WooCommerce Gutenberg Products Block - Version 5.2.0

Version Description

  • 2021-05-25 =

Enhancements

  • Added a key prop to each CartTotalItem within usePaymentMethodInterface. (4240)
  • Hide legacy widgets with a feature-complete block equivalent from the widget area block inserter. (4237)
  • Hide the All Products Block from the Customizer Widget Areas until full support is achieved. (4225)
  • Sync customer data during checkout with draft orders. (4197)
  • Update the display of the sidebar/order summary in the Cart and Checkout blocks. (4180)
  • Improved accessibility and styling of the controls of several of ours blocks. (4100)

Bug Fixes

  • Hide tax breakdown if the total amount of tax to be paid is 0. (4262)
  • Prevent Coupon code panel from appearing in stores were coupons are disabled. (4202)
  • For payment methods, only use canMakePayment in the frontend (not the editor) context. (4188)
  • Fix duplicate react keys in ProductDetails component. (4187)
  • Fix sending of confirmation emails for orders when no payment is needed. (4186)
  • Stopped a warning being shown when using WooCommerce Force Sells and adding a product with a Synced Force Sell to the cart. (4182)

Various

  • Move Button and Label components to @woocommerce/blocks-checkout package. (4222)
  • Add couponName filter to allow extensions to modify how coupons are displayed in the Cart and Checkout summary. (4166)
Download this release

Release Info

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

Code changes from version 5.1.0 to 5.2.0

Files changed (132) hide show
  1. LICENSE +674 -0
  2. assets/css/abstracts/_colors.scss +1 -0
  3. assets/css/editor.scss +11 -5
  4. assets/js/atomic/blocks/product-elements/add-to-cart/shared/add-to-cart-button.js +1 -1
  5. assets/js/atomic/blocks/product-elements/sale-badge/block.js +1 -1
  6. assets/js/base/components/cart-checkout/order-summary/order-summary-item.js +9 -2
  7. assets/js/base/components/cart-checkout/place-order-button/index.js +1 -1
  8. assets/js/base/components/cart-checkout/product-details/index.tsx +1 -1
  9. assets/js/base/components/cart-checkout/product-summary/index.tsx +0 -1
  10. assets/js/base/components/cart-checkout/shipping-calculator/address.tsx +1 -1
  11. assets/js/base/components/cart-checkout/shipping-rates-control-package/index.tsx +3 -8
  12. assets/js/base/components/cart-checkout/shipping-rates-control-package/style.scss +0 -6
  13. assets/js/base/components/cart-checkout/totals/coupon/index.js +3 -5
  14. assets/js/base/components/cart-checkout/totals/discount/index.js +47 -29
  15. assets/js/base/components/cart-checkout/totals/discount/style.scss +4 -0
  16. assets/js/base/components/cart-checkout/totals/footer-item/index.js +16 -8
  17. assets/js/base/components/cart-checkout/totals/footer-item/test/__snapshots__/index.js.snap +79 -0
  18. assets/js/base/components/cart-checkout/totals/footer-item/test/index.js +81 -0
  19. assets/js/base/components/cart-checkout/totals/shipping/index.tsx +21 -5
  20. assets/js/base/components/cart-checkout/totals/shipping/shipping-via.tsx +17 -0
  21. assets/js/base/components/cart-checkout/totals/shipping/style.scss +4 -0
  22. assets/js/base/components/filter-submit-button/index.js +1 -1
  23. assets/js/base/components/load-more-button/index.js +1 -1
  24. assets/js/base/components/pagination/index.js +1 -1
  25. assets/js/base/components/price-slider/index.js +6 -2
  26. assets/js/base/components/quantity-selector/index.tsx +1 -1
  27. assets/js/base/components/sidebar-layout/style.scss +7 -0
  28. assets/js/base/components/sort-select/index.js +1 -1
  29. assets/js/base/components/text-input/{index.js → index.ts} +0 -0
  30. assets/js/base/components/text-input/{text-input.js → text-input.tsx} +25 -22
  31. assets/js/base/components/text-input/{validated-text-input.js → validated-text-input.tsx} +45 -27
  32. assets/js/base/context/hooks/cart/use-store-cart-item-quantity.ts +8 -7
  33. assets/js/base/context/hooks/payment-methods/test/use-payment-method-interface.js +6 -1
  34. assets/js/base/context/hooks/payment-methods/{use-payment-method-interface.js → use-payment-method-interface.ts} +35 -91
  35. assets/js/base/context/hooks/payment-methods/utils.ts +85 -0
  36. assets/js/base/context/hooks/use-customer-data.ts +24 -7
  37. assets/js/base/context/hooks/use-emit-response.js +0 -59
  38. assets/js/base/context/hooks/use-emit-response.ts +66 -0
  39. assets/js/base/context/{index.js → index.ts} +0 -0
  40. assets/js/base/context/providers/cart-checkout/checkout-state/actions.js +0 -82
  41. assets/js/base/context/providers/cart-checkout/checkout-state/actions.ts +110 -0
  42. assets/js/base/context/providers/cart-checkout/checkout-state/constants.js +0 -53
  43. assets/js/base/context/providers/cart-checkout/checkout-state/constants.ts +84 -0
  44. assets/js/base/context/providers/cart-checkout/checkout-state/event-emit.js +0 -48
  45. assets/js/base/context/providers/cart-checkout/checkout-state/event-emit.ts +62 -0
  46. assets/js/base/context/providers/cart-checkout/checkout-state/{index.js → index.tsx} +76 -124
  47. assets/js/base/context/providers/cart-checkout/checkout-state/reducer.js +0 -235
  48. assets/js/base/context/providers/cart-checkout/checkout-state/reducer.ts +197 -0
  49. assets/js/base/context/providers/cart-checkout/checkout-state/types.ts +103 -0
  50. assets/js/base/context/providers/cart-checkout/checkout-state/utils.ts +63 -0
  51. assets/js/base/context/providers/cart-checkout/payment-methods/use-payment-method-registration.ts +8 -4
  52. assets/js/base/utils/{address.js → address.ts} +44 -6
  53. assets/js/base/utils/index.js +0 -1
  54. assets/js/blocks/active-filters/block.js +1 -1
  55. assets/js/blocks/active-filters/utils.js +1 -1
  56. assets/js/blocks/attribute-filter/edit.js +8 -8
  57. assets/js/blocks/attribute-filter/label.js +1 -1
  58. assets/js/blocks/cart-checkout/cart/attributes.js +4 -0
  59. assets/js/blocks/cart-checkout/cart/checkout-button/index.js +7 -9
  60. assets/js/blocks/cart-checkout/cart/edit.js +25 -0
  61. assets/js/blocks/cart-checkout/cart/full-cart/cart-line-item-row.tsx +9 -2
  62. assets/js/blocks/cart-checkout/cart/full-cart/index.tsx +14 -7
  63. assets/js/blocks/cart-checkout/cart/full-cart/style.scss +16 -5
  64. assets/js/blocks/cart-checkout/cart/test/__snapshots__/block.js.snap +2084 -0
  65. assets/js/blocks/cart-checkout/cart/test/block.js +54 -0
  66. assets/js/blocks/cart-checkout/checkout/attributes.js +4 -0
  67. assets/js/blocks/cart-checkout/checkout/block.js +1 -0
  68. assets/js/blocks/cart-checkout/checkout/edit.js +25 -0
  69. assets/js/blocks/cart-checkout/checkout/sidebar/index.js +11 -7
  70. assets/js/blocks/cart-checkout/checkout/sidebar/test/__snapshots__/index.js.snap +142 -0
  71. assets/js/blocks/cart-checkout/checkout/sidebar/test/index.js +29 -0
  72. assets/js/blocks/cart-checkout/checkout/style.scss +6 -0
  73. assets/js/blocks/cart-checkout/payment-methods/payment-methods.js +1 -1
  74. assets/js/blocks/handpicked-products/block.js +1 -0
  75. assets/js/blocks/product-category/block.js +1 -0
  76. assets/js/blocks/product-tag/block.js +1 -0
  77. assets/js/blocks/products-by-attribute/block.js +1 -0
  78. assets/js/blocks/reviews/reviews-by-category/edit.js +10 -9
  79. assets/js/blocks/reviews/reviews-by-product/edit.js +3 -3
  80. assets/js/data/cart/actions.ts +4 -2
  81. assets/js/editor-components/expandable-search-list-item/expandable-search-list-item.tsx +60 -0
  82. assets/js/editor-components/product-attribute-term-control/index.js +72 -41
  83. assets/js/editor-components/product-attribute-term-control/style.scss +1 -12
  84. assets/js/editor-components/product-category-control/index.js +20 -15
  85. assets/js/editor-components/product-category-control/style.scss +0 -11
  86. assets/js/editor-components/product-control/index.js +64 -95
  87. assets/js/editor-components/product-control/style.scss +1 -1
  88. assets/js/editor-components/product-tag-control/index.js +23 -12
  89. assets/js/editor-components/product-tag-control/style.scss +0 -11
  90. assets/js/editor-components/products-control/index.js +5 -0
  91. assets/js/hocs/test/with-categories.js +1 -1
  92. assets/js/hocs/with-categories.js +2 -2
  93. assets/js/icons/stories/index.js +7 -6
  94. assets/js/previews/cart.ts +27 -20
  95. assets/js/settings/shared/settings-init.ts +6 -1
  96. assets/js/settings/shared/test/get-setting.js +3 -0
  97. assets/js/settings/shared/utils.ts +5 -3
  98. assets/js/type-defs/checkout.js +0 -26
  99. assets/js/types/index.ts +2 -0
  100. assets/js/{type-defs → types/type-defs}/add-to-cart-form.js +0 -0
  101. assets/js/{type-defs → types/type-defs}/address-fields.js +0 -0
  102. assets/js/{type-defs → types/type-defs}/billing.js +0 -0
  103. assets/js/{type-defs → types/type-defs}/cart-response.ts +10 -18
  104. assets/js/{type-defs → types/type-defs}/cart.js +0 -0
  105. assets/js/{type-defs → types/type-defs}/cart.ts +1 -0
  106. assets/js/{type-defs → types/type-defs}/contexts.js +4 -4
  107. assets/js/types/type-defs/currency.ts +22 -0
  108. assets/js/{type-defs → types/type-defs}/hooks.js +0 -0
  109. assets/js/{type-defs → types/type-defs}/hooks.ts +1 -1
  110. assets/js/{type-defs → types/type-defs}/index.ts +1 -0
  111. assets/js/{type-defs → types/type-defs}/payments.js +0 -0
  112. assets/js/{type-defs → types/type-defs}/product-response.ts +6 -10
  113. assets/js/{type-defs → types/type-defs}/registered-payment-method-props.js +0 -0
  114. assets/js/{type-defs → types/type-defs}/settings.js +0 -0
  115. assets/js/{type-defs → types/type-defs}/shipping.js +0 -0
  116. assets/js/{type-defs → types/type-defs}/shipping.ts +0 -0
  117. assets/js/{base/utils/type-guards.ts → types/type-guards/index.ts} +2 -2
  118. assets/js/utils/attributes-query.js +2 -2
  119. build/active-filters-frontend.asset.php +1 -1
  120. build/active-filters-frontend.js +2 -2
  121. build/active-filters.asset.php +1 -1
  122. build/active-filters.js +1 -1
  123. build/all-products-frontend.asset.php +1 -1
  124. build/all-products-frontend.js +2 -2
  125. build/all-products.asset.php +1 -1
  126. build/all-products.js +1 -1
  127. build/all-reviews.asset.php +1 -1
  128. build/all-reviews.js +1 -1
  129. build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b.js +1 -1
  130. build/atomic-block-components/add-to-cart--atomic-block-components/button.js +1 -1
  131. build/atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title.js +1 -1
  132. build/atomic-block-components/add-to-cart-frontend.js +1 -1
LICENSE ADDED
@@ -0,0 +1,674 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ <one line to give the program's name and a brief idea of what it does.>
635
+ Copyright (C) <year> <name of author>
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ <program> Copyright (C) <year> <name of author>
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <https://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
+ <https://www.gnu.org/licenses/why-not-lgpl.html>.
assets/css/abstracts/_colors.scss CHANGED
@@ -5,6 +5,7 @@
5
  $no-stock-color: $alert-red;
6
  $low-stock-color: $alert-yellow;
7
  $in-stock-color: $alert-green;
 
8
 
9
  $placeholder-color: var(--global--color-primary, $gray-200);
10
  $input-border-gray: #50575e;
5
  $no-stock-color: $alert-red;
6
  $low-stock-color: $alert-yellow;
7
  $in-stock-color: $alert-green;
8
+ $discount-color: $alert-green;
9
 
10
  $placeholder-color: var(--global--color-primary, $gray-200);
11
  $input-border-gray: #50575e;
assets/css/editor.scss CHANGED
@@ -48,9 +48,15 @@
48
  }
49
  }
50
 
51
- // This border has been upstreamed to WooCommerce Admin, so it can be removed
52
- // from here once @woocommerce/components gets updated.
53
- // https://github.com/woocommerce/woocommerce-admin/pull/5901
54
- .woocommerce-search-list__list {
55
- border: 1px solid $gray-200;
 
 
 
 
 
 
56
  }
48
  }
49
  }
50
 
51
+ // Selectors with extra specificity to override some editor styles.
52
+ .woocommerce-search-list__list.woocommerce-search-list__list {
53
+ box-sizing: border-box;
54
+ margin: 0;
55
+ padding: 0;
56
+ }
57
+
58
+ .woocommerce-search-list__selected.woocommerce-search-list__selected > ul {
59
+ list-style: none;
60
+ margin: 0;
61
+ padding: 0;
62
  }
assets/js/atomic/blocks/product-elements/add-to-cart/shared/add-to-cart-button.js CHANGED
@@ -2,7 +2,7 @@
2
  * External dependencies
3
  */
4
  import { __, _n, sprintf } from '@wordpress/i18n';
5
- import Button from '@woocommerce/base-components/button';
6
  import { Icon, done as doneIcon } from '@woocommerce/icons';
7
  import { useState, useEffect } from '@wordpress/element';
8
  import { useAddToCartFormContext } from '@woocommerce/base-context';
2
  * External dependencies
3
  */
4
  import { __, _n, sprintf } from '@wordpress/i18n';
5
+ import { Button } from '@woocommerce/blocks-checkout';
6
  import { Icon, done as doneIcon } from '@woocommerce/icons';
7
  import { useState, useEffect } from '@wordpress/element';
8
  import { useAddToCartFormContext } from '@woocommerce/base-context';
assets/js/atomic/blocks/product-elements/sale-badge/block.js CHANGED
@@ -4,7 +4,7 @@
4
  import PropTypes from 'prop-types';
5
  import { __ } from '@wordpress/i18n';
6
  import classnames from 'classnames';
7
- import Label from '@woocommerce/base-components/label';
8
  import {
9
  useInnerBlockLayoutContext,
10
  useProductDataContext,
4
  import PropTypes from 'prop-types';
5
  import { __ } from '@wordpress/i18n';
6
  import classnames from 'classnames';
7
+ import { Label } from '@woocommerce/blocks-checkout';
8
  import {
9
  useInnerBlockLayoutContext,
10
  useProductDataContext,
assets/js/base/components/cart-checkout/order-summary/order-summary-item.js CHANGED
@@ -2,7 +2,6 @@
2
  * External dependencies
3
  */
4
  import { __, sprintf } from '@wordpress/i18n';
5
- import Label from '@woocommerce/base-components/label';
6
  import ProductPrice from '@woocommerce/base-components/product-price';
7
  import ProductName from '@woocommerce/base-components/product-name';
8
  import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
@@ -10,11 +9,13 @@ import {
10
  __experimentalApplyCheckoutFilter,
11
  mustBeString,
12
  mustContain,
 
13
  } from '@woocommerce/blocks-checkout';
14
  import PropTypes from 'prop-types';
15
  import Dinero from 'dinero.js';
16
  import { getSetting } from '@woocommerce/settings';
17
  import { useCallback, useMemo } from '@wordpress/element';
 
18
 
19
  /**
20
  * Internal dependencies
@@ -41,6 +42,11 @@ const OrderSummaryItem = ( { cartItem } ) => {
41
  extensions = {},
42
  } = cartItem;
43
 
 
 
 
 
 
44
  const productPriceValidation = useCallback(
45
  ( value ) => mustBeString( value ) && mustContain( value, '<price/>' ),
46
  []
@@ -50,8 +56,9 @@ const OrderSummaryItem = ( { cartItem } ) => {
50
  () => ( {
51
  context: 'summary',
52
  cartItem,
 
53
  } ),
54
- [ cartItem ]
55
  );
56
 
57
  const priceCurrency = getCurrencyFromPriceResponse( prices );
2
  * External dependencies
3
  */
4
  import { __, sprintf } from '@wordpress/i18n';
 
5
  import ProductPrice from '@woocommerce/base-components/product-price';
6
  import ProductName from '@woocommerce/base-components/product-name';
7
  import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
9
  __experimentalApplyCheckoutFilter,
10
  mustBeString,
11
  mustContain,
12
+ Label,
13
  } from '@woocommerce/blocks-checkout';
14
  import PropTypes from 'prop-types';
15
  import Dinero from 'dinero.js';
16
  import { getSetting } from '@woocommerce/settings';
17
  import { useCallback, useMemo } from '@wordpress/element';
18
+ import { useStoreCart } from '@woocommerce/base-context/hooks';
19
 
20
  /**
21
  * Internal dependencies
42
  extensions = {},
43
  } = cartItem;
44
 
45
+ // Prepare props to pass to the __experimentalApplyCheckoutFilter filter.
46
+ // We need to pluck out receiveCart.
47
+ // eslint-disable-next-line no-unused-vars
48
+ const { receiveCart, ...cart } = useStoreCart();
49
+
50
  const productPriceValidation = useCallback(
51
  ( value ) => mustBeString( value ) && mustContain( value, '<price/>' ),
52
  []
56
  () => ( {
57
  context: 'summary',
58
  cartItem,
59
+ cart,
60
  } ),
61
+ [ cartItem, cart ]
62
  );
63
 
64
  const priceCurrency = getCurrencyFromPriceResponse( prices );
assets/js/base/components/cart-checkout/place-order-button/index.js CHANGED
@@ -4,7 +4,7 @@
4
  import { __ } from '@wordpress/i18n';
5
  import { useCheckoutSubmit } from '@woocommerce/base-context/hooks';
6
  import { Icon, done } from '@woocommerce/icons';
7
- import Button from '@woocommerce/base-components/button';
8
 
9
  const PlaceOrderButton = () => {
10
  const {
4
  import { __ } from '@wordpress/i18n';
5
  import { useCheckoutSubmit } from '@woocommerce/base-context/hooks';
6
  import { Icon, done } from '@woocommerce/icons';
7
+ import { Button } from '@woocommerce/blocks-checkout';
8
 
9
  const PlaceOrderButton = () => {
10
  const {
assets/js/base/components/cart-checkout/product-details/index.tsx CHANGED
@@ -37,7 +37,7 @@ const ProductDetails = ( {
37
  : '';
38
  return (
39
  <li
40
- key={ detail.name + ( detail.display || detail.name ) }
41
  className={ className }
42
  >
43
  { detail.name && (
37
  : '';
38
  return (
39
  <li
40
+ key={ detail.name + ( detail.display || detail.value ) }
41
  className={ className }
42
  >
43
  { detail.name && (
assets/js/base/components/cart-checkout/product-summary/index.tsx CHANGED
@@ -1,7 +1,6 @@
1
  /**
2
  * External dependencies
3
  */
4
- import PropTypes from 'prop-types';
5
  import Summary from '@woocommerce/base-components/summary';
6
  import { blocksConfig } from '@woocommerce/block-settings';
7
 
1
  /**
2
  * External dependencies
3
  */
 
4
  import Summary from '@woocommerce/base-components/summary';
5
  import { blocksConfig } from '@woocommerce/block-settings';
6
 
assets/js/base/components/cart-checkout/shipping-calculator/address.tsx CHANGED
@@ -2,7 +2,7 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import Button from '@woocommerce/base-components/button';
6
  import { useState } from '@wordpress/element';
7
  import isShallowEqual from '@wordpress/is-shallow-equal';
8
  import { useValidationContext } from '@woocommerce/base-context';
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { Button } from '@woocommerce/blocks-checkout';
6
  import { useState } from '@wordpress/element';
7
  import isShallowEqual from '@wordpress/is-shallow-equal';
8
  import { useValidationContext } from '@woocommerce/base-context';
assets/js/base/components/cart-checkout/shipping-rates-control-package/index.tsx CHANGED
@@ -4,11 +4,9 @@
4
  import classNames from 'classnames';
5
  import { _n, sprintf } from '@wordpress/i18n';
6
  import { decodeEntities } from '@wordpress/html-entities';
7
- import Label from '@woocommerce/base-components/label';
8
- import Title from '@woocommerce/base-components/title';
9
  import type { ReactElement } from 'react';
10
  import type { PackageRateOption } from '@woocommerce/type-defs/shipping';
11
- import { Panel } from '@woocommerce/blocks-checkout';
12
  import { useSelectShippingRate } from '@woocommerce/base-context/hooks';
13
  import type { CartShippingPackageShippingRate } from '@woocommerce/type-defs/cart';
14
 
@@ -77,12 +75,9 @@ export const ShippingRatesControlPackage = ( {
77
  const header = (
78
  <>
79
  { ( showItems || collapsible ) && (
80
- <Title
81
- className="wc-block-components-shipping-rates-control__package-title"
82
- headingLevel="3"
83
- >
84
  { packageData.name }
85
- </Title>
86
  ) }
87
  { showItems && (
88
  <ul className="wc-block-components-shipping-rates-control__package-items">
4
  import classNames from 'classnames';
5
  import { _n, sprintf } from '@wordpress/i18n';
6
  import { decodeEntities } from '@wordpress/html-entities';
 
 
7
  import type { ReactElement } from 'react';
8
  import type { PackageRateOption } from '@woocommerce/type-defs/shipping';
9
+ import { Panel, Label } from '@woocommerce/blocks-checkout';
10
  import { useSelectShippingRate } from '@woocommerce/base-context/hooks';
11
  import type { CartShippingPackageShippingRate } from '@woocommerce/type-defs/cart';
12
 
75
  const header = (
76
  <>
77
  { ( showItems || collapsible ) && (
78
+ <div className="wc-block-components-shipping-rates-control__package-title">
 
 
 
79
  { packageData.name }
80
+ </div>
81
  ) }
82
  { showItems && (
83
  <ul className="wc-block-components-shipping-rates-control__package-items">
assets/js/base/components/cart-checkout/shipping-rates-control-package/style.scss CHANGED
@@ -6,12 +6,6 @@
6
  padding-top: em($gap-small);
7
  }
8
 
9
- .wc-block-components-shipping-rates-control__package-title {
10
- @include text-heading();
11
- font-weight: bold;
12
- margin: 0;
13
- }
14
-
15
  // Remove panel padding because we are adding bottom padding to `.wc-block-components-radio-control`
16
  // and `.wc-block-components-radio-control__option-layout` in the next ruleset.
17
  .wc-block-components-panel__content {
6
  padding-top: em($gap-small);
7
  }
8
 
 
 
 
 
 
 
9
  // Remove panel padding because we are adding bottom padding to `.wc-block-components-radio-control`
10
  // and `.wc-block-components-radio-control__option-layout` in the next ruleset.
11
  .wc-block-components-panel__content {
assets/js/base/components/cart-checkout/totals/coupon/index.js CHANGED
@@ -3,9 +3,8 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { useState, useEffect, useRef } from '@wordpress/element';
6
- import Button from '@woocommerce/base-components/button';
7
  import { ValidatedTextInput } from '@woocommerce/base-components/text-input';
8
- import Label from '@woocommerce/base-components/label';
9
  import LoadingMask from '@woocommerce/base-components/loading-mask';
10
  import PropTypes from 'prop-types';
11
  import { withInstanceId } from '@woocommerce/base-hocs/with-instance-id';
@@ -13,7 +12,6 @@ import {
13
  ValidationInputError,
14
  useValidationContext,
15
  } from '@woocommerce/base-context';
16
- import { Panel } from '@woocommerce/blocks-checkout';
17
 
18
  /**
19
  * Internal dependencies
@@ -51,11 +49,11 @@ const TotalsCoupon = ( {
51
  title={
52
  <Label
53
  label={ __(
54
- 'Coupon Code?',
55
  'woo-gutenberg-products-block'
56
  ) }
57
  screenReaderLabel={ __(
58
- 'Introduce Coupon Code',
59
  'woo-gutenberg-products-block'
60
  ) }
61
  htmlFor={ textInputId }
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { useState, useEffect, useRef } from '@wordpress/element';
6
+ import { Button, Panel, Label } from '@woocommerce/blocks-checkout';
7
  import { ValidatedTextInput } from '@woocommerce/base-components/text-input';
 
8
  import LoadingMask from '@woocommerce/base-components/loading-mask';
9
  import PropTypes from 'prop-types';
10
  import { withInstanceId } from '@woocommerce/base-hocs/with-instance-id';
12
  ValidationInputError,
13
  useValidationContext,
14
  } from '@woocommerce/base-context';
 
15
 
16
  /**
17
  * Internal dependencies
49
  title={
50
  <Label
51
  label={ __(
52
+ 'Coupon code',
53
  'woo-gutenberg-products-block'
54
  ) }
55
  screenReaderLabel={ __(
56
+ 'Apply a coupon code',
57
  'woo-gutenberg-products-block'
58
  ) }
59
  htmlFor={ textInputId }
assets/js/base/components/cart-checkout/totals/discount/index.js CHANGED
@@ -5,7 +5,11 @@ import { __, sprintf } from '@wordpress/i18n';
5
  import LoadingMask from '@woocommerce/base-components/loading-mask';
6
  import { RemovableChip } from '@woocommerce/base-components/chip';
7
  import PropTypes from 'prop-types';
8
- import { TotalsItem } from '@woocommerce/blocks-checkout';
 
 
 
 
9
  import { getSetting } from '@woocommerce/settings';
10
 
11
  /**
@@ -53,34 +57,48 @@ const TotalsDiscount = ( {
53
  showSpinner={ false }
54
  >
55
  <ul className="wc-block-components-totals-discount__coupon-list">
56
- { cartCoupons.map( ( cartCoupon ) => (
57
- <RemovableChip
58
- key={ 'coupon-' + cartCoupon.code }
59
- className="wc-block-components-totals-discount__coupon-list-item"
60
- text={ cartCoupon.code }
61
- screenReaderText={ sprintf(
62
- /* translators: %s Coupon code. */
63
- __(
64
- 'Coupon: %s',
65
- 'woo-gutenberg-products-block'
66
- ),
67
- cartCoupon.code
68
- ) }
69
- disabled={ isRemovingCoupon }
70
- onRemove={ () => {
71
- removeCoupon( cartCoupon.code );
72
- } }
73
- radius="large"
74
- ariaLabel={ sprintf(
75
- /* translators: %s is a coupon code. */
76
- __(
77
- 'Remove coupon "%s"',
78
- 'woo-gutenberg-products-block'
79
- ),
80
- cartCoupon.code
81
- ) }
82
- />
83
- ) ) }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  </ul>
85
  </LoadingMask>
86
  )
5
  import LoadingMask from '@woocommerce/base-components/loading-mask';
6
  import { RemovableChip } from '@woocommerce/base-components/chip';
7
  import PropTypes from 'prop-types';
8
+ import {
9
+ __experimentalApplyCheckoutFilter,
10
+ mustBeString,
11
+ TotalsItem,
12
+ } from '@woocommerce/blocks-checkout';
13
  import { getSetting } from '@woocommerce/settings';
14
 
15
  /**
57
  showSpinner={ false }
58
  >
59
  <ul className="wc-block-components-totals-discount__coupon-list">
60
+ { cartCoupons.map( ( cartCoupon ) => {
61
+ const filteredCouponCode = __experimentalApplyCheckoutFilter(
62
+ {
63
+ validation: mustBeString,
64
+ arg: {
65
+ context: 'summary',
66
+ coupon: cartCoupon,
67
+ },
68
+ filterName: 'couponName',
69
+ defaultValue: cartCoupon.code,
70
+ }
71
+ );
72
+
73
+ return (
74
+ <RemovableChip
75
+ key={ 'coupon-' + cartCoupon.code }
76
+ className="wc-block-components-totals-discount__coupon-list-item"
77
+ text={ filteredCouponCode }
78
+ screenReaderText={ sprintf(
79
+ /* translators: %s Coupon code. */
80
+ __(
81
+ 'Coupon: %s',
82
+ 'woo-gutenberg-products-block'
83
+ ),
84
+ filteredCouponCode
85
+ ) }
86
+ disabled={ isRemovingCoupon }
87
+ onRemove={ () => {
88
+ removeCoupon( cartCoupon.code );
89
+ } }
90
+ radius="large"
91
+ ariaLabel={ sprintf(
92
+ /* translators: %s is a coupon code. */
93
+ __(
94
+ 'Remove coupon "%s"',
95
+ 'woo-gutenberg-products-block'
96
+ ),
97
+ filteredCouponCode
98
+ ) }
99
+ />
100
+ );
101
+ } ) }
102
  </ul>
103
  </LoadingMask>
104
  )
assets/js/base/components/cart-checkout/totals/discount/style.scss CHANGED
@@ -3,3 +3,7 @@
3
  margin: 0;
4
  padding: 0;
5
  }
 
 
 
 
3
  margin: 0;
4
  padding: 0;
5
  }
6
+
7
+ .wc-block-components-totals-discount .wc-block-components-totals-item__value {
8
+ color: $discount-color;
9
+ }
assets/js/base/components/cart-checkout/totals/footer-item/index.js CHANGED
@@ -18,21 +18,28 @@ import { getSetting } from '@woocommerce/settings';
18
  */
19
  import './style.scss';
20
 
21
- const SHOW_TAXES =
22
- getSetting( 'taxesEnabled', true ) &&
23
- getSetting( 'displayCartPricesIncludingTax', false );
24
-
25
  const TotalsFooterItem = ( { currency, values } ) => {
 
 
 
 
26
  const { total_price: totalPrice, total_tax: totalTax } = values;
27
- const { extensions } = useStoreCart();
 
 
 
 
28
  const label = __experimentalApplyCheckoutFilter( {
29
  filterName: 'totalLabel',
30
  defaultValue: __( 'Total', 'woo-gutenberg-products-block' ),
31
- extensions,
 
32
  // Only accept strings.
33
  validation: mustBeString,
34
  } );
35
 
 
 
36
  return (
37
  <TotalsItem
38
  className="wc-block-components-totals-footer-item"
@@ -40,7 +47,8 @@ const TotalsFooterItem = ( { currency, values } ) => {
40
  label={ label }
41
  value={ parseInt( totalPrice, 10 ) }
42
  description={
43
- SHOW_TAXES && (
 
44
  <p className="wc-block-components-totals-footer-item-tax">
45
  { createInterpolateElement(
46
  __(
@@ -52,7 +60,7 @@ const TotalsFooterItem = ( { currency, values } ) => {
52
  <FormattedMonetaryAmount
53
  className="wc-block-components-totals-footer-item-tax-value"
54
  currency={ currency }
55
- value={ parseInt( totalTax, 10 ) }
56
  />
57
  ),
58
  }
18
  */
19
  import './style.scss';
20
 
 
 
 
 
21
  const TotalsFooterItem = ( { currency, values } ) => {
22
+ const SHOW_TAXES =
23
+ getSetting( 'taxesEnabled', true ) &&
24
+ getSetting( 'displayCartPricesIncludingTax', false );
25
+
26
  const { total_price: totalPrice, total_tax: totalTax } = values;
27
+
28
+ // Prepare props to pass to the __experimentalApplyCheckoutFilter filter.
29
+ // We need to pluck out receiveCart.
30
+ // eslint-disable-next-line no-unused-vars
31
+ const { receiveCart, ...cart } = useStoreCart();
32
  const label = __experimentalApplyCheckoutFilter( {
33
  filterName: 'totalLabel',
34
  defaultValue: __( 'Total', 'woo-gutenberg-products-block' ),
35
+ extensions: cart.extensions,
36
+ arg: { cart },
37
  // Only accept strings.
38
  validation: mustBeString,
39
  } );
40
 
41
+ const parsedTaxValue = parseInt( totalTax, 10 );
42
+
43
  return (
44
  <TotalsItem
45
  className="wc-block-components-totals-footer-item"
47
  label={ label }
48
  value={ parseInt( totalPrice, 10 ) }
49
  description={
50
+ SHOW_TAXES &&
51
+ parsedTaxValue !== 0 && (
52
  <p className="wc-block-components-totals-footer-item-tax">
53
  { createInterpolateElement(
54
  __(
60
  <FormattedMonetaryAmount
61
  className="wc-block-components-totals-footer-item-tax-value"
62
  currency={ currency }
63
+ value={ parsedTaxValue }
64
  />
65
  ),
66
  }
assets/js/base/components/cart-checkout/totals/footer-item/test/__snapshots__/index.js.snap ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`TotalsFooterItem Does not show the "including %s of tax" line if tax is 0 1`] = `
4
+ <div>
5
+ <div
6
+ class="wc-block-components-totals-item wc-block-components-totals-footer-item"
7
+ >
8
+ <span
9
+ class="wc-block-components-totals-item__label"
10
+ >
11
+ Total
12
+ </span>
13
+ <span
14
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
15
+ >
16
+ £85.00
17
+ </span>
18
+ <div
19
+ class="wc-block-components-totals-item__description"
20
+ />
21
+ </div>
22
+ </div>
23
+ `;
24
+
25
+ exports[`TotalsFooterItem Does not show the "including %s of tax" line if tax is disabled 1`] = `
26
+ <div>
27
+ <div
28
+ class="wc-block-components-totals-item wc-block-components-totals-footer-item"
29
+ >
30
+ <span
31
+ class="wc-block-components-totals-item__label"
32
+ >
33
+ Total
34
+ </span>
35
+ <span
36
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
37
+ >
38
+ £85.00
39
+ </span>
40
+ <div
41
+ class="wc-block-components-totals-item__description"
42
+ />
43
+ </div>
44
+ </div>
45
+ `;
46
+
47
+ exports[`TotalsFooterItem Shows the "including %s of tax" line if tax is greater than 0 1`] = `
48
+ <div>
49
+ <div
50
+ class="wc-block-components-totals-item wc-block-components-totals-footer-item"
51
+ >
52
+ <span
53
+ class="wc-block-components-totals-item__label"
54
+ >
55
+ Total
56
+ </span>
57
+ <span
58
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
59
+ >
60
+ £85.00
61
+ </span>
62
+ <div
63
+ class="wc-block-components-totals-item__description"
64
+ >
65
+ <p
66
+ class="wc-block-components-totals-footer-item-tax"
67
+ >
68
+ Including
69
+ <span
70
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-footer-item-tax-value"
71
+ >
72
+ £1.00
73
+ </span>
74
+ in taxes
75
+ </p>
76
+ </div>
77
+ </div>
78
+ </div>
79
+ `;
assets/js/base/components/cart-checkout/totals/footer-item/test/index.js ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { render } from '@testing-library/react';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import TotalsFooterItem from '../index';
10
+ import { allSettings } from '../../../../../../settings/shared/settings-init';
11
+
12
+ describe( 'TotalsFooterItem', () => {
13
+ beforeEach( () => {
14
+ allSettings.taxesEnabled = true;
15
+ allSettings.displayCartPricesIncludingTax = true;
16
+ } );
17
+ const currency = {
18
+ code: 'GBP',
19
+ decimalSeparator: '.',
20
+ minorUnit: 2,
21
+ prefix: '£',
22
+ suffix: '',
23
+ symbol: '£',
24
+ thousandSeparator: ',',
25
+ };
26
+
27
+ const values = {
28
+ currency_code: 'GBP',
29
+ currency_decimal_separator: '.',
30
+ currency_minor_unit: 2,
31
+ currency_prefix: '£',
32
+ currency_suffix: '',
33
+ currency_symbol: '£',
34
+ currency_thousand_separator: ',',
35
+ tax_lines: [],
36
+ length: 2,
37
+ total_discount: '0',
38
+ total_discount_tax: '0',
39
+ total_fees: '0',
40
+ total_fees_tax: '0',
41
+ total_items: '7100',
42
+ total_items_tax: '0',
43
+ total_price: '8500',
44
+ total_shipping: '0',
45
+ total_shipping_tax: '0',
46
+ total_tax: '0',
47
+ };
48
+
49
+ it( 'Does not show the "including %s of tax" line if tax is 0', () => {
50
+ const { container } = render(
51
+ <TotalsFooterItem currency={ currency } values={ values } />
52
+ );
53
+ expect( container ).toMatchSnapshot();
54
+ } );
55
+
56
+ it( 'Does not show the "including %s of tax" line if tax is disabled', () => {
57
+ allSettings.taxesEnabled = false;
58
+ /* This shouldn't ever happen if taxes are disabled, but this is to test whether the taxesEnabled setting works */
59
+ const valuesWithTax = {
60
+ ...values,
61
+ total_tax: '100',
62
+ total_items_tax: '100',
63
+ };
64
+ const { container } = render(
65
+ <TotalsFooterItem currency={ currency } values={ valuesWithTax } />
66
+ );
67
+ expect( container ).toMatchSnapshot();
68
+ } );
69
+
70
+ it( 'Shows the "including %s of tax" line if tax is greater than 0', () => {
71
+ const valuesWithTax = {
72
+ ...values,
73
+ total_tax: '100',
74
+ total_items_tax: '100',
75
+ };
76
+ const { container } = render(
77
+ <TotalsFooterItem currency={ currency } values={ valuesWithTax } />
78
+ );
79
+ expect( container ).toMatchSnapshot();
80
+ } );
81
+ } );
assets/js/base/components/cart-checkout/totals/shipping/index.tsx CHANGED
@@ -9,6 +9,7 @@ import { TotalsItem } from '@woocommerce/blocks-checkout';
9
  import type { Currency } from '@woocommerce/price-format';
10
  import type { ReactElement } from 'react';
11
  import { getSetting, EnteredAddress } from '@woocommerce/settings';
 
12
 
13
  /**
14
  * Internal dependencies
@@ -146,6 +147,14 @@ const TotalsShipping = ( {
146
  setIsShippingCalculatorOpen,
147
  };
148
 
 
 
 
 
 
 
 
 
149
  return (
150
  <div
151
  className={ classnames(
@@ -168,11 +177,18 @@ const TotalsShipping = ( {
168
  description={
169
  <>
170
  { cartHasCalculatedShipping && (
171
- <ShippingAddress
172
- shippingAddress={ shippingAddress }
173
- showCalculator={ showCalculator }
174
- { ...calculatorButtonProps }
175
- />
 
 
 
 
 
 
 
176
  ) }
177
  </>
178
  }
9
  import type { Currency } from '@woocommerce/price-format';
10
  import type { ReactElement } from 'react';
11
  import { getSetting, EnteredAddress } from '@woocommerce/settings';
12
+ import { ShippingVia } from '@woocommerce/base-components/cart-checkout/totals/shipping/shipping-via';
13
 
14
  /**
15
  * Internal dependencies
147
  setIsShippingCalculatorOpen,
148
  };
149
 
150
+ const selectedShippingRates = shippingRates.flatMap(
151
+ ( shippingPackage ) => {
152
+ return shippingPackage.shipping_rates
153
+ .filter( ( rate ) => rate.selected )
154
+ .flatMap( ( rate ) => rate.name );
155
+ }
156
+ );
157
+
158
  return (
159
  <div
160
  className={ classnames(
177
  description={
178
  <>
179
  { cartHasCalculatedShipping && (
180
+ <>
181
+ <ShippingVia
182
+ selectedShippingRates={
183
+ selectedShippingRates
184
+ }
185
+ />
186
+ <ShippingAddress
187
+ shippingAddress={ shippingAddress }
188
+ showCalculator={ showCalculator }
189
+ { ...calculatorButtonProps }
190
+ />
191
+ </>
192
  ) }
193
  </>
194
  }
assets/js/base/components/cart-checkout/totals/shipping/shipping-via.tsx ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+
6
+ export const ShippingVia = ( {
7
+ selectedShippingRates,
8
+ }: {
9
+ selectedShippingRates: string[];
10
+ } ): JSX.Element => {
11
+ return (
12
+ <div className="wc-block-components-totals-item__description wc-block-components-totals-shipping__via">
13
+ { __( 'via', 'woo-gutenberg-products-block' ) }{ ' ' }
14
+ { selectedShippingRates.join( ', ' ) }
15
+ </div>
16
+ );
17
+ };
assets/js/base/components/cart-checkout/totals/shipping/style.scss CHANGED
@@ -7,6 +7,10 @@
7
  border: 0;
8
  }
9
 
 
 
 
 
10
  .wc-block-components-totals-shipping__options {
11
  .wc-block-components-radio-control__label,
12
  .wc-block-components-radio-control__description,
7
  border: 0;
8
  }
9
 
10
+ .wc-block-components-totals-shipping__via {
11
+ margin-bottom: $gap;
12
+ }
13
+
14
  .wc-block-components-totals-shipping__options {
15
  .wc-block-components-radio-control__label,
16
  .wc-block-components-radio-control__description,
assets/js/base/components/filter-submit-button/index.js CHANGED
@@ -4,7 +4,7 @@
4
  import { __ } from '@wordpress/i18n';
5
  import PropTypes from 'prop-types';
6
  import classNames from 'classnames';
7
- import Label from '@woocommerce/base-components/label';
8
 
9
  /**
10
  * Internal dependencies
4
  import { __ } from '@wordpress/i18n';
5
  import PropTypes from 'prop-types';
6
  import classNames from 'classnames';
7
+ import { Label } from '@woocommerce/blocks-checkout';
8
 
9
  /**
10
  * Internal dependencies
assets/js/base/components/load-more-button/index.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import PropTypes from 'prop-types';
6
- import Label from '@woocommerce/base-components/label';
7
 
8
  /**
9
  * Internal dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import PropTypes from 'prop-types';
6
+ import { Label } from '@woocommerce/blocks-checkout';
7
 
8
  /**
9
  * Internal dependencies
assets/js/base/components/pagination/index.js CHANGED
@@ -4,7 +4,7 @@
4
  import { __, sprintf } from '@wordpress/i18n';
5
  import PropTypes from 'prop-types';
6
  import classNames from 'classnames';
7
- import Label from '@woocommerce/base-components/label';
8
 
9
  /**
10
  * Internal dependencies
4
  import { __, sprintf } from '@wordpress/i18n';
5
  import PropTypes from 'prop-types';
6
  import classNames from 'classnames';
7
+ import { Label } from '@woocommerce/blocks-checkout';
8
 
9
  /**
10
  * Internal dependencies
assets/js/base/components/price-slider/index.js CHANGED
@@ -12,6 +12,7 @@ import {
12
  import PropTypes from 'prop-types';
13
  import classnames from 'classnames';
14
  import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
 
15
 
16
  /**
17
  * Internal dependencies
@@ -241,10 +242,13 @@ const PriceSlider = ( {
241
  ! hasValidConstraints && 'is-disabled'
242
  );
243
 
 
 
 
244
  const minRangeStep =
245
- minRange && document.activeElement === minRange.current ? stepValue : 1;
246
  const maxRangeStep =
247
- maxRange && document.activeElement === maxRange.current ? stepValue : 1;
248
 
249
  return (
250
  <div className={ classes }>
12
  import PropTypes from 'prop-types';
13
  import classnames from 'classnames';
14
  import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
15
+ import { isObject } from '@woocommerce/types';
16
 
17
  /**
18
  * Internal dependencies
242
  ! hasValidConstraints && 'is-disabled'
243
  );
244
 
245
+ const activeElement = isObject( minRange.current )
246
+ ? minRange.current.ownerDocument.activeElement
247
+ : undefined;
248
  const minRangeStep =
249
+ activeElement && activeElement === minRange.current ? stepValue : 1;
250
  const maxRangeStep =
251
+ activeElement && activeElement === maxRange.current ? stepValue : 1;
252
 
253
  return (
254
  <div className={ classes }>
assets/js/base/components/quantity-selector/index.tsx CHANGED
@@ -6,12 +6,12 @@ import { speak } from '@wordpress/a11y';
6
  import classNames from 'classnames';
7
  import { useCallback } from '@wordpress/element';
8
  import { DOWN, UP } from '@wordpress/keycodes';
 
9
 
10
  /**
11
  * Internal dependencies
12
  */
13
  import './style.scss';
14
- import { isNumber } from '../../utils/type-guards';
15
 
16
  interface QuantitySelectorProps {
17
  className?: string;
6
  import classNames from 'classnames';
7
  import { useCallback } from '@wordpress/element';
8
  import { DOWN, UP } from '@wordpress/keycodes';
9
+ import { isNumber } from '@woocommerce/types';
10
 
11
  /**
12
  * Internal dependencies
13
  */
14
  import './style.scss';
 
15
 
16
  interface QuantitySelectorProps {
17
  className?: string;
assets/js/base/components/sidebar-layout/style.scss CHANGED
@@ -52,6 +52,13 @@
52
  }
53
  }
54
 
 
 
 
 
 
 
 
55
  // For Twenty Twenty we need to increase specificity a bit more.
56
  .theme-twentytwenty {
57
  .wc-block-components-sidebar .wc-block-components-panel > h2 {
52
  }
53
  }
54
 
55
+ .wc-block-components-sidebar .wc-block-components-panel > h2 {
56
+ @include reset-typography();
57
+ .wc-block-components-panel__button {
58
+ font-weight: 400;
59
+ }
60
+ }
61
+
62
  // For Twenty Twenty we need to increase specificity a bit more.
63
  .theme-twentytwenty {
64
  .wc-block-components-sidebar .wc-block-components-panel > h2 {
assets/js/base/components/sort-select/index.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import PropTypes from 'prop-types';
5
  import classNames from 'classnames';
6
- import Label from '@woocommerce/base-components/label';
7
  import { withInstanceId } from '@woocommerce/base-hocs/with-instance-id';
8
 
9
  /**
3
  */
4
  import PropTypes from 'prop-types';
5
  import classNames from 'classnames';
6
+ import { Label } from '@woocommerce/blocks-checkout';
7
  import { withInstanceId } from '@woocommerce/base-hocs/with-instance-id';
8
 
9
  /**
assets/js/base/components/text-input/{index.js → index.ts} RENAMED
File without changes
assets/js/base/components/text-input/{text-input.js → text-input.tsx} RENAMED
@@ -1,18 +1,34 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { forwardRef } from 'react';
5
- import PropTypes from 'prop-types';
6
  import classnames from 'classnames';
7
  import { useState } from '@wordpress/element';
 
8
 
9
  /**
10
  * Internal dependencies
11
  */
12
- import Label from '../label';
13
  import './style.scss';
14
 
15
- const TextInput = forwardRef(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  (
17
  {
18
  className,
@@ -29,7 +45,9 @@ const TextInput = forwardRef(
29
  value = '',
30
  onChange,
31
  required = false,
32
- onBlur = () => {},
 
 
33
  feedback,
34
  },
35
  ref
@@ -57,8 +75,8 @@ const TextInput = forwardRef(
57
  onChange( event.target.value );
58
  } }
59
  onFocus={ () => setIsActive( true ) }
60
- onBlur={ () => {
61
- onBlur();
62
  setIsActive( false );
63
  } }
64
  aria-label={ ariaLabel || label }
@@ -93,19 +111,4 @@ const TextInput = forwardRef(
93
  }
94
  );
95
 
96
- TextInput.propTypes = {
97
- id: PropTypes.string.isRequired,
98
- onChange: PropTypes.func.isRequired,
99
- value: PropTypes.string,
100
- ariaLabel: PropTypes.string,
101
- ariaDescribedBy: PropTypes.string,
102
- label: PropTypes.string,
103
- screenReaderLabel: PropTypes.string,
104
- disabled: PropTypes.bool,
105
- help: PropTypes.string,
106
- autoCapitalize: PropTypes.string,
107
- autoComplete: PropTypes.string,
108
- required: PropTypes.bool,
109
- };
110
-
111
  export default TextInput;
1
  /**
2
  * External dependencies
3
  */
4
+ import { forwardRef, InputHTMLAttributes } from 'react';
 
5
  import classnames from 'classnames';
6
  import { useState } from '@wordpress/element';
7
+ import { Label } from '@woocommerce/blocks-checkout';
8
 
9
  /**
10
  * Internal dependencies
11
  */
 
12
  import './style.scss';
13
 
14
+ interface TextInputProps
15
+ extends Omit<
16
+ InputHTMLAttributes< HTMLInputElement >,
17
+ 'onChange' | 'onBlur'
18
+ > {
19
+ id: string;
20
+ ariaLabel?: string;
21
+ label?: string;
22
+ ariaDescribedBy?: string;
23
+ screenReaderLabel?: string;
24
+ help?: string;
25
+ feedback?: boolean | JSX.Element;
26
+ autoComplete?: string;
27
+ onChange: ( newValue: string ) => void;
28
+ onBlur?: ( newValue: string ) => void;
29
+ }
30
+
31
+ const TextInput = forwardRef< HTMLInputElement, TextInputProps >(
32
  (
33
  {
34
  className,
45
  value = '',
46
  onChange,
47
  required = false,
48
+ onBlur = () => {
49
+ /* Do nothing */
50
+ },
51
  feedback,
52
  },
53
  ref
75
  onChange( event.target.value );
76
  } }
77
  onFocus={ () => setIsActive( true ) }
78
+ onBlur={ ( event ) => {
79
+ onBlur( event.target.value );
80
  setIsActive( false );
81
  } }
82
  aria-label={ ariaLabel || label }
111
  }
112
  );
113
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  export default TextInput;
assets/js/base/components/text-input/{validated-text-input.js → validated-text-input.tsx} RENAMED
@@ -3,7 +3,6 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { useCallback, useRef, useEffect, useState } from 'react';
6
- import PropTypes from 'prop-types';
7
  import classnames from 'classnames';
8
  import {
9
  ValidationInputError,
@@ -17,6 +16,29 @@ import { withInstanceId } from '@woocommerce/base-hocs/with-instance-id';
17
  import TextInput from './text-input';
18
  import './style.scss';
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  const ValidatedTextInput = ( {
21
  className,
22
  instanceId,
@@ -28,9 +50,9 @@ const ValidatedTextInput = ( {
28
  onChange,
29
  showError = true,
30
  ...rest
31
- } ) => {
32
  const [ isPristine, setIsPristine ] = useState( true );
33
- const inputRef = useRef();
34
  const {
35
  getValidationError,
36
  hideValidationError,
@@ -39,8 +61,9 @@ const ValidatedTextInput = ( {
39
  getValidationErrorId,
40
  } = useValidationContext();
41
 
42
- const textInputId = id || 'textinput-' + instanceId;
43
- errorId = errorId || textInputId;
 
44
 
45
  const validateInput = useCallback(
46
  ( errorsHidden = true ) => {
@@ -52,10 +75,10 @@ const ValidatedTextInput = ( {
52
  inputObject.value = inputObject.value.trim();
53
  const inputIsValid = inputObject.checkValidity();
54
  if ( inputIsValid ) {
55
- clearValidationError( errorId );
56
  } else {
57
  setValidationErrors( {
58
- [ errorId ]: {
59
  message:
60
  inputObject.validationMessage ||
61
  __(
@@ -67,13 +90,13 @@ const ValidatedTextInput = ( {
67
  } );
68
  }
69
  },
70
- [ clearValidationError, errorId, setValidationErrors ]
71
  );
72
 
73
  useEffect( () => {
74
  if ( isPristine ) {
75
  if ( focusOnMount ) {
76
- inputRef.current.focus();
77
  }
78
  setIsPristine( false );
79
  }
@@ -91,15 +114,19 @@ const ValidatedTextInput = ( {
91
  // Remove validation errors when unmounted.
92
  useEffect( () => {
93
  return () => {
94
- clearValidationError( errorId );
95
  };
96
- }, [ clearValidationError, errorId ] );
97
 
98
- const errorMessage = getValidationError( errorId ) || {};
 
 
 
 
99
  const hasError = errorMessage.message && ! errorMessage.hidden;
100
  const describedBy =
101
- showError && hasError && getValidationErrorId( errorId )
102
- ? getValidationErrorId( errorId )
103
  : ariaDescribedBy;
104
 
105
  return (
@@ -112,11 +139,13 @@ const ValidatedTextInput = ( {
112
  validateInput( false );
113
  } }
114
  feedback={
115
- showError && <ValidationInputError propertyName={ errorId } />
 
 
116
  }
117
  ref={ inputRef }
118
  onChange={ ( val ) => {
119
- hideValidationError( errorId );
120
  onChange( val );
121
  } }
122
  ariaDescribedBy={ describedBy }
@@ -125,15 +154,4 @@ const ValidatedTextInput = ( {
125
  );
126
  };
127
 
128
- ValidatedTextInput.propTypes = {
129
- onChange: PropTypes.func.isRequired,
130
- id: PropTypes.string,
131
- value: PropTypes.string,
132
- ariaDescribedBy: PropTypes.string,
133
- errorId: PropTypes.string,
134
- validateOnMount: PropTypes.bool,
135
- focusOnMount: PropTypes.bool,
136
- showError: PropTypes.bool,
137
- };
138
-
139
  export default withInstanceId( ValidatedTextInput );
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { useCallback, useRef, useEffect, useState } from 'react';
 
6
  import classnames from 'classnames';
7
  import {
8
  ValidationInputError,
16
  import TextInput from './text-input';
17
  import './style.scss';
18
 
19
+ interface ValidatedTextInputPropsWithId {
20
+ instanceId?: string;
21
+ id: string;
22
+ }
23
+
24
+ interface ValidatedTextInputPropsWithInstanceId {
25
+ instanceId: string;
26
+ id?: string;
27
+ }
28
+
29
+ type ValidatedTextInputProps = (
30
+ | ValidatedTextInputPropsWithId
31
+ | ValidatedTextInputPropsWithInstanceId
32
+ ) & {
33
+ className?: string;
34
+ ariaDescribedBy?: string;
35
+ errorId?: string;
36
+ validateOnMount?: boolean;
37
+ focusOnMount?: boolean;
38
+ showError?: boolean;
39
+ onChange: ( newValue: string ) => void;
40
+ };
41
+
42
  const ValidatedTextInput = ( {
43
  className,
44
  instanceId,
50
  onChange,
51
  showError = true,
52
  ...rest
53
+ }: ValidatedTextInputProps ) => {
54
  const [ isPristine, setIsPristine ] = useState( true );
55
+ const inputRef = useRef< HTMLInputElement >( null );
56
  const {
57
  getValidationError,
58
  hideValidationError,
61
  getValidationErrorId,
62
  } = useValidationContext();
63
 
64
+ const textInputId =
65
+ typeof id !== 'undefined' ? id : 'textinput-' + instanceId;
66
+ const errorIdString = errorId !== undefined ? errorId : textInputId;
67
 
68
  const validateInput = useCallback(
69
  ( errorsHidden = true ) => {
75
  inputObject.value = inputObject.value.trim();
76
  const inputIsValid = inputObject.checkValidity();
77
  if ( inputIsValid ) {
78
+ clearValidationError( errorIdString );
79
  } else {
80
  setValidationErrors( {
81
+ [ errorIdString ]: {
82
  message:
83
  inputObject.validationMessage ||
84
  __(
90
  } );
91
  }
92
  },
93
+ [ clearValidationError, errorIdString, setValidationErrors ]
94
  );
95
 
96
  useEffect( () => {
97
  if ( isPristine ) {
98
  if ( focusOnMount ) {
99
+ inputRef.current?.focus();
100
  }
101
  setIsPristine( false );
102
  }
114
  // Remove validation errors when unmounted.
115
  useEffect( () => {
116
  return () => {
117
+ clearValidationError( errorIdString );
118
  };
119
+ }, [ clearValidationError, errorIdString ] );
120
 
121
+ // @todo - When useValidationContext is converted to TypeScript, remove this cast and use the correct type.
122
+ const errorMessage = ( getValidationError( errorIdString ) || {} ) as {
123
+ message?: string;
124
+ hidden?: boolean;
125
+ };
126
  const hasError = errorMessage.message && ! errorMessage.hidden;
127
  const describedBy =
128
+ showError && hasError && getValidationErrorId( errorIdString )
129
+ ? getValidationErrorId( errorIdString )
130
  : ariaDescribedBy;
131
 
132
  return (
139
  validateInput( false );
140
  } }
141
  feedback={
142
+ showError && (
143
+ <ValidationInputError propertyName={ errorIdString } />
144
+ )
145
  }
146
  ref={ inputRef }
147
  onChange={ ( val ) => {
148
+ hideValidationError( errorIdString );
149
  onChange( val );
150
  } }
151
  ariaDescribedBy={ describedBy }
154
  );
155
  };
156
 
 
 
 
 
 
 
 
 
 
 
 
157
  export default withInstanceId( ValidatedTextInput );
assets/js/base/context/hooks/cart/use-store-cart-item-quantity.ts CHANGED
@@ -7,19 +7,20 @@ import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
7
  import { useDebounce } from 'use-debounce';
8
  import { usePrevious } from '@woocommerce/base-hooks';
9
  import { triggerFragmentRefresh } from '@woocommerce/base-utils';
10
- import type { CartItem, StoreCartItemQuantity } from '@woocommerce/types';
 
 
 
 
 
 
 
11
 
12
  /**
13
  * Internal dependencies
14
  */
15
  import { useStoreCart } from './use-store-cart';
16
  import { useCheckoutContext } from '../../providers/cart-checkout';
17
- import {
18
- isNumber,
19
- isObject,
20
- isString,
21
- objectHasProp,
22
- } from '../../../utils/type-guards';
23
 
24
  /**
25
  * Ensures the object passed has props key: string and quantity: number
7
  import { useDebounce } from 'use-debounce';
8
  import { usePrevious } from '@woocommerce/base-hooks';
9
  import { triggerFragmentRefresh } from '@woocommerce/base-utils';
10
+ import {
11
+ CartItem,
12
+ StoreCartItemQuantity,
13
+ isNumber,
14
+ isObject,
15
+ isString,
16
+ objectHasProp,
17
+ } from '@woocommerce/types';
18
 
19
  /**
20
  * Internal dependencies
21
  */
22
  import { useStoreCart } from './use-store-cart';
23
  import { useCheckoutContext } from '../../providers/cart-checkout';
 
 
 
 
 
 
24
 
25
  /**
26
  * Ensures the object passed has props key: string and quantity: number
assets/js/base/context/hooks/payment-methods/test/use-payment-method-interface.js CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * Internal dependencies
3
  */
4
- import { prepareTotalItems } from '../use-payment-method-interface';
5
 
6
  describe( 'prepareTotalItems', () => {
7
  const fixture = {
@@ -17,21 +17,25 @@ describe( 'prepareTotalItems', () => {
17
  };
18
  const expected = [
19
  {
 
20
  label: 'Subtotal:',
21
  value: 200,
22
  valueWithTax: 220,
23
  },
24
  {
 
25
  label: 'Fees:',
26
  value: 100,
27
  valueWithTax: 110,
28
  },
29
  {
 
30
  label: 'Discount:',
31
  value: 350,
32
  valueWithTax: 400,
33
  },
34
  {
 
35
  label: 'Taxes:',
36
  value: 30,
37
  valueWithTax: 30,
@@ -40,6 +44,7 @@ describe( 'prepareTotalItems', () => {
40
  const expectedWithShipping = [
41
  ...expected,
42
  {
 
43
  label: 'Shipping:',
44
  value: 50,
45
  valueWithTax: 55,
1
  /**
2
  * Internal dependencies
3
  */
4
+ import { prepareTotalItems } from '../utils';
5
 
6
  describe( 'prepareTotalItems', () => {
7
  const fixture = {
17
  };
18
  const expected = [
19
  {
20
+ key: 'total_items',
21
  label: 'Subtotal:',
22
  value: 200,
23
  valueWithTax: 220,
24
  },
25
  {
26
+ key: 'total_fees',
27
  label: 'Fees:',
28
  value: 100,
29
  valueWithTax: 110,
30
  },
31
  {
32
+ key: 'total_discount',
33
  label: 'Discount:',
34
  value: 350,
35
  valueWithTax: 400,
36
  },
37
  {
38
+ key: 'total_tax',
39
  label: 'Taxes:',
40
  value: 30,
41
  valueWithTax: 30,
44
  const expectedWithShipping = [
45
  ...expected,
46
  {
47
+ key: 'total_shipping',
48
  label: 'Shipping:',
49
  value: 50,
50
  valueWithTax: 55,
assets/js/base/context/hooks/payment-methods/{use-payment-method-interface.js → use-payment-method-interface.ts} RENAMED
@@ -19,67 +19,12 @@ import { useCheckoutContext } from '../../providers/cart-checkout/checkout-state
19
  import { usePaymentMethodDataContext } from '../../providers/cart-checkout/payment-methods';
20
  import { useShippingDataContext } from '../../providers/cart-checkout/shipping';
21
  import { useCustomerDataContext } from '../../providers/cart-checkout/customer';
 
22
 
23
  /**
24
- * @typedef {import('@woocommerce/type-defs/registered-payment-method-props').RegisteredPaymentMethodProps} RegisteredPaymentMethodProps
25
- * @typedef {import('@woocommerce/type-defs/cart').CartTotalItem} CartTotalItem
26
  */
27
-
28
- /**
29
- * Prepares the total items into a shape usable for display as passed on to
30
- * registered payment methods.
31
- *
32
- * @param {Object} totals Current cart total items
33
- * @param {boolean} needsShipping Whether or not shipping is needed.
34
- *
35
- * @return {CartTotalItem[]} Array for cart total items prepared for use.
36
- */
37
- export const prepareTotalItems = ( totals, needsShipping ) => {
38
- const newTotals = [];
39
- const factory = ( label, property ) => {
40
- const value = parseInt( totals[ property ], 10 );
41
- const tax = parseInt( totals[ property + '_tax' ], 10 );
42
- return {
43
- label,
44
- value,
45
- valueWithTax: value + tax,
46
- };
47
- };
48
- newTotals.push(
49
- factory(
50
- __( 'Subtotal:', 'woo-gutenberg-products-block' ),
51
- 'total_items'
52
- )
53
- );
54
- newTotals.push(
55
- factory( __( 'Fees:', 'woo-gutenberg-products-block' ), 'total_fees' )
56
- );
57
- newTotals.push(
58
- factory(
59
- __( 'Discount:', 'woo-gutenberg-products-block' ),
60
- 'total_discount'
61
- )
62
- );
63
- newTotals.push( {
64
- label: __( 'Taxes:', 'woo-gutenberg-products-block' ),
65
- value: parseInt( totals.total_tax, 10 ),
66
- valueWithTax: parseInt( totals.total_tax, 10 ),
67
- } );
68
- if ( needsShipping ) {
69
- newTotals.push(
70
- factory(
71
- __( 'Shipping:', 'woo-gutenberg-products-block' ),
72
- 'total_shipping'
73
- )
74
- );
75
- }
76
- return newTotals;
77
- };
78
-
79
- /**
80
- * @return {RegisteredPaymentMethodProps} Interface to use as payment method props.
81
- */
82
- export const usePaymentMethodInterface = () => {
83
  const {
84
  isCalculating,
85
  isComplete,
@@ -107,7 +52,6 @@ export const usePaymentMethodInterface = () => {
107
  selectedRates,
108
  setSelectedRates,
109
  isSelectingRate,
110
-
111
  onShippingRateSuccess,
112
  onShippingRateFail,
113
  onShippingRateSelectSuccess,
@@ -142,27 +86,7 @@ export const usePaymentMethodInterface = () => {
142
  }, [ cartTotals, needsShipping ] );
143
 
144
  return {
145
- checkoutStatus: {
146
- isCalculating,
147
- isComplete,
148
- isIdle,
149
- isProcessing,
150
- },
151
- paymentStatus: currentStatus,
152
- shippingStatus: {
153
- shippingErrorStatus,
154
- shippingErrorTypes,
155
- },
156
- shippingData: {
157
- shippingRates,
158
- shippingRatesLoading,
159
- selectedRates,
160
- setSelectedRates,
161
- isSelectingRate,
162
- shippingAddress,
163
- setShippingAddress,
164
- needsShipping,
165
- },
166
  billing: {
167
  billingData,
168
  cartTotal: currentCartTotal.current,
@@ -171,10 +95,25 @@ export const usePaymentMethodInterface = () => {
171
  displayPricesIncludingTax: getSetting(
172
  'displayCartPricesIncludingTax',
173
  false
174
- ),
175
  appliedCoupons,
176
  customerId,
177
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  eventRegistration: {
179
  onCheckoutBeforeProcessing,
180
  onCheckoutValidationBeforeProcessing,
@@ -186,18 +125,23 @@ export const usePaymentMethodInterface = () => {
186
  onShippingRateSelectFail,
187
  onPaymentProcessing,
188
  },
189
- components: {
190
- ValidationInputError,
191
- PaymentMethodIcons,
192
- PaymentMethodLabel,
193
- },
194
- emitResponse: {
195
- noticeContexts,
196
- responseTypes,
197
- },
198
  onSubmit,
199
- activePaymentMethod,
200
  setExpressPaymentError,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  shouldSavePayment,
202
  };
203
  };
19
  import { usePaymentMethodDataContext } from '../../providers/cart-checkout/payment-methods';
20
  import { useShippingDataContext } from '../../providers/cart-checkout/shipping';
21
  import { useCustomerDataContext } from '../../providers/cart-checkout/customer';
22
+ import { prepareTotalItems } from './utils';
23
 
24
  /**
25
+ * Returns am interface to use as payment method props.
 
26
  */
27
+ export const usePaymentMethodInterface = (): Record< string, unknown > => {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  const {
29
  isCalculating,
30
  isComplete,
52
  selectedRates,
53
  setSelectedRates,
54
  isSelectingRate,
 
55
  onShippingRateSuccess,
56
  onShippingRateFail,
57
  onShippingRateSelectSuccess,
86
  }, [ cartTotals, needsShipping ] );
87
 
88
  return {
89
+ activePaymentMethod,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  billing: {
91
  billingData,
92
  cartTotal: currentCartTotal.current,
95
  displayPricesIncludingTax: getSetting(
96
  'displayCartPricesIncludingTax',
97
  false
98
+ ) as boolean,
99
  appliedCoupons,
100
  customerId,
101
  },
102
+ checkoutStatus: {
103
+ isCalculating,
104
+ isComplete,
105
+ isIdle,
106
+ isProcessing,
107
+ },
108
+ components: {
109
+ ValidationInputError,
110
+ PaymentMethodIcons,
111
+ PaymentMethodLabel,
112
+ },
113
+ emitResponse: {
114
+ noticeContexts,
115
+ responseTypes,
116
+ },
117
  eventRegistration: {
118
  onCheckoutBeforeProcessing,
119
  onCheckoutValidationBeforeProcessing,
125
  onShippingRateSelectFail,
126
  onPaymentProcessing,
127
  },
 
 
 
 
 
 
 
 
 
128
  onSubmit,
129
+ paymentStatus: currentStatus,
130
  setExpressPaymentError,
131
+ shippingData: {
132
+ shippingRates,
133
+ shippingRatesLoading,
134
+ selectedRates,
135
+ setSelectedRates,
136
+ isSelectingRate,
137
+ shippingAddress,
138
+ setShippingAddress,
139
+ needsShipping,
140
+ },
141
+ shippingStatus: {
142
+ shippingErrorStatus,
143
+ shippingErrorTypes,
144
+ },
145
  shouldSavePayment,
146
  };
147
  };
assets/js/base/context/hooks/payment-methods/utils.ts ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import {
6
+ CartResponseTotals,
7
+ objectHasProp,
8
+ isString,
9
+ } from '@woocommerce/types';
10
+
11
+ export interface CartTotalItem {
12
+ key: string;
13
+ label: string;
14
+ value: number;
15
+ valueWithTax: number;
16
+ }
17
+
18
+ /**
19
+ * Prepares the total items into a shape usable for display as passed on to
20
+ * registered payment methods.
21
+ *
22
+ * @param {Object} totals Current cart total items
23
+ * @param {boolean} needsShipping Whether or not shipping is needed.
24
+ */
25
+ export const prepareTotalItems = (
26
+ totals: CartResponseTotals,
27
+ needsShipping: boolean
28
+ ): CartTotalItem[] => {
29
+ const newTotals = [];
30
+
31
+ const factory = ( label: string, property: string ): CartTotalItem => {
32
+ const taxProperty = property + '_tax';
33
+ const value =
34
+ objectHasProp( totals, property ) && isString( totals[ property ] )
35
+ ? parseInt( totals[ property ] as string, 10 )
36
+ : 0;
37
+ const tax =
38
+ objectHasProp( totals, taxProperty ) &&
39
+ isString( totals[ taxProperty ] )
40
+ ? parseInt( totals[ taxProperty ] as string, 10 )
41
+ : 0;
42
+ return {
43
+ key: property,
44
+ label,
45
+ value,
46
+ valueWithTax: value + tax,
47
+ };
48
+ };
49
+
50
+ newTotals.push(
51
+ factory(
52
+ __( 'Subtotal:', 'woo-gutenberg-products-block' ),
53
+ 'total_items'
54
+ )
55
+ );
56
+
57
+ newTotals.push(
58
+ factory( __( 'Fees:', 'woo-gutenberg-products-block' ), 'total_fees' )
59
+ );
60
+
61
+ newTotals.push(
62
+ factory(
63
+ __( 'Discount:', 'woo-gutenberg-products-block' ),
64
+ 'total_discount'
65
+ )
66
+ );
67
+
68
+ newTotals.push( {
69
+ key: 'total_tax',
70
+ label: __( 'Taxes:', 'woo-gutenberg-products-block' ),
71
+ value: parseInt( totals.total_tax, 10 ),
72
+ valueWithTax: parseInt( totals.total_tax, 10 ),
73
+ } );
74
+
75
+ if ( needsShipping ) {
76
+ newTotals.push(
77
+ factory(
78
+ __( 'Shipping:', 'woo-gutenberg-products-block' ),
79
+ 'total_shipping'
80
+ )
81
+ );
82
+ }
83
+
84
+ return newTotals;
85
+ };
assets/js/base/context/hooks/use-customer-data.ts CHANGED
@@ -9,6 +9,7 @@ import isShallowEqual from '@wordpress/is-shallow-equal';
9
  import {
10
  formatStoreApiErrorMessage,
11
  pluckAddress,
 
12
  } from '@woocommerce/base-utils';
13
  import type {
14
  CartResponseBillingAddress,
@@ -26,8 +27,16 @@ declare type CustomerData = {
26
  import { useStoreCart } from './cart/use-store-cart';
27
  import { useStoreNotices } from './use-store-notices';
28
 
 
 
 
 
 
 
29
  /**
30
- * Does a shallow compare of important address data to determine if the cart needs updating.
 
 
31
  *
32
  * @param {Object} previousAddress An object containing all previous address information
33
  * @param {Object} address An object containing all address information
@@ -40,12 +49,20 @@ const shouldUpdateAddressStore = <
40
  previousAddress: T,
41
  address: T
42
  ): boolean => {
43
- if ( ! address.country ) {
44
- return false;
 
 
 
 
45
  }
46
- return ! isShallowEqual(
47
- pluckAddress( previousAddress ),
48
- pluckAddress( address )
 
 
 
 
49
  );
50
  };
51
 
@@ -56,7 +73,7 @@ export const useCustomerData = (): {
56
  billingData: CartResponseBillingAddress;
57
  shippingAddress: CartResponseShippingAddress;
58
  setBillingData: ( data: CartResponseBillingAddress ) => void;
59
- setShippingAddress: ( data: CartResponseBillingAddress ) => void;
60
  } => {
61
  const { updateCustomerData } = useDispatch( storeKey );
62
  const { addErrorNotice, removeNotice } = useStoreNotices();
9
  import {
10
  formatStoreApiErrorMessage,
11
  pluckAddress,
12
+ pluckEmail,
13
  } from '@woocommerce/base-utils';
14
  import type {
15
  CartResponseBillingAddress,
27
  import { useStoreCart } from './cart/use-store-cart';
28
  import { useStoreNotices } from './use-store-notices';
29
 
30
+ function instanceOfCartResponseBillingAddress(
31
+ address: CartResponseBillingAddress | CartResponseShippingAddress
32
+ ): address is CartResponseBillingAddress {
33
+ return 'email' in address;
34
+ }
35
+
36
  /**
37
+ * Does a shallow compare of important address data to determine if the cart needs updating on the server.
38
+ *
39
+ * This takes the current and previous address into account, as well as the billing email field.
40
  *
41
  * @param {Object} previousAddress An object containing all previous address information
42
  * @param {Object} address An object containing all address information
49
  previousAddress: T,
50
  address: T
51
  ): boolean => {
52
+ if (
53
+ instanceOfCartResponseBillingAddress( address ) &&
54
+ pluckEmail( address ) !==
55
+ pluckEmail( previousAddress as CartResponseBillingAddress )
56
+ ) {
57
+ return true;
58
  }
59
+
60
+ return (
61
+ !! address.country &&
62
+ ! isShallowEqual(
63
+ pluckAddress( previousAddress ),
64
+ pluckAddress( address )
65
+ )
66
  );
67
  };
68
 
73
  billingData: CartResponseBillingAddress;
74
  shippingAddress: CartResponseShippingAddress;
75
  setBillingData: ( data: CartResponseBillingAddress ) => void;
76
+ setShippingAddress: ( data: CartResponseShippingAddress ) => void;
77
  } => {
78
  const { updateCustomerData } = useDispatch( storeKey );
79
  const { addErrorNotice, removeNotice } = useStoreNotices();
assets/js/base/context/hooks/use-emit-response.js DELETED
@@ -1,59 +0,0 @@
1
- /**
2
- * @typedef {import('@woocommerce/type-defs/hooks').EmitResponseTypes} EmitResponseTypes
3
- * @typedef {import('@woocommerce/type-defs/hooks').NoticeContexts} NoticeContexts
4
- * @typedef {import('@woocommerce/type-defs/hooks').EmitResponseApi} EmitResponseApi
5
- */
6
-
7
- const isResponseOf = ( response, type ) => {
8
- return !! response.type && response.type === type;
9
- };
10
-
11
- /**
12
- * @type {EmitResponseTypes}
13
- */
14
- const responseTypes = {
15
- SUCCESS: 'success',
16
- FAIL: 'failure',
17
- ERROR: 'error',
18
- };
19
-
20
- /**
21
- * @type {NoticeContexts}
22
- */
23
- const noticeContexts = {
24
- PAYMENTS: 'wc/payment-area',
25
- EXPRESS_PAYMENTS: 'wc/express-payment-area',
26
- };
27
-
28
- export const isSuccessResponse = ( response ) => {
29
- return isResponseOf( response, responseTypes.SUCCESS );
30
- };
31
-
32
- export const isErrorResponse = ( response ) => {
33
- return isResponseOf( response, responseTypes.ERROR );
34
- };
35
-
36
- export const isFailResponse = ( response ) => {
37
- return isResponseOf( response, responseTypes.FAIL );
38
- };
39
-
40
- export const shouldRetry = ( response ) => {
41
- return typeof response.retry === 'undefined' || response.retry === true;
42
- };
43
-
44
- /**
45
- * A custom hook exposing response utilities for emitters.
46
- *
47
- * @return {EmitResponseApi} Various interfaces for validating and implementing
48
- * emitter response properties.
49
- */
50
- export const useEmitResponse = () => {
51
- return {
52
- responseTypes,
53
- noticeContexts,
54
- shouldRetry,
55
- isSuccessResponse,
56
- isErrorResponse,
57
- isFailResponse,
58
- };
59
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/base/context/hooks/use-emit-response.ts ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { isObject } from '@woocommerce/types';
5
+
6
+ export enum responseTypes {
7
+ SUCCESS = 'success',
8
+ FAIL = 'failure',
9
+ ERROR = 'error',
10
+ }
11
+
12
+ export enum noticeContexts {
13
+ PAYMENTS = 'wc/payment-area',
14
+ EXPRESS_PAYMENTS = 'wc/express-payment-area',
15
+ }
16
+
17
+ export interface ResponseType extends Record< string, unknown > {
18
+ type: responseTypes;
19
+ retry?: boolean;
20
+ }
21
+
22
+ const isResponseOf = (
23
+ response: unknown,
24
+ type: string
25
+ ): response is ResponseType => {
26
+ return isObject( response ) && 'type' in response && response.type === type;
27
+ };
28
+
29
+ export const isSuccessResponse = (
30
+ response: unknown
31
+ ): response is ResponseType => {
32
+ return isResponseOf( response, responseTypes.SUCCESS );
33
+ };
34
+
35
+ export const isErrorResponse = (
36
+ response: unknown
37
+ ): response is ResponseType => {
38
+ return isResponseOf( response, responseTypes.ERROR );
39
+ };
40
+
41
+ export const isFailResponse = (
42
+ response: unknown
43
+ ): response is ResponseType => {
44
+ return isResponseOf( response, responseTypes.FAIL );
45
+ };
46
+
47
+ export const shouldRetry = ( response: unknown ): boolean => {
48
+ return (
49
+ ! isObject( response ) ||
50
+ typeof response.retry === 'undefined' ||
51
+ response.retry === true
52
+ );
53
+ };
54
+
55
+ /**
56
+ * A custom hook exposing response utilities for emitters.
57
+ */
58
+ export const useEmitResponse = () =>
59
+ ( {
60
+ responseTypes,
61
+ noticeContexts,
62
+ shouldRetry,
63
+ isSuccessResponse,
64
+ isErrorResponse,
65
+ isFailResponse,
66
+ } as const );
assets/js/base/context/{index.js → index.ts} RENAMED
File without changes
assets/js/base/context/providers/cart-checkout/checkout-state/actions.js DELETED
@@ -1,82 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { TYPES } from './constants';
5
-
6
- const {
7
- SET_PRISTINE,
8
- SET_IDLE,
9
- SET_PROCESSING,
10
- SET_BEFORE_PROCESSING,
11
- SET_AFTER_PROCESSING,
12
- SET_PROCESSING_RESPONSE,
13
- SET_REDIRECT_URL,
14
- SET_COMPLETE,
15
- SET_HAS_ERROR,
16
- SET_NO_ERROR,
17
- INCREMENT_CALCULATING,
18
- DECREMENT_CALCULATING,
19
- SET_CUSTOMER_ID,
20
- SET_ORDER_ID,
21
- SET_SHOULD_CREATE_ACCOUNT,
22
- SET_ORDER_NOTES,
23
- } = TYPES;
24
-
25
- /**
26
- * All the actions that can be dispatched for the checkout.
27
- */
28
- export const actions = {
29
- setPristine: () => ( {
30
- type: SET_PRISTINE,
31
- } ),
32
- setIdle: () => ( {
33
- type: SET_IDLE,
34
- } ),
35
- setProcessing: () => ( {
36
- type: SET_PROCESSING,
37
- } ),
38
- setRedirectUrl: ( url ) => ( {
39
- type: SET_REDIRECT_URL,
40
- url,
41
- } ),
42
- setProcessingResponse: ( data ) => ( {
43
- type: SET_PROCESSING_RESPONSE,
44
- data,
45
- } ),
46
- setComplete: ( data ) => ( {
47
- type: SET_COMPLETE,
48
- data,
49
- } ),
50
- setBeforeProcessing: () => ( {
51
- type: SET_BEFORE_PROCESSING,
52
- } ),
53
- setAfterProcessing: () => ( {
54
- type: SET_AFTER_PROCESSING,
55
- } ),
56
- setHasError: ( hasError = true ) => {
57
- const type = hasError ? SET_HAS_ERROR : SET_NO_ERROR;
58
- return { type };
59
- },
60
- incrementCalculating: () => ( {
61
- type: INCREMENT_CALCULATING,
62
- } ),
63
- decrementCalculating: () => ( {
64
- type: DECREMENT_CALCULATING,
65
- } ),
66
- setCustomerId: ( customerId ) => ( {
67
- type: SET_CUSTOMER_ID,
68
- customerId,
69
- } ),
70
- setOrderId: ( orderId ) => ( {
71
- type: SET_ORDER_ID,
72
- orderId,
73
- } ),
74
- setShouldCreateAccount: ( shouldCreateAccount ) => ( {
75
- type: SET_SHOULD_CREATE_ACCOUNT,
76
- shouldCreateAccount,
77
- } ),
78
- setOrderNotes: ( orderNotes ) => ( {
79
- type: SET_ORDER_NOTES,
80
- orderNotes,
81
- } ),
82
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/base/context/providers/cart-checkout/checkout-state/actions.ts ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { PaymentResultDataType } from './types';
5
+
6
+ export enum ACTION {
7
+ SET_IDLE = 'set_idle',
8
+ SET_PRISTINE = 'set_pristine',
9
+ SET_REDIRECT_URL = 'set_redirect_url',
10
+ SET_COMPLETE = 'set_checkout_complete',
11
+ SET_BEFORE_PROCESSING = 'set_before_processing',
12
+ SET_AFTER_PROCESSING = 'set_after_processing',
13
+ SET_PROCESSING_RESPONSE = 'set_processing_response',
14
+ SET_PROCESSING = 'set_checkout_is_processing',
15
+ SET_HAS_ERROR = 'set_checkout_has_error',
16
+ SET_NO_ERROR = 'set_checkout_no_error',
17
+ SET_CUSTOMER_ID = 'set_checkout_customer_id',
18
+ SET_ORDER_ID = 'set_checkout_order_id',
19
+ SET_ORDER_NOTES = 'set_checkout_order_notes',
20
+ INCREMENT_CALCULATING = 'increment_calculating',
21
+ DECREMENT_CALCULATING = 'decrement_calculating',
22
+ SET_SHOULD_CREATE_ACCOUNT = 'set_should_create_account',
23
+ }
24
+
25
+ export interface ActionType {
26
+ type: ACTION;
27
+ data?:
28
+ | Record< string, unknown >
29
+ | Record< string, never >
30
+ | PaymentResultDataType;
31
+ url?: string;
32
+ customerId?: number;
33
+ orderId?: number;
34
+ shouldCreateAccount?: boolean;
35
+ hasError?: boolean;
36
+ orderNotes?: string;
37
+ }
38
+
39
+ /**
40
+ * All the actions that can be dispatched for the checkout.
41
+ */
42
+ export const actions = {
43
+ setPristine: () =>
44
+ ( {
45
+ type: ACTION.SET_PRISTINE,
46
+ } as const ),
47
+ setIdle: () =>
48
+ ( {
49
+ type: ACTION.SET_IDLE,
50
+ } as const ),
51
+ setProcessing: () =>
52
+ ( {
53
+ type: ACTION.SET_PROCESSING,
54
+ } as const ),
55
+ setRedirectUrl: ( url: string ) =>
56
+ ( {
57
+ type: ACTION.SET_REDIRECT_URL,
58
+ url,
59
+ } as const ),
60
+ setProcessingResponse: ( data: PaymentResultDataType ) =>
61
+ ( {
62
+ type: ACTION.SET_PROCESSING_RESPONSE,
63
+ data,
64
+ } as const ),
65
+ setComplete: ( data: Record< string, unknown > = {} ) =>
66
+ ( {
67
+ type: ACTION.SET_COMPLETE,
68
+ data,
69
+ } as const ),
70
+ setBeforeProcessing: () =>
71
+ ( {
72
+ type: ACTION.SET_BEFORE_PROCESSING,
73
+ } as const ),
74
+ setAfterProcessing: () =>
75
+ ( {
76
+ type: ACTION.SET_AFTER_PROCESSING,
77
+ } as const ),
78
+ setHasError: ( hasError = true ) =>
79
+ ( {
80
+ type: hasError ? ACTION.SET_HAS_ERROR : ACTION.SET_NO_ERROR,
81
+ } as const ),
82
+ incrementCalculating: () =>
83
+ ( {
84
+ type: ACTION.INCREMENT_CALCULATING,
85
+ } as const ),
86
+ decrementCalculating: () =>
87
+ ( {
88
+ type: ACTION.DECREMENT_CALCULATING,
89
+ } as const ),
90
+ setCustomerId: ( customerId: number ) =>
91
+ ( {
92
+ type: ACTION.SET_CUSTOMER_ID,
93
+ customerId,
94
+ } as const ),
95
+ setOrderId: ( orderId: number ) =>
96
+ ( {
97
+ type: ACTION.SET_ORDER_ID,
98
+ orderId,
99
+ } as const ),
100
+ setShouldCreateAccount: ( shouldCreateAccount: boolean ) =>
101
+ ( {
102
+ type: ACTION.SET_SHOULD_CREATE_ACCOUNT,
103
+ shouldCreateAccount,
104
+ } as const ),
105
+ setOrderNotes: ( orderNotes: string ) =>
106
+ ( {
107
+ type: ACTION.SET_ORDER_NOTES,
108
+ orderNotes,
109
+ } as const ),
110
+ };
assets/js/base/context/providers/cart-checkout/checkout-state/constants.js DELETED
@@ -1,53 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { getSetting } from '@woocommerce/settings';
5
-
6
- /**
7
- * @type {import("@woocommerce/type-defs/checkout").CheckoutStatusConstants}
8
- */
9
- export const STATUS = {
10
- PRISTINE: 'pristine',
11
- IDLE: 'idle',
12
- PROCESSING: 'processing',
13
- COMPLETE: 'complete',
14
- BEFORE_PROCESSING: 'before_processing',
15
- AFTER_PROCESSING: 'after_processing',
16
- };
17
-
18
- const preloadedApiRequests = getSetting( 'preloadedApiRequests', {} );
19
- const checkoutData = {
20
- order_id: 0,
21
- customer_id: 0,
22
- ...( preloadedApiRequests[ '/wc/store/checkout' ]?.body || {} ),
23
- };
24
-
25
- export const DEFAULT_STATE = {
26
- redirectUrl: '',
27
- status: STATUS.PRISTINE,
28
- hasError: false,
29
- calculatingCount: 0,
30
- orderId: checkoutData.order_id,
31
- orderNotes: '',
32
- customerId: checkoutData.customer_id,
33
- shouldCreateAccount: false,
34
- processingResponse: null,
35
- };
36
-
37
- export const TYPES = {
38
- SET_IDLE: 'set_idle',
39
- SET_PRISTINE: 'set_pristine',
40
- SET_REDIRECT_URL: 'set_redirect_url',
41
- SET_COMPLETE: 'set_checkout_complete',
42
- SET_BEFORE_PROCESSING: 'set_before_processing',
43
- SET_AFTER_PROCESSING: 'set_after_processing',
44
- SET_PROCESSING_RESPONSE: 'set_processing_response',
45
- SET_PROCESSING: 'set_checkout_is_processing',
46
- SET_HAS_ERROR: 'set_checkout_has_error',
47
- SET_NO_ERROR: 'set_checkout_no_error',
48
- SET_CUSTOMER_ID: 'set_checkout_customer_id',
49
- SET_ORDER_ID: 'set_checkout_order_id',
50
- SET_ORDER_NOTES: 'set_checkout_order_notes',
51
- INCREMENT_CALCULATING: 'increment_calculating',
52
- DECREMENT_CALCULATING: 'decrement_calculating',
53
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/base/context/providers/cart-checkout/checkout-state/constants.ts ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { getSetting } from '@woocommerce/settings';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import type {
10
+ CheckoutStateContextType,
11
+ CheckoutStateContextState,
12
+ } from './types';
13
+
14
+ export enum STATUS {
15
+ // Checkout is in it's initialized state.
16
+ PRISTINE = 'pristine',
17
+ // When checkout state has changed but there is no activity happening.
18
+ IDLE = 'idle',
19
+ // After BEFORE_PROCESSING status emitters have finished successfully. Payment processing is started on this checkout status.
20
+ PROCESSING = 'processing',
21
+ // After the AFTER_PROCESSING event emitters have completed. This status triggers the checkout redirect.
22
+ COMPLETE = 'complete',
23
+ // This is the state before checkout processing begins after the checkout button has been pressed/submitted.
24
+ BEFORE_PROCESSING = 'before_processing',
25
+ // After server side checkout processing is completed this status is set
26
+ AFTER_PROCESSING = 'after_processing',
27
+ }
28
+
29
+ const preloadedApiRequests = getSetting( 'preloadedApiRequests', {} ) as Record<
30
+ string,
31
+ { body: Record< string, unknown > }
32
+ >;
33
+
34
+ const checkoutData = {
35
+ order_id: 0,
36
+ customer_id: 0,
37
+ ...( preloadedApiRequests[ '/wc/store/checkout' ]?.body || {} ),
38
+ };
39
+
40
+ export const DEFAULT_CHECKOUT_STATE_DATA: CheckoutStateContextType = {
41
+ dispatchActions: {
42
+ resetCheckout: () => void null,
43
+ setRedirectUrl: ( url ) => void url,
44
+ setHasError: ( hasError ) => void hasError,
45
+ setAfterProcessing: ( response ) => void response,
46
+ incrementCalculating: () => void null,
47
+ decrementCalculating: () => void null,
48
+ setCustomerId: ( id ) => void id,
49
+ setOrderId: ( id ) => void id,
50
+ setOrderNotes: ( orderNotes ) => void orderNotes,
51
+ },
52
+ onSubmit: () => void null,
53
+ isComplete: false,
54
+ isIdle: false,
55
+ isCalculating: false,
56
+ isProcessing: false,
57
+ isBeforeProcessing: false,
58
+ isAfterProcessing: false,
59
+ hasError: false,
60
+ redirectUrl: '',
61
+ orderId: 0,
62
+ orderNotes: '',
63
+ customerId: 0,
64
+ onCheckoutAfterProcessingWithSuccess: () => () => void null,
65
+ onCheckoutAfterProcessingWithError: () => () => void null,
66
+ onCheckoutBeforeProcessing: () => () => void null, // deprecated for onCheckoutValidationBeforeProcessing
67
+ onCheckoutValidationBeforeProcessing: () => () => void null,
68
+ hasOrder: false,
69
+ isCart: false,
70
+ shouldCreateAccount: false,
71
+ setShouldCreateAccount: ( value ) => void value,
72
+ };
73
+
74
+ export const DEFAULT_STATE: CheckoutStateContextState = {
75
+ redirectUrl: '',
76
+ status: STATUS.PRISTINE,
77
+ hasError: false,
78
+ calculatingCount: 0,
79
+ orderId: checkoutData.order_id,
80
+ orderNotes: '',
81
+ customerId: checkoutData.customer_id,
82
+ shouldCreateAccount: false,
83
+ processingResponse: null,
84
+ };
assets/js/base/context/providers/cart-checkout/checkout-state/event-emit.js DELETED
@@ -1,48 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import {
5
- emitterCallback,
6
- reducer,
7
- emitEvent,
8
- emitEventWithAbort,
9
- } from '../../../event-emit';
10
-
11
- const EMIT_TYPES = {
12
- CHECKOUT_VALIDATION_BEFORE_PROCESSING:
13
- 'checkout_validation_before_processing',
14
- CHECKOUT_AFTER_PROCESSING_WITH_SUCCESS:
15
- 'checkout_after_processing_with_success',
16
- CHECKOUT_AFTER_PROCESSING_WITH_ERROR:
17
- 'checkout_after_processing_with_error',
18
- };
19
-
20
- /**
21
- * Receives a reducer dispatcher and returns an object with the
22
- * callback registration function for the checkout emit
23
- * events.
24
- *
25
- * Calling the event registration function with the callback will register it
26
- * for the event emitter and will return a dispatcher for removing the
27
- * registered callback (useful for implementation in `useEffect`).
28
- *
29
- * @param {Function} dispatcher The emitter reducer dispatcher.
30
- *
31
- * @return {Object} An object with the checkout emmitter registration
32
- */
33
- const emitterObservers = ( dispatcher ) => ( {
34
- onCheckoutAfterProcessingWithSuccess: emitterCallback(
35
- EMIT_TYPES.CHECKOUT_AFTER_PROCESSING_WITH_SUCCESS,
36
- dispatcher
37
- ),
38
- onCheckoutAfterProcessingWithError: emitterCallback(
39
- EMIT_TYPES.CHECKOUT_AFTER_PROCESSING_WITH_ERROR,
40
- dispatcher
41
- ),
42
- onCheckoutValidationBeforeProcessing: emitterCallback(
43
- EMIT_TYPES.CHECKOUT_VALIDATION_BEFORE_PROCESSING,
44
- dispatcher
45
- ),
46
- } );
47
-
48
- export { EMIT_TYPES, emitterObservers, reducer, emitEvent, emitEventWithAbort };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/base/context/providers/cart-checkout/checkout-state/event-emit.ts ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { useMemo } from '@wordpress/element';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import {
10
+ emitterCallback,
11
+ reducer,
12
+ emitEvent,
13
+ emitEventWithAbort,
14
+ ActionType,
15
+ } from '../../../event-emit';
16
+
17
+ const EMIT_TYPES = {
18
+ CHECKOUT_VALIDATION_BEFORE_PROCESSING:
19
+ 'checkout_validation_before_processing',
20
+ CHECKOUT_AFTER_PROCESSING_WITH_SUCCESS:
21
+ 'checkout_after_processing_with_success',
22
+ CHECKOUT_AFTER_PROCESSING_WITH_ERROR:
23
+ 'checkout_after_processing_with_error',
24
+ };
25
+
26
+ type EventEmittersType = Record< string, ReturnType< typeof emitterCallback > >;
27
+
28
+ /**
29
+ * Receives a reducer dispatcher and returns an object with the
30
+ * various event emitters for the payment processing events.
31
+ *
32
+ * Calling the event registration function with the callback will register it
33
+ * for the event emitter and will return a dispatcher for removing the
34
+ * registered callback (useful for implementation in `useEffect`).
35
+ *
36
+ * @param {Function} observerDispatch The emitter reducer dispatcher.
37
+ * @return {Object} An object with the various payment event emitter registration functions
38
+ */
39
+ const useEventEmitters = (
40
+ observerDispatch: React.Dispatch< ActionType >
41
+ ): EventEmittersType => {
42
+ const eventEmitters = useMemo(
43
+ () => ( {
44
+ onCheckoutAfterProcessingWithSuccess: emitterCallback(
45
+ EMIT_TYPES.CHECKOUT_AFTER_PROCESSING_WITH_SUCCESS,
46
+ observerDispatch
47
+ ),
48
+ onCheckoutAfterProcessingWithError: emitterCallback(
49
+ EMIT_TYPES.CHECKOUT_AFTER_PROCESSING_WITH_ERROR,
50
+ observerDispatch
51
+ ),
52
+ onCheckoutValidationBeforeProcessing: emitterCallback(
53
+ EMIT_TYPES.CHECKOUT_VALIDATION_BEFORE_PROCESSING,
54
+ observerDispatch
55
+ ),
56
+ } ),
57
+ [ observerDispatch ]
58
+ );
59
+ return eventEmitters;
60
+ };
61
+
62
+ export { EMIT_TYPES, useEventEmitters, reducer, emitEvent, emitEventWithAbort };
assets/js/base/context/providers/cart-checkout/checkout-state/{index.js → index.tsx} RENAMED
@@ -13,15 +13,26 @@ import {
13
  import { __ } from '@wordpress/i18n';
14
  import { usePrevious } from '@woocommerce/base-hooks';
15
  import deprecated from '@wordpress/deprecated';
 
 
16
  /**
17
  * Internal dependencies
18
  */
19
  import { actions } from './actions';
20
- import { reducer, prepareResponseData } from './reducer';
21
- import { DEFAULT_STATE, STATUS } from './constants';
 
 
 
 
 
 
 
 
 
22
  import {
23
  EMIT_TYPES,
24
- emitterObservers,
25
  emitEvent,
26
  emitEventWithAbort,
27
  reducer as emitReducer,
@@ -33,49 +44,12 @@ import { useCheckoutNotices } from '../../../hooks/use-checkout-notices';
33
  import { useEmitResponse } from '../../../hooks/use-emit-response';
34
 
35
  /**
36
- * @typedef {import('@woocommerce/type-defs/checkout').CheckoutDispatchActions} CheckoutDispatchActions
37
  * @typedef {import('@woocommerce/type-defs/contexts').CheckoutDataContext} CheckoutDataContext
38
  */
39
 
40
- const CheckoutContext = createContext( {
41
- isComplete: false,
42
- isIdle: false,
43
- isCalculating: false,
44
- isProcessing: false,
45
- isBeforeProcessing: false,
46
- isAfterProcessing: false,
47
- hasError: false,
48
- redirectUrl: '',
49
- orderId: 0,
50
- orderNotes: '',
51
- customerId: 0,
52
- onSubmit: () => void null,
53
- // deprecated for onCheckoutValidationBeforeProcessing
54
- onCheckoutBeforeProcessing: ( callback ) => void callback,
55
- onCheckoutValidationBeforeProcessing: ( callback ) => void callback,
56
- onCheckoutAfterProcessingWithSuccess: ( callback ) => void callback,
57
- onCheckoutAfterProcessingWithError: ( callback ) => void callback,
58
- dispatchActions: {
59
- resetCheckout: () => void null,
60
- setRedirectUrl: ( url ) => void url,
61
- setHasError: ( hasError ) => void hasError,
62
- setAfterProcessing: ( response ) => void response,
63
- incrementCalculating: () => void null,
64
- decrementCalculating: () => void null,
65
- setCustomerId: ( id ) => void id,
66
- setOrderId: ( id ) => void id,
67
- setOrderNotes: ( orderNotes ) => void orderNotes,
68
- },
69
- hasOrder: false,
70
- isCart: false,
71
- shouldCreateAccount: false,
72
- setShouldCreateAccount: ( value ) => void value,
73
- } );
74
 
75
- /**
76
- * @return {CheckoutDataContext} Returns the checkout data context value
77
- */
78
- export const useCheckoutContext = () => {
79
  return useContext( CheckoutContext );
80
  };
81
 
@@ -93,13 +67,15 @@ export const CheckoutStateProvider = ( {
93
  children,
94
  redirectUrl,
95
  isCart = false,
96
- } ) => {
 
 
 
 
97
  // note, this is done intentionally so that the default state now has
98
  // the redirectUrl for when checkout is reset to PRISTINE state.
99
  DEFAULT_STATE.redirectUrl = redirectUrl;
100
  const [ checkoutState, dispatch ] = useReducer( reducer, DEFAULT_STATE );
101
- const [ observers, observerDispatch ] = useReducer( emitReducer, {} );
102
- const currentObservers = useRef( observers );
103
  const { setValidationErrors } = useValidationContext();
104
  const { addErrorNotice, removeNotices } = useStoreNotices();
105
  const { dispatchCheckoutEvent } = useStoreEvents();
@@ -116,57 +92,42 @@ export const CheckoutStateProvider = ( {
116
  expressPaymentNotices,
117
  } = useCheckoutNotices();
118
 
 
 
 
 
 
 
 
 
119
  // set observers on ref so it's always current.
120
  useEffect( () => {
121
  currentObservers.current = observers;
122
  }, [ observers ] );
 
123
  /**
124
  * @deprecated use onCheckoutValidationBeforeProcessing instead
125
  *
126
  * To prevent the deprecation message being shown at render time
127
- * we need an extra function between useMemo and emitterObservers
128
  * so that the deprecated message gets shown only at invocation time.
129
  * (useMemo calls the passed function at render time)
130
  * See: https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4039/commits/a502d1be8828848270993264c64220731b0ae181
131
  */
132
  const onCheckoutBeforeProcessing = useMemo( () => {
133
- const callback = emitterObservers( observerDispatch )
134
- .onCheckoutValidationBeforeProcessing;
135
-
136
- return function ( ...args ) {
137
  deprecated( 'onCheckoutBeforeProcessing', {
138
  alternative: 'onCheckoutValidationBeforeProcessing',
139
  plugin: 'WooCommerce Blocks',
140
  } );
141
-
142
- return callback( ...args );
143
  };
144
- }, [ observerDispatch ] );
145
 
146
- const onCheckoutValidationBeforeProcessing = useMemo(
147
- () =>
148
- emitterObservers( observerDispatch )
149
- .onCheckoutValidationBeforeProcessing,
150
- [ observerDispatch ]
151
- );
152
- const onCheckoutAfterProcessingWithSuccess = useMemo(
153
- () =>
154
- emitterObservers( observerDispatch )
155
- .onCheckoutAfterProcessingWithSuccess,
156
- [ observerDispatch ]
157
- );
158
- const onCheckoutAfterProcessingWithError = useMemo(
159
- () =>
160
- emitterObservers( observerDispatch )
161
- .onCheckoutAfterProcessingWithError,
162
- [ observerDispatch ]
163
- );
164
-
165
- /**
166
- * @type {CheckoutDispatchActions}
167
- */
168
  const dispatchActions = useMemo(
169
- () => ( {
170
  resetCheckout: () => void dispatch( actions.setPristine() ),
171
  setRedirectUrl: ( url ) =>
172
  void dispatch( actions.setRedirectUrl( url ) ),
@@ -183,35 +144,17 @@ export const CheckoutStateProvider = ( {
183
  setOrderNotes: ( orderNotes ) =>
184
  void dispatch( actions.setOrderNotes( orderNotes ) ),
185
  setAfterProcessing: ( response ) => {
186
- // capture general error message if this is an error response.
187
- if (
188
- ! response.payment_result &&
189
- response.message &&
190
- response?.data?.status !== 200
191
- ) {
192
- response.payment_result = {
193
- ...response.payment_result,
194
- message: response.message,
195
- };
196
- }
197
- if ( response.payment_result ) {
198
- if (
199
- // eslint-disable-next-line camelcase
200
- response.payment_result?.redirect_url
201
- ) {
202
- dispatch(
203
- actions.setRedirectUrl(
204
- response.payment_result.redirect_url
205
- )
206
- );
207
- }
208
  dispatch(
209
- actions.setProcessingResponse(
210
- prepareResponseData( response.payment_result )
211
- )
212
  );
213
  }
214
- void dispatch( actions.setAfterProcessing() );
 
215
  },
216
  } ),
217
  []
@@ -261,20 +204,20 @@ export const CheckoutStateProvider = ( {
261
  return;
262
  }
263
 
264
- const handleErrorResponse = ( observerResponses ) => {
265
  let errorResponse = null;
266
  observerResponses.forEach( ( response ) => {
267
- const { message, messageContext } = response;
268
  if (
269
- ( isErrorResponse( response ) ||
270
- isFailResponse( response ) ) &&
271
- message
272
  ) {
273
- const errorOptions = messageContext
274
- ? { context: messageContext }
275
- : undefined;
276
- errorResponse = response;
277
- addErrorNotice( message, errorOptions );
 
 
278
  }
279
  } );
280
  return errorResponse;
@@ -285,7 +228,7 @@ export const CheckoutStateProvider = ( {
285
  redirectUrl: checkoutState.redirectUrl,
286
  orderId: checkoutState.orderId,
287
  customerId: checkoutState.customerId,
288
- customerNote: checkoutState.customerNote,
289
  processingResponse: checkoutState.processingResponse,
290
  };
291
  if ( checkoutState.hasError ) {
@@ -309,13 +252,16 @@ export const CheckoutStateProvider = ( {
309
  } else {
310
  const hasErrorNotices =
311
  checkoutNotices.some(
312
- ( notice ) => notice.status === 'error'
 
313
  ) ||
314
  expressPaymentNotices.some(
315
- ( notice ) => notice.status === 'error'
 
316
  ) ||
317
  paymentNotices.some(
318
- ( notice ) => notice.status === 'error'
 
319
  );
320
  if ( ! hasErrorNotices ) {
321
  // no error handling in place by anything so let's fall
@@ -339,8 +285,16 @@ export const CheckoutStateProvider = ( {
339
  currentObservers.current,
340
  EMIT_TYPES.CHECKOUT_AFTER_PROCESSING_WITH_SUCCESS,
341
  data
342
- ).then( ( observerResponses ) => {
343
- let successResponse, errorResponse;
 
 
 
 
 
 
 
 
344
  observerResponses.forEach( ( response ) => {
345
  if ( isSuccessResponse( response ) ) {
346
  // the last observer response always "wins" for success.
@@ -353,9 +307,10 @@ export const CheckoutStateProvider = ( {
353
  errorResponse = response;
354
  }
355
  } );
 
356
  if ( successResponse && ! errorResponse ) {
357
  dispatch( actions.setComplete( successResponse ) );
358
- } else if ( errorResponse ) {
359
  if ( errorResponse.message ) {
360
  const errorOptions = errorResponse.messageContext
361
  ? { context: errorResponse.messageContext }
@@ -387,7 +342,7 @@ export const CheckoutStateProvider = ( {
387
  checkoutState.redirectUrl,
388
  checkoutState.orderId,
389
  checkoutState.customerId,
390
- checkoutState.customerNote,
391
  checkoutState.processingResponse,
392
  previousStatus,
393
  previousHasError,
@@ -407,10 +362,7 @@ export const CheckoutStateProvider = ( {
407
  dispatch( actions.setBeforeProcessing() );
408
  }, [ dispatchCheckoutEvent ] );
409
 
410
- /**
411
- * @type {CheckoutDataContext}
412
- */
413
- const checkoutData = {
414
  onSubmit,
415
  isComplete: checkoutState.status === STATUS.COMPLETE,
416
  isIdle: checkoutState.status === STATUS.IDLE,
13
  import { __ } from '@wordpress/i18n';
14
  import { usePrevious } from '@woocommerce/base-hooks';
15
  import deprecated from '@wordpress/deprecated';
16
+ import { isObject } from '@woocommerce/types';
17
+
18
  /**
19
  * Internal dependencies
20
  */
21
  import { actions } from './actions';
22
+ import { reducer } from './reducer';
23
+ import { getPaymentResultFromCheckoutResponse } from './utils';
24
+ import {
25
+ DEFAULT_STATE,
26
+ STATUS,
27
+ DEFAULT_CHECKOUT_STATE_DATA,
28
+ } from './constants';
29
+ import type {
30
+ CheckoutStateDispatchActions,
31
+ CheckoutStateContextType,
32
+ } from './types';
33
  import {
34
  EMIT_TYPES,
35
+ useEventEmitters,
36
  emitEvent,
37
  emitEventWithAbort,
38
  reducer as emitReducer,
44
  import { useEmitResponse } from '../../../hooks/use-emit-response';
45
 
46
  /**
 
47
  * @typedef {import('@woocommerce/type-defs/contexts').CheckoutDataContext} CheckoutDataContext
48
  */
49
 
50
+ const CheckoutContext = createContext( DEFAULT_CHECKOUT_STATE_DATA );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
+ export const useCheckoutContext = (): CheckoutStateContextType => {
 
 
 
53
  return useContext( CheckoutContext );
54
  };
55
 
67
  children,
68
  redirectUrl,
69
  isCart = false,
70
+ }: {
71
+ children: React.ReactChildren;
72
+ redirectUrl: string;
73
+ isCart: boolean;
74
+ } ): JSX.Element => {
75
  // note, this is done intentionally so that the default state now has
76
  // the redirectUrl for when checkout is reset to PRISTINE state.
77
  DEFAULT_STATE.redirectUrl = redirectUrl;
78
  const [ checkoutState, dispatch ] = useReducer( reducer, DEFAULT_STATE );
 
 
79
  const { setValidationErrors } = useValidationContext();
80
  const { addErrorNotice, removeNotices } = useStoreNotices();
81
  const { dispatchCheckoutEvent } = useStoreEvents();
92
  expressPaymentNotices,
93
  } = useCheckoutNotices();
94
 
95
+ const [ observers, observerDispatch ] = useReducer( emitReducer, {} );
96
+ const currentObservers = useRef( observers );
97
+ const {
98
+ onCheckoutAfterProcessingWithSuccess,
99
+ onCheckoutAfterProcessingWithError,
100
+ onCheckoutValidationBeforeProcessing,
101
+ } = useEventEmitters( observerDispatch );
102
+
103
  // set observers on ref so it's always current.
104
  useEffect( () => {
105
  currentObservers.current = observers;
106
  }, [ observers ] );
107
+
108
  /**
109
  * @deprecated use onCheckoutValidationBeforeProcessing instead
110
  *
111
  * To prevent the deprecation message being shown at render time
112
+ * we need an extra function between useMemo and event emitters
113
  * so that the deprecated message gets shown only at invocation time.
114
  * (useMemo calls the passed function at render time)
115
  * See: https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4039/commits/a502d1be8828848270993264c64220731b0ae181
116
  */
117
  const onCheckoutBeforeProcessing = useMemo( () => {
118
+ return function (
119
+ ...args: Parameters< typeof onCheckoutValidationBeforeProcessing >
120
+ ) {
 
121
  deprecated( 'onCheckoutBeforeProcessing', {
122
  alternative: 'onCheckoutValidationBeforeProcessing',
123
  plugin: 'WooCommerce Blocks',
124
  } );
125
+ return onCheckoutValidationBeforeProcessing( ...args );
 
126
  };
127
+ }, [ onCheckoutValidationBeforeProcessing ] );
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  const dispatchActions = useMemo(
130
+ (): CheckoutStateDispatchActions => ( {
131
  resetCheckout: () => void dispatch( actions.setPristine() ),
132
  setRedirectUrl: ( url ) =>
133
  void dispatch( actions.setRedirectUrl( url ) ),
144
  setOrderNotes: ( orderNotes ) =>
145
  void dispatch( actions.setOrderNotes( orderNotes ) ),
146
  setAfterProcessing: ( response ) => {
147
+ const paymentResult = getPaymentResultFromCheckoutResponse(
148
+ response
149
+ );
150
+
151
+ if ( paymentResult.redirectUrl ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  dispatch(
153
+ actions.setRedirectUrl( paymentResult.redirectUrl )
 
 
154
  );
155
  }
156
+ dispatch( actions.setProcessingResponse( paymentResult ) );
157
+ dispatch( actions.setAfterProcessing() );
158
  },
159
  } ),
160
  []
204
  return;
205
  }
206
 
207
+ const handleErrorResponse = ( observerResponses: unknown[] ) => {
208
  let errorResponse = null;
209
  observerResponses.forEach( ( response ) => {
 
210
  if (
211
+ isErrorResponse( response ) ||
212
+ isFailResponse( response )
 
213
  ) {
214
+ if ( response.message ) {
215
+ const errorOptions = response.messageContext
216
+ ? { context: response.messageContext }
217
+ : undefined;
218
+ errorResponse = response;
219
+ addErrorNotice( response.message, errorOptions );
220
+ }
221
  }
222
  } );
223
  return errorResponse;
228
  redirectUrl: checkoutState.redirectUrl,
229
  orderId: checkoutState.orderId,
230
  customerId: checkoutState.customerId,
231
+ orderNotes: checkoutState.orderNotes,
232
  processingResponse: checkoutState.processingResponse,
233
  };
234
  if ( checkoutState.hasError ) {
252
  } else {
253
  const hasErrorNotices =
254
  checkoutNotices.some(
255
+ ( notice: { status: string } ) =>
256
+ notice.status === 'error'
257
  ) ||
258
  expressPaymentNotices.some(
259
+ ( notice: { status: string } ) =>
260
+ notice.status === 'error'
261
  ) ||
262
  paymentNotices.some(
263
+ ( notice: { status: string } ) =>
264
+ notice.status === 'error'
265
  );
266
  if ( ! hasErrorNotices ) {
267
  // no error handling in place by anything so let's fall
285
  currentObservers.current,
286
  EMIT_TYPES.CHECKOUT_AFTER_PROCESSING_WITH_SUCCESS,
287
  data
288
+ ).then( ( observerResponses: unknown[] ) => {
289
+ let successResponse = null as null | Record<
290
+ string,
291
+ unknown
292
+ >;
293
+ let errorResponse = null as null | Record<
294
+ string,
295
+ unknown
296
+ >;
297
+
298
  observerResponses.forEach( ( response ) => {
299
  if ( isSuccessResponse( response ) ) {
300
  // the last observer response always "wins" for success.
307
  errorResponse = response;
308
  }
309
  } );
310
+
311
  if ( successResponse && ! errorResponse ) {
312
  dispatch( actions.setComplete( successResponse ) );
313
+ } else if ( isObject( errorResponse ) ) {
314
  if ( errorResponse.message ) {
315
  const errorOptions = errorResponse.messageContext
316
  ? { context: errorResponse.messageContext }
342
  checkoutState.redirectUrl,
343
  checkoutState.orderId,
344
  checkoutState.customerId,
345
+ checkoutState.orderNotes,
346
  checkoutState.processingResponse,
347
  previousStatus,
348
  previousHasError,
362
  dispatch( actions.setBeforeProcessing() );
363
  }, [ dispatchCheckoutEvent ] );
364
 
365
+ const checkoutData: CheckoutStateContextType = {
 
 
 
366
  onSubmit,
367
  isComplete: checkoutState.status === STATUS.COMPLETE,
368
  isIdle: checkoutState.status === STATUS.IDLE,
assets/js/base/context/providers/cart-checkout/checkout-state/reducer.js DELETED
@@ -1,235 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { decodeEntities } from '@wordpress/html-entities';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import { TYPES, DEFAULT_STATE, STATUS } from './constants';
10
-
11
- const {
12
- SET_PRISTINE,
13
- SET_IDLE,
14
- SET_PROCESSING,
15
- SET_BEFORE_PROCESSING,
16
- SET_AFTER_PROCESSING,
17
- SET_PROCESSING_RESPONSE,
18
- SET_REDIRECT_URL,
19
- SET_COMPLETE,
20
- SET_HAS_ERROR,
21
- SET_NO_ERROR,
22
- INCREMENT_CALCULATING,
23
- DECREMENT_CALCULATING,
24
- SET_CUSTOMER_ID,
25
- SET_ORDER_ID,
26
- SET_ORDER_NOTES,
27
- SET_SHOULD_CREATE_ACCOUNT,
28
- } = TYPES;
29
-
30
- const {
31
- PRISTINE,
32
- IDLE,
33
- PROCESSING,
34
- BEFORE_PROCESSING,
35
- AFTER_PROCESSING,
36
- COMPLETE,
37
- } = STATUS;
38
-
39
- /**
40
- * Prepares the payment_result data from the server checkout endpoint response.
41
- *
42
- * @param {Object} data The value of `payment_result` from the checkout
43
- * processing endpoint response.
44
- * @param {string} data.message If there was a general error message it will appear
45
- * on this property.
46
- * @param {string} data.payment_status The payment status. One of 'success', 'failure',
47
- * 'pending', 'error'.
48
- * @param {Array<Object>} data.payment_details An array of Objects with a 'key' property that is a
49
- * string and value property that is a string. These are
50
- * converted to a flat object where the key becomes the
51
- * object property and value the property value.
52
- *
53
- * @return {Object} A new object with 'paymentStatus', and 'paymentDetails' as the properties.
54
- */
55
- export const prepareResponseData = ( data ) => {
56
- const responseData = {
57
- message: data?.message || '',
58
- paymentStatus: data.payment_status,
59
- paymentDetails: {},
60
- };
61
- if ( Array.isArray( data.payment_details ) ) {
62
- data.payment_details.forEach( ( { key, value } ) => {
63
- responseData.paymentDetails[ key ] = decodeEntities( value );
64
- } );
65
- }
66
- return responseData;
67
- };
68
-
69
- /**
70
- * Reducer for the checkout state
71
- *
72
- * @param {Object} state Current state.
73
- * @param {Object} action Incoming action object.
74
- * @param {string} action.url URL passed in.
75
- * @param {string} action.type Type of action.
76
- * @param {string} action.customerId Customer ID.
77
- * @param {string} action.orderId Order ID.
78
- * @param {Array} action.orderNotes Order notes.
79
- * @param {boolean} action.shouldCreateAccount True if shopper has requested a user account (signup checkbox).
80
- * @param {Object} action.data Other action payload.
81
- */
82
- export const reducer = (
83
- state = DEFAULT_STATE,
84
- { url, type, customerId, orderId, orderNotes, shouldCreateAccount, data }
85
- ) => {
86
- let newState = state;
87
- switch ( type ) {
88
- case SET_PRISTINE:
89
- newState = DEFAULT_STATE;
90
- break;
91
- case SET_IDLE:
92
- newState =
93
- state.status !== IDLE
94
- ? {
95
- ...state,
96
- status: IDLE,
97
- }
98
- : state;
99
- break;
100
- case SET_REDIRECT_URL:
101
- newState =
102
- url !== state.url
103
- ? {
104
- ...state,
105
- redirectUrl: url,
106
- }
107
- : state;
108
- break;
109
- case SET_PROCESSING_RESPONSE:
110
- newState = {
111
- ...state,
112
- processingResponse: data,
113
- };
114
- break;
115
-
116
- case SET_COMPLETE:
117
- newState =
118
- state.status !== COMPLETE
119
- ? {
120
- ...state,
121
- status: COMPLETE,
122
- redirectUrl: data?.redirectUrl || state.redirectUrl,
123
- }
124
- : state;
125
- break;
126
- case SET_PROCESSING:
127
- newState =
128
- state.status !== PROCESSING
129
- ? {
130
- ...state,
131
- status: PROCESSING,
132
- hasError: false,
133
- }
134
- : state;
135
- // clear any error state.
136
- newState =
137
- newState.hasError === false
138
- ? newState
139
- : { ...newState, hasError: false };
140
- break;
141
- case SET_BEFORE_PROCESSING:
142
- newState =
143
- state.status !== BEFORE_PROCESSING
144
- ? {
145
- ...state,
146
- status: BEFORE_PROCESSING,
147
- hasError: false,
148
- }
149
- : state;
150
- break;
151
- case SET_AFTER_PROCESSING:
152
- newState =
153
- state.status !== AFTER_PROCESSING
154
- ? {
155
- ...state,
156
- status: AFTER_PROCESSING,
157
- }
158
- : state;
159
- break;
160
- case SET_HAS_ERROR:
161
- newState = state.hasError
162
- ? state
163
- : {
164
- ...state,
165
- hasError: true,
166
- };
167
- newState =
168
- state.status === PROCESSING ||
169
- state.status === BEFORE_PROCESSING
170
- ? {
171
- ...newState,
172
- status: IDLE,
173
- }
174
- : newState;
175
- break;
176
- case SET_NO_ERROR:
177
- newState = state.hasError
178
- ? {
179
- ...state,
180
- hasError: false,
181
- }
182
- : state;
183
- break;
184
- case INCREMENT_CALCULATING:
185
- newState = {
186
- ...state,
187
- calculatingCount: state.calculatingCount + 1,
188
- };
189
- break;
190
- case DECREMENT_CALCULATING:
191
- newState = {
192
- ...state,
193
- calculatingCount: Math.max( 0, state.calculatingCount - 1 ),
194
- };
195
- break;
196
- case SET_CUSTOMER_ID:
197
- newState = {
198
- ...state,
199
- customerId,
200
- };
201
- break;
202
- case SET_ORDER_ID:
203
- newState = {
204
- ...state,
205
- orderId,
206
- };
207
- break;
208
- case SET_SHOULD_CREATE_ACCOUNT:
209
- if ( shouldCreateAccount !== state.shouldCreateAccount ) {
210
- newState = {
211
- ...state,
212
- shouldCreateAccount,
213
- };
214
- }
215
- break;
216
- case SET_ORDER_NOTES:
217
- if ( state.orderNotes !== orderNotes ) {
218
- newState = {
219
- ...state,
220
- orderNotes,
221
- };
222
- }
223
- break;
224
- }
225
- // automatically update state to idle from pristine as soon as it
226
- // initially changes.
227
- if (
228
- newState !== state &&
229
- type !== SET_PRISTINE &&
230
- newState.status === PRISTINE
231
- ) {
232
- newState.status = IDLE;
233
- }
234
- return newState;
235
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/base/context/providers/cart-checkout/checkout-state/reducer.ts ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { DEFAULT_STATE, STATUS } from './constants';
5
+ import { ActionType, ACTION } from './actions';
6
+ import type { CheckoutStateContextState, PaymentResultDataType } from './types';
7
+
8
+ /**
9
+ * Reducer for the checkout state
10
+ *
11
+ * @param {Object} state Current state.
12
+ * @param {Object} action Incoming action object.
13
+ * @param {string} action.url URL passed in.
14
+ * @param {string} action.type Type of action.
15
+ * @param {string} action.customerId Customer ID.
16
+ * @param {string} action.orderId Order ID.
17
+ * @param {Array} action.orderNotes Order notes.
18
+ * @param {boolean} action.shouldCreateAccount True if shopper has requested a user account (sign-up checkbox).
19
+ * @param {Object} action.data Other action payload.
20
+ */
21
+ export const reducer = (
22
+ state = DEFAULT_STATE,
23
+ {
24
+ url,
25
+ type,
26
+ customerId,
27
+ orderId,
28
+ orderNotes,
29
+ shouldCreateAccount,
30
+ data,
31
+ }: ActionType
32
+ ): CheckoutStateContextState => {
33
+ let newState = state;
34
+ switch ( type ) {
35
+ case ACTION.SET_PRISTINE:
36
+ newState = DEFAULT_STATE;
37
+ break;
38
+ case ACTION.SET_IDLE:
39
+ newState =
40
+ state.status !== STATUS.IDLE
41
+ ? {
42
+ ...state,
43
+ status: STATUS.IDLE,
44
+ }
45
+ : state;
46
+ break;
47
+ case ACTION.SET_REDIRECT_URL:
48
+ newState =
49
+ url !== undefined && url !== state.redirectUrl
50
+ ? {
51
+ ...state,
52
+ redirectUrl: url,
53
+ }
54
+ : state;
55
+ break;
56
+ case ACTION.SET_PROCESSING_RESPONSE:
57
+ newState = {
58
+ ...state,
59
+ processingResponse: data as PaymentResultDataType,
60
+ };
61
+ break;
62
+
63
+ case ACTION.SET_COMPLETE:
64
+ newState =
65
+ state.status !== STATUS.COMPLETE
66
+ ? {
67
+ ...state,
68
+ status: STATUS.COMPLETE,
69
+ // @todo Investigate why redirectURL could be non-truthy and whether this would cause a bug if multiple gateways were used for payment e.g. 1st set the redirect URL but failed, and then the 2nd did not provide a redirect URL and succeeded.
70
+ redirectUrl:
71
+ data !== undefined &&
72
+ typeof data.redirectUrl === 'string' &&
73
+ data.redirectUrl
74
+ ? data.redirectUrl
75
+ : state.redirectUrl,
76
+ }
77
+ : state;
78
+ break;
79
+ case ACTION.SET_PROCESSING:
80
+ newState =
81
+ state.status !== STATUS.PROCESSING
82
+ ? {
83
+ ...state,
84
+ status: STATUS.PROCESSING,
85
+ hasError: false,
86
+ }
87
+ : state;
88
+ // clear any error state.
89
+ newState =
90
+ newState.hasError === false
91
+ ? newState
92
+ : { ...newState, hasError: false };
93
+ break;
94
+ case ACTION.SET_BEFORE_PROCESSING:
95
+ newState =
96
+ state.status !== STATUS.BEFORE_PROCESSING
97
+ ? {
98
+ ...state,
99
+ status: STATUS.BEFORE_PROCESSING,
100
+ hasError: false,
101
+ }
102
+ : state;
103
+ break;
104
+ case ACTION.SET_AFTER_PROCESSING:
105
+ newState =
106
+ state.status !== STATUS.AFTER_PROCESSING
107
+ ? {
108
+ ...state,
109
+ status: STATUS.AFTER_PROCESSING,
110
+ }
111
+ : state;
112
+ break;
113
+ case ACTION.SET_HAS_ERROR:
114
+ newState = state.hasError
115
+ ? state
116
+ : {
117
+ ...state,
118
+ hasError: true,
119
+ };
120
+ newState =
121
+ state.status === STATUS.PROCESSING ||
122
+ state.status === STATUS.BEFORE_PROCESSING
123
+ ? {
124
+ ...newState,
125
+ status: STATUS.IDLE,
126
+ }
127
+ : newState;
128
+ break;
129
+ case ACTION.SET_NO_ERROR:
130
+ newState = state.hasError
131
+ ? {
132
+ ...state,
133
+ hasError: false,
134
+ }
135
+ : state;
136
+ break;
137
+ case ACTION.INCREMENT_CALCULATING:
138
+ newState = {
139
+ ...state,
140
+ calculatingCount: state.calculatingCount + 1,
141
+ };
142
+ break;
143
+ case ACTION.DECREMENT_CALCULATING:
144
+ newState = {
145
+ ...state,
146
+ calculatingCount: Math.max( 0, state.calculatingCount - 1 ),
147
+ };
148
+ break;
149
+ case ACTION.SET_CUSTOMER_ID:
150
+ newState =
151
+ customerId !== undefined
152
+ ? {
153
+ ...state,
154
+ customerId,
155
+ }
156
+ : state;
157
+ break;
158
+ case ACTION.SET_ORDER_ID:
159
+ newState =
160
+ orderId !== undefined
161
+ ? {
162
+ ...state,
163
+ orderId,
164
+ }
165
+ : state;
166
+ break;
167
+ case ACTION.SET_SHOULD_CREATE_ACCOUNT:
168
+ if (
169
+ shouldCreateAccount !== undefined &&
170
+ shouldCreateAccount !== state.shouldCreateAccount
171
+ ) {
172
+ newState = {
173
+ ...state,
174
+ shouldCreateAccount,
175
+ };
176
+ }
177
+ break;
178
+ case ACTION.SET_ORDER_NOTES:
179
+ if ( orderNotes !== undefined && state.orderNotes !== orderNotes ) {
180
+ newState = {
181
+ ...state,
182
+ orderNotes,
183
+ };
184
+ }
185
+ break;
186
+ }
187
+ // automatically update state to idle from pristine as soon as it
188
+ // initially changes.
189
+ if (
190
+ newState !== state &&
191
+ type !== ACTION.SET_PRISTINE &&
192
+ newState.status === STATUS.PRISTINE
193
+ ) {
194
+ newState.status = STATUS.IDLE;
195
+ }
196
+ return newState;
197
+ };
assets/js/base/context/providers/cart-checkout/checkout-state/types.ts ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { STATUS } from './constants';
5
+ import type { emitterCallback } from '../../../event-emit';
6
+
7
+ export interface CheckoutResponseError {
8
+ code: string;
9
+ message: string;
10
+ data: {
11
+ status: number;
12
+ };
13
+ }
14
+
15
+ export interface CheckoutResponseSuccess {
16
+ // eslint-disable-next-line camelcase
17
+ payment_result: {
18
+ // eslint-disable-next-line camelcase
19
+ payment_status: 'success' | 'failure' | 'pending' | 'error';
20
+ // eslint-disable-next-line camelcase
21
+ payment_details: Record< string, string > | Record< string, never >;
22
+ // eslint-disable-next-line camelcase
23
+ redirect_url: string;
24
+ };
25
+ }
26
+
27
+ export type CheckoutResponse = CheckoutResponseSuccess | CheckoutResponseError;
28
+
29
+ export interface PaymentResultDataType {
30
+ message: string;
31
+ paymentStatus: string;
32
+ paymentDetails: Record< string, string > | Record< string, never >;
33
+ redirectUrl: string;
34
+ }
35
+
36
+ export type CheckoutStateContextState = {
37
+ redirectUrl: string;
38
+ status: STATUS;
39
+ hasError: boolean;
40
+ calculatingCount: number;
41
+ orderId: number;
42
+ orderNotes: string;
43
+ customerId: number;
44
+ shouldCreateAccount: boolean;
45
+ processingResponse: PaymentResultDataType | null;
46
+ };
47
+
48
+ export type CheckoutStateDispatchActions = {
49
+ resetCheckout: () => void;
50
+ setRedirectUrl: ( url: string ) => void;
51
+ setHasError: ( hasError: boolean ) => void;
52
+ setAfterProcessing: ( response: CheckoutResponse ) => void;
53
+ incrementCalculating: () => void;
54
+ decrementCalculating: () => void;
55
+ setCustomerId: ( id: number ) => void;
56
+ setOrderId: ( id: number ) => void;
57
+ setOrderNotes: ( orderNotes: string ) => void;
58
+ };
59
+
60
+ export type CheckoutStateContextType = {
61
+ // Dispatch actions to the checkout provider.
62
+ dispatchActions: CheckoutStateDispatchActions;
63
+ // Submits the checkout and begins processing.
64
+ onSubmit: () => void;
65
+ // True when checkout is complete and ready for redirect.
66
+ isComplete: boolean;
67
+ // True when the checkout state has changed and checkout has no activity.
68
+ isIdle: boolean;
69
+ // True when something in the checkout is resulting in totals being calculated.
70
+ isCalculating: boolean;
71
+ // True when checkout has been submitted and is being processed. Note, payment related processing happens during this state. When payment status is success, processing happens on the server.
72
+ isProcessing: boolean;
73
+ // True during any observers executing logic before checkout processing (eg. validation).
74
+ isBeforeProcessing: boolean;
75
+ // True when checkout status is AFTER_PROCESSING.
76
+ isAfterProcessing: boolean;
77
+ // True when the checkout is in an error state. Whatever caused the error (validation/payment method) will likely have triggered a notice.
78
+ hasError: boolean;
79
+ // This is the url that checkout will redirect to when it's ready.
80
+ redirectUrl: string;
81
+ // This is the ID for the draft order if one exists.
82
+ orderId: number;
83
+ // Order notes introduced by the user in the checkout form.
84
+ orderNotes: string;
85
+ // This is the ID of the customer the draft order belongs to.
86
+ customerId: number;
87
+ // Used to register a callback that will fire after checkout has been processed and there are no errors.
88
+ onCheckoutAfterProcessingWithSuccess: ReturnType< typeof emitterCallback >;
89
+ // Used to register a callback that will fire when the checkout has been processed and has an error.
90
+ onCheckoutAfterProcessingWithError: ReturnType< typeof emitterCallback >;
91
+ // Deprecated in favour of onCheckoutValidationBeforeProcessing.
92
+ onCheckoutBeforeProcessing: ReturnType< typeof emitterCallback >;
93
+ // Used to register a callback that will fire when the checkout has been submitted before being sent off to the server.
94
+ onCheckoutValidationBeforeProcessing: ReturnType< typeof emitterCallback >;
95
+ // True when the checkout has a draft order from the API.
96
+ hasOrder: boolean;
97
+ // When true, means the provider is providing data for the cart.
98
+ isCart: boolean;
99
+ // Should a user account be created?
100
+ shouldCreateAccount: boolean;
101
+ // Set if user account should be created.
102
+ setShouldCreateAccount: ( shouldCreateAccount: boolean ) => void;
103
+ };
assets/js/base/context/providers/cart-checkout/checkout-state/utils.ts ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { decodeEntities } from '@wordpress/html-entities';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import type { PaymentResultDataType, CheckoutResponse } from './types';
11
+
12
+ /**
13
+ * Prepares the payment_result data from the server checkout endpoint response.
14
+ */
15
+ export const getPaymentResultFromCheckoutResponse = (
16
+ response: CheckoutResponse
17
+ ): PaymentResultDataType => {
18
+ const paymentResult = {
19
+ message: '',
20
+ paymentStatus: '',
21
+ redirectUrl: '',
22
+ paymentDetails: {},
23
+ } as PaymentResultDataType;
24
+
25
+ // payment_result is present in successful responses.
26
+ if ( 'payment_result' in response ) {
27
+ paymentResult.paymentStatus = response.payment_result.payment_status;
28
+ paymentResult.redirectUrl = response.payment_result.redirect_url;
29
+
30
+ if (
31
+ response.payment_result.hasOwnProperty( 'payment_details' ) &&
32
+ Array.isArray( response.payment_result.payment_details )
33
+ ) {
34
+ response.payment_result.payment_details.forEach(
35
+ ( { key, value }: { key: string; value: string } ) => {
36
+ paymentResult.paymentDetails[ key ] = decodeEntities(
37
+ value
38
+ );
39
+ }
40
+ );
41
+ }
42
+ }
43
+
44
+ // message is present in error responses.
45
+ if ( 'message' in response ) {
46
+ paymentResult.message = decodeEntities( response.message );
47
+ }
48
+
49
+ // If there was an error code but no message, set a default message.
50
+ if (
51
+ ! paymentResult.message &&
52
+ 'data' in response &&
53
+ 'status' in response.data &&
54
+ response.data.status > 299
55
+ ) {
56
+ paymentResult.message = __(
57
+ 'Something went wrong. Please contact us to get assistance.',
58
+ 'woo-gutenberg-products-block'
59
+ );
60
+ }
61
+
62
+ return paymentResult;
63
+ };
assets/js/base/context/providers/cart-checkout/payment-methods/use-payment-method-registration.ts CHANGED
@@ -103,11 +103,15 @@ const usePaymentMethodRegistration = (
103
  continue;
104
  }
105
 
106
- // In front end, ask payment method if it should be available.
107
  try {
108
- const canPay = await Promise.resolve(
109
- paymentMethod.canMakePayment( canPayArgument.current )
110
- );
 
 
 
 
111
 
112
  if ( !! canPay ) {
113
  if (
103
  continue;
104
  }
105
 
106
+ // See if payment method should be available. This always evaluates to true in the editor context.
107
  try {
108
+ const canPay = isEditor
109
+ ? true
110
+ : await Promise.resolve(
111
+ paymentMethod.canMakePayment(
112
+ canPayArgument.current
113
+ )
114
+ );
115
 
116
  if ( !! canPay ) {
117
  if (
assets/js/base/utils/{address.js → address.ts} RENAMED
@@ -3,6 +3,11 @@
3
  */
4
  import { defaultAddressFields } from '@woocommerce/settings';
5
  import prepareAddressFields from '@woocommerce/base-components/cart-checkout/address-form/prepare-address-fields';
 
 
 
 
 
6
 
7
  /**
8
  * pluckAddress takes a full address object and returns relevant fields for calculating
@@ -21,27 +26,60 @@ export const pluckAddress = ( {
21
  state = '',
22
  city = '',
23
  postcode = '',
24
- } ) => ( {
 
 
 
 
 
25
  country: country.trim(),
26
  state: state.trim(),
27
  city: city.trim(),
28
  postcode: postcode ? postcode.replace( ' ', '' ).toUpperCase() : '',
29
  } );
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  /**
32
  * Sets fields to an empty string in an address if they are hidden by the settings in countryLocale.
33
  *
34
  * @param {Object} address The address to empty fields from.
35
  * @return {Object} The address with hidden fields values removed.
36
  */
37
- export const emptyHiddenAddressFields = ( address ) => {
 
 
 
 
38
  const fields = Object.keys( defaultAddressFields );
39
  const addressFields = prepareAddressFields( fields, {}, address.country );
40
- const newAddress = Object.assign( {}, address );
41
- addressFields.forEach( ( field ) => {
42
- if ( field.hidden ) {
43
- newAddress[ field.key ] = '';
 
44
  }
45
  } );
 
46
  return newAddress;
47
  };
3
  */
4
  import { defaultAddressFields } from '@woocommerce/settings';
5
  import prepareAddressFields from '@woocommerce/base-components/cart-checkout/address-form/prepare-address-fields';
6
+ import { isEmail } from '@wordpress/url';
7
+ import type {
8
+ CartResponseBillingAddress,
9
+ CartResponseShippingAddress,
10
+ } from '@woocommerce/types';
11
 
12
  /**
13
  * pluckAddress takes a full address object and returns relevant fields for calculating
26
  state = '',
27
  city = '',
28
  postcode = '',
29
+ }: CartResponseBillingAddress | CartResponseShippingAddress ): {
30
+ country: string;
31
+ state: string;
32
+ city: string;
33
+ postcode: string;
34
+ } => ( {
35
  country: country.trim(),
36
  state: state.trim(),
37
  city: city.trim(),
38
  postcode: postcode ? postcode.replace( ' ', '' ).toUpperCase() : '',
39
  } );
40
 
41
+ /**
42
+ * pluckEmail takes a full address object and returns only the email address, if set and valid. Otherwise returns an empty string.
43
+ *
44
+ * @param {Object} address An object containing all address information
45
+ * @param {string} address.email The email address.
46
+ * @return {string} The email address.
47
+ */
48
+ export const pluckEmail = ( {
49
+ email = '',
50
+ }: CartResponseBillingAddress ): string =>
51
+ isEmail( email ) ? email.trim() : '';
52
+
53
+ /**
54
+ * Type-guard.
55
+ */
56
+ const isValidAddressKey = (
57
+ key: string,
58
+ address: CartResponseBillingAddress | CartResponseShippingAddress
59
+ ): key is keyof typeof address => {
60
+ return key in address;
61
+ };
62
+
63
  /**
64
  * Sets fields to an empty string in an address if they are hidden by the settings in countryLocale.
65
  *
66
  * @param {Object} address The address to empty fields from.
67
  * @return {Object} The address with hidden fields values removed.
68
  */
69
+ export const emptyHiddenAddressFields = <
70
+ T extends CartResponseBillingAddress | CartResponseShippingAddress
71
+ >(
72
+ address: T
73
+ ): T => {
74
  const fields = Object.keys( defaultAddressFields );
75
  const addressFields = prepareAddressFields( fields, {}, address.country );
76
+ const newAddress = Object.assign( {}, address ) as T;
77
+
78
+ addressFields.forEach( ( { key = '', hidden = false } ) => {
79
+ if ( hidden && isValidAddressKey( key, address ) ) {
80
+ newAddress[ key ] = '';
81
  }
82
  } );
83
+
84
  return newAddress;
85
  };
assets/js/base/utils/index.js CHANGED
@@ -8,4 +8,3 @@ export * from './get-valid-block-attributes';
8
  export * from './product-data';
9
  export * from './derive-selected-shipping-rates';
10
  export * from './from-entries-polyfill';
11
- export * from './type-guards';
8
  export * from './product-data';
9
  export * from './derive-selected-shipping-rates';
10
  export * from './from-entries-polyfill';
 
assets/js/blocks/active-filters/block.js CHANGED
@@ -6,7 +6,7 @@ import { useQueryStateByKey } from '@woocommerce/base-context/hooks';
6
  import { useMemo } from '@wordpress/element';
7
  import classnames from 'classnames';
8
  import PropTypes from 'prop-types';
9
- import Label from '@woocommerce/base-components/label';
10
 
11
  /**
12
  * Internal dependencies
6
  import { useMemo } from '@wordpress/element';
7
  import classnames from 'classnames';
8
  import PropTypes from 'prop-types';
9
+ import { Label } from '@woocommerce/blocks-checkout';
10
 
11
  /**
12
  * Internal dependencies
assets/js/blocks/active-filters/utils.js CHANGED
@@ -4,7 +4,7 @@
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.
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/blocks-checkout';
8
 
9
  /**
10
  * Format a min/max price range to display.
assets/js/blocks/attribute-filter/edit.js CHANGED
@@ -15,7 +15,7 @@ import {
15
  } from '@wordpress/components';
16
  import { Icon, server, external } from '@woocommerce/icons';
17
  import { SearchListControl } from '@woocommerce/components';
18
- import { mapValues, toArray, sortBy, find } from 'lodash';
19
  import { getAdminLink, getSetting } from '@woocommerce/settings';
20
  import HeadingToolbar from '@woocommerce/editor-components/heading-toolbar';
21
  import BlockTitle from '@woocommerce/editor-components/block-title';
@@ -212,7 +212,7 @@ const Edit = ( { attributes, setAttributes, debouncedSpeak } ) => {
212
  ) }
213
  initialOpen={ false }
214
  >
215
- { renderAttributeControl() }
216
  </PanelBody>
217
  </InspectorControls>
218
  );
@@ -274,10 +274,9 @@ const Edit = ( { attributes, setAttributes, debouncedSpeak } ) => {
274
  }
275
 
276
  const selectedId = selected[ 0 ].id;
277
- const productAttribute = find( ATTRIBUTES, [
278
- 'attribute_id',
279
- selectedId.toString(),
280
- ] );
281
 
282
  if ( ! productAttribute || attributeId === selectedId ) {
283
  return;
@@ -295,7 +294,7 @@ const Edit = ( { attributes, setAttributes, debouncedSpeak } ) => {
295
  } );
296
  };
297
 
298
- const renderAttributeControl = () => {
299
  const messages = {
300
  clear: __(
301
  'Clear selected attribute',
@@ -347,6 +346,7 @@ const Edit = ( { attributes, setAttributes, debouncedSpeak } ) => {
347
  onChange={ onChange }
348
  messages={ messages }
349
  isSingle
 
350
  />
351
  );
352
  };
@@ -366,7 +366,7 @@ const Edit = ( { attributes, setAttributes, debouncedSpeak } ) => {
366
  ) }
367
  >
368
  <div className="wc-block-attribute-filter__selection">
369
- { renderAttributeControl() }
370
  <Button isPrimary onClick={ onDone }>
371
  { __( 'Done', 'woo-gutenberg-products-block' ) }
372
  </Button>
15
  } from '@wordpress/components';
16
  import { Icon, server, external } from '@woocommerce/icons';
17
  import { SearchListControl } from '@woocommerce/components';
18
+ import { mapValues, toArray, sortBy } from 'lodash';
19
  import { getAdminLink, getSetting } from '@woocommerce/settings';
20
  import HeadingToolbar from '@woocommerce/editor-components/heading-toolbar';
21
  import BlockTitle from '@woocommerce/editor-components/block-title';
212
  ) }
213
  initialOpen={ false }
214
  >
215
+ { renderAttributeControl( { isCompact: true } ) }
216
  </PanelBody>
217
  </InspectorControls>
218
  );
274
  }
275
 
276
  const selectedId = selected[ 0 ].id;
277
+ const productAttribute = ATTRIBUTES.find(
278
+ ( attribute ) => attribute.attribute_id === selectedId.toString()
279
+ );
 
280
 
281
  if ( ! productAttribute || attributeId === selectedId ) {
282
  return;
294
  } );
295
  };
296
 
297
+ const renderAttributeControl = ( { isCompact } ) => {
298
  const messages = {
299
  clear: __(
300
  'Clear selected attribute',
346
  onChange={ onChange }
347
  messages={ messages }
348
  isSingle
349
+ isCompact={ isCompact }
350
  />
351
  );
352
  };
366
  ) }
367
  >
368
  <div className="wc-block-attribute-filter__selection">
369
+ { renderAttributeControl( { isCompact: false } ) }
370
  <Button isPrimary onClick={ onDone }>
371
  { __( 'Done', 'woo-gutenberg-products-block' ) }
372
  </Button>
assets/js/blocks/attribute-filter/label.js CHANGED
@@ -2,7 +2,7 @@
2
  * External dependencies
3
  */
4
  import { _n, sprintf } from '@wordpress/i18n';
5
- import Label from '@woocommerce/base-components/label';
6
 
7
  /**
8
  * The label for an attribute term filter.
2
  * External dependencies
3
  */
4
  import { _n, sprintf } from '@wordpress/i18n';
5
+ import { Label } from '@woocommerce/blocks-checkout';
6
 
7
  /**
8
  * The label for an attribute term filter.
assets/js/blocks/cart-checkout/cart/attributes.js CHANGED
@@ -21,6 +21,10 @@ const blockAttributes = {
21
  type: 'boolean',
22
  default: getSetting( 'hasDarkEditorStyleSupport', false ),
23
  },
 
 
 
 
24
  };
25
 
26
  export default blockAttributes;
21
  type: 'boolean',
22
  default: getSetting( 'hasDarkEditorStyleSupport', false ),
23
  },
24
+ showRateAfterTaxName: {
25
+ type: 'boolean',
26
+ default: true,
27
+ },
28
  };
29
 
30
  export default blockAttributes;
assets/js/blocks/cart-checkout/cart/checkout-button/index.js CHANGED
@@ -4,7 +4,7 @@
4
  import { __ } from '@wordpress/i18n';
5
  import { useState, useEffect } from '@wordpress/element';
6
  import { PaymentMethodIcons } from '@woocommerce/base-components/cart-checkout';
7
- import Button from '@woocommerce/base-components/button';
8
  import { CHECKOUT_URL } from '@woocommerce/block-settings';
9
  import { useCheckoutContext } from '@woocommerce/base-context';
10
  import { usePaymentMethods } from '@woocommerce/base-context/hooks';
@@ -40,14 +40,12 @@ const CheckoutButton = ( { link } ) => {
40
  const { paymentMethods } = usePaymentMethods();
41
 
42
  useEffect( () => {
43
- // Add a listener for when the page is unloaded (specifically needed for Safari)
44
- // to remove the spinner on the checkout button, so the saved page snapshot does not
45
- // contain the spinner class. See https://archive.is/lOEW0 for why this is needed.
46
 
47
  if (
48
- ! window ||
49
- typeof window.addEventListener !== 'function' ||
50
- typeof window.removeEventListener !== 'function'
51
  ) {
52
  return;
53
  }
@@ -56,10 +54,10 @@ const CheckoutButton = ( { link } ) => {
56
  setShowSpinner( false );
57
  };
58
 
59
- window.addEventListener( 'beforeunload', hideSpinner );
60
 
61
  return () => {
62
- window.removeEventListener( 'beforeunload', hideSpinner );
63
  };
64
  }, [] );
65
 
4
  import { __ } from '@wordpress/i18n';
5
  import { useState, useEffect } from '@wordpress/element';
6
  import { PaymentMethodIcons } from '@woocommerce/base-components/cart-checkout';
7
+ import { Button } from '@woocommerce/blocks-checkout';
8
  import { CHECKOUT_URL } from '@woocommerce/block-settings';
9
  import { useCheckoutContext } from '@woocommerce/base-context';
10
  import { usePaymentMethods } from '@woocommerce/base-context/hooks';
40
  const { paymentMethods } = usePaymentMethods();
41
 
42
  useEffect( () => {
43
+ // Add a listener to remove the spinner on the checkout button, so the saved page snapshot does not
44
+ // contain the spinner class. See https://archive.is/lOEW0 for why this is needed for Safari.
 
45
 
46
  if (
47
+ typeof global.addEventListener !== 'function' ||
48
+ typeof global.removeEventListener !== 'function'
 
49
  ) {
50
  return;
51
  }
54
  setShowSpinner( false );
55
  };
56
 
57
+ global.addEventListener( 'pageshow', hideSpinner );
58
 
59
  return () => {
60
+ global.removeEventListener( 'pageshow', hideSpinner );
61
  };
62
  }, [] );
63
 
assets/js/blocks/cart-checkout/cart/edit.js CHANGED
@@ -39,6 +39,7 @@ const BlockSettings = ( { attributes, setAttributes } ) => {
39
  isShippingCalculatorEnabled,
40
  checkoutPageId,
41
  hasDarkControls,
 
42
  } = attributes;
43
  const { currentPostId } = useEditorContext();
44
  const { current: savedCheckoutPageId } = useRef( checkoutPageId );
@@ -95,6 +96,30 @@ const BlockSettings = ( { attributes, setAttributes } ) => {
95
  />
96
  </PanelBody>
97
  ) }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  { ! (
99
  currentPostId === CART_PAGE_ID && savedCheckoutPageId === 0
100
  ) && (
39
  isShippingCalculatorEnabled,
40
  checkoutPageId,
41
  hasDarkControls,
42
+ showRateAfterTaxName,
43
  } = attributes;
44
  const { currentPostId } = useEditorContext();
45
  const { current: savedCheckoutPageId } = useRef( checkoutPageId );
96
  />
97
  </PanelBody>
98
  ) }
99
+ { getSetting( 'taxesEnabled' ) &&
100
+ getSetting( 'displayItemizedTaxes', false ) &&
101
+ ! getSetting( 'displayCartPricesIncludingTax', false ) && (
102
+ <PanelBody
103
+ title={ __( 'Taxes', 'woo-gutenberg-products-block' ) }
104
+ >
105
+ <ToggleControl
106
+ label={ __(
107
+ 'Show rate after tax name',
108
+ 'woo-gutenberg-products-block'
109
+ ) }
110
+ help={ __(
111
+ 'Show the percentage rate alongside each tax line in the summary.',
112
+ 'woo-gutenberg-products-block'
113
+ ) }
114
+ checked={ showRateAfterTaxName }
115
+ onChange={ () =>
116
+ setAttributes( {
117
+ showRateAfterTaxName: ! showRateAfterTaxName,
118
+ } )
119
+ }
120
+ />
121
+ </PanelBody>
122
+ ) }
123
  { ! (
124
  currentPostId === CART_PAGE_ID && savedCheckoutPageId === 0
125
  ) && (
assets/js/blocks/cart-checkout/cart/full-cart/cart-line-item-row.tsx CHANGED
@@ -9,6 +9,7 @@ import ProductName from '@woocommerce/base-components/product-name';
9
  import {
10
  useStoreCartItemQuantity,
11
  useStoreEvents,
 
12
  } from '@woocommerce/base-context/hooks';
13
  import {
14
  ProductBackorderBadge,
@@ -29,7 +30,7 @@ import {
29
  import Dinero from 'dinero.js';
30
  import { useCallback, useMemo } from '@wordpress/element';
31
  import type { CartItem } from '@woocommerce/type-defs/cart';
32
- import { objectHasProp } from '@woocommerce/base-utils';
33
  import { getSetting } from '@woocommerce/settings';
34
 
35
  /**
@@ -114,12 +115,18 @@ const CartLineItemRow = ( {
114
  ( value ) => mustBeString( value ) && mustContain( value, '<price/>' ),
115
  []
116
  );
 
 
 
 
 
117
  const arg = useMemo(
118
  () => ( {
119
  context: 'cart',
120
  cartItem: lineItem,
 
121
  } ),
122
- [ lineItem ]
123
  );
124
  const priceCurrency = getCurrencyFromPriceResponse( prices );
125
  const name = __experimentalApplyCheckoutFilter( {
9
  import {
10
  useStoreCartItemQuantity,
11
  useStoreEvents,
12
+ useStoreCart,
13
  } from '@woocommerce/base-context/hooks';
14
  import {
15
  ProductBackorderBadge,
30
  import Dinero from 'dinero.js';
31
  import { useCallback, useMemo } from '@wordpress/element';
32
  import type { CartItem } from '@woocommerce/type-defs/cart';
33
+ import { objectHasProp } from '@woocommerce/types';
34
  import { getSetting } from '@woocommerce/settings';
35
 
36
  /**
115
  ( value ) => mustBeString( value ) && mustContain( value, '<price/>' ),
116
  []
117
  );
118
+
119
+ // Prepare props to pass to the __experimentalApplyCheckoutFilter filter.
120
+ // We need to pluck out receiveCart.
121
+ // eslint-disable-next-line no-unused-vars
122
+ const { receiveCart, ...cart } = useStoreCart();
123
  const arg = useMemo(
124
  () => ( {
125
  context: 'cart',
126
  cartItem: lineItem,
127
+ cart,
128
  } ),
129
+ [ lineItem, cart ]
130
  );
131
  const priceCurrency = getCurrencyFromPriceResponse( prices );
132
  const name = __experimentalApplyCheckoutFilter( {
assets/js/blocks/cart-checkout/cart/full-cart/index.tsx CHANGED
@@ -48,6 +48,7 @@ interface CartAttributes {
48
  isShippingCalculatorEnabled: boolean;
49
  checkoutPageId: number;
50
  isPreview: boolean;
 
51
  }
52
 
53
  interface CartProps {
@@ -60,7 +61,11 @@ interface CartProps {
60
  * @param {Object} props.attributes Incoming attributes for block.
61
  */
62
  const Cart = ( { attributes }: CartProps ) => {
63
- const { isShippingCalculatorEnabled, hasDarkControls } = attributes;
 
 
 
 
64
 
65
  const {
66
  cartItems,
@@ -141,6 +146,12 @@ const Cart = ( { attributes }: CartProps ) => {
141
  removeCoupon={ removeCoupon }
142
  values={ cartTotals }
143
  />
 
 
 
 
 
 
144
  { cartNeedsShipping && (
145
  <TotalsShipping
146
  showCalculator={ isShippingCalculatorEnabled }
@@ -154,16 +165,12 @@ const Cart = ( { attributes }: CartProps ) => {
154
  false
155
  ) && (
156
  <TotalsTaxes
 
157
  currency={ totalsCurrency }
158
  values={ cartTotals }
159
  />
160
  ) }
161
- { getSetting( 'couponsEnabled', true ) && (
162
- <TotalsCoupon
163
- onSubmit={ applyCoupon }
164
- isLoading={ isApplyingCoupon }
165
- />
166
- ) }
167
  <TotalsFooterItem
168
  currency={ totalsCurrency }
169
  values={ cartTotals }
48
  isShippingCalculatorEnabled: boolean;
49
  checkoutPageId: number;
50
  isPreview: boolean;
51
+ showRateAfterTaxName: boolean;
52
  }
53
 
54
  interface CartProps {
61
  * @param {Object} props.attributes Incoming attributes for block.
62
  */
63
  const Cart = ( { attributes }: CartProps ) => {
64
+ const {
65
+ isShippingCalculatorEnabled,
66
+ hasDarkControls,
67
+ showRateAfterTaxName,
68
+ } = attributes;
69
 
70
  const {
71
  cartItems,
146
  removeCoupon={ removeCoupon }
147
  values={ cartTotals }
148
  />
149
+ { getSetting( 'couponsEnabled', true ) && (
150
+ <TotalsCoupon
151
+ onSubmit={ applyCoupon }
152
+ isLoading={ isApplyingCoupon }
153
+ />
154
+ ) }
155
  { cartNeedsShipping && (
156
  <TotalsShipping
157
  showCalculator={ isShippingCalculatorEnabled }
165
  false
166
  ) && (
167
  <TotalsTaxes
168
+ showRateAfterTaxName={ showRateAfterTaxName }
169
  currency={ totalsCurrency }
170
  values={ cartTotals }
171
  />
172
  ) }
173
+
 
 
 
 
 
174
  <TotalsFooterItem
175
  currency={ totalsCurrency }
176
  values={ cartTotals }
assets/js/blocks/cart-checkout/cart/full-cart/style.scss CHANGED
@@ -78,8 +78,17 @@ table.wc-block-cart-items {
78
  }
79
  }
80
 
81
- .wc-block-cart .wc-block-components-shipping-rates-control__package {
82
- @include with-translucent-border(1px 0 0);
 
 
 
 
 
 
 
 
 
83
  }
84
 
85
  // Loading placeholder state.
@@ -236,13 +245,15 @@ table.wc-block-cart-items {
236
  }
237
  td {
238
  @include with-translucent-border(1px 0 0);
239
- padding: $gap $gap $gap 0;
240
  vertical-align: top;
241
  }
242
- th:last-child,
243
- td:last-child {
244
  padding-right: 0;
245
  }
 
 
 
246
  }
247
 
248
  .wc-block-components-radio-control__input {
78
  }
79
  }
80
 
81
+ .wc-block-cart {
82
+ .wc-block-components-totals-taxes,
83
+ .wc-block-components-totals-footer-item {
84
+ @include with-translucent-border(1px 0 0);
85
+ margin: 0;
86
+ padding: em($gap-small) 0;
87
+ }
88
+
89
+ .wc-block-components-totals-footer-item {
90
+ @include with-translucent-border(1px 0);
91
+ }
92
  }
93
 
94
  // Loading placeholder state.
245
  }
246
  td {
247
  @include with-translucent-border(1px 0 0);
248
+ padding: $gap 0 $gap $gap;
249
  vertical-align: top;
250
  }
251
+ th:last-child {
 
252
  padding-right: 0;
253
  }
254
+ td:last-child {
255
+ padding-right: $gap;
256
+ }
257
  }
258
 
259
  .wc-block-components-radio-control__input {
assets/js/blocks/cart-checkout/cart/test/__snapshots__/block.js.snap ADDED
@@ -0,0 +1,2084 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Testing cart Contains a Taxes section if Core options are set to show it 1`] = `
4
+ <div>
5
+ <div
6
+ aria-hidden="true"
7
+ class="with-scroll-to-top__scroll-point"
8
+ />
9
+ <h2
10
+ class="wc-block-components-title"
11
+ >
12
+ Your cart (3 items)
13
+ </h2>
14
+ <div
15
+ class="wc-block-components-sidebar-layout wc-block-cart"
16
+ >
17
+ <iframe
18
+ aria-hidden="true"
19
+ frameborder="0"
20
+ src="about:blank"
21
+ style="display: block; opacity: 0; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"
22
+ tabindex="-1"
23
+ />
24
+ <div
25
+ class="wc-block-components-main wc-block-cart__main"
26
+ >
27
+ <table
28
+ class="wc-block-cart-items"
29
+ >
30
+ <thead>
31
+ <tr
32
+ class="wc-block-cart-items__header"
33
+ >
34
+ <th
35
+ class="wc-block-cart-items__header-image"
36
+ >
37
+ <span>
38
+ Product
39
+ </span>
40
+ </th>
41
+ <th
42
+ class="wc-block-cart-items__header-product"
43
+ >
44
+ <span>
45
+ Details
46
+ </span>
47
+ </th>
48
+ <th
49
+ class="wc-block-cart-items__header-total"
50
+ >
51
+ <span>
52
+ Total
53
+ </span>
54
+ </th>
55
+ </tr>
56
+ </thead>
57
+ <tbody>
58
+ <tr
59
+ class="wc-block-cart-items__row"
60
+ >
61
+ <td
62
+ aria-hidden="true"
63
+ class="wc-block-cart-item__image"
64
+ >
65
+ <a
66
+ href="https://example.org"
67
+ tabindex="-1"
68
+ >
69
+ <img
70
+ alt=""
71
+ src="assets/img/beanie.jpg"
72
+ />
73
+ </a>
74
+ </td>
75
+ <td
76
+ class="wc-block-cart-item__product"
77
+ >
78
+ <a
79
+ class="wc-block-components-product-name"
80
+ href="https://example.org"
81
+ >
82
+ Beanie
83
+ </a>
84
+ <div
85
+ class="wc-block-components-product-badge wc-block-components-product-low-stock-badge"
86
+ >
87
+ 2 left in stock
88
+ </div>
89
+ <div
90
+ class="wc-block-cart-item__prices"
91
+ >
92
+ <span
93
+ class="price wc-block-components-product-price"
94
+ >
95
+ <span
96
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
97
+ >
98
+ $6.40
99
+ </span>
100
+ </span>
101
+ </div>
102
+ <div
103
+ class="wc-block-components-product-metadata"
104
+ >
105
+ <div
106
+ class="wc-block-components-product-metadata__description"
107
+ >
108
+ <p>
109
+ Warm hat for winter
110
+ </p>
111
+
112
+
113
+ </div>
114
+ <ul
115
+ class="wc-block-components-product-details"
116
+ >
117
+ <li
118
+ class="wc-block-components-product-details__color"
119
+ >
120
+ <span
121
+ class="wc-block-components-product-details__name"
122
+ >
123
+ Color
124
+ :
125
+ </span>
126
+
127
+ <span
128
+ class="wc-block-components-product-details__value"
129
+ >
130
+ Yellow
131
+ </span>
132
+ </li>
133
+ <li
134
+ class="wc-block-components-product-details__size"
135
+ >
136
+ <span
137
+ class="wc-block-components-product-details__name"
138
+ >
139
+ Size
140
+ :
141
+ </span>
142
+
143
+ <span
144
+ class="wc-block-components-product-details__value"
145
+ >
146
+ Small
147
+ </span>
148
+ </li>
149
+ </ul>
150
+ </div>
151
+ <div
152
+ class="wc-block-cart-item__quantity"
153
+ >
154
+ <div
155
+ class="wc-block-components-quantity-selector"
156
+ >
157
+ <input
158
+ aria-label="Quantity of Beanie in your cart."
159
+ class="wc-block-components-quantity-selector__input"
160
+ min="0"
161
+ step="1"
162
+ type="number"
163
+ value="2"
164
+ />
165
+ <button
166
+ aria-label="Reduce quantity"
167
+ class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
168
+ >
169
+
170
+ </button>
171
+ <button
172
+ aria-label="Increase quantity"
173
+ class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
174
+ >
175
+
176
+ </button>
177
+ </div>
178
+ <button
179
+ class="wc-block-cart-item__remove-link"
180
+ >
181
+ Remove item
182
+ </button>
183
+ </div>
184
+ </td>
185
+ <td
186
+ class="wc-block-cart-item__total"
187
+ >
188
+ <div
189
+ class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
190
+ >
191
+ <span
192
+ class="price wc-block-components-product-price"
193
+ >
194
+ <span
195
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
196
+ >
197
+ $12.80
198
+ </span>
199
+ </span>
200
+ </div>
201
+ </td>
202
+ </tr>
203
+ <tr
204
+ class="wc-block-cart-items__row"
205
+ >
206
+ <td
207
+ aria-hidden="true"
208
+ class="wc-block-cart-item__image"
209
+ >
210
+ <a
211
+ href="https://example.org"
212
+ tabindex="-1"
213
+ >
214
+ <img
215
+ alt=""
216
+ src="assets/img/cap.jpg"
217
+ />
218
+ </a>
219
+ </td>
220
+ <td
221
+ class="wc-block-cart-item__product"
222
+ >
223
+ <a
224
+ class="wc-block-components-product-name"
225
+ href="https://example.org"
226
+ >
227
+ Cap
228
+ </a>
229
+ <div
230
+ class="wc-block-cart-item__prices"
231
+ >
232
+ <span
233
+ class="price wc-block-components-product-price"
234
+ >
235
+ <span
236
+ class="screen-reader-text"
237
+ >
238
+ Previous price:
239
+ </span>
240
+ <del
241
+ class="wc-block-components-product-price__regular"
242
+ >
243
+ $12.80
244
+ </del>
245
+ <span
246
+ class="screen-reader-text"
247
+ >
248
+ Discounted price:
249
+ </span>
250
+ <ins
251
+ class="wc-block-components-product-price__value is-discounted"
252
+ >
253
+ $11.20
254
+ </ins>
255
+ </span>
256
+ </div>
257
+ <div
258
+ class="wc-block-components-product-badge wc-block-components-sale-badge"
259
+ >
260
+ Save
261
+ <span
262
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
263
+ >
264
+ $1.60
265
+ </span>
266
+ </div>
267
+ <div
268
+ class="wc-block-components-product-metadata"
269
+ >
270
+ <div
271
+ class="wc-block-components-product-metadata__description"
272
+ >
273
+ <p>
274
+ Lightweight baseball cap
275
+ </p>
276
+
277
+
278
+ </div>
279
+ <ul
280
+ class="wc-block-components-product-details"
281
+ >
282
+ <li
283
+ class="wc-block-components-product-details__color"
284
+ >
285
+ <span
286
+ class="wc-block-components-product-details__name"
287
+ >
288
+ Color
289
+ :
290
+ </span>
291
+
292
+ <span
293
+ class="wc-block-components-product-details__value"
294
+ >
295
+ Orange
296
+ </span>
297
+ </li>
298
+ </ul>
299
+ </div>
300
+ <div
301
+ class="wc-block-cart-item__quantity"
302
+ >
303
+ <div
304
+ class="wc-block-components-quantity-selector"
305
+ >
306
+ <input
307
+ aria-label="Quantity of Cap in your cart."
308
+ class="wc-block-components-quantity-selector__input"
309
+ min="0"
310
+ step="1"
311
+ type="number"
312
+ value="1"
313
+ />
314
+ <button
315
+ aria-label="Reduce quantity"
316
+ class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
317
+ disabled=""
318
+ >
319
+
320
+ </button>
321
+ <button
322
+ aria-label="Increase quantity"
323
+ class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
324
+ >
325
+
326
+ </button>
327
+ </div>
328
+ <button
329
+ class="wc-block-cart-item__remove-link"
330
+ >
331
+ Remove item
332
+ </button>
333
+ </div>
334
+ </td>
335
+ <td
336
+ class="wc-block-cart-item__total"
337
+ >
338
+ <div
339
+ class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
340
+ >
341
+ <span
342
+ class="price wc-block-components-product-price"
343
+ >
344
+ <span
345
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
346
+ >
347
+ $11.20
348
+ </span>
349
+ </span>
350
+ </div>
351
+ </td>
352
+ </tr>
353
+ </tbody>
354
+ </table>
355
+ </div>
356
+ <div
357
+ class="wc-block-components-sidebar wc-block-cart__sidebar"
358
+ >
359
+ <h2
360
+ class="wc-block-components-title wc-block-cart__totals-title"
361
+ >
362
+ Cart totals
363
+ </h2>
364
+ <div
365
+ class="wc-block-components-totals-item"
366
+ >
367
+ <span
368
+ class="wc-block-components-totals-item__label"
369
+ >
370
+ Subtotal
371
+ </span>
372
+ <span
373
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
374
+ >
375
+ $24.00
376
+ </span>
377
+ <div
378
+ class="wc-block-components-totals-item__description"
379
+ />
380
+ </div>
381
+ <div
382
+ class="wc-block-components-totals-coupon wc-block-components-panel has-border"
383
+ >
384
+ <div>
385
+ <button
386
+ aria-expanded="false"
387
+ class="wc-block-components-panel__button"
388
+ >
389
+ <svg
390
+ aria-hidden="true"
391
+ class="wc-block-components-panel__button-icon"
392
+ focusable="false"
393
+ height="24"
394
+ role="img"
395
+ viewBox="0 0 24 24"
396
+ width="24"
397
+ xmlns="http://www.w3.org/2000/svg"
398
+ >
399
+ <path
400
+ d="M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"
401
+ />
402
+ </svg>
403
+ <span
404
+ aria-hidden="true"
405
+ >
406
+ Coupon code
407
+ </span>
408
+ <span
409
+ class="screen-reader-text"
410
+ >
411
+ Apply a coupon code
412
+ </span>
413
+ </button>
414
+ </div>
415
+ <div
416
+ class="wc-block-components-panel__content"
417
+ hidden=""
418
+ >
419
+ <div
420
+ class="wc-block-components-totals-coupon__content"
421
+ >
422
+ <form
423
+ class="wc-block-components-totals-coupon__form"
424
+ >
425
+ <div
426
+ class="wc-block-components-text-input wc-block-components-totals-coupon__input is-active"
427
+ >
428
+ <input
429
+ aria-describedby=""
430
+ aria-label="Enter code"
431
+ autocapitalize="off"
432
+ autocomplete="off"
433
+ id="wc-block-components-totals-coupon__input-3"
434
+ type="text"
435
+ value=""
436
+ />
437
+ <label
438
+ for="wc-block-components-totals-coupon__input-3"
439
+ >
440
+ Enter code
441
+ </label>
442
+ </div>
443
+ <button
444
+ class="components-button wc-block-components-button wc-block-components-totals-coupon__button"
445
+ disabled=""
446
+ type="submit"
447
+ >
448
+ <span
449
+ class="wc-block-components-button__text"
450
+ >
451
+ Apply
452
+ </span>
453
+ </button>
454
+ </form>
455
+ </div>
456
+ </div>
457
+ </div>
458
+ <div
459
+ class="wc-block-components-totals-shipping"
460
+ >
461
+ <div
462
+ class="wc-block-components-totals-item"
463
+ >
464
+ <span
465
+ class="wc-block-components-totals-item__label"
466
+ >
467
+ Shipping
468
+ </span>
469
+ <span
470
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
471
+ >
472
+ $0.00
473
+ </span>
474
+ <div
475
+ class="wc-block-components-totals-item__description"
476
+ >
477
+ <div
478
+ class="wc-block-components-totals-item__description wc-block-components-totals-shipping__via"
479
+ >
480
+ via
481
+
482
+ Free shipping
483
+ </div>
484
+ </div>
485
+ </div>
486
+ <fieldset
487
+ class="wc-block-components-totals-shipping__fieldset"
488
+ >
489
+ <legend
490
+ class="screen-reader-text"
491
+ >
492
+ Shipping options
493
+ </legend>
494
+ <div
495
+ class="wc-block-components-shipping-rates-control wc-block-components-totals-shipping__options"
496
+ >
497
+ <div
498
+ class="wc-block-components-shipping-rates-control__package wc-block-components-panel"
499
+ >
500
+ <div>
501
+ <button
502
+ aria-expanded="true"
503
+ class="wc-block-components-panel__button"
504
+ >
505
+ <svg
506
+ aria-hidden="true"
507
+ class="wc-block-components-panel__button-icon"
508
+ focusable="false"
509
+ height="24"
510
+ role="img"
511
+ viewBox="0 0 24 24"
512
+ width="24"
513
+ xmlns="http://www.w3.org/2000/svg"
514
+ >
515
+ <path
516
+ d="M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z"
517
+ />
518
+ </svg>
519
+ <div
520
+ class="wc-block-components-shipping-rates-control__package-title"
521
+ >
522
+ Shipping
523
+ </div>
524
+ </button>
525
+ </div>
526
+ <div
527
+ class="wc-block-components-panel__content"
528
+ >
529
+ <div
530
+ class="wc-block-components-radio-control"
531
+ >
532
+ <label
533
+ class="wc-block-components-radio-control__option wc-block-components-radio-control__option-checked"
534
+ for="radio-control-3-free_shipping:1"
535
+ >
536
+ <input
537
+ aria-describedby="radio-control-3-free_shipping:1__label radio-control-3-free_shipping:1__description"
538
+ checked=""
539
+ class="wc-block-components-radio-control__input"
540
+ id="radio-control-3-free_shipping:1"
541
+ name="radio-control-3"
542
+ type="radio"
543
+ value="free_shipping:1"
544
+ />
545
+ <div
546
+ class="wc-block-components-radio-control__option-layout"
547
+ >
548
+ <div
549
+ class="wc-block-components-radio-control__label-group"
550
+ >
551
+ <span
552
+ class="wc-block-components-radio-control__label"
553
+ id="radio-control-3-free_shipping:1__label"
554
+ >
555
+ Free shipping
556
+ </span>
557
+ </div>
558
+ <div
559
+ class="wc-block-components-radio-control__description-group"
560
+ >
561
+ <span
562
+ class="wc-block-components-radio-control__description"
563
+ id="radio-control-3-free_shipping:1__description"
564
+ >
565
+ <span
566
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
567
+ >
568
+ $0.00
569
+ </span>
570
+
571
+ </span>
572
+ </div>
573
+ </div>
574
+ </label>
575
+ <label
576
+ class="wc-block-components-radio-control__option"
577
+ for="radio-control-3-local_pickup:1"
578
+ >
579
+ <input
580
+ aria-describedby="radio-control-3-local_pickup:1__label radio-control-3-local_pickup:1__description"
581
+ class="wc-block-components-radio-control__input"
582
+ id="radio-control-3-local_pickup:1"
583
+ name="radio-control-3"
584
+ type="radio"
585
+ value="local_pickup:1"
586
+ />
587
+ <div
588
+ class="wc-block-components-radio-control__option-layout"
589
+ >
590
+ <div
591
+ class="wc-block-components-radio-control__label-group"
592
+ >
593
+ <span
594
+ class="wc-block-components-radio-control__label"
595
+ id="radio-control-3-local_pickup:1__label"
596
+ >
597
+ Local pickup
598
+ </span>
599
+ </div>
600
+ <div
601
+ class="wc-block-components-radio-control__description-group"
602
+ >
603
+ <span
604
+ class="wc-block-components-radio-control__description"
605
+ id="radio-control-3-local_pickup:1__description"
606
+ >
607
+ <span
608
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
609
+ >
610
+ $2.00
611
+ </span>
612
+
613
+ </span>
614
+ </div>
615
+ </div>
616
+ </label>
617
+ </div>
618
+ </div>
619
+ </div>
620
+ </div>
621
+ </fieldset>
622
+ </div>
623
+ <div
624
+ class="wc-block-components-totals-item wc-block-components-totals-taxes"
625
+ >
626
+ <span
627
+ class="wc-block-components-totals-item__label"
628
+ >
629
+ Taxes
630
+ </span>
631
+ <span
632
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
633
+ >
634
+ $6.00
635
+ </span>
636
+ <div
637
+ class="wc-block-components-totals-item__description"
638
+ />
639
+ </div>
640
+ <div
641
+ class="wc-block-components-totals-item wc-block-components-totals-footer-item"
642
+ >
643
+ <span
644
+ class="wc-block-components-totals-item__label"
645
+ >
646
+ Total
647
+ </span>
648
+ <span
649
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
650
+ >
651
+ $30.00
652
+ </span>
653
+ <div
654
+ class="wc-block-components-totals-item__description"
655
+ />
656
+ </div>
657
+ <div
658
+ class="wc-block-components-order-meta"
659
+ />
660
+ <div
661
+ class="wc-block-cart__payment-options"
662
+ >
663
+ <div
664
+ class="wc-block-cart__submit"
665
+ >
666
+ <div
667
+ aria-hidden="true"
668
+ style="bottom: 0px; left: 0px; opacity: 0; pointer-events: none; position: absolute; right: 0px; top: 0px; z-index: -1;"
669
+ />
670
+ <div
671
+ class="wc-block-cart__submit-container"
672
+ >
673
+ <a
674
+ class="components-button wc-block-components-button wc-block-cart__submit-button"
675
+ href=""
676
+ >
677
+ <span
678
+ class="wc-block-components-button__text"
679
+ >
680
+ Proceed to Checkout
681
+ </span>
682
+ </a>
683
+ </div>
684
+ </div>
685
+ </div>
686
+ </div>
687
+ </div>
688
+ <div
689
+ style="display: none;"
690
+ />
691
+ </div>
692
+ `;
693
+
694
+ exports[`Testing cart Shows individual tax lines if the store is set to do so 1`] = `
695
+ <div>
696
+ <div
697
+ aria-hidden="true"
698
+ class="with-scroll-to-top__scroll-point"
699
+ />
700
+ <h2
701
+ class="wc-block-components-title"
702
+ >
703
+ Your cart (3 items)
704
+ </h2>
705
+ <div
706
+ class="wc-block-components-sidebar-layout wc-block-cart"
707
+ >
708
+ <iframe
709
+ aria-hidden="true"
710
+ frameborder="0"
711
+ src="about:blank"
712
+ style="display: block; opacity: 0; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"
713
+ tabindex="-1"
714
+ />
715
+ <div
716
+ class="wc-block-components-main wc-block-cart__main"
717
+ >
718
+ <table
719
+ class="wc-block-cart-items"
720
+ >
721
+ <thead>
722
+ <tr
723
+ class="wc-block-cart-items__header"
724
+ >
725
+ <th
726
+ class="wc-block-cart-items__header-image"
727
+ >
728
+ <span>
729
+ Product
730
+ </span>
731
+ </th>
732
+ <th
733
+ class="wc-block-cart-items__header-product"
734
+ >
735
+ <span>
736
+ Details
737
+ </span>
738
+ </th>
739
+ <th
740
+ class="wc-block-cart-items__header-total"
741
+ >
742
+ <span>
743
+ Total
744
+ </span>
745
+ </th>
746
+ </tr>
747
+ </thead>
748
+ <tbody>
749
+ <tr
750
+ class="wc-block-cart-items__row"
751
+ >
752
+ <td
753
+ aria-hidden="true"
754
+ class="wc-block-cart-item__image"
755
+ >
756
+ <a
757
+ href="https://example.org"
758
+ tabindex="-1"
759
+ >
760
+ <img
761
+ alt=""
762
+ src="assets/img/beanie.jpg"
763
+ />
764
+ </a>
765
+ </td>
766
+ <td
767
+ class="wc-block-cart-item__product"
768
+ >
769
+ <a
770
+ class="wc-block-components-product-name"
771
+ href="https://example.org"
772
+ >
773
+ Beanie
774
+ </a>
775
+ <div
776
+ class="wc-block-components-product-badge wc-block-components-product-low-stock-badge"
777
+ >
778
+ 2 left in stock
779
+ </div>
780
+ <div
781
+ class="wc-block-cart-item__prices"
782
+ >
783
+ <span
784
+ class="price wc-block-components-product-price"
785
+ >
786
+ <span
787
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
788
+ >
789
+ $6.40
790
+ </span>
791
+ </span>
792
+ </div>
793
+ <div
794
+ class="wc-block-components-product-metadata"
795
+ >
796
+ <div
797
+ class="wc-block-components-product-metadata__description"
798
+ >
799
+ <p>
800
+ Warm hat for winter
801
+ </p>
802
+
803
+
804
+ </div>
805
+ <ul
806
+ class="wc-block-components-product-details"
807
+ >
808
+ <li
809
+ class="wc-block-components-product-details__color"
810
+ >
811
+ <span
812
+ class="wc-block-components-product-details__name"
813
+ >
814
+ Color
815
+ :
816
+ </span>
817
+
818
+ <span
819
+ class="wc-block-components-product-details__value"
820
+ >
821
+ Yellow
822
+ </span>
823
+ </li>
824
+ <li
825
+ class="wc-block-components-product-details__size"
826
+ >
827
+ <span
828
+ class="wc-block-components-product-details__name"
829
+ >
830
+ Size
831
+ :
832
+ </span>
833
+
834
+ <span
835
+ class="wc-block-components-product-details__value"
836
+ >
837
+ Small
838
+ </span>
839
+ </li>
840
+ </ul>
841
+ </div>
842
+ <div
843
+ class="wc-block-cart-item__quantity"
844
+ >
845
+ <div
846
+ class="wc-block-components-quantity-selector"
847
+ >
848
+ <input
849
+ aria-label="Quantity of Beanie in your cart."
850
+ class="wc-block-components-quantity-selector__input"
851
+ min="0"
852
+ step="1"
853
+ type="number"
854
+ value="2"
855
+ />
856
+ <button
857
+ aria-label="Reduce quantity"
858
+ class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
859
+ >
860
+
861
+ </button>
862
+ <button
863
+ aria-label="Increase quantity"
864
+ class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
865
+ >
866
+
867
+ </button>
868
+ </div>
869
+ <button
870
+ class="wc-block-cart-item__remove-link"
871
+ >
872
+ Remove item
873
+ </button>
874
+ </div>
875
+ </td>
876
+ <td
877
+ class="wc-block-cart-item__total"
878
+ >
879
+ <div
880
+ class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
881
+ >
882
+ <span
883
+ class="price wc-block-components-product-price"
884
+ >
885
+ <span
886
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
887
+ >
888
+ $12.80
889
+ </span>
890
+ </span>
891
+ </div>
892
+ </td>
893
+ </tr>
894
+ <tr
895
+ class="wc-block-cart-items__row"
896
+ >
897
+ <td
898
+ aria-hidden="true"
899
+ class="wc-block-cart-item__image"
900
+ >
901
+ <a
902
+ href="https://example.org"
903
+ tabindex="-1"
904
+ >
905
+ <img
906
+ alt=""
907
+ src="assets/img/cap.jpg"
908
+ />
909
+ </a>
910
+ </td>
911
+ <td
912
+ class="wc-block-cart-item__product"
913
+ >
914
+ <a
915
+ class="wc-block-components-product-name"
916
+ href="https://example.org"
917
+ >
918
+ Cap
919
+ </a>
920
+ <div
921
+ class="wc-block-cart-item__prices"
922
+ >
923
+ <span
924
+ class="price wc-block-components-product-price"
925
+ >
926
+ <span
927
+ class="screen-reader-text"
928
+ >
929
+ Previous price:
930
+ </span>
931
+ <del
932
+ class="wc-block-components-product-price__regular"
933
+ >
934
+ $12.80
935
+ </del>
936
+ <span
937
+ class="screen-reader-text"
938
+ >
939
+ Discounted price:
940
+ </span>
941
+ <ins
942
+ class="wc-block-components-product-price__value is-discounted"
943
+ >
944
+ $11.20
945
+ </ins>
946
+ </span>
947
+ </div>
948
+ <div
949
+ class="wc-block-components-product-badge wc-block-components-sale-badge"
950
+ >
951
+ Save
952
+ <span
953
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
954
+ >
955
+ $1.60
956
+ </span>
957
+ </div>
958
+ <div
959
+ class="wc-block-components-product-metadata"
960
+ >
961
+ <div
962
+ class="wc-block-components-product-metadata__description"
963
+ >
964
+ <p>
965
+ Lightweight baseball cap
966
+ </p>
967
+
968
+
969
+ </div>
970
+ <ul
971
+ class="wc-block-components-product-details"
972
+ >
973
+ <li
974
+ class="wc-block-components-product-details__color"
975
+ >
976
+ <span
977
+ class="wc-block-components-product-details__name"
978
+ >
979
+ Color
980
+ :
981
+ </span>
982
+
983
+ <span
984
+ class="wc-block-components-product-details__value"
985
+ >
986
+ Orange
987
+ </span>
988
+ </li>
989
+ </ul>
990
+ </div>
991
+ <div
992
+ class="wc-block-cart-item__quantity"
993
+ >
994
+ <div
995
+ class="wc-block-components-quantity-selector"
996
+ >
997
+ <input
998
+ aria-label="Quantity of Cap in your cart."
999
+ class="wc-block-components-quantity-selector__input"
1000
+ min="0"
1001
+ step="1"
1002
+ type="number"
1003
+ value="1"
1004
+ />
1005
+ <button
1006
+ aria-label="Reduce quantity"
1007
+ class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
1008
+ disabled=""
1009
+ >
1010
+
1011
+ </button>
1012
+ <button
1013
+ aria-label="Increase quantity"
1014
+ class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
1015
+ >
1016
+
1017
+ </button>
1018
+ </div>
1019
+ <button
1020
+ class="wc-block-cart-item__remove-link"
1021
+ >
1022
+ Remove item
1023
+ </button>
1024
+ </div>
1025
+ </td>
1026
+ <td
1027
+ class="wc-block-cart-item__total"
1028
+ >
1029
+ <div
1030
+ class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
1031
+ >
1032
+ <span
1033
+ class="price wc-block-components-product-price"
1034
+ >
1035
+ <span
1036
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
1037
+ >
1038
+ $11.20
1039
+ </span>
1040
+ </span>
1041
+ </div>
1042
+ </td>
1043
+ </tr>
1044
+ </tbody>
1045
+ </table>
1046
+ </div>
1047
+ <div
1048
+ class="wc-block-components-sidebar wc-block-cart__sidebar"
1049
+ >
1050
+ <h2
1051
+ class="wc-block-components-title wc-block-cart__totals-title"
1052
+ >
1053
+ Cart totals
1054
+ </h2>
1055
+ <div
1056
+ class="wc-block-components-totals-item"
1057
+ >
1058
+ <span
1059
+ class="wc-block-components-totals-item__label"
1060
+ >
1061
+ Subtotal
1062
+ </span>
1063
+ <span
1064
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
1065
+ >
1066
+ $24.00
1067
+ </span>
1068
+ <div
1069
+ class="wc-block-components-totals-item__description"
1070
+ />
1071
+ </div>
1072
+ <div
1073
+ class="wc-block-components-totals-coupon wc-block-components-panel has-border"
1074
+ >
1075
+ <div>
1076
+ <button
1077
+ aria-expanded="false"
1078
+ class="wc-block-components-panel__button"
1079
+ >
1080
+ <svg
1081
+ aria-hidden="true"
1082
+ class="wc-block-components-panel__button-icon"
1083
+ focusable="false"
1084
+ height="24"
1085
+ role="img"
1086
+ viewBox="0 0 24 24"
1087
+ width="24"
1088
+ xmlns="http://www.w3.org/2000/svg"
1089
+ >
1090
+ <path
1091
+ d="M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"
1092
+ />
1093
+ </svg>
1094
+ <span
1095
+ aria-hidden="true"
1096
+ >
1097
+ Coupon code
1098
+ </span>
1099
+ <span
1100
+ class="screen-reader-text"
1101
+ >
1102
+ Apply a coupon code
1103
+ </span>
1104
+ </button>
1105
+ </div>
1106
+ <div
1107
+ class="wc-block-components-panel__content"
1108
+ hidden=""
1109
+ >
1110
+ <div
1111
+ class="wc-block-components-totals-coupon__content"
1112
+ >
1113
+ <form
1114
+ class="wc-block-components-totals-coupon__form"
1115
+ >
1116
+ <div
1117
+ class="wc-block-components-text-input wc-block-components-totals-coupon__input is-active"
1118
+ >
1119
+ <input
1120
+ aria-describedby=""
1121
+ aria-label="Enter code"
1122
+ autocapitalize="off"
1123
+ autocomplete="off"
1124
+ id="wc-block-components-totals-coupon__input-5"
1125
+ type="text"
1126
+ value=""
1127
+ />
1128
+ <label
1129
+ for="wc-block-components-totals-coupon__input-5"
1130
+ >
1131
+ Enter code
1132
+ </label>
1133
+ </div>
1134
+ <button
1135
+ class="components-button wc-block-components-button wc-block-components-totals-coupon__button"
1136
+ disabled=""
1137
+ type="submit"
1138
+ >
1139
+ <span
1140
+ class="wc-block-components-button__text"
1141
+ >
1142
+ Apply
1143
+ </span>
1144
+ </button>
1145
+ </form>
1146
+ </div>
1147
+ </div>
1148
+ </div>
1149
+ <div
1150
+ class="wc-block-components-totals-shipping"
1151
+ >
1152
+ <div
1153
+ class="wc-block-components-totals-item"
1154
+ >
1155
+ <span
1156
+ class="wc-block-components-totals-item__label"
1157
+ >
1158
+ Shipping
1159
+ </span>
1160
+ <span
1161
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
1162
+ >
1163
+ $0.00
1164
+ </span>
1165
+ <div
1166
+ class="wc-block-components-totals-item__description"
1167
+ >
1168
+ <div
1169
+ class="wc-block-components-totals-item__description wc-block-components-totals-shipping__via"
1170
+ >
1171
+ via
1172
+
1173
+ Free shipping
1174
+ </div>
1175
+ </div>
1176
+ </div>
1177
+ <fieldset
1178
+ class="wc-block-components-totals-shipping__fieldset"
1179
+ >
1180
+ <legend
1181
+ class="screen-reader-text"
1182
+ >
1183
+ Shipping options
1184
+ </legend>
1185
+ <div
1186
+ class="wc-block-components-shipping-rates-control wc-block-components-totals-shipping__options"
1187
+ >
1188
+ <div
1189
+ class="wc-block-components-shipping-rates-control__package wc-block-components-panel"
1190
+ >
1191
+ <div>
1192
+ <button
1193
+ aria-expanded="true"
1194
+ class="wc-block-components-panel__button"
1195
+ >
1196
+ <svg
1197
+ aria-hidden="true"
1198
+ class="wc-block-components-panel__button-icon"
1199
+ focusable="false"
1200
+ height="24"
1201
+ role="img"
1202
+ viewBox="0 0 24 24"
1203
+ width="24"
1204
+ xmlns="http://www.w3.org/2000/svg"
1205
+ >
1206
+ <path
1207
+ d="M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z"
1208
+ />
1209
+ </svg>
1210
+ <div
1211
+ class="wc-block-components-shipping-rates-control__package-title"
1212
+ >
1213
+ Shipping
1214
+ </div>
1215
+ </button>
1216
+ </div>
1217
+ <div
1218
+ class="wc-block-components-panel__content"
1219
+ >
1220
+ <div
1221
+ class="wc-block-components-radio-control"
1222
+ >
1223
+ <label
1224
+ class="wc-block-components-radio-control__option wc-block-components-radio-control__option-checked"
1225
+ for="radio-control-5-free_shipping:1"
1226
+ >
1227
+ <input
1228
+ aria-describedby="radio-control-5-free_shipping:1__label radio-control-5-free_shipping:1__description"
1229
+ checked=""
1230
+ class="wc-block-components-radio-control__input"
1231
+ id="radio-control-5-free_shipping:1"
1232
+ name="radio-control-5"
1233
+ type="radio"
1234
+ value="free_shipping:1"
1235
+ />
1236
+ <div
1237
+ class="wc-block-components-radio-control__option-layout"
1238
+ >
1239
+ <div
1240
+ class="wc-block-components-radio-control__label-group"
1241
+ >
1242
+ <span
1243
+ class="wc-block-components-radio-control__label"
1244
+ id="radio-control-5-free_shipping:1__label"
1245
+ >
1246
+ Free shipping
1247
+ </span>
1248
+ </div>
1249
+ <div
1250
+ class="wc-block-components-radio-control__description-group"
1251
+ >
1252
+ <span
1253
+ class="wc-block-components-radio-control__description"
1254
+ id="radio-control-5-free_shipping:1__description"
1255
+ >
1256
+ <span
1257
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
1258
+ >
1259
+ $0.00
1260
+ </span>
1261
+
1262
+ </span>
1263
+ </div>
1264
+ </div>
1265
+ </label>
1266
+ <label
1267
+ class="wc-block-components-radio-control__option"
1268
+ for="radio-control-5-local_pickup:1"
1269
+ >
1270
+ <input
1271
+ aria-describedby="radio-control-5-local_pickup:1__label radio-control-5-local_pickup:1__description"
1272
+ class="wc-block-components-radio-control__input"
1273
+ id="radio-control-5-local_pickup:1"
1274
+ name="radio-control-5"
1275
+ type="radio"
1276
+ value="local_pickup:1"
1277
+ />
1278
+ <div
1279
+ class="wc-block-components-radio-control__option-layout"
1280
+ >
1281
+ <div
1282
+ class="wc-block-components-radio-control__label-group"
1283
+ >
1284
+ <span
1285
+ class="wc-block-components-radio-control__label"
1286
+ id="radio-control-5-local_pickup:1__label"
1287
+ >
1288
+ Local pickup
1289
+ </span>
1290
+ </div>
1291
+ <div
1292
+ class="wc-block-components-radio-control__description-group"
1293
+ >
1294
+ <span
1295
+ class="wc-block-components-radio-control__description"
1296
+ id="radio-control-5-local_pickup:1__description"
1297
+ >
1298
+ <span
1299
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
1300
+ >
1301
+ $2.00
1302
+ </span>
1303
+
1304
+ </span>
1305
+ </div>
1306
+ </div>
1307
+ </label>
1308
+ </div>
1309
+ </div>
1310
+ </div>
1311
+ </div>
1312
+ </fieldset>
1313
+ </div>
1314
+ <div
1315
+ class="wc-block-components-totals-taxes"
1316
+ >
1317
+ <div
1318
+ class="wc-block-components-totals-item wc-block-components-totals-taxes__grouped-rate"
1319
+ >
1320
+ <span
1321
+ class="wc-block-components-totals-item__label"
1322
+ >
1323
+ Sales tax
1324
+ </span>
1325
+ <span
1326
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
1327
+ >
1328
+ $6.00
1329
+ </span>
1330
+ <div
1331
+ class="wc-block-components-totals-item__description"
1332
+ />
1333
+ </div>
1334
+
1335
+ </div>
1336
+ <div
1337
+ class="wc-block-components-totals-item wc-block-components-totals-footer-item"
1338
+ >
1339
+ <span
1340
+ class="wc-block-components-totals-item__label"
1341
+ >
1342
+ Total
1343
+ </span>
1344
+ <span
1345
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
1346
+ >
1347
+ $30.00
1348
+ </span>
1349
+ <div
1350
+ class="wc-block-components-totals-item__description"
1351
+ />
1352
+ </div>
1353
+ <div
1354
+ class="wc-block-components-order-meta"
1355
+ />
1356
+ <div
1357
+ class="wc-block-cart__payment-options"
1358
+ >
1359
+ <div
1360
+ class="wc-block-cart__submit"
1361
+ >
1362
+ <div
1363
+ aria-hidden="true"
1364
+ style="bottom: 0px; left: 0px; opacity: 0; pointer-events: none; position: absolute; right: 0px; top: 0px; z-index: -1;"
1365
+ />
1366
+ <div
1367
+ class="wc-block-cart__submit-container"
1368
+ >
1369
+ <a
1370
+ class="components-button wc-block-components-button wc-block-cart__submit-button"
1371
+ href=""
1372
+ >
1373
+ <span
1374
+ class="wc-block-components-button__text"
1375
+ >
1376
+ Proceed to Checkout
1377
+ </span>
1378
+ </a>
1379
+ </div>
1380
+ </div>
1381
+ </div>
1382
+ </div>
1383
+ </div>
1384
+ <div
1385
+ style="display: none;"
1386
+ />
1387
+ </div>
1388
+ `;
1389
+
1390
+ exports[`Testing cart Shows rate percentages after tax lines if the block is set to do so 1`] = `
1391
+ <div>
1392
+ <div
1393
+ aria-hidden="true"
1394
+ class="with-scroll-to-top__scroll-point"
1395
+ />
1396
+ <h2
1397
+ class="wc-block-components-title"
1398
+ >
1399
+ Your cart (3 items)
1400
+ </h2>
1401
+ <div
1402
+ class="wc-block-components-sidebar-layout wc-block-cart"
1403
+ >
1404
+ <iframe
1405
+ aria-hidden="true"
1406
+ frameborder="0"
1407
+ src="about:blank"
1408
+ style="display: block; opacity: 0; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"
1409
+ tabindex="-1"
1410
+ />
1411
+ <div
1412
+ class="wc-block-components-main wc-block-cart__main"
1413
+ >
1414
+ <table
1415
+ class="wc-block-cart-items"
1416
+ >
1417
+ <thead>
1418
+ <tr
1419
+ class="wc-block-cart-items__header"
1420
+ >
1421
+ <th
1422
+ class="wc-block-cart-items__header-image"
1423
+ >
1424
+ <span>
1425
+ Product
1426
+ </span>
1427
+ </th>
1428
+ <th
1429
+ class="wc-block-cart-items__header-product"
1430
+ >
1431
+ <span>
1432
+ Details
1433
+ </span>
1434
+ </th>
1435
+ <th
1436
+ class="wc-block-cart-items__header-total"
1437
+ >
1438
+ <span>
1439
+ Total
1440
+ </span>
1441
+ </th>
1442
+ </tr>
1443
+ </thead>
1444
+ <tbody>
1445
+ <tr
1446
+ class="wc-block-cart-items__row"
1447
+ >
1448
+ <td
1449
+ aria-hidden="true"
1450
+ class="wc-block-cart-item__image"
1451
+ >
1452
+ <a
1453
+ href="https://example.org"
1454
+ tabindex="-1"
1455
+ >
1456
+ <img
1457
+ alt=""
1458
+ src="assets/img/beanie.jpg"
1459
+ />
1460
+ </a>
1461
+ </td>
1462
+ <td
1463
+ class="wc-block-cart-item__product"
1464
+ >
1465
+ <a
1466
+ class="wc-block-components-product-name"
1467
+ href="https://example.org"
1468
+ >
1469
+ Beanie
1470
+ </a>
1471
+ <div
1472
+ class="wc-block-components-product-badge wc-block-components-product-low-stock-badge"
1473
+ >
1474
+ 2 left in stock
1475
+ </div>
1476
+ <div
1477
+ class="wc-block-cart-item__prices"
1478
+ >
1479
+ <span
1480
+ class="price wc-block-components-product-price"
1481
+ >
1482
+ <span
1483
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
1484
+ >
1485
+ $6.40
1486
+ </span>
1487
+ </span>
1488
+ </div>
1489
+ <div
1490
+ class="wc-block-components-product-metadata"
1491
+ >
1492
+ <div
1493
+ class="wc-block-components-product-metadata__description"
1494
+ >
1495
+ <p>
1496
+ Warm hat for winter
1497
+ </p>
1498
+
1499
+
1500
+ </div>
1501
+ <ul
1502
+ class="wc-block-components-product-details"
1503
+ >
1504
+ <li
1505
+ class="wc-block-components-product-details__color"
1506
+ >
1507
+ <span
1508
+ class="wc-block-components-product-details__name"
1509
+ >
1510
+ Color
1511
+ :
1512
+ </span>
1513
+
1514
+ <span
1515
+ class="wc-block-components-product-details__value"
1516
+ >
1517
+ Yellow
1518
+ </span>
1519
+ </li>
1520
+ <li
1521
+ class="wc-block-components-product-details__size"
1522
+ >
1523
+ <span
1524
+ class="wc-block-components-product-details__name"
1525
+ >
1526
+ Size
1527
+ :
1528
+ </span>
1529
+
1530
+ <span
1531
+ class="wc-block-components-product-details__value"
1532
+ >
1533
+ Small
1534
+ </span>
1535
+ </li>
1536
+ </ul>
1537
+ </div>
1538
+ <div
1539
+ class="wc-block-cart-item__quantity"
1540
+ >
1541
+ <div
1542
+ class="wc-block-components-quantity-selector"
1543
+ >
1544
+ <input
1545
+ aria-label="Quantity of Beanie in your cart."
1546
+ class="wc-block-components-quantity-selector__input"
1547
+ min="0"
1548
+ step="1"
1549
+ type="number"
1550
+ value="2"
1551
+ />
1552
+ <button
1553
+ aria-label="Reduce quantity"
1554
+ class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
1555
+ >
1556
+
1557
+ </button>
1558
+ <button
1559
+ aria-label="Increase quantity"
1560
+ class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
1561
+ >
1562
+
1563
+ </button>
1564
+ </div>
1565
+ <button
1566
+ class="wc-block-cart-item__remove-link"
1567
+ >
1568
+ Remove item
1569
+ </button>
1570
+ </div>
1571
+ </td>
1572
+ <td
1573
+ class="wc-block-cart-item__total"
1574
+ >
1575
+ <div
1576
+ class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
1577
+ >
1578
+ <span
1579
+ class="price wc-block-components-product-price"
1580
+ >
1581
+ <span
1582
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
1583
+ >
1584
+ $12.80
1585
+ </span>
1586
+ </span>
1587
+ </div>
1588
+ </td>
1589
+ </tr>
1590
+ <tr
1591
+ class="wc-block-cart-items__row"
1592
+ >
1593
+ <td
1594
+ aria-hidden="true"
1595
+ class="wc-block-cart-item__image"
1596
+ >
1597
+ <a
1598
+ href="https://example.org"
1599
+ tabindex="-1"
1600
+ >
1601
+ <img
1602
+ alt=""
1603
+ src="assets/img/cap.jpg"
1604
+ />
1605
+ </a>
1606
+ </td>
1607
+ <td
1608
+ class="wc-block-cart-item__product"
1609
+ >
1610
+ <a
1611
+ class="wc-block-components-product-name"
1612
+ href="https://example.org"
1613
+ >
1614
+ Cap
1615
+ </a>
1616
+ <div
1617
+ class="wc-block-cart-item__prices"
1618
+ >
1619
+ <span
1620
+ class="price wc-block-components-product-price"
1621
+ >
1622
+ <span
1623
+ class="screen-reader-text"
1624
+ >
1625
+ Previous price:
1626
+ </span>
1627
+ <del
1628
+ class="wc-block-components-product-price__regular"
1629
+ >
1630
+ $12.80
1631
+ </del>
1632
+ <span
1633
+ class="screen-reader-text"
1634
+ >
1635
+ Discounted price:
1636
+ </span>
1637
+ <ins
1638
+ class="wc-block-components-product-price__value is-discounted"
1639
+ >
1640
+ $11.20
1641
+ </ins>
1642
+ </span>
1643
+ </div>
1644
+ <div
1645
+ class="wc-block-components-product-badge wc-block-components-sale-badge"
1646
+ >
1647
+ Save
1648
+ <span
1649
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
1650
+ >
1651
+ $1.60
1652
+ </span>
1653
+ </div>
1654
+ <div
1655
+ class="wc-block-components-product-metadata"
1656
+ >
1657
+ <div
1658
+ class="wc-block-components-product-metadata__description"
1659
+ >
1660
+ <p>
1661
+ Lightweight baseball cap
1662
+ </p>
1663
+
1664
+
1665
+ </div>
1666
+ <ul
1667
+ class="wc-block-components-product-details"
1668
+ >
1669
+ <li
1670
+ class="wc-block-components-product-details__color"
1671
+ >
1672
+ <span
1673
+ class="wc-block-components-product-details__name"
1674
+ >
1675
+ Color
1676
+ :
1677
+ </span>
1678
+
1679
+ <span
1680
+ class="wc-block-components-product-details__value"
1681
+ >
1682
+ Orange
1683
+ </span>
1684
+ </li>
1685
+ </ul>
1686
+ </div>
1687
+ <div
1688
+ class="wc-block-cart-item__quantity"
1689
+ >
1690
+ <div
1691
+ class="wc-block-components-quantity-selector"
1692
+ >
1693
+ <input
1694
+ aria-label="Quantity of Cap in your cart."
1695
+ class="wc-block-components-quantity-selector__input"
1696
+ min="0"
1697
+ step="1"
1698
+ type="number"
1699
+ value="1"
1700
+ />
1701
+ <button
1702
+ aria-label="Reduce quantity"
1703
+ class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus"
1704
+ disabled=""
1705
+ >
1706
+
1707
+ </button>
1708
+ <button
1709
+ aria-label="Increase quantity"
1710
+ class="wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus"
1711
+ >
1712
+
1713
+ </button>
1714
+ </div>
1715
+ <button
1716
+ class="wc-block-cart-item__remove-link"
1717
+ >
1718
+ Remove item
1719
+ </button>
1720
+ </div>
1721
+ </td>
1722
+ <td
1723
+ class="wc-block-cart-item__total"
1724
+ >
1725
+ <div
1726
+ class="wc-block-cart-item__total-price-and-sale-badge-wrapper"
1727
+ >
1728
+ <span
1729
+ class="price wc-block-components-product-price"
1730
+ >
1731
+ <span
1732
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-product-price__value"
1733
+ >
1734
+ $11.20
1735
+ </span>
1736
+ </span>
1737
+ </div>
1738
+ </td>
1739
+ </tr>
1740
+ </tbody>
1741
+ </table>
1742
+ </div>
1743
+ <div
1744
+ class="wc-block-components-sidebar wc-block-cart__sidebar"
1745
+ >
1746
+ <h2
1747
+ class="wc-block-components-title wc-block-cart__totals-title"
1748
+ >
1749
+ Cart totals
1750
+ </h2>
1751
+ <div
1752
+ class="wc-block-components-totals-item"
1753
+ >
1754
+ <span
1755
+ class="wc-block-components-totals-item__label"
1756
+ >
1757
+ Subtotal
1758
+ </span>
1759
+ <span
1760
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
1761
+ >
1762
+ $24.00
1763
+ </span>
1764
+ <div
1765
+ class="wc-block-components-totals-item__description"
1766
+ />
1767
+ </div>
1768
+ <div
1769
+ class="wc-block-components-totals-coupon wc-block-components-panel has-border"
1770
+ >
1771
+ <div>
1772
+ <button
1773
+ aria-expanded="false"
1774
+ class="wc-block-components-panel__button"
1775
+ >
1776
+ <svg
1777
+ aria-hidden="true"
1778
+ class="wc-block-components-panel__button-icon"
1779
+ focusable="false"
1780
+ height="24"
1781
+ role="img"
1782
+ viewBox="0 0 24 24"
1783
+ width="24"
1784
+ xmlns="http://www.w3.org/2000/svg"
1785
+ >
1786
+ <path
1787
+ d="M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"
1788
+ />
1789
+ </svg>
1790
+ <span
1791
+ aria-hidden="true"
1792
+ >
1793
+ Coupon code
1794
+ </span>
1795
+ <span
1796
+ class="screen-reader-text"
1797
+ >
1798
+ Apply a coupon code
1799
+ </span>
1800
+ </button>
1801
+ </div>
1802
+ <div
1803
+ class="wc-block-components-panel__content"
1804
+ hidden=""
1805
+ >
1806
+ <div
1807
+ class="wc-block-components-totals-coupon__content"
1808
+ >
1809
+ <form
1810
+ class="wc-block-components-totals-coupon__form"
1811
+ >
1812
+ <div
1813
+ class="wc-block-components-text-input wc-block-components-totals-coupon__input is-active"
1814
+ >
1815
+ <input
1816
+ aria-describedby=""
1817
+ aria-label="Enter code"
1818
+ autocapitalize="off"
1819
+ autocomplete="off"
1820
+ id="wc-block-components-totals-coupon__input-7"
1821
+ type="text"
1822
+ value=""
1823
+ />
1824
+ <label
1825
+ for="wc-block-components-totals-coupon__input-7"
1826
+ >
1827
+ Enter code
1828
+ </label>
1829
+ </div>
1830
+ <button
1831
+ class="components-button wc-block-components-button wc-block-components-totals-coupon__button"
1832
+ disabled=""
1833
+ type="submit"
1834
+ >
1835
+ <span
1836
+ class="wc-block-components-button__text"
1837
+ >
1838
+ Apply
1839
+ </span>
1840
+ </button>
1841
+ </form>
1842
+ </div>
1843
+ </div>
1844
+ </div>
1845
+ <div
1846
+ class="wc-block-components-totals-shipping"
1847
+ >
1848
+ <div
1849
+ class="wc-block-components-totals-item"
1850
+ >
1851
+ <span
1852
+ class="wc-block-components-totals-item__label"
1853
+ >
1854
+ Shipping
1855
+ </span>
1856
+ <span
1857
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
1858
+ >
1859
+ $0.00
1860
+ </span>
1861
+ <div
1862
+ class="wc-block-components-totals-item__description"
1863
+ >
1864
+ <div
1865
+ class="wc-block-components-totals-item__description wc-block-components-totals-shipping__via"
1866
+ >
1867
+ via
1868
+
1869
+ Free shipping
1870
+ </div>
1871
+ </div>
1872
+ </div>
1873
+ <fieldset
1874
+ class="wc-block-components-totals-shipping__fieldset"
1875
+ >
1876
+ <legend
1877
+ class="screen-reader-text"
1878
+ >
1879
+ Shipping options
1880
+ </legend>
1881
+ <div
1882
+ class="wc-block-components-shipping-rates-control wc-block-components-totals-shipping__options"
1883
+ >
1884
+ <div
1885
+ class="wc-block-components-shipping-rates-control__package wc-block-components-panel"
1886
+ >
1887
+ <div>
1888
+ <button
1889
+ aria-expanded="true"
1890
+ class="wc-block-components-panel__button"
1891
+ >
1892
+ <svg
1893
+ aria-hidden="true"
1894
+ class="wc-block-components-panel__button-icon"
1895
+ focusable="false"
1896
+ height="24"
1897
+ role="img"
1898
+ viewBox="0 0 24 24"
1899
+ width="24"
1900
+ xmlns="http://www.w3.org/2000/svg"
1901
+ >
1902
+ <path
1903
+ d="M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z"
1904
+ />
1905
+ </svg>
1906
+ <div
1907
+ class="wc-block-components-shipping-rates-control__package-title"
1908
+ >
1909
+ Shipping
1910
+ </div>
1911
+ </button>
1912
+ </div>
1913
+ <div
1914
+ class="wc-block-components-panel__content"
1915
+ >
1916
+ <div
1917
+ class="wc-block-components-radio-control"
1918
+ >
1919
+ <label
1920
+ class="wc-block-components-radio-control__option wc-block-components-radio-control__option-checked"
1921
+ for="radio-control-7-free_shipping:1"
1922
+ >
1923
+ <input
1924
+ aria-describedby="radio-control-7-free_shipping:1__label radio-control-7-free_shipping:1__description"
1925
+ checked=""
1926
+ class="wc-block-components-radio-control__input"
1927
+ id="radio-control-7-free_shipping:1"
1928
+ name="radio-control-7"
1929
+ type="radio"
1930
+ value="free_shipping:1"
1931
+ />
1932
+ <div
1933
+ class="wc-block-components-radio-control__option-layout"
1934
+ >
1935
+ <div
1936
+ class="wc-block-components-radio-control__label-group"
1937
+ >
1938
+ <span
1939
+ class="wc-block-components-radio-control__label"
1940
+ id="radio-control-7-free_shipping:1__label"
1941
+ >
1942
+ Free shipping
1943
+ </span>
1944
+ </div>
1945
+ <div
1946
+ class="wc-block-components-radio-control__description-group"
1947
+ >
1948
+ <span
1949
+ class="wc-block-components-radio-control__description"
1950
+ id="radio-control-7-free_shipping:1__description"
1951
+ >
1952
+ <span
1953
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
1954
+ >
1955
+ $0.00
1956
+ </span>
1957
+
1958
+ </span>
1959
+ </div>
1960
+ </div>
1961
+ </label>
1962
+ <label
1963
+ class="wc-block-components-radio-control__option"
1964
+ for="radio-control-7-local_pickup:1"
1965
+ >
1966
+ <input
1967
+ aria-describedby="radio-control-7-local_pickup:1__label radio-control-7-local_pickup:1__description"
1968
+ class="wc-block-components-radio-control__input"
1969
+ id="radio-control-7-local_pickup:1"
1970
+ name="radio-control-7"
1971
+ type="radio"
1972
+ value="local_pickup:1"
1973
+ />
1974
+ <div
1975
+ class="wc-block-components-radio-control__option-layout"
1976
+ >
1977
+ <div
1978
+ class="wc-block-components-radio-control__label-group"
1979
+ >
1980
+ <span
1981
+ class="wc-block-components-radio-control__label"
1982
+ id="radio-control-7-local_pickup:1__label"
1983
+ >
1984
+ Local pickup
1985
+ </span>
1986
+ </div>
1987
+ <div
1988
+ class="wc-block-components-radio-control__description-group"
1989
+ >
1990
+ <span
1991
+ class="wc-block-components-radio-control__description"
1992
+ id="radio-control-7-local_pickup:1__description"
1993
+ >
1994
+ <span
1995
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount"
1996
+ >
1997
+ $2.00
1998
+ </span>
1999
+
2000
+ </span>
2001
+ </div>
2002
+ </div>
2003
+ </label>
2004
+ </div>
2005
+ </div>
2006
+ </div>
2007
+ </div>
2008
+ </fieldset>
2009
+ </div>
2010
+ <div
2011
+ class="wc-block-components-totals-taxes"
2012
+ >
2013
+ <div
2014
+ class="wc-block-components-totals-item wc-block-components-totals-taxes__grouped-rate"
2015
+ >
2016
+ <span
2017
+ class="wc-block-components-totals-item__label"
2018
+ >
2019
+ Sales tax 20%
2020
+ </span>
2021
+ <span
2022
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
2023
+ >
2024
+ $6.00
2025
+ </span>
2026
+ <div
2027
+ class="wc-block-components-totals-item__description"
2028
+ />
2029
+ </div>
2030
+
2031
+ </div>
2032
+ <div
2033
+ class="wc-block-components-totals-item wc-block-components-totals-footer-item"
2034
+ >
2035
+ <span
2036
+ class="wc-block-components-totals-item__label"
2037
+ >
2038
+ Total
2039
+ </span>
2040
+ <span
2041
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
2042
+ >
2043
+ $30.00
2044
+ </span>
2045
+ <div
2046
+ class="wc-block-components-totals-item__description"
2047
+ />
2048
+ </div>
2049
+ <div
2050
+ class="wc-block-components-order-meta"
2051
+ />
2052
+ <div
2053
+ class="wc-block-cart__payment-options"
2054
+ >
2055
+ <div
2056
+ class="wc-block-cart__submit"
2057
+ >
2058
+ <div
2059
+ aria-hidden="true"
2060
+ style="bottom: 0px; left: 0px; opacity: 0; pointer-events: none; position: absolute; right: 0px; top: 0px; z-index: -1;"
2061
+ />
2062
+ <div
2063
+ class="wc-block-cart__submit-container"
2064
+ >
2065
+ <a
2066
+ class="components-button wc-block-components-button wc-block-cart__submit-button"
2067
+ href=""
2068
+ >
2069
+ <span
2070
+ class="wc-block-components-button__text"
2071
+ >
2072
+ Proceed to Checkout
2073
+ </span>
2074
+ </a>
2075
+ </div>
2076
+ </div>
2077
+ </div>
2078
+ </div>
2079
+ </div>
2080
+ <div
2081
+ style="display: none;"
2082
+ />
2083
+ </div>
2084
+ `;
assets/js/blocks/cart-checkout/cart/test/block.js CHANGED
@@ -12,6 +12,7 @@ import { default as fetchMock } from 'jest-fetch-mock';
12
  */
13
  import CartBlock from '../block';
14
  import { defaultCartState } from '../../../../data/default-states';
 
15
 
16
  describe( 'Testing cart', () => {
17
  beforeEach( async () => {
@@ -49,6 +50,59 @@ describe( 'Testing cart', () => {
49
  expect( console ).toHaveWarned();
50
  } );
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  it( 'renders empty cart if there are no items in the cart', async () => {
53
  fetchMock.mockResponse( ( req ) => {
54
  if ( req.url.match( /wc\/store\/cart/ ) ) {
12
  */
13
  import CartBlock from '../block';
14
  import { defaultCartState } from '../../../../data/default-states';
15
+ import { allSettings } from '../../../../settings/shared/settings-init';
16
 
17
  describe( 'Testing cart', () => {
18
  beforeEach( async () => {
50
  expect( console ).toHaveWarned();
51
  } );
52
 
53
+ it( 'Contains a Taxes section if Core options are set to show it', async () => {
54
+ allSettings.displayCartPricesIncludingTax = false;
55
+ // The criteria for showing the Taxes section is:
56
+ // Display prices during basket and checkout: 'Excluding tax'.
57
+ const { container } = render(
58
+ <CartBlock
59
+ emptyCart={ null }
60
+ attributes={ {
61
+ isShippingCalculatorEnabled: false,
62
+ } }
63
+ />
64
+ );
65
+ await waitFor( () => expect( fetchMock ).toHaveBeenCalled() );
66
+ expect( container ).toMatchSnapshot();
67
+ } );
68
+
69
+ it( 'Shows individual tax lines if the store is set to do so', async () => {
70
+ allSettings.displayCartPricesIncludingTax = false;
71
+ allSettings.displayItemizedTaxes = true;
72
+ // The criteria for showing the lines in the Taxes section is:
73
+ // Display prices during basket and checkout: 'Excluding tax'.
74
+ // Display tax totals: 'Itemized';
75
+ const { container } = render(
76
+ <CartBlock
77
+ emptyCart={ null }
78
+ attributes={ {
79
+ isShippingCalculatorEnabled: false,
80
+ } }
81
+ />
82
+ );
83
+ await waitFor( () => expect( fetchMock ).toHaveBeenCalled() );
84
+ expect( container ).toMatchSnapshot();
85
+ } );
86
+
87
+ it( 'Shows rate percentages after tax lines if the block is set to do so', async () => {
88
+ allSettings.displayCartPricesIncludingTax = false;
89
+ allSettings.displayItemizedTaxes = true;
90
+ // The criteria for showing the lines in the Taxes section is:
91
+ // Display prices during basket and checkout: 'Excluding tax'.
92
+ // Display tax totals: 'Itemized';
93
+ const { container } = render(
94
+ <CartBlock
95
+ emptyCart={ null }
96
+ attributes={ {
97
+ showRateAfterTaxName: true,
98
+ isShippingCalculatorEnabled: false,
99
+ } }
100
+ />
101
+ );
102
+ await waitFor( () => expect( fetchMock ).toHaveBeenCalled() );
103
+ expect( container ).toMatchSnapshot();
104
+ } );
105
+
106
  it( 'renders empty cart if there are no items in the cart', async () => {
107
  fetchMock.mockResponse( ( req ) => {
108
  if ( req.url.match( /wc\/store\/cart/ ) ) {
assets/js/blocks/cart-checkout/checkout/attributes.js CHANGED
@@ -53,6 +53,10 @@ const blockAttributes = {
53
  type: 'boolean',
54
  default: getSetting( 'hasDarkEditorStyleSupport', false ),
55
  },
 
 
 
 
56
  };
57
 
58
  export default blockAttributes;
53
  type: 'boolean',
54
  default: getSetting( 'hasDarkEditorStyleSupport', false ),
55
  },
56
+ showRateAfterTaxName: {
57
+ type: 'boolean',
58
+ default: getSetting( 'displayCartPricesIncludingTax', false ),
59
+ },
60
  };
61
 
62
  export default blockAttributes;
assets/js/blocks/cart-checkout/checkout/block.js CHANGED
@@ -155,6 +155,7 @@ const Checkout = ( { attributes, scrollToTop } ) => {
155
  cartItems={ cartItems }
156
  cartTotals={ cartTotals }
157
  cartFees={ cartFees }
 
158
  />
159
  </Sidebar>
160
  </SidebarLayout>
155
  cartItems={ cartItems }
156
  cartTotals={ cartTotals }
157
  cartFees={ cartFees }
158
+ showRateAfterTaxName={ attributes.showRateAfterTaxName }
159
  />
160
  </Sidebar>
161
  </SidebarLayout>
assets/js/blocks/cart-checkout/checkout/edit.js CHANGED
@@ -52,6 +52,7 @@ const BlockSettings = ( { attributes, setAttributes } ) => {
52
  showReturnToCart,
53
  cartPageId,
54
  hasDarkControls,
 
55
  } = attributes;
56
  const { currentPostId } = useEditorContext();
57
  const { current: savedCartPageId } = useRef( cartPageId );
@@ -298,6 +299,30 @@ const BlockSettings = ( { attributes, setAttributes } ) => {
298
  } }
299
  />
300
  ) }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
301
  <PanelBody title={ __( 'Style', 'woo-gutenberg-products-block' ) }>
302
  <ToggleControl
303
  label={ __(
52
  showReturnToCart,
53
  cartPageId,
54
  hasDarkControls,
55
+ showRateAfterTaxName,
56
  } = attributes;
57
  const { currentPostId } = useEditorContext();
58
  const { current: savedCartPageId } = useRef( cartPageId );
299
  } }
300
  />
301
  ) }
302
+ { getSetting( 'taxesEnabled' ) &&
303
+ getSetting( 'displayItemizedTaxes', false ) &&
304
+ ! getSetting( 'displayCartPricesIncludingTax', false ) && (
305
+ <PanelBody
306
+ title={ __( 'Taxes', 'woo-gutenberg-products-block' ) }
307
+ >
308
+ <ToggleControl
309
+ label={ __(
310
+ 'Show rate after tax name',
311
+ 'woo-gutenberg-products-block'
312
+ ) }
313
+ help={ __(
314
+ 'Show the percentage rate alongside each tax line in the summary.',
315
+ 'woo-gutenberg-products-block'
316
+ ) }
317
+ checked={ showRateAfterTaxName }
318
+ onChange={ () =>
319
+ setAttributes( {
320
+ showRateAfterTaxName: ! showRateAfterTaxName,
321
+ } )
322
+ }
323
+ />
324
+ </PanelBody>
325
+ ) }
326
  <PanelBody title={ __( 'Style', 'woo-gutenberg-products-block' ) }>
327
  <ToggleControl
328
  label={ __(
assets/js/blocks/cart-checkout/checkout/sidebar/index.js CHANGED
@@ -1,6 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
 
4
  import {
5
  OrderSummary,
6
  TotalsCoupon,
@@ -14,6 +15,7 @@ import {
14
  TotalsTaxes,
15
  ExperimentalOrderMeta,
16
  } from '@woocommerce/blocks-checkout';
 
17
  import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
18
  import { useShippingDataContext } from '@woocommerce/base-context';
19
  import {
@@ -27,6 +29,7 @@ const CheckoutSidebar = ( {
27
  cartItems = [],
28
  cartFees = [],
29
  cartTotals = {},
 
30
  } ) => {
31
  const {
32
  applyCoupon,
@@ -59,6 +62,13 @@ const CheckoutSidebar = ( {
59
  removeCoupon={ removeCoupon }
60
  values={ cartTotals }
61
  />
 
 
 
 
 
 
 
62
  { needsShipping && (
63
  <TotalsShipping
64
  showCalculator={ false }
@@ -70,16 +80,10 @@ const CheckoutSidebar = ( {
70
  { ! getSetting( 'displayCartPricesIncludingTax', false ) && (
71
  <TotalsTaxes
72
  currency={ totalsCurrency }
 
73
  values={ cartTotals }
74
  />
75
  ) }
76
- { getSetting( 'couponsEnabled', true ) && (
77
- <TotalsCoupon
78
- onSubmit={ applyCoupon }
79
- initialOpen={ false }
80
- isLoading={ isApplyingCoupon }
81
- />
82
- ) }
83
  <TotalsFooterItem
84
  currency={ totalsCurrency }
85
  values={ cartTotals }
1
  /**
2
  * External dependencies
3
  */
4
+
5
  import {
6
  OrderSummary,
7
  TotalsCoupon,
15
  TotalsTaxes,
16
  ExperimentalOrderMeta,
17
  } from '@woocommerce/blocks-checkout';
18
+
19
  import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
20
  import { useShippingDataContext } from '@woocommerce/base-context';
21
  import {
29
  cartItems = [],
30
  cartFees = [],
31
  cartTotals = {},
32
+ showRateAfterTaxName = false,
33
  } ) => {
34
  const {
35
  applyCoupon,
62
  removeCoupon={ removeCoupon }
63
  values={ cartTotals }
64
  />
65
+ { getSetting( 'couponsEnabled', true ) && (
66
+ <TotalsCoupon
67
+ onSubmit={ applyCoupon }
68
+ initialOpen={ false }
69
+ isLoading={ isApplyingCoupon }
70
+ />
71
+ ) }
72
  { needsShipping && (
73
  <TotalsShipping
74
  showCalculator={ false }
80
  { ! getSetting( 'displayCartPricesIncludingTax', false ) && (
81
  <TotalsTaxes
82
  currency={ totalsCurrency }
83
+ showRateAfterTaxName={ showRateAfterTaxName }
84
  values={ cartTotals }
85
  />
86
  ) }
 
 
 
 
 
 
 
87
  <TotalsFooterItem
88
  currency={ totalsCurrency }
89
  values={ cartTotals }
assets/js/blocks/cart-checkout/checkout/sidebar/test/__snapshots__/index.js.snap ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Testing checkout sidebar Shows rate percentages after tax lines if the block is set to do so 1`] = `
4
+ <div>
5
+ <div
6
+ class="wc-block-components-totals-item"
7
+ >
8
+ <span
9
+ class="wc-block-components-totals-item__label"
10
+ >
11
+ Subtotal
12
+ </span>
13
+ <span
14
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
15
+ >
16
+ $24.00
17
+ </span>
18
+ <div
19
+ class="wc-block-components-totals-item__description"
20
+ />
21
+ </div>
22
+ <div
23
+ class="wc-block-components-totals-coupon wc-block-components-panel has-border"
24
+ >
25
+ <div>
26
+ <button
27
+ aria-expanded="false"
28
+ class="wc-block-components-panel__button"
29
+ >
30
+ <svg
31
+ aria-hidden="true"
32
+ class="wc-block-components-panel__button-icon"
33
+ focusable="false"
34
+ height="24"
35
+ role="img"
36
+ viewBox="0 0 24 24"
37
+ width="24"
38
+ xmlns="http://www.w3.org/2000/svg"
39
+ >
40
+ <path
41
+ d="M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"
42
+ />
43
+ </svg>
44
+ <span
45
+ aria-hidden="true"
46
+ >
47
+ Coupon code
48
+ </span>
49
+ <span
50
+ class="screen-reader-text"
51
+ >
52
+ Apply a coupon code
53
+ </span>
54
+ </button>
55
+ </div>
56
+ <div
57
+ class="wc-block-components-panel__content"
58
+ hidden=""
59
+ >
60
+ <div
61
+ class="wc-block-components-totals-coupon__content"
62
+ >
63
+ <form
64
+ class="wc-block-components-totals-coupon__form"
65
+ >
66
+ <div
67
+ class="wc-block-components-text-input wc-block-components-totals-coupon__input is-active"
68
+ >
69
+ <input
70
+ aria-describedby="wc-block-components-totals-coupon__input-0"
71
+ aria-label="Enter code"
72
+ autocapitalize="off"
73
+ autocomplete="off"
74
+ id="wc-block-components-totals-coupon__input-0"
75
+ type="text"
76
+ value=""
77
+ />
78
+ <label
79
+ for="wc-block-components-totals-coupon__input-0"
80
+ >
81
+ Enter code
82
+ </label>
83
+ </div>
84
+ <button
85
+ class="components-button wc-block-components-button wc-block-components-totals-coupon__button"
86
+ disabled=""
87
+ type="submit"
88
+ >
89
+ <span
90
+ class="wc-block-components-button__text"
91
+ >
92
+ Apply
93
+ </span>
94
+ </button>
95
+ </form>
96
+ </div>
97
+ </div>
98
+ </div>
99
+ <div
100
+ class="wc-block-components-totals-taxes"
101
+ >
102
+ <div
103
+ class="wc-block-components-totals-item wc-block-components-totals-taxes__grouped-rate"
104
+ >
105
+ <span
106
+ class="wc-block-components-totals-item__label"
107
+ >
108
+ Sales tax 20%
109
+ </span>
110
+ <span
111
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
112
+ >
113
+ $6.00
114
+ </span>
115
+ <div
116
+ class="wc-block-components-totals-item__description"
117
+ />
118
+ </div>
119
+
120
+ </div>
121
+ <div
122
+ class="wc-block-components-totals-item wc-block-components-totals-footer-item"
123
+ >
124
+ <span
125
+ class="wc-block-components-totals-item__label"
126
+ >
127
+ Total
128
+ </span>
129
+ <span
130
+ class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
131
+ >
132
+ $30.00
133
+ </span>
134
+ <div
135
+ class="wc-block-components-totals-item__description"
136
+ />
137
+ </div>
138
+ <div
139
+ class="wc-block-components-order-meta"
140
+ />
141
+ </div>
142
+ `;
assets/js/blocks/cart-checkout/checkout/sidebar/test/index.js ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { render } from '@testing-library/react';
5
+ import { previewCart } from '@woocommerce/resource-previews';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { allSettings } from '../../../../../settings/shared/settings-init';
11
+ import CheckoutSidebar from '../index';
12
+
13
+ describe( 'Testing checkout sidebar', () => {
14
+ it( 'Shows rate percentages after tax lines if the block is set to do so', async () => {
15
+ allSettings.displayCartPricesIncludingTax = false;
16
+ allSettings.displayItemizedTaxes = true;
17
+ const { totals: cartTotals, items: cartItems } = previewCart;
18
+ const { container } = render(
19
+ <CheckoutSidebar
20
+ cartItems={ cartItems }
21
+ cartTotals={ cartTotals }
22
+ showRateAfterTaxName={ true }
23
+ />
24
+ );
25
+ expect( container ).toMatchSnapshot();
26
+ // ["Components must be wrapped within `SlotFillProvider`. See https://developer.wordpress.org/block-editor/components/slot-fill/"]
27
+ expect( console ).toHaveWarned();
28
+ } );
29
+ } );
assets/js/blocks/cart-checkout/checkout/style.scss CHANGED
@@ -10,6 +10,12 @@
10
  // Required by IE11.
11
  flex-basis: 0;
12
  }
 
 
 
 
 
 
13
  }
14
 
15
  .wc-block-checkout__actions {
10
  // Required by IE11.
11
  flex-basis: 0;
12
  }
13
+ .wc-block-components-totals-taxes,
14
+ .wc-block-components-totals-footer-item {
15
+ @include with-translucent-border(1px 0 0);
16
+ margin: 0;
17
+ padding: em($gap-small) 0;
18
+ }
19
  }
20
 
21
  .wc-block-checkout__actions {
assets/js/blocks/cart-checkout/payment-methods/payment-methods.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { usePaymentMethods } from '@woocommerce/base-context/hooks';
5
  import { __ } from '@wordpress/i18n';
6
- import Label from '@woocommerce/base-components/label';
7
  import { usePaymentMethodDataContext } from '@woocommerce/base-context';
8
 
9
  /**
3
  */
4
  import { usePaymentMethods } from '@woocommerce/base-context/hooks';
5
  import { __ } from '@wordpress/i18n';
6
+ import { Label } from '@woocommerce/blocks-checkout';
7
  import { usePaymentMethodDataContext } from '@woocommerce/base-context';
8
 
9
  /**
assets/js/blocks/handpicked-products/block.js CHANGED
@@ -106,6 +106,7 @@ class ProductsBlock extends Component {
106
  const ids = value.map( ( { id } ) => id );
107
  setAttributes( { products: ids } );
108
  } }
 
109
  />
110
  </PanelBody>
111
  </InspectorControls>
106
  const ids = value.map( ( { id } ) => id );
107
  setAttributes( { products: ids } );
108
  } }
109
+ isCompact={ true }
110
  />
111
  </PanelBody>
112
  </InspectorControls>
assets/js/blocks/product-category/block.js CHANGED
@@ -135,6 +135,7 @@ class ProductByCategoryBlock extends Component {
135
  setAttributes( changes );
136
  this.setChangedAttributes( changes );
137
  } }
 
138
  />
139
  </PanelBody>
140
  <PanelBody
135
  setAttributes( changes );
136
  this.setChangedAttributes( changes );
137
  } }
138
+ isCompact={ true }
139
  />
140
  </PanelBody>
141
  <PanelBody
assets/js/blocks/product-tag/block.js CHANGED
@@ -112,6 +112,7 @@ class ProductsByTagBlock extends Component {
112
  onOperatorChange={ ( value = 'any' ) =>
113
  setAttributes( { tagOperator: value } )
114
  }
 
115
  />
116
  </PanelBody>
117
  <PanelBody
112
  onOperatorChange={ ( value = 'any' ) =>
113
  setAttributes( { tagOperator: value } )
114
  }
115
+ isCompact={ true }
116
  />
117
  </PanelBody>
118
  <PanelBody
assets/js/blocks/products-by-attribute/block.js CHANGED
@@ -90,6 +90,7 @@ class ProductsByAttributeBlock extends Component {
90
  onOperatorChange={ ( value = 'any' ) =>
91
  setAttributes( { attrOperator: value } )
92
  }
 
93
  />
94
  </PanelBody>
95
  <PanelBody
90
  onOperatorChange={ ( value = 'any' ) =>
91
  setAttributes( { attrOperator: value } )
92
  }
93
+ isCompact={ true }
94
  />
95
  </PanelBody>
96
  <PanelBody
assets/js/blocks/reviews/reviews-by-category/edit.js CHANGED
@@ -14,6 +14,7 @@ import { SearchListItem } from '@woocommerce/components';
14
  import PropTypes from 'prop-types';
15
  import ProductCategoryControl from '@woocommerce/editor-components/product-category-control';
16
  import { Icon, review } from '@woocommerce/icons';
 
17
 
18
  /**
19
  * Internal dependencies
@@ -43,13 +44,6 @@ const ReviewsByCategoryEditor = ( {
43
 
44
  const renderCategoryControlItem = ( args ) => {
45
  const { item, search, depth = 0 } = args;
46
- const classes = [ 'woocommerce-product-categories__item' ];
47
- if ( search.length ) {
48
- classes.push( 'is-searching' );
49
- }
50
- if ( depth === 0 && item.parent !== 0 ) {
51
- classes.push( 'is-skip-level' );
52
- }
53
 
54
  const accessibleName = ! item.breadcrumbs.length
55
  ? item.name
@@ -57,9 +51,15 @@ const ReviewsByCategoryEditor = ( {
57
 
58
  return (
59
  <SearchListItem
60
- className={ classes.join( ' ' ) }
 
 
 
 
 
 
 
61
  { ...args }
62
- showCount
63
  aria-label={ sprintf(
64
  /* translators: %1$s is the search term name, %2$d is the number of products returned for search query. */
65
  _n(
@@ -89,6 +89,7 @@ const ReviewsByCategoryEditor = ( {
89
  setAttributes( { categoryIds: ids } );
90
  } }
91
  renderItem={ renderCategoryControlItem }
 
92
  />
93
  </PanelBody>
94
  <PanelBody
14
  import PropTypes from 'prop-types';
15
  import ProductCategoryControl from '@woocommerce/editor-components/product-category-control';
16
  import { Icon, review } from '@woocommerce/icons';
17
+ import classNames from 'classnames';
18
 
19
  /**
20
  * Internal dependencies
44
 
45
  const renderCategoryControlItem = ( args ) => {
46
  const { item, search, depth = 0 } = args;
 
 
 
 
 
 
 
47
 
48
  const accessibleName = ! item.breadcrumbs.length
49
  ? item.name
51
 
52
  return (
53
  <SearchListItem
54
+ className={ classNames(
55
+ 'woocommerce-product-categories__item',
56
+ 'has-count',
57
+ {
58
+ 'is-searching': search.length > 0,
59
+ 'is-skip-level': depth === 0 && item.parent !== 0,
60
+ }
61
+ ) }
62
  { ...args }
 
63
  aria-label={ sprintf(
64
  /* translators: %1$s is the search term name, %2$d is the number of products returned for search query. */
65
  _n(
89
  setAttributes( { categoryIds: ids } );
90
  } }
91
  renderItem={ renderCategoryControlItem }
92
+ isCompact={ true }
93
  />
94
  </PanelBody>
95
  <PanelBody
assets/js/blocks/reviews/reviews-by-product/edit.js CHANGED
@@ -49,14 +49,13 @@ const ReviewsByProductEditor = ( {
49
  countLabel={ sprintf(
50
  /* translators: %d is the review count. */
51
  _n(
52
- '%d Review',
53
- '%d Reviews',
54
  item.review_count,
55
  'woo-gutenberg-products-block'
56
  ),
57
  item.review_count
58
  ) }
59
- showCount
60
  aria-label={ sprintf(
61
  /* translators: %1$s is the item name, and %2$d is the number of reviews for the item. */
62
  _n(
@@ -86,6 +85,7 @@ const ReviewsByProductEditor = ( {
86
  setAttributes( { productId: id } );
87
  } }
88
  renderItem={ renderProductControlItem }
 
89
  />
90
  </PanelBody>
91
  <PanelBody
49
  countLabel={ sprintf(
50
  /* translators: %d is the review count. */
51
  _n(
52
+ '%d review',
53
+ '%d reviews',
54
  item.review_count,
55
  'woo-gutenberg-products-block'
56
  ),
57
  item.review_count
58
  ) }
 
59
  aria-label={ sprintf(
60
  /* translators: %1$s is the item name, and %2$d is the number of reviews for the item. */
61
  _n(
85
  setAttributes( { productId: id } );
86
  } }
87
  renderItem={ renderProductControlItem }
88
+ isCompact={ true }
89
  />
90
  </PanelBody>
91
  <PanelBody
assets/js/data/cart/actions.ts CHANGED
@@ -28,14 +28,16 @@ import type { ResponseError } from '../types';
28
  *
29
  * @param {CartResponse} response
30
  */
31
- export const receiveCart = ( response: CartResponse ) => {
 
 
32
  const cart = ( mapKeys( response, ( _, key ) =>
33
  camelCase( key )
34
  ) as unknown ) as Cart;
35
  return {
36
  type: types.RECEIVE_CART,
37
  response: cart,
38
- } as const;
39
  };
40
 
41
  /**
28
  *
29
  * @param {CartResponse} response
30
  */
31
+ export const receiveCart = (
32
+ response: CartResponse
33
+ ): { type: string; response: Cart } => {
34
  const cart = ( mapKeys( response, ( _, key ) =>
35
  camelCase( key )
36
  ) as unknown ) as Cart;
37
  return {
38
  type: types.RECEIVE_CART,
39
  response: cart,
40
+ };
41
  };
42
 
43
  /**
assets/js/editor-components/expandable-search-list-item/expandable-search-list-item.tsx ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { SearchListItem } from '@woocommerce/components';
5
+ import { Spinner } from '@wordpress/components';
6
+ import classNames from 'classnames';
7
+
8
+ interface SearchListItem {
9
+ id: string;
10
+ }
11
+
12
+ interface ExpandableSearchListItemProps {
13
+ className?: string;
14
+ item: SearchListItem;
15
+ isSelected: boolean;
16
+ isLoading: boolean;
17
+ onSelect: () => void;
18
+ disabled: boolean;
19
+ }
20
+
21
+ const ExpandableSearchListItem = ( {
22
+ className,
23
+ item,
24
+ isSelected,
25
+ isLoading,
26
+ onSelect,
27
+ disabled,
28
+ ...rest
29
+ }: ExpandableSearchListItemProps ): JSX.Element => {
30
+ return (
31
+ <>
32
+ <SearchListItem
33
+ { ...rest }
34
+ key={ item.id }
35
+ className={ className }
36
+ isSelected={ isSelected }
37
+ item={ item }
38
+ onSelect={ onSelect }
39
+ isSingle
40
+ disabled={ disabled }
41
+ />
42
+ { isSelected && isLoading && (
43
+ <div
44
+ key="loading"
45
+ className={ classNames(
46
+ 'woocommerce-search-list__item',
47
+ 'woocommerce-product-attributes__item',
48
+ 'depth-1',
49
+ 'is-loading',
50
+ 'is-not-active'
51
+ ) }
52
+ >
53
+ <Spinner />
54
+ </div>
55
+ ) }
56
+ </>
57
+ );
58
+ };
59
+
60
+ export default ExpandableSearchListItem;
assets/js/editor-components/product-attribute-term-control/index.js CHANGED
@@ -2,12 +2,14 @@
2
  * External dependencies
3
  */
4
  import { __, _n, sprintf } from '@wordpress/i18n';
5
- import { find } from 'lodash';
6
  import PropTypes from 'prop-types';
7
  import { SearchListControl, SearchListItem } from '@woocommerce/components';
8
- import { SelectControl, Spinner } from '@wordpress/components';
 
9
  import { withAttributes } from '@woocommerce/block-hocs';
10
  import ErrorMessage from '@woocommerce/editor-components/error-placeholder/error-message.js';
 
 
11
 
12
  /**
13
  * Internal dependencies
@@ -21,43 +23,54 @@ const ProductAttributeTermControl = ( {
21
  onChange,
22
  onExpandAttribute,
23
  onOperatorChange,
 
 
24
  isLoading,
25
  operator,
26
  selected,
27
  termsAreLoading,
28
  termsList,
29
  } ) => {
30
- const onSelectAttribute = ( item ) => {
31
- return () => {
32
- onChange( [] );
33
- onExpandAttribute( item.id );
34
- };
35
- };
36
-
37
  const renderItem = ( args ) => {
38
  const { item, search, depth = 0 } = args;
39
  const classes = [
40
  'woocommerce-product-attributes__item',
41
  'woocommerce-search-list__item',
 
 
 
 
42
  ];
43
- if ( search.length ) {
44
- classes.push( 'is-searching' );
45
- }
46
- if ( depth === 0 && item.parent ) {
47
- classes.push( 'is-skip-level' );
48
- }
49
 
50
  if ( ! item.breadcrumbs.length ) {
51
- return [
52
- <SearchListItem
53
- key={ `attr-${ item.id }` }
54
  { ...args }
55
- className={ classes.join( ' ' ) }
56
- isSelected={ expandedAttribute === item.id }
57
- onSelect={ onSelectAttribute }
58
- isSingle
 
 
59
  disabled={ item.count === '0' }
60
- aria-expanded={ expandedAttribute === item.id }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  aria-label={ sprintf(
62
  /* translators: %1$s is the item name, %2$d is the count of terms for the item. */
63
  _n(
@@ -69,27 +82,38 @@ const ProductAttributeTermControl = ( {
69
  item.name,
70
  item.count
71
  ) }
72
- />,
73
- expandedAttribute === item.id && termsAreLoading && (
74
- <div
75
- key="loading"
76
- className={
77
- 'woocommerce-search-list__item woocommerce-product-attributes__item' +
78
- 'depth-1 is-loading is-not-active'
79
- }
80
- >
81
- <Spinner />
82
- </div>
83
- ),
84
- ];
85
  }
86
 
 
 
87
  return (
88
  <SearchListItem
89
- className={ classes.join( ' ' ) }
90
  { ...args }
91
- showCount
92
- aria-label={ `${ item.breadcrumbs[ 0 ] }: ${ item.name }` }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  />
94
  );
95
  };
@@ -139,11 +163,16 @@ const ProductAttributeTermControl = ( {
139
  list={ currentList }
140
  isLoading={ isLoading }
141
  selected={ selected
142
- .map( ( { id } ) => find( currentList, { id } ) )
 
 
 
 
143
  .filter( Boolean ) }
144
  onChange={ onChange }
145
  renderItem={ renderItem }
146
  messages={ messages }
 
147
  isHierarchical
148
  />
149
  { !! onOperatorChange && (
@@ -209,13 +238,15 @@ ProductAttributeTermControl.propTypes = {
209
  error: PropTypes.object,
210
  expandedAttribute: PropTypes.number,
211
  onExpandAttribute: PropTypes.func,
 
212
  isLoading: PropTypes.bool,
213
  termsAreLoading: PropTypes.bool,
214
  termsList: PropTypes.object,
215
  };
216
 
217
  ProductAttributeTermControl.defaultProps = {
 
218
  operator: 'any',
219
  };
220
 
221
- export default withAttributes( ProductAttributeTermControl );
2
  * External dependencies
3
  */
4
  import { __, _n, sprintf } from '@wordpress/i18n';
 
5
  import PropTypes from 'prop-types';
6
  import { SearchListControl, SearchListItem } from '@woocommerce/components';
7
+ import { SelectControl } from '@wordpress/components';
8
+ import { withInstanceId } from '@wordpress/compose';
9
  import { withAttributes } from '@woocommerce/block-hocs';
10
  import ErrorMessage from '@woocommerce/editor-components/error-placeholder/error-message.js';
11
+ import classNames from 'classnames';
12
+ import ExpandableSearchListItem from '@woocommerce/editor-components/expandable-search-list-item/expandable-search-list-item.tsx';
13
 
14
  /**
15
  * Internal dependencies
23
  onChange,
24
  onExpandAttribute,
25
  onOperatorChange,
26
+ instanceId,
27
+ isCompact,
28
  isLoading,
29
  operator,
30
  selected,
31
  termsAreLoading,
32
  termsList,
33
  } ) => {
 
 
 
 
 
 
 
34
  const renderItem = ( args ) => {
35
  const { item, search, depth = 0 } = args;
36
  const classes = [
37
  'woocommerce-product-attributes__item',
38
  'woocommerce-search-list__item',
39
+ {
40
+ 'is-searching': search.length > 0,
41
+ 'is-skip-level': depth === 0 && item.parent !== 0,
42
+ },
43
  ];
 
 
 
 
 
 
44
 
45
  if ( ! item.breadcrumbs.length ) {
46
+ const isSelected = expandedAttribute === item.id;
47
+ return (
48
+ <ExpandableSearchListItem
49
  { ...args }
50
+ className={ classNames( ...classes, {
51
+ 'is-selected': isSelected,
52
+ } ) }
53
+ isSelected={ isSelected }
54
+ item={ item }
55
+ isLoading={ termsAreLoading }
56
  disabled={ item.count === '0' }
57
+ onSelect={ ( { id } ) => {
58
+ return () => {
59
+ onChange( [] );
60
+ onExpandAttribute( id );
61
+ };
62
+ } }
63
+ name={ `attributes-${ instanceId }` }
64
+ countLabel={ sprintf(
65
+ /* translators: %d is the count of terms. */
66
+ _n(
67
+ '%d term',
68
+ '%d terms',
69
+ item.count,
70
+ 'woo-gutenberg-products-block'
71
+ ),
72
+ item.count
73
+ ) }
74
  aria-label={ sprintf(
75
  /* translators: %1$s is the item name, %2$d is the count of terms for the item. */
76
  _n(
82
  item.name,
83
  item.count
84
  ) }
85
+ />
86
+ );
 
 
 
 
 
 
 
 
 
 
 
87
  }
88
 
89
+ const itemName = `${ item.breadcrumbs[ 0 ] }: ${ item.name }`;
90
+
91
  return (
92
  <SearchListItem
 
93
  { ...args }
94
+ name={ `terms-${ instanceId }` }
95
+ className={ classNames( ...classes, 'has-count' ) }
96
+ countLabel={ sprintf(
97
+ /* translators: %d is the count of products. */
98
+ _n(
99
+ '%d product',
100
+ '%d products',
101
+ item.count,
102
+ 'woo-gutenberg-products-block'
103
+ ),
104
+ item.count
105
+ ) }
106
+ aria-label={ sprintf(
107
+ /* translators: %1$s is the attribute name, %2$d is the count of products for that attribute. */
108
+ _n(
109
+ '%1$s, has %2$d product',
110
+ '%1$s, has %2$d products',
111
+ item.count,
112
+ 'woo-gutenberg-products-block'
113
+ ),
114
+ itemName,
115
+ item.count
116
+ ) }
117
  />
118
  );
119
  };
163
  list={ currentList }
164
  isLoading={ isLoading }
165
  selected={ selected
166
+ .map( ( { id } ) =>
167
+ currentList.find(
168
+ ( currentListItem ) => currentListItem.id === id
169
+ )
170
+ )
171
  .filter( Boolean ) }
172
  onChange={ onChange }
173
  renderItem={ renderItem }
174
  messages={ messages }
175
+ isCompact={ isCompact }
176
  isHierarchical
177
  />
178
  { !! onOperatorChange && (
238
  error: PropTypes.object,
239
  expandedAttribute: PropTypes.number,
240
  onExpandAttribute: PropTypes.func,
241
+ isCompact: PropTypes.bool,
242
  isLoading: PropTypes.bool,
243
  termsAreLoading: PropTypes.bool,
244
  termsList: PropTypes.object,
245
  };
246
 
247
  ProductAttributeTermControl.defaultProps = {
248
+ isCompact: false,
249
  operator: 'any',
250
  };
251
 
252
+ export default withAttributes( withInstanceId( ProductAttributeTermControl ) );
assets/js/editor-components/product-attribute-term-control/style.scss CHANGED
@@ -9,17 +9,6 @@
9
  }
10
  }
11
 
12
- .components-panel {
13
- .woocommerce-product-attributes__operator.components-base-control {
14
- margin-top: $gap;
15
-
16
- .components-select-control__input {
17
- margin-left: 0;
18
- min-width: 100%;
19
- }
20
- }
21
- }
22
-
23
  .woocommerce-search-list__item.woocommerce-product-attributes__item {
24
  &.is-searching,
25
  &.is-skip-level {
@@ -55,7 +44,7 @@
55
  background-size: contain;
56
  }
57
 
58
- &.depth-0[aria-expanded="true"]::after {
59
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z" fill="#{encode-color($gray-700)}" /></svg>');
60
  }
61
 
9
  }
10
  }
11
 
 
 
 
 
 
 
 
 
 
 
 
12
  .woocommerce-search-list__item.woocommerce-product-attributes__item {
13
  &.is-searching,
14
  &.is-skip-level {
44
  background-size: contain;
45
  }
46
 
47
+ &.depth-0.is-selected::after {
48
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z" fill="#{encode-color($gray-700)}" /></svg>');
49
  }
50
 
assets/js/editor-components/product-category-control/index.js CHANGED
@@ -2,12 +2,12 @@
2
  * External dependencies
3
  */
4
  import { __, _n, sprintf } from '@wordpress/i18n';
5
- import { find } from 'lodash';
6
  import PropTypes from 'prop-types';
7
  import { SearchListControl, SearchListItem } from '@woocommerce/components';
8
  import { SelectControl } from '@wordpress/components';
9
  import { withCategories } from '@woocommerce/block-hocs';
10
  import ErrorMessage from '@woocommerce/editor-components/error-placeholder/error-message.js';
 
11
 
12
  /**
13
  * Internal dependencies
@@ -22,18 +22,12 @@ const ProductCategoryControl = ( {
22
  onOperatorChange,
23
  operator,
24
  selected,
 
25
  isSingle,
26
  showReviewCount,
27
  } ) => {
28
  const renderItem = ( args ) => {
29
  const { item, search, depth = 0 } = args;
30
- const classes = [ 'woocommerce-product-categories__item' ];
31
- if ( search.length ) {
32
- classes.push( 'is-searching' );
33
- }
34
- if ( depth === 0 && item.parent !== 0 ) {
35
- classes.push( 'is-skip-level' );
36
- }
37
 
38
  const accessibleName = ! item.breadcrumbs.length
39
  ? item.name
@@ -67,8 +61,8 @@ const ProductCategoryControl = ( {
67
  ? sprintf(
68
  /* translators: %d is the count of reviews. */
69
  _n(
70
- '%d Review',
71
- '%d Reviews',
72
  item.review_count,
73
  'woo-gutenberg-products-block'
74
  ),
@@ -77,8 +71,8 @@ const ProductCategoryControl = ( {
77
  : sprintf(
78
  /* translators: %d is the count of products. */
79
  _n(
80
- '%d Product',
81
- '%d Products',
82
  item.count,
83
  'woo-gutenberg-products-block'
84
  ),
@@ -86,9 +80,15 @@ const ProductCategoryControl = ( {
86
  );
87
  return (
88
  <SearchListItem
89
- className={ classes.join( ' ' ) }
 
 
 
 
 
 
 
90
  { ...args }
91
- showCount
92
  countLabel={ listItemCountLabel }
93
  aria-label={ listItemAriaLabel }
94
  />
@@ -137,11 +137,14 @@ const ProductCategoryControl = ( {
137
  list={ categories }
138
  isLoading={ isLoading }
139
  selected={ selected
140
- .map( ( id ) => find( categories, { id } ) )
 
 
141
  .filter( Boolean ) }
142
  onChange={ onChange }
143
  renderItem={ renderItem }
144
  messages={ messages }
 
145
  isHierarchical
146
  isSingle={ isSingle }
147
  />
@@ -203,6 +206,7 @@ ProductCategoryControl.propTypes = {
203
  * The list of currently selected category IDs.
204
  */
205
  selected: PropTypes.array.isRequired,
 
206
  /**
207
  * Allow only a single selection. Defaults to false.
208
  */
@@ -211,6 +215,7 @@ ProductCategoryControl.propTypes = {
211
 
212
  ProductCategoryControl.defaultProps = {
213
  operator: 'any',
 
214
  isSingle: false,
215
  };
216
 
2
  * External dependencies
3
  */
4
  import { __, _n, sprintf } from '@wordpress/i18n';
 
5
  import PropTypes from 'prop-types';
6
  import { SearchListControl, SearchListItem } from '@woocommerce/components';
7
  import { SelectControl } from '@wordpress/components';
8
  import { withCategories } from '@woocommerce/block-hocs';
9
  import ErrorMessage from '@woocommerce/editor-components/error-placeholder/error-message.js';
10
+ import classNames from 'classnames';
11
 
12
  /**
13
  * Internal dependencies
22
  onOperatorChange,
23
  operator,
24
  selected,
25
+ isCompact,
26
  isSingle,
27
  showReviewCount,
28
  } ) => {
29
  const renderItem = ( args ) => {
30
  const { item, search, depth = 0 } = args;
 
 
 
 
 
 
 
31
 
32
  const accessibleName = ! item.breadcrumbs.length
33
  ? item.name
61
  ? sprintf(
62
  /* translators: %d is the count of reviews. */
63
  _n(
64
+ '%d review',
65
+ '%d reviews',
66
  item.review_count,
67
  'woo-gutenberg-products-block'
68
  ),
71
  : sprintf(
72
  /* translators: %d is the count of products. */
73
  _n(
74
+ '%d product',
75
+ '%d products',
76
  item.count,
77
  'woo-gutenberg-products-block'
78
  ),
80
  );
81
  return (
82
  <SearchListItem
83
+ className={ classNames(
84
+ 'woocommerce-product-categories__item',
85
+ 'has-count',
86
+ {
87
+ 'is-searching': search.length > 0,
88
+ 'is-skip-level': depth === 0 && item.parent !== 0,
89
+ }
90
+ ) }
91
  { ...args }
 
92
  countLabel={ listItemCountLabel }
93
  aria-label={ listItemAriaLabel }
94
  />
137
  list={ categories }
138
  isLoading={ isLoading }
139
  selected={ selected
140
+ .map( ( id ) =>
141
+ categories.find( ( category ) => category.id === id )
142
+ )
143
  .filter( Boolean ) }
144
  onChange={ onChange }
145
  renderItem={ renderItem }
146
  messages={ messages }
147
+ isCompact={ isCompact }
148
  isHierarchical
149
  isSingle={ isSingle }
150
  />
206
  * The list of currently selected category IDs.
207
  */
208
  selected: PropTypes.array.isRequired,
209
+ isCompact: PropTypes.bool,
210
  /**
211
  * Allow only a single selection. Defaults to false.
212
  */
215
 
216
  ProductCategoryControl.defaultProps = {
217
  operator: 'any',
218
+ isCompact: false,
219
  isSingle: false,
220
  };
221
 
assets/js/editor-components/product-category-control/style.scss CHANGED
@@ -8,14 +8,3 @@
8
  margin-right: 0.5em;
9
  }
10
  }
11
-
12
- .components-panel {
13
- .woocommerce-product-categories__operator.components-base-control {
14
- margin-top: $gap;
15
-
16
- .components-select-control__input {
17
- margin-left: 0;
18
- min-width: 100%;
19
- }
20
- }
21
- }
8
  margin-right: 0.5em;
9
  }
10
  }
 
 
 
 
 
 
 
 
 
 
 
assets/js/editor-components/product-control/index.js CHANGED
@@ -2,40 +2,24 @@
2
  * External dependencies
3
  */
4
  import { __, _n, sprintf } from '@wordpress/i18n';
5
- import { escapeRegExp, isEmpty } from 'lodash';
6
  import PropTypes from 'prop-types';
7
  import { SearchListControl, SearchListItem } from '@woocommerce/components';
8
- import { Spinner, MenuItem } from '@wordpress/components';
9
- import classnames from 'classnames';
10
  import {
11
  withProductVariations,
12
  withSearchedProducts,
13
  withTransformSingleSelectToMultipleSelect,
14
  } from '@woocommerce/block-hocs';
15
- import { Icon, radioSelected, radioUnselected } from '@woocommerce/icons';
16
  import ErrorMessage from '@woocommerce/editor-components/error-placeholder/error-message.js';
 
 
17
 
18
  /**
19
  * Internal dependencies
20
  */
21
  import './style.scss';
22
 
23
- function getHighlightedName( name, search ) {
24
- if ( ! search ) {
25
- return name;
26
- }
27
- const re = new RegExp( escapeRegExp( search ), 'ig' );
28
- return name.replace( re, '<strong>$&</strong>' );
29
- }
30
-
31
- const getInteractionIcon = ( isSelected = false ) => {
32
- return isSelected ? (
33
- <Icon srcElement={ radioSelected } />
34
- ) : (
35
- <Icon srcElement={ radioUnselected } />
36
- );
37
- };
38
-
39
  const messages = {
40
  list: __( 'Products', 'woo-gutenberg-products-block' ),
41
  noItems: __(
@@ -55,6 +39,8 @@ const messages = {
55
  const ProductControl = ( {
56
  expandedProduct,
57
  error,
 
 
58
  isLoading,
59
  onChange,
60
  onSearch,
@@ -71,10 +57,11 @@ const ProductControl = ( {
71
  item.variations && Array.isArray( item.variations )
72
  ? item.variations.length
73
  : 0;
74
- const classes = classnames(
75
  'woocommerce-search-product__item',
76
  'woocommerce-search-list__item',
77
  `depth-${ depth }`,
 
78
  {
79
  'is-searching': search.length > 0,
80
  'is-skip-level': depth === 0 && item.parent !== 0,
@@ -82,89 +69,66 @@ const ProductControl = ( {
82
  }
83
  );
84
 
85
- const itemArgs = Object.assign( {}, args );
86
- delete itemArgs.isSingle;
87
-
88
- const a11yProps = {
89
- role: 'menuitemradio',
90
- };
91
-
92
- if ( item.breadcrumbs.length ) {
93
- a11yProps[
94
- 'aria-label'
95
- ] = `${ item.breadcrumbs[ 0 ] }: ${ item.name }`;
96
- }
97
-
98
- if ( variationsCount ) {
99
- a11yProps[ 'aria-expanded' ] = item.id === expandedProduct;
100
- }
101
-
102
  // Top level items custom rendering based on SearchListItem.
103
  if ( ! item.breadcrumbs.length ) {
104
- return [
105
- <MenuItem
106
- key={ `product-${ item.id }` }
 
 
 
107
  isSelected={ isSelected }
108
- { ...itemArgs }
109
- { ...a11yProps }
110
- className={ classes }
111
- onClick={ () => {
112
- onSelect( item )();
113
  } }
114
- >
115
- <span className="woocommerce-search-list__item-state">
116
- { getInteractionIcon( isSelected ) }
117
- </span>
118
-
119
- <span className="woocommerce-search-list__item-label">
120
- <span
121
- className="woocommerce-search-list__item-name"
122
- dangerouslySetInnerHTML={ {
123
- __html: getHighlightedName( item.name, search ),
124
- } }
125
- />
126
- </span>
127
-
128
- { variationsCount ? (
129
- <span className="woocommerce-search-list__item-variation-count">
130
- { sprintf(
131
- /* translators: %d is the count of variations. */
132
- _n(
133
- '%d variation',
134
- '%d variations',
135
- variationsCount,
136
- 'woo-gutenberg-products-block'
137
- ),
138
- variationsCount
139
- ) }
140
- </span>
141
- ) : null }
142
- </MenuItem>,
143
- expandedProduct === item.id &&
144
- variationsCount > 0 &&
145
- variationsLoading && (
146
- <div
147
- key="loading"
148
- className={
149
- 'woocommerce-search-list__item woocommerce-search-product__item' +
150
- 'depth-1 is-loading is-not-active'
151
- }
152
- >
153
- <Spinner />
154
- </div>
155
- ),
156
- ];
157
  }
158
 
159
- if ( ! isEmpty( item.variation ) ) {
160
- item.name = item.variation;
161
- }
 
 
 
 
 
 
 
162
 
163
  return (
164
  <SearchListItem
 
165
  className={ classes }
166
- { ...args }
167
- { ...a11yProps }
168
  />
169
  );
170
  };
@@ -192,6 +156,7 @@ const ProductControl = ( {
192
  <SearchListControl
193
  className="woocommerce-products"
194
  list={ currentList }
 
195
  isLoading={ isLoading }
196
  isSingle
197
  selected={ currentList.filter( ( { id } ) =>
@@ -211,6 +176,7 @@ ProductControl.propTypes = {
211
  * Callback to update the selected products.
212
  */
213
  onChange: PropTypes.func.isRequired,
 
214
  /**
215
  * The ID of the currently expanded product.
216
  */
@@ -238,11 +204,14 @@ ProductControl.propTypes = {
238
  };
239
 
240
  ProductControl.defaultProps = {
 
241
  expandedProduct: null,
242
  selected: [],
243
  showVariations: false,
244
  };
245
 
246
  export default withTransformSingleSelectToMultipleSelect(
247
- withSearchedProducts( withProductVariations( ProductControl ) )
 
 
248
  );
2
  * External dependencies
3
  */
4
  import { __, _n, sprintf } from '@wordpress/i18n';
5
+ import { isEmpty } from 'lodash';
6
  import PropTypes from 'prop-types';
7
  import { SearchListControl, SearchListItem } from '@woocommerce/components';
8
+ import { withInstanceId } from '@wordpress/compose';
 
9
  import {
10
  withProductVariations,
11
  withSearchedProducts,
12
  withTransformSingleSelectToMultipleSelect,
13
  } from '@woocommerce/block-hocs';
 
14
  import ErrorMessage from '@woocommerce/editor-components/error-placeholder/error-message.js';
15
+ import classNames from 'classnames';
16
+ import ExpandableSearchListItem from '@woocommerce/editor-components/expandable-search-list-item/expandable-search-list-item.tsx';
17
 
18
  /**
19
  * Internal dependencies
20
  */
21
  import './style.scss';
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  const messages = {
24
  list: __( 'Products', 'woo-gutenberg-products-block' ),
25
  noItems: __(
39
  const ProductControl = ( {
40
  expandedProduct,
41
  error,
42
+ instanceId,
43
+ isCompact,
44
  isLoading,
45
  onChange,
46
  onSearch,
57
  item.variations && Array.isArray( item.variations )
58
  ? item.variations.length
59
  : 0;
60
+ const classes = classNames(
61
  'woocommerce-search-product__item',
62
  'woocommerce-search-list__item',
63
  `depth-${ depth }`,
64
+ 'has-count',
65
  {
66
  'is-searching': search.length > 0,
67
  'is-skip-level': depth === 0 && item.parent !== 0,
69
  }
70
  );
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  // Top level items custom rendering based on SearchListItem.
73
  if ( ! item.breadcrumbs.length ) {
74
+ return (
75
+ <ExpandableSearchListItem
76
+ { ...args }
77
+ className={ classNames( classes, {
78
+ 'is-selected': isSelected,
79
+ } ) }
80
  isSelected={ isSelected }
81
+ item={ item }
82
+ onSelect={ () => {
83
+ return () => {
84
+ onSelect( item )();
85
+ };
86
  } }
87
+ isLoading={ isLoading || variationsLoading }
88
+ countLabel={
89
+ item.variations.length > 0
90
+ ? sprintf(
91
+ /* translators: %1$d is the number of variations of a product product. */
92
+ __(
93
+ '%1$d variations',
94
+ 'woo-gutenberg-products-block'
95
+ ),
96
+ item.variations.length
97
+ )
98
+ : null
99
+ }
100
+ name={ `products-${ instanceId }` }
101
+ aria-label={ sprintf(
102
+ /* translators: %1$s is the product name, %2$d is the number of variations of that product. */
103
+ _n(
104
+ '%1$s, has %2$d variation',
105
+ '%1$s, has %2$d variations',
106
+ item.variations.length,
107
+ 'woo-gutenberg-products-block'
108
+ ),
109
+ item.name,
110
+ item.variations.length
111
+ ) }
112
+ />
113
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  }
115
 
116
+ const itemArgs = isEmpty( item.variation )
117
+ ? args
118
+ : {
119
+ ...args,
120
+ item: {
121
+ ...args.item,
122
+ name: item.variation,
123
+ },
124
+ 'aria-label': `${ item.breadcrumbs[ 0 ] }: ${ item.variation }`,
125
+ };
126
 
127
  return (
128
  <SearchListItem
129
+ { ...itemArgs }
130
  className={ classes }
131
+ name={ `variations-${ instanceId }` }
 
132
  />
133
  );
134
  };
156
  <SearchListControl
157
  className="woocommerce-products"
158
  list={ currentList }
159
+ isCompact={ isCompact }
160
  isLoading={ isLoading }
161
  isSingle
162
  selected={ currentList.filter( ( { id } ) =>
176
  * Callback to update the selected products.
177
  */
178
  onChange: PropTypes.func.isRequired,
179
+ isCompact: PropTypes.bool,
180
  /**
181
  * The ID of the currently expanded product.
182
  */
204
  };
205
 
206
  ProductControl.defaultProps = {
207
+ isCompact: false,
208
  expandedProduct: null,
209
  selected: [],
210
  showVariations: false,
211
  };
212
 
213
  export default withTransformSingleSelectToMultipleSelect(
214
+ withSearchedProducts(
215
+ withProductVariations( withInstanceId( ProductControl ) )
216
+ )
217
  );
assets/js/editor-components/product-control/style.scss CHANGED
@@ -39,7 +39,7 @@
39
  background-size: contain;
40
  }
41
 
42
- &.depth-0.is-variable[aria-expanded="true"]::after {
43
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" fill="#{encode-color($gray-700)}" /></svg>');
44
  }
45
  }
39
  background-size: contain;
40
  }
41
 
42
+ &.depth-0.is-variable.is-selected::after {
43
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" fill="#{encode-color($gray-700)}" /></svg>');
44
  }
45
  }
assets/js/editor-components/product-tag-control/index.js CHANGED
@@ -3,11 +3,12 @@
3
  */
4
  import { __, _n, sprintf } from '@wordpress/i18n';
5
  import { Component } from '@wordpress/element';
6
- import { debounce, find } from 'lodash';
7
  import PropTypes from 'prop-types';
8
  import { SearchListControl, SearchListItem } from '@woocommerce/components';
9
  import { SelectControl } from '@wordpress/components';
10
  import { getSetting } from '@woocommerce/settings';
 
11
 
12
  /**
13
  * Internal dependencies
@@ -56,13 +57,6 @@ class ProductTagControl extends Component {
56
 
57
  renderItem( args ) {
58
  const { item, search, depth = 0 } = args;
59
- const classes = [ 'woocommerce-product-tags__item' ];
60
- if ( search.length ) {
61
- classes.push( 'is-searching' );
62
- }
63
- if ( depth === 0 && item.parent !== 0 ) {
64
- classes.push( 'is-skip-level' );
65
- }
66
 
67
  const accessibleName = ! item.breadcrumbs.length
68
  ? item.name
@@ -70,9 +64,15 @@ class ProductTagControl extends Component {
70
 
71
  return (
72
  <SearchListItem
73
- className={ classes.join( ' ' ) }
 
 
 
 
 
 
 
74
  { ...args }
75
- showCount
76
  aria-label={ sprintf(
77
  /* translators: %1$d is the count of products, %2$s is the name of the tag. */
78
  _n(
@@ -90,7 +90,13 @@ class ProductTagControl extends Component {
90
 
91
  render() {
92
  const { list, loading } = this.state;
93
- const { onChange, onOperatorChange, operator, selected } = this.props;
 
 
 
 
 
 
94
 
95
  const messages = {
96
  clear: __(
@@ -132,12 +138,15 @@ class ProductTagControl extends Component {
132
  list={ list }
133
  isLoading={ loading }
134
  selected={ selected
135
- .map( ( id ) => find( list, { id } ) )
 
 
136
  .filter( Boolean ) }
137
  onChange={ onChange }
138
  onSearch={ limitTags ? this.debouncedOnSearch : null }
139
  renderItem={ this.renderItem }
140
  messages={ messages }
 
141
  isHierarchical
142
  />
143
  { !! onOperatorChange && (
@@ -199,9 +208,11 @@ ProductTagControl.propTypes = {
199
  * The list of currently selected tags.
200
  */
201
  selected: PropTypes.array.isRequired,
 
202
  };
203
 
204
  ProductTagControl.defaultProps = {
 
205
  operator: 'any',
206
  };
207
 
3
  */
4
  import { __, _n, sprintf } from '@wordpress/i18n';
5
  import { Component } from '@wordpress/element';
6
+ import { debounce } from 'lodash';
7
  import PropTypes from 'prop-types';
8
  import { SearchListControl, SearchListItem } from '@woocommerce/components';
9
  import { SelectControl } from '@wordpress/components';
10
  import { getSetting } from '@woocommerce/settings';
11
+ import classNames from 'classnames';
12
 
13
  /**
14
  * Internal dependencies
57
 
58
  renderItem( args ) {
59
  const { item, search, depth = 0 } = args;
 
 
 
 
 
 
 
60
 
61
  const accessibleName = ! item.breadcrumbs.length
62
  ? item.name
64
 
65
  return (
66
  <SearchListItem
67
+ className={ classNames(
68
+ 'woocommerce-product-tags__item',
69
+ 'has-count',
70
+ {
71
+ 'is-searching': search.length > 0,
72
+ 'is-skip-level': depth === 0 && item.parent !== 0,
73
+ }
74
+ ) }
75
  { ...args }
 
76
  aria-label={ sprintf(
77
  /* translators: %1$d is the count of products, %2$s is the name of the tag. */
78
  _n(
90
 
91
  render() {
92
  const { list, loading } = this.state;
93
+ const {
94
+ isCompact,
95
+ onChange,
96
+ onOperatorChange,
97
+ operator,
98
+ selected,
99
+ } = this.props;
100
 
101
  const messages = {
102
  clear: __(
138
  list={ list }
139
  isLoading={ loading }
140
  selected={ selected
141
+ .map( ( id ) =>
142
+ list.find( ( listItem ) => listItem.id === id )
143
+ )
144
  .filter( Boolean ) }
145
  onChange={ onChange }
146
  onSearch={ limitTags ? this.debouncedOnSearch : null }
147
  renderItem={ this.renderItem }
148
  messages={ messages }
149
+ isCompact={ isCompact }
150
  isHierarchical
151
  />
152
  { !! onOperatorChange && (
208
  * The list of currently selected tags.
209
  */
210
  selected: PropTypes.array.isRequired,
211
+ isCompact: PropTypes.bool,
212
  };
213
 
214
  ProductTagControl.defaultProps = {
215
+ isCompact: false,
216
  operator: 'any',
217
  };
218
 
assets/js/editor-components/product-tag-control/style.scss CHANGED
@@ -8,14 +8,3 @@
8
  margin-right: 0.5em;
9
  }
10
  }
11
-
12
- .components-panel {
13
- .woocommerce-product-tags__operator.components-base-control {
14
- margin-top: $gap;
15
-
16
- .components-select-control__input {
17
- margin-left: 0;
18
- min-width: 100%;
19
- }
20
- }
21
- }
8
  margin-right: 0.5em;
9
  }
10
  }
 
 
 
 
 
 
 
 
 
 
 
assets/js/editor-components/products-control/index.js CHANGED
@@ -18,6 +18,7 @@ import ErrorMessage from '@woocommerce/editor-components/error-placeholder/error
18
  * @param {Array} props.selected An array of selected products.
19
  * @param {Array} props.products An array of products to select from.
20
  * @param {boolean} props.isLoading Whether or not the products are being loaded.
 
21
  *
22
  * @return {Function} A functional component.
23
  */
@@ -28,6 +29,7 @@ const ProductsControl = ( {
28
  selected,
29
  products,
30
  isLoading,
 
31
  } ) => {
32
  const messages = {
33
  clear: __( 'Clear all products', 'woo-gutenberg-products-block' ),
@@ -65,6 +67,7 @@ const ProductsControl = ( {
65
  <SearchListControl
66
  className="woocommerce-products"
67
  list={ products }
 
68
  isLoading={ isLoading }
69
  selected={ products.filter( ( { id } ) =>
70
  selected.includes( id )
@@ -81,12 +84,14 @@ ProductsControl.propTypes = {
81
  onSearch: PropTypes.func,
82
  selected: PropTypes.array,
83
  products: PropTypes.array,
 
84
  isLoading: PropTypes.bool,
85
  };
86
 
87
  ProductsControl.defaultProps = {
88
  selected: [],
89
  products: [],
 
90
  isLoading: true,
91
  };
92
 
18
  * @param {Array} props.selected An array of selected products.
19
  * @param {Array} props.products An array of products to select from.
20
  * @param {boolean} props.isLoading Whether or not the products are being loaded.
21
+ * @param {boolean} props.isCompact Whether or not the control should have compact styles.
22
  *
23
  * @return {Function} A functional component.
24
  */
29
  selected,
30
  products,
31
  isLoading,
32
+ isCompact,
33
  } ) => {
34
  const messages = {
35
  clear: __( 'Clear all products', 'woo-gutenberg-products-block' ),
67
  <SearchListControl
68
  className="woocommerce-products"
69
  list={ products }
70
+ isCompact={ isCompact }
71
  isLoading={ isLoading }
72
  selected={ products.filter( ( { id } ) =>
73
  selected.includes( id )
84
  onSearch: PropTypes.func,
85
  selected: PropTypes.array,
86
  products: PropTypes.array,
87
+ isCompact: PropTypes.bool,
88
  isLoading: PropTypes.bool,
89
  };
90
 
91
  ProductsControl.defaultProps = {
92
  selected: [],
93
  products: [],
94
+ isCompact: false,
95
  isLoading: true,
96
  };
97
 
assets/js/hocs/test/with-categories.js CHANGED
@@ -97,7 +97,7 @@ describe( 'withCategories Component', () => {
97
  expect( formatError ).toHaveBeenCalledTimes( 1 );
98
  expect( props.error ).toEqual( formattedError );
99
  expect( props.isLoading ).toBe( false );
100
- expect( props.categories ).toBeNull();
101
  } );
102
  } );
103
  } );
97
  expect( formatError ).toHaveBeenCalledTimes( 1 );
98
  expect( props.error ).toEqual( formattedError );
99
  expect( props.isLoading ).toBe( false );
100
+ expect( props.categories ).toEqual( [] );
101
  } );
102
  } );
103
  } );
assets/js/hocs/with-categories.js CHANGED
@@ -22,7 +22,7 @@ const withCategories = createHigherOrderComponent( ( OriginalComponent ) => {
22
  this.state = {
23
  error: null,
24
  loading: false,
25
- categories: null,
26
  };
27
  this.loadCategories = this.loadCategories.bind( this );
28
  }
@@ -46,7 +46,7 @@ const withCategories = createHigherOrderComponent( ( OriginalComponent ) => {
46
  const error = await formatError( e );
47
 
48
  this.setState( {
49
- categories: null,
50
  loading: false,
51
  error,
52
  } );
22
  this.state = {
23
  error: null,
24
  loading: false,
25
+ categories: [],
26
  };
27
  this.loadCategories = this.loadCategories.bind( this );
28
  }
46
  const error = await formatError( e );
47
 
48
  this.setState( {
49
+ categories: [],
50
  loading: false,
51
  error,
52
  } );
assets/js/icons/stories/index.js CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { omitBy, omit, map } from 'lodash';
5
  import { useState } from '@wordpress/element';
6
 
7
  /**
@@ -22,6 +22,7 @@ const LibraryExample = () => {
22
  const filteredIcons = omitBy( availableIcons, ( _icon, name ) => {
23
  return ! name.includes( filter );
24
  } );
 
25
  return (
26
  <div style={ { padding: '20px' } }>
27
  <label htmlFor="filter-icons" style={ { paddingRight: '30px' } }>
@@ -39,16 +40,16 @@ const LibraryExample = () => {
39
  style={ {
40
  display: 'flex',
41
  alignItems: 'bottom',
42
- 'flex-wrap': 'wrap',
43
  } }
44
  >
45
- { map( filteredIcons, ( icon, name ) => {
46
  return (
47
  <div
48
  key={ name }
49
  style={ {
50
  display: 'flex',
51
- 'flex-direction': 'column',
52
  width: '25%',
53
  padding: '25px 0 25px 0',
54
  } }
@@ -68,12 +69,12 @@ const LibraryExample = () => {
68
  >
69
  <Icon srcElement={ icon } />
70
  <Icon
71
- style={ { 'padding-left': '10px' } }
72
  srcElement={ icon }
73
  size={ 36 }
74
  />
75
  <Icon
76
- style={ { 'padding-left': '10px' } }
77
  srcElement={ icon }
78
  size={ 48 }
79
  />
1
  /**
2
  * External dependencies
3
  */
4
+ import { omitBy, omit } from 'lodash';
5
  import { useState } from '@wordpress/element';
6
 
7
  /**
22
  const filteredIcons = omitBy( availableIcons, ( _icon, name ) => {
23
  return ! name.includes( filter );
24
  } );
25
+
26
  return (
27
  <div style={ { padding: '20px' } }>
28
  <label htmlFor="filter-icons" style={ { paddingRight: '30px' } }>
40
  style={ {
41
  display: 'flex',
42
  alignItems: 'bottom',
43
+ flexWrap: 'wrap',
44
  } }
45
  >
46
+ { Object.entries( filteredIcons ).map( ( [ name, icon ] ) => {
47
  return (
48
  <div
49
  key={ name }
50
  style={ {
51
  display: 'flex',
52
+ flexDirection: 'column',
53
  width: '25%',
54
  padding: '25px 0 25px 0',
55
  } }
69
  >
70
  <Icon srcElement={ icon } />
71
  <Icon
72
+ style={ { paddingLeft: '10px' } }
73
  srcElement={ icon }
74
  size={ 36 }
75
  />
76
  <Icon
77
+ style={ { paddingLeft: '10px' } }
78
  srcElement={ icon }
79
  size={ 48 }
80
  />
assets/js/previews/cart.ts CHANGED
@@ -11,6 +11,7 @@ import { getSetting } from '@woocommerce/settings';
11
  */
12
  import { previewShippingRates } from './shipping-rates';
13
 
 
14
  // Sample data for cart block.
15
  // This closely resembles the data returned from the Store API /cart endpoint.
16
  // https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/trunk/src/RestApi/StoreApi#cart-api
@@ -66,14 +67,14 @@ export const previewCart: CartResponse = {
66
  currency_thousand_separator: ',',
67
  currency_prefix: '$',
68
  currency_suffix: '',
69
- price: '800',
70
- regular_price: '800',
71
- sale_price: '800',
72
  raw_prices: {
73
  precision: 6,
74
- price: '8000000',
75
- regular_price: '8000000',
76
- sale_price: '8000000',
77
  },
78
  },
79
  totals: {
@@ -84,10 +85,10 @@ export const previewCart: CartResponse = {
84
  currency_thousand_separator: ',',
85
  currency_prefix: '$',
86
  currency_suffix: '',
87
- line_subtotal: '1600',
88
  line_subtotal_tax: '0',
89
  line_total: '1600',
90
- line_total_tax: '0',
91
  },
92
  extensions: {},
93
  },
@@ -132,14 +133,14 @@ export const previewCart: CartResponse = {
132
  currency_thousand_separator: ',',
133
  currency_prefix: '$',
134
  currency_suffix: '',
135
- price: '1400',
136
- regular_price: '1600',
137
- sale_price: '1400',
138
  raw_prices: {
139
  precision: 6,
140
- price: '14000000',
141
- regular_price: '16000000',
142
- sale_price: '14000000',
143
  },
144
  },
145
  totals: {
@@ -150,10 +151,10 @@ export const previewCart: CartResponse = {
150
  currency_thousand_separator: ',',
151
  currency_prefix: '$',
152
  currency_suffix: '',
153
- line_subtotal: '1400',
154
- line_subtotal_tax: '0',
155
  line_total: '1400',
156
- line_total_tax: '0',
157
  },
158
  extensions: {},
159
  },
@@ -197,7 +198,7 @@ export const previewCart: CartResponse = {
197
  currency_thousand_separator: ',',
198
  currency_prefix: '$',
199
  currency_suffix: '',
200
- total_items: '3000',
201
  total_items_tax: '0',
202
  total_fees: '0',
203
  total_fees_tax: '0',
@@ -205,8 +206,14 @@ export const previewCart: CartResponse = {
205
  total_discount_tax: '0',
206
  total_shipping: '0',
207
  total_shipping_tax: '0',
208
- total_tax: '0',
209
  total_price: '3000',
210
- tax_lines: [],
 
 
 
 
 
 
211
  },
212
  };
11
  */
12
  import { previewShippingRates } from './shipping-rates';
13
 
14
+ const displayWithTax = getSetting( 'displayCartPricesIncludingTax', false );
15
  // Sample data for cart block.
16
  // This closely resembles the data returned from the Store API /cart endpoint.
17
  // https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/trunk/src/RestApi/StoreApi#cart-api
67
  currency_thousand_separator: ',',
68
  currency_prefix: '$',
69
  currency_suffix: '',
70
+ price: displayWithTax ? '800' : '640',
71
+ regular_price: displayWithTax ? '800' : '640',
72
+ sale_price: displayWithTax ? '800' : '640',
73
  raw_prices: {
74
  precision: 6,
75
+ price: displayWithTax ? '8000000' : '6400000',
76
+ regular_price: displayWithTax ? '8000000' : '6400000',
77
+ sale_price: displayWithTax ? '8000000' : '6400000',
78
  },
79
  },
80
  totals: {
85
  currency_thousand_separator: ',',
86
  currency_prefix: '$',
87
  currency_suffix: '',
88
+ line_subtotal: displayWithTax ? '1600' : '1280',
89
  line_subtotal_tax: '0',
90
  line_total: '1600',
91
+ line_total_tax: displayWithTax ? '0' : '320',
92
  },
93
  extensions: {},
94
  },
133
  currency_thousand_separator: ',',
134
  currency_prefix: '$',
135
  currency_suffix: '',
136
+ price: displayWithTax ? '1400' : '1120',
137
+ regular_price: displayWithTax ? '1600' : '1280',
138
+ sale_price: displayWithTax ? '1400' : '1120',
139
  raw_prices: {
140
  precision: 6,
141
+ price: displayWithTax ? '14000000' : '11200000',
142
+ regular_price: displayWithTax ? '16000000' : '12800000',
143
+ sale_price: displayWithTax ? '14000000' : '11200000',
144
  },
145
  },
146
  totals: {
151
  currency_thousand_separator: ',',
152
  currency_prefix: '$',
153
  currency_suffix: '',
154
+ line_subtotal: displayWithTax ? '1400' : '1120',
155
+ line_subtotal_tax: displayWithTax ? '0' : '280',
156
  line_total: '1400',
157
+ line_total_tax: displayWithTax ? '0' : '280',
158
  },
159
  extensions: {},
160
  },
198
  currency_thousand_separator: ',',
199
  currency_prefix: '$',
200
  currency_suffix: '',
201
+ total_items: displayWithTax ? '3000' : '2400',
202
  total_items_tax: '0',
203
  total_fees: '0',
204
  total_fees_tax: '0',
206
  total_discount_tax: '0',
207
  total_shipping: '0',
208
  total_shipping_tax: '0',
209
+ total_tax: '600',
210
  total_price: '3000',
211
+ tax_lines: [
212
+ {
213
+ name: __( 'Sales tax', 'woo-gutenberg-products-block' ),
214
+ rate: '20%',
215
+ price: 600,
216
+ },
217
+ ],
218
  },
219
  };
assets/js/settings/shared/settings-init.ts CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  declare global {
2
  interface Window {
3
  wcSettings: Record< string, unknown >;
@@ -12,7 +17,7 @@ export interface WooCommerceSiteCurrency {
12
  // The symbol for the currency (eg '$')
13
  symbol: string;
14
  // The position for the symbol ('left', or 'right')
15
- symbolPosition: 'left' | 'right' | 'left_space' | 'right_space';
16
  // The string used for the decimal separator.
17
  decimalSeparator: string;
18
  // The string used for the thousands separator.
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { SymbolPosition } from '@woocommerce/type-defs/currency';
5
+
6
  declare global {
7
  interface Window {
8
  wcSettings: Record< string, unknown >;
17
  // The symbol for the currency (eg '$')
18
  symbol: string;
19
  // The position for the symbol ('left', or 'right')
20
+ symbolPosition: SymbolPosition;
21
  // The string used for the decimal separator.
22
  decimalSeparator: string;
23
  // The string used for the thousands separator.
assets/js/settings/shared/test/get-setting.js CHANGED
@@ -11,6 +11,9 @@ describe( 'getSetting', () => {
11
  it( 'returns expected value for existing setting', () => {
12
  expect( getSetting( 'adminUrl', 'not this' ) ).toEqual( ADMIN_URL );
13
  } );
 
 
 
14
  it( 'filters value via provided filter callback', () => {
15
  expect( getSetting( 'some value', 'default', () => 42 ) ).toBe( 42 );
16
  } );
11
  it( 'returns expected value for existing setting', () => {
12
  expect( getSetting( 'adminUrl', 'not this' ) ).toEqual( ADMIN_URL );
13
  } );
14
+ it( "returns expected value for existing setting even if it's a falsy value", () => {
15
+ expect( getSetting( 'currentUserIsAdmin', true ) ).toBe( false );
16
+ } );
17
  it( 'filters value via provided filter callback', () => {
18
  expect( getSetting( 'some value', 'default', () => 42 ) ).toBe( 42 );
19
  } );
assets/js/settings/shared/utils.ts CHANGED
@@ -11,13 +11,15 @@ import { allSettings } from './settings-init';
11
  /**
12
  * Retrieves a setting value from the setting state.
13
  *
14
- * If a setting with key `name` does not exist, the `fallback` will be returned instead. An optional `filter` callback
15
- * can be passed to format the returned value.
 
16
  */
17
  export const getSetting = (
18
  name: string,
19
  fallback: unknown = false,
20
- filter = ( val: unknown, fb: unknown ) => val || fb
 
21
  ): unknown => {
22
  const value = name in allSettings ? allSettings[ name ] : fallback;
23
  return filter( value, fallback );
11
  /**
12
  * Retrieves a setting value from the setting state.
13
  *
14
+ * If a setting with key `name` does not exist or is undefined,
15
+ * the `fallback` will be returned instead. An optional `filter`
16
+ * callback can be passed to format the returned value.
17
  */
18
  export const getSetting = (
19
  name: string,
20
  fallback: unknown = false,
21
+ filter = ( val: unknown, fb: unknown ) =>
22
+ typeof val !== 'undefined' ? val : fb
23
  ): unknown => {
24
  const value = name in allSettings ? allSettings[ name ] : fallback;
25
  return filter( value, fallback );
assets/js/type-defs/checkout.js DELETED
@@ -1,26 +0,0 @@
1
- /**
2
- * @typedef {Object} CheckoutDispatchActions
3
- *
4
- * @property {function():void} resetCheckout Dispatches an action that resets the checkout to a pristine state.
5
- * @property {function(string):void} setRedirectUrl Dispatches an action that sets the redirectUrl.
6
- * @property {function(boolean=):void} setHasError Dispatches an action that sets the checkout status to having an error.
7
- * @property {function(Object):void} setAfterProcessing Dispatches an action that sets the checkout status to after processing and also sets the response data accordingly.
8
- * @property {function():void} incrementCalculating Dispatches an action that increments the calculating state for checkout by one.
9
- * @property {function():void} decrementCalculating Dispatches an action that decrements the calculating state for checkout by one.
10
- * @property {function(number|string):void} setOrderId Dispatches an action that stores the draft order ID and key.
11
- * @property {function(string):void} setOrderNotes Dispatches an action that sets the order notes.
12
- * @property {function(number):void} setCustomerId Dispatches an action that stores the customer ID.
13
- */
14
-
15
- /**
16
- * @typedef {Object} CheckoutStatusConstants
17
- *
18
- * @property {string} PRISTINE Checkout is in it's initialized state.
19
- * @property {string} IDLE When checkout state has changed but there is no activity happening.
20
- * @property {string} BEFORE_PROCESSING This is the state before checkout processing begins after the checkout button has been pressed/submitted.
21
- * @property {string} PROCESSING After BEFORE_PROCESSING status emitters have finished successfully. Payment processing is started on this checkout status.
22
- * @property {string} AFTER_PROCESSING After server side checkout processing is completed this status is set.
23
- * @property {string} COMPLETE After the AFTER_PROCESSING event emitters have completed. This status triggers the checkout redirect.
24
- */
25
-
26
- export {};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/types/index.ts ADDED
@@ -0,0 +1,2 @@
 
 
1
+ export * from './type-defs';
2
+ export * from './type-guards';
assets/js/{type-defs → types/type-defs}/add-to-cart-form.js RENAMED
File without changes
assets/js/{type-defs → types/type-defs}/address-fields.js RENAMED
File without changes
assets/js/{type-defs → types/type-defs}/billing.js RENAMED
File without changes
assets/js/{type-defs → types/type-defs}/cart-response.ts RENAMED
@@ -1,26 +1,17 @@
1
  /* eslint-disable camelcase -- API responses have camelcase properties */
2
  /**
3
- * External dependencies
4
  */
 
5
  import {
6
  CartImageItem,
7
  CartItemPrices,
8
  CartItemTotals,
9
  CartVariationItem,
10
  CatalogVisibility,
11
- } from '@woocommerce/type-defs/cart';
12
 
13
- export interface CurrencyResponseInfo {
14
- currency_code: string;
15
- currency_symbol: string;
16
- currency_minor_unit: number;
17
- currency_decimal_separator: string;
18
- currency_thousand_separator: string;
19
- currency_prefix: string;
20
- currency_suffix: string;
21
- }
22
-
23
- export interface CartResponseTotalsItem extends CurrencyResponseInfo {
24
  total_discount: string;
25
  total_discount_tax: string;
26
  }
@@ -61,7 +52,7 @@ export type ExtensionsData =
61
  | Record< string, never >;
62
 
63
  export interface CartResponseShippingPackageShippingRate
64
- extends CurrencyResponseInfo {
65
  rate_id: string;
66
  name: string;
67
  description: string;
@@ -110,7 +101,7 @@ export interface CartResponseVariationItem {
110
  value: string;
111
  }
112
 
113
- export interface CartResponseItemPrices extends CurrencyResponseInfo {
114
  price: string;
115
  regular_price: string;
116
  sale_price: string;
@@ -123,7 +114,7 @@ export interface CartResponseItemPrices extends CurrencyResponseInfo {
123
  };
124
  }
125
 
126
- export interface CartResponseItemTotals extends CurrencyResponseInfo {
127
  line_subtotal: string;
128
  line_subtotal_tax: string;
129
  line_total: string;
@@ -157,9 +148,10 @@ export interface CartResponseItem {
157
  export interface CartResponseTotalsTaxLineItem {
158
  name: string;
159
  price: string;
 
160
  }
161
 
162
- export interface CartResponseFeeItemTotals extends CurrencyResponseInfo {
163
  total: string;
164
  total_tax: string;
165
  }
@@ -170,7 +162,7 @@ export type CartResponseFeeItem = {
170
  totals: CartResponseFeeItemTotals;
171
  };
172
 
173
- export interface CartResponseTotals extends CurrencyResponseInfo {
174
  total_items: string;
175
  total_items_tax: string;
176
  total_fees: string;
1
  /* eslint-disable camelcase -- API responses have camelcase properties */
2
  /**
3
+ * Internal dependencies
4
  */
5
+ import { CurrencyResponse } from './currency';
6
  import {
7
  CartImageItem,
8
  CartItemPrices,
9
  CartItemTotals,
10
  CartVariationItem,
11
  CatalogVisibility,
12
+ } from './cart';
13
 
14
+ export interface CartResponseTotalsItem extends CurrencyResponse {
 
 
 
 
 
 
 
 
 
 
15
  total_discount: string;
16
  total_discount_tax: string;
17
  }
52
  | Record< string, never >;
53
 
54
  export interface CartResponseShippingPackageShippingRate
55
+ extends CurrencyResponse {
56
  rate_id: string;
57
  name: string;
58
  description: string;
101
  value: string;
102
  }
103
 
104
+ export interface CartResponseItemPrices extends CurrencyResponse {
105
  price: string;
106
  regular_price: string;
107
  sale_price: string;
114
  };
115
  }
116
 
117
+ export interface CartResponseItemTotals extends CurrencyResponse {
118
  line_subtotal: string;
119
  line_subtotal_tax: string;
120
  line_total: string;
148
  export interface CartResponseTotalsTaxLineItem {
149
  name: string;
150
  price: string;
151
+ rate: string;
152
  }
153
 
154
+ export interface CartResponseFeeItemTotals extends CurrencyResponse {
155
  total: string;
156
  total_tax: string;
157
  }
162
  totals: CartResponseFeeItemTotals;
163
  };
164
 
165
+ export interface CartResponseTotals extends CurrencyResponse {
166
  total_items: string;
167
  total_items_tax: string;
168
  total_fees: string;
assets/js/{type-defs → types/type-defs}/cart.js RENAMED
File without changes
assets/js/{type-defs → types/type-defs}/cart.ts RENAMED
@@ -137,6 +137,7 @@ export interface CartItem {
137
  export interface CartTotalsTaxLineItem {
138
  name: string;
139
  price: string;
 
140
  }
141
 
142
  export interface CartFeeItemTotals extends CurrencyInfo {
137
  export interface CartTotalsTaxLineItem {
138
  name: string;
139
  price: string;
140
+ rate: string;
141
  }
142
 
143
  export interface CartFeeItemTotals extends CurrencyInfo {
assets/js/{type-defs → types/type-defs}/contexts.js RENAMED
@@ -13,8 +13,8 @@
13
  *
14
  * @property {BillingData} billingData The current billing data, including address and email.
15
  * @property {CartShippingAddress} shippingAddress The current set address for shipping.
16
- * @property {Function} setBillingData A function for setting billing data.
17
- * @property {Function} setShippingAddress A function for setting shipping address.
18
  */
19
 
20
  /**
@@ -27,10 +27,10 @@
27
  * @property {CartShippingOption[]} shippingRates An array of available shipping rates.
28
  * @property {boolean} shippingRatesLoading Whether or not the shipping rates are being loaded.
29
  * @property {string[]} selectedRates The ids of the rates that are selected.
30
- * @property {Function} setSelectedRates Function for setting the selected rates.
31
  * @property {boolean} isSelectingRate True when rate is being selected.
32
  * @property {CartShippingAddress} shippingAddress The current set address for shipping.
33
- * @property {Function} setShippingAddress Function for setting the shipping address.
34
  * @property {function()} onShippingRateSuccess Used to register a callback to be invoked when shipping
35
  * rates are retrieved.
36
  * @property {function()} onShippingRateSelectSuccess Used to register a callback to be invoked when shipping
13
  *
14
  * @property {BillingData} billingData The current billing data, including address and email.
15
  * @property {CartShippingAddress} shippingAddress The current set address for shipping.
16
+ * @property {function()} setBillingData A function for setting billing data.
17
+ * @property {function()} setShippingAddress A function for setting shipping address.
18
  */
19
 
20
  /**
27
  * @property {CartShippingOption[]} shippingRates An array of available shipping rates.
28
  * @property {boolean} shippingRatesLoading Whether or not the shipping rates are being loaded.
29
  * @property {string[]} selectedRates The ids of the rates that are selected.
30
+ * @property {function()} setSelectedRates Function for setting the selected rates.
31
  * @property {boolean} isSelectingRate True when rate is being selected.
32
  * @property {CartShippingAddress} shippingAddress The current set address for shipping.
33
+ * @property {function()} setShippingAddress Function for setting the shipping address.
34
  * @property {function()} onShippingRateSuccess Used to register a callback to be invoked when shipping
35
  * rates are retrieved.
36
  * @property {function()} onShippingRateSelectSuccess Used to register a callback to be invoked when shipping
assets/js/types/type-defs/currency.ts ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export interface Currency {
2
+ code: string;
3
+ decimalSeparator: string;
4
+ minorUnit: number;
5
+ prefix: string;
6
+ suffix: string;
7
+ symbol: string;
8
+ thousandSeparator: string;
9
+ }
10
+
11
+ /* eslint-disable camelcase -- API responses have camelcase properties */
12
+ export interface CurrencyResponse {
13
+ currency_code: string;
14
+ currency_symbol: string;
15
+ currency_minor_unit: number;
16
+ currency_decimal_separator: string;
17
+ currency_thousand_separator: string;
18
+ currency_prefix: string;
19
+ currency_suffix: string;
20
+ }
21
+
22
+ export type SymbolPosition = 'left' | 'left_space' | 'right' | 'right_space';
assets/js/{type-defs → types/type-defs}/hooks.js RENAMED
File without changes
assets/js/{type-defs → types/type-defs}/hooks.ts RENAMED
@@ -12,7 +12,7 @@ import type {
12
  CartResponseShippingRate,
13
  CartResponse,
14
  } from './cart-response';
15
- import type { ResponseError } from '../data/types';
16
  export interface StoreCartItemQuantity {
17
  isPendingDelete: boolean;
18
  quantity: number;
12
  CartResponseShippingRate,
13
  CartResponse,
14
  } from './cart-response';
15
+ import type { ResponseError } from '../../data/types';
16
  export interface StoreCartItemQuantity {
17
  isPendingDelete: boolean;
18
  quantity: number;
assets/js/{type-defs → types/type-defs}/index.ts RENAMED
@@ -2,3 +2,4 @@ export * from './cart-response';
2
  export * from './product-response';
3
  export * from './cart';
4
  export * from './hooks';
 
2
  export * from './product-response';
3
  export * from './cart';
4
  export * from './hooks';
5
+ export * from './currency';
assets/js/{type-defs → types/type-defs}/payments.js RENAMED
File without changes
assets/js/{type-defs → types/type-defs}/product-response.ts RENAMED
@@ -1,15 +1,11 @@
1
  /* eslint-disable camelcase -- API responses have camelcase properties */
2
- export interface CurrencyResponseInfo {
3
- currency_code: string;
4
- currency_symbol: string;
5
- currency_minor_unit: number;
6
- currency_decimal_separator: string;
7
- currency_thousand_separator: string;
8
- currency_prefix: string;
9
- currency_suffix: string;
10
- }
11
 
12
- export interface ProductResponseItemPrices extends CurrencyResponseInfo {
 
 
 
 
 
13
  price: string;
14
  regular_price: string;
15
  sale_price: string;
1
  /* eslint-disable camelcase -- API responses have camelcase properties */
 
 
 
 
 
 
 
 
 
2
 
3
+ /**
4
+ * Internal dependencies
5
+ */
6
+ import { CurrencyResponse } from './currency';
7
+
8
+ export interface ProductResponseItemPrices extends CurrencyResponse {
9
  price: string;
10
  regular_price: string;
11
  sale_price: string;
assets/js/{type-defs → types/type-defs}/registered-payment-method-props.js RENAMED
File without changes
assets/js/{type-defs → types/type-defs}/settings.js RENAMED
File without changes
assets/js/{type-defs → types/type-defs}/shipping.js RENAMED
File without changes
assets/js/{type-defs → types/type-defs}/shipping.ts RENAMED
File without changes
assets/js/{base/utils/type-guards.ts → types/type-guards/index.ts} RENAMED
@@ -17,11 +17,11 @@ export const isObject = < T extends Record< string, unknown >, U >(
17
  };
18
 
19
  export function objectHasProp< P extends PropertyKey >(
20
- target: Record< string, unknown >,
21
  property: P
22
  ): target is { [ K in P ]: unknown } {
23
  // The `in` operator throws a `TypeError` for non-object values.
24
- return property in target;
25
  }
26
 
27
  // eslint-disable-next-line @typescript-eslint/ban-types
17
  };
18
 
19
  export function objectHasProp< P extends PropertyKey >(
20
+ target: unknown,
21
  property: P
22
  ): target is { [ K in P ]: unknown } {
23
  // The `in` operator throws a `TypeError` for non-object values.
24
+ return isObject( target ) && property in target;
25
  }
26
 
27
  // eslint-disable-next-line @typescript-eslint/ban-types
assets/js/utils/attributes-query.js CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { sortBy, map } from 'lodash';
5
 
6
  /**
7
  * Given a query object, removes an attribute filter by a single slug.
@@ -75,7 +75,7 @@ export const updateAttributeFilter = (
75
  returnQuery.push( {
76
  attribute: attribute.taxonomy,
77
  operator,
78
- slug: map( attributeTerms, 'slug' ).sort(),
79
  } );
80
  setQuery( sortBy( returnQuery, 'attribute' ) );
81
  }
1
  /**
2
  * External dependencies
3
  */
4
+ import { sortBy } from 'lodash';
5
 
6
  /**
7
  * Given a query object, removes an attribute filter by a single slug.
75
  returnQuery.push( {
76
  attribute: attribute.taxonomy,
77
  operator,
78
+ slug: attributeTerms.map( ( { slug } ) => slug ).sort(),
79
  } );
80
  setQuery( sortBy( returnQuery, 'attribute' ) );
81
  }
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' => '6ac27c4f05842e0dbc741860d8647b76');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-blocks', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'd59c854a2d4e2ed0bee6af672ca04350');
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=238)}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},11:function(e,t){!function(){e.exports=this.wp.data}()},110: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}},12:function(e,t,r){"use strict";r.d(t,"k",(function(){return c})),r.d(t,"i",(function(){return a})),r.d(t,"j",(function(){return i})),r.d(t,"f",(function(){return u})),r.d(t,"b",(function(){return l})),r.d(t,"e",(function(){return p})),r.d(t,"d",(function(){return f})),r.d(t,"h",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"a",(function(){return m})),r.d(t,"c",(function(){return y})),r.d(t,"l",(function(){return v}));var n,o=r(5),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"assets/",i=c.pluginUrl+"build/",s=c.buildPhase,u=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,f=o.STORE_PAGES.privacy.title,b=o.STORE_PAGES.terms.permalink,d=o.STORE_PAGES.terms.title,m=(o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),y=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),v=(r(41),function(){return s>1})},121:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(10),o=r.n(n),c=r(7),a=r.n(c),i=r(0),s=r(44);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){a()(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,a=e.getErrorBoundaryProps,u=void 0===a?function(){}:a;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=c(e,r),a=u(e,r),p=l(l({},e.dataset),n.attributes);e.classList.remove("is-loading"),Object(i.render)(React.createElement(s.a,a,React.createElement(i.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},n,{attributes:p})))),e)}))},b=function(e){var t=e.Block,r=e.getProps,n=e.getErrorBoundaryProps,o=e.selector,c=e.wrappers,a=document.body.querySelectorAll(o);c.length>0&&Array.prototype.filter.call(a,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,c)})),f({Block:t,containers:a,getProps:r,getErrorBoundaryProps:n})},d=function(e){var t=document.body.querySelectorAll(p.join(","));b(l(l({},e),{},{wrappers:t})),Array.prototype.forEach.call(t,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,c,a,i;r=l(l({},e),{},{wrapper:t}),n=r.Block,o=r.getProps,c=r.getErrorBoundaryProps,a=r.selector,i=r.wrapper.querySelectorAll(a),f({Block:n,containers:i,getProps:o,getErrorBoundaryProps:c})}))}))}},124:function(e,t){},127:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(14),o=r(11),c=r(0),a=r(54),i=r(99),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}),m=Object(a.a)(p),y=Object(a.a)(u),v=Object(i.a)(),g=Object(o.useSelect)((function(e){if(!b)return null;var o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,m,y],a=o.getCollectionError.apply(o,c);return a&&v(a),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,r,y,m,b]);return null!==g&&(d.current=g),d.current}},139:function(e,t,r){"use strict";var n=r(7),o=r.n(n),c=r(15),a=r.n(c),i=r(0);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=a()(e,["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){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}},14:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},141:function(e,t,r){"use strict";var n=r(0),o=r(14),c=r(11),a=r(12);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(a.k.restApiRoutes||{}),Object(c.useSelect)((function(e,t){if(r.current){var n=e(o.SCHEMA_STORE_KEY),c=n.isResolving,a=n.hasFinishedResolution,i=t.dispatch(o.SCHEMA_STORE_KEY),s=i.receiveRoutes,u=i.startResolution,l=i.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];c("getRoutes",[e])||a("getRoutes",[e])||(u("getRoutes",[e]),s(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},15:function(e,t,r){var n=r(72);e.exports=function(e,t){if(null==e)return{};var r,o,c=n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(c[r]=e[r])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},150:function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return i}));var n=r(5),o=Object(n.getSetting)("attributes",[]),c=o.reduce((function(e,t){var r,n=(r=t)&&r.attribute_name?{id:parseInt(r.attribute_id,10),name:r.attribute_name,taxonomy:"pa_"+r.attribute_name,label:r.attribute_label}:null;return n.id&&e.push(n),e}),[]),a=function(e){if(e)return c.find((function(t){return t.id===e}))},i=function(e){if(e)return c.find((function(t){return t.taxonomy===e}))}},151:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r(8),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",c=e.filter((function(e){return e.attribute===r.taxonomy})),a=c.length?c[0]:null;if(a&&a.slug&&Array.isArray(a.slug)&&a.slug.includes(o)){var i=a.slug.filter((function(e){return e!==o})),s=e.filter((function(e){return e.attribute!==r.taxonomy}));i.length>0&&(a.slug=i.sort(),s.push(a)),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",a=e.filter((function(e){return e.attribute!==r.taxonomy}));0===o.length?t(a):(a.push({attribute:r.taxonomy,operator:c,slug:Object(n.map)(o,"slug").sort()}),t(Object(n.sortBy)(a,"attribute")))}},158:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(15),a=r.n(c),i=(r(3),r(4)),s=r.n(i),u=r(1),l=r(139),p=r(174),f=(r(124),function(e){var t=e.text,r=e.screenReaderText,n=void 0===r?"":r,c=e.element,i=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,m=a()(e,["text","screenReaderText","element","className","radius","children"]),y=i,v=s()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+f),g=Boolean(n&&n!==t);return React.createElement(y,o()({className:v},m),React.createElement("span",{"aria-hidden":g,className:"wc-block-components-chip__text"},t),g&&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,i=e.disabled,b=void 0!==i&&i,d=e.onRemove,m=void 0===d?function(){}:d,y=e.removeOnAnyClick,v=void 0!==y&&y,g=e.text,O=e.screenReaderText,_=void 0===O?"":O,h=a()(e,["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"]),x=v?"span":"button";if(!r){var E=_&&"string"==typeof _?_:g;r="string"!=typeof E?Object(u.__)("Remove","woo-gutenberg-products-block"):Object(u.sprintf)(Object(u.__)('Remove "%s"',"woo-gutenberg-products-block"),E)}var j={"aria-label":r,disabled:b,onClick:m,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||m()}},w=v?j:{},R=v?{"aria-hidden":!0}:j;return React.createElement(f,o()({},h,w,{className:s()(c,"is-removable"),element:v?"button":h.element,screenReaderText:_,text:g}),React.createElement(x,o()({className:"wc-block-components-chip__remove"},R),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},174:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(15),a=r.n(c),i=r(28),s=function(e){var t=e.className,r=e.size,n=a()(e,["className","size"]);return React.createElement(i.SVG,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},n),React.createElement("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},u=React.createElement(s,null);t.a=u},18:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},2:function(e,t){!function(){e.exports=this.React}()},20:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},21:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},22: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},238:function(e,t,r){e.exports=r(286)},239:function(e,t){},25:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},28:function(e,t){!function(){e.exports=this.wp.primitives}()},286:function(e,t,r){"use strict";r.r(t);var n=r(141),o=r(121),c=r(9),a=r.n(c),i=r(1),s=r(98),u=r(0),l=r(4),p=r.n(l),f=(r(3),r(31)),b=(r(239),r(150)),d=r(40),m=r(158),y=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(i.sprintf)(Object(i.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(d.formatPrice)(e),Object(d.formatPrice)(t)):Number.isFinite(e)?Object(i.sprintf)(Object(i.__)("From %s","woo-gutenberg-products-block"),Object(d.formatPrice)(e)):Object(i.sprintf)(Object(i.__)("Up to %s","woo-gutenberg-products-block"),Object(d.formatPrice)(t))},v=function(e){var t=e.type,r=e.name,n=e.prefix,o=e.removeCallback,c=void 0===o?function(){}:o,a=e.showLabel,s=void 0===a||a,u=e.displayStyle,l=n?React.createElement(React.Fragment,null,n," ",r):r,p=Object(i.sprintf)(Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),r);return React.createElement("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},s&&React.createElement("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===u?React.createElement(m.a,{element:"span",text:l,onRemove:c,radius:"large",ariaLabel:p}):React.createElement("span",{className:"wc-block-active-filters__list-item-name"},l,React.createElement("button",{className:"wc-block-active-filters__list-item-remove",onClick:c},React.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),React.createElement("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),React.createElement("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),React.createElement(f.a,{screenReaderLabel:p}))))},g=r(127),O=r(18),_=r(151),h=function(e){var t=e.attributeObject,r=void 0===t?{}:t,n=e.slugs,o=void 0===n?[]:n,c=e.operator,u=void 0===c?"in":c,l=e.displayStyle,p=Object(g.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[r.id]}),f=p.results,b=p.isLoading,d=Object(s.b)("attributes",[]),m=a()(d,2),y=m[0],h=m[1];if(b)return null;var x=r.label;return React.createElement("li",null,React.createElement("span",{className:"wc-block-active-filters__list-item-type"},x,":"),React.createElement("ul",null,o.map((function(e,t){var n=f.find((function(t){return t.slug===e}));if(!n)return null;var o="";return t>0&&"and"===u&&(o=React.createElement("span",{className:"wc-block-active-filters__list-item-operator"},Object(i.__)("and","woo-gutenberg-products-block"))),v({type:x,name:Object(O.decodeEntities)(n.name||e),prefix:o,removeCallback:function(){Object(_.a)(y,h,r,e)},showLabel:!1,displayStyle:l})}))))},x=function(e){var t=e.attributes,r=e.isEditor,n=void 0!==r&&r,o=Object(s.b)("attributes",[]),c=a()(o,2),l=c[0],d=c[1],m=Object(s.b)("min_price"),g=a()(m,2),O=g[0],_=g[1],x=Object(s.b)("max_price"),E=a()(x,2),j=E[0],w=E[1],R=Object(u.useMemo)((function(){return Number.isFinite(O)||Number.isFinite(j)?v({type:Object(i.__)("Price","woo-gutenberg-products-block"),name:y(O,j),removeCallback:function(){_(void 0),w(void 0)},displayStyle:t.displayStyle}):null}),[O,j,t.displayStyle,_,w]),S=Object(u.useMemo)((function(){return l.map((function(e){var r=Object(b.b)(e.attribute);return React.createElement(h,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[l,t.displayStyle]);if(!(l.length>0||Number.isFinite(O)||Number.isFinite(j)||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,v({type:Object(i.__)("Size","woo-gutenberg-products-block"),name:Object(i.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),v({type:Object(i.__)("Color","woo-gutenberg-products-block"),name:Object(i.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):React.createElement(React.Fragment,null,R,S)),React.createElement("button",{className:"wc-block-active-filters__clear-all",onClick:function(){_(void 0),w(void 0),d([])}},React.createElement(f.a,{label:Object(i.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(i.__)("Clear All Filters","woo-gutenberg-products-block")}))))};Object(o.a)({selector:".wp-block-woocommerce-active-filters",Block:Object(n.a)(x),getProps:function(e){return{attributes:{displayStyle:e.dataset.displayStyle,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3}}}})},3:function(e,t,r){e.exports=r(75)()},31:function(e,t,r){"use strict";var n=r(7),o=r.n(n),c=r(0),a=r(4),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){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,a=e.wrapperProps,s=void 0===a?{}:a,l=null!=r,p=null!=n;return!l&&p?(t=o||"span",s=u(u({},s),{},{className:i()(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))}},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(65);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(22);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},4:function(e,t,r){var n;
2
  /*!
3
  Copyright (c) 2017 Jed Watson.
4
  Licensed under the MIT License (MIT), see
5
  http://jedwatson.github.io/classnames
6
- */!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var c=typeof n;if("string"===c||"number"===c)e.push(n);else if(Array.isArray(n)&&n.length){var a=o.apply(null,n);a&&e.push(a)}else if("object"===c)for(var i in n)r.call(n,i)&&n[i]&&e.push(i)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},40:function(e,t){!function(){e.exports=this.wc.priceFormat}()},41: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),a=r.n(c),i=r(22),s=r.n(i),u=r(34),l=r.n(u),p=r(35),f=r.n(p),b=r(25),d=r.n(b),m=r(7),y=r.n(m),v=(r(3),r(2)),g=r(1),O=r(12),_=function(e){var t=e.imageUrl,r=void 0===t?"".concat(O.i,"img/block-error.svg"):t,n=e.header,o=void 0===n?Object(g.__)("Oops!","woo-gutenberg-products-block"):n,c=e.text,a=void 0===c?Object(g.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,i=e.errorMessage,s=e.errorMessagePrefix,u=void 0===s?Object(g.__)("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),a&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},a),i&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},u?u+" ":"",i)))};r(77);function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f()(this,r)}}var x=function(e){l()(r,e);var t=h(r);function r(){var e;o()(this,r);for(var n=arguments.length,c=new Array(n),a=0;a<n;a++)c[a]=arguments[a];return e=t.call.apply(t,[this].concat(c)),y()(s()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(r,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,a=e.renderError,i=this.state,s=i.errorMessage;return i.hasError?"function"==typeof a?a({errorMessage:s}):React.createElement(_,{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}(v.Component);x.defaultProps={showErrorMessage:!0};t.a=x},5:function(e,t){!function(){e.exports=this.wc.wcSettings}()},54:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=r(21),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}},61:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=Object(n.createContext)("page"),c=function(){return Object(n.useContext)(o)};o.Provider},65: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},69:function(e,t,r){var n=r(70);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},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},70: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},72:function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},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,a){if(a!==n){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return r.PropTypes=r,r}},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}()},86:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},87:function(e,t){e.exports=function(e,t){var r=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=r){var n,o,c=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},88: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){var n=r(86),o=r(87),c=r(69),a=r(88);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},98:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return m}));var n=r(9),o=r.n(n),c=r(14),a=r(11),i=r(0),s=r(21),u=r.n(s),l=r(54),p=r(110),f=r(61),b=function(e){var t=Object(f.a)();e=e||t;var r=Object(a.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(a.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(i.useCallback)((function(t){n(e,t)}),[e,n])]},d=function(e,t,r){var n=Object(f.a)();r=r||n;var o=Object(a.useSelect)((function(n){return n(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),s=Object(a.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(i.useCallback)((function(t){s(r,e,t)}),[r,e,s])]},m=function(e,t){var r=Object(f.a)(),n=b(t=t||r),c=o()(n,2),a=c[0],s=c[1],d=Object(l.a)(a),m=Object(l.a)(e),y=Object(p.a)(m),v=Object(i.useRef)(!1);return Object(i.useEffect)((function(){u()(y,m)||(s(Object.assign({},d,m)),v.current=!0)}),[d,m,y,s]),v.current?[a,s]:[e,s]}},99:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(9),o=r.n(n),c=r(0),a=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}}});
1
+ !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=235)}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},107:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(2);function o(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},11:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},119:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(10),o=r.n(n),c=r(7),a=r.n(c),i=r(0),u=r(44);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=[".wp-block-woocommerce-cart"],f=function(e){var t=e.Block,r=e.containers,n=e.getProps,c=void 0===n?function(){}:n,a=e.getErrorBoundaryProps,s=void 0===a?function(){}:a;0!==r.length&&Array.prototype.forEach.call(r,(function(e,r){var n=c(e,r),a=s(e,r),p=l(l({},e.dataset),n.attributes);e.classList.remove("is-loading"),Object(i.render)(React.createElement(u.a,a,React.createElement(i.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},n,{attributes:p})))),e)}))},b=function(e){var t=e.Block,r=e.getProps,n=e.getErrorBoundaryProps,o=e.selector,c=e.wrappers,a=document.body.querySelectorAll(o);c.length>0&&Array.prototype.filter.call(a,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,c)})),f({Block:t,containers:a,getProps:r,getErrorBoundaryProps:n})},d=function(e){var t=document.body.querySelectorAll(p.join(","));b(l(l({},e),{},{wrappers:t})),Array.prototype.forEach.call(t,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var r,n,o,c,a,i;r=l(l({},e),{},{wrapper:t}),n=r.Block,o=r.getProps,c=r.getErrorBoundaryProps,a=r.selector,i=r.wrapper.querySelectorAll(a),f({Block:n,containers:i,getProps:o,getErrorBoundaryProps:c})}))}))}},12:function(e,t){!function(){e.exports=this.wp.data}()},122:function(e,t){},125:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(15),o=r(12),c=r(0),a=r(54),i=r(95),u=function(e){var t=e.namespace,r=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,p=void 0===l?{}:l,f=e.shouldSelect,b=void 0===f||f;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(c.useRef)({results:[],isLoading:!0}),m=Object(a.a)(p),v=Object(a.a)(s),y=Object(i.a)(),g=Object(o.useSelect)((function(e){if(!b)return null;var o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,m,v],a=o.getCollectionError.apply(o,c);return a&&y(a),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,r,v,m,b]);return null!==g&&(d.current=g),d.current}},13:function(e,t,r){"use strict";r.d(t,"k",(function(){return c})),r.d(t,"i",(function(){return a})),r.d(t,"j",(function(){return i})),r.d(t,"f",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"e",(function(){return p})),r.d(t,"d",(function(){return f})),r.d(t,"h",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"a",(function(){return m})),r.d(t,"c",(function(){return v})),r.d(t,"l",(function(){return y}));var n,o=r(5),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"assets/",i=c.pluginUrl+"build/",u=c.buildPhase,s=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),p=o.STORE_PAGES.privacy.permalink,f=o.STORE_PAGES.privacy.title,b=o.STORE_PAGES.terms.permalink,d=o.STORE_PAGES.terms.title,m=(o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),v=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),y=(r(41),function(){return u>1})},139:function(e,t,r){"use strict";var n=r(7),o=r.n(n),c=r(16),a=r.n(c),i=r(0);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=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?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)):null}},141:function(e,t,r){"use strict";var n=r(0),o=r(15),c=r(12),a=r(13);t.a=function(e){return function(t){var r;return r=Object(n.useRef)(a.k.restApiRoutes||{}),Object(c.useSelect)((function(e,t){if(r.current){var n=e(o.SCHEMA_STORE_KEY),c=n.isResolving,a=n.hasFinishedResolution,i=t.dispatch(o.SCHEMA_STORE_KEY),u=i.receiveRoutes,s=i.startResolution,l=i.finishResolution;Object.keys(r.current).forEach((function(e){var t=r.current[e];c("getRoutes",[e])||a("getRoutes",[e])||(s("getRoutes",[e]),u(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},15:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},150:function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return i}));var n=r(5),o=Object(n.getSetting)("attributes",[]),c=o.reduce((function(e,t){var r,n=(r=t)&&r.attribute_name?{id:parseInt(r.attribute_id,10),name:r.attribute_name,taxonomy:"pa_"+r.attribute_name,label:r.attribute_label}:null;return n.id&&e.push(n),e}),[]),a=function(e){if(e)return c.find((function(t){return t.id===e}))},i=function(e){if(e)return c.find((function(t){return t.taxonomy===e}))}},151:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r(8),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",c=e.filter((function(e){return e.attribute===r.taxonomy})),a=c.length?c[0]:null;if(a&&a.slug&&Array.isArray(a.slug)&&a.slug.includes(o)){var i=a.slug.filter((function(e){return e!==o})),u=e.filter((function(e){return e.attribute!==r.taxonomy}));i.length>0&&(a.slug=i.sort(),u.push(a)),t(Object(n.sortBy)(u,"attribute"))}},c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",a=e.filter((function(e){return e.attribute!==r.taxonomy}));0===o.length?t(a):(a.push({attribute:r.taxonomy,operator:c,slug:o.map((function(e){return e.slug})).sort()}),t(Object(n.sortBy)(a,"attribute")))}},158:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(16),a=r.n(c),i=(r(3),r(4)),u=r.n(i),s=r(1),l=r(139),p=r(170),f=(r(122),function(e){var t=e.text,r=e.screenReaderText,n=void 0===r?"":r,c=e.element,i=void 0===c?"li":c,s=e.className,l=void 0===s?"":s,p=e.radius,f=void 0===p?"small":p,b=e.children,d=void 0===b?null:b,m=a()(e,["text","screenReaderText","element","className","radius","children"]),v=i,y=u()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+f),g=Boolean(n&&n!==t);return React.createElement(v,o()({className:y},m),React.createElement("span",{"aria-hidden":g,className:"wc-block-components-chip__text"},t),g&&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,i=e.disabled,b=void 0!==i&&i,d=e.onRemove,m=void 0===d?function(){}:d,v=e.removeOnAnyClick,y=void 0!==v&&v,g=e.text,_=e.screenReaderText,O=void 0===_?"":_,h=a()(e,["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"]),x=y?"span":"button";if(!r){var E=O&&"string"==typeof O?O:g;r="string"!=typeof E?Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),E)}var w={"aria-label":r,disabled:b,onClick:m,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||m()}},j=y?w:{},R=y?{"aria-hidden":!0}:w;return React.createElement(f,o()({},h,j,{className:u()(c,"is-removable"),element:y?"button":h.element,screenReaderText:O,text:g}),React.createElement(x,o()({className:"wc-block-components-chip__remove"},R),React.createElement(l.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},16:function(e,t,r){var n=r(71);e.exports=function(e,t){if(null==e)return{};var r,o,c=n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(c[r]=e[r])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},170:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(16),a=r.n(c),i=r(28),u=function(e){var t=e.className,r=e.size,n=a()(e,["className","size"]);return React.createElement(i.SVG,o()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},n),React.createElement("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},s=React.createElement(u,null);t.a=s},18:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},2:function(e,t){!function(){e.exports=this.React}()},20:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},22:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},23:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},235:function(e,t,r){e.exports=r(284)},236:function(e,t){},25:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},28:function(e,t){!function(){e.exports=this.wp.primitives}()},284:function(e,t,r){"use strict";r.r(t);var n=r(141),o=r(119),c=r(9),a=r.n(c),i=r(1),u=r(94),s=r(0),l=r(4),p=r.n(l),f=(r(3),r(11)),b=(r(236),r(150)),d=r(40),m=r(158),v=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(i.sprintf)(Object(i.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(d.formatPrice)(e),Object(d.formatPrice)(t)):Number.isFinite(e)?Object(i.sprintf)(Object(i.__)("From %s","woo-gutenberg-products-block"),Object(d.formatPrice)(e)):Object(i.sprintf)(Object(i.__)("Up to %s","woo-gutenberg-products-block"),Object(d.formatPrice)(t))},y=function(e){var t=e.type,r=e.name,n=e.prefix,o=e.removeCallback,c=void 0===o?function(){}:o,a=e.showLabel,u=void 0===a||a,s=e.displayStyle,l=n?React.createElement(React.Fragment,null,n," ",r):r,p=Object(i.sprintf)(Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),r);return React.createElement("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},u&&React.createElement("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===s?React.createElement(m.a,{element:"span",text:l,onRemove:c,radius:"large",ariaLabel:p}):React.createElement("span",{className:"wc-block-active-filters__list-item-name"},l,React.createElement("button",{className:"wc-block-active-filters__list-item-remove",onClick:c},React.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),React.createElement("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),React.createElement("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),React.createElement(f.Label,{screenReaderLabel:p}))))},g=r(125),_=r(18),O=r(151),h=function(e){var t=e.attributeObject,r=void 0===t?{}:t,n=e.slugs,o=void 0===n?[]:n,c=e.operator,s=void 0===c?"in":c,l=e.displayStyle,p=Object(g.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[r.id]}),f=p.results,b=p.isLoading,d=Object(u.b)("attributes",[]),m=a()(d,2),v=m[0],h=m[1];if(b)return null;var x=r.label;return React.createElement("li",null,React.createElement("span",{className:"wc-block-active-filters__list-item-type"},x,":"),React.createElement("ul",null,o.map((function(e,t){var n=f.find((function(t){return t.slug===e}));if(!n)return null;var o="";return t>0&&"and"===s&&(o=React.createElement("span",{className:"wc-block-active-filters__list-item-operator"},Object(i.__)("and","woo-gutenberg-products-block"))),y({type:x,name:Object(_.decodeEntities)(n.name||e),prefix:o,removeCallback:function(){Object(O.a)(v,h,r,e)},showLabel:!1,displayStyle:l})}))))},x=function(e){var t=e.attributes,r=e.isEditor,n=void 0!==r&&r,o=Object(u.b)("attributes",[]),c=a()(o,2),l=c[0],d=c[1],m=Object(u.b)("min_price"),g=a()(m,2),_=g[0],O=g[1],x=Object(u.b)("max_price"),E=a()(x,2),w=E[0],j=E[1],R=Object(s.useMemo)((function(){return Number.isFinite(_)||Number.isFinite(w)?y({type:Object(i.__)("Price","woo-gutenberg-products-block"),name:v(_,w),removeCallback:function(){O(void 0),j(void 0)},displayStyle:t.displayStyle}):null}),[_,w,t.displayStyle,O,j]),k=Object(s.useMemo)((function(){return l.map((function(e){var r=Object(b.b)(e.attribute);return React.createElement(h,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[l,t.displayStyle]);if(!(l.length>0||Number.isFinite(_)||Number.isFinite(w)||n))return null;var S="h".concat(t.headingLevel),P=p()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return React.createElement(React.Fragment,null,!n&&t.heading&&React.createElement(S,null,t.heading),React.createElement("div",{className:"wc-block-active-filters"},React.createElement("ul",{className:P},n?React.createElement(React.Fragment,null,y({type:Object(i.__)("Size","woo-gutenberg-products-block"),name:Object(i.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),y({type:Object(i.__)("Color","woo-gutenberg-products-block"),name:Object(i.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):React.createElement(React.Fragment,null,R,k)),React.createElement("button",{className:"wc-block-active-filters__clear-all",onClick:function(){O(void 0),j(void 0),d([])}},React.createElement(f.Label,{label:Object(i.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(i.__)("Clear All Filters","woo-gutenberg-products-block")}))))};Object(o.a)({selector:".wp-block-woocommerce-active-filters",Block:Object(n.a)(x),getProps:function(e){return{attributes:{displayStyle:e.dataset.displayStyle,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3}}}})},3:function(e,t,r){e.exports=r(73)()},32:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},33:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},34:function(e,t,r){var n=r(64);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},35:function(e,t,r){var n=r(20).default,o=r(23);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},4:function(e,t,r){var n;
2
  /*!
3
  Copyright (c) 2017 Jed Watson.
4
  Licensed under the MIT License (MIT), see
5
  http://jedwatson.github.io/classnames
6
+ */!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var c=typeof n;if("string"===c||"number"===c)e.push(n);else if(Array.isArray(n)&&n.length){var a=o.apply(null,n);a&&e.push(a)}else if("object"===c)for(var i in n)r.call(n,i)&&n[i]&&e.push(i)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},40:function(e,t){!function(){e.exports=this.wc.priceFormat}()},41: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),a=r.n(c),i=r(23),u=r.n(i),s=r(34),l=r.n(s),p=r(35),f=r.n(p),b=r(25),d=r.n(b),m=r(7),v=r.n(m),y=(r(3),r(2)),g=r(1),_=r(13),O=function(e){var t=e.imageUrl,r=void 0===t?"".concat(_.i,"img/block-error.svg"):t,n=e.header,o=void 0===n?Object(g.__)("Oops!","woo-gutenberg-products-block"):n,c=e.text,a=void 0===c?Object(g.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,i=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(g.__)("Error:","woo-gutenberg-products-block"):u;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},r&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:r,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),a&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},a),i&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",i)))};r(75);function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f()(this,r)}}var x=function(e){l()(r,e);var t=h(r);function r(){var e;o()(this,r);for(var n=arguments.length,c=new Array(n),a=0;a<n;a++)c[a]=arguments[a];return e=t.call.apply(t,[this].concat(c)),v()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(r,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,a=e.renderError,i=this.state,u=i.errorMessage;return i.hasError?"function"==typeof a?a({errorMessage:u}):React.createElement(O,{errorMessage:n?u:null,header:t,imageUrl:r,text:o,errorMessagePrefix:c}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),r}(y.Component);x.defaultProps={showErrorMessage:!0};t.a=x},5:function(e,t){!function(){e.exports=this.wc.wcSettings}()},54:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=r(22),c=r.n(o);function a(e){var t=Object(n.useRef)();return void 0!==t.current&&c()(e,t.current)||(t.current=e),t.current}},61:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),o=Object(n.createContext)("page"),c=function(){return Object(n.useContext)(o)};o.Provider},64:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},67:function(e,t,r){var n=r(68);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},68:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},7:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},71: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},73:function(e,t,r){"use strict";var n=r(74);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,c,a){if(a!==n){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return r.PropTypes=r,r}},74:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},75: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){var r=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=r){var n,o,c=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},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){var n=r(83),o=r(84),c=r(67),a=r(85);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},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 m}));var n=r(9),o=r.n(n),c=r(15),a=r(12),i=r(0),u=r(22),s=r.n(u),l=r(54),p=r(107),f=r(61),b=function(e){var t=Object(f.a)();e=e||t;var r=Object(a.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(a.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(i.useCallback)((function(t){n(e,t)}),[e,n])]},d=function(e,t,r){var n=Object(f.a)();r=r||n;var o=Object(a.useSelect)((function(n){return n(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),u=Object(a.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(i.useCallback)((function(t){u(r,e,t)}),[r,e,u])]},m=function(e,t){var r=Object(f.a)(),n=b(t=t||r),c=o()(n,2),a=c[0],u=c[1],d=Object(l.a)(a),m=Object(l.a)(e),v=Object(p.a)(m),y=Object(i.useRef)(!1);return Object(i.useEffect)((function(){s()(v,m)||(u(Object.assign({},d,m)),y.current=!0)}),[d,m,v,u]),y.current?[a,u]:[e,u]}},95:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(9),o=r.n(n),c=r(0),a=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}}});
build/active-filters.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-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' => '9906c9393007c7a48c78dc22a3dc519f');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'b27eb572aa297d14d54627bde379198c');
build/active-filters.js CHANGED
@@ -1 +1 @@
1
- this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["active-filters"]=function(e){function t(t){for(var r,i,a=t[0],l=t[1],s=t[2],b=0,f=[];b<a.length;b++)i=a[b],Object.prototype.hasOwnProperty.call(c,i)&&c[i]&&f.push(c[i][0]),c[i]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(u&&u(t);f.length;)f.shift()();return o.push.apply(o,s||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,a=1;a<n.length;a++){var l=n[a];0!==c[l]&&(r=!1)}r&&(o.splice(t--,1),e=i(i.s=n[0]))}return e}var r={},c={5:0},o=[];function i(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],l=a.push.bind(a);a.push=t,a=a.slice();for(var s=0;s<a.length;s++)t(a[s]);var u=l;return o.push([863,0]),n()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},119:function(e,t){},147:function(e,t,n){"use strict";var r=n(15),c=n.n(r),o=n(16),i=n.n(o),a=n(17),l=n.n(a),s=n(18),u=n.n(s),b=n(9),f=n.n(b),p=n(0),d=n(6),v=n(1),m=n(3);function h(e){var t=e.level,n={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return n.hasOwnProperty(t)?Object(p.createElement)(m.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(m.Path,{d:n[t]})):null}function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f()(e);if(t){var c=f()(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return u()(this,n)}}var j=function(e){l()(n,e);var t=O(n);function n(){return c()(this,n),t.apply(this,arguments)}return i()(n,[{key:"createLevelControl",value:function(e,t,n){var r=e===t;return{icon:Object(p.createElement)(h,{level:e}),title:Object(v.sprintf)(Object(v.__)("Heading %d"),e),isActive:r,onClick:function(){return n(e)}}}},{key:"render",value:function(){var e=this,t=this.props,n=t.isCollapsed,r=void 0===n||n,c=t.minLevel,o=t.maxLevel,i=t.selectedLevel,a=t.onChange;return Object(p.createElement)(m.ToolbarGroup,{isCollapsed:r,icon:Object(p.createElement)(h,{level:i}),controls:Object(d.range)(c,o).map((function(t){return e.createLevelControl(t,i,a)}))})}}]),n}(p.Component);t.a=j},150:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return v}));var r=n(13),c=n.n(r),o=n(36),i=n(21),a=n(0),l=n(33),s=n.n(l),u=n(74),b=n(166),f=n(82),p=function(e){var t=Object(f.a)();e=e||t;var n=Object(i.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(i.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(a.useCallback)((function(t){r(e,t)}),[e,r])]},d=function(e,t,n){var r=Object(f.a)();n=n||r;var c=Object(i.useSelect)((function(r){return r(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),l=Object(i.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(a.useCallback)((function(t){l(n,e,t)}),[n,e,l])]},v=function(e,t){var n=Object(f.a)(),r=p(t=t||n),o=c()(r,2),i=o[0],l=o[1],d=Object(u.a)(i),v=Object(u.a)(e),m=Object(b.a)(v),h=Object(a.useRef)(!1);return Object(a.useEffect)((function(){s()(m,v)||(l(Object.assign({},d,v)),h.current=!0)}),[d,v,m,l]),h.current?[i,l]:[e,l]}},151:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(13),c=n.n(r),o=n(0),i=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},166:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(8);function c(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},183:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(22)),o=n(7),i=n.n(o);n(249);t.a=function(e){var t=e.className,n=e.headingLevel,o=e.onChange,a=e.heading,l="h".concat(n);return Object(r.createElement)(l,null,Object(r.createElement)(c.PlainText,{className:i()("wc-block-editor-components-title",t),value:a,onChange:o}))}},198:function(e,t){},200:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(36),c=n(21),o=n(0),i=n(74),a=n(151),l=function(e){var t=e.namespace,n=e.resourceName,l=e.resourceValues,s=void 0===l?[]:l,u=e.query,b=void 0===u?{}:u,f=e.shouldSelect,p=void 0===f||f;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(o.useRef)({results:[],isLoading:!0}),v=Object(i.a)(b),m=Object(i.a)(s),h=Object(a.a)(),O=Object(c.useSelect)((function(e){if(!p)return null;var c=e(r.COLLECTIONS_STORE_KEY),o=[t,n,v,m],i=c.getCollectionError.apply(c,o);return i&&h(i),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,n,m,v,p]);return null!==O&&(d.current=O),d.current}},21:function(e,t){!function(){e.exports=this.wp.data}()},22:function(e,t){!function(){e.exports=this.wp.blockEditor}()},249:function(e,t){},25:function(e,t){!function(){e.exports=this.wp.blocks}()},255:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a}));var r=n(5),c=Object(r.getSetting)("attributes",[]),o=c.reduce((function(e,t){var n,r=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;return r.id&&e.push(r),e}),[]),i=function(e){if(e)return o.find((function(t){return t.id===e}))},a=function(e){if(e)return o.find((function(t){return t.taxonomy===e}))}},256:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return o}));var r=n(6),c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=e.filter((function(e){return e.attribute===n.taxonomy})),i=o.length?o[0]:null;if(i&&i.slug&&Array.isArray(i.slug)&&i.slug.includes(c)){var a=i.slug.filter((function(e){return e!==c})),l=e.filter((function(e){return e.attribute!==n.taxonomy}));a.length>0&&(i.slug=a.sort(),l.push(i)),t(Object(r.sortBy)(l,"attribute"))}},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",i=e.filter((function(e){return e.attribute!==n.taxonomy}));0===c.length?t(i):(i.push({attribute:n.taxonomy,operator:o,slug:Object(r.map)(c,"slug").sort()}),t(Object(r.sortBy)(i,"attribute")))}},26:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},264:function(e,t,n){"use strict";var r=n(10),c=n.n(r),o=n(23),i=n.n(o),a=n(0),l=(n(2),n(7)),s=n.n(l),u=n(1),b=n(57),f=n(355),p=(n(198),function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,o=e.element,l=void 0===o?"li":o,u=e.className,b=void 0===u?"":u,f=e.radius,p=void 0===f?"small":f,d=e.children,v=void 0===d?null:d,m=i()(e,["text","screenReaderText","element","className","radius","children"]),h=l,O=s()(b,"wc-block-components-chip","wc-block-components-chip--radius-"+p),j=Boolean(r&&r!==t);return Object(a.createElement)(h,c()({className:O},m),Object(a.createElement)("span",{"aria-hidden":j,className:"wc-block-components-chip__text"},t),j&&Object(a.createElement)("span",{className:"screen-reader-text"},r),v)});t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,o=void 0===r?"":r,l=e.disabled,d=void 0!==l&&l,v=e.onRemove,m=void 0===v?function(){}:v,h=e.removeOnAnyClick,O=void 0!==h&&h,j=e.text,g=e.screenReaderText,y=void 0===g?"":g,w=i()(e,["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"]),_=O?"span":"button";if(!n){var E=y&&"string"==typeof y?y:j;n="string"!=typeof E?Object(u.__)("Remove","woo-gutenberg-products-block"):Object(u.sprintf)(Object(u.__)('Remove "%s"',"woo-gutenberg-products-block"),E)}var k={"aria-label":n,disabled:d,onClick:m,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||m()}},x=O?k:{},S=O?{"aria-hidden":!0}:k;return Object(a.createElement)(p,c()({},w,x,{className:s()(o,"is-removable"),element:O?"button":w.element,screenReaderText:y,text:j}),Object(a.createElement)(_,c()({className:"wc-block-components-chip__remove"},S),Object(a.createElement)(b.a,{className:"wc-block-components-chip__remove-icon",srcElement:f.a,size:16})))}},3:function(e,t){!function(){e.exports=this.wp.components}()},31:function(e,t){!function(){e.exports=this.wp.primitives}()},33:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},355:function(e,t,n){"use strict";var r=n(10),c=n.n(r),o=n(23),i=n.n(o),a=n(0),l=n(31),s=Object(a.createElement)((function(e){var t=e.className,n=e.size,r=i()(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=s},36:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},41:function(e,t,n){"use strict";var r=n(4),c=n.n(r),o=n(0),i=n(7),a=n.n(i);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,c=e.wrapperElement,i=e.wrapperProps,l=void 0===i?{}:i,u=null!=n,b=null!=r;return!u&&b?(t=c||"span",l=s(s({},l),{},{className:a()(l.className,"screen-reader-text")}),Object(o.createElement)(t,l,r)):(t=c||o.Fragment,u&&b&&n!==r?Object(o.createElement)(t,l,Object(o.createElement)("span",{"aria-hidden":"true"},n),Object(o.createElement)("span",{className:"screen-reader-text"},r)):Object(o.createElement)(t,l,n))}},5:function(e,t){!function(){e.exports=this.wc.wcSettings}()},57:function(e,t,n){"use strict";var r=n(4),c=n.n(r),o=n(23),i=n.n(o),a=n(0);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,o=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?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},o)):null}},58:function(e,t){!function(){e.exports=this.wc.priceFormat}()},6:function(e,t){!function(){e.exports=this.lodash}()},71:function(e,t,n){"use strict";var r=n(10),c=n.n(r),o=n(15),i=n.n(o),a=n(16),l=n.n(a),s=n(11),u=n.n(s),b=n(17),f=n.n(b),p=n(18),d=n.n(p),v=n(9),m=n.n(v),h=n(0),O=n(6),j=n(7),g=n.n(j),y=n(3),w=n(188);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 d()(this,n)}}var E=function(e){f()(n,e);var t=_(n);function n(){var e;return i()(this,n),(e=t.apply(this,arguments)).onClick=e.onClick.bind(u()(e)),e}return l()(n,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.label,o=n.checked,i=n.instanceId,a=n.className,l=n.help,s=n.options,u=n.value,b="inspector-toggle-button-control-".concat(i);return l&&(e=Object(O.isFunction)(l)?l(o):l),Object(h.createElement)(y.BaseControl,{id:b,help:e,className:g()("components-toggle-button-control",a)},Object(h.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},r),Object(h.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},s.map((function(e,n){var o={};return u===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(h.createElement)(y.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(n),value:e.value,onClick:t.onClick,"aria-label":r+": "+e.label},o),e.label)}))))}}]),n}(h.Component);t.a=Object(w.a)(E)},74:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),c=n(33),o=n.n(c);function i(e){var t=Object(r.useRef)();return void 0!==t.current&&o()(e,t.current)||(t.current=e),t.current}},8:function(e,t){!function(){e.exports=this.React}()},82:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=Object(r.createContext)("page"),o=function(){return Object(r.useContext)(c)};c.Provider},863:function(e,t,n){e.exports=n(903)},864:function(e,t){},903:function(e,t,n){"use strict";n.r(t);var r=n(10),c=n.n(r),o=n(0),i=n(1),a=n(25),l=n(57),s=n(31),u=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zm0-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})),b=n(7),f=n.n(b),p=n(22),d=n(3),v=n(147),m=n(183),h=n(71),O=n(13),j=n.n(O),g=n(150),y=(n(2),n(41)),w=(n(864),n(255)),_=n(58),E=n(264),k=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(i.sprintf)(Object(i.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(_.formatPrice)(e),Object(_.formatPrice)(t)):Number.isFinite(e)?Object(i.sprintf)(Object(i.__)("From %s","woo-gutenberg-products-block"),Object(_.formatPrice)(e)):Object(i.sprintf)(Object(i.__)("Up to %s","woo-gutenberg-products-block"),Object(_.formatPrice)(t))},x=function(e){var t=e.type,n=e.name,r=e.prefix,c=e.removeCallback,a=void 0===c?function(){}:c,l=e.showLabel,s=void 0===l||l,u=e.displayStyle,b=r?Object(o.createElement)(o.Fragment,null,r," ",n):n,f=Object(i.sprintf)(Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),n);return Object(o.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+n},s&&Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===u?Object(o.createElement)(E.a,{element:"span",text:b,onRemove:a,radius:"large",ariaLabel:f}):Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-name"},b,Object(o.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:a},Object(o.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),Object(o.createElement)("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),Object(o.createElement)("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),Object(o.createElement)(y.a,{screenReaderLabel:f}))))},S=n(200),C=n(26),N=n(256),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,s=e.displayStyle,u=Object(S.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[n.id]}),b=u.results,f=u.isLoading,p=Object(g.b)("attributes",[]),d=j()(p,2),v=d[0],m=d[1];if(f)return null;var h=n.label;return Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},h,":"),Object(o.createElement)("ul",null,c.map((function(e,t){var r=b.find((function(t){return t.slug===e}));if(!r)return null;var c="";return t>0&&"and"===l&&(c=Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(i.__)("and","woo-gutenberg-products-block"))),x({type:h,name:Object(C.decodeEntities)(r.name||e),prefix:c,removeCallback:function(){Object(N.a)(v,m,n,e)},showLabel:!1,displayStyle:s})}))))},R=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,c=Object(g.b)("attributes",[]),a=j()(c,2),l=a[0],s=a[1],u=Object(g.b)("min_price"),b=j()(u,2),p=b[0],d=b[1],v=Object(g.b)("max_price"),m=j()(v,2),h=m[0],O=m[1],_=Object(o.useMemo)((function(){return Number.isFinite(p)||Number.isFinite(h)?x({type:Object(i.__)("Price","woo-gutenberg-products-block"),name:k(p,h),removeCallback:function(){d(void 0),O(void 0)},displayStyle:t.displayStyle}):null}),[p,h,t.displayStyle,d,O]),E=Object(o.useMemo)((function(){return l.map((function(e){var n=Object(w.b)(e.attribute);return Object(o.createElement)(P,{attributeObject:n,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[l,t.displayStyle]);if(!(l.length>0||Number.isFinite(p)||Number.isFinite(h)||r))return null;var S="h".concat(t.headingLevel),C=f()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(S,null,t.heading),Object(o.createElement)("div",{className:"wc-block-active-filters"},Object(o.createElement)("ul",{className:C},r?Object(o.createElement)(o.Fragment,null,x({type:Object(i.__)("Size","woo-gutenberg-products-block"),name:Object(i.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),x({type:Object(i.__)("Color","woo-gutenberg-products-block"),name:Object(i.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):Object(o.createElement)(o.Fragment,null,_,E)),Object(o.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:function(){d(void 0),O(void 0),s([])}},Object(o.createElement)(y.a,{label:Object(i.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(i.__)("Clear All Filters","woo-gutenberg-products-block")}))))},L=Object(d.withSpokenMessages)((function(e){var t=e.attributes,n=e.setAttributes,r=t.className,c=t.displayStyle,a=t.heading,l=t.headingLevel;return Object(o.createElement)("div",{className:r},Object(o.createElement)(p.InspectorControls,{key:"inspector"},Object(o.createElement)(d.PanelBody,{title:Object(i.__)("Block Settings","woo-gutenberg-products-block")},Object(o.createElement)(h.a,{label:Object(i.__)("Display Style","woo-gutenberg-products-block"),value:c,options:[{label:Object(i.__)("List","woo-gutenberg-products-block"),value:"list"},{label:Object(i.__)("Chips","woo-gutenberg-products-block"),value:"chips"}],onChange:function(e){return n({displayStyle:e})}}),Object(o.createElement)("p",null,Object(i.__)("Heading Level","woo-gutenberg-products-block")),Object(o.createElement)(v.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:l,onChange:function(e){return n({headingLevel:e})}}))),Object(o.createElement)(m.a,{headingLevel:l,heading:a,onChange:function(e){return n({heading:e})}}),Object(o.createElement)(d.Disabled,null,Object(o.createElement)(R,{attributes:t,isEditor:!0})))}));Object(a.registerBlockType)("woocommerce/active-filters",{title:Object(i.__)("Active Product Filters","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(l.a,{srcElement:u}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(i.__)("Show the currently active product filters. Works in combination with the All Products and filters blocks.","woo-gutenberg-products-block"),supports:{html:!1,multiple:!1},example:{attributes:{}},attributes:{displayStyle:{type:"string",default:"list"},heading:{type:"string",default:Object(i.__)("Active filters","woo-gutenberg-products-block")},headingLevel:{type:"number",default:3}},edit: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(o.createElement)("div",c()({className:f()("is-loading",n)},r),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-product-filters__placeholder"}))}})}});
1
+ this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["active-filters"]=function(e){function t(t){for(var r,i,a=t[0],l=t[1],u=t[2],b=0,f=[];b<a.length;b++)i=a[b],Object.prototype.hasOwnProperty.call(c,i)&&c[i]&&f.push(c[i][0]),c[i]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(s&&s(t);f.length;)f.shift()();return o.push.apply(o,u||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,a=1;a<n.length;a++){var l=n[a];0!==c[l]&&(r=!1)}r&&(o.splice(t--,1),e=i(i.s=n[0]))}return e}var r={},c={5:0},o=[];function i(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],l=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var s=l;return o.push([733,0]),n()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},104:function(e,t){},129:function(e,t,n){"use strict";var r=n(15),c=n.n(r),o=n(16),i=n.n(o),a=n(17),l=n.n(a),u=n(18),s=n.n(u),b=n(9),f=n.n(b),p=n(0),d=n(6),v=n(1),m=n(3);function h(e){var t=e.level,n={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return n.hasOwnProperty(t)?Object(p.createElement)(m.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(p.createElement)(m.Path,{d:n[t]})):null}function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f()(e);if(t){var c=f()(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return s()(this,n)}}var g=function(e){l()(n,e);var t=O(n);function n(){return c()(this,n),t.apply(this,arguments)}return i()(n,[{key:"createLevelControl",value:function(e,t,n){var r=e===t;return{icon:Object(p.createElement)(h,{level:e}),title:Object(v.sprintf)(Object(v.__)("Heading %d"),e),isActive:r,onClick:function(){return n(e)}}}},{key:"render",value:function(){var e=this,t=this.props,n=t.isCollapsed,r=void 0===n||n,c=t.minLevel,o=t.maxLevel,i=t.selectedLevel,a=t.onChange;return Object(p.createElement)(m.ToolbarGroup,{isCollapsed:r,icon:Object(p.createElement)(h,{level:i}),controls:Object(d.range)(c,o).map((function(t){return e.createLevelControl(t,i,a)}))})}}]),n}(p.Component);t.a=g},132:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return v}));var r=n(13),c=n.n(r),o=n(40),i=n(23),a=n(0),l=n(37),u=n.n(l),s=n(76),b=n(149),f=n(83),p=function(e){var t=Object(f.a)();e=e||t;var n=Object(i.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(i.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(a.useCallback)((function(t){r(e,t)}),[e,r])]},d=function(e,t,n){var r=Object(f.a)();n=n||r;var c=Object(i.useSelect)((function(r){return r(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),l=Object(i.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(a.useCallback)((function(t){l(n,e,t)}),[n,e,l])]},v=function(e,t){var n=Object(f.a)(),r=p(t=t||n),o=c()(r,2),i=o[0],l=o[1],d=Object(s.a)(i),v=Object(s.a)(e),m=Object(b.a)(v),h=Object(a.useRef)(!1);return Object(a.useEffect)((function(){u()(m,v)||(l(Object.assign({},d,v)),h.current=!0)}),[d,v,m,l]),h.current?[i,l]:[e,l]}},133:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(13),c=n.n(r),o=n(0),i=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},149:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(8);function c(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},168:function(e,t,n){"use strict";var r=n(0),c=(n(2),n(24)),o=n(7),i=n.n(o);n(225);t.a=function(e){var t=e.className,n=e.headingLevel,o=e.onChange,a=e.heading,l="h".concat(n);return Object(r.createElement)(l,null,Object(r.createElement)(c.PlainText,{className:i()("wc-block-editor-components-title",t),value:a,onChange:o}))}},181:function(e,t){},184:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(40),c=n(23),o=n(0),i=n(76),a=n(133),l=function(e){var t=e.namespace,n=e.resourceName,l=e.resourceValues,u=void 0===l?[]:l,s=e.query,b=void 0===s?{}:s,f=e.shouldSelect,p=void 0===f||f;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var d=Object(o.useRef)({results:[],isLoading:!0}),v=Object(i.a)(b),m=Object(i.a)(u),h=Object(a.a)(),O=Object(c.useSelect)((function(e){if(!p)return null;var c=e(r.COLLECTIONS_STORE_KEY),o=[t,n,v,m],i=c.getCollectionError.apply(c,o);return i&&h(i),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,n,m,v,p]);return null!==O&&(d.current=O),d.current}},22:function(e,t){!function(){e.exports=this.wp.compose}()},225:function(e,t){},23:function(e,t){!function(){e.exports=this.wp.data}()},231:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a}));var r=n(5),c=Object(r.getSetting)("attributes",[]),o=c.reduce((function(e,t){var n,r=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;return r.id&&e.push(r),e}),[]),i=function(e){if(e)return o.find((function(t){return t.id===e}))},a=function(e){if(e)return o.find((function(t){return t.taxonomy===e}))}},232:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return o}));var r=n(6),c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=e.filter((function(e){return e.attribute===n.taxonomy})),i=o.length?o[0]:null;if(i&&i.slug&&Array.isArray(i.slug)&&i.slug.includes(c)){var a=i.slug.filter((function(e){return e!==c})),l=e.filter((function(e){return e.attribute!==n.taxonomy}));a.length>0&&(i.slug=a.sort(),l.push(i)),t(Object(r.sortBy)(l,"attribute"))}},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in",i=e.filter((function(e){return e.attribute!==n.taxonomy}));0===c.length?t(i):(i.push({attribute:n.taxonomy,operator:o,slug:c.map((function(e){return e.slug})).sort()}),t(Object(r.sortBy)(i,"attribute")))}},239:function(e,t,n){"use strict";var r=n(11),c=n.n(r),o=n(20),i=n.n(o),a=n(0),l=(n(2),n(7)),u=n.n(l),s=n(1),b=n(58),f=n(311),p=(n(181),function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,o=e.element,l=void 0===o?"li":o,s=e.className,b=void 0===s?"":s,f=e.radius,p=void 0===f?"small":f,d=e.children,v=void 0===d?null:d,m=i()(e,["text","screenReaderText","element","className","radius","children"]),h=l,O=u()(b,"wc-block-components-chip","wc-block-components-chip--radius-"+p),g=Boolean(r&&r!==t);return Object(a.createElement)(h,c()({className:O},m),Object(a.createElement)("span",{"aria-hidden":g,className:"wc-block-components-chip__text"},t),g&&Object(a.createElement)("span",{className:"screen-reader-text"},r),v)});t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,o=void 0===r?"":r,l=e.disabled,d=void 0!==l&&l,v=e.onRemove,m=void 0===v?function(){}:v,h=e.removeOnAnyClick,O=void 0!==h&&h,g=e.text,j=e.screenReaderText,y=void 0===j?"":j,w=i()(e,["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"]),_=O?"span":"button";if(!n){var E=y&&"string"==typeof y?y:g;n="string"!=typeof E?Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),E)}var k={"aria-label":n,disabled:d,onClick:m,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||m()}},x=O?k:{},S=O?{"aria-hidden":!0}:k;return Object(a.createElement)(p,c()({},w,x,{className:u()(o,"is-removable"),element:O?"button":w.element,screenReaderText:y,text:g}),Object(a.createElement)(_,c()({className:"wc-block-components-chip__remove"},S),Object(a.createElement)(b.a,{className:"wc-block-components-chip__remove-icon",srcElement:f.a,size:16})))}},24:function(e,t){!function(){e.exports=this.wp.blockEditor}()},26:function(e,t){!function(){e.exports=this.wp.blocks}()},27:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},29:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},3:function(e,t){!function(){e.exports=this.wp.components}()},311:function(e,t,n){"use strict";var r=n(11),c=n.n(r),o=n(20),i=n.n(o),a=n(0),l=n(33),u=Object(a.createElement)((function(e){var t=e.className,n=e.size,r=i()(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},33:function(e,t){!function(){e.exports=this.wp.primitives}()},37:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},40:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},5:function(e,t){!function(){e.exports=this.wc.wcSettings}()},58:function(e,t,n){"use strict";var r=n(4),c=n.n(r),o=n(20),i=n.n(o),a=n(0);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,o=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?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},o)):null}},59:function(e,t){!function(){e.exports=this.wc.priceFormat}()},6:function(e,t){!function(){e.exports=this.lodash}()},733:function(e,t,n){e.exports=n(774)},734:function(e,t){},74:function(e,t,n){"use strict";var r=n(11),c=n.n(r),o=n(15),i=n.n(o),a=n(16),l=n.n(a),u=n(12),s=n.n(u),b=n(17),f=n.n(b),p=n(18),d=n.n(p),v=n(9),m=n.n(v),h=n(0),O=n(6),g=n(7),j=n.n(g),y=n(3),w=n(22);n(104);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m()(e);if(t){var c=m()(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return d()(this,n)}}var E=function(e){f()(n,e);var t=_(n);function n(){var e;return i()(this,n),(e=t.apply(this,arguments)).onClick=e.onClick.bind(s()(e)),e}return l()(n,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.label,o=n.checked,i=n.instanceId,a=n.className,l=n.help,u=n.options,s=n.value,b="inspector-toggle-button-control-".concat(i);return l&&(e=Object(O.isFunction)(l)?l(o):l),Object(h.createElement)(y.BaseControl,{id:b,help:e,className:j()("components-toggle-button-control",a)},Object(h.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},r),Object(h.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},u.map((function(e,n){var o={};return s===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(h.createElement)(y.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(n),value:e.value,onClick:t.onClick,"aria-label":r+": "+e.label},o),e.label)}))))}}]),n}(h.Component);t.a=Object(w.withInstanceId)(E)},76:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),c=n(37),o=n.n(c);function i(e){var t=Object(r.useRef)();return void 0!==t.current&&o()(e,t.current)||(t.current=e),t.current}},774:function(e,t,n){"use strict";n.r(t);var r=n(11),c=n.n(r),o=n(0),i=n(1),a=n(26),l=n(58),u=n(33),s=Object(o.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zm0-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})),b=n(7),f=n.n(b),p=n(24),d=n(3),v=n(129),m=n(168),h=n(74),O=n(13),g=n.n(O),j=n(132),y=(n(2),n(27)),w=(n(734),n(231)),_=n(59),E=n(239),k=function(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Object(i.sprintf)(Object(i.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(_.formatPrice)(e),Object(_.formatPrice)(t)):Number.isFinite(e)?Object(i.sprintf)(Object(i.__)("From %s","woo-gutenberg-products-block"),Object(_.formatPrice)(e)):Object(i.sprintf)(Object(i.__)("Up to %s","woo-gutenberg-products-block"),Object(_.formatPrice)(t))},x=function(e){var t=e.type,n=e.name,r=e.prefix,c=e.removeCallback,a=void 0===c?function(){}:c,l=e.showLabel,u=void 0===l||l,s=e.displayStyle,b=r?Object(o.createElement)(o.Fragment,null,r," ",n):n,f=Object(i.sprintf)(Object(i.__)("Remove %s filter","woo-gutenberg-products-block"),n);return Object(o.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+n},u&&Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===s?Object(o.createElement)(E.a,{element:"span",text:b,onRemove:a,radius:"large",ariaLabel:f}):Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-name"},b,Object(o.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:a},Object(o.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),Object(o.createElement)("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),Object(o.createElement)("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),Object(o.createElement)(y.Label,{screenReaderLabel:f}))))},S=n(184),C=n(29),N=n(232),R=function(e){var t=e.attributeObject,n=void 0===t?{}:t,r=e.slugs,c=void 0===r?[]:r,a=e.operator,l=void 0===a?"in":a,u=e.displayStyle,s=Object(S.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[n.id]}),b=s.results,f=s.isLoading,p=Object(j.b)("attributes",[]),d=g()(p,2),v=d[0],m=d[1];if(f)return null;var h=n.label;return Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},h,":"),Object(o.createElement)("ul",null,c.map((function(e,t){var r=b.find((function(t){return t.slug===e}));if(!r)return null;var c="";return t>0&&"and"===l&&(c=Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(i.__)("and","woo-gutenberg-products-block"))),x({type:h,name:Object(C.decodeEntities)(r.name||e),prefix:c,removeCallback:function(){Object(N.a)(v,m,n,e)},showLabel:!1,displayStyle:u})}))))},L=function(e){var t=e.attributes,n=e.isEditor,r=void 0!==n&&n,c=Object(j.b)("attributes",[]),a=g()(c,2),l=a[0],u=a[1],s=Object(j.b)("min_price"),b=g()(s,2),p=b[0],d=b[1],v=Object(j.b)("max_price"),m=g()(v,2),h=m[0],O=m[1],_=Object(o.useMemo)((function(){return Number.isFinite(p)||Number.isFinite(h)?x({type:Object(i.__)("Price","woo-gutenberg-products-block"),name:k(p,h),removeCallback:function(){d(void 0),O(void 0)},displayStyle:t.displayStyle}):null}),[p,h,t.displayStyle,d,O]),E=Object(o.useMemo)((function(){return l.map((function(e){var n=Object(w.b)(e.attribute);return Object(o.createElement)(R,{attributeObject:n,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}))}),[l,t.displayStyle]);if(!(l.length>0||Number.isFinite(p)||Number.isFinite(h)||r))return null;var S="h".concat(t.headingLevel),C=f()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(S,null,t.heading),Object(o.createElement)("div",{className:"wc-block-active-filters"},Object(o.createElement)("ul",{className:C},r?Object(o.createElement)(o.Fragment,null,x({type:Object(i.__)("Size","woo-gutenberg-products-block"),name:Object(i.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),x({type:Object(i.__)("Color","woo-gutenberg-products-block"),name:Object(i.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):Object(o.createElement)(o.Fragment,null,_,E)),Object(o.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:function(){d(void 0),O(void 0),u([])}},Object(o.createElement)(y.Label,{label:Object(i.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(i.__)("Clear All Filters","woo-gutenberg-products-block")}))))},P=Object(d.withSpokenMessages)((function(e){var t=e.attributes,n=e.setAttributes,r=t.className,c=t.displayStyle,a=t.heading,l=t.headingLevel;return Object(o.createElement)("div",{className:r},Object(o.createElement)(p.InspectorControls,{key:"inspector"},Object(o.createElement)(d.PanelBody,{title:Object(i.__)("Block Settings","woo-gutenberg-products-block")},Object(o.createElement)(h.a,{label:Object(i.__)("Display Style","woo-gutenberg-products-block"),value:c,options:[{label:Object(i.__)("List","woo-gutenberg-products-block"),value:"list"},{label:Object(i.__)("Chips","woo-gutenberg-products-block"),value:"chips"}],onChange:function(e){return n({displayStyle:e})}}),Object(o.createElement)("p",null,Object(i.__)("Heading Level","woo-gutenberg-products-block")),Object(o.createElement)(v.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:l,onChange:function(e){return n({headingLevel:e})}}))),Object(o.createElement)(m.a,{headingLevel:l,heading:a,onChange:function(e){return n({heading:e})}}),Object(o.createElement)(d.Disabled,null,Object(o.createElement)(L,{attributes:t,isEditor:!0})))}));Object(a.registerBlockType)("woocommerce/active-filters",{title:Object(i.__)("Active Product Filters","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(l.a,{srcElement:s}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(i.__)("Show the currently active product filters. Works in combination with the All Products and filters blocks.","woo-gutenberg-products-block"),supports:{html:!1,multiple:!1},example:{attributes:{}},attributes:{displayStyle:{type:"string",default:"list"},heading:{type:"string",default:Object(i.__)("Active filters","woo-gutenberg-products-block")},headingLevel:{type:"number",default:3}},edit:P,save:function(e){var t=e.attributes,n=t.className,r={"data-display-style":t.displayStyle,"data-heading":t.heading,"data-heading-level":t.headingLevel};return Object(o.createElement)("div",c()({className:f()("is-loading",n)},r),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-product-filters__placeholder"}))}})},8:function(e,t){!function(){e.exports=this.React}()},83:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=Object(r.createContext)("page"),o=function(){return Object(r.useContext)(c)};c.Provider}});
build/all-products-frontend.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-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-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-warning', 'wp-wordcount'), 'version' => 'b0fea12a63d718b10383aee3a4d0fb05');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', '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-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'a98865381c8cd33a99fd706242c964ea');
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=226)}([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,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){!function(){e.exports=this.wc.wcSettings}()},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){var r=n(86),o=n(87),c=n(69),i=n(88);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";n.d(t,"k",(function(){return c})),n.d(t,"i",(function(){return i})),n.d(t,"j",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return f})),n.d(t,"d",(function(){return p})),n.d(t,"h",(function(){return d})),n.d(t,"g",(function(){return b})),n.d(t,"a",(function(){return m})),n.d(t,"c",(function(){return h})),n.d(t,"l",(function(){return v}));var r,o=n(5),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"assets/",a=c.pluginUrl+"build/",u=c.buildPhase,s=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),f=o.STORE_PAGES.privacy.permalink,p=o.STORE_PAGES.privacy.title,d=o.STORE_PAGES.terms.permalink,b=o.STORE_PAGES.terms.title,m=(o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),h=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),v=(n(41),function(){return u>1})},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},function(e,t,n){var r=n(72);e.exports=function(e,t){if(null==e)return{};var n,o,c=r(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(66);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,o,c=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return c}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(23);function o(e,t){if(null==e)return{};var n,o,c=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c}},function(e,t){!function(){e.exports=this.wp.htmlEntities}()},function(e,t,n){"use strict";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){!function(){e.exports=this.wp.isShallowEqual}()},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},,function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},,function(e,t){!function(){e.exports=this.wp.primitives}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(58);var o=n(66);function c(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},,function(e,t,n){"use strict";var r=n(7),o=n.n(r),c=n(0),i=n(4),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){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(65);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(22);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wp.a11y}()},function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return j}));var r=n(9),o=n.n(r),c=n(7),i=n.n(c),a=n(8),u=n(0),s=n(14),l=n(11),f=n(18),p=n(97),d=n(100),b=n(46);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},g=h(h({},v),{},{email:"",phone:""}),y=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=o()(e,2),n=t[0],r=t[1];return[n,Object(f.decodeEntities)(r)]})))},O={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:[],currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},cartIsLoading:!0,cartErrors:[],billingAddress:g,shippingAddress:v,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(b.a)(),n=t.isEditor,r=t.previewData,o=(null==r?void 0:r.previewCart)||{},c=e.shouldSelect,i=Object(u.useRef)(),f=Object(l.useSelect)((function(e,t){var r=t.dispatch;if(!c)return O;if(n)return{cartCoupons:o.coupons,cartItems:o.items,cartFees:o.fees,cartItemsCount:o.items_count,cartItemsWeight:o.items_weight,cartNeedsPayment:o.needs_payment,cartNeedsShipping:o.needs_shipping,cartItemErrors:[],cartTotals:o.totals,cartIsLoading:!1,cartErrors:[],billingAddress:g,shippingAddress:v,extensions:{},shippingRates:o.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:o.has_calculated_shipping,paymentRequirements:o.paymentRequirements,receiveCart:"function"==typeof(null==o?void 0:o.receiveCart)?o.receiveCart:function(){}};var i=e(s.CART_STORE_KEY),a=i.getCartData(),u=i.getCartErrors(),l=i.getCartTotals(),f=!i.hasFinishedResolution("getCartData"),p=i.isCustomerDataUpdating(),b=r(s.CART_STORE_KEY).receiveCart,m=y(a.billingAddress),h=a.needsShipping?y(a.shippingAddress):m,j=a.fees.map((function(e){return y(e)}));return{cartCoupons:a.coupons,cartItems:a.items||[],cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors||[],cartTotals:l,cartIsLoading:f,cartErrors:u,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(h),extensions:a.extensions||{},shippingRates:a.shippingRates||[],shippingRatesLoading:p,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements||[],receiveCart:b}}),[c]);return i.current&&Object(a.isEqual)(i.current,f)||(i.current=f),i.current}},,function(e,t){!function(){e.exports=this.wc.priceFormat}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.dom}()},,function(e,t,n){"use strict";var r=n(32),o=n.n(r),c=n(33),i=n.n(c),a=n(22),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(12),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.i,"img/block-error.svg"):t,r=e.header,o=void 0===r?Object(g.__)("Oops!","woo-gutenberg-products-block"):r,c=e.text,i=void 0===c?Object(g.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(g.__)("Error:","woo-gutenberg-products-block"):u;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},n&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:n,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),i&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},i),a&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",a)))};n(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,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=(n(11),Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}})),c=function(){return Object(r.useContext)(o)}},,function(e,t,n){"use strict";(function(e){var r=n(0),o=(n(68),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,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(21),c=n.n(o);function i(e){var t=Object(r.useRef)();return void 0!==t.current&&c()(e,t.current)||(t.current=e),t.current}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(7),o=n.n(r),c=n(82),i=n(0),a=n(38);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l=function(){var e=Object(a.a)();return{dispatchStoreEvent:Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(i.useCallback)((function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-checkout-".concat(t),s(s({},n),{},{storeCart:e}))}catch(e){console.error(e)}}),[e])}}},function(e,t){!function(){e.exports=this.wp.deprecated}()},,function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=Object(r.createContext)("page"),c=function(){return Object(r.useContext)(o)};o.Provider},function(e,t){!function(){e.exports=this.wp.keycodes}()},,,function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(58);function o(e,t){if(e){if("string"==typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,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(70);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";var r=n(6),o=n(17),c=n(0),i=n(4),a=n.n(i),u=n(8),s=n(56),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(71);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(42),k=n(62),E=n(67),_={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},x={">=":"min-width","<":"max-width"},P={">=":function(e,t){return t>=e},"<":function(e,t){return t<e}},R=Object(c.createContext)(null),S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:">=",n=Object(c.useContext)(R),r=!n&&"(".concat(x[t],": ").concat(_[e],"px)"),o=Object(E.a)(r);return n?P[t](_[e],n):o};S.__experimentalWidthProvider=R.Provider;var C=S,T=n(171),N=n(132),A=n(19);function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach((function(t){Object(A.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function M(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 L=n(29);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}};function V(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var q=Object(c.createContext)({focusHistory:[]}),z=q.Provider,W=q.Consumer;z.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=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(L.a)(u.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(L.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 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 K=B((function(e){return function(t){m(r,t);var n=G(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 Q(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=B((function(e){return function(t){m(o,t);var n=Q(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(48);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(59),ue=n(21),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(L.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 _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(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 xe(e){var t=e.bubblesVirtually,n=Object(o.a)(e,["bubblesVirtually"]);return t?Object(c.createElement)(Ee,n):Object(c.createElement)(Oe,n)}function Pe(e){return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(ke,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 Se(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=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 Te(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:Ce(Se({type:t},r))})}var Ne=K(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 Me(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,_=e.expandOnMobile,x=e.animate,P=void 0===x||x,R=e.onClickOutside,S=e.onFocusOutside,A=e.__unstableSticky,D=e.__unstableSlotName,L=void 0===D?"Popover":D,B=e.__unstableObserveElement,V=e.__unstableBoundaryParent,q=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"]),z=Object(c.useRef)(null),W=Object(c.useRef)(null),H=Object(c.useRef)(),U=C("medium","<"),G=Object(c.useState)(),K=Object(j.a)(G,2),Q=K[0],Y=K[1],$=ce(L),Z=_&&U,ee=Object(T.a)(),ne=Object(j.a)(ee,2),re=ne[0],oe=ne[1];p=Z||p,Object(c.useLayoutEffect)((function(){if(Z)return Me(H.current,"is-without-arrow",p),Me(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(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)}}(z,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=M(e,t,f,p,r,d.yAxis,i);return F(F({},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&&(Fe(H.current,"top",s+"px"),Fe(H.current,"left",l+"px")),Me(H.current,"is-without-arrow",p||"center"===f&&"middle"===b),Me(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),B&&(n=new window.MutationObserver(e)).observe(B,{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,B,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(S)S(e);else if(R){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"}),R(t)}else n&&n()}},Object(c.createElement)(Te,{type:P&&Q?"appear":null,options:{origin:Q}},(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})},q,{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)(Ge,{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)(Ne,null,ae)),$.ref&&(ae=Object(c.createElement)(Pe,{name:L},ae)),g||O?ae:Object(c.createElement)("span",{ref:z},ae)};Ie.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(c.createElement)(xe,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var Le=Ie;var Be=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 qe=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)(Le,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(c.createElement)(Be,{className:"components-tooltip__shortcut",shortcut:o})))})}}]),n}(c.Component),ze=n(90);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 Ge=t.a=Object(c.forwardRef)((function(e,t){var n=e.href,i=e.target,s=e.isPrimary,f=e.isSmall,p=e.isTertiary,d=e.isPressed,b=e.isBusy,m=e.isDefault,h=e.isSecondary,v=e.isLink,g=e.isDestructive,y=e.className,O=e.disabled,j=e.icon,w=e.iconSize,k=e.showTooltip,E=e.tooltipPosition,_=e.shortcut,x=e.label,P=e.children,R=e.__experimentalIsFocusable,S=Object(o.a)(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);m&&l()("Button isDefault prop",{alternative:"isSecondary"});var C=a()("components-button",y,{"is-secondary":m||h,"is-primary":s,"is-small":f,"is-tertiary":p,"is-pressed":d,"is-busy":b,"is-link":v,"is-destructive":g,"has-text":!!j&&!!P,"has-icon":!!j}),T=O&&!R,N=void 0===n||T?"button":"a",A="a"===N?{href:n,target:i}:{type:"button",disabled:T,"aria-pressed":d};if(O&&R){A["aria-disabled"]=!0;var D,F=We(Ue);try{for(F.s();!(D=F.n()).done;){S[D.value]=function(e){e.stopPropagation(),e.preventDefault()}}}catch(e){F.e(e)}finally{F.f()}}var M=!T&&(k&&x||_||!!x&&(!P||Object(u.isArray)(P)&&!P.length)&&!1!==k),I=Object(c.createElement)(N,Object(r.a)({},A,S,{className:C,"aria-label":S["aria-label"]||x,ref:t}),j&&Object(c.createElement)(ze.a,{icon:j,size:w}),P);return M?Object(c.createElement)(qe,{text:x,shortcut:_,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){"use strict";var r=n(7),o=n.n(r),c=n(9),i=n.n(c),a=n(5),u=n(1);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=Object(a.getSetting)("countryLocale",{}),p=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(u.sprintf)(Object(u.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(t.index=parseInt(e.priority,10)),!0===e.hidden&&(t.required=!1),t},d=Object.entries(f).map((function(e){var t=i()(e,2),n=t[0],r=t[1];return[n,Object.entries(r).map((function(e){var t=i()(e,2),n=t[0],r=t[1];return[n,p(r)]})).reduce((function(e,t){var n=i()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})]})).reduce((function(e,t){var n=i()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{});t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=n&&void 0!==d[n]?d[n]:{};return e.map((function(e){var n=a.defaultAddressFields[e]||{},o=r[e]||{},c=t[e]||{};return l(l(l({key:e},n),o),c)})).sort((function(e,t){return e.index-t.index}))}},function(e,t,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){!function(){e.exports=this.wp.hooks}()},function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(10)),c=r(n(72)),i=n(2),a=r(i),u=r(n(123)),s=r(n(22)),l={arr:Array.isArray,obj:function(e){return"[object Object]"===Object.prototype.toString.call(e)},fun:function(e){return"function"==typeof e},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},und:function(e){return void 0===e},nul:function(e){return null===e},set:function(e){return e instanceof Set},map:function(e){return e instanceof Map},equ:function(e,t){if(typeof e!=typeof t)return!1;if(l.str(e)||l.num(e))return e===t;if(l.obj(e)&&l.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;var n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!l.und(n)||e===t}};function f(){var e=i.useState(!1)[1];return i.useCallback((function(){return e((function(e){return!e}))}),[])}function p(e,t){return l.und(e)||l.nul(e)?t:e}function d(e){return l.und(e)?[]:l.arr(e)?e:[e]}function b(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return l.fun(e)?e.apply(void 0,n):e}function m(e){var t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,c(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(l.und(t))return o({to:t},e);var n=Object.keys(e).reduce((function(n,r){var c;return l.und(t[r])?o({},n,((c={})[r]=e[r],c)):n}),{});return o({to:t},n)}var h,v,g=function(){function e(){this.payload=void 0,this.children=[]}var t=e.prototype;return t.getAnimatedValue=function(){return this.getValue()},t.getPayload=function(){return this.payload||this},t.attach=function(){},t.detach=function(){},t.getChildren=function(){return this.children},t.addChild=function(e){0===this.children.length&&this.attach(),this.children.push(e)},t.removeChild=function(e){var t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()},e}(),y=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload=[],t.attach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.addChild(s(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.removeChild(s(t))}))},t}return u(t,e),t}(g),O=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload={},t.attach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&e.addChild(s(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&e.removeChild(s(t))}))},t}u(t,e);var n=t.prototype;return n.getValue=function(e){void 0===e&&(e=!1);var t={};for(var n in this.payload){var r=this.payload[n];(!e||r instanceof g)&&(t[n]=r instanceof g?r[e?"getAnimatedValue":"getValue"]():r)}return t},n.getAnimatedValue=function(){return this.getValue(!0)},t}(g);function j(e,t){h={fn:e,transform:t}}function w(e){v=e}var k,E=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},_=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function x(e){k=e}var P,R=function(){return Date.now()};function S(e){P=e}var C,T,N=function(e){return e.current};function A(e){C=e}var D=Object.freeze({get applyAnimatedValues(){return h},injectApplyAnimatedValues:j,get colorNames(){return v},injectColorNames:w,get requestFrame(){return E},get cancelFrame(){return _},injectFrame:function(e,t){E=e,_=t},get interpolation(){return k},injectStringInterpolator:x,get now(){return R},injectNow:function(e){R=e},get defaultElement(){return P},injectDefaultElement:S,get animatedApi(){return N},injectAnimatedApi:function(e){N=e},get createAnimatedStyle(){return C},injectCreateAnimatedStyle:A,get manualFrameloop(){return T},injectManualFrameloop:function(e){T=e}}),F=function(e){function t(t,n){var r;return(r=e.call(this)||this).update=void 0,r.payload=t.style?o({},t,{style:C(t.style)}):t,r.update=n,r.attach(),r}return u(t,e),t}(O),M=!1,I=new Set,L=function e(){if(!M)return!1;var t=R(),n=I,r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var c;if(r){if(o>=n.length)break;c=n[o++]}else{if((o=n.next()).done)break;c=o.value}for(var i=c,a=!1,u=0;u<i.configs.length;u++){for(var s=i.configs[u],l=void 0,f=void 0,p=0;p<s.animatedValues.length;p++){var d=s.animatedValues[p];if(!d.done){var b=s.fromValues[p],m=s.toValues[p],h=d.lastPosition,v=m instanceof g,y=Array.isArray(s.initialVelocity)?s.initialVelocity[p]:s.initialVelocity;if(v&&(m=m.getValue()),s.immediate)d.setValue(m),d.done=!0;else if("string"!=typeof b&&"string"!=typeof m){if(void 0!==s.duration)h=b+s.easing((t-d.startTime)/s.duration)*(m-b),l=t>=d.startTime+s.duration;else if(s.decay)h=b+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-d.startTime))),(l=Math.abs(d.lastPosition-h)<.1)&&(m=h);else{f=void 0!==d.lastTime?d.lastTime:t,y=void 0!==d.lastVelocity?d.lastVelocity:s.initialVelocity,t>f+64&&(f=t);for(var O=Math.floor(t-f),j=0;j<O;++j){h+=1*(y+=1*((-s.tension*(h-m)+-s.friction*y)/s.mass)/1e3)/1e3}var w=!(!s.clamp||0===s.tension)&&(b<m?h>m:h<m),k=Math.abs(y)<=s.precision,_=0===s.tension||Math.abs(m-h)<=s.precision;l=w||k&&_,d.lastVelocity=y,d.lastTime=t}v&&!s.toValues[p].done&&(l=!1),l?(d.value!==m&&(h=m),d.done=!0):a=!0,d.setValue(h),d.lastPosition=h}else d.setValue(m),d.done=!0}}i.props.onFrame&&(i.values[s.name]=s.interpolation.getValue())}i.props.onFrame&&i.props.onFrame(i.values),a||(I.delete(i),i.stop(!0))}return I.size?T?T():E(e):M=!1,M};function B(e,t,n){if("function"==typeof e)return e;if(Array.isArray(e))return B({range:e,output:t,extrapolate:n});if(k&&"string"==typeof e.output[0])return k(e);var r=e,o=r.output,c=r.range||[0,1],i=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",u=r.easing||function(e){return e};return function(e){var t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,c);return function(e,t,n,r,o,c,i,a,u){var s=u?u(e):e;if(s<t){if("identity"===i)return s;"clamp"===i&&(s=t)}if(s>n){if("identity"===a)return s;"clamp"===a&&(s=n)}if(r===o)return r;if(t===n)return e<=t?r:o;t===-1/0?s=-s:n===1/0?s-=t:s=(s-t)/(n-t);s=c(s),r===-1/0?s=-s:o===1/0?s+=r:s=s*(o-r)+r;return s}(e,c[t],c[t+1],o[t],o[t+1],u,i,a,r.map)}}var V=function(e){function t(n,r,o,c){var i;return(i=e.call(this)||this).calc=void 0,i.payload=n instanceof y&&!(n instanceof t)?n.getPayload():Array.isArray(n)?n:[n],i.calc=B(r,o,c),i}u(t,e);var n=t.prototype;return n.getValue=function(){return this.calc.apply(this,this.payload.map((function(e){return e.getValue()})))},n.updateConfig=function(e,t,n){this.calc=B(e,t,n)},n.interpolate=function(e,n,r){return new t(this,e,n,r)},t}(y);var q=function(e){function t(t){var n;return(n=e.call(this)||this).animatedStyles=new Set,n.value=void 0,n.startPosition=void 0,n.lastPosition=void 0,n.lastVelocity=void 0,n.startTime=void 0,n.lastTime=void 0,n.done=!1,n.setValue=function(e,t){void 0===t&&(t=!0),n.value=e,t&&n.flush()},n.value=t,n.startPosition=t,n.lastPosition=t,n}u(t,e);var n=t.prototype;return n.flush=function(){0===this.animatedStyles.size&&function e(t,n){"update"in t?n.add(t):t.getChildren().forEach((function(t){return e(t,n)}))}(this,this.animatedStyles),this.animatedStyles.forEach((function(e){return e.update()}))},n.clearStyles=function(){this.animatedStyles.clear()},n.getValue=function(){return this.value},n.interpolate=function(e,t,n){return new V(this,e,t,n)},t}(g),z=function(e){function t(t){var n;return(n=e.call(this)||this).payload=t.map((function(e){return new q(e)})),n}u(t,e);var n=t.prototype;return n.setValue=function(e,t){var n=this;void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((function(e,r){return n.payload[r].setValue(e,t)})):this.payload.forEach((function(n){return n.setValue(e,t)}))},n.getValue=function(){return this.payload.map((function(e){return e.getValue()}))},n.interpolate=function(e,t){return new V(this,e,t)},t}(y),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),M||(M=!0,E(T||L));return this},t.stop=function(e){return this.listeners.forEach((function(t){return t(e)})),this.listeners=[],this},t.pause=function(e){var t;return this.stop(!0),e&&(t=this,I.has(t)&&I.delete(t)),this},t.runAsync=function(e,t){var n=this,r=(e.delay,c(e,["delay"])),i=this.local,a=Promise.resolve(void 0);if(l.arr(r.to))for(var u=function(e){var t=e,c=o({},r,m(r.to[t]));l.arr(c.config)&&(c.config=c.config[t]),a=a.then((function(){if(i===n.guid)return new Promise((function(e){return n.diff(c).start(e)}))}))},s=0;s<r.to.length;s++)u(s);else if(l.fun(r.to)){var f,p=0;a=a.then((function(){return r.to((function(e){var t=o({},r,m(e));if(l.arr(t.config)&&(t.config=t.config[p]),p++,i===n.guid)return f=new Promise((function(e){return n.diff(t).start(e)}))}),(function(e){return void 0===e&&(e=!0),n.stop(e)})).then((function(){return f}))}))}a.then(t)},t.diff=function(e){var t=this;this.props=o({},this.props,e);var n=this.props,r=n.from,c=void 0===r?{}:r,i=n.to,a=void 0===i?{}:i,u=n.config,s=void 0===u?{}:u,f=n.reverse,m=n.attach,h=n.reset,g=n.immediate;if(f){var y=[a,c];c=y[0],a=y[1]}this.merged=o({},c,this.merged,a),this.hasChanged=!1;var O=m&&m(this);if(this.animations=Object.entries(this.merged).reduce((function(e,n){var r=n[0],i=n[1],a=e[r]||{},u=l.num(i),f=l.str(i)&&!i.startsWith("#")&&!/\d/.test(i)&&!v[i],m=l.arr(i),y=!u&&!m&&!f,j=l.und(c[r])?i:c[r],w=u||m||f?i:1,E=b(s,r);O&&(w=O.animations[r].parent);var _,x=a.parent,P=a.interpolation,S=d(O?w.getPayload():w),C=i;y&&(C=k({range:[0,1],output:[i,i]})(1));var T,N=P&&P.getValue(),A=!l.und(x)&&a.animatedValues.some((function(e){return!e.done})),D=!l.equ(C,N),F=!l.equ(C,a.previous),M=!l.equ(E,a.config);if(h||F&&D||M){var I;if(u||f)x=P=a.parent||new q(j);else if(m)x=P=a.parent||new z(j);else if(y){var L=a.interpolation&&a.interpolation.calc(a.parent.value);L=void 0===L||h?j:L,a.parent?(x=a.parent).setValue(0,!1):x=new q(0);var B={output:[L,i]};a.interpolation?(P=a.interpolation,a.interpolation.updateConfig(B)):P=x.interpolate(B)}return S=d(O?w.getPayload():w),_=d(x.getPayload()),h&&!y&&x.setValue(j,!1),t.hasChanged=!0,_.forEach((function(e){e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=A?e.lastVelocity:void 0,e.lastTime=A?e.lastTime:void 0,e.startTime=R(),e.done=!1,e.animatedStyles.clear()})),b(g,r)&&x.setValue(y?w:i,!1),o({},e,((I={})[r]=o({},a,{name:r,parent:x,interpolation:P,animatedValues:_,toValues:S,previous:C,config:E,fromValues:d(x.getValue()),immediate:b(g,r),initialVelocity:p(E.velocity,0),clamp:p(E.clamp,!1),precision:p(E.precision,.01),tension:p(E.tension,170),friction:p(E.friction,26),mass:p(E.mass,1),duration:E.duration,easing:p(E.easing,(function(e){return e})),decay:E.decay}),I))}return D?e:(y&&(x.setValue(1,!1),P.updateConfig({output:[C,C]})),x.done=!0,t.hasChanged=!0,o({},e,((T={})[r]=o({},e[r],{previous:C}),T)))}),this.animations),this.hasChanged)for(var j in this.configs=Object.values(this.animations),this.values={},this.interpolations={},this.animations)this.interpolations[j]=this.animations[j].interpolation,this.values[j]=this.animations[j].interpolation.getValue();return this},t.destroy=function(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0},e}(),U=function(e,t){var n=i.useRef(!1),r=i.useRef(),o=l.fun(t),c=i.useMemo((function(){var n;return r.current&&(r.current.map((function(e){return e.destroy()})),r.current=void 0),[new Array(e).fill().map((function(e,r){var c=new 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},G=0,K=function(e,t){return("function"==typeof t?e.map(t):d(t)).map(String)},Q=function(e){var t=e.items,n=e.keys,r=void 0===n?function(e){return e}:n,i=c(e,["items","keys"]);return t=d(void 0!==t?t:null),o({items:t,keys:K(t,r)},i)};function Y(e,t){var n=function(){if(o){if(c>=r.length)return"break";i=r[c++]}else{if((c=r.next()).done)return"break";i=c.value}var n=i.key,a=function(e){return e.key!==n};(l.und(t)||t===n)&&(e.current.instances.delete(n),e.current.transitions=e.current.transitions.filter(a),e.current.deleted=e.current.deleted.filter(a))},r=e.current.deleted,o=Array.isArray(r),c=0;for(r=o?r:r[Symbol.iterator]();;){var i;if("break"===n())break}e.current.forceUpdate()}var $=function(e){function t(t){var n;return void 0===t&&(t={}),n=e.call(this)||this,!t.transform||t.transform instanceof g||(t=h.transform(t)),n.payload=t,n}return u(t,e),t}(O),J={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Z="[-+]?\\d*\\.?\\d+";function X(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var ee=new RegExp("rgb"+X(Z,Z,Z)),te=new RegExp("rgba"+X(Z,Z,Z,Z)),ne=new RegExp("hsl"+X(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),re=new RegExp("hsla"+X(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",Z)),oe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ce=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ie=/^#([0-9a-fA-F]{6})$/,ae=/^#([0-9a-fA-F]{8})$/;function ue(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function se(e,t,n){var r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,c=ue(o,r,e+1/3),i=ue(o,r,e),a=ue(o,r,e-1/3);return Math.round(255*c)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function le(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function fe(e){return(parseFloat(e)%360+360)%360/360}function pe(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function de(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function be(e){var t,n,r="number"==typeof(t=e)?t>>>0===t&&t>=0&&t<=4294967295?t:null:(n=ie.exec(t))?parseInt(n[1]+"ff",16)>>>0:J.hasOwnProperty(t)?J[t]:(n=ee.exec(t))?(le(n[1])<<24|le(n[2])<<16|le(n[3])<<8|255)>>>0:(n=te.exec(t))?(le(n[1])<<24|le(n[2])<<16|le(n[3])<<8|pe(n[4]))>>>0:(n=oe.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0:(n=ae.exec(t))?parseInt(n[1],16)>>>0:(n=ce.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0:(n=ne.exec(t))?(255|se(fe(n[1]),de(n[2]),de(n[3])))>>>0:(n=re.exec(t))?(se(fe(n[1]),de(n[2]),de(n[3]))|pe(n[4]))>>>0:null;return null===r?e:"rgba("+((4278190080&(r=r||0))>>>24)+", "+((16711680&r)>>>16)+", "+((65280&r)>>>8)+", "+(255&r)/255+")"}var me=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,he=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ve=new RegExp("("+Object.keys(J).join("|")+")","g"),ge={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ye=["Webkit","Ms","Moz","O"];function Oe(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ge.hasOwnProperty(e)&&ge[e]?(""+t).trim():t+"px"}ge=Object.keys(ge).reduce((function(e,t){return ye.forEach((function(n){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(n,t)]=e[t]})),e}),ge);var je={};A((function(e){return new $(e)})),S("div"),x((function(e){var t=e.output.map((function(e){return e.replace(he,be)})).map((function(e){return e.replace(ve,be)})),n=t[0].match(me).map((function(){return[]}));t.forEach((function(e){e.match(me).forEach((function(e,t){return n[t].push(+e)}))}));var r=t[0].match(me).map((function(t,r){return B(o({},e,{output:n[r]}))}));return function(e){var n=0;return t[0].replace(me,(function(){return r[n++](e)})).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(function(e,t,n,r,o){return"rgba("+Math.round(t)+", "+Math.round(n)+", "+Math.round(r)+", "+o+")"}))}})),w(J),j((function(e,t){if(!e.nodeType||void 0===e.setAttribute)return!1;var n=t.style,r=t.children,o=t.scrollTop,i=t.scrollLeft,a=c(t,["style","children","scrollTop","scrollLeft"]),u="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;for(var s in void 0!==o&&(e.scrollTop=o),void 0!==i&&(e.scrollLeft=i),void 0!==r&&(e.textContent=r),n)if(n.hasOwnProperty(s)){var l=0===s.indexOf("--"),f=Oe(s,n[s],l);"float"===s&&(s="cssFloat"),l?e.style.setProperty(s,f):e.style[s]=f}for(var p in a){var d=u?p:je[p]||(je[p]=p.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})));void 0!==e.getAttribute(d)&&e.setAttribute(d,a[p])}}),(function(e){return e}));var we,ke,Ee=(we=function(e){return i.forwardRef((function(t,n){var r=f(),u=i.useRef(!0),s=i.useRef(null),p=i.useRef(null),d=i.useCallback((function(e){var t=s.current;s.current=new F(e,(function(){var e=!1;p.current&&(e=h.fn(p.current,s.current.getAnimatedValue())),p.current&&!1!==e||r()})),t&&t.detach()}),[]);i.useEffect((function(){return function(){u.current=!1,s.current&&s.current.detach()}}),[]),i.useImperativeHandle(n,(function(){return N(p,u,r)})),d(t);var b,m=s.current.getValue(),v=(m.scrollTop,m.scrollLeft,c(m,["scrollTop","scrollLeft"])),g=(b=e,!l.fun(b)||b.prototype instanceof a.Component?function(e){return p.current=function(e,t){return t&&(l.fun(t)?t(e):l.obj(t)&&(t.current=e)),e}(e,n)}:void 0);return a.createElement(e,o({},v,{ref:g}))}))},void 0===(ke=!1)&&(ke=!0),function(e){return(l.arr(e)?e:Object.keys(e)).reduce((function(e,t){var n=ke?t[0].toLowerCase()+t.substring(1):t;return e[n]=we(n),e}),we)}),_e=Ee(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);t.apply=Ee,t.config={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},t.update=L,t.animated=_e,t.a=_e,t.interpolate=function(e,t,n){return e&&new V(e,t,n)},t.Globals=D,t.useSpring=function(e){var t=l.fun(e),n=U(1,t?e:[e]),r=n[0],o=n[1],c=n[2];return t?[r[0],o,c]:r},t.useTrail=function(e,t){var n=i.useRef(!1),r=l.fun(t),c=b(t),a=i.useRef(),u=U(e,(function(e,t){return 0===e&&(a.current=[]),a.current.push(t),o({},c,{config:b(c.config,e),attach:e>0&&function(){return a.current[e-1]}})})),s=u[0],f=u[1],p=u[2],d=i.useMemo((function(){return function(e){return f((function(t,n){e.reverse;var r=e.reverse?t+1:t-1,i=a.current[r];return o({},e,{config:b(e.config||c.config,t),attach:i&&function(){return i}})}))}}),[e,c.reverse]);return i.useEffect((function(){n.current&&!r&&d(t)})),i.useEffect((function(){n.current=!0}),[]),r?[s,d,p]:s},t.useTransition=function(e,t,n){var r=o({items:e,keys:t||function(e){return e}},n),a=Q(r),u=a.lazy,s=void 0!==u&&u,l=(a.unique,a.reset),p=void 0!==l&&l,d=(a.enter,a.leave,a.update,a.onDestroyed),m=(a.keys,a.items,a.onFrame),h=a.onRest,v=a.onStart,g=a.ref,y=c(a,["lazy","unique","reset","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","ref"]),O=f(),j=i.useRef(!1),w=i.useRef({mounted:!1,first:!0,deleted:[],current:{},transitions:[],prevProps:{},paused:!!r.ref,instances:!j.current&&new Map,forceUpdate:O});return i.useImperativeHandle(r.ref,(function(){return{start:function(){return Promise.all(Array.from(w.current.instances).map((function(e){var t=e[1];return new Promise((function(e){return t.start(e)}))})))},stop:function(e){return Array.from(w.current.instances).forEach((function(t){return t[1].stop(e)}))},get controllers(){return Array.from(w.current.instances).map((function(e){return e[1]}))}}})),w.current=function(e,t){var n=e.first,r=e.prevProps,i=c(e,["first","prevProps"]),a=Q(t),u=a.items,s=a.keys,l=a.initial,f=a.from,p=a.enter,d=a.leave,m=a.update,h=a.trail,v=void 0===h?0:h,g=a.unique,y=a.config,O=a.order,j=void 0===O?["enter","leave","update"]:O,w=Q(r),k=w.keys,E=w.items,_=o({},i.current),x=[].concat(i.deleted),P=Object.keys(_),R=new Set(P),S=new Set(s),C=s.filter((function(e){return!R.has(e)})),T=i.transitions.filter((function(e){return!e.destroyed&&!S.has(e.originalKey)})).map((function(e){return e.originalKey})),N=s.filter((function(e){return R.has(e)})),A=-v;for(;j.length;){switch(j.shift()){case"enter":C.forEach((function(e,t){g&&x.find((function(t){return t.originalKey===e}))&&(x=x.filter((function(t){return t.originalKey!==e})));var r=s.indexOf(e),o=u[r],c=n&&void 0!==l?"initial":"enter";_[e]={slot:c,originalKey:e,key:g?String(e):G++,item:o,trail:A+=v,config:b(y,o,c),from:b(n&&void 0!==l?l||{}:f,o),to:b(p,o)}}));break;case"leave":T.forEach((function(e){var t=k.indexOf(e),n=E[t];x.unshift(o({},_[e],{slot:"leave",destroyed:!0,left:k[Math.max(0,t-1)],right:k[Math.min(k.length,t+1)],trail:A+=v,config:b(y,n,"leave"),to:b(d,n)})),delete _[e]}));break;case"update":N.forEach((function(e){var t=s.indexOf(e),n=u[t];_[e]=o({},_[e],{item:n,slot:"update",trail:A+=v,config:b(y,n,"update"),to:b(m,n)})}))}}var D=s.map((function(e){return _[e]}));return x.forEach((function(e){var t,n=e.left,r=(e.right,c(e,["left","right"]));-1!==(t=D.findIndex((function(e){return e.originalKey===n})))&&(t+=1),t=Math.max(0,t),D=[].concat(D.slice(0,t),[r],D.slice(t))})),o({},i,{changed:C.length||T.length||N.length,first:n&&0===C.length,transitions:D,current:_,deleted:x,prevProps:t})}(w.current,r),w.current.changed&&w.current.transitions.forEach((function(e){var t=e.slot,n=e.from,r=e.to,c=e.config,i=e.trail,a=e.key,u=e.item;w.current.instances.has(a)||w.current.instances.set(a,new 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){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,o,c=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";var r=n(19),o=n(6),c=n(17),i=n(0),a=n(28);var u=function(e){var t=e.icon,n=e.className,r=Object(c.a)(e,["icon","className"]),a=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" ");return Object(i.createElement)("span",Object(o.a)({className:a},r))};function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.icon,n=void 0===t?null:t,r=e.size,s=Object(c.a)(e,["icon","size"]);if("string"==typeof n)return Object(i.createElement)(u,Object(o.a)({icon:n},s));if(n&&u===n.type)return Object(i.cloneElement)(n,l({},s));var f=r||24;if("function"==typeof n)return n.prototype instanceof i.Component?Object(i.createElement)(n,l({size:f},s)):n(l({size:f},s));if(n&&("svg"===n.type||n.type===a.SVG)){var p=l(l({width:f,height:f},n.props),s);return Object(i.createElement)(a.SVG,p)}return Object(i.isValidElement)(n)?Object(i.cloneElement)(n,l({size:f},s)):n}},,function(e,t){!function(){e.exports=this.wp.autop}()},,function(e,t,n){"use strict";(function(e){var r=n(0),o=n(8),c=n(4),i=n.n(c),a=n(36),u=n(1),s=(n(68),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 c}));var r=n(9),o=n.n(r),c=function(e){return e.reduce((function(e,t){var n=o()(t,2),r=n[0],c=n[1];return e[r]=c,e}),{})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return m}));var r=n(9),o=n.n(r),c=n(14),i=n(11),a=n(0),u=n(21),s=n.n(u),l=n(54),f=n(110),p=n(61),d=function(e){var t=Object(p.a)();e=e||t;var n=Object(i.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(a.useCallback)((function(t){r(e,t)}),[e,r])]},b=function(e,t,n){var r=Object(p.a)();n=n||r;var o=Object(i.useSelect)((function(r){return r(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),u=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(a.useCallback)((function(t){u(n,e,t)}),[n,e,u])]},m=function(e,t){var n=Object(p.a)(),r=d(t=t||n),c=o()(r,2),i=c[0],u=c[1],b=Object(l.a)(i),m=Object(l.a)(e),h=Object(f.a)(m),v=Object(a.useRef)(!1);return Object(a.useEffect)((function(){s()(h,m)||(u(Object.assign({},b,m)),v.current=!0)}),[b,m,h,u]),v.current?[i,u]:[e,u]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(9),o=n.n(r),c=n(0),i=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var r=n(5),o=n(79),c=function(e){var t=e.country,n=void 0===t?"":t,r=e.state,o=void 0===r?"":r,c=e.city,i=void 0===c?"":c,a=e.postcode,u=void 0===a?"":a;return{country:n.trim(),state:o.trim(),city:i.trim(),postcode:u?u.replace(" ","").toUpperCase():""}},i=function(e){var t=Object.keys(r.defaultAddressFields),n=Object(o.a)(t,{},e.country),c=Object.assign({},e);return n.forEach((function(e){e.hidden&&(c[e.key]="")})),c}},,,,,,,,function(e,t){!function(){e.exports=this.wp.wordcount}()},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2);function o(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},,,,function(e,t,n){"use strict";var r=n(6),o=n(0),c=n(8);var i=function(e,t){return function(n){var r=e(n),o=n.displayName,i=void 0===o?n.name||"Component":o;return r.displayName="".concat(Object(c.upperFirst)(Object(c.camelCase)(t)),"(").concat(i,")"),r}},a=new WeakMap;function u(e,t){return Object(o.useMemo)((function(){var n=function(e){var t=a.get(e)||0;return a.set(e,t+1),t}(e);return t?"".concat(t,"-").concat(n):n}),[e])}t.a=i((function(e){return function(t){var n=u(e);return Object(o.createElement)(e,Object(r.a)({},t,{instanceId:n}))}}),"withInstanceId")},,,function(e,t,n){"use strict";var r=n(10),o=n.n(r),c=n(32),i=n.n(c),a=n(33),u=n.n(a),s=n(22),l=n.n(s),f=n(34),p=n.n(f),d=n(35),b=n.n(d),m=n(25),h=n.n(m),v=n(7),g=n.n(v),y=n(2);n(140);function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h()(e);if(t){var o=h()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return b()(this,n)}}t.a=function(e){var t=function(t){p()(r,t);var n=O(r);function r(){var e;return i()(this,r),e=n.call(this),g()(l()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),g()(l()(e),"moveFocusToTop",(function(t){var n=e.scrollPointRef.current.parentElement.querySelectorAll(t);n.length&&n[0].focus()})),g()(l()(e),"scrollToTop",(function(t){window&&Number.isFinite(window.innerHeight)&&(e.scrollToTopIfNeeded(),t&&t.focusableSelector&&e.moveFocusToTop(t.focusableSelector))})),e.scrollPointRef=Object(y.createRef)(),e}return u()(r,[{key:"render",value:function(){return React.createElement(React.Fragment,null,React.createElement("div",{className:"with-scroll-to-top__scroll-point",ref:this.scrollPointRef,"aria-hidden":!0}),React.createElement(e,o()({},this.props,{scrollToTop:this.scrollToTop})))}}]),r}(y.Component);return t.displayName="withScrollToTop",t}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(10),o=n.n(r),c=n(7),i=n.n(c),a=n(0),u=n(44);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=[".wp-block-woocommerce-cart"],p=function(e){var t=e.Block,n=e.containers,r=e.getProps,c=void 0===r?function(){}:r,i=e.getErrorBoundaryProps,s=void 0===i?function(){}:i;0!==n.length&&Array.prototype.forEach.call(n,(function(e,n){var r=c(e,n),i=s(e,n),f=l(l({},e.dataset),r.attributes);e.classList.remove("is-loading"),Object(a.render)(React.createElement(u.a,i,React.createElement(a.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},r,{attributes:f})))),e)}))},d=function(e){var t=e.Block,n=e.getProps,r=e.getErrorBoundaryProps,o=e.selector,c=e.wrappers,i=document.body.querySelectorAll(o);c.length>0&&Array.prototype.filter.call(i,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,c)})),p({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})},b=function(e){var t=document.body.querySelectorAll(f.join(","));d(l(l({},e),{},{wrappers:t})),Array.prototype.forEach.call(t,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var n,r,o,c,i,a;n=l(l({},e),{},{wrapper:t}),r=n.Block,o=n.getProps,c=n.getErrorBoundaryProps,i=n.selector,a=n.wrapper.querySelectorAll(i),p({Block:r,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},function(e,t){},function(e,t,n){var r=n(65);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";n.d(t,"b",(function(){return A})),n.d(t,"a",(function(){return D}));var r=n(7),o=n.n(r),c=n(9),i=n.n(c),a=(n(3),n(0)),u=n(11),s=n(55),l=n(46),f=n(10),p=n.n(f),d=n(4),b=n.n(d),m=n(170),h=(n(122),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-success";case"info":case"warning":return"woocommerce-info"}return""}),v=function(e){var t=e.className,n=e.notices,r=e.removeNotice,o=n.filter((function(e){return"snackbar"!==e.type}));if(!o.length)return null;var c=b()(t,"wc-block-components-notices");return React.createElement("div",{className:c},o.map((function(e){return React.createElement(m.a,p()({key:"store-notice-"+e.id},e,{className:b()("wc-block-components-notices__notice","woocommerce-message",h(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)})))},g=n(6),y=n(26),O=n.n(y);function j(e,t,n,r,o,c,i){try{var a=e[c](i),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function w(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var c=e.apply(t,n);function i(e){j(c,r,o,i,a,"next",e)}function a(e){j(c,r,o,i,a,"throw",e)}i(void 0)}))}}var k=n(16),E=n(8),_=n(83),x=n(172),P=n(94);var R=function(e){var t=e.notices,n=e.className,r=e.children,o=e.onRemove,c=void 0===o?E.noop:o,i=Object(x.a)(),u=Object(a.useState)((function(){return new WeakMap})),s=Object(k.a)(u,1)[0],l=Object(_.useTransition)(t,(function(e){return e.id}),{from:{opacity:0,height:0},enter:function(e){return function(){var t=w(O.a.mark((function t(n){return O.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n({opacity:1,height:s.get(e).offsetHeight});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},leave:function(){return function(){var e=w(O.a.mark((function e(t){return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t({opacity:0});case 2:return e.next=4,t({height:0});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},immediate:i});n=b()("components-snackbar-list",n);var f=function(e){return function(){return c(e.id)}};return Object(a.createElement)("div",{className:n},r,l.map((function(e){var t=e.item,n=e.key,r=e.props;return Object(a.createElement)(_.animated.div,{key:n,style:r},Object(a.createElement)("div",{className:"components-snackbar-list__notice-container",ref:function(e){return e&&s.set(t,e)}},Object(a.createElement)(P.a,Object(g.a)({},Object(E.omit)(t,["content"]),{onRemove:f(t)}),t.content)))})))},S=function(e){var t=e.className,n=e.notices,r=e.removeNotice;if(e.isEditor)return null;var o=n.filter((function(e){return"snackbar"===e.type})),c=b()(t,"wc-block-components-notices__snackbar");return React.createElement(R,{notices:o,className:c,onRemove:r})};function C(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 T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var N=Object(a.createContext)({notices:[],createNotice:function(e,t,n){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),A=function(){return Object(a.useContext)(N)},D=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,o=e.createNoticeContainer,c=void 0===o||o,f=e.context,p=void 0===f?"wc/core":f,d=Object(u.useDispatch)("core/notices"),b=d.createNotice,m=d.removeNotice,h=Object(a.useState)(!1),g=i()(h,2),y=g[0],O=g[1],j=Object(s.a)().dispatchStoreEvent,w=Object(l.a)().isEditor,k=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};b(e,t,T(T({},n),{},{context:n.context||p})),j("store-notice-create",{status:e,content:t,options:n})}),[b,j,p]),E=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),_=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k("default",e,T(T({},t),{},{type:"snackbar"}))}),[k]),x={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:k,createSnackbarNotice:_,removeNotice:E,context:p,setIsSuppressed:O},P=y?null:React.createElement(v,{className:r,notices:x.notices,removeNotice:x.removeNotice,isEditor:w}),R=y?null:React.createElement(S,{notices:x.notices,removeNotice:x.removeNotice,isEditor:w});return React.createElement(N.Provider,{value:x},c&&P,t,R)}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(14),o=n(11),c=n(0),i=n(54),a=n(99),u=function(e){var t=e.namespace,n=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,f=void 0===l?{}:l,p=e.shouldSelect,d=void 0===p||p;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var b=Object(c.useRef)({results:[],isLoading:!0}),m=Object(i.a)(f),h=Object(i.a)(s),v=Object(a.a)(),g=Object(o.useSelect)((function(e){if(!d)return null;var o=e(r.COLLECTIONS_STORE_KEY),c=[t,n,m,h],i=o.getCollectionError.apply(o,c);return i&&v(i),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,n,h,m,d]);return null!==g&&(b.current=g),b.current}},,,,,function(e,t,n){"use strict";var r=n(0),o=n(28),c=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},,,,,,,function(e,t,n){"use strict";var r=n(7),o=n.n(r),c=n(15),i=n.n(c),a=n(0);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(14),c=n(11),i=n(12);t.a=function(e){return function(t){var n;return n=Object(r.useRef)(i.k.restApiRoutes||{}),Object(c.useSelect)((function(e,t){if(n.current){var r=e(o.SCHEMA_STORE_KEY),c=r.isResolving,i=r.hasFinishedResolution,a=t.dispatch(o.SCHEMA_STORE_KEY),u=a.receiveRoutes,s=a.startResolution,l=a.finishResolution;Object.keys(n.current).forEach((function(e){var t=n.current[e];c("getRoutes",[e])||i("getRoutes",[e])||(s("getRoutes",[e]),u(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},,,,,,function(e,t,n){"use strict";n(3);var r=n(4),o=n.n(r),c=n(31),i=n(114);n(169);t.a=Object(i.a)((function(e){var t=e.className,n=e.instanceId,r=e.defaultValue,i=e.label,a=e.onChange,u=e.options,s=e.screenReaderLabel,l=e.readOnly,f=e.value,p="wc-block-components-sort-select__select-".concat(n);return React.createElement("div",{className:o()("wc-block-sort-select","wc-block-components-sort-select",t)},React.createElement(c.a,{label:i,screenReaderLabel:s,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:p}}),React.createElement("select",{id:p,className:"wc-block-sort-select__select wc-block-components-sort-select__select",defaultValue:r,onChange:a,readOnly:l,value:f},u.map((function(e){return React.createElement("option",{key:e.key,value:e.key},e.label)}))))}))},,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(37),o=n(0),c=n(12);n.p=c.j,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)((function(){return Promise.all([n.e(20),n.e(6)]).then(n.bind(null,309))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)((function(){return n.e(5).then(n.bind(null,319))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)((function(){return n.e(13).then(n.bind(null,318))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)((function(){return n.e(7).then(n.bind(null,310))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)((function(){return n.e(3).then(n.bind(null,311))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)((function(){return n.e(11).then(n.bind(null,312))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)((function(){return n.e(8).then(n.bind(null,296))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)((function(){return n.e(9).then(n.bind(null,313))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)((function(){return n.e(4).then(n.bind(null,314))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)((function(){return n.e(12).then(n.bind(null,315))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)((function(){return n.e(10).then(n.bind(null,316))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)((function(){return n.e(2).then(n.bind(null,317))}))});var i=function(e){return Object(r.getRegisteredBlockComponents)(e)}},,,,,,,,,,,,function(e,t){},function(e,t,n){"use strict";var r=n(0),o=n(8),c=n(4),i=n.n(c),a=n(1),u=n(36),s=n(132),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(80),o=n.n(r);t.a=o.a},function(e,t,n){"use strict";(function(e){var r=n(67),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(279)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(141),o=n(125),c=n(121),i=n(32),a=n.n(i),u=n(33),s=n.n(u),l=n(34),f=n.n(l),p=n(35),d=n.n(p),b=n(25),m=n.n(b),h=n(2),v=(n(3),n(9)),g=n.n(v),y=n(0),O=n(15),j=n.n(O),w=n(7),k=n.n(w),E=n(1),_=n(8),x=n(4),P=n.n(x),R=n(31),S=(n(229),function(e){var t=e.currentPage,n=e.displayFirstAndLastPages,r=e.displayNextAndPreviousArrows,o=e.pagesToDisplay,c=e.onPageChange,i=e.totalPages,a=function(e,t,n){if(n<=2)return{minIndex:null,maxIndex:null};var r=e-1,o=Math.max(Math.floor(t-r/2),2),c=Math.min(Math.ceil(t+(r-(t-o))),n-1);return{minIndex:Math.max(Math.floor(t-(r-(c-t))),2),maxIndex:c}}(o,t,i),u=a.minIndex,s=a.maxIndex,l=n&&Boolean(1!==u),f=n&&Boolean(s!==i),p=n&&Boolean(u>3),d=n&&Boolean(s<i-2);l&&3===u&&(u-=1),f&&s===i-2&&(s+=1);var b=[];if(u&&s)for(var m=u;m<=s;m++)b.push(m);return React.createElement("div",{className:"wc-block-pagination wc-block-components-pagination"},React.createElement(R.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(R.a,{label:"<",screenReaderLabel:Object(E.__)("Previous page","woo-gutenberg-products-block")})),l&&React.createElement("button",{className:P()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:function(){return c(1)},disabled:1===t},React.createElement(R.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:P()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?null:function(){return c(e)},disabled:t===e},React.createElement(R.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:P()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===i,"wc-block-components-pagination__page--active":t===i}),onClick:function(){return c(i)},disabled:t===i},React.createElement(R.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(R.a,{label:">",screenReaderLabel:Object(E.__)("Next page","woo-gutenberg-products-block")})))});S.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var C=S,T=n(110),N=n(98),A=n(127),D=n(14),F=n(11),M=n(54);function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var B=function(e){var t={namespace:"/wc/store",resourceName:"products"},n=Object(A.a)(L(L({},t),{},{query:e})),r=n.results,o=n.isLoading,c=function(e,t){var n=t.namespace,r=t.resourceName,o=t.resourceValues,c=void 0===o?[]:o,i=t.query,a=void 0===i?{}:i;if(!n||!r)throw new Error("The options object must have valid values for the namespace and the resource name properties.");var u=Object(M.a)(a),s=Object(M.a)(c),l=Object(F.useSelect)((function(t){var o=t(D.COLLECTIONS_STORE_KEY),c=[e,n,r,u,s];return{value:o.getCollectionHeader.apply(o,c),isLoading:o.hasFinishedResolution("getCollectionHeader",c)}}),[e,n,r,s,u]),f=l.value,p=l.isLoading;return{value:f,isLoading:void 0===p||p}}("x-wp-total",L(L({},t),{},{query:e})).value;return{products:r,totalProducts:parseInt(c,10),productsLoading:o}},V=n(55),q=n(117),z=n(84),W=n(36),H=n(139),U=n(28),G=React.createElement(U.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})),K=function(){var e=Object(z.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(e,"__no-products")},React.createElement(H.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:G,size:100}),React.createElement("strong",{className:"".concat(e,"__no-products-title")},Object(E.__)("No products","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(e,"__no-products-description")},Object(E.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},Q=React.createElement(U.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),React.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})),Y=function(e){var t=e.resetCallback,n=void 0===t?function(){}:t,r=Object(z.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(r,"__no-products")},React.createElement(H.a,{className:"".concat(r,"__no-products-image"),alt:"",srcElement:Q,size:100}),React.createElement("strong",{className:"".concat(r,"__no-products-title")},Object(E.__)("No products found","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(r,"__no-products-description")},Object(E.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),React.createElement("button",{onClick:n},Object(E.__)("Reset Search","woo-gutenberg-products-block")))},$=n(147),J=(n(228),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(114),X=n(10),ee=n.n(X),te=n(157),ne=Object(Z.a)((function(e){var t=e.product,n=e.attributes,r=e.instanceId,o=n.layoutConfig,c=Object(z.useInnerBlockLayoutContext)(),i=c.parentClassName,a=c.parentName,u=0===Object.keys(t).length,s=P()("".concat(i,"__product"),"wc-block-layout",{"is-loading":u});return React.createElement("li",{className:s,"aria-hidden":u},function e(t,n,r,o){if(r){var c=Object(te.a)(t);return r.map((function(r,i){var a=g()(r,2),u=a[0],s=a[1],l=void 0===s?{}:s,f=[];l.children&&l.children.length>0&&(f=e(t,n,l.children,o));var p=c[u];if(!p)return null;var d=n.id||0,b=["layout",u,i,o,d];return React.createElement(y.Suspense,{key:b.join("_"),fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(p,ee()({},l,{children:f,product:n})))}))}}(a,t,o,r))}));n(227);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(_.isEqual)(t,o)&&Number.isFinite(n)},ie=Object(q.a)((function(e){var t=e.attributes,n=e.currentPage,r=e.onPageChange,o=e.onSortChange,c=e.sortValue,i=e.scrollToTop,a=e.hideOutOfStockItems,u=void 0!==a&&a,s=Object(N.c)(function(e){var t=e.sortValue,n=e.currentPage,r=e.attributes,o=e.hideOutOfStockItems,c=r.columns,i=r.rows;return 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:c*i,page:n},o&&{stock_status:["instock","onbackorder"]})}({attributes:t,sortValue:c,currentPage:n,hideOutOfStockItems:u})),l=g()(s,1)[0],f=B(l),p=f.products,d=f.totalProducts,b=f.productsLoading,m=Object(z.useInnerBlockLayoutContext)(),h=m.parentClassName,v=m.parentName,O=function(e){e.order,e.orderby,e.page,e.per_page;return j()(e,["order","orderby","page","per_page"])||{}}(l),w=Object(V.a)().dispatchStoreEvent,k=Object(N.b)("attributes",[]),x=g()(k,2),R=x[0],S=x[1],A=Object(N.b)("min_price"),D=g()(A,2),F=D[0],M=D[1],I=Object(N.b)("max_price"),L=g()(I,2),q=L[0],H=L[1],U=Object(T.a)({totalQuery:O,totalProducts:d},ce);Object(y.useEffect)((function(){w("product-list-render",{products:p,listName:v})}),[p,v,w]),Object(y.useEffect)((function(){Object(_.isEqual)(O,null==U?void 0:U.totalQuery)||(r(1),null!=U&&U.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(W.speak)(Object(E.__)("No products found","woo-gutenberg-products-block")):Object(W.speak)(Object(E.sprintf)(Object(E._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(d))}),[null==U?void 0:U.totalQuery,d,r,O]);var G,Q,$,Z,X,ee=t.contentVisibility,te=t.columns*t.rows,re=!Number.isFinite(d)&&Number.isFinite(null==U?void 0:U.totalProducts)&&Object(_.isEqual)(O,null==U?void 0:U.totalQuery)?Math.ceil(U.totalProducts/te):Math.ceil(d/te),ie=p.length?p:Array.from({length:te}),ae=0!==p.length||b,ue=R.length>0||Number.isFinite(F)||Number.isFinite(q);return React.createElement("div",{className:(G=t.columns,Q=t.rows,$=t.alignButtons,Z=t.align,X=void 0!==Z?"align"+Z:"",P()(h,X,"has-"+G+"-columns",{"has-multiple-rows":Q>1,"has-aligned-buttons":$}))},ee.orderBy&&ae&&React.createElement(J,{onChange:o,value:c}),!ae&&ue&&React.createElement(Y,{resetCallback:function(){S([]),M(null),H(null)}}),!ae&&!ue&&React.createElement(K,null),ae&&React.createElement("ul",{className:"".concat(h,"__products")},ie.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})}))),re>1&&React.createElement(C,{currentPage:n,onPageChange:function(e){i({focusableSelector:"a, button"}),r(e)},totalPages:re}))})),ae=function(e){var t=e.attributes,n=e.hideOutOfStockItems,r=void 0!==n&&n,o=Object(y.useState)(1),c=g()(o,2),i=c[0],a=c[1],u=Object(y.useState)(t.orderby),s=g()(u,2),l=s[0],f=s[1];Object(y.useEffect)((function(){f(t.orderby)}),[t.orderby]);return React.createElement(ie,{attributes:t,hideOutOfStockItems:r,currentPage:i,onPageChange:function(e){a(e)},onSortChange:function(e){var t=e.target.value;f(t),a(1)},sortValue:l})},ue=n(12),se=React.createElement("img",{src:ue.i+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}}),le=n(5);function fe(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 pe=function(e){f()(n,e);var t=fe(n);function n(){return a()(this,n),t.apply(this,arguments)}return s()(n,[{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.urlParameterSuffix;if(t.isPreview)return se;var r=Object(le.getSetting)("hideOutOfStockItems",!1);return React.createElement(z.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},React.createElement(ae,{attributes:t,urlParameterSuffix:n,hideOutOfStockItems:r}))}}]),n}(h.Component);Object(c.a)({selector:".wp-block-woocommerce-all-products",Block:Object(r.a)((function(e){return React.createElement(o.a,{context:"wc/all-products"},React.createElement(pe,e))})),getProps:function(e){return{attributes:JSON.parse(e.dataset.attributes)}}})}]);
1
+ !function(e){function t(t){for(var n,o,c=t[0],i=t[1],a=0,s=[];a<c.length;a++)o=c[a],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&s.push(r[o][0]),r[o]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(u&&u(t);s.length;)s.shift()()}var n={},r={1:0};function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(e){var t=[],n=r[e];if(0!==n)if(n)t.push(n[2]);else{var c=new Promise((function(t,o){n=r[e]=[t,o]}));t.push(n[2]=c);var i,a=document.createElement("script");a.charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.src=function(e){return o.p+""+({2:"atomic-block-components/add-to-cart",3:"atomic-block-components/button",4:"atomic-block-components/category-list",5:"atomic-block-components/image",6:"atomic-block-components/price",7:"atomic-block-components/rating",8:"atomic-block-components/sale-badge",9:"atomic-block-components/sku",10:"atomic-block-components/stock-indicator",11:"atomic-block-components/summary",12:"atomic-block-components/tag-list",13:"atomic-block-components/title",20:"vendors--atomic-block-components/price"}[e]||e)+"-frontend.js"}(e);var u=new Error;i=function(t){a.onerror=a.onload=null,clearTimeout(s);var n=r[e];if(0!==n){if(n){var o=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+o+": "+c+")",u.name="ChunkLoadError",u.type=o,u.request=c,n[1](u)}r[e]=void 0}};var s=setTimeout((function(){i({type:"timeout",target:a})}),12e4);a.onerror=a.onload=i,document.head.appendChild(a)}return Promise.all(t)},o.m=e,o.c=n,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var c=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=c.push.bind(c);c.push=t,c=c.slice();for(var a=0;a<c.length;a++)t(c[a]);var u=i;o(o.s=223)}([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(73)()},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){!function(){e.exports=this.wc.wcSettings}()},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){var r=n(83),o=n(84),c=n(67),i=n(85);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t,n){"use strict";n.d(t,"k",(function(){return c})),n.d(t,"i",(function(){return i})),n.d(t,"j",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return f})),n.d(t,"d",(function(){return p})),n.d(t,"h",(function(){return d})),n.d(t,"g",(function(){return b})),n.d(t,"a",(function(){return m})),n.d(t,"c",(function(){return h})),n.d(t,"l",(function(){return v}));var r,o=n(5),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"assets/",a=c.pluginUrl+"build/",u=c.buildPhase,s=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),f=o.STORE_PAGES.privacy.permalink,p=o.STORE_PAGES.privacy.title,d=o.STORE_PAGES.terms.permalink,b=o.STORE_PAGES.terms.title,m=(o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),h=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),v=(n(41),function(){return u>1})},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},function(e,t,n){var r=n(71);e.exports=function(e,t){if(null==e)return{};var n,o,c=r(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(24);function o(e,t){if(null==e)return{};var n,o,c=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c}},function(e,t){!function(){e.exports=this.wp.htmlEntities}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(65);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,o,c=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return c}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){!function(){e.exports=this.wp.primitives}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(58);var o=n(65);function c(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},,,function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(64);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(20).default,o=n(23);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){!function(){e.exports=this.wp.a11y}()},function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return j}));var r=n(9),o=n.n(r),c=n(7),i=n.n(c),a=n(8),u=n(0),s=n(15),l=n(12),f=n(18),p=n(93),d=n(96),b=n(46);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},g=h(h({},v),{},{email:"",phone:""}),y=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=o()(e,2),n=t[0],r=t[1];return[n,Object(f.decodeEntities)(r)]})))},O={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:[],currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},cartIsLoading:!0,cartErrors:[],billingAddress:g,shippingAddress:v,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(b.a)(),n=t.isEditor,r=t.previewData,o=(null==r?void 0:r.previewCart)||{},c=e.shouldSelect,i=Object(u.useRef)(),f=Object(l.useSelect)((function(e,t){var r=t.dispatch;if(!c)return O;if(n)return{cartCoupons:o.coupons,cartItems:o.items,cartFees:o.fees,cartItemsCount:o.items_count,cartItemsWeight:o.items_weight,cartNeedsPayment:o.needs_payment,cartNeedsShipping:o.needs_shipping,cartItemErrors:[],cartTotals:o.totals,cartIsLoading:!1,cartErrors:[],billingAddress:g,shippingAddress:v,extensions:{},shippingRates:o.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:o.has_calculated_shipping,paymentRequirements:o.paymentRequirements,receiveCart:"function"==typeof(null==o?void 0:o.receiveCart)?o.receiveCart:function(){}};var i=e(s.CART_STORE_KEY),a=i.getCartData(),u=i.getCartErrors(),l=i.getCartTotals(),f=!i.hasFinishedResolution("getCartData"),p=i.isCustomerDataUpdating(),b=r(s.CART_STORE_KEY).receiveCart,m=y(a.billingAddress),h=a.needsShipping?y(a.shippingAddress):m,j=a.fees.map((function(e){return y(e)}));return{cartCoupons:a.coupons,cartItems:a.items||[],cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors||[],cartTotals:l,cartIsLoading:f,cartErrors:u,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(h),extensions:a.extensions||{},shippingRates:a.shippingRates||[],shippingRatesLoading:p,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements||[],receiveCart:b}}),[c]);return i.current&&Object(a.isEqual)(i.current,f)||(i.current=f),i.current}},,function(e,t){!function(){e.exports=this.wc.priceFormat}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.dom}()},,function(e,t,n){"use strict";var r=n(32),o=n.n(r),c=n(33),i=n.n(c),a=n(23),u=n.n(a),s=n(34),l=n.n(s),f=n(35),p=n.n(f),d=n(25),b=n.n(d),m=n(7),h=n.n(m),v=(n(3),n(2)),g=n(1),y=n(13),O=function(e){var t=e.imageUrl,n=void 0===t?"".concat(y.i,"img/block-error.svg"):t,r=e.header,o=void 0===r?Object(g.__)("Oops!","woo-gutenberg-products-block"):r,c=e.text,i=void 0===c?Object(g.__)("There was an error loading the content.","woo-gutenberg-products-block"):c,a=e.errorMessage,u=e.errorMessagePrefix,s=void 0===u?Object(g.__)("Error:","woo-gutenberg-products-block"):u;return React.createElement("div",{className:"wc-block-error wc-block-components-error"},n&&React.createElement("img",{className:"wc-block-error__image wc-block-components-error__image",src:n,alt:""}),React.createElement("div",{className:"wc-block-error__content wc-block-components-error__content"},o&&React.createElement("p",{className:"wc-block-error__header wc-block-components-error__header"},o),i&&React.createElement("p",{className:"wc-block-error__text wc-block-components-error__text"},i),a&&React.createElement("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",a)))};n(75);function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b()(e);if(t){var o=b()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p()(this,n)}}var w=function(e){l()(n,e);var t=j(n);function n(){var e;o()(this,n);for(var r=arguments.length,c=new Array(r),i=0;i<r;i++)c[i]=arguments[i];return e=t.call.apply(t,[this].concat(c)),h()(u()(e),"state",{errorMessage:"",hasError:!1}),e}return i()(n,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,o=e.text,c=e.errorMessagePrefix,i=e.renderError,a=this.state,u=a.errorMessage;return a.hasError?"function"==typeof i?i({errorMessage:u}):React.createElement(O,{errorMessage:r?u:null,header:t,imageUrl:n,text:o,errorMessagePrefix:c}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:React.createElement(React.Fragment,null,React.createElement("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),n}(v.Component);w.defaultProps={showErrorMessage:!0};t.a=w},,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=(n(12),Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}})),c=function(){return Object(r.useContext)(o)}},,function(e,t,n){"use strict";(function(e){var r=n(0),o=(n(66),Object(r.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==e&&e.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}}));t.a=o}).call(this,n(89))},,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(22),c=n.n(o);function i(e){var t=Object(r.useRef)();return void 0!==t.current&&c()(e,t.current)||(t.current=e),t.current}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(7),o=n.n(r),c=n(78),i=n(0),a=n(38);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l=function(){var e=Object(a.a)();return{dispatchStoreEvent:Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(i.useCallback)((function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-checkout-".concat(t),s(s({},n),{},{storeCart:e}))}catch(e){console.error(e)}}),[e])}}},function(e,t){!function(){e.exports=this.wp.deprecated}()},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=Object(r.createContext)("page"),c=function(){return Object(r.useContext)(o)};o.Provider},function(e,t){!function(){e.exports=this.wp.keycodes}()},,function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(58);function o(e,t){if(e){if("string"==typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t){!function(){e.exports=this.wp.warning}()},function(e,t,n){var r=n(68);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.url}()},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";var r=n(74);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,c,i){if(i!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){},function(e,t,n){"use strict";var r=n(7),o=n.n(r),c=n(9),i=n.n(c),a=n(5),u=n(1);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=Object(a.getSetting)("countryLocale",{}),p=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(u.sprintf)(Object(u.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(t.index=parseInt(e.priority,10)),!0===e.hidden&&(t.required=!1),t},d=Object.entries(f).map((function(e){var t=i()(e,2),n=t[0],r=t[1];return[n,Object.entries(r).map((function(e){var t=i()(e,2),n=t[0],r=t[1];return[n,p(r)]})).reduce((function(e,t){var n=i()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})]})).reduce((function(e,t){var n=i()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{});t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=n&&void 0!==d[n]?d[n]:{};return e.map((function(e){var n=a.defaultAddressFields[e]||{},o=r[e]||{},c=t[e]||{};return l(l(l({key:e},n),o),c)})).sort((function(e,t){return e.index-t.index}))}},,function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(10)),c=r(n(71)),i=n(2),a=r(i),u=r(n(121)),s=r(n(23)),l={arr:Array.isArray,obj:function(e){return"[object Object]"===Object.prototype.toString.call(e)},fun:function(e){return"function"==typeof e},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},und:function(e){return void 0===e},nul:function(e){return null===e},set:function(e){return e instanceof Set},map:function(e){return e instanceof Map},equ:function(e,t){if(typeof e!=typeof t)return!1;if(l.str(e)||l.num(e))return e===t;if(l.obj(e)&&l.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;var n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!l.und(n)||e===t}};function f(){var e=i.useState(!1)[1];return i.useCallback((function(){return e((function(e){return!e}))}),[])}function p(e,t){return l.und(e)||l.nul(e)?t:e}function d(e){return l.und(e)?[]:l.arr(e)?e:[e]}function b(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return l.fun(e)?e.apply(void 0,n):e}function m(e){var t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,c(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(l.und(t))return o({to:t},e);var n=Object.keys(e).reduce((function(n,r){var c;return l.und(t[r])?o({},n,((c={})[r]=e[r],c)):n}),{});return o({to:t},n)}var h,v,g=function(){function e(){this.payload=void 0,this.children=[]}var t=e.prototype;return t.getAnimatedValue=function(){return this.getValue()},t.getPayload=function(){return this.payload||this},t.attach=function(){},t.detach=function(){},t.getChildren=function(){return this.children},t.addChild=function(e){0===this.children.length&&this.attach(),this.children.push(e)},t.removeChild=function(e){var t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()},e}(),y=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload=[],t.attach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.addChild(s(t))}))},t.detach=function(){return t.payload.forEach((function(e){return e instanceof g&&e.removeChild(s(t))}))},t}return u(t,e),t}(g),O=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).payload={},t.attach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&e.addChild(s(t))}))},t.detach=function(){return Object.values(t.payload).forEach((function(e){return e instanceof g&&e.removeChild(s(t))}))},t}u(t,e);var n=t.prototype;return n.getValue=function(e){void 0===e&&(e=!1);var t={};for(var n in this.payload){var r=this.payload[n];(!e||r instanceof g)&&(t[n]=r instanceof g?r[e?"getAnimatedValue":"getValue"]():r)}return t},n.getAnimatedValue=function(){return this.getValue(!0)},t}(g);function j(e,t){h={fn:e,transform:t}}function w(e){v=e}var k,E=function(e){return"undefined"!=typeof window?window.requestAnimationFrame(e):-1},_=function(e){"undefined"!=typeof window&&window.cancelAnimationFrame(e)};function x(e){k=e}var P,R=function(){return Date.now()};function S(e){P=e}var C,T,N=function(e){return e.current};function A(e){C=e}var F=Object.freeze({get applyAnimatedValues(){return h},injectApplyAnimatedValues:j,get colorNames(){return v},injectColorNames:w,get requestFrame(){return E},get cancelFrame(){return _},injectFrame:function(e,t){E=e,_=t},get interpolation(){return k},injectStringInterpolator:x,get now(){return R},injectNow:function(e){R=e},get defaultElement(){return P},injectDefaultElement:S,get animatedApi(){return N},injectAnimatedApi:function(e){N=e},get createAnimatedStyle(){return C},injectCreateAnimatedStyle:A,get manualFrameloop(){return T},injectManualFrameloop:function(e){T=e}}),D=function(e){function t(t,n){var r;return(r=e.call(this)||this).update=void 0,r.payload=t.style?o({},t,{style:C(t.style)}):t,r.update=n,r.attach(),r}return u(t,e),t}(O),M=!1,I=new Set,L=function e(){if(!M)return!1;var t=R(),n=I,r=Array.isArray(n),o=0;for(n=r?n:n[Symbol.iterator]();;){var c;if(r){if(o>=n.length)break;c=n[o++]}else{if((o=n.next()).done)break;c=o.value}for(var i=c,a=!1,u=0;u<i.configs.length;u++){for(var s=i.configs[u],l=void 0,f=void 0,p=0;p<s.animatedValues.length;p++){var d=s.animatedValues[p];if(!d.done){var b=s.fromValues[p],m=s.toValues[p],h=d.lastPosition,v=m instanceof g,y=Array.isArray(s.initialVelocity)?s.initialVelocity[p]:s.initialVelocity;if(v&&(m=m.getValue()),s.immediate)d.setValue(m),d.done=!0;else if("string"!=typeof b&&"string"!=typeof m){if(void 0!==s.duration)h=b+s.easing((t-d.startTime)/s.duration)*(m-b),l=t>=d.startTime+s.duration;else if(s.decay)h=b+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-d.startTime))),(l=Math.abs(d.lastPosition-h)<.1)&&(m=h);else{f=void 0!==d.lastTime?d.lastTime:t,y=void 0!==d.lastVelocity?d.lastVelocity:s.initialVelocity,t>f+64&&(f=t);for(var O=Math.floor(t-f),j=0;j<O;++j){h+=1*(y+=1*((-s.tension*(h-m)+-s.friction*y)/s.mass)/1e3)/1e3}var w=!(!s.clamp||0===s.tension)&&(b<m?h>m:h<m),k=Math.abs(y)<=s.precision,_=0===s.tension||Math.abs(m-h)<=s.precision;l=w||k&&_,d.lastVelocity=y,d.lastTime=t}v&&!s.toValues[p].done&&(l=!1),l?(d.value!==m&&(h=m),d.done=!0):a=!0,d.setValue(h),d.lastPosition=h}else d.setValue(m),d.done=!0}}i.props.onFrame&&(i.values[s.name]=s.interpolation.getValue())}i.props.onFrame&&i.props.onFrame(i.values),a||(I.delete(i),i.stop(!0))}return I.size?T?T():E(e):M=!1,M};function B(e,t,n){if("function"==typeof e)return e;if(Array.isArray(e))return B({range:e,output:t,extrapolate:n});if(k&&"string"==typeof e.output[0])return k(e);var r=e,o=r.output,c=r.range||[0,1],i=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",u=r.easing||function(e){return e};return function(e){var t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,c);return function(e,t,n,r,o,c,i,a,u){var s=u?u(e):e;if(s<t){if("identity"===i)return s;"clamp"===i&&(s=t)}if(s>n){if("identity"===a)return s;"clamp"===a&&(s=n)}if(r===o)return r;if(t===n)return e<=t?r:o;t===-1/0?s=-s:n===1/0?s-=t:s=(s-t)/(n-t);s=c(s),r===-1/0?s=-s:o===1/0?s+=r:s=s*(o-r)+r;return s}(e,c[t],c[t+1],o[t],o[t+1],u,i,a,r.map)}}var V=function(e){function t(n,r,o,c){var i;return(i=e.call(this)||this).calc=void 0,i.payload=n instanceof y&&!(n instanceof t)?n.getPayload():Array.isArray(n)?n:[n],i.calc=B(r,o,c),i}u(t,e);var n=t.prototype;return n.getValue=function(){return this.calc.apply(this,this.payload.map((function(e){return e.getValue()})))},n.updateConfig=function(e,t,n){this.calc=B(e,t,n)},n.interpolate=function(e,n,r){return new t(this,e,n,r)},t}(y);var q=function(e){function t(t){var n;return(n=e.call(this)||this).animatedStyles=new Set,n.value=void 0,n.startPosition=void 0,n.lastPosition=void 0,n.lastVelocity=void 0,n.startTime=void 0,n.lastTime=void 0,n.done=!1,n.setValue=function(e,t){void 0===t&&(t=!0),n.value=e,t&&n.flush()},n.value=t,n.startPosition=t,n.lastPosition=t,n}u(t,e);var n=t.prototype;return n.flush=function(){0===this.animatedStyles.size&&function e(t,n){"update"in t?n.add(t):t.getChildren().forEach((function(t){return e(t,n)}))}(this,this.animatedStyles),this.animatedStyles.forEach((function(e){return e.update()}))},n.clearStyles=function(){this.animatedStyles.clear()},n.getValue=function(){return this.value},n.interpolate=function(e,t,n){return new V(this,e,t,n)},t}(g),z=function(e){function t(t){var n;return(n=e.call(this)||this).payload=t.map((function(e){return new q(e)})),n}u(t,e);var n=t.prototype;return n.setValue=function(e,t){var n=this;void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((function(e,r){return n.payload[r].setValue(e,t)})):this.payload.forEach((function(n){return n.setValue(e,t)}))},n.getValue=function(){return this.payload.map((function(e){return e.getValue()}))},n.interpolate=function(e,t){return new V(this,e,t)},t}(y),H=0,W=function(){function e(){var e=this;this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=function(){return e.interpolations},this.id=H++}var t=e.prototype;return t.update=function(e){if(!e)return this;var t=m(e),n=t.delay,r=void 0===n?0:n,i=t.to,a=c(t,["delay","to"]);if(l.arr(i)||l.fun(i))this.queue.push(o({},a,{delay:r,to:i}));else if(i){var u={};Object.entries(i).forEach((function(e){var t,n=e[0],c=e[1],i=o({to:(t={},t[n]=c,t),delay:b(r,n)},a),s=u[i.delay]&&u[i.delay].to;u[i.delay]=o({},u[i.delay],i,{to:o({},s,i.to)})})),this.queue=Object.values(u)}return this.queue=this.queue.sort((function(e,t){return e.delay-t.delay})),this.diff(a),this},t.start=function(e){var t,n=this;if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((function(e){var t=e.from,r=void 0===t?{}:t,c=e.to,i=void 0===c?{}:c;l.obj(r)&&(n.merged=o({},r,n.merged)),l.obj(i)&&(n.merged=o({},n.merged,i))}));var r=this.local=++this.guid,i=this.localQueue=this.queue;this.queue=[],i.forEach((function(t,o){var a=t.delay,u=c(t,["delay"]),s=function(t){o===i.length-1&&r===n.guid&&t&&(n.idle=!0,n.props.onRest&&n.props.onRest(n.merged)),e&&e()},f=l.arr(u.to)||l.fun(u.to);a?setTimeout((function(){r===n.guid&&(f?n.runAsync(u,s):n.diff(u).start(s))}),a):f?n.runAsync(u,s):n.diff(u).start(s)}))}else l.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),t=this,I.has(t)||I.add(t),M||(M=!0,E(T||L));return this},t.stop=function(e){return this.listeners.forEach((function(t){return t(e)})),this.listeners=[],this},t.pause=function(e){var t;return this.stop(!0),e&&(t=this,I.has(t)&&I.delete(t)),this},t.runAsync=function(e,t){var n=this,r=(e.delay,c(e,["delay"])),i=this.local,a=Promise.resolve(void 0);if(l.arr(r.to))for(var u=function(e){var t=e,c=o({},r,m(r.to[t]));l.arr(c.config)&&(c.config=c.config[t]),a=a.then((function(){if(i===n.guid)return new Promise((function(e){return n.diff(c).start(e)}))}))},s=0;s<r.to.length;s++)u(s);else if(l.fun(r.to)){var f,p=0;a=a.then((function(){return r.to((function(e){var t=o({},r,m(e));if(l.arr(t.config)&&(t.config=t.config[p]),p++,i===n.guid)return f=new Promise((function(e){return n.diff(t).start(e)}))}),(function(e){return void 0===e&&(e=!0),n.stop(e)})).then((function(){return f}))}))}a.then(t)},t.diff=function(e){var t=this;this.props=o({},this.props,e);var n=this.props,r=n.from,c=void 0===r?{}:r,i=n.to,a=void 0===i?{}:i,u=n.config,s=void 0===u?{}:u,f=n.reverse,m=n.attach,h=n.reset,g=n.immediate;if(f){var y=[a,c];c=y[0],a=y[1]}this.merged=o({},c,this.merged,a),this.hasChanged=!1;var O=m&&m(this);if(this.animations=Object.entries(this.merged).reduce((function(e,n){var r=n[0],i=n[1],a=e[r]||{},u=l.num(i),f=l.str(i)&&!i.startsWith("#")&&!/\d/.test(i)&&!v[i],m=l.arr(i),y=!u&&!m&&!f,j=l.und(c[r])?i:c[r],w=u||m||f?i:1,E=b(s,r);O&&(w=O.animations[r].parent);var _,x=a.parent,P=a.interpolation,S=d(O?w.getPayload():w),C=i;y&&(C=k({range:[0,1],output:[i,i]})(1));var T,N=P&&P.getValue(),A=!l.und(x)&&a.animatedValues.some((function(e){return!e.done})),F=!l.equ(C,N),D=!l.equ(C,a.previous),M=!l.equ(E,a.config);if(h||D&&F||M){var I;if(u||f)x=P=a.parent||new q(j);else if(m)x=P=a.parent||new z(j);else if(y){var L=a.interpolation&&a.interpolation.calc(a.parent.value);L=void 0===L||h?j:L,a.parent?(x=a.parent).setValue(0,!1):x=new q(0);var B={output:[L,i]};a.interpolation?(P=a.interpolation,a.interpolation.updateConfig(B)):P=x.interpolate(B)}return S=d(O?w.getPayload():w),_=d(x.getPayload()),h&&!y&&x.setValue(j,!1),t.hasChanged=!0,_.forEach((function(e){e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=A?e.lastVelocity:void 0,e.lastTime=A?e.lastTime:void 0,e.startTime=R(),e.done=!1,e.animatedStyles.clear()})),b(g,r)&&x.setValue(y?w:i,!1),o({},e,((I={})[r]=o({},a,{name:r,parent:x,interpolation:P,animatedValues:_,toValues:S,previous:C,config:E,fromValues:d(x.getValue()),immediate:b(g,r),initialVelocity:p(E.velocity,0),clamp:p(E.clamp,!1),precision:p(E.precision,.01),tension:p(E.tension,170),friction:p(E.friction,26),mass:p(E.mass,1),duration:E.duration,easing:p(E.easing,(function(e){return e})),decay:E.decay}),I))}return F?e:(y&&(x.setValue(1,!1),P.updateConfig({output:[C,C]})),x.done=!0,t.hasChanged=!0,o({},e,((T={})[r]=o({},e[r],{previous:C}),T)))}),this.animations),this.hasChanged)for(var j in this.configs=Object.values(this.animations),this.values={},this.interpolations={},this.animations)this.interpolations[j]=this.animations[j].interpolation,this.values[j]=this.animations[j].interpolation.getValue();return this},t.destroy=function(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0},e}(),U=function(e,t){var n=i.useRef(!1),r=i.useRef(),o=l.fun(t),c=i.useMemo((function(){var n;return r.current&&(r.current.map((function(e){return e.destroy()})),r.current=void 0),[new Array(e).fill().map((function(e,r){var c=new W,i=o?b(t,r,c):t[r];return 0===r&&(n=i.ref),c.update(i),n||c.start(),c})),n]}),[e]),a=c[0],u=c[1];r.current=a;i.useImperativeHandle(u,(function(){return{start:function(){return Promise.all(r.current.map((function(e){return new Promise((function(t){return e.start(t)}))})))},stop:function(e){return r.current.forEach((function(t){return t.stop(e)}))},get controllers(){return r.current}}}));var s=i.useMemo((function(){return function(e){return r.current.map((function(t,n){t.update(o?b(e,n,t):e[n]),u||t.start()}))}}),[e]);i.useEffect((function(){n.current?o||s(t):u||r.current.forEach((function(e){return e.start()}))})),i.useEffect((function(){return n.current=!0,function(){return r.current.forEach((function(e){return e.destroy()}))}}),[]);var f=r.current.map((function(e){return e.getValues()}));return o?[f,s,function(e){return r.current.forEach((function(t){return t.pause(e)}))}]:f},G=0,K=function(e,t){return("function"==typeof t?e.map(t):d(t)).map(String)},Q=function(e){var t=e.items,n=e.keys,r=void 0===n?function(e){return e}:n,i=c(e,["items","keys"]);return t=d(void 0!==t?t:null),o({items:t,keys:K(t,r)},i)};function Y(e,t){var n=function(){if(o){if(c>=r.length)return"break";i=r[c++]}else{if((c=r.next()).done)return"break";i=c.value}var n=i.key,a=function(e){return e.key!==n};(l.und(t)||t===n)&&(e.current.instances.delete(n),e.current.transitions=e.current.transitions.filter(a),e.current.deleted=e.current.deleted.filter(a))},r=e.current.deleted,o=Array.isArray(r),c=0;for(r=o?r:r[Symbol.iterator]();;){var i;if("break"===n())break}e.current.forceUpdate()}var $=function(e){function t(t){var n;return void 0===t&&(t={}),n=e.call(this)||this,!t.transform||t.transform instanceof g||(t=h.transform(t)),n.payload=t,n}return u(t,e),t}(O),J={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Z="[-+]?\\d*\\.?\\d+";function X(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var ee=new RegExp("rgb"+X(Z,Z,Z)),te=new RegExp("rgba"+X(Z,Z,Z,Z)),ne=new RegExp("hsl"+X(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),re=new RegExp("hsla"+X(Z,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",Z)),oe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ce=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ie=/^#([0-9a-fA-F]{6})$/,ae=/^#([0-9a-fA-F]{8})$/;function ue(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function se(e,t,n){var r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,c=ue(o,r,e+1/3),i=ue(o,r,e),a=ue(o,r,e-1/3);return Math.round(255*c)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function le(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function fe(e){return(parseFloat(e)%360+360)%360/360}function pe(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function de(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function be(e){var t,n,r="number"==typeof(t=e)?t>>>0===t&&t>=0&&t<=4294967295?t:null:(n=ie.exec(t))?parseInt(n[1]+"ff",16)>>>0:J.hasOwnProperty(t)?J[t]:(n=ee.exec(t))?(le(n[1])<<24|le(n[2])<<16|le(n[3])<<8|255)>>>0:(n=te.exec(t))?(le(n[1])<<24|le(n[2])<<16|le(n[3])<<8|pe(n[4]))>>>0:(n=oe.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0:(n=ae.exec(t))?parseInt(n[1],16)>>>0:(n=ce.exec(t))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0:(n=ne.exec(t))?(255|se(fe(n[1]),de(n[2]),de(n[3])))>>>0:(n=re.exec(t))?(se(fe(n[1]),de(n[2]),de(n[3]))|pe(n[4]))>>>0:null;return null===r?e:"rgba("+((4278190080&(r=r||0))>>>24)+", "+((16711680&r)>>>16)+", "+((65280&r)>>>8)+", "+(255&r)/255+")"}var me=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,he=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ve=new RegExp("("+Object.keys(J).join("|")+")","g"),ge={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ye=["Webkit","Ms","Moz","O"];function Oe(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ge.hasOwnProperty(e)&&ge[e]?(""+t).trim():t+"px"}ge=Object.keys(ge).reduce((function(e,t){return ye.forEach((function(n){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(n,t)]=e[t]})),e}),ge);var je={};A((function(e){return new $(e)})),S("div"),x((function(e){var t=e.output.map((function(e){return e.replace(he,be)})).map((function(e){return e.replace(ve,be)})),n=t[0].match(me).map((function(){return[]}));t.forEach((function(e){e.match(me).forEach((function(e,t){return n[t].push(+e)}))}));var r=t[0].match(me).map((function(t,r){return B(o({},e,{output:n[r]}))}));return function(e){var n=0;return t[0].replace(me,(function(){return r[n++](e)})).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(function(e,t,n,r,o){return"rgba("+Math.round(t)+", "+Math.round(n)+", "+Math.round(r)+", "+o+")"}))}})),w(J),j((function(e,t){if(!e.nodeType||void 0===e.setAttribute)return!1;var n=t.style,r=t.children,o=t.scrollTop,i=t.scrollLeft,a=c(t,["style","children","scrollTop","scrollLeft"]),u="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;for(var s in void 0!==o&&(e.scrollTop=o),void 0!==i&&(e.scrollLeft=i),void 0!==r&&(e.textContent=r),n)if(n.hasOwnProperty(s)){var l=0===s.indexOf("--"),f=Oe(s,n[s],l);"float"===s&&(s="cssFloat"),l?e.style.setProperty(s,f):e.style[s]=f}for(var p in a){var d=u?p:je[p]||(je[p]=p.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})));void 0!==e.getAttribute(d)&&e.setAttribute(d,a[p])}}),(function(e){return e}));var we,ke,Ee=(we=function(e){return i.forwardRef((function(t,n){var r=f(),u=i.useRef(!0),s=i.useRef(null),p=i.useRef(null),d=i.useCallback((function(e){var t=s.current;s.current=new D(e,(function(){var e=!1;p.current&&(e=h.fn(p.current,s.current.getAnimatedValue())),p.current&&!1!==e||r()})),t&&t.detach()}),[]);i.useEffect((function(){return function(){u.current=!1,s.current&&s.current.detach()}}),[]),i.useImperativeHandle(n,(function(){return N(p,u,r)})),d(t);var b,m=s.current.getValue(),v=(m.scrollTop,m.scrollLeft,c(m,["scrollTop","scrollLeft"])),g=(b=e,!l.fun(b)||b.prototype instanceof a.Component?function(e){return p.current=function(e,t){return t&&(l.fun(t)?t(e):l.obj(t)&&(t.current=e)),e}(e,n)}:void 0);return a.createElement(e,o({},v,{ref:g}))}))},void 0===(ke=!1)&&(ke=!0),function(e){return(l.arr(e)?e:Object.keys(e)).reduce((function(e,t){var n=ke?t[0].toLowerCase()+t.substring(1):t;return e[n]=we(n),e}),we)}),_e=Ee(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);t.apply=Ee,t.config={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},t.update=L,t.animated=_e,t.a=_e,t.interpolate=function(e,t,n){return e&&new V(e,t,n)},t.Globals=F,t.useSpring=function(e){var t=l.fun(e),n=U(1,t?e:[e]),r=n[0],o=n[1],c=n[2];return t?[r[0],o,c]:r},t.useTrail=function(e,t){var n=i.useRef(!1),r=l.fun(t),c=b(t),a=i.useRef(),u=U(e,(function(e,t){return 0===e&&(a.current=[]),a.current.push(t),o({},c,{config:b(c.config,e),attach:e>0&&function(){return a.current[e-1]}})})),s=u[0],f=u[1],p=u[2],d=i.useMemo((function(){return function(e){return f((function(t,n){e.reverse;var r=e.reverse?t+1:t-1,i=a.current[r];return o({},e,{config:b(e.config||c.config,t),attach:i&&function(){return i}})}))}}),[e,c.reverse]);return i.useEffect((function(){n.current&&!r&&d(t)})),i.useEffect((function(){n.current=!0}),[]),r?[s,d,p]:s},t.useTransition=function(e,t,n){var r=o({items:e,keys:t||function(e){return e}},n),a=Q(r),u=a.lazy,s=void 0!==u&&u,l=(a.unique,a.reset),p=void 0!==l&&l,d=(a.enter,a.leave,a.update,a.onDestroyed),m=(a.keys,a.items,a.onFrame),h=a.onRest,v=a.onStart,g=a.ref,y=c(a,["lazy","unique","reset","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","ref"]),O=f(),j=i.useRef(!1),w=i.useRef({mounted:!1,first:!0,deleted:[],current:{},transitions:[],prevProps:{},paused:!!r.ref,instances:!j.current&&new Map,forceUpdate:O});return i.useImperativeHandle(r.ref,(function(){return{start:function(){return Promise.all(Array.from(w.current.instances).map((function(e){var t=e[1];return new Promise((function(e){return t.start(e)}))})))},stop:function(e){return Array.from(w.current.instances).forEach((function(t){return t[1].stop(e)}))},get controllers(){return Array.from(w.current.instances).map((function(e){return e[1]}))}}})),w.current=function(e,t){var n=e.first,r=e.prevProps,i=c(e,["first","prevProps"]),a=Q(t),u=a.items,s=a.keys,l=a.initial,f=a.from,p=a.enter,d=a.leave,m=a.update,h=a.trail,v=void 0===h?0:h,g=a.unique,y=a.config,O=a.order,j=void 0===O?["enter","leave","update"]:O,w=Q(r),k=w.keys,E=w.items,_=o({},i.current),x=[].concat(i.deleted),P=Object.keys(_),R=new Set(P),S=new Set(s),C=s.filter((function(e){return!R.has(e)})),T=i.transitions.filter((function(e){return!e.destroyed&&!S.has(e.originalKey)})).map((function(e){return e.originalKey})),N=s.filter((function(e){return R.has(e)})),A=-v;for(;j.length;){switch(j.shift()){case"enter":C.forEach((function(e,t){g&&x.find((function(t){return t.originalKey===e}))&&(x=x.filter((function(t){return t.originalKey!==e})));var r=s.indexOf(e),o=u[r],c=n&&void 0!==l?"initial":"enter";_[e]={slot:c,originalKey:e,key:g?String(e):G++,item:o,trail:A+=v,config:b(y,o,c),from:b(n&&void 0!==l?l||{}:f,o),to:b(p,o)}}));break;case"leave":T.forEach((function(e){var t=k.indexOf(e),n=E[t];x.unshift(o({},_[e],{slot:"leave",destroyed:!0,left:k[Math.max(0,t-1)],right:k[Math.min(k.length,t+1)],trail:A+=v,config:b(y,n,"leave"),to:b(d,n)})),delete _[e]}));break;case"update":N.forEach((function(e){var t=s.indexOf(e),n=u[t];_[e]=o({},_[e],{item:n,slot:"update",trail:A+=v,config:b(y,n,"update"),to:b(m,n)})}))}}var F=s.map((function(e){return _[e]}));return x.forEach((function(e){var t,n=e.left,r=(e.right,c(e,["left","right"]));-1!==(t=F.findIndex((function(e){return e.originalKey===n})))&&(t+=1),t=Math.max(0,t),F=[].concat(F.slice(0,t),[r],F.slice(t))})),o({},i,{changed:C.length||T.length||N.length,first:n&&0===C.length,transitions:F,current:_,deleted:x,prevProps:t})}(w.current,r),w.current.changed&&w.current.transitions.forEach((function(e){var t=e.slot,n=e.from,r=e.to,c=e.config,i=e.trail,a=e.key,u=e.item;w.current.instances.has(a)||w.current.instances.set(a,new W);var l=w.current.instances.get(a),f=o({},y,{to:r,from:n,config:c,ref:g,onRest:function(n){w.current.mounted&&(e.destroyed&&(g||s||Y(w,a),d&&d(u)),!Array.from(w.current.instances).some((function(e){return!e[1].idle}))&&(g||s)&&w.current.deleted.length>0&&Y(w),h&&h(u,t,n))},onStart:v&&function(){return v(u,t)},onFrame:m&&function(e){return m(u,t,e)},delay:i,reset:p&&"enter"===t});l.update(f),w.current.paused||l.start()})),i.useEffect((function(){return w.current.mounted=j.current=!0,function(){w.current.mounted=j.current=!1,Array.from(w.current.instances).map((function(e){return e[1].destroy()})),w.current.instances.clear()}}),[]),w.current.transitions.map((function(e){var t=e.item,n=e.slot,r=e.key;return{item:t,key:r,state:n,props:w.current.instances.get(r).getValues()}}))},t.useChain=function(e,t,n){void 0===n&&(n=1e3);var r=i.useRef();i.useEffect((function(){l.equ(e,r.current)?e.forEach((function(e){var t=e.current;return t&&t.start()})):t?e.forEach((function(e,r){var c=e.current;if(c){var i=c.controllers;if(i.length){var a=n*t[r];i.forEach((function(e){e.queue=e.queue.map((function(e){return o({},e,{delay:e.delay+a})})),e.start()}))}}})):e.reduce((function(e,t,n){var r=t.current;return e.then((function(){return r.start()}))}),Promise.resolve()),r.current=e}))},t.useSprings=U},function(e,t,n){"use strict";var r=n(6),o=n(17),c=n(0),i=n(4),a=n.n(i),u=n(8),s=n(57),l=n.n(s);function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),e}var b=n(69);function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(b.a)(e,t)}var h=n(20),v=n.n(h),g=n(14);function y(e,t){return!t||"object"!==v()(t)&&"function"!=typeof t?Object(g.a)(e):t}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var j=n(19),w=n(42),k=n(62),E=n(27),_=n(130),x=n(21);function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){Object(x.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function S(e,t,n,r,o,c,i){var a=t.width,u="rtl"===document.documentElement.dir;"left"===n&&u?n="right":"right"===n&&u&&(n="left"),"left"===r&&u?r="right":"right"===r&&u&&(r="left");var s=Math.round(e.left+e.width/2),l={popoverLeft:s,contentWidth:(s-a/2>0?a/2:s)+(s+a/2>window.innerWidth?window.innerWidth-s:a/2)},f=e.left;"right"===r?f=e.right:"middle"!==c&&(f=s);var p=e.right;"left"===r?p=e.left:"middle"!==c&&(p=s);var d,b={popoverLeft:f,contentWidth:f-a>0?a:f},m={popoverLeft:p,contentWidth:p+a>window.innerWidth?window.innerWidth-p:a},h=n,v=null;if(!o)if("center"===n&&l.contentWidth===a)h="center";else if("left"===n&&b.contentWidth===a)h="left";else if("right"===n&&m.contentWidth===a)h="right";else{var g="left"===(h=b.contentWidth>m.contentWidth?"left":"right")?b.contentWidth:m.contentWidth;v=g!==a?g:null}if(d="center"===h?l.popoverLeft:"left"===h?b.popoverLeft:m.popoverLeft,i){var y=i.getBoundingClientRect();d=Math.min(d,y.right-a)}return{xAxis:h,popoverLeft:d,contentWidth:v}}function C(e,t,n,r,o,c,i){var a=t.height;if(o){var u=(Object(w.getScrollContainer)(c)||document.body).getBoundingClientRect().top+a-i;if(e.top<=u)return{yAxis:n,popoverTop:Math.min(e.bottom,u)}}var s=e.top+e.height/2;"bottom"===r?s=e.bottom:"top"===r&&(s=e.top);var l={popoverTop:s,contentHeight:(s-a/2>0?a/2:s)+(s+a/2>window.innerHeight?window.innerHeight-s:a/2)},f={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a},d=n,b=null;if(!o)if("middle"===n&&l.contentHeight===a)d="middle";else if("top"===n&&f.contentHeight===a)d="top";else if("bottom"===n&&p.contentHeight===a)d="bottom";else{var m="top"===(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;b=m!==a?m:null}return{yAxis:d,popoverTop:"middle"===d?l.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:b}}var T=n(29);function N(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var A=Object(c.createContext)({focusHistory:[]}),F=A.Provider,D=A.Consumer;F.displayName="FocusReturnProvider",D.displayName="FocusReturnConsumer";c.Component;function M(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var I=Object(E.createHigherOrderComponent)((function e(t){if((r=t)instanceof c.Component||"function"==typeof r){var n=t;return e({})(n)}var r,o=t.onFocusReturn,i=void 0===o?u.stubTrue:o;return function(e){var t=function(t){m(r,t);var n=M(r);function r(){var e;return f(this,r),(e=n.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return d(r,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==i())for(var r,o=[].concat(Object(T.a)(u.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(T.a)(n)))),[e]);r=o.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(c.createElement)(e,this.props.childProps))}}]),r}(c.Component);return function(e){return Object(c.createElement)(D,null,(function(n){return Object(c.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn");function L(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var B=Object(E.createHigherOrderComponent)((function(e){return function(t){m(r,t);var n=L(r);function r(){var e;return f(this,r),(e=n.apply(this,arguments)).focusContainRef=Object(c.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(g.a)(e)),e}return d(r,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===k.TAB){var t=w.focus.tabbable.find(this.focusContainRef.current);if(t.length){var n=t[0],r=t[t.length-1];e.shiftKey&&e.target===n?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&t.includes(e.target)||(e.preventDefault(),n.focus())}}}},{key:"render",value:function(){return Object(c.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(c.createElement)(e,this.props))}}]),r}(c.Component)}),"withConstrainedTabbing");function V(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var q=["button","submit"];function z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var H=Object(E.createHigherOrderComponent)((function(e){return function(t){m(o,t);var n=V(o);function o(){var e;return f(this,o),(e=n.apply(this,arguments)).bindNode=e.bindNode.bind(Object(g.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(g.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(g.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(g.a)(e)),e}return d(o,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;Object(u.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(u.includes)(q,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(c.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(c.createElement)(e,Object(r.a)({ref:this.bindNode},this.props)))}}]),o}(c.Component)}),"withFocusOutside")(function(e){m(n,e);var t=z(n);function n(){return f(this,n),t.apply(this,arguments)}return d(n,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),n}(c.Component));function W(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,r=e.className,o=void 0===r?"lockscroll":r,i=0,a=0;function u(e){var t=n.scrollingElement||n.body;e&&(a=t.scrollTop);var r=e?"add":"remove";t.classList[r](o),n.documentElement.classList[r](o),e||(t.scrollTop=a)}function s(){0===i&&u(!0),++i}function l(){1===i&&u(!1),--i}return function(e){m(n,e);var t=W(n);function n(){return f(this,n),t.apply(this,arguments)}return d(n,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),n}(c.Component)}();function G(e){e.stopPropagation()}var K=Object(c.forwardRef)((function(e,t){var n=e.children,i=Object(o.a)(e,["children"]);return Object(c.createElement)("div",Object(r.a)({},i,{ref:t,onMouseDown:G}),n)})),Q=n(48);function Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(n),!0).forEach((function(t){Object(x.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function J(e){var t=Object(c.useContext)(Q.a),n=t.slots[e]||{},r=t.fills[e],o=Object(c.useMemo)((function(){return r||[]}),[r]),i=Object(c.useCallback)((function(n){t.updateSlot(e,n)}),[e,t.updateSlot]),a=Object(c.useCallback)((function(n){t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),u=Object(c.useCallback)((function(n){t.registerFill(e,n)}),[e,t.registerFill]),s=Object(c.useCallback)((function(n){t.unregisterFill(e,n)}),[e,t.unregisterFill]);return $($({},n),{},{updateSlot:i,unregisterSlot:a,fills:o,registerFill:u,unregisterFill:s})}function Z(e,t,n){return(Z="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=O(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}var X=n(59),ee=n(22),te=n.n(ee);function ne(e){var t=function(e,t){if("object"!==Object(X.a)(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Object(X.a)(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Object(X.a)(t)?t:String(t)}function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){Object(x.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ce(e){var t,n,r,i,a,u,s,l,f,p,d,b,m,h=e.children,v=(t=Object(c.useState)({}),n=Object(j.a)(t,2),r=n[0],i=n[1],a=Object(c.useState)({}),u=Object(j.a)(a,2),s=u[0],l=u[1],f=Object(c.useCallback)((function(e,t,n){i((function(r){var o=r[e]||{};return oe(oe({},r),{},Object(x.a)({},e,oe(oe({},o),{},{ref:t||o.ref,fillProps:n||o.fillProps||{}})))}))}),[]),p=Object(c.useCallback)((function(e,t){i((function(n){var r=n[e],c=Object(o.a)(n,[e].map(ne));return(null==r?void 0:r.ref)===t?c:n}))}),[]),d=Object(c.useCallback)((function(e,t){var n=r[e];if(n&&!te()(n.fillProps,t)){n.fillProps=t;var o=s[e];o&&o.map((function(e){return e.current.rerender()}))}}),[r,s]),b=Object(c.useCallback)((function(e,t){l((function(n){return oe(oe({},n),{},Object(x.a)({},e,[].concat(Object(T.a)(n[e]||[]),[t])))}))}),[]),m=Object(c.useCallback)((function(e,t){l((function(n){return n[e]?oe(oe({},n),{},Object(x.a)({},e,n[e].filter((function(e){return e!==t})))):n}))}),[]),Object(c.useMemo)((function(){return{slots:r,fills:s,registerSlot:f,updateSlot:d,unregisterSlot:p,registerFill:b,unregisterFill:m}}),[r,s,f,d,p,b,m]));return Object(c.createElement)(Q.a.Provider,{value:v},h)}function ie(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var ae=Object(c.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),ue=ae.Provider,se=ae.Consumer;c.Component;function le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var fe=function(e){m(n,e);var t=le(n);function n(){var e;return f(this,n),(e=t.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(Object(g.a)(e)),e}return d(n,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,o=t.registerSlot;e.name!==n&&(r(e.name),o(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||Z(O(n.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,r=e.fillProps,o=void 0===r?{}:r,i=e.getFills,a=Object(u.map)(i(n,this),(function(e){var t=e.occurrence,n=Object(u.isFunction)(e.children)?e.children(o):e.children;return c.Children.map(n,(function(e,n){if(!e||Object(u.isString)(e))return e;var r="".concat(t,"---").concat(e.key||n);return Object(c.cloneElement)(e,{key:r})}))})).filter(Object(u.negate)(c.isEmptyElement));return Object(c.createElement)(c.Fragment,null,Object(u.isFunction)(t)?t(a):a)}}]),n}(c.Component),pe=function(e){return Object(c.createElement)(se,null,(function(t){var n=t.registerSlot,o=t.unregisterSlot,i=t.getFills;return Object(c.createElement)(fe,Object(r.a)({},e,{registerSlot:n,unregisterSlot:o,getFills:i}))}))},de=0;function be(e){var t=e.name,n=e.children,r=e.registerFill,o=e.unregisterFill,i=function(e){var t=Object(c.useContext)(ae),n=t.getSlot,r=t.subscribe,o=Object(c.useState)(n(e)),i=Object(j.a)(o,2),a=i[0],u=i[1];return Object(c.useEffect)((function(){return u(n(e)),r((function(){u(n(e))}))}),[e]),a}(t),a=Object(c.useRef)({name:t,children:n});return a.current.occurrence||(a.current.occurrence=++de),Object(c.useLayoutEffect)((function(){return r(t,a.current),function(){return o(t,a.current)}}),[]),Object(c.useLayoutEffect)((function(){a.current.children=n,i&&i.forceUpdate()}),[n]),Object(c.useLayoutEffect)((function(){t!==a.current.name&&(o(a.current.name,a.current),a.current.name=t,r(t,a.current))}),[t]),i&&i.node?(Object(u.isFunction)(n)&&(n=n(i.props.fillProps)),Object(c.createPortal)(n,i.node)):null}var me=function(e){return Object(c.createElement)(se,null,(function(t){var n=t.registerFill,o=t.unregisterFill;return Object(c.createElement)(be,Object(r.a)({},e,{registerFill:n,unregisterFill:o}))}))};function he(e){var t=e.name,n=e.fillProps,i=void 0===n?{}:n,a=e.as,u=void 0===a?"div":a,s=Object(o.a)(e,["name","fillProps","as"]),l=Object(c.useContext)(Q.a),f=Object(c.useRef)();return Object(c.useLayoutEffect)((function(){return l.registerSlot(t,f,i),function(){l.unregisterSlot(t,f)}}),[l.registerSlot,l.unregisterSlot,t]),Object(c.useLayoutEffect)((function(){l.updateSlot(t,i)})),Object(c.createElement)(u,Object(r.a)({ref:f},s))}function ve(e){var t,n,r=e.name,o=e.children,i=J(r),a=Object(c.useRef)({rerender:(t=Object(c.useState)({}),n=Object(j.a)(t,2)[1],function(){return n({})})});return Object(c.useEffect)((function(){return i.registerFill(a),function(){i.unregisterFill(a)}}),[i.registerFill,i.unregisterFill]),i.ref&&i.ref.current?("function"==typeof o&&(o=o(i.fillProps)),Object(c.createPortal)(o,i.ref.current)):null}function ge(e){var t=e.bubblesVirtually,n=Object(o.a)(e,["bubblesVirtually"]);return t?Object(c.createElement)(he,n):Object(c.createElement)(pe,n)}function ye(e){return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(me,e),Object(c.createElement)(ve,e))}function Oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oe(Object(n),!0).forEach((function(t){Object(x.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function we(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var o,c=r.split(" "),i=Object(j.a)(c,2),u=i[0],s=i[1],l=void 0===s?"center":s;return a()("components-animate__appear",(o={},Object(x.a)(o,"is-from-"+l,"center"!==l),Object(x.a)(o,"is-from-"+u,"middle"!==u),o))}return"slide-in"===t?a()("components-animate__slide-in","is-from-"+r):"loading"===t?a()("components-animate__loading"):void 0}function ke(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:we(je({type:t},r))})}var Ee=B(I((function(e){return e.children})));function _e(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),o=r.paddingTop,c=r.paddingBottom,i=r.paddingLeft,a=r.paddingRight,u=o?parseInt(o,10):0,s=c?parseInt(c,10):0,l=i?parseInt(i,10):0,f=a?parseInt(a,10):0;return{x:e.left+l,y:e.top+u,width:e.width-l-f,height:e.height-u-s,left:e.left+l,right:e.right-f,top:e.top+u,bottom:e.bottom-s}}function xe(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function Pe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function Re(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var Se=function(e){var t=e.headerTitle,n=e.onClose,i=e.onKeyDown,u=e.children,s=e.className,f=e.noArrow,p=void 0===f||f,d=e.isAlternate,b=e.position,m=void 0===b?"bottom right":b,h=(e.range,e.focusOnMount),v=void 0===h?"firstElement":h,g=e.anchorRef,y=e.shouldAnchorIncludePadding,O=e.anchorRect,x=e.getAnchorRect,P=e.expandOnMobile,T=e.animate,N=void 0===T||T,A=e.onClickOutside,F=e.onFocusOutside,D=e.__unstableSticky,M=e.__unstableSlotName,I=void 0===M?"Popover":M,L=e.__unstableObserveElement,B=e.__unstableBoundaryParent,V=Object(o.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),q=Object(c.useRef)(null),z=Object(c.useRef)(null),W=Object(c.useRef)(),G=Object(E.useViewportMatch)("medium","<"),Q=Object(c.useState)(),Y=Object(j.a)(Q,2),$=Y[0],Z=Y[1],X=J(I),ee=P&&G,te=Object(E.useResizeObserver)(),ne=Object(j.a)(te,2),re=ne[0],oe=ne[1];p=ee||p,Object(c.useLayoutEffect)((function(){if(ee)return Re(W.current,"is-without-arrow",p),Re(W.current,"is-alternate",d),xe(W.current,"data-x-axis"),xe(W.current,"data-y-axis"),Pe(W.current,"top"),Pe(W.current,"left"),Pe(z.current,"maxHeight"),void Pe(z.current,"maxWidth");var e=function(){if(W.current&&z.current){var e=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return Object(w.getRectangleFromRange)(r);if(r instanceof window.Element){var c=r.getBoundingClientRect();return o?c:_e(c,r)}var i=r.top,a=r.bottom,u=i.getBoundingClientRect(),s=a.getBoundingClientRect(),l=new window.DOMRect(u.left,u.top,u.width,s.bottom-u.top);return o?l:_e(l,r)}if(e.current){var f=e.current.parentNode,p=f.getBoundingClientRect();return o?p:_e(p,f)}}(q,O,x,g,y);if(e){var t,n,r=W.current,o=r.offsetParent,c=r.ownerDocument,i=0;if(o&&o!==c.body){var a=o.getBoundingClientRect();i=a.top,e=new window.DOMRect(e.left-a.left,e.top-a.top,e.width,e.height)}if(B)t=null===(n=W.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode;var u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,a=n.split(" "),u=Object(j.a)(a,3),s=u[0],l=u[1],f=void 0===l?"center":l,p=u[2],d=C(e,t,s,p,r,o,c),b=S(e,t,f,p,r,d.yAxis,i);return R(R({},b),d)}(e,oe.height?oe:z.current.getBoundingClientRect(),m,D,W.current,i,t),s=u.popoverTop,l=u.popoverLeft,f=u.xAxis,b=u.yAxis,h=u.contentHeight,v=u.contentWidth;"number"==typeof s&&"number"==typeof l&&(Pe(W.current,"top",s+"px"),Pe(W.current,"left",l+"px")),Re(W.current,"is-without-arrow",p||"center"===f&&"middle"===b),Re(W.current,"is-alternate",d),xe(W.current,"data-x-axis",f),xe(W.current,"data-y-axis",b),Pe(z.current,"maxHeight","number"==typeof h?h+"px":""),Pe(z.current,"maxWidth","number"==typeof v?v+"px":"");Z(({left:"right",right:"left"}[f]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),L&&(n=new window.MutationObserver(e)).observe(L,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[ee,O,x,g,y,m,oe,D,L,B]),function(e,t){Object(c.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=w.focus.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(v,z);var ce=function(e){e.keyCode===k.ESCAPE&&n&&(e.stopPropagation(),n()),i&&i(e)};var ie=Object(c.createElement)(H,{onFocusOutside:function(e){if(F)F(e);else if(A){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),l()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),A(t)}else n&&n()}},Object(c.createElement)(ke,{type:N&&$?"appear":null,options:{origin:$}},(function(e){var o=e.className;return Object(c.createElement)(K,Object(r.a)({className:a()("components-popover",s,o,{"is-expanded":ee,"is-without-arrow":p,"is-alternate":d})},V,{onKeyDown:ce,ref:W}),ee&&Object(c.createElement)(U,null),ee&&Object(c.createElement)("div",{className:"components-popover__header"},Object(c.createElement)("span",{className:"components-popover__header-title"},t),Object(c.createElement)(Le,{className:"components-popover__close",icon:_.a,onClick:n})),Object(c.createElement)("div",{ref:z,className:"components-popover__content",tabIndex:"-1"},Object(c.createElement)("div",{style:{position:"relative"}},re,u)))})));return v&&(ie=Object(c.createElement)(Ee,null,ie)),X.ref&&(ie=Object(c.createElement)(ye,{name:I},ie)),g||O?ie:Object(c.createElement)("span",{ref:q},ie)};Se.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(c.createElement)(ge,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var Ce=Se;var Te=function(e){var t,n,r=e.shortcut,o=e.className;return r?(Object(u.isString)(r)&&(t=r),Object(u.isObject)(r)&&(t=r.display,n=r.ariaLabel),Object(c.createElement)("span",{className:o,"aria-label":n},t)):null};function Ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}var Ae=function(e){m(n,e);var t=Ne(n);function n(){var e;return f(this,n),(e=t.apply(this,arguments)).delayedSetIsOver=Object(u.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return d(n,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var n=this.props.children;if(1===c.Children.count(n)){var r=c.Children.only(n);"function"==typeof r.props[e]&&r.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var o=Object(u.includes)(["focus","mouseenter"],r.type);o!==n.state.isOver&&(t?n.delayedSetIsOver(o):n.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.position,r=e.text,o=e.shortcut;if(1!==c.Children.count(t))return t;var i=c.Children.only(t),a=this.state.isOver;return Object(c.cloneElement)(i,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Object(c.concatChildren)(i.props.children,a&&Object(c.createElement)(Ce,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(c.createElement)(Te,{className:"components-tooltip__shortcut",shortcut:o})))})}}]),n}(c.Component),Fe=n(86);function De(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Me(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,i=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,c=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw c}}}}function Me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ie=["onMouseDown","onClick"];var Le=t.a=Object(c.forwardRef)((function(e,t){var n=e.href,i=e.target,s=e.isPrimary,f=e.isSmall,p=e.isTertiary,d=e.isPressed,b=e.isBusy,m=e.isDefault,h=e.isSecondary,v=e.isLink,g=e.isDestructive,y=e.className,O=e.disabled,j=e.icon,w=e.iconSize,k=e.showTooltip,E=e.tooltipPosition,_=e.shortcut,x=e.label,P=e.children,R=e.__experimentalIsFocusable,S=Object(o.a)(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);m&&l()("Button isDefault prop",{alternative:"isSecondary"});var C=a()("components-button",y,{"is-secondary":m||h,"is-primary":s,"is-small":f,"is-tertiary":p,"is-pressed":d,"is-busy":b,"is-link":v,"is-destructive":g,"has-text":!!j&&!!P,"has-icon":!!j}),T=O&&!R,N=void 0===n||T?"button":"a",A="a"===N?{href:n,target:i}:{type:"button",disabled:T,"aria-pressed":d};if(O&&R){A["aria-disabled"]=!0;var F,D=De(Ie);try{for(D.s();!(F=D.n()).done;){S[F.value]=function(e){e.stopPropagation(),e.preventDefault()}}}catch(e){D.e(e)}finally{D.f()}}var M=!T&&(k&&x||_||!!x&&(!P||Object(u.isArray)(P)&&!P.length)&&!1!==k),I=Object(c.createElement)(N,Object(r.a)({},A,S,{className:C,"aria-label":S["aria-label"]||x,ref:t}),j&&Object(c.createElement)(Fe.a,{icon:j,size:w}),P);return M?Object(c.createElement)(Ae,{text:x,shortcut:_,position:E},I):I}))},function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},,function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,o,c=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return c}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(21),o=n(6),c=n(17),i=n(0),a=n(28);var u=function(e){var t=e.icon,n=e.className,r=Object(c.a)(e,["icon","className"]),a=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" ");return Object(i.createElement)("span",Object(o.a)({className:a},r))};function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.icon,n=void 0===t?null:t,r=e.size,s=Object(c.a)(e,["icon","size"]);if("string"==typeof n)return Object(i.createElement)(u,Object(o.a)({icon:n},s));if(n&&u===n.type)return Object(i.cloneElement)(n,l({},s));var f=r||24;if("function"==typeof n)return n.prototype instanceof i.Component?Object(i.createElement)(n,l({size:f},s)):n(l({size:f},s));if(n&&("svg"===n.type||n.type===a.SVG)){var p=l(l({width:f,height:f},n.props),s);return Object(i.createElement)(a.SVG,p)}return Object(i.isValidElement)(n)?Object(i.cloneElement)(n,l({size:f},s)):n}},function(e,t){!function(){e.exports=this.wp.autop}()},,function(e,t){var n,r,o=e.exports={};function c(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===c||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:c}catch(e){n=c}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var u,s=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?s=u.concat(s):f=-1,s.length&&d())}function d(){if(!l){var e=a(p);l=!0;for(var t=s.length;t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function b(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new b(e,t)),1!==s.length||l||a(d)},b.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";(function(e){var r=n(0),o=n(8),c=n(4),i=n.n(c),a=n(36),u=n(1),s=(n(66),n(80));t.a=Object(r.forwardRef)((function(t,n){var c=t.className,l=t.children,f=t.spokenMessage,p=void 0===f?l:f,d=t.politeness,b=void 0===d?"polite":d,m=t.actions,h=void 0===m?[]:m,v=t.onRemove,g=void 0===v?o.noop:v;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(a.speak)(n,t)}),[n,t])}(p,b),Object(r.useEffect)((function(){var e=setTimeout((function(){g()}),1e4);return function(){return clearTimeout(e)}}),[]);var y=i()(c,"components-snackbar");return h&&h.length>1&&(void 0!==e&&e.env,h=[h[0]]),Object(r.createElement)("div",{ref:n,className:y,onClick:g,tabIndex:"0",role:"button",onKeyPress:g,"aria-label":Object(u.__)("Dismiss this notice")},Object(r.createElement)("div",{className:"components-snackbar__content"},l,h.map((function(e,t){var n=e.label,o=e.onClick,c=e.url;return Object(r.createElement)(s.a,{key:t,href:c,isTertiary:!0,onClick:function(e){e.stopPropagation(),o&&o(e)},className:"components-snackbar__action"},n)}))))}))}).call(this,n(89))},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),o=n.n(r),c=function(e){return e.reduce((function(e,t){var n=o()(t,2),r=n[0],c=n[1];return e[r]=c,e}),{})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return m}));var r=n(9),o=n.n(r),c=n(15),i=n(12),a=n(0),u=n(22),s=n.n(u),l=n(54),f=n(107),p=n(61),d=function(e){var t=Object(p.a)();e=e||t;var n=Object(i.useSelect)((function(t){return t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),r=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[n,Object(a.useCallback)((function(t){r(e,t)}),[e,r])]},b=function(e,t,n){var r=Object(p.a)();n=n||r;var o=Object(i.useSelect)((function(r){return r(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t)}),[n,e]),u=Object(i.useDispatch)(c.QUERY_STATE_STORE_KEY).setQueryValue;return[o,Object(a.useCallback)((function(t){u(n,e,t)}),[n,e,u])]},m=function(e,t){var n=Object(p.a)(),r=d(t=t||n),c=o()(r,2),i=c[0],u=c[1],b=Object(l.a)(i),m=Object(l.a)(e),h=Object(f.a)(m),v=Object(a.useRef)(!1);return Object(a.useEffect)((function(){s()(h,m)||(u(Object.assign({},b,m)),v.current=!0)}),[b,m,h,u]),v.current?[i,u]:[e,u]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(9),o=n.n(r),c=n(0),i=function(){var e=Object(c.useState)(),t=o()(e,2)[1];return Object(c.useCallback)((function(e){t((function(){throw e}))}),[])}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return u}));var r=n(5),o=n(76),c=n(70),i=function(e){var t=e.country,n=void 0===t?"":t,r=e.state,o=void 0===r?"":r,c=e.city,i=void 0===c?"":c,a=e.postcode,u=void 0===a?"":a;return{country:n.trim(),state:o.trim(),city:i.trim(),postcode:u?u.replace(" ","").toUpperCase():""}},a=function(e){var t=e.email,n=void 0===t?"":t;return Object(c.isEmail)(n)?n.trim():""},u=function(e){var t=Object.keys(r.defaultAddressFields),n=Object(o.a)(t,{},e.country),c=Object.assign({},e);return n.forEach((function(t){var n=t.key,r=void 0===n?"":n,o=t.hidden;void 0!==o&&o&&function(e,t){return e in t}(r,e)&&(c[r]="")})),c}},,,,,,,,,function(e,t){!function(){e.exports=this.wp.wordcount}()},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2);function o(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},,,,,function(e,t,n){"use strict";var r=n(6),o=n(0),c=n(8);var i=function(e,t){return function(n){var r=e(n),o=n.displayName,i=void 0===o?n.name||"Component":o;return r.displayName="".concat(Object(c.upperFirst)(Object(c.camelCase)(t)),"(").concat(i,")"),r}},a=new WeakMap;function u(e,t){return Object(o.useMemo)((function(){var n=function(e){var t=a.get(e)||0;return a.set(e,t+1),t}(e);return t?"".concat(t,"-").concat(n):n}),[e])}t.a=i((function(e){return function(t){var n=u(e);return Object(o.createElement)(e,Object(r.a)({},t,{instanceId:n}))}}),"withInstanceId")},,,function(e,t,n){"use strict";var r=n(10),o=n.n(r),c=n(32),i=n.n(c),a=n(33),u=n.n(a),s=n(23),l=n.n(s),f=n(34),p=n.n(f),d=n(35),b=n.n(d),m=n(25),h=n.n(m),v=n(7),g=n.n(v),y=n(2);n(140);function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h()(e);if(t){var o=h()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return b()(this,n)}}t.a=function(e){var t=function(t){p()(r,t);var n=O(r);function r(){var e;return i()(this,r),e=n.call(this),g()(l()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),g()(l()(e),"moveFocusToTop",(function(t){var n=e.scrollPointRef.current.parentElement.querySelectorAll(t);n.length&&n[0].focus()})),g()(l()(e),"scrollToTop",(function(t){window&&Number.isFinite(window.innerHeight)&&(e.scrollToTopIfNeeded(),t&&t.focusableSelector&&e.moveFocusToTop(t.focusableSelector))})),e.scrollPointRef=Object(y.createRef)(),e}return u()(r,[{key:"render",value:function(){return React.createElement(React.Fragment,null,React.createElement("div",{className:"with-scroll-to-top__scroll-point",ref:this.scrollPointRef,"aria-hidden":!0}),React.createElement(e,o()({},this.props,{scrollToTop:this.scrollToTop})))}}]),r}(y.Component);return t.displayName="withScrollToTop",t}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(10),o=n.n(r),c=n(7),i=n.n(c),a=n(0),u=n(44);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=[".wp-block-woocommerce-cart"],p=function(e){var t=e.Block,n=e.containers,r=e.getProps,c=void 0===r?function(){}:r,i=e.getErrorBoundaryProps,s=void 0===i?function(){}:i;0!==n.length&&Array.prototype.forEach.call(n,(function(e,n){var r=c(e,n),i=s(e,n),f=l(l({},e.dataset),r.attributes);e.classList.remove("is-loading"),Object(a.render)(React.createElement(u.a,i,React.createElement(a.Suspense,{fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(t,o()({},r,{attributes:f})))),e)}))},d=function(e){var t=e.Block,n=e.getProps,r=e.getErrorBoundaryProps,o=e.selector,c=e.wrappers,i=document.body.querySelectorAll(o);c.length>0&&Array.prototype.filter.call(i,(function(e){return!function(e,t){return Array.prototype.some.call(t,(function(t){return t.contains(e)&&!t.isSameNode(e)}))}(e,c)})),p({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})},b=function(e){var t=document.body.querySelectorAll(f.join(","));d(l(l({},e),{},{wrappers:t})),Array.prototype.forEach.call(t,(function(t){t.addEventListener("wc-blocks_render_blocks_frontend",(function(){var n,r,o,c,i,a;n=l(l({},e),{},{wrapper:t}),r=n.Block,o=n.getProps,c=n.getErrorBoundaryProps,i=n.selector,a=n.wrapper.querySelectorAll(i),p({Block:r,containers:a,getProps:o,getErrorBoundaryProps:c})}))}))}},function(e,t){},function(e,t,n){var r=n(64);e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){"use strict";n.d(t,"b",(function(){return A})),n.d(t,"a",(function(){return F}));var r=n(7),o=n.n(r),c=n(9),i=n.n(c),a=(n(3),n(0)),u=n(12),s=n(56),l=n(46),f=n(10),p=n.n(f),d=n(4),b=n.n(d),m=n(168),h=(n(120),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-success";case"info":case"warning":return"woocommerce-info"}return""}),v=function(e){var t=e.className,n=e.notices,r=e.removeNotice,o=n.filter((function(e){return"snackbar"!==e.type}));if(!o.length)return null;var c=b()(t,"wc-block-components-notices");return React.createElement("div",{className:c},o.map((function(e){return React.createElement(m.a,p()({key:"store-notice-"+e.id},e,{className:b()("wc-block-components-notices__notice","woocommerce-message",h(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)})))},g=n(6),y=n(26),O=n.n(y);function j(e,t,n,r,o,c,i){try{var a=e[c](i),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function w(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var c=e.apply(t,n);function i(e){j(c,r,o,i,a,"next",e)}function a(e){j(c,r,o,i,a,"throw",e)}i(void 0)}))}}var k=n(19),E=n(8),_=n(79),x=n(27),P=n(90);var R=function(e){var t=e.notices,n=e.className,r=e.children,o=e.onRemove,c=void 0===o?E.noop:o,i=Object(x.useReducedMotion)(),u=Object(a.useState)((function(){return new WeakMap})),s=Object(k.a)(u,1)[0],l=Object(_.useTransition)(t,(function(e){return e.id}),{from:{opacity:0,height:0},enter:function(e){return function(){var t=w(O.a.mark((function t(n){return O.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n({opacity:1,height:s.get(e).offsetHeight});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},leave:function(){return function(){var e=w(O.a.mark((function e(t){return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t({opacity:0});case 2:return e.next=4,t({height:0});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},immediate:i});n=b()("components-snackbar-list",n);var f=function(e){return function(){return c(e.id)}};return Object(a.createElement)("div",{className:n},r,l.map((function(e){var t=e.item,n=e.key,r=e.props;return Object(a.createElement)(_.animated.div,{key:n,style:r},Object(a.createElement)("div",{className:"components-snackbar-list__notice-container",ref:function(e){return e&&s.set(t,e)}},Object(a.createElement)(P.a,Object(g.a)({},Object(E.omit)(t,["content"]),{onRemove:f(t)}),t.content)))})))},S=function(e){var t=e.className,n=e.notices,r=e.removeNotice;if(e.isEditor)return null;var o=n.filter((function(e){return"snackbar"===e.type})),c=b()(t,"wc-block-components-notices__snackbar");return React.createElement(R,{notices:o,className:c,onRemove:r})};function C(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 T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var N=Object(a.createContext)({notices:[],createNotice:function(e,t,n){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),A=function(){return Object(a.useContext)(N)},F=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,o=e.createNoticeContainer,c=void 0===o||o,f=e.context,p=void 0===f?"wc/core":f,d=Object(u.useDispatch)("core/notices"),b=d.createNotice,m=d.removeNotice,h=Object(a.useState)(!1),g=i()(h,2),y=g[0],O=g[1],j=Object(s.a)().dispatchStoreEvent,w=Object(l.a)().isEditor,k=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};b(e,t,T(T({},n),{},{context:n.context||p})),j("store-notice-create",{status:e,content:t,options:n})}),[b,j,p]),E=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),_=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k("default",e,T(T({},t),{},{type:"snackbar"}))}),[k]),x={notices:Object(u.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:k,createSnackbarNotice:_,removeNotice:E,context:p,setIsSuppressed:O},P=y?null:React.createElement(v,{className:r,notices:x.notices,removeNotice:x.removeNotice,isEditor:w}),R=y?null:React.createElement(S,{notices:x.notices,removeNotice:x.removeNotice,isEditor:w});return React.createElement(N.Provider,{value:x},c&&P,t,R)}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(15),o=n(12),c=n(0),i=n(54),a=n(95),u=function(e){var t=e.namespace,n=e.resourceName,u=e.resourceValues,s=void 0===u?[]:u,l=e.query,f=void 0===l?{}:l,p=e.shouldSelect,d=void 0===p||p;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");var b=Object(c.useRef)({results:[],isLoading:!0}),m=Object(i.a)(f),h=Object(i.a)(s),v=Object(a.a)(),g=Object(o.useSelect)((function(e){if(!d)return null;var o=e(r.COLLECTIONS_STORE_KEY),c=[t,n,m,h],i=o.getCollectionError.apply(o,c);return i&&v(i),{results:o.getCollection.apply(o,c),isLoading:!o.hasFinishedResolution("getCollection",c)}}),[t,n,h,m,d]);return null!==g&&(b.current=g),b.current}},,,,,function(e,t,n){"use strict";var r=n(0),o=n(28),c=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},,,,,,,,,function(e,t,n){"use strict";var r=n(7),o=n.n(r),c=n(16),i=n.n(c),a=n(0);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(15),c=n(12),i=n(13);t.a=function(e){return function(t){var n;return n=Object(r.useRef)(i.k.restApiRoutes||{}),Object(c.useSelect)((function(e,t){if(n.current){var r=e(o.SCHEMA_STORE_KEY),c=r.isResolving,i=r.hasFinishedResolution,a=t.dispatch(o.SCHEMA_STORE_KEY),u=a.receiveRoutes,s=a.startResolution,l=a.finishResolution;Object.keys(n.current).forEach((function(e){var t=n.current[e];c("getRoutes",[e])||i("getRoutes",[e])||(s("getRoutes",[e]),u(t,[e]),l("getRoutes",[e]))}))}}),[]),React.createElement(e,t)}}},,,,,,function(e,t,n){"use strict";n(3);var r=n(4),o=n.n(r),c=n(11),i=n(112);n(167);t.a=Object(i.a)((function(e){var t=e.className,n=e.instanceId,r=e.defaultValue,i=e.label,a=e.onChange,u=e.options,s=e.screenReaderLabel,l=e.readOnly,f=e.value,p="wc-block-components-sort-select__select-".concat(n);return React.createElement("div",{className:o()("wc-block-sort-select","wc-block-components-sort-select",t)},React.createElement(c.Label,{label:i,screenReaderLabel:s,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:p}}),React.createElement("select",{id:p,className:"wc-block-sort-select__select wc-block-components-sort-select__select",defaultValue:r,onChange:a,readOnly:l,value:f},u.map((function(e){return React.createElement("option",{key:e.key,value:e.key},e.label)}))))}))},,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(37),o=n(0),c=n(13);n.p=c.j,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)((function(){return Promise.all([n.e(20),n.e(6)]).then(n.bind(null,307))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)((function(){return n.e(5).then(n.bind(null,317))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)((function(){return n.e(13).then(n.bind(null,316))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)((function(){return n.e(7).then(n.bind(null,308))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)((function(){return n.e(3).then(n.bind(null,309))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)((function(){return n.e(11).then(n.bind(null,310))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)((function(){return n.e(8).then(n.bind(null,294))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)((function(){return n.e(9).then(n.bind(null,311))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)((function(){return n.e(4).then(n.bind(null,312))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)((function(){return n.e(12).then(n.bind(null,313))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)((function(){return n.e(10).then(n.bind(null,314))}))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)((function(){return n.e(2).then(n.bind(null,315))}))});var i=function(e){return Object(r.getRegisteredBlockComponents)(e)}},,,,,,,,,,function(e,t){},function(e,t,n){"use strict";var r=n(0),o=n(8),c=n(4),i=n.n(c),a=n(1),u=n(36),s=n(130),l=n(80);t.a=function(e){var t=e.className,n=e.status,c=void 0===n?"info":n,f=e.children,p=e.spokenMessage,d=void 0===p?f:p,b=e.onRemove,m=void 0===b?o.noop:b,h=e.isDismissible,v=void 0===h||h,g=e.actions,y=void 0===g?[]:g,O=e.politeness,j=void 0===O?function(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}(c):O,w=e.__unstableHTML;!function(e,t){var n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)((function(){n&&Object(u.speak)(n,t)}),[n,t])}(d,j);var k=i()(t,"components-notice","is-"+c,{"is-dismissible":v});return w&&(f=Object(r.createElement)(r.RawHTML,null,f)),Object(r.createElement)("div",{className:k},Object(r.createElement)("div",{className:"components-notice__content"},f,y.map((function(e,t){var n=e.className,o=e.label,c=e.isPrimary,a=e.noDefaultClasses,u=void 0!==a&&a,s=e.onClick,f=e.url;return Object(r.createElement)(l.a,{key:t,href:f,isPrimary:c,isSecondary:!u&&!f,isLink:!u&&!!f,onClick:f?void 0:s,className:i()("components-notice__action",n)},o)}))),v&&Object(r.createElement)(l.a,{className:"components-notice__dismiss",icon:s.a,label:Object(a.__)("Dismiss this notice"),onClick:m,showTooltip:!1}))}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){!function(){e.exports=this.wc.wcSharedHocs}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t){!function(){e.exports=this.wp.components}()},,,,,,,,,,,,,function(e,t,n){e.exports=n(276)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(141),o=n(123),c=n(119),i=n(32),a=n.n(i),u=n(33),s=n.n(u),l=n(34),f=n.n(l),p=n(35),d=n.n(p),b=n(25),m=n.n(b),h=n(2),v=(n(3),n(9)),g=n.n(v),y=n(0),O=n(16),j=n.n(O),w=n(7),k=n.n(w),E=n(1),_=n(8),x=n(4),P=n.n(x),R=n(11),S=(n(226),function(e){var t=e.currentPage,n=e.displayFirstAndLastPages,r=e.displayNextAndPreviousArrows,o=e.pagesToDisplay,c=e.onPageChange,i=e.totalPages,a=function(e,t,n){if(n<=2)return{minIndex:null,maxIndex:null};var r=e-1,o=Math.max(Math.floor(t-r/2),2),c=Math.min(Math.ceil(t+(r-(t-o))),n-1);return{minIndex:Math.max(Math.floor(t-(r-(c-t))),2),maxIndex:c}}(o,t,i),u=a.minIndex,s=a.maxIndex,l=n&&Boolean(1!==u),f=n&&Boolean(s!==i),p=n&&Boolean(u>3),d=n&&Boolean(s<i-2);l&&3===u&&(u-=1),f&&s===i-2&&(s+=1);var b=[];if(u&&s)for(var m=u;m<=s;m++)b.push(m);return React.createElement("div",{className:"wc-block-pagination wc-block-components-pagination"},React.createElement(R.Label,{screenReaderLabel:Object(E.__)("Navigate to another page","woo-gutenberg-products-block")}),r&&React.createElement("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return c(t-1)},title:Object(E.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},React.createElement(R.Label,{label:"<",screenReaderLabel:Object(E.__)("Previous page","woo-gutenberg-products-block")})),l&&React.createElement("button",{className:P()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:function(){return c(1)},disabled:1===t},React.createElement(R.Label,{label:1,screenReaderLabel:Object(E.sprintf)(Object(E.__)("Page %d","woo-gutenberg-products-block"),1)})),p&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(E.__)("…","woo-gutenberg-products-block")),b.map((function(e){return React.createElement("button",{key:e,className:P()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?null:function(){return c(e)},disabled:t===e},React.createElement(R.Label,{label:e,screenReaderLabel:Object(E.sprintf)(Object(E.__)("Page %d","woo-gutenberg-products-block"),e)}))})),d&&React.createElement("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(E.__)("…","woo-gutenberg-products-block")),f&&React.createElement("button",{className:P()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===i,"wc-block-components-pagination__page--active":t===i}),onClick:function(){return c(i)},disabled:t===i},React.createElement(R.Label,{label:i,screenReaderLabel:Object(E.sprintf)(Object(E.__)("Page %d","woo-gutenberg-products-block"),i)})),r&&React.createElement("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return c(t+1)},title:Object(E.__)("Next page","woo-gutenberg-products-block"),disabled:t>=i},React.createElement(R.Label,{label:">",screenReaderLabel:Object(E.__)("Next page","woo-gutenberg-products-block")})))});S.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var C=S,T=n(107),N=n(94),A=n(125),F=n(15),D=n(12),M=n(54);function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var B=function(e){var t={namespace:"/wc/store",resourceName:"products"},n=Object(A.a)(L(L({},t),{},{query:e})),r=n.results,o=n.isLoading,c=function(e,t){var n=t.namespace,r=t.resourceName,o=t.resourceValues,c=void 0===o?[]:o,i=t.query,a=void 0===i?{}:i;if(!n||!r)throw new Error("The options object must have valid values for the namespace and the resource name properties.");var u=Object(M.a)(a),s=Object(M.a)(c),l=Object(D.useSelect)((function(t){var o=t(F.COLLECTIONS_STORE_KEY),c=[e,n,r,u,s];return{value:o.getCollectionHeader.apply(o,c),isLoading:o.hasFinishedResolution("getCollectionHeader",c)}}),[e,n,r,s,u]),f=l.value,p=l.isLoading;return{value:f,isLoading:void 0===p||p}}("x-wp-total",L(L({},t),{},{query:e})).value;return{products:r,totalProducts:parseInt(c,10),productsLoading:o}},V=n(56),q=n(115),z=n(81),H=n(36),W=n(139),U=n(28),G=React.createElement(U.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},React.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})),K=function(){var e=Object(z.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(e,"__no-products")},React.createElement(W.a,{className:"".concat(e,"__no-products-image"),alt:"",srcElement:G,size:100}),React.createElement("strong",{className:"".concat(e,"__no-products-title")},Object(E.__)("No products","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(e,"__no-products-description")},Object(E.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},Q=React.createElement(U.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),React.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})),Y=function(e){var t=e.resetCallback,n=void 0===t?function(){}:t,r=Object(z.useInnerBlockLayoutContext)().parentClassName;return React.createElement("div",{className:"".concat(r,"__no-products")},React.createElement(W.a,{className:"".concat(r,"__no-products-image"),alt:"",srcElement:Q,size:100}),React.createElement("strong",{className:"".concat(r,"__no-products-title")},Object(E.__)("No products found","woo-gutenberg-products-block")),React.createElement("p",{className:"".concat(r,"__no-products-description")},Object(E.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),React.createElement("button",{onClick:n},Object(E.__)("Reset Search","woo-gutenberg-products-block")))},$=n(147),J=(n(225),function(e){var t=e.defaultValue,n=e.onChange,r=e.readOnly,o=e.value;return React.createElement($.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",defaultValue:t,name:"orderby",onChange:n,options:[{key:"menu_order",label:Object(E.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(E.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(E.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(E.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(E.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(E.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(E.__)("Order products by","woo-gutenberg-products-block"),value:o})}),Z=n(112),X=n(10),ee=n.n(X),te=n(157),ne=Object(Z.a)((function(e){var t=e.product,n=e.attributes,r=e.instanceId,o=n.layoutConfig,c=Object(z.useInnerBlockLayoutContext)(),i=c.parentClassName,a=c.parentName,u=0===Object.keys(t).length,s=P()("".concat(i,"__product"),"wc-block-layout",{"is-loading":u});return React.createElement("li",{className:s,"aria-hidden":u},function e(t,n,r,o){if(r){var c=Object(te.a)(t);return r.map((function(r,i){var a=g()(r,2),u=a[0],s=a[1],l=void 0===s?{}:s,f=[];l.children&&l.children.length>0&&(f=e(t,n,l.children,o));var p=c[u];if(!p)return null;var d=n.id||0,b=["layout",u,i,o,d];return React.createElement(y.Suspense,{key:b.join("_"),fallback:React.createElement("div",{className:"wc-block-placeholder"})},React.createElement(p,ee()({},l,{children:f,product:n})))}))}}(a,t,o,r))}));n(224);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(_.isEqual)(t,o)&&Number.isFinite(n)},ie=Object(q.a)((function(e){var t=e.attributes,n=e.currentPage,r=e.onPageChange,o=e.onSortChange,c=e.sortValue,i=e.scrollToTop,a=e.hideOutOfStockItems,u=void 0!==a&&a,s=Object(N.c)(function(e){var t=e.sortValue,n=e.currentPage,r=e.attributes,o=e.hideOutOfStockItems,c=r.columns,i=r.rows;return 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:c*i,page:n},o&&{stock_status:["instock","onbackorder"]})}({attributes:t,sortValue:c,currentPage:n,hideOutOfStockItems:u})),l=g()(s,1)[0],f=B(l),p=f.products,d=f.totalProducts,b=f.productsLoading,m=Object(z.useInnerBlockLayoutContext)(),h=m.parentClassName,v=m.parentName,O=function(e){e.order,e.orderby,e.page,e.per_page;return j()(e,["order","orderby","page","per_page"])||{}}(l),w=Object(V.a)().dispatchStoreEvent,k=Object(N.b)("attributes",[]),x=g()(k,2),R=x[0],S=x[1],A=Object(N.b)("min_price"),F=g()(A,2),D=F[0],M=F[1],I=Object(N.b)("max_price"),L=g()(I,2),q=L[0],W=L[1],U=Object(T.a)({totalQuery:O,totalProducts:d},ce);Object(y.useEffect)((function(){w("product-list-render",{products:p,listName:v})}),[p,v,w]),Object(y.useEffect)((function(){Object(_.isEqual)(O,null==U?void 0:U.totalQuery)||(r(1),null!=U&&U.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(H.speak)(Object(E.__)("No products found","woo-gutenberg-products-block")):Object(H.speak)(Object(E.sprintf)(Object(E._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(d))}),[null==U?void 0:U.totalQuery,d,r,O]);var G,Q,$,Z,X,ee=t.contentVisibility,te=t.columns*t.rows,re=!Number.isFinite(d)&&Number.isFinite(null==U?void 0:U.totalProducts)&&Object(_.isEqual)(O,null==U?void 0:U.totalQuery)?Math.ceil(U.totalProducts/te):Math.ceil(d/te),ie=p.length?p:Array.from({length:te}),ae=0!==p.length||b,ue=R.length>0||Number.isFinite(D)||Number.isFinite(q);return React.createElement("div",{className:(G=t.columns,Q=t.rows,$=t.alignButtons,Z=t.align,X=void 0!==Z?"align"+Z:"",P()(h,X,"has-"+G+"-columns",{"has-multiple-rows":Q>1,"has-aligned-buttons":$}))},ee.orderBy&&ae&&React.createElement(J,{onChange:o,value:c}),!ae&&ue&&React.createElement(Y,{resetCallback:function(){S([]),M(null),W(null)}}),!ae&&!ue&&React.createElement(K,null),ae&&React.createElement("ul",{className:"".concat(h,"__products")},ie.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})}))),re>1&&React.createElement(C,{currentPage:n,onPageChange:function(e){i({focusableSelector:"a, button"}),r(e)},totalPages:re}))})),ae=function(e){var t=e.attributes,n=e.hideOutOfStockItems,r=void 0!==n&&n,o=Object(y.useState)(1),c=g()(o,2),i=c[0],a=c[1],u=Object(y.useState)(t.orderby),s=g()(u,2),l=s[0],f=s[1];Object(y.useEffect)((function(){f(t.orderby)}),[t.orderby]);return React.createElement(ie,{attributes:t,hideOutOfStockItems:r,currentPage:i,onPageChange:function(e){a(e)},onSortChange:function(e){var t=e.target.value;f(t),a(1)},sortValue:l})},ue=n(13),se=React.createElement("img",{src:ue.i+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}}),le=n(5);function fe(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 pe=function(e){f()(n,e);var t=fe(n);function n(){return a()(this,n),t.apply(this,arguments)}return s()(n,[{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.urlParameterSuffix;if(t.isPreview)return se;var r=Object(le.getSetting)("hideOutOfStockItems",!1);return React.createElement(z.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},React.createElement(ae,{attributes:t,urlParameterSuffix:n,hideOutOfStockItems:r}))}}]),n}(h.Component);Object(c.a)({selector:".wp-block-woocommerce-all-products",Block:Object(r.a)((function(e){return React.createElement(o.a,{context:"wc/all-products"},React.createElement(pe,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' => '661a37ecead80dcaaf32e4d10bd9ed9a');
1
+ <?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wc-blocks-checkout', '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-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => 'fd745edceeff0ed74f36a7ecc10d395d');
build/all-products.js CHANGED
@@ -1 +1 @@
1
- this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-products"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],u=t[2],b=0,p=[];b<i.length;b++)a=i[b],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&p.push(c[a][0]),c[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(l&&l(t);p.length;)p.shift()();return o.push.apply(o,u||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,i=1;i<r.length;i++){var s=r[i];0!==c[s]&&(n=!1)}n&&(o.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},c={6:0,1:0,3:0,4:0,9:0,10:0,12:0,13:0,14:0,15:0,16:0,17:0},o=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.e=function(e){var t=[],r=c[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=c[e]=[t,n]}));t.push(r[2]=n);var o,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({1:"atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b",2:"atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title",3:"atomic-block-components/add-to-cart--atomic-block-components/button",4:"atomic-block-components/sale-badge",8:"atomic-block-components/add-to-cart",9:"atomic-block-components/button",10:"atomic-block-components/category-list",11:"atomic-block-components/image",12:"atomic-block-components/price",13:"atomic-block-components/rating",14:"atomic-block-components/sku",15:"atomic-block-components/stock-indicator",16:"atomic-block-components/summary",17:"atomic-block-components/tag-list",18:"atomic-block-components/title"}[e]||e)+".js"}(e);var s=new Error;o=function(t){i.onerror=i.onload=null,clearTimeout(u);var r=c[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",s.name="ChunkLoadError",s.type=n,s.request=o,r[1](s)}c[e]=void 0}};var u=setTimeout((function(){o({type:"timeout",target:i})}),12e4);i.onerror=i.onload=o,document.head.appendChild(i)}return Promise.all(t)},a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a.oe=function(e){throw console.error(e),e};var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var u=0;u<i.length;u++)t(i[u]);var l=s;return o.push([843,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";var n=r(10),c=r.n(n),o=r(23),a=r.n(o),i=r(0),s=r(221),u=r(7),l=r.n(u);r(225);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))}},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){},12:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},127:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(57),a=r(165),i=r(5),s=r(22),u=r(38);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}},136:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(13),a=r.n(o),i=r(5),s=r(1);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var b=Object(i.getSetting)("countryLocale",{}),p=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(s.sprintf)(Object(s.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(t.index=parseInt(e.priority,10)),!0===e.hidden&&(t.required=!1),t},d=Object.entries(b).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,p(n)]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==d[r]?d[r]:{};return e.map((function(e){var r=i.defaultAddressFields[e]||{},c=n[e]||{},o=t[e]||{};return l(l(l({key:e},r),c),o)})).sort((function(e,t){return e.index-t.index}))}},137:function(e,t){!function(){e.exports=this.wp.wordcount}()},138:function(e,t,r){"use strict";r.d(t,"b",(function(){return v})),r.d(t,"a",(function(){return h}));var n=r(40),c=r.n(n),o=r(4),a=r.n(o),i=r(23),s=r.n(i),u=r(13),l=r.n(u),b=r(0),p=r(6),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)}},139:function(e,t,r){"use strict";var n=r(30),c=r.n(n),o=r(10),a=r.n(o),i=r(0),s=r(1),u=r(6),l=(r(2),r(45)),b=r(3),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(9),E=r.n(w),_=r(142);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()(e);if(t){var c=E()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var P=Object(_.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"),C=r(285),S=r(28),N=r.n(S),x=r(11),D=r.n(x),B=r(4),R=r.n(B),A=r(12),T=r.n(A),z=r(33),L=r.n(z),V=r(35),I=r(37);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){R()(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()(e);if(t){var c=E()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var q=Object(_.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)),R()(D()(e),"state",{error:null,loading:!1,variations:{}}),R()(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(V.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),{},R()({},o,r)),loading:!1,error:null})})).catch(function(){var t=N()(T.a.mark((function t(r){var n;return T.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),{},R()({},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),{},R()({},o,null)),loading:!1,error:null})}}})),e}return g()(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.selected,r=e.showVariations;t&&r&&this.loadVariations()}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isLoading,n=t.selected;t.showVariations&&(!L()(e.selected,n)||e.isLoading&&!r)&&this.loadVariations()}},{key:"isProductId",value:function(e){return this.props.products.some((function(t){return t.id===e}))}},{key:"findParentProduct",value:function(e){return this.props.products.filter((function(t){return t.variations&&t.variations.find((function(t){return t.id===e}))}))[0].id}},{key:"getExpandedProduct",value:function(){var e=this.props,t=e.isLoading,r=e.selected;if(!e.showVariations)return null;var n=r&&r.length?r[0]:null;return n?this.prevSelectedItem=n:this.prevSelectedItem&&(t||this.isProductId(this.prevSelectedItem)||(n=this.prevSelectedItem)),!t&&n?this.isProductId(n)?n:this.findParentProduct(n):null}},{key:"render",value:function(){var t=this.props,r=t.error,n=t.isLoading,c=this.state,o=c.error,s=c.loading,u=c.variations;return Object(i.createElement)(e,a()({},this.props,{error:o||r,expandedProduct:this.getExpandedProduct(),isLoading:n,variations:u,variationsLoading:s}))}}]),n}(i.Component);return R()(t,"defaultProps",{selected:[],showVariations:!1}),t}),"withProductVariations"),G=r(57),Q=r(31),U=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"})),W=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(43);r(195);function Y(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)(G.a,{srcElement:U}):Object(i.createElement)(G.a,{srcElement:W})},$={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: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:$,isHierarchical:!0})};X.defaultProps={expandedProduct:null,selected:[],showVariations:!1};t.a=P(Object(C.a)(q(X)))},14:function(e,t,r){"use strict";r.d(t,"m",(function(){return o})),r.d(t,"k",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"h",(function(){return u})),r.d(t,"c",(function(){return l})),r.d(t,"d",(function(){return b})),r.d(t,"g",(function(){return p})),r.d(t,"f",(function(){return d})),r.d(t,"j",(function(){return f})),r.d(t,"i",(function(){return m})),r.d(t,"a",(function(){return O})),r.d(t,"b",(function(){return g})),r.d(t,"e",(function(){return j})),r.d(t,"p",(function(){return h})),r.d(t,"q",(function(){return y})),r.d(t,"n",(function(){return w})),r.d(t,"o",(function(){return E}));var n,c=r(5),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),a=o.pluginUrl+"assets/",i=o.pluginUrl+"build/",s=o.buildPhase,u=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,p=c.STORE_PAGES.privacy.permalink,d=c.STORE_PAGES.privacy.title,f=c.STORE_PAGES.terms.permalink,m=c.STORE_PAGES.terms.title,O=c.STORE_PAGES.cart.id,g=c.STORE_PAGES.cart.permalink,j=c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),v=r(25),h=function(e,t){if(s>2)return Object(v.registerBlockType)(e,t)},y=function(e,t){if(s>1)return Object(v.registerBlockType)(e,t)},w=function(){return s>2},E=function(){return s>1}},141: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},145:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(41),i=r(187);r(197);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)}))))}))},146:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(0),a=r(1),i=r(53),s=r(7),u=r.n(s),l=(r(2),r(153)),b=(r(223),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=e.regularPriceStyle,_=u()(r,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));var 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:E}):null!==O&&null!==f?P=Object(o.createElement)(b,{currency:n,maxPrice:f,minPrice:O,priceClassName:v,priceStyle:h}):null!==j&&(P=Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",v),currency:n,value:j,style:h})),Object(o.createElement)("span",{className:_},Object(l.a)(s,{price:P}))}},147:function(e,t,r){"use strict";var n=r(15),c=r.n(n),o=r(16),a=r.n(o),i=r(17),s=r.n(i),u=r(18),l=r.n(u),b=r(9),p=r.n(b),d=r(0),f=r(6),m=r(1),O=r(3);function g(e){var t=e.level,r={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return r.hasOwnProperty(t)?Object(d.createElement)(O.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(d.createElement)(O.Path,{d:r[t]})):null}function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=p()(e);if(t){var c=p()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return l()(this,r)}}var v=function(e){s()(r,e);var t=j(r);function r(){return c()(this,r),t.apply(this,arguments)}return a()(r,[{key:"createLevelControl",value:function(e,t,r){var n=e===t;return{icon:Object(d.createElement)(g,{level:e}),title:Object(m.sprintf)(Object(m.__)("Heading %d"),e),isActive:n,onClick:function(){return r(e)}}}},{key:"render",value:function(){var e=this,t=this.props,r=t.isCollapsed,n=void 0===r||r,c=t.minLevel,o=t.maxLevel,a=t.selectedLevel,i=t.onChange;return Object(d.createElement)(O.ToolbarGroup,{isCollapsed:n,icon:Object(d.createElement)(g,{level:a}),controls:Object(f.range)(c,o).map((function(t){return e.createLevelControl(t,a,i)}))})}}]),r}(d.Component);t.a=v},148:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n,c=r(4),o=r.n(c),a=r(6);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,i=t.callback,u=t.priority,b=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return b.set(a,{priority:u,callback:i}),s(s({},e),{},o()({},c,b));case n.REMOVE_EVENT_CALLBACK:return b.delete(a),s(s({},e),{},o()({},c,b))}}},150:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f})),r.d(t,"c",(function(){return m}));var n=r(13),c=r.n(n),o=r(36),a=r(21),i=r(0),s=r(33),u=r.n(s),l=r(74),b=r(166),p=r(82),d=function(e){var t=Object(p.a)();e=e||t;var r=Object(a.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(i.useCallback)((function(t){n(e,t)}),[e,n])]},f=function(e,t,r){var n=Object(p.a)();r=r||n;var c=Object(a.useSelect)((function(n){return n(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),s=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(i.useCallback)((function(t){s(r,e,t)}),[r,e,s])]},m=function(e,t){var r=Object(p.a)(),n=d(t=t||r),o=c()(n,2),a=o[0],s=o[1],f=Object(l.a)(a),m=Object(l.a)(e),O=Object(b.a)(m),g=Object(i.useRef)(!1);return Object(i.useEffect)((function(){u()(O,m)||(s(Object.assign({},f,m)),g.current=!0)}),[f,m,O,s]),g.current?[a,s]:[e,s]}},151:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(13),c=r.n(n),o=r(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},164:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(13),c=r.n(n),o=function(e){return e.reduce((function(e,t){var r=c()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{})}},165: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},166:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(8);function c(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},175:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(14),o=Object(n.createElement)("img",{src:c.k+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}})},176:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(23),a=r.n(o),i=r(0),s=(r(2),r(26)),u=r(7),l=r.n(u);r(222);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))}},177:function(e,t,r){"use strict";r.d(t,"b",(function(){return E})),r.d(t,"a",(function(){return _}));var n=r(4),c=r.n(n),o=r(13),a=r.n(o),i=r(0),s=(r(2),r(21)),u=r(85),l=r(75),b=r(10),p=r.n(b),d=r(7),f=r.n(d),m=r(936),O=(r(224),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-success";case"info":case"warning":return"woocommerce-info"}return""}),g=function(e){var t=e.className,r=e.notices,n=e.removeNotice,c=r.filter((function(e){return"snackbar"!==e.type}));if(!c.length)return null;var o=f()(t,"wc-block-components-notices");return Object(i.createElement)("div",{className:o},c.map((function(e){return Object(i.createElement)(m.a,p()({key:"store-notice-"+e.id},e,{className:f()("wc-block-components-notices__notice","woocommerce-message",O(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)})))},j=r(941),v=function(e){var t=e.className,r=e.notices,n=e.removeNotice;if(e.isEditor)return null;var c=r.filter((function(e){return"snackbar"===e.type})),o=f()(t,"wc-block-components-notices__snackbar");return Object(i.createElement)(j.a,{notices:c,className:o,onRemove:n})};function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var w=Object(i.createContext)({notices:[],createNotice:function(e,t,r){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),E=function(){return Object(i.useContext)(w)},_=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,c=e.createNoticeContainer,o=void 0===c||c,b=e.context,p=void 0===b?"wc/core":b,d=Object(s.useDispatch)("core/notices"),f=d.createNotice,m=d.removeNotice,O=Object(i.useState)(!1),j=a()(O,2),h=j[0],E=j[1],_=Object(u.a)().dispatchStoreEvent,k=Object(l.b)().isEditor,P=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};f(e,t,y(y({},r),{},{context:r.context||p})),_("store-notice-create",{status:e,content:t,options:r})}),[f,_,p]),C=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),S=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};P("default",e,y(y({},t),{},{type:"snackbar"}))}),[P]),N={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:P,createSnackbarNotice:S,removeNotice:C,context:p,setIsSuppressed:E},x=h?null:Object(i.createElement)(g,{className:n,notices:N.notices,removeNotice:N.removeNotice,isEditor:k}),D=h?null:Object(i.createElement)(v,{notices:N.notices,removeNotice:N.removeNotice,isEditor:k});return Object(i.createElement)(w.Provider,{value:N},o&&x,t,D)}},178:function(e,t,r){"use strict";var n=r(0),c=r(137),o=r(96),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)}},182:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(15),a=r.n(o),i=r(16),s=r.n(i),u=r(11),l=r.n(u),b=r(17),p=r.n(b),d=r(18),f=r.n(d),m=r(9),O=r.n(m),g=r(4),j=r.n(g),v=r(0),h=r(8);r(248);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}},185:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return a}));var n=r(5),c=r(136),o=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,c=void 0===n?"":n,o=e.city,a=void 0===o?"":o,i=e.postcode,s=void 0===i?"":i;return{country:r.trim(),state:c.trim(),city:a.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},a=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(c.a)(t,{},e.country),o=Object.assign({},e);return r.forEach((function(e){e.hidden&&(o[e.key]="")})),o}},189:function(e,t){},19:function(e,t){!function(){e.exports=this.wp.apiFetch}()},195:function(e,t){},197:function(e,t){},199:function(e,t){!function(){e.exports=this.wp.warning}()},20:function(e,t){!function(){e.exports=this.wp.url}()},200:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(36),c=r(21),o=r(0),a=r(74),i=r(151),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}},21:function(e,t){!function(){e.exports=this.wp.data}()},22:function(e,t){!function(){e.exports=this.wp.blockEditor}()},222:function(e,t){},223:function(e,t){},224:function(e,t){},225:function(e,t){},226:function(e,t){},248:function(e,t){},25:function(e,t){!function(){e.exports=this.wp.blocks}()},26:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},27:function(e,t){!function(){e.exports=this.moment}()},285:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(28),a=r.n(o),i=r(15),s=r.n(i),u=r(16),l=r.n(u),b=r(11),p=r.n(b),d=r(17),f=r.n(d),m=r(18),O=r.n(m),g=r(9),j=r.n(g),v=r(0),h=r(12),y=r.n(h),w=r(6),E=r(142),_=(r(2),r(14)),k=r(35),P=r(37);function C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j()(e);if(t){var c=j()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return O()(this,r)}}var S=Object(E.a)((function(e){var t=function(t){f()(o,t);var r,n=C(o);function o(){var e;return s()(this,o),(e=n.apply(this,arguments)).state={list:[],loading:!0},e.setError=e.setError.bind(p()(e)),e.debouncedOnSearch=Object(w.debounce)(e.onSearch.bind(p()(e)),400),e}return l()(o,[{key:"componentDidMount",value:function(){var e=this,t=this.props.selected;Object(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:_.m.productCount>100?function(e){t.setState({loading:!0}),t.debouncedOnSearch(e)}:null}))}}]),o}(v.Component);return t.defaultProps={selected:[]},t}),"withSearchedProducts");t.a=S},286:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(7),s=r.n(i),u=r(41),l=r(38),b=r(69);r(547);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")}))}))},287:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(138)),o=(r(226),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.wp.components}()},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}()},35:function(e,t,r){"use strict";r.d(t,"h",(function(){return d})),r.d(t,"e",(function(){return f})),r.d(t,"b",(function(){return m})),r.d(t,"i",(function(){return O})),r.d(t,"f",(function(){return g})),r.d(t,"c",(function(){return j})),r.d(t,"d",(function(){return v})),r.d(t,"g",(function(){return h})),r.d(t,"a",(function(){return y}));var n=r(4),c=r.n(n),o=r(20),a=r(19),i=r.n(a),s=r(6),u=r(5),l=r(14);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,u=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,i=void 0===a?[]:a,s=l.m.productCount>100,u={per_page:s?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},b=[Object(o.addQueryArgs)("/wc/store/products",p(p({},u),i))];return s&&r.length&&b.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r})),b}({selected:r,search:c,queryArgs:void 0===a?[]:a});return Promise.all(u.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return p(p({},e),{},{parent:0})}))})).catch((function(e){throw e}))},f=function(e){return i()({path:"/wc/store/products/".concat(e)})},m=function(){return i()({path:"wc/store/products/attributes"})},O=function(e){return i()({path:"wc/store/products/attributes/".concat(e,"/terms")})},g=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(u.getSetting)("limitTags",!1),a=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&a.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),a}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")}))},j=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products/categories",p({per_page:0},e))})},v=function(e){return i()({path:"wc/store/products/categories/".concat(e)})},h=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},y=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},353: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){!function(){e.exports=this.wc.wcBlocksData}()},37:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u}));var n=r(28),c=r.n(n),o=r(12),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")}},38:function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},385:function(e,t){},386:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(14);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s={headingLevel:{type:"number",default:2},productLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(o.o)()&&(s=i(i({},s),{},{align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}})),t.a=s},387:function(e,t,r){"use strict";t.a={productLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}}},388:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(4),a=r.n(o),i=r(13),s=r.n(i),u=r(0),l=(r(2),r(1)),b=r(7),p=r.n(b),d=r(5),f=r(38),m=r(69),O=r(85),g=r(286);r(548);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var h=function(){return Object(u.createElement)("img",{src:d.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500})},y=function(e){var t=e.image,r=e.onLoad,n=e.loaded,o=e.showFullSize,a=e.fallbackAlt,i=t||{},s=i.thumbnail,l=i.src,b=i.srcset,p=i.sizes,d=v({alt:i.alt||a,onLoad:r,hidden:!n,src:s},o&&{src:l,srcSet:b,sizes:p});return Object(u.createElement)(u.Fragment,null,d.src&&Object(u.createElement)("img",c()({"data-testid":"product-image"},d)),!n&&Object(u.createElement)(h,null))};t.a=Object(m.withProductDataContext)((function(e){var t=e.className,r=e.imageSizing,n=void 0===r?"full-size":r,c=e.productLink,o=void 0===c||c,i=e.showSaleBadge,b=e.saleBadgeAlign,d=void 0===b?"right":b,m=Object(f.useInnerBlockLayoutContext)().parentClassName,j=Object(f.useProductDataContext)().product,w=Object(u.useState)(!1),E=s()(w,2),_=E[0],k=E[1],P=Object(O.a)().dispatchStoreEvent;if(!j.id)return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(h,null));var C=!!j.images.length,S=C?j.images[0]:null,N=o?"a":u.Fragment,x=Object(l.sprintf)(Object(l.__)("Link to %s","woo-gutenberg-products-block"),j.name),D=v(v({href:j.permalink,rel:"nofollow"},!C&&{"aria-label":x}),{},{onClick:function(){P("product-view-link",{product:j})}});return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(N,o&&D,!!i&&Object(u.createElement)(g.default,{align:d,product:j}),Object(u.createElement)(y,{fallbackAlt:j.name,image:S,onLoad:function(){return k(!0)},loaded:_,showFullSize:"cropped"!==n})))}))},389:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(148),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))}}}},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(7)),o=r.n(c),a=r(13),i=r.n(a),s=r(1),u=r(74),l=r(925),b="pristine",p="idle",d="disabled",f="processing",m="before_processing",O="after_processing",g={status:b,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},j="set_pristine",v="set_idle",h="set_disabled",y="set_processing",w="set_before_processing",E="set_after_processing",_="set_processing_response",k="set_has_error",P="set_no_error",C="set_quantity",S="set_request_params",N=j,x=v,D=h,B=y,R=w,A=E,T=_,z=k,L=P,V=C,I=S,F=function(){return{type:N}},M=function(){return{type:x}},H=function(){return{type:D}},q=function(){return{type:B}},G=function(){return{type:R}},Q=function(){return{type:A}},U=function(e){return{type:T,data:e}},W=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?z:L;return{type:t}},K=function(e){return{type:V,quantity:e}},Y=function(e){return{type:I,data:e}},J=r(4),$=r.n(J);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){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ee=j,te=v,re=h,ne=y,ce=w,oe=E,ae=_,ie=k,se=P,ue=C,le=S,be=b,pe=p,de=d,fe=f,me=m,Oe=O,ge=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case ee:e=g;break;case te:e=t.status!==pe?Z(Z({},t),{},{status:pe}):t;break;case re:e=t.status!==de?Z(Z({},t),{},{status:de}):t;break;case ue:e=n!==t.quantity?Z(Z({},t),{},{quantity:n}):t;break;case le:e=Z(Z({},t),{},{requestParams:Z(Z({},t.requestParams),o)});break;case ae:e=Z(Z({},t),{},{processingResponse:o});break;case ne:e=!1===(e=t.status!==fe?Z(Z({},t),{},{status:fe,hasError:!1}):t).hasError?e:Z(Z({},e),{},{hasError:!1});break;case ce:e=t.status!==me?Z(Z({},t),{},{status:me,hasError:!1}):t;break;case oe:e=t.status!==Oe?Z(Z({},t),{},{status:Oe}):t;break;case ie:e=t.hasError?t:Z(Z({},t),{},{hasError:!0}),e=t.status===fe||t.status===me?Z(Z({},e),{},{status:pe}):e;break;case se:e=t.hasError?Z(Z({},t),{},{hasError:!1}):t}return e!==t&&c!==ee&&e.status===be&&(e.status=pe),e},je=r(148),ve=r(389),he="add_to_cart_before_processing",ye="add_to_cart_after_processing_with_success",we="add_to_cart_after_processing_with_error",Ee=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(ve.a)(ye,e),onAddToCartProcessingWithError:Object(ve.a)(we,e),onAddToCartBeforeProcessing:Object(ve.a)(he,e)}},_e=r(393),ke=r(138),Pe=r(62),Ce=r(56),Se=Object(n.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),Ne=function(){return Object(n.useContext)(Se)},xe=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(ge,g),a=i()(o,2),b=a[0],j=a[1],v=Object(n.useReducer)(je.b,{}),h=i()(v,2),y=h[0],w=h[1],E=Object(u.a)(y),_=Object(Pe.a)(),k=_.addErrorNotice,P=_.removeNotices,C=Object(ke.b)().setValidationErrors,S=Object(Ce.c)(),N=S.isSuccessResponse,x=S.isErrorResponse,D=S.isFailResponse,B=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:Ee(w).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:Ee(w).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:Ee(w).onAddToCartBeforeProcessing}}),[w]),R=Object(n.useMemo)((function(){return{resetForm:function(){j(F())},submitForm:function(){j(G())},setQuantity:function(e){j(K(e))},setHasError:function(e){j(W(e))},setRequestParams:function(e){j(Y(e))},setAfterProcessing:function(e){j(U(e)),j(Q())}}}),[]);Object(n.useEffect)((function(){var e=b.status,t=!r.id||!Object(l.a)(r);e!==d||t?e!==d&&t&&j(H()):j(M())}),[b.status,r,j]),Object(n.useEffect)((function(){b.status===m&&(P("error"),Object(_e.a)(E,he,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&k(t),r&&C(r)})),j(M())):j(q())})))}),[b.status,C,k,P,j,E]),Object(n.useEffect)((function(){if(b.status===O){var e={processingResponse:b.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(x(e)||D(e))&&r&&(t=!0,k(r,n?{context:n}:void 0))})),t};if(b.hasError)return void Object(_e.b)(E,we,e).then((function(r){if(!t(r)){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(s.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");k(c,{id:"add-to-cart"})}j(M())}));Object(_e.b)(E,ye,e).then((function(e){t(e)?j(W(!0)):j(M())}))}}),[b.status,b.hasError,b.processingResponse,R,k,x,D,N,E]);var A=Object(l.b)(r),T={product:r,productType:r.type||"simple",productIsPurchasable:Object(l.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:A,showFormElements:c&&A,quantity:b.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:b.requestParams,isIdle:b.status===p,isDisabled:b.status===d,isProcessing:b.status===f,isBeforeProcessing:b.status===m,isAfterProcessing:b.status===O,hasError:b.hasError,eventRegistration:B,dispatchActions:R};return Object(n.createElement)(Se.Provider,{value:T},t)},De=r(19),Be=r.n(De),Re=r(26),Ae=r(51);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 ze=function(){var e=Ne(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,a=e.hasError,u=e.isProcessing,l=e.requestParams,b=Object(ke.b)(),p=b.hasValidationErrors,d=b.showAllValidationErrors,f=Object(Pe.a)(),m=f.addErrorNotice,O=f.removeNotice,g=Object(Ae.a)().receiveCart,j=Object(n.useState)(!1),v=i()(j,2),h=v[0],y=v[1],w=!a&&u,E=Object(n.useCallback)((function(){return!p||(d(),{type:"error"})}),[p,d]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(E,0);return function(){e()}}),[o,E]);var _=Object(n.useCallback)((function(){y(!0),O("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(r),!0).forEach((function(t){$()(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},l);Be()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){Be.a.setNonce(e.headers),e.json().then((function(r){e.ok?g(r):(r.body&&r.body.message?m(Object(Re.decodeEntities)(r.body.message),{id:"add-to-cart"}):m(Object(s.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),y(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&g(e.data.cart),t.setHasError(),t.setAfterProcessing(e),y(!1)}))}))}),[r,m,O,g,t,c,l]);return Object(n.useEffect)((function(){w&&!h&&_()}),[w,_,h]),null},Le=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(ke.a,null,Object(n.createElement)(xe,{product:r,showFormElements:c},t,Object(n.createElement)(ze,null)))},Ve=r(38),Ie=r(6),Fe=r(69),Me=(r(385),r(100)),He=r(57),qe=r(557),Ge=r(85),Qe=r(846),Ue=function(e){var t=e.className,r=e.href,c=e.text,o=e.onClick;return Object(n.createElement)(Me.a,{className:t,href:r,onClick:o,rel:"nofollow"},c)},We=function(e){var t=e.className,r=e.quantityInCart,c=e.isProcessing,o=e.isDisabled,a=e.isDone,i=e.onClick;return Object(n.createElement)(Me.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)(He.a,{srcElement:qe.a,alt:Object(s.__)("Done","woo-gutenberg-products-block")}))},Ke=function(){var e=Ne(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,u=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,p=e.hasError,d=e.dispatchActions,f=Object(Ve.useInnerBlockLayoutContext)().parentName,m=Object(Ge.a)().dispatchStoreEvent,O=Object(Qe.a)(o.id||0).cartQuantity,g=Object(n.useState)(!1),j=i()(g,2),v=j[0],h=j[1],y=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return p||h(!0),!0}),0);return function(){e()}}),[b,p]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(We,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:O,isDisabled:u,isProcessing:l,isDone:v,onClick:function(){d.submitForm(),m("cart-add-item",{product:o,listName:f})}}):Object(n.createElement)(Ue,{className:"wc-block-components-product-add-to-cart-button",href:y.url,text:y.text||Object(s.__)("View Product","woo-gutenberg-products-block"),onClick:function(){m("product-view-link",{product:o,listName:f})}})},Ye=function(e){var t=e.disabled,r=e.min,c=e.max,o=e.value,a=e.onChange;return Object(n.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:c,hidden:1===c,disabled:t,onChange:function(e){a(e.target.value)}})},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)(Ye,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ke,null))},Xe=(r(556),r(30)),Ze=r.n(Xe),et=r(3),tt=r(8),rt=r(287),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(ke.b)(),f=d.getValidationError,m=d.setValidationErrors,O=d.clearValidationError,g=t,j=f(g)||{};return Object(tt.useEffect)((function(){i?O(g):m($()({},g,{message:p,hidden:!0}))}),[i,g,p,O,m]),Object(tt.useEffect)((function(){return function(){O(g)}}),[g,O]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)(et.SelectControl,{label:Object(Re.decodeEntities)(t),value:i||"",options:[nt].concat(Ze()(c)),onChange:l,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":j.message&&!j.hidden})}),Object(n.createElement)(rt.a,{propertyName:g,elementId:g}))};function ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function at(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(r),!0).forEach((function(t){$()(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),{},$()({},c,null)),s=o?it(e,t,i):null,u=null!==s?s.map((function(e){return t["id:"+e].attributes[c]})):null;n[c]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var r=e.name,n=e.slug;return null===t||t.includes(null)||t.includes(n)?{value:n,label:Object(Re.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n};function ut(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ut(Object(r),!0).forEach((function(t){$()(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),{},$()({},e,t)))}})})))},pt=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(Ie.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(c).length||0===o.length?null:Object(n.createElement)(bt,{attributes:c,variationAttributes:o,setRequestParams:r.setRequestParams})},dt=function(){var e=Ne(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,i=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)(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)(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)($e,null):null:Object(n.createElement)(Ke,null)};t.a=Object(Fe.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(Ve.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Ie.isEmpty)(c)});return Object(n.createElement)(Le,{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(4),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(38),u=r(22),l=r(14),b=function(e){var t=e.color,r=e.fontSize;return Object(l.o)()?{color:t,fontSize:r}:{}},p=r(69),d=r(176),f=r(85);r(546),t.a=Object(p.withProductDataContext)((function(e){var t,r,n,a=e.className,p=e.headingLevel,m=void 0===p?2:p,O=e.productLink,g=void 0===O||O,j=e.align,v=e.color,h=e.customColor,y=e.fontSize,w=e.customFontSize,E=Object(s.useInnerBlockLayoutContext)().parentClassName,_=Object(s.useProductDataContext)().product,k=Object(f.a)().dispatchStoreEvent,P="h".concat(m),C=Object(u.getColorClassName)("color",v),S=Object(u.getFontSizeClass)(y),N=i()((t={"has-text-color":v||h,"has-font-size":y||w},c()(t,C,C),c()(t,S,S),t));return _.id?Object(o.createElement)(P,{className:i()(a,"wc-block-components-product-title",(r={},c()(r,"".concat(E,"__product-title"),E),c()(r,"wc-block-components-product-title--align-".concat(j),j&&Object(l.o)()),r))},Object(o.createElement)(d.a,{className:i()(c()({},N,Object(l.o)())),disabled:!g,name:_.name,permalink:_.permalink,rel:g?"nofollow":null,style:b({color:h,fontSize:w}),onClick:function(){k("product-view-link",{product:_})}})):Object(o.createElement)(P,{className:i()(a,"wc-block-components-product-title",(n={},c()(n,"".concat(E,"__product-title"),E),c()(n,"wc-block-components-product-title--align-".concat(j),j&&Object(l.o)()),c()(n,N,Object(l.o)()),n)),style:b({color:h,fontSize:w})})}))},393:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f}));var n=r(40),c=r.n(n),o=r(28),a=r.n(o),i=r(12),s=r.n(i),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(56);function b(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw o}}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var d=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,l,p,d;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],i=b(o),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return p=l.value,e.prev=7,e.next=10,Promise.resolve(p.callback(n));case 10:d=e.sent,"object"===c()(d)&&a.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(t,r,n){return e.apply(this,arguments)}}(),f=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,p,d,f;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,r),i=b(a),e.prev=3,i.s();case 5:if((p=i.n()).done){e.next=28;break}return d=p.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:if(f=e.sent,"object"===c()(f)&&null!==f){e.next=13;break}return e.abrupt("continue",26);case 13:if(f.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(f)&&!Object(l.b)(f)){e.next=18;break}return o.push(f),e.abrupt("return",o);case 18:o.push(f),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},41:function(e,t,r){"use strict";var n=r(4),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))}},42: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(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")))}},48:function(e,t){!function(){e.exports=this.wp.keycodes}()},5:function(e,t){!function(){e.exports=this.wc.wcSettings}()},50:function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},51:function(e,t,r){"use strict";r.d(t,"a",(function(){return y}));var n=r(13),c=r.n(n),o=r(4),a=r.n(o),i=r(6),s=r(0),u=r(36),l=r(21),b=r(26),p=r(164),d=r(185),f=r(75);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},j=O(O({},g),{},{email:"",phone:""}),v=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=c()(e,2),r=t[0],n=t[1];return[r,Object(b.decodeEntities)(n)]})))},h={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:[],currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},cartIsLoading:!0,cartErrors:[],billingAddress:j,shippingAddress:g,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(f.b)(),r=t.isEditor,n=t.previewData,c=(null==n?void 0:n.previewCart)||{},o=e.shouldSelect,a=Object(s.useRef)(),b=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!o)return h;if(r)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:[],cartTotals:c.totals,cartIsLoading:!1,cartErrors:[],billingAddress:j,shippingAddress:g,extensions:{},shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var a=e(u.CART_STORE_KEY),i=a.getCartData(),s=a.getCartErrors(),l=a.getCartTotals(),b=!a.hasFinishedResolution("getCartData"),p=a.isCustomerDataUpdating(),f=n(u.CART_STORE_KEY).receiveCart,m=v(i.billingAddress),O=i.needsShipping?v(i.shippingAddress):m,y=i.fees.map((function(e){return v(e)}));return{cartCoupons:i.coupons,cartItems:i.items||[],cartFees:y,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors||[],cartTotals:l,cartIsLoading:b,cartErrors:s,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(O),extensions:i.extensions||{},shippingRates:i.shippingRates||[],shippingRatesLoading:p,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements||[],receiveCart:f}}),[o]);return a.current&&Object(i.isEqual)(a.current,b)||(a.current=b),a.current}},53:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(4),a=r.n(o),i=r(23),s=r.n(i),u=r(0),l=r(181),b=r(7),p=r.n(b);r(189);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}))}},530:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(146),u=r(58),l=r(38),b=r(22),p=r(14),d=r(69);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=e.customColor,_=e.saleColor,k=e.customSaleColor,P=Object(l.useInnerBlockLayoutContext)().parentClassName,C=Object(l.useProductDataContext)().product,S=i()(O,c()({},"".concat(P,"__product-price"),P));if(!C.id)return Object(o.createElement)(s.a,{align:g,className:S});var N=Object(b.getColorClassName)("color",w),x=Object(b.getFontSizeClass)(j),D=Object(b.getColorClassName)("color",_),B=Object(b.getFontSizeClass)(h),R=i()((t={"has-text-color":w||E,"has-font-size":j||v},c()(t,N,N),c()(t,x,x),t)),A=i()((r={"has-text-color":_||k,"has-font-size":h||y},c()(r,D,D),c()(r,B,B),r)),T={color:E,fontSize:v},z={color:k,fontSize:y},L=C.prices,V=Object(u.getCurrencyFromPriceResponse)(L),I=L.price!==L.regular_price,F=I?i()((n={},c()(n,"".concat(P,"__product-price__value"),P),c()(n,A,Object(p.o)()),n)):i()((a={},c()(a,"".concat(P,"__product-price__value"),P),c()(a,R,Object(p.o)()),a)),M=I?z:T;return Object(o.createElement)(s.a,{align:g,className:S,currency:V,price:L.price,priceClassName:F,priceStyle:Object(p.o)()?M:{},minPrice:null==L||null===(d=L.price_range)||void 0===d?void 0:d.min_amount,maxPrice:null==L||null===(f=L.price_range)||void 0===f?void 0:f.max_amount,regularPrice:L.regular_price,regularPriceClassName:i()((m={},c()(m,"".concat(P,"__product-price__regular"),P),c()(m,R,Object(p.o)()),m)),regularPriceStyle:Object(p.o)()?T:{}})}))},531:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(7),s=r.n(i),u=r(38),l=r(69),b=(r(549),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)))}))},532:function(e,t,r){"use strict";r.r(t);var n=r(10),c=r.n(n),o=r(4),a=r.n(o),i=r(0),s=(r(2),r(7)),u=r.n(s),l=r(1),b=r(85),p=r(846),d=r(26),f=r(38),m=r(69),O=(r(550),function(e){var t=e.product,r=t.id,n=t.permalink,o=t.add_to_cart,a=t.has_options,s=t.is_purchasable,f=t.is_in_stock,m=Object(b.a)().dispatchStoreEvent,O=Object(p.a)(r),g=O.cartQuantity,j=O.addingToCart,v=O.addToCart,h=Number.isFinite(g)&&g>0,y=!a&&s&&f,w=Object(d.decodeEntities)((null==o?void 0:o.description)||""),E=h?Object(l.sprintf)(Object(l._n)("%d in cart","%d in cart",g,"woo-gutenberg-products-block"),g):Object(d.decodeEntities)((null==o?void 0:o.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),_=y?"button":"a",k={};return y?k.onClick=function(){v(),m("cart-add-item",{product:t})}:(k.href=n,k.rel="nofollow",k.onClick=function(){m("product-view-link",{product:t})}),Object(i.createElement)(_,c()({"aria-label":w,className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:j,added:h}),disabled:j},k),E)}),g=function(){return Object(i.createElement)("button",{className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};t.default=Object(m.withProductDataContext)((function(e){var t=e.className,r=Object(f.useInnerBlockLayoutContext)().parentClassName,n=Object(f.useProductDataContext)().product;return Object(i.createElement)("div",{className:u()(t,"wp-block-button","wc-block-components-product-button",a()({},"".concat(r,"__product-add-to-cart"),r))},n.id?Object(i.createElement)(O,{product:n}):Object(i.createElement)(g,null))}))},533:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(178),u=r(14),l=r(38),b=r(69);r(551);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product;if(!n)return Object(o.createElement)("div",{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r))});var a=n.short_description?n.short_description:n.description;return a?Object(o.createElement)(s.a,{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r)),source:a,maxLength:150,countType:u.m.wordCountType||"words"}):null}))},534:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(38),l=r(69);r(552);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}))},535:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(38),l=r(6),b=r(69);r(553);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(l.isEmpty)(n.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))}))))}))},536:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(38),l=r(6),b=r(69);r(554);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))}))))}))},537:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(38),l=r(69),b=(r(555),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))}))},54:function(e,t){!function(){e.exports=this.wp.hooks}()},546:function(e,t){},547:function(e,t){},548:function(e,t){},549:function(e,t){},550:function(e,t){},551:function(e,t){},552:function(e,t){},553:function(e,t){},554:function(e,t){},555:function(e,t){},556:function(e,t){},557: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";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return s})),r.d(t,"c",(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}}},57:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(23),a=r.n(o),i=r(0);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}},58:function(e,t){!function(){e.exports=this.wc.priceFormat}()},6:function(e,t){!function(){e.exports=this.lodash}()},62:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(4),c=r.n(n),o=r(0),a=r(177);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,c=e.createSnackbarNotice,i=e.setIsSuppressed,u=Object(o.useRef)(t);Object(o.useEffect)((function(){u.current=t}),[t]);var l=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return u.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),b=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,s({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c(e,t)}}}),[r,c]);return s(s(s({notices:t},l),b),{},{setIsSuppressed:i})}},66:function(e,t){!function(){e.exports=this.wp.deprecated}()},69:function(e,t){!function(){e.exports=this.wc.wcSharedHocs}()},70:function(e,t){!function(){e.exports=this.wp.dom}()},71:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(15),a=r.n(o),i=r(16),s=r.n(i),u=r(11),l=r.n(u),b=r(17),p=r.n(b),d=r(18),f=r.n(d),m=r(9),O=r.n(m),g=r(0),j=r(6),v=r(7),h=r.n(v),y=r(3),w=r(188);r(119);function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=O()(e);if(t){var c=O()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return f()(this,r)}}var _=function(e){p()(r,e);var t=E(r);function r(){var e;return a()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(l()(e)),e}return s()(r,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,o=r.checked,a=r.instanceId,i=r.className,s=r.help,u=r.options,l=r.value,b="inspector-toggle-button-control-".concat(a);return s&&(e=Object(j.isFunction)(s)?s(o):s),Object(g.createElement)(y.BaseControl,{id:b,help:e,className: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)(_)},74: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}},75: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)}},77:function(e,t){!function(){e.exports=this.wp.a11y}()},78:function(e,t){!function(){e.exports=this.ReactDOM}()},8:function(e,t){!function(){e.exports=this.React}()},80:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(6),a=(r(2),r(3));t.a=function(e){var t=e.columns,r=e.rows,i=e.setAttributes,s=e.alignButtons,u=e.minColumns,l=void 0===u?1:u,b=e.maxColumns,p=void 0===b?6:b,d=e.minRows,f=void 0===d?1:d,m=e.maxRows,O=void 0===m?6:m;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:function(e){var t=Object(o.clamp)(e,l,p);i({columns:Number.isNaN(t)?"":t})},min:l,max:p}),Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Rows","woo-gutenberg-products-block"),value:r,onChange:function(e){var t=Object(o.clamp)(e,f,O);i({rows:Number.isNaN(t)?"":t})},min:f,max:O}),Object(n.createElement)(a.ToggleControl,{label:Object(c.__)("Align Last Block","woo-gutenberg-products-block"),help:s?Object(c.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(c.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:s,onChange:function(){return i({alignButtons:!s})}}))}},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:"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},82: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},822: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},83:function(e,t){!function(){e.exports=this.wp.viewport}()},830: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},831:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),c=r(14),o=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:Object(n.__)("Fly your WordPress banner with this beauty! Deck out your office space or add it to your kids walls. This banner will spruce up any space it’s hung!","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",price:"7.99",price_html:'<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>7.99</span>',images:[{id:1,src:c.k+"img/pennant.jpg",thumbnail:c.k+"img/pennant.jpg",name:"pennant-1.jpg",alt:"WordPress Pennant",srcset:"",sizes:""}],average_rating:5,review_count:1,prices:{currency_code:"GBP",decimal_separator:".",thousand_separator:",",decimals:2,price_prefix:"£",price_suffix:"",price:"7.99",regular_price:"9.99",sale_price:"7.99",price_range:null},add_to_cart:{text:Object(n.__)("Add to cart","woo-gutenberg-products-block"),description:Object(n.__)("Add to cart","woo-gutenberg-products-block")},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},836: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},84:function(e,t){!function(){e.exports=this.wp.date}()},843:function(e,t,r){e.exports=r(895)},844:function(e,t){},845:function(e,t){},846:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(13),c=r.n(n),o=r(0),a=r(21),i=r(36),s=r(26),u=r(51),l=r(62),b=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},p=function(e){var t=Object(a.useDispatch)(i.CART_STORE_KEY).addItemToCart,r=Object(u.a)(),n=r.cartItems,p=r.cartIsLoading,d=Object(l.a)(),f=d.addErrorNotice,m=d.removeNotice,O=Object(o.useState)(!1),g=c()(O,2),j=g[0],v=g[1],h=Object(o.useRef)(b(n,e));return Object(o.useEffect)((function(){var t=b(n,e);t!==h.current&&(h.current=t)}),[n,e]),{cartQuantity:Number.isFinite(h.current)?h.current:0,addingToCart:j,cartIsLoading:p,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return v(!0),t(e,r).then((function(){m("add-to-cart")})).catch((function(e){f(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){v(!1)}))}}}},848: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},849:function(e,t){},85:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(4),c=r.n(n),o=r(54),a=r(0),i=r(51);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=function(){var e=Object(i.a)();return{dispatchStoreEvent:Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(a.useCallback)((function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-checkout-".concat(t),u(u({},r),{},{storeCart:e}))}catch(e){console.error(e)}}),[e])}}},850:function(e,t){},851:function(e,t){},852:function(e,t){},895:function(e,t,r){"use strict";r.r(t),r.d(t,"blockSettings",(function(){return qr}));var n=r(4),c=r.n(n),o=r(10),a=r.n(o),i=r(0),s=r(1),u=r(22),l=r(25),b=r(57),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(14),m=r(7),O=r.n(m),g=function(e){var t=e.attributes;return Object(i.createElement)("div",{className:O()("is-loading",t.className)})},j={category:"woocommerce-product-elements",keywords:[Object(s.__)("WooCommerce","woo-gutenberg-products-block")],icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},supports:{html:!1},parent:Object(f.n)()?null:["@woocommerce/all-products","@woocommerce/single-product"],save:g,deprecated:[{save:function(){}}]},v=r(386),h=r(3),y=r(934),w=r(147),E=r(392),_=r(13),k=r.n(_),P=r(139),C=r(23),S=r.n(C);r(845);var N=function(e){var t=e.className,r=void 0===t?"":t,n=S()(e,["className"]),c=O()("wc-block-text-toolbar-button",r);return Object(i.createElement)(h.Button,a()({className:c},n))},x=r(38),D=(r(844),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"})),R=Object(s.__)("Product Title","woo-gutenberg-products-block"),A=Object(i.createElement)(b.a,{srcElement:B}),T=Object(s.__)("Display the title of a product.","woo-gutenberg-products-block"),z=function(e){var t=e.color,r=e.fontSize,n=e.setFontSize,c=e.setColor,o=e.attributes,a=e.setAttributes,l=o.headingLevel,b=o.productLink,p=o.align;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(w.a,{isCollapsed:!0,minLevel:1,maxLevel:7,selectedLevel:l,onChange:function(e){return a({headingLevel:e})}}),Object(f.o)()&&Object(i.createElement)(u.AlignmentToolbar,{value:p,onChange:function(e){a({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(s.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:b,onChange:function(){return a({productLink:!b})}})),Object(f.o)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Text settings","woo-gutenberg-products-block")},Object(i.createElement)(u.FontSizePicker,{value:r.size,onChange:n})),Object(i.createElement)(u.PanelColorSettings,{title:Object(s.__)("Color settings","woo-gutenberg-products-block"),colorSettings:[{value:t.color,onChange:c,label:Object(s.__)("Text color","woo-gutenberg-products-block")}]}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(E.a,o)))},L=Object(f.o)()?Object(y.a)([Object(u.withFontSizes)("fontSize"),Object(u.withColors)("color",{textColor:"color"}),D({icon:A,label:R,description:Object(s.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(z):z;function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function I(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var F={title:R,description:T,icon:{src:A,foreground:"#874FB9"},attributes:v.a,edit:L};Object(l.registerBlockType)("woocommerce/product-title",I(I({},j),F));var M=r(530),H=r(353),q=Object(s.__)("Product Price","woo-gutenberg-products-block"),G=Object(i.createElement)(b.a,{srcElement:H.a}),Q=Object(s.__)("Display the price of a product.","woo-gutenberg-products-block"),U=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")})))},W=function(e){var t=e.fontSize,r=e.saleFontSize,n=e.setFontSize,c=e.setSaleFontSize,o=e.color,a=e.saleColor,l=e.setColor,b=e.setSaleColor,p=e.attributes,d=e.setAttributes,m=p.align;return Object(i.createElement)(i.Fragment,null,Object(f.o)()&&Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(u.AlignmentToolbar,{value:m,onChange:function(e){d({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(f.o)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Price","woo-gutenberg-products-block")},Object(i.createElement)(U,{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)(U,{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.o)()?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:G,label:q,description:Object(s.__)("Choose a product to display its price.","woo-gutenberg-products-block")})])(W):W;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 J(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 $={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.o)()&&($=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:Q,icon:{src:G,foreground:"#874FB9"},attributes:$,edit:K};Object(l.registerBlockType)("woocommerce/product-price",Z(Z({},j),ee));var te=r(387),re=r(153),ne=r(71),ce=r(5),oe=r(388),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(531),Oe=r(830),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}},Ee=r(532),_e=r(848),ke=Object(s.__)("Add to Cart Button","woo-gutenberg-products-block"),Pe=Object(i.createElement)(b.a,{srcElement:_e.a});function Ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Se(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ne={title:ke,description:Object(s.__)("Display a call to action button which either adds the product to the cart, or links to the product page.","woo-gutenberg-products-block"),icon:{src:Pe,foreground:"#874FB9"},attributes:we,edit:D({icon:Pe,label:ke,description:Object(s.__)("Choose a product to display its add to cart button.","woo-gutenberg-products-block")})((function(e){var t=e.attributes;return Object(i.createElement)(h.Disabled,null,Object(i.createElement)(Ee.default,t))}))};Object(l.registerBlockType)("woocommerce/product-button",Se(Se({},j),Ne));var xe={productId:{type:"number",default:0}},De=r(533),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"})),Re=Object(s.__)("Product Summary","woo-gutenberg-products-block"),Ae=Object(i.createElement)(b.a,{srcElement:Be});function Te(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ze(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Te(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Le={title:Re,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:Re,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",ze(ze({},j),Le));var Ve={productId:{type:"number",default:0}},Ie=r(286),Fe=r(822),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 Ge(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:Ve,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",Ge(Ge({},j),Qe));var Ue={productId:{type:"number",default:0}},We=r(127),Ke=r(534),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"})),Je=Object(s.__)("Product SKU","woo-gutenberg-products-block"),$e=Object(i.createElement)(b.a,{srcElement:Ye});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:Ue,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)(We.a,null),Object(i.createElement)(Ke.default,t))}))};Object(f.p)("woocommerce/product-sku",Ze(Ze({},j),et));var tt={productId:{type:"number",default:0}},rt=r(535),nt=r(815),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)(We.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(rt.default,t)))}))};Object(f.p)("woocommerce/product-category-list",it(it({},j),st));var ut={productId:{type:"number",default:0}},lt=r(536),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)(We.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(lt.default,t)))}))};Object(f.p)("woocommerce/product-tag-list",ft(ft({},j),mt));var Ot={productId:{type:"number",default:0}},gt=r(537),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 Et={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)(We.a,null),Object(i.createElement)(gt.default,t))}))};Object(f.p)("woocommerce/product-stock-indicator",wt(wt({},j),Et));var _t=r(925),kt=(r(385),r(391)),Pt=Object(s.__)("Add to Cart","woo-gutenberg-products-block"),Ct=Object(i.createElement)(b.a,{srcElement:_e.a});function St(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?St(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):St(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var xt={title:Pt,description:Object(s.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woo-gutenberg-products-block"),icon:{src:Ct,foreground:"#874FB9"},edit:D({icon:Ct,label:Pt,description:Object(s.__)("Choose a product to display its add to cart form.","woo-gutenberg-products-block")})((function(e){var t=e.attributes,r=e.setAttributes,n=Object(x.useProductDataContext)().product,c=t.className,o=t.showFormElements;return Object(i.createElement)("div",{className:O()(c,"wc-block-components-product-add-to-cart")},Object(i.createElement)(We.a,{productId:n.id}),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout","woo-gutenberg-products-block")},Object(_t.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(390).a};Object(f.p)("woocommerce/product-add-to-cart",Nt(Nt({},j),xt));var Dt=r(15),Bt=r.n(Dt),Rt=r(11),At=r.n(Rt),Tt=r(17),zt=r.n(Tt),Lt=r(18),Vt=r.n(Lt),It=r(9),Ft=r.n(It),Mt=r(21),Ht=(r(2),r(80)),qt=r(921),Gt=r(831),Qt=r(165),Ut=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})},Wt=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 Jt(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=[["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(16),cr=r.n(nr),or=r(8),ar=r(6),ir=r(41),sr=(r(852),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(166),br=r(150),pr=r(200),dr=r(36),fr=r(74);function mr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Or(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var gr=function(e){var t={namespace:"/wc/store",resourceName:"products"},r=Object(pr.a)(Or(Or({},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(fr.a)(i),u=Object(fr.a)(o),l=Object(Mt.useSelect)((function(t){var c=t(dr.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",Or(Or({},t),{},{query:e})).value;return{products:n,totalProducts:parseInt(o,10),productsLoading:c}},jr=r(85),vr=r(182),hr=r(77),yr=r(141),wr=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:yr.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")))},Er=r(836),_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:Er.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")))},kr=r(145),Pr=(r(851),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,c=e.value;return Object(i.createElement)(kr.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})}),Cr=r(187),Sr=Object(Cr.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(850);function Nr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Dr=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)},Br=Object(vr.a)((function(e){var t=e.attributes,r=e.currentPage,n=e.onPageChange,c=e.onSortChange,o=e.sortValue,a=e.scrollToTop,u=e.hideOutOfStockItems,l=void 0!==u&&u,b=Object(br.c)(function(e){var t=e.sortValue,r=e.currentPage,n=e.attributes,c=e.hideOutOfStockItems,o=n.columns,a=n.rows;return xr(xr({},function(e){switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}}(t)),{},{catalog_visibility:"catalog",per_page:o*a,page:r},c&&{stock_status:["instock","onbackorder"]})}({attributes:t,sortValue:o,currentPage:r,hideOutOfStockItems:l})),p=k()(b,1)[0],d=gr(p),f=d.products,m=d.totalProducts,g=d.productsLoading,j=Object(x.useInnerBlockLayoutContext)(),v=j.parentClassName,h=j.parentName,y=function(e){e.order,e.orderby,e.page,e.per_page;return S()(e,["order","orderby","page","per_page"])||{}}(p),w=Object(jr.a)().dispatchStoreEvent,E=Object(br.b)("attributes",[]),_=k()(E,2),P=_[0],C=_[1],N=Object(br.b)("min_price"),D=k()(N,2),B=D[0],R=D[1],A=Object(br.b)("max_price"),T=k()(A,2),z=T[0],L=T[1],V=Object(lr.a)({totalQuery:y,totalProducts:m},Dr);Object(i.useEffect)((function(){w("product-list-render",{products:f,listName:h})}),[f,h,w]),Object(i.useEffect)((function(){Object(ar.isEqual)(y,null==V?void 0:V.totalQuery)||(n(1),null!=V&&V.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(hr.speak)(Object(s.__)("No products found","woo-gutenberg-products-block")):Object(hr.speak)(Object(s.sprintf)(Object(s._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(m))}),[null==V?void 0:V.totalQuery,m,n,y]);var I,F,M,H,q,G=t.contentVisibility,Q=t.columns*t.rows,U=!Number.isFinite(m)&&Number.isFinite(null==V?void 0:V.totalProducts)&&Object(ar.isEqual)(y,null==V?void 0:V.totalQuery)?Math.ceil(V.totalProducts/Q):Math.ceil(m/Q),W=f.length?f:Array.from({length:Q}),K=0!==f.length||g,Y=P.length>0||Number.isFinite(B)||Number.isFinite(z);return Object(i.createElement)("div",{className:(I=t.columns,F=t.rows,M=t.alignButtons,H=t.align,q=void 0!==H?"align"+H:"",O()(v,q,"has-"+I+"-columns",{"has-multiple-rows":F>1,"has-aligned-buttons":M}))},G.orderBy&&K&&Object(i.createElement)(Pr,{onChange:c,value:o}),!K&&Y&&Object(i.createElement)(_r,{resetCallback:function(){C([]),R(null),L(null)}}),!K&&!Y&&Object(i.createElement)(wr,null),K&&Object(i.createElement)("ul",{className:"".concat(v,"__products")},W.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return Object(i.createElement)(Sr,{key:e.id||r,attributes:t,product:e})}))),U>1&&Object(i.createElement)(ur,{currentPage:r,onPageChange:function(e){a({focusableSelector:"a, button"}),n(e)},totalPages:U}))})),Rr=function(e){var t=e.attributes,r=e.hideOutOfStockItems,n=void 0!==r&&r,c=Object(i.useState)(1),o=k()(c,2),a=o[0],s=o[1],u=Object(i.useState)(t.orderby),l=k()(u,2),b=l[0],p=l[1];Object(i.useEffect)((function(){p(t.orderby)}),[t.orderby]);return Object(i.createElement)(Br,{attributes:t,hideOutOfStockItems:n,currentPage:a,onPageChange:function(e){s(e)},onSortChange:function(e){var t=e.target.value;p(t),s(1)},sortValue:b})},Ar=r(175);function Tr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return 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 Vt()(this,r)}}var zr=function(e){zt()(r,e);var t=Tr(r);function r(){return Bt()(this,r),t.apply(this,arguments)}return cr()(r,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.urlParameterSuffix;if(t.isPreview)return Ar.a;var n=Object(ce.getSetting)("hideOutOfStockItems",!1);return Object(i.createElement)(x.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)(Rr,{attributes:t,urlParameterSuffix:r,hideOutOfStockItems:n}))}}]),r}(or.Component);r(849);function Lr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return 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 Vt()(this,r)}}var Vr=function(e){zt()(r,e);var t=Lr(r);function r(){var e;Bt()(this,r);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return e=t.call.apply(t,[this].concat(o)),c()(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,minColumns:Object(ce.getSetting)("min_columns",1),maxColumns:Object(ce.getSetting)("max_columns",6),minRows:Object(ce.getSetting)("min_rows",1),maxRows:Object(ce.getSetting)("max_rows",6)})),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:Gt.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=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)(zr,{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 0===f.m.productCount?Wt(n,c):Object(i.createElement)("div",{className:Ut("wc-block-all-products",t)},e.getBlockControls(),e.getInspectorControls(),r?e.renderEditMode():e.renderViewMode())})),e}return r}(i.Component),Ir=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),Fr={columns:Object(ce.getSetting)("default_columns",3),rows:Object(ce.getSetting)("default_rows",3),alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:$t,isPreview:!1};function Mr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Hr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var qr={title:Object(s.__)("All Products","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(s.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(s.__)("Display products from your store in a grid layout.","woo-gutenberg-products-block"),supports:{align:["wide","full"],html:!1,multiple:!1},example:{attributes:{isPreview:!0}},attributes:{columns:{type:"number"},rows:{type:"number"},alignButtons:{type:"boolean"},contentVisibility:{type:"object"},orderby:{type:"string"},layoutConfig:{type:"array"},isPreview:{type:"boolean",default:!1}},defaults:Fr,edit:function(e){return Object(i.createElement)(Ir,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:Ut("wc-block-all-products",t)},n),Object(i.createElement)(u.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",Hr(Hr({},qr),{},{deprecated:[{attributes:Object.assign({},qr.attributes,{rows:{type:"number",default:1}}),save:function(e){var t=e.attributes,r={"data-attributes":JSON.stringify(t)};return Object(i.createElement)("div",a()({className:Ut("wc-block-all-products",t)},r),Object(i.createElement)(u.InnerBlocks.Content,null))}}]}))},921:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(50),c=r(0),o=r(14);r.p=o.l,Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(12)]).then(r.bind(null,530))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(4),r.e(11)]).then(r.bind(null,943))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(18)]).then(r.bind(null,944))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(c.lazy)((function(){return r.e(13).then(r.bind(null,531))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(3),r.e(9)]).then(r.bind(null,532))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(c.lazy)((function(){return r.e(16).then(r.bind(null,533))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(c.lazy)((function(){return r.e(4).then(r.bind(null,286))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(c.lazy)((function(){return r.e(14).then(r.bind(null,534))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(c.lazy)((function(){return r.e(10).then(r.bind(null,535))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(c.lazy)((function(){return r.e(17).then(r.bind(null,536))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(c.lazy)((function(){return r.e(15).then(r.bind(null,537))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(2),r.e(3),r.e(8)]).then(r.bind(null,945))}))});var a=function(e){return Object(n.getRegisteredBlockComponents)(e)}},925: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")}},96:function(e,t){!function(){e.exports=this.wp.autop}()}});
1
+ this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-products"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],u=t[2],b=0,p=[];b<i.length;b++)a=i[b],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&p.push(c[a][0]),c[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(l&&l(t);p.length;)p.shift()();return o.push.apply(o,u||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,i=1;i<r.length;i++){var s=r[i];0!==c[s]&&(n=!1)}n&&(o.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},c={6:0,1:0,3:0,4:0,9:0,10:0,12:0,13:0,14:0,15:0,16:0,17:0},o=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.e=function(e){var t=[],r=c[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=c[e]=[t,n]}));t.push(r[2]=n);var o,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({1:"atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b",2:"atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title",3:"atomic-block-components/add-to-cart--atomic-block-components/button",4:"atomic-block-components/sale-badge",8:"atomic-block-components/add-to-cart",9:"atomic-block-components/button",10:"atomic-block-components/category-list",11:"atomic-block-components/image",12:"atomic-block-components/price",13:"atomic-block-components/rating",14:"atomic-block-components/sku",15:"atomic-block-components/stock-indicator",16:"atomic-block-components/summary",17:"atomic-block-components/tag-list",18:"atomic-block-components/title"}[e]||e)+".js"}(e);var s=new Error;o=function(t){i.onerror=i.onload=null,clearTimeout(u);var r=c[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",s.name="ChunkLoadError",s.type=n,s.request=o,r[1](s)}c[e]=void 0}};var u=setTimeout((function(){o({type:"timeout",target:i})}),12e4);i.onerror=i.onload=o,document.head.appendChild(i)}return Promise.all(t)},a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a.oe=function(e){throw console.error(e),e};var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var u=0;u<i.length;u++)t(i[u]);var l=s;return o.push([713,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},102:function(e,t){},103:function(e,t){!function(){e.exports=this.wp.coreData}()},104:function(e,t){},108:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(20),a=r.n(o),i=r(0),s=r(44),u=r(3),l=r(7),b=r.n(l);t.a=function(e){var t=e.className,r=e.item,n=e.isSelected,o=e.isLoading,l=e.onSelect,p=e.disabled,d=a()(e,["className","item","isSelected","isLoading","onSelect","disabled"]);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(s.c,c()({},d,{key:r.id,className:t,isSelected:n,item:r,onSelect:l,isSingle:!0,disabled:p})),n&&o&&Object(i.createElement)("div",{key:"loading",className:b()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(i.createElement)(u.Spinner,null)))}},113:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(58),a=r(148),i=r(5),s=r(24),u=r(43);t.a=function(e){var t=(Object(u.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)("div",{className:"wc-block-single-product__edit-card"},Object(n.createElement)("div",{className:"wc-block-single-product__edit-card-title"},Object(n.createElement)("a",{href:"".concat(i.ADMIN_URL,"post.php?post=").concat(t,"&action=edit"),target:"_blank",rel:"noopener noreferrer"},Object(c.__)("Edit this product's details","woo-gutenberg-products-block"),Object(n.createElement)(o.a,{srcElement:a.a,size:16}))),Object(n.createElement)("div",{className:"wc-block-single-product__edit-card-description"},Object(c.__)("Edit details such as title, price, description and more.","woo-gutenberg-products-block")))):null}},119:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(13),a=r.n(o),i=r(5),s=r(1);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var b=Object(i.getSetting)("countryLocale",{}),p=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(s.sprintf)(Object(s.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(t.index=parseInt(e.priority,10)),!0===e.hidden&&(t.required=!1),t},d=Object.entries(b).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,p(n)]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==d[r]?d[r]:{};return e.map((function(e){var r=i.defaultAddressFields[e]||{},c=n[e]||{},o=t[e]||{};return l(l(l({key:e},r),c),o)})).sort((function(e,t){return e.index-t.index}))}},120:function(e,t){!function(){e.exports=this.wp.wordcount}()},121:function(e,t,r){"use strict";r.d(t,"b",(function(){return v})),r.d(t,"a",(function(){return h}));var n=r(42),c=r.n(n),o=r(4),a=r.n(o),i=r(20),s=r.n(i),u=r(13),l=r.n(u),b=r(0),p=r(6),d=r(37),f=r.n(d);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===c()(t)?t:String(t)}var j=Object(b.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),v=function(){return Object(b.useContext)(j)},h=function(e){var t=e.children,r=Object(b.useState)({}),n=l()(r,2),c=n[0],o=n[1],i=Object(b.useCallback)((function(e){return c[e]}),[c]),u=Object(b.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),d=Object(b.useCallback)((function(e){o((function(t){if(!t[e])return t;t[e];return s()(t,[e].map(g))}))}),[]),m=Object(b.useCallback)((function(){o({})}),[]),v=Object(b.useCallback)((function(e){e&&o((function(t){return e=Object(p.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!f()(t[r],e))})),0===Object.values(e).length?t:O(O({},t),e)}))}),[]),h=Object(b.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=O(O({},r[e]),t);return f()(r[e],n)?r:O(O({},r),{},a()({},e,n))}))}),[]),y={getValidationError:i,setValidationErrors:v,clearValidationError:d,clearAllValidationErrors:m,hideValidationError:Object(b.useCallback)((function(e){h(e,{hidden:!0})}),[h]),showValidationError:Object(b.useCallback)((function(e){h(e,{hidden:!1})}),[h]),showAllValidationErrors:Object(b.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=O(O({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:O(O({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return Object(b.createElement)(j.Provider,{value:y},t)}},122:function(e,t,r){"use strict";var n=r(32),c=r.n(n),o=r(4),a=r.n(o),i=r(11),s=r.n(i),u=r(0),l=r(1),b=r(6),p=(r(2),r(44)),d=r(22),f=r(15),m=r.n(f),O=r(16),g=r.n(O),j=r(17),v=r.n(j),h=r(18),y=r.n(h),w=r(9),k=r.n(w);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=k()(e);if(t){var c=k()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var E=Object(d.createHigherOrderComponent)((function(e){var t=function(t){v()(n,t);var r=_(n);function n(){return m()(this,n),r.apply(this,arguments)}return g()(n,[{key:"render",value:function(){var t=this.props.selected,r=null==t;return Object(u.createElement)(e,s()({},this.props,{selected:r?[]:[t]}))}}]),n}(u.Component);return t.defaultProps={selected:null},t}),"withTransformSingleSelectToMultipleSelect"),P=r(255),C=r(31),S=r.n(C),N=r(12),x=r.n(N),D=r(10),B=r.n(D),R=r(37),A=r.n(R),L=r(39),T=r(41);function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function V(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=k()(e);if(t){var c=k()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return y()(this,r)}}var F=Object(d.createHigherOrderComponent)((function(e){var t=function(t){v()(n,t);var r=I(n);function n(){var e;m()(this,n);for(var t=arguments.length,c=new Array(t),o=0;o<t;o++)c[o]=arguments[o];return e=r.call.apply(r,[this].concat(c)),a()(x()(e),"state",{error:null,loading:!1,variations:{}}),a()(x()(e),"loadVariations",(function(){var t=e.props.products,r=e.state,n=r.loading,c=r.variations;if(!n){var o=e.getExpandedProduct();if(o&&!c[o]){var i=t.find((function(e){return e.id===o}));i.variations&&0!==i.variations.length?(e.setState({loading:!0}),Object(L.g)(o).then((function(t){var r=t.map((function(e){return V(V({},e),{},{parent:o})}));e.setState({variations:V(V({},e.state.variations),{},a()({},o,r)),loading:!1,error:null})})).catch(function(){var t=S()(B.a.mark((function t(r){var n;return B.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(T.a)(r);case 2:n=t.sent,e.setState({variations:V(V({},e.state.variations),{},a()({},o,null)),loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())):e.setState({variations:V(V({},e.state.variations),{},a()({},o,null)),loading:!1,error:null})}}})),e}return g()(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.selected,r=e.showVariations;t&&r&&this.loadVariations()}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isLoading,n=t.selected;t.showVariations&&(!A()(e.selected,n)||e.isLoading&&!r)&&this.loadVariations()}},{key:"isProductId",value:function(e){return this.props.products.some((function(t){return t.id===e}))}},{key:"findParentProduct",value:function(e){return this.props.products.filter((function(t){return t.variations&&t.variations.find((function(t){return t.id===e}))}))[0].id}},{key:"getExpandedProduct",value:function(){var e=this.props,t=e.isLoading,r=e.selected;if(!e.showVariations)return null;var n=r&&r.length?r[0]:null;return n?this.prevSelectedItem=n:this.prevSelectedItem&&(t||this.isProductId(this.prevSelectedItem)||(n=this.prevSelectedItem)),!t&&n?this.isProductId(n)?n:this.findParentProduct(n):null}},{key:"render",value:function(){var t=this.props,r=t.error,n=t.isLoading,c=this.state,o=c.error,a=c.loading,i=c.variations;return Object(u.createElement)(e,s()({},this.props,{error:o||r,expandedProduct:this.getExpandedProduct(),isLoading:n,variations:i,variationsLoading:a}))}}]),n}(u.Component);return a()(t,"defaultProps",{selected:[],showVariations:!1}),t}),"withProductVariations"),M=r(46),H=r(7),q=r.n(H),G=r(108);r(178);function Q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var W={list:Object(l.__)("Products","woo-gutenberg-products-block"),noItems:Object(l.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(l.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(l.__)("Product search results updated.","woo-gutenberg-products-block")},K=function(e){var t=e.expandedProduct,r=e.error,n=e.instanceId,o=e.isCompact,a=e.isLoading,i=e.onChange,d=e.onSearch,f=e.products,m=e.renderItem,O=e.selected,g=e.showVariations,j=e.variations,v=e.variationsLoading,h=function(e){var t=e.item,r=e.search,c=e.depth,o=void 0===c?0:c,i=e.isSelected,d=e.onSelect,f=t.variations&&Array.isArray(t.variations)?t.variations.length:0,m=q()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(o),"has-count",{"is-searching":r.length>0,"is-skip-level":0===o&&0!==t.parent,"is-variable":f>0});if(!t.breadcrumbs.length)return Object(u.createElement)(G.a,s()({},e,{className:q()(m,{"is-selected":i}),isSelected:i,item:t,onSelect:function(){return function(){d(t)()}},isLoading:a||v,countLabel:t.variations.length>0?Object(l.sprintf)(Object(l.__)("%1$d variations","woo-gutenberg-products-block"),t.variations.length):null,name:"products-".concat(n),"aria-label":Object(l.sprintf)(Object(l._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,"woo-gutenberg-products-block"),t.name,t.variations.length)}));var O=Object(b.isEmpty)(t.variation)?e:U(U({},e),{},{item:U(U({},e.item),{},{name:t.variation}),"aria-label":"".concat(t.breadcrumbs[0],": ").concat(t.variation)});return Object(u.createElement)(p.c,s()({},O,{className:m,name:"variations-".concat(n)}))};if(r)return Object(u.createElement)(M.a,{error:r});var y=j&&j[t]?j[t]:[],w=[].concat(c()(f),c()(y));return Object(u.createElement)(p.b,{className:"woocommerce-products",list:w,isCompact:o,isLoading:a,isSingle:!0,selected:w.filter((function(e){var t=e.id;return O.includes(t)})),onChange:i,renderItem:m||(g?h:null),onSearch:d,messages:W,isHierarchical:!0})};K.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1};t.a=E(Object(P.a)(F(Object(d.withInstanceId)(K))))},124:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=o},127:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(27),i=r(173);r(180);t.a=Object(i.a)((function(e){var t=e.className,r=e.instanceId,c=e.defaultValue,i=e.label,s=e.onChange,u=e.options,l=e.screenReaderLabel,b=e.readOnly,p=e.value,d="wc-block-components-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:o()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(a.Label,{label:i,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(n.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",defaultValue:c,onChange:s,readOnly:b,value:p},u.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},128:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(0),a=r(1),i=r(54),s=r(7),u=r.n(s),l=(r(2),r(135)),b=(r(207),function(e){var t=e.currency,r=e.maxPrice,n=e.minPrice,c=e.priceClassName,a=e.priceStyle;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:n,style:a})," — ",Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:r,style:a}))}),p=function(e){var t=e.currency,r=e.regularPriceClassName,n=e.regularPriceStyle,c=e.regularPrice,s=e.priceClassName,l=e.priceStyle,b=e.price;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("del",{className:u()("wc-block-components-product-price__regular",r),style:n},e)},value:c}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:","woo-gutenberg-products-block")),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("ins",{className:u()("wc-block-components-product-price__value","is-discounted",s),style:l},e)},value:b}))};t.a=function(e){var t=e.align,r=e.className,n=e.currency,a=e.format,s=void 0===a?"<price/>":a,d=e.maxPrice,f=void 0===d?null:d,m=e.minPrice,O=void 0===m?null:m,g=e.price,j=void 0===g?null:g,v=e.priceClassName,h=e.priceStyle,y=e.regularPrice,w=e.regularPriceClassName,k=e.regularPriceStyle,_=u()(r,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));var E=y&&j!==y,P=Object(o.createElement)("span",{className:u()("wc-block-components-product-price__value",v)});return E?P=Object(o.createElement)(p,{currency:n,price:j,priceClassName:v,priceStyle:h,regularPrice:y,regularPriceClassName:w,regularPriceStyle:k}):null!==O&&null!==f?P=Object(o.createElement)(b,{currency:n,maxPrice:f,minPrice:O,priceClassName:v,priceStyle:h}):null!==j&&(P=Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",v),currency:n,value:j,style:h})),Object(o.createElement)("span",{className:_},Object(l.a)(s,{price:P}))}},129:function(e,t,r){"use strict";var n=r(15),c=r.n(n),o=r(16),a=r.n(o),i=r(17),s=r.n(i),u=r(18),l=r.n(u),b=r(9),p=r.n(b),d=r(0),f=r(6),m=r(1),O=r(3);function g(e){var t=e.level,r={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return r.hasOwnProperty(t)?Object(d.createElement)(O.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(d.createElement)(O.Path,{d:r[t]})):null}function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=p()(e);if(t){var c=p()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return l()(this,r)}}var v=function(e){s()(r,e);var t=j(r);function r(){return c()(this,r),t.apply(this,arguments)}return a()(r,[{key:"createLevelControl",value:function(e,t,r){var n=e===t;return{icon:Object(d.createElement)(g,{level:e}),title:Object(m.sprintf)(Object(m.__)("Heading %d"),e),isActive:n,onClick:function(){return r(e)}}}},{key:"render",value:function(){var e=this,t=this.props,r=t.isCollapsed,n=void 0===r||r,c=t.minLevel,o=t.maxLevel,a=t.selectedLevel,i=t.onChange;return Object(d.createElement)(O.ToolbarGroup,{isCollapsed:n,icon:Object(d.createElement)(g,{level:a}),controls:Object(f.range)(c,o).map((function(t){return e.createLevelControl(t,a,i)}))})}}]),r}(d.Component);t.a=v},130:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n,c=r(4),o=r.n(c),a=r(6);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,i=t.callback,u=t.priority,b=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return b.set(a,{priority:u,callback:i}),s(s({},e),{},o()({},c,b));case n.REMOVE_EVENT_CALLBACK:return b.delete(a),s(s({},e),{},o()({},c,b))}}},132:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f})),r.d(t,"c",(function(){return m}));var n=r(13),c=r.n(n),o=r(40),a=r(23),i=r(0),s=r(37),u=r.n(s),l=r(76),b=r(149),p=r(83),d=function(e){var t=Object(p.a)();e=e||t;var r=Object(a.useSelect)((function(t){return t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)}),[e]),n=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setValueForQueryContext;return[r,Object(i.useCallback)((function(t){n(e,t)}),[e,n])]},f=function(e,t,r){var n=Object(p.a)();r=r||n;var c=Object(a.useSelect)((function(n){return n(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t)}),[r,e]),s=Object(a.useDispatch)(o.QUERY_STATE_STORE_KEY).setQueryValue;return[c,Object(i.useCallback)((function(t){s(r,e,t)}),[r,e,s])]},m=function(e,t){var r=Object(p.a)(),n=d(t=t||r),o=c()(n,2),a=o[0],s=o[1],f=Object(l.a)(a),m=Object(l.a)(e),O=Object(b.a)(m),g=Object(i.useRef)(!1);return Object(i.useEffect)((function(){u()(O,m)||(s(Object.assign({},f,m)),g.current=!0)}),[f,m,O,s]),g.current?[a,s]:[e,s]}},133:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(13),c=r.n(n),o=r(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},14:function(e,t,r){"use strict";r.d(t,"m",(function(){return o})),r.d(t,"k",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"h",(function(){return u})),r.d(t,"c",(function(){return l})),r.d(t,"d",(function(){return b})),r.d(t,"g",(function(){return p})),r.d(t,"f",(function(){return d})),r.d(t,"j",(function(){return f})),r.d(t,"i",(function(){return m})),r.d(t,"a",(function(){return O})),r.d(t,"b",(function(){return g})),r.d(t,"e",(function(){return j})),r.d(t,"p",(function(){return h})),r.d(t,"q",(function(){return y})),r.d(t,"n",(function(){return w})),r.d(t,"o",(function(){return k}));var n,c=r(5),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),a=o.pluginUrl+"assets/",i=o.pluginUrl+"build/",s=o.buildPhase,u=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,p=c.STORE_PAGES.privacy.permalink,d=c.STORE_PAGES.privacy.title,f=c.STORE_PAGES.terms.permalink,m=c.STORE_PAGES.terms.title,O=c.STORE_PAGES.cart.id,g=c.STORE_PAGES.cart.permalink,j=c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),v=r(26),h=function(e,t){if(s>2)return Object(v.registerBlockType)(e,t)},y=function(e,t){if(s>1)return Object(v.registerBlockType)(e,t)},w=function(){return s>2},k=function(){return s>1}},147:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(13),c=r.n(n),o=function(e){return e.reduce((function(e,t){var r=c()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{})}},148:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(n.createElement)("path",{fill:"#fff",d:"M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"})),Object(n.createElement)("g",{mask:"url(#external-mask)"},Object(n.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=o},149:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(8);function c(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},153:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return a})),r.d(t,"b",(function(){return i})),r.d(t,"d",(function(){return s}));var n=r(42),c=r.n(n),o=function(e){return"number"==typeof e},a=function(e){return"string"==typeof e},i=function(e){return!function(e){return null===e}(e)&&"object"===c()(e)};function s(e,t){return i(e)&&t in e}},160:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(14),o=Object(n.createElement)("img",{src:c.k+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}})},161:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(20),a=r.n(o),i=r(0),s=(r(2),r(29)),u=r(7),l=r.n(u);r(206);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))}},162:function(e,t,r){"use strict";r.d(t,"b",(function(){return k})),r.d(t,"a",(function(){return _}));var n=r(4),c=r.n(n),o=r(13),a=r.n(o),i=r(0),s=(r(2),r(23)),u=r(85),l=r(78),b=r(11),p=r.n(b),d=r(7),f=r.n(d),m=r(806),O=(r(208),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-success";case"info":case"warning":return"woocommerce-info"}return""}),g=function(e){var t=e.className,r=e.notices,n=e.removeNotice,c=r.filter((function(e){return"snackbar"!==e.type}));if(!c.length)return null;var o=f()(t,"wc-block-components-notices");return Object(i.createElement)("div",{className:o},c.map((function(e){return Object(i.createElement)(m.a,p()({key:"store-notice-"+e.id},e,{className:f()("wc-block-components-notices__notice","woocommerce-message",O(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)})))},j=r(810),v=function(e){var t=e.className,r=e.notices,n=e.removeNotice;if(e.isEditor)return null;var c=r.filter((function(e){return"snackbar"===e.type})),o=f()(t,"wc-block-components-notices__snackbar");return Object(i.createElement)(j.a,{notices:c,className:o,onRemove:n})};function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var w=Object(i.createContext)({notices:[],createNotice:function(e,t,r){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),k=function(){return Object(i.useContext)(w)},_=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,c=e.createNoticeContainer,o=void 0===c||c,b=e.context,p=void 0===b?"wc/core":b,d=Object(s.useDispatch)("core/notices"),f=d.createNotice,m=d.removeNotice,O=Object(i.useState)(!1),j=a()(O,2),h=j[0],k=j[1],_=Object(u.a)().dispatchStoreEvent,E=Object(l.b)().isEditor,P=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};f(e,t,y(y({},r),{},{context:r.context||p})),_("store-notice-create",{status:e,content:t,options:r})}),[f,_,p]),C=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;m(e,t)}),[m,p]),S=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};P("default",e,y(y({},t),{},{type:"snackbar"}))}),[P]),N={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(p)}}),[p]).notices,createNotice:P,createSnackbarNotice:S,removeNotice:C,context:p,setIsSuppressed:k},x=h?null:Object(i.createElement)(g,{className:n,notices:N.notices,removeNotice:N.removeNotice,isEditor:E}),D=h?null:Object(i.createElement)(v,{notices:N.notices,removeNotice:N.removeNotice,isEditor:E});return Object(i.createElement)(w.Provider,{value:N},o&&x,t,D)}},163:function(e,t,r){"use strict";var n=r(0),c=r(120),o=r(94),a=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},i=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},s=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},u=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;",n=i(e),c=n.split(" ").splice(0,t).join(" ");return Object(o.autop)(s(c,r))},l=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;",c=i(e),a=c.slice(0,t);if(r)return Object(o.autop)(s(a,n));var u=a.match(/([\s]+)/g),l=u?u.length:0,b=c.slice(0,t+l);return Object(o.autop)(s(b,n))};t.a=function(e){var t=e.source,r=e.maxLength,i=void 0===r?15:r,s=e.countType,b=void 0===s?"words":s,p=e.className,d=void 0===p?"":p,f=Object(n.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",n=Object(o.autop)(e),i=Object(c.count)(n,r);if(i<=t)return n;var s=a(n),b=Object(c.count)(s,r);return b<=t?s:"words"===r?u(s,t):l(s,t,"characters_including_spaces"===r)}(t,i,b)}),[t,i,b]);return Object(n.createElement)(n.RawHTML,{className:d},f)}},167:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(15),a=r.n(o),i=r(16),s=r.n(i),u=r(12),l=r.n(u),b=r(17),p=r.n(b),d=r(18),f=r.n(d),m=r(9),O=r.n(m),g=r(4),j=r.n(g),v=r(0),h=r(8);r(224);function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=O()(e);if(t){var c=O()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return f()(this,r)}}t.a=function(e){var t=function(t){p()(n,t);var r=y(n);function n(){var e;return a()(this,n),e=r.call(this),j()(l()(e),"scrollToTopIfNeeded",(function(){var t=e.scrollPointRef.current.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollPointRef.current.scrollIntoView()})),j()(l()(e),"moveFocusToTop",(function(t){var r=e.scrollPointRef.current.parentElement.querySelectorAll(t);r.length&&r[0].focus()})),j()(l()(e),"scrollToTop",(function(t){window&&Number.isFinite(window.innerHeight)&&(e.scrollToTopIfNeeded(),t&&t.focusableSelector&&e.moveFocusToTop(t.focusableSelector))})),e.scrollPointRef=Object(h.createRef)(),e}return s()(n,[{key:"render",value:function(){return Object(v.createElement)(v.Fragment,null,Object(v.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:this.scrollPointRef,"aria-hidden":!0}),Object(v.createElement)(e,c()({},this.props,{scrollToTop:this.scrollToTop})))}}]),n}(h.Component);return t.displayName="withScrollToTop",t}},171:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return s}));var n=r(5),c=r(119),o=r(21),a=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,c=void 0===n?"":n,o=e.city,a=void 0===o?"":o,i=e.postcode,s=void 0===i?"":i;return{country:r.trim(),state:c.trim(),city:a.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},i=function(e){var t=e.email,r=void 0===t?"":t;return Object(o.isEmail)(r)?r.trim():""},s=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(c.a)(t,{},e.country),o=Object.assign({},e);return r.forEach((function(t){var r=t.key,n=void 0===r?"":r,c=t.hidden;void 0!==c&&c&&function(e,t){return e in t}(n,e)&&(o[n]="")})),o}},174:function(e,t){},178:function(e,t){},180:function(e,t){},183:function(e,t){!function(){e.exports=this.wp.warning}()},184:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(40),c=r(23),o=r(0),a=r(76),i=r(133),s=function(e){var t=e.namespace,r=e.resourceName,s=e.resourceValues,u=void 0===s?[]:s,l=e.query,b=void 0===l?{}:l,p=e.shouldSelect,d=void 0===p||p;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");var f=Object(o.useRef)({results:[],isLoading:!0}),m=Object(a.a)(b),O=Object(a.a)(u),g=Object(i.a)(),j=Object(c.useSelect)((function(e){if(!d)return null;var c=e(n.COLLECTIONS_STORE_KEY),o=[t,r,m,O],a=c.getCollectionError.apply(c,o);return a&&g(a),{results:c.getCollection.apply(c,o),isLoading:!c.hasFinishedResolution("getCollection",o)}}),[t,r,O,m,d]);return null!==j&&(f.current=j),f.current}},19:function(e,t){!function(){e.exports=this.wp.apiFetch}()},206:function(e,t){},207:function(e,t){},208:function(e,t){},209:function(e,t){},21:function(e,t){!function(){e.exports=this.wp.url}()},22:function(e,t){!function(){e.exports=this.wp.compose}()},224:function(e,t){},23:function(e,t){!function(){e.exports=this.wp.data}()},24:function(e,t){!function(){e.exports=this.wp.blockEditor}()},255:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(31),a=r.n(o),i=r(15),s=r.n(i),u=r(16),l=r.n(u),b=r(12),p=r.n(b),d=r(17),f=r.n(d),m=r(18),O=r.n(m),g=r(9),j=r.n(g),v=r(0),h=r(10),y=r.n(h),w=r(6),k=r(22),_=(r(2),r(14)),E=r(39),P=r(41);function C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j()(e);if(t){var c=j()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return O()(this,r)}}var S=Object(k.createHigherOrderComponent)((function(e){var t=function(t){f()(o,t);var r,n=C(o);function o(){var e;return s()(this,o),(e=n.apply(this,arguments)).state={list:[],loading:!0},e.setError=e.setError.bind(p()(e)),e.debouncedOnSearch=Object(w.debounce)(e.onSearch.bind(p()(e)),400),e}return l()(o,[{key:"componentDidMount",value:function(){var e=this,t=this.props.selected;Object(E.h)({selected:t}).then((function(t){e.setState({list:t,loading:!1})})).catch(this.setError)}},{key:"componentWillUnmount",value:function(){this.debouncedOnSearch.cancel()}},{key:"onSearch",value:function(e){var t=this,r=this.props.selected;Object(E.h)({selected:r,search:e}).then((function(e){t.setState({list:e,loading:!1})})).catch(this.setError)}},{key:"setError",value:(r=a()(y.a.mark((function e(t){var r;return y.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(P.a)(t);case 2:r=e.sent,this.setState({list:[],loading:!1,error:r});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"render",value:function(){var t=this,r=this.state,n=r.error,o=r.list,a=r.loading;return Object(v.createElement)(e,c()({},this.props,{error:n,products:o,isLoading:a,onSearch:_.m.productCount>100?function(e){t.setState({loading:!0}),t.debouncedOnSearch(e)}:null}))}}]),o}(v.Component);return t.defaultProps={selected:[]},t}),"withSearchedProducts");t.a=S},256:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(7),s=r.n(i),u=r(27),l=r(43),b=r(71);r(487);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=e.align,n=Object(l.useInnerBlockLayoutContext)().parentClassName,i=Object(l.useProductDataContext)().product;if(!i.id||!i.on_sale)return null;var b="string"==typeof r?"wc-block-components-product-sale-badge--align-".concat(r):"";return Object(o.createElement)("div",{className:s()("wc-block-components-product-sale-badge",t,b,c()({},"".concat(n,"__product-onsale"),n))},Object(o.createElement)(u.Label,{label:Object(a.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(a.__)("Product on sale","woo-gutenberg-products-block")}))}))},258:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(121)),o=(r(209),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,i=e.elementId,s=void 0===i?"":i,u=Object(c.b)(),l=u.getValidationError,b=u.getValidationErrorId;if(!r){var p=l(a)||{};if(!p.message||p.hidden)return null;r=p.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:b(s)},r))})},26:function(e,t){!function(){e.exports=this.wp.blocks}()},27:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},29:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},3:function(e,t){!function(){e.exports=this.wp.components}()},30:function(e,t){!function(){e.exports=this.moment}()},309:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4V6h16v12z"}));t.a=o},33:function(e,t){!function(){e.exports=this.wp.primitives}()},34:function(e,t){!function(){e.exports=this.wp.dataControls}()},343:function(e,t){},344:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(14);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s={headingLevel:{type:"number",default:2},productLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(o.o)()&&(s=i(i({},s),{},{align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}})),t.a=s},345:function(e,t,r){"use strict";t.a={productLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}}},346:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(4),a=r.n(o),i=r(13),s=r.n(i),u=r(0),l=(r(2),r(1)),b=r(7),p=r.n(b),d=r(5),f=r(43),m=r(71),O=r(85),g=r(256);r(488);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var h=function(){return Object(u.createElement)("img",{src:d.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500})},y=function(e){var t=e.image,r=e.onLoad,n=e.loaded,o=e.showFullSize,a=e.fallbackAlt,i=t||{},s=i.thumbnail,l=i.src,b=i.srcset,p=i.sizes,d=v({alt:i.alt||a,onLoad:r,hidden:!n,src:s},o&&{src:l,srcSet:b,sizes:p});return Object(u.createElement)(u.Fragment,null,d.src&&Object(u.createElement)("img",c()({"data-testid":"product-image"},d)),!n&&Object(u.createElement)(h,null))};t.a=Object(m.withProductDataContext)((function(e){var t=e.className,r=e.imageSizing,n=void 0===r?"full-size":r,c=e.productLink,o=void 0===c||c,i=e.showSaleBadge,b=e.saleBadgeAlign,d=void 0===b?"right":b,m=Object(f.useInnerBlockLayoutContext)().parentClassName,j=Object(f.useProductDataContext)().product,w=Object(u.useState)(!1),k=s()(w,2),_=k[0],E=k[1],P=Object(O.a)().dispatchStoreEvent;if(!j.id)return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(h,null));var C=!!j.images.length,S=C?j.images[0]:null,N=o?"a":u.Fragment,x=Object(l.sprintf)(Object(l.__)("Link to %s","woo-gutenberg-products-block"),j.name),D=v(v({href:j.permalink,rel:"nofollow"},!C&&{"aria-label":x}),{},{onClick:function(){P("product-view-link",{product:j})}});return Object(u.createElement)("div",{className:p()(t,"wc-block-components-product-image",a()({},"".concat(m,"__product-image"),m))},Object(u.createElement)(N,o&&D,!!i&&Object(u.createElement)(g.default,{align:d,product:j}),Object(u.createElement)(y,{fallbackAlt:j.name,image:S,onLoad:function(){return E(!0)},loaded:_,showFullSize:"cropped"!==n})))}))},347:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(130),c=function(e,t){return function(r){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=n.a.addEventCallback(e,r,c);return t(o),function(){t(n.a.removeEventCallback(e,o.id))}}}},348:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},349:function(e,t,r){"use strict";var n=r(0),c=(r(2),r(7)),o=r.n(c),a=r(13),i=r.n(a),s=r(1),u=r(76),l=r(795),b="pristine",p="idle",d="disabled",f="processing",m="before_processing",O="after_processing",g={status:b,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},j="set_pristine",v="set_idle",h="set_disabled",y="set_processing",w="set_before_processing",k="set_after_processing",_="set_processing_response",E="set_has_error",P="set_no_error",C="set_quantity",S="set_request_params",N=j,x=v,D=h,B=y,R=w,A=k,L=_,T=E,z=P,V=C,I=S,F=function(){return{type:N}},M=function(){return{type:x}},H=function(){return{type:D}},q=function(){return{type:B}},G=function(){return{type:R}},Q=function(){return{type:A}},U=function(e){return{type:L,data:e}},W=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?T:z;return{type:t}},K=function(e){return{type:V,quantity:e}},Y=function(e){return{type:I,data:e}},$=r(4),J=r.n($);function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(Object(r),!0).forEach((function(t){J()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ee=j,te=v,re=h,ne=y,ce=w,oe=k,ae=_,ie=E,se=P,ue=C,le=S,be=b,pe=p,de=d,fe=f,me=m,Oe=O,ge=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,c=r.type,o=r.data;switch(c){case ee:e=g;break;case te:e=t.status!==pe?Z(Z({},t),{},{status:pe}):t;break;case re:e=t.status!==de?Z(Z({},t),{},{status:de}):t;break;case ue:e=n!==t.quantity?Z(Z({},t),{},{quantity:n}):t;break;case le:e=Z(Z({},t),{},{requestParams:Z(Z({},t.requestParams),o)});break;case ae:e=Z(Z({},t),{},{processingResponse:o});break;case ne:e=!1===(e=t.status!==fe?Z(Z({},t),{},{status:fe,hasError:!1}):t).hasError?e:Z(Z({},e),{},{hasError:!1});break;case ce:e=t.status!==me?Z(Z({},t),{},{status:me,hasError:!1}):t;break;case oe:e=t.status!==Oe?Z(Z({},t),{},{status:Oe}):t;break;case ie:e=t.hasError?t:Z(Z({},t),{},{hasError:!0}),e=t.status===fe||t.status===me?Z(Z({},e),{},{status:pe}):e;break;case se:e=t.hasError?Z(Z({},t),{},{hasError:!1}):t}return e!==t&&c!==ee&&e.status===be&&(e.status=pe),e},je=r(130),ve=r(347),he="add_to_cart_before_processing",ye="add_to_cart_after_processing_with_success",we="add_to_cart_after_processing_with_error",ke=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(ve.a)(ye,e),onAddToCartProcessingWithError:Object(ve.a)(we,e),onAddToCartBeforeProcessing:Object(ve.a)(he,e)}},_e=r(351),Ee=r(121),Pe=r(63),Ce=r(57),Se=Object(n.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),Ne=function(){return Object(n.useContext)(Se)},xe=function(e){var t=e.children,r=e.product,c=e.showFormElements,o=Object(n.useReducer)(ge,g),a=i()(o,2),b=a[0],j=a[1],v=Object(n.useReducer)(je.b,{}),h=i()(v,2),y=h[0],w=h[1],k=Object(u.a)(y),_=Object(Pe.a)(),E=_.addErrorNotice,P=_.removeNotices,C=Object(Ee.b)().setValidationErrors,S=Object(Ce.c)(),N=S.isSuccessResponse,x=S.isErrorResponse,D=S.isFailResponse,B=Object(n.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:ke(w).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:ke(w).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:ke(w).onAddToCartBeforeProcessing}}),[w]),R=Object(n.useMemo)((function(){return{resetForm:function(){j(F())},submitForm:function(){j(G())},setQuantity:function(e){j(K(e))},setHasError:function(e){j(W(e))},setRequestParams:function(e){j(Y(e))},setAfterProcessing:function(e){j(U(e)),j(Q())}}}),[]);Object(n.useEffect)((function(){var e=b.status,t=!r.id||!Object(l.a)(r);e!==d||t?e!==d&&t&&j(H()):j(M())}),[b.status,r,j]),Object(n.useEffect)((function(){b.status===m&&(P("error"),Object(_e.a)(k,he,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&E(t),r&&C(r)})),j(M())):j(q())})))}),[b.status,C,E,P,j,k]),Object(n.useEffect)((function(){if(b.status===O){var e={processingResponse:b.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(x(e)||D(e))&&r&&(t=!0,E(r,n?{context:n}:void 0))})),t};if(b.hasError)return void Object(_e.b)(k,we,e).then((function(r){if(!t(r)){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(s.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");E(c,{id:"add-to-cart"})}j(M())}));Object(_e.b)(k,ye,e).then((function(e){t(e)?j(W(!0)):j(M())}))}}),[b.status,b.hasError,b.processingResponse,R,E,x,D,N,k]);var A=Object(l.b)(r),L={product:r,productType:r.type||"simple",productIsPurchasable:Object(l.a)(r),productHasOptions:r.has_options||!1,supportsFormElements:A,showFormElements:c&&A,quantity:b.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:b.requestParams,isIdle:b.status===p,isDisabled:b.status===d,isProcessing:b.status===f,isBeforeProcessing:b.status===m,isAfterProcessing:b.status===O,hasError:b.hasError,eventRegistration:B,dispatchActions:R};return Object(n.createElement)(Se.Provider,{value:L},t)},De=r(19),Be=r.n(De),Re=r(29),Ae=r(52);function Le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Te=function(){var e=Ne(),t=e.dispatchActions,r=e.product,c=e.quantity,o=e.eventRegistration,a=e.hasError,u=e.isProcessing,l=e.requestParams,b=Object(Ee.b)(),p=b.hasValidationErrors,d=b.showAllValidationErrors,f=Object(Pe.a)(),m=f.addErrorNotice,O=f.removeNotice,g=Object(Ae.a)().receiveCart,j=Object(n.useState)(!1),v=i()(j,2),h=v[0],y=v[1],w=!a&&u,k=Object(n.useCallback)((function(){return!p||(d(),{type:"error"})}),[p,d]);Object(n.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(k,0);return function(){e()}}),[o,k]);var _=Object(n.useCallback)((function(){y(!0),O("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(r),!0).forEach((function(t){J()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Le(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:c},l);Be()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){Be.a.setNonce(e.headers),e.json().then((function(r){e.ok?g(r):(r.body&&r.body.message?m(Object(Re.decodeEntities)(r.body.message),{id:"add-to-cart"}):m(Object(s.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),y(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&g(e.data.cart),t.setHasError(),t.setAfterProcessing(e),y(!1)}))}))}),[r,m,O,g,t,c,l]);return Object(n.useEffect)((function(){w&&!h&&_()}),[w,_,h]),null},ze=function(e){var t=e.children,r=e.product,c=e.showFormElements;return Object(n.createElement)(Ee.a,null,Object(n.createElement)(xe,{product:r,showFormElements:c},t,Object(n.createElement)(Te,null)))},Ve=r(43),Ie=r(6),Fe=r(71),Me=(r(343),r(27)),He=r(58),qe=r(497),Ge=r(85),Qe=r(716),Ue=function(e){var t=e.className,r=e.href,c=e.text,o=e.onClick;return Object(n.createElement)(Me.Button,{className:t,href:r,onClick:o,rel:"nofollow"},c)},We=function(e){var t=e.className,r=e.quantityInCart,c=e.isProcessing,o=e.isDisabled,a=e.isDone,i=e.onClick;return Object(n.createElement)(Me.Button,{className:t,disabled:o,showSpinner:c,onClick:i},a&&r>0?Object(s.sprintf)(Object(s._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(s.__)("Add to cart","woo-gutenberg-products-block"),!!a&&Object(n.createElement)(He.a,{srcElement:qe.a,alt:Object(s.__)("Done","woo-gutenberg-products-block")}))},Ke=function(){var e=Ne(),t=e.showFormElements,r=e.productIsPurchasable,c=e.productHasOptions,o=e.product,a=e.productType,u=e.isDisabled,l=e.isProcessing,b=e.eventRegistration,p=e.hasError,d=e.dispatchActions,f=Object(Ve.useInnerBlockLayoutContext)().parentName,m=Object(Ge.a)().dispatchStoreEvent,O=Object(Qe.a)(o.id||0).cartQuantity,g=Object(n.useState)(!1),j=i()(g,2),v=j[0],h=j[1],y=o.add_to_cart||{url:"",text:""};return Object(n.useEffect)((function(){var e=b.onAddToCartAfterProcessingWithSuccess((function(){return p||h(!0),!0}),0);return function(){e()}}),[b,p]),(t||!c&&"simple"===a)&&r?Object(n.createElement)(We,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:O,isDisabled:u,isProcessing:l,isDone:v,onClick:function(){d.submitForm(),m("cart-add-item",{product:o,listName:f})}}):Object(n.createElement)(Ue,{className:"wc-block-components-product-add-to-cart-button",href:y.url,text:y.text||Object(s.__)("View Product","woo-gutenberg-products-block"),onClick:function(){m("product-view-link",{product:o,listName:f})}})},Ye=function(e){var t=e.disabled,r=e.min,c=e.max,o=e.value,a=e.onChange;return Object(n.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:c,hidden:1===c,disabled:t,onChange:function(e){a(e.target.value)}})},$e=function(e){var t=e.reason,r=void 0===t?Object(s.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},Je=function(){var e=Ne(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,i=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)($e,null):t.id&&!t.is_in_stock?Object(n.createElement)($e,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Ye,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ke,null))},Xe=(r(496),r(32)),Ze=r.n(Xe),et=r(3),tt=r(8),rt=r(258),nt={value:"",label:Object(s.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,c=void 0===r?[]:r,a=e.value,i=void 0===a?"":a,u=e.onChange,l=void 0===u?function(){}:u,b=e.errorMessage,p=void 0===b?Object(s.__)("Please select a value.","woo-gutenberg-products-block"):b,d=Object(Ee.b)(),f=d.getValidationError,m=d.setValidationErrors,O=d.clearValidationError,g=t,j=f(g)||{};return Object(tt.useEffect)((function(){i?O(g):m(J()({},g,{message:p,hidden:!0}))}),[i,g,p,O,m]),Object(tt.useEffect)((function(){return function(){O(g)}}),[g,O]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)(et.SelectControl,{label:Object(Re.decodeEntities)(t),value:i||"",options:[nt].concat(Ze()(c)),onChange:l,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":j.message&&!j.hidden})}),Object(n.createElement)(rt.a,{propertyName:g,elementId:g}))};function ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function at(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(r),!0).forEach((function(t){J()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var it=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var c=Object.keys(e);return n.filter((function(e){return c.every((function(n){var c=r[n]||"",o=t["id:"+e].attributes[n];return""===c||(null===o||o===c)}))}))},st=function(e,t,r){var n={},c=Object.keys(e),o=Object.values(r).filter(Boolean).length>0;return c.forEach((function(c){var a=e[c],i=at(at({},r),{},J()({},c,null)),s=o?it(e,t,i):null,u=null!==s?s.map((function(e){return t["id:"+e].attributes[c]})):null;n[c]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var r=e.name,n=e.slug;return null===t||t.includes(null)||t.includes(n)?{value:n,label:Object(Re.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n};function ut(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ut(Object(r),!0).forEach((function(t){J()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bt=function(e){var t=e.attributes,r=e.variationAttributes,c=e.setRequestParams,o=Object(u.a)(t),a=Object(u.a)(r),s=Object(n.useState)(0),l=i()(s,2),b=l[0],p=l[1],d=Object(n.useState)({}),f=i()(d,2),m=f[0],O=f[1],g=Object(n.useMemo)((function(){return st(o,a,m)}),[m,o,a]);return Object(n.useEffect)((function(){Object.values(m).filter((function(e){return""!==e})).length===Object.keys(o).length?p(function(e,t,r){return it(e,t,r)[0]||0}(o,a,m)):b>0&&p(0)}),[m,b,o,a]),Object(n.useEffect)((function(){c({id:b,variation:Object.keys(m).map((function(e){return{attribute:e,value:m[e]}}))})}),[c,b,m]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return Object(n.createElement)(ct,{key:e,attributeName:e,options:g[e],value:m[e],onChange:function(t){O(lt(lt({},m),{},J()({},e,t)))}})})))},pt=function(e){var t=e.product,r=e.dispatchers,c=function(e){return e?Object(Ie.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(c).length||0===o.length?null:Object(n.createElement)(bt,{attributes:c,variationAttributes:o,setRequestParams:r.setRequestParams})},dt=function(){var e=Ne(),t=e.product,r=e.quantity,c=e.minQuantity,o=e.maxQuantity,a=e.dispatchActions,i=e.isDisabled;return t.id&&!t.is_purchasable?Object(n.createElement)($e,null):t.id&&!t.is_in_stock?Object(n.createElement)($e,{reason:Object(s.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(pt,{product:t,dispatchers:a}),Object(n.createElement)(Ye,{value:r,min:c,max:o,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Ke,null))},ft=function(){return Object(n.createElement)(Ke,null)},mt=function(){return Object(n.createElement)(et.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},Ot=function(){return Object(n.createElement)(mt,null)},gt=function(){var e=Ne(),t=e.showFormElements,r=e.productType;return t?"variable"===r?Object(n.createElement)(dt,null):"grouped"===r?Object(n.createElement)(Ot,null):"external"===r?Object(n.createElement)(ft,null):"simple"===r||"variation"===r?Object(n.createElement)(Je,null):null:Object(n.createElement)(Ke,null)};t.a=Object(Fe.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,c=Object(Ve.useProductDataContext)().product,a=o()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Ie.isEmpty)(c)});return Object(n.createElement)(ze,{product:c,showFormElements:r},Object(n.createElement)("div",{className:a},Object(n.createElement)(gt,null)))}))},350:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(43),u=r(24),l=r(14),b=function(e){var t=e.color,r=e.fontSize;return Object(l.o)()?{color:t,fontSize:r}:{}},p=r(71),d=r(161),f=r(85);r(486),t.a=Object(p.withProductDataContext)((function(e){var t,r,n,a=e.className,p=e.headingLevel,m=void 0===p?2:p,O=e.productLink,g=void 0===O||O,j=e.align,v=e.color,h=e.customColor,y=e.fontSize,w=e.customFontSize,k=Object(s.useInnerBlockLayoutContext)().parentClassName,_=Object(s.useProductDataContext)().product,E=Object(f.a)().dispatchStoreEvent,P="h".concat(m),C=Object(u.getColorClassName)("color",v),S=Object(u.getFontSizeClass)(y),N=i()((t={"has-text-color":v||h,"has-font-size":y||w},c()(t,C,C),c()(t,S,S),t));return _.id?Object(o.createElement)(P,{className:i()(a,"wc-block-components-product-title",(r={},c()(r,"".concat(k,"__product-title"),k),c()(r,"wc-block-components-product-title--align-".concat(j),j&&Object(l.o)()),r))},Object(o.createElement)(d.a,{className:i()(c()({},N,Object(l.o)())),disabled:!g,name:_.name,permalink:_.permalink,rel:g?"nofollow":null,style:b({color:h,fontSize:w}),onClick:function(){E("product-view-link",{product:_})}})):Object(o.createElement)(P,{className:i()(a,"wc-block-components-product-title",(n={},c()(n,"".concat(k,"__product-title"),k),c()(n,"wc-block-components-product-title--align-".concat(j),j&&Object(l.o)()),c()(n,N,Object(l.o)()),n)),style:b({color:h,fontSize:w})})}))},351:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return f}));var n=r(42),c=r.n(n),o=r(31),a=r.n(o),i=r(10),s=r.n(i),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(57);function b(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw o}}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var d=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,l,p,d;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],i=b(o),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return p=l.value,e.prev=7,e.next=10,Promise.resolve(p.callback(n));case 10:d=e.sent,"object"===c()(d)&&a.push(d),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(t,r,n){return e.apply(this,arguments)}}(),f=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,p,d,f;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,r),i=b(a),e.prev=3,i.s();case 5:if((p=i.n()).done){e.next=28;break}return d=p.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:if(f=e.sent,"object"===c()(f)&&null!==f){e.next=13;break}return e.abrupt("continue",26);case 13:if(f.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(f)&&!Object(l.b)(f)){e.next=18;break}return o.push(f),e.abrupt("return",o);case 18:o.push(f),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},37:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return d})),r.d(t,"e",(function(){return f})),r.d(t,"b",(function(){return m})),r.d(t,"i",(function(){return O})),r.d(t,"f",(function(){return g})),r.d(t,"c",(function(){return j})),r.d(t,"d",(function(){return v})),r.d(t,"g",(function(){return h})),r.d(t,"a",(function(){return y}));var n=r(4),c=r.n(n),o=r(21),a=r(19),i=r.n(a),s=r(6),u=r(5),l=r(14);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,u=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,i=void 0===a?[]:a,s=l.m.productCount>100,u={per_page:s?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},b=[Object(o.addQueryArgs)("/wc/store/products",p(p({},u),i))];return s&&r.length&&b.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r})),b}({selected:r,search:c,queryArgs:void 0===a?[]:a});return Promise.all(u.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return p(p({},e),{},{parent:0})}))})).catch((function(e){throw e}))},f=function(e){return i()({path:"/wc/store/products/".concat(e)})},m=function(){return i()({path:"wc/store/products/attributes"})},O=function(e){return i()({path:"wc/store/products/attributes/".concat(e,"/terms")})},g=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(u.getSetting)("limitTags",!1),a=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&a.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),a}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")}))},j=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products/categories",p({per_page:0},e))})},v=function(e){return i()({path:"wc/store/products/categories/".concat(e)})},h=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},y=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},40:function(e,t){!function(){e.exports=this.wc.wcBlocksData}()},41:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u}));var n=r(31),c=r.n(n),o=r(10),a=r.n(o),i=r(1),s=function(){var e=c()(a.a.mark((function e(t){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},43:function(e,t){!function(){e.exports=this.wc.wcSharedContext}()},449:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(128),u=r(59),l=r(43),b=r(24),p=r(14),d=r(71);t.default=Object(d.withProductDataContext)((function(e){var t,r,n,a,d,f,m,O=e.className,g=e.align,j=e.fontSize,v=e.customFontSize,h=e.saleFontSize,y=e.customSaleFontSize,w=e.color,k=e.customColor,_=e.saleColor,E=e.customSaleColor,P=Object(l.useInnerBlockLayoutContext)().parentClassName,C=Object(l.useProductDataContext)().product,S=i()(O,c()({},"".concat(P,"__product-price"),P));if(!C.id)return Object(o.createElement)(s.a,{align:g,className:S});var N=Object(b.getColorClassName)("color",w),x=Object(b.getFontSizeClass)(j),D=Object(b.getColorClassName)("color",_),B=Object(b.getFontSizeClass)(h),R=i()((t={"has-text-color":w||k,"has-font-size":j||v},c()(t,N,N),c()(t,x,x),t)),A=i()((r={"has-text-color":_||E,"has-font-size":h||y},c()(r,D,D),c()(r,B,B),r)),L={color:k,fontSize:v},T={color:E,fontSize:y},z=C.prices,V=Object(u.getCurrencyFromPriceResponse)(z),I=z.price!==z.regular_price,F=I?i()((n={},c()(n,"".concat(P,"__product-price__value"),P),c()(n,A,Object(p.o)()),n)):i()((a={},c()(a,"".concat(P,"__product-price__value"),P),c()(a,R,Object(p.o)()),a)),M=I?T:L;return Object(o.createElement)(s.a,{align:g,className:S,currency:V,price:z.price,priceClassName:F,priceStyle:Object(p.o)()?M:{},minPrice:null==z||null===(d=z.price_range)||void 0===d?void 0:d.min_amount,maxPrice:null==z||null===(f=z.price_range)||void 0===f?void 0:f.max_amount,regularPrice:z.regular_price,regularPriceClassName:i()((m={},c()(m,"".concat(P,"__product-price__regular"),P),c()(m,R,Object(p.o)()),m)),regularPriceStyle:Object(p.o)()?L:{}})}))},45:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},450:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(1)),i=r(7),s=r.n(i),u=r(43),l=r(71),b=(r(489),function(e){var t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0});t.default=Object(l.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product,i=b(n);if(!i)return null;var l={width:i/5*100+"%"},p=Object(a.sprintf)(Object(a.__)("Rated %f out of 5","woo-gutenberg-products-block"),i);return Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-rating",c()({},"".concat(r,"__product-rating"),r))},Object(o.createElement)("div",{className:s()("wc-block-components-product-rating__stars","".concat(r,"__product-rating__stars")),role:"img","aria-label":p},Object(o.createElement)("span",{style:l},p)))}))},451:function(e,t,r){"use strict";r.r(t);var n=r(11),c=r.n(n),o=r(4),a=r.n(o),i=r(0),s=(r(2),r(7)),u=r.n(s),l=r(1),b=r(85),p=r(716),d=r(29),f=r(43),m=r(71),O=(r(490),function(e){var t=e.product,r=t.id,n=t.permalink,o=t.add_to_cart,a=t.has_options,s=t.is_purchasable,f=t.is_in_stock,m=Object(b.a)().dispatchStoreEvent,O=Object(p.a)(r),g=O.cartQuantity,j=O.addingToCart,v=O.addToCart,h=Number.isFinite(g)&&g>0,y=!a&&s&&f,w=Object(d.decodeEntities)((null==o?void 0:o.description)||""),k=h?Object(l.sprintf)(Object(l._n)("%d in cart","%d in cart",g,"woo-gutenberg-products-block"),g):Object(d.decodeEntities)((null==o?void 0:o.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),_=y?"button":"a",E={};return y?E.onClick=function(){v(),m("cart-add-item",{product:t})}:(E.href=n,E.rel="nofollow",E.onClick=function(){m("product-view-link",{product:t})}),Object(i.createElement)(_,c()({"aria-label":w,className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:j,added:h}),disabled:j},E),k)}),g=function(){return Object(i.createElement)("button",{className:u()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};t.default=Object(m.withProductDataContext)((function(e){var t=e.className,r=Object(f.useInnerBlockLayoutContext)().parentClassName,n=Object(f.useProductDataContext)().product;return Object(i.createElement)("div",{className:u()(t,"wp-block-button","wc-block-components-product-button",a()({},"".concat(r,"__product-add-to-cart"),r))},n.id?Object(i.createElement)(O,{product:n}):Object(i.createElement)(g,null))}))},453:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=(r(2),r(7)),i=r.n(a),s=r(163),u=r(14),l=r(43),b=r(71);r(491);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(l.useInnerBlockLayoutContext)().parentClassName,n=Object(l.useProductDataContext)().product;if(!n)return Object(o.createElement)("div",{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r))});var a=n.short_description?n.short_description:n.description;return a?Object(o.createElement)(s.a,{className:i()(t,"wc-block-components-product-summary",c()({},"".concat(r,"__product-summary"),r)),source:a,maxLength:150,countType:u.m.wordCountType||"words"}):null}))},454:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(43),l=r(71);r(492);t.default=Object(l.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product.sku;return n?Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-sku",c()({},"".concat(r,"__product-sku"),r))},Object(a.__)("SKU:","woo-gutenberg-products-block")," ",Object(o.createElement)("strong",null,n)):null}))},455:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(43),l=r(6),b=r(71);r(493);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(l.isEmpty)(n.categories)?null:Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-category-list",c()({},"".concat(r,"__product-category-list"),r))},Object(a.__)("Categories:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.categories).map((function(e){var t=e.name,r=e.link,n=e.slug;return Object(o.createElement)("li",{key:"category-list-item-".concat(n)},Object(o.createElement)("a",{href:r},t))}))))}))},456:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(43),l=r(6),b=r(71);r(494);t.default=Object(b.withProductDataContext)((function(e){var t=e.className,r=Object(u.useInnerBlockLayoutContext)().parentClassName,n=Object(u.useProductDataContext)().product;return Object(l.isEmpty)(n.tags)?null:Object(o.createElement)("div",{className:s()(t,"wc-block-components-product-tag-list",c()({},"".concat(r,"__product-tag-list"),r))},Object(a.__)("Tags:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.tags).map((function(e){var t=e.name,r=e.link,n=e.slug;return Object(o.createElement)("li",{key:"tag-list-item-".concat(n)},Object(o.createElement)("a",{href:r},t))}))))}))},457:function(e,t,r){"use strict";r.r(t);var n=r(4),c=r.n(n),o=r(0),a=r(1),i=(r(2),r(7)),s=r.n(i),u=r(43),l=r(71),b=(r(495),function(e){return Object(a.sprintf)(Object(a.__)("%d left in stock","woo-gutenberg-products-block"),e)}),p=function(e,t){return t?Object(a.__)("Available on backorder","woo-gutenberg-products-block"):e?Object(a.__)("In Stock","woo-gutenberg-products-block"):Object(a.__)("Out of Stock","woo-gutenberg-products-block")};t.default=Object(l.withProductDataContext)((function(e){var t,r=e.className,n=Object(u.useInnerBlockLayoutContext)().parentClassName,a=Object(u.useProductDataContext)().product;if(!a.id||!a.is_purchasable)return null;var i=!!a.is_in_stock,l=a.low_stock_remaining,d=a.is_on_backorder;return Object(o.createElement)("div",{className:s()(r,"wc-block-components-product-stock-indicator",(t={},c()(t,"".concat(n,"__stock-indicator"),n),c()(t,"wc-block-components-product-stock-indicator--in-stock",i),c()(t,"wc-block-components-product-stock-indicator--out-of-stock",!i),c()(t,"wc-block-components-product-stock-indicator--low-stock",!!l),c()(t,"wc-block-components-product-stock-indicator--available-on-backorder",!!d),t))},l?b(l):p(i,d))}))},46:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(45));t.a=function(e){var t,r,a,i=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=i).message,a=t.type,r?"general"===a?Object(n.createElement)("span",null,Object(c.__)("The following error was returned","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):"api"===a?Object(n.createElement)("span",null,Object(c.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(o.escapeHTML)(r))):r:Object(c.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))}},48:function(e,t){!function(){e.exports=this.wp.keycodes}()},486:function(e,t){},487:function(e,t){},488:function(e,t){},489:function(e,t){},490:function(e,t){},491:function(e,t){},492:function(e,t){},493:function(e,t){},494:function(e,t){},495:function(e,t){},496:function(e,t){},497:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},5:function(e,t){!function(){e.exports=this.wc.wcSettings}()},50:function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},51:function(e,t){!function(){e.exports=this.wp.hooks}()},52:function(e,t,r){"use strict";r.d(t,"a",(function(){return y}));var n=r(13),c=r.n(n),o=r(4),a=r.n(o),i=r(6),s=r(0),u=r(40),l=r(23),b=r(29),p=r(147),d=r(171),f=r(78);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},j=O(O({},g),{},{email:"",phone:""}),v=function(e){return Object(p.a)(Object.entries(e).map((function(e){var t=c()(e,2),r=t[0],n=t[1];return[r,Object(b.decodeEntities)(n)]})))},h={cartCoupons:[],cartItems:[],cartFees:[],cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:[],cartTotals:{total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:[],currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},cartIsLoading:!0,cartErrors:[],billingAddress:j,shippingAddress:g,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(f.b)(),r=t.isEditor,n=t.previewData,c=(null==n?void 0:n.previewCart)||{},o=e.shouldSelect,a=Object(s.useRef)(),b=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!o)return h;if(r)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:[],cartTotals:c.totals,cartIsLoading:!1,cartErrors:[],billingAddress:j,shippingAddress:g,extensions:{},shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var a=e(u.CART_STORE_KEY),i=a.getCartData(),s=a.getCartErrors(),l=a.getCartTotals(),b=!a.hasFinishedResolution("getCartData"),p=a.isCustomerDataUpdating(),f=n(u.CART_STORE_KEY).receiveCart,m=v(i.billingAddress),O=i.needsShipping?v(i.shippingAddress):m,y=i.fees.map((function(e){return v(e)}));return{cartCoupons:i.coupons,cartItems:i.items||[],cartFees:y,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors||[],cartTotals:l,cartIsLoading:b,cartErrors:s,billingAddress:Object(d.a)(m),shippingAddress:Object(d.a)(O),extensions:i.extensions||{},shippingRates:i.shippingRates||[],shippingRatesLoading:p,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements||[],receiveCart:f}}),[o]);return a.current&&Object(i.isEqual)(a.current,b)||(a.current=b),a.current}},54:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(4),a=r.n(o),i=r(20),s=r.n(i),u=r(0),l=r(166),b=r(7),p=r.n(b);r(174);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}))}},57:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return b}));var n,c,o=r(153);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},i=function(e){return a(e,n.SUCCESS)},s=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},b=function(){return{responseTypes:n,noticeContexts:c,shouldRetry:l,isSuccessResponse:i,isErrorResponse:s,isFailResponse:u}}},58:function(e,t,r){"use strict";var n=r(4),c=r.n(n),o=r(20),a=r.n(o),i=r(0);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}},59:function(e,t){!function(){e.exports=this.wc.priceFormat}()},6:function(e,t){!function(){e.exports=this.lodash}()},61:function(e,t){!function(){e.exports=this.wp.deprecated}()},63:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(4),c=r.n(n),o=r(0),a=r(162);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,c=e.createSnackbarNotice,i=e.setIsSuppressed,u=Object(o.useRef)(t);Object(o.useEffect)((function(){u.current=t}),[t]);var l=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return u.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),b=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,s({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c(e,t)}}}),[r,c]);return s(s(s({notices:t},l),b),{},{setIsSuppressed:i})}},685:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"}));t.a=o},692:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42zM13 20.01L4 11V4h7v-.01l9 9-7 7.02z"}),Object(n.createElement)("circle",{cx:"6.5",cy:"6.5",r:"1.5"}),Object(n.createElement)("path",{d:"M8.9 12.55c0 .57.23 1.07.6 1.45l3.5 3.5 3.5-3.5c.37-.37.6-.89.6-1.45 0-1.13-.92-2.05-2.05-2.05-.57 0-1.08.23-1.45.6l-.6.6-.6-.59c-.37-.38-.89-.61-1.45-.61-1.13 0-2.05.92-2.05 2.05z"}));t.a=o},700:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}));t.a=o},701:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),c=r(14),o=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:Object(n.__)("Fly your WordPress banner with this beauty! Deck out your office space or add it to your kids walls. This banner will spruce up any space it’s hung!","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",price:"7.99",price_html:'<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>7.99</span>',images:[{id:1,src:c.k+"img/pennant.jpg",thumbnail:c.k+"img/pennant.jpg",name:"pennant-1.jpg",alt:"WordPress Pennant",srcset:"",sizes:""}],average_rating:5,review_count:1,prices:{currency_code:"GBP",decimal_separator:".",thousand_separator:",",decimals:2,price_prefix:"£",price_suffix:"",price:"7.99",regular_price:"9.99",sale_price:"7.99",price_range:null},add_to_cart:{text:Object(n.__)("Add to cart","woo-gutenberg-products-block"),description:Object(n.__)("Add to cart","woo-gutenberg-products-block")},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},706:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}));t.a=o},71:function(e,t){!function(){e.exports=this.wc.wcSharedHocs}()},713:function(e,t,r){e.exports=r(765)},714:function(e,t){},715:function(e,t){},716:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(13),c=r.n(n),o=r(0),a=r(23),i=r(40),s=r(29),u=r(52),l=r(63),b=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},p=function(e){var t=Object(a.useDispatch)(i.CART_STORE_KEY).addItemToCart,r=Object(u.a)(),n=r.cartItems,p=r.cartIsLoading,d=Object(l.a)(),f=d.addErrorNotice,m=d.removeNotice,O=Object(o.useState)(!1),g=c()(O,2),j=g[0],v=g[1],h=Object(o.useRef)(b(n,e));return Object(o.useEffect)((function(){var t=b(n,e);t!==h.current&&(h.current=t)}),[n,e]),{cartQuantity:Number.isFinite(h.current)?h.current:0,addingToCart:j,cartIsLoading:p,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return v(!0),t(e,r).then((function(){m("add-to-cart")})).catch((function(e){f(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){v(!1)}))}}}},718:function(e,t,r){"use strict";var n=r(0),c=r(33),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));t.a=o},719:function(e,t){},72:function(e,t){!function(){e.exports=this.wp.dom}()},720:function(e,t){},721:function(e,t){},722:function(e,t){},73:function(e,t){!function(){e.exports=this.ReactDOM}()},74:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(15),a=r.n(o),i=r(16),s=r.n(i),u=r(12),l=r.n(u),b=r(17),p=r.n(b),d=r(18),f=r.n(d),m=r(9),O=r.n(m),g=r(0),j=r(6),v=r(7),h=r.n(v),y=r(3),w=r(22);r(104);function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=O()(e);if(t){var c=O()(this).constructor;r=Reflect.construct(n,arguments,c)}else r=n.apply(this,arguments);return f()(this,r)}}var _=function(e){p()(r,e);var t=k(r);function r(){var e;return a()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(l()(e)),e}return s()(r,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,o=r.checked,a=r.instanceId,i=r.className,s=r.help,u=r.options,l=r.value,b="inspector-toggle-button-control-".concat(a);return s&&(e=Object(j.isFunction)(s)?s(o):s),Object(g.createElement)(y.BaseControl,{id:b,help:e,className:h()("components-toggle-button-control",i)},Object(g.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(g.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},u.map((function(e,r){var o={};return l===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(g.createElement)(y.Button,c()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},o),e.label)}))))}}]),r}(g.Component);t.a=Object(w.withInstanceId)(_)},76:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(37),o=r.n(c);function a(e){var t=Object(n.useRef)();return void 0!==t.current&&o()(e,t.current)||(t.current=e),t.current}},765:function(e,t,r){"use strict";r.r(t),r.d(t,"blockSettings",(function(){return qr}));var n=r(4),c=r.n(n),o=r(11),a=r.n(o),i=r(0),s=r(1),u=r(24),l=r(26),b=r(58),p=r(33),d=Object(i.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(i.createElement)("path",{d:"M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"})),f=r(14),m=r(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.n)()?null:["@woocommerce/all-products","@woocommerce/single-product"],save:g,deprecated:[{save:function(){}}]},v=r(344),h=r(3),y=r(22),w=r(129),k=r(350),_=r(13),E=r.n(_),P=r(122),C=r(20),S=r.n(C);r(715);var N=function(e){var t=e.className,r=void 0===t?"":t,n=S()(e,["className"]),c=O()("wc-block-text-toolbar-button",r);return Object(i.createElement)(h.Button,a()({className:c},n))},x=r(43),D=(r(714),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=E()(l,2),p=b[0],d=b[1];return n.hasContext?Object(i.createElement)(t,r):Object(i.createElement)(i.Fragment,null,p?Object(i.createElement)(h.Placeholder,{icon:e.icon||"",label:e.label||"",className:"wc-atomic-blocks-product"},!!e.description&&Object(i.createElement)("div",null,e.description),Object(i.createElement)("div",{className:"wc-atomic-blocks-product__selection"},Object(i.createElement)(P.a,{selected:a||0,showVariations:!0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];o({productId:e[0]?e[0].id:0})}}),Object(i.createElement)(h.Button,{isSecondary:!0,disabled:!a,onClick:function(){d(!1)}},Object(s.__)("Done","woo-gutenberg-products-block")))):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(h.ToolbarGroup,null,Object(i.createElement)(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"})),R=Object(s.__)("Product Title","woo-gutenberg-products-block"),A=Object(i.createElement)(b.a,{srcElement:B}),L=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.o)()&&Object(i.createElement)(u.AlignmentToolbar,{value:p,onChange:function(e){a({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Content","woo-gutenberg-products-block")},Object(i.createElement)(h.ToggleControl,{label:Object(s.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(s.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:b,onChange:function(){return a({productLink:!b})}})),Object(f.o)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Text settings","woo-gutenberg-products-block")},Object(i.createElement)(u.FontSizePicker,{value:r.size,onChange:n})),Object(i.createElement)(u.PanelColorSettings,{title:Object(s.__)("Color settings","woo-gutenberg-products-block"),colorSettings:[{value:t.color,onChange:c,label:Object(s.__)("Text color","woo-gutenberg-products-block")}]}))),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(k.a,o)))},z=Object(f.o)()?Object(y.compose)([Object(u.withFontSizes)("fontSize"),Object(u.withColors)("color",{textColor:"color"}),D({icon:A,label:R,description:Object(s.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(T):T;function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function I(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var F={title:R,description:L,icon:{src:A,foreground:"#874FB9"},attributes:v.a,edit:z};Object(l.registerBlockType)("woocommerce/product-title",I(I({},j),F));var M=r(449),H=r(309),q=Object(s.__)("Product Price","woo-gutenberg-products-block"),G=Object(i.createElement)(b.a,{srcElement:H.a}),Q=Object(s.__)("Display the price of a product.","woo-gutenberg-products-block"),U=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")})))},W=function(e){var t=e.fontSize,r=e.saleFontSize,n=e.setFontSize,c=e.setSaleFontSize,o=e.color,a=e.saleColor,l=e.setColor,b=e.setSaleColor,p=e.attributes,d=e.setAttributes,m=p.align;return Object(i.createElement)(i.Fragment,null,Object(f.o)()&&Object(i.createElement)(u.BlockControls,null,Object(i.createElement)(u.AlignmentToolbar,{value:m,onChange:function(e){d({align:e})}})),Object(i.createElement)(u.InspectorControls,null,Object(f.o)()&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Price","woo-gutenberg-products-block")},Object(i.createElement)(U,{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)(U,{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.o)()?Object(y.compose)([Object(u.withFontSizes)("fontSize"),Object(u.withFontSizes)("saleFontSize"),Object(u.withFontSizes)("originalFontSize"),Object(u.withColors)("color",{textColor:"color"}),Object(u.withColors)("saleColor",{textColor:"saleColor"}),Object(u.withColors)("originalColor",{textColor:"originalColor"}),D({icon:G,label:q,description:Object(s.__)("Choose a product to display its price.","woo-gutenberg-products-block")})])(W):W;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 $(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 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.o)()&&(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:Q,icon:{src:G,foreground:"#874FB9"},attributes:J,edit:K};Object(l.registerBlockType)("woocommerce/product-price",Z(Z({},j),ee));var te=r(345),re=r(135),ne=r(74),ce=r(5),oe=r(346),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(450),Oe=r(700),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(451),_e=r(718),Ee=Object(s.__)("Add to Cart Button","woo-gutenberg-products-block"),Pe=Object(i.createElement)(b.a,{srcElement:_e.a});function Ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Se(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ne={title:Ee,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:Ee,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",Se(Se({},j),Ne));var xe={productId:{type:"number",default:0}},De=r(453),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"})),Re=Object(s.__)("Product Summary","woo-gutenberg-products-block"),Ae=Object(i.createElement)(b.a,{srcElement:Be});function Le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Le(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ze={title:Re,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:Re,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),ze));var Ve={productId:{type:"number",default:0}},Ie=r(256),Fe=r(692),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 Ge(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:Ve,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",Ge(Ge({},j),Qe));var Ue={productId:{type:"number",default:0}},We=r(113),Ke=r(454),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"})),$e=Object(s.__)("Product SKU","woo-gutenberg-products-block"),Je=Object(i.createElement)(b.a,{srcElement:Ye});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:$e,description:Object(s.__)("Display the SKU of a product.","woo-gutenberg-products-block"),icon:{src:Je,foreground:"#874FB9"},attributes:Ue,edit:D({icon:Je,label:$e,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)(We.a,null),Object(i.createElement)(Ke.default,t))}))};Object(f.p)("woocommerce/product-sku",Ze(Ze({},j),et));var tt={productId:{type:"number",default:0}},rt=r(455),nt=r(685),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)(We.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(rt.default,t)))}))};Object(f.p)("woocommerce/product-category-list",it(it({},j),st));var ut={productId:{type:"number",default:0}},lt=r(456),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)(We.a,null),Object(i.createElement)(h.Disabled,null,Object(i.createElement)(lt.default,t)))}))};Object(f.p)("woocommerce/product-tag-list",ft(ft({},j),mt));var Ot={productId:{type:"number",default:0}},gt=r(457),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)(We.a,null),Object(i.createElement)(gt.default,t))}))};Object(f.p)("woocommerce/product-stock-indicator",wt(wt({},j),kt));var _t=r(795),Et=(r(343),r(349)),Pt=Object(s.__)("Add to Cart","woo-gutenberg-products-block"),Ct=Object(i.createElement)(b.a,{srcElement:_e.a});function St(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?St(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):St(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var xt={title:Pt,description:Object(s.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woo-gutenberg-products-block"),icon:{src:Ct,foreground:"#874FB9"},edit:D({icon:Ct,label:Pt,description:Object(s.__)("Choose a product to display its add to cart form.","woo-gutenberg-products-block")})((function(e){var t=e.attributes,r=e.setAttributes,n=Object(x.useProductDataContext)().product,c=t.className,o=t.showFormElements;return Object(i.createElement)("div",{className:O()(c,"wc-block-components-product-add-to-cart")},Object(i.createElement)(We.a,{productId:n.id}),Object(i.createElement)(u.InspectorControls,null,Object(i.createElement)(h.PanelBody,{title:Object(s.__)("Layout","woo-gutenberg-products-block")},Object(_t.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)(Et.a,t)))})),attributes:r(348).a};Object(f.p)("woocommerce/product-add-to-cart",Nt(Nt({},j),xt));var Dt=r(15),Bt=r.n(Dt),Rt=r(12),At=r.n(Rt),Lt=r(17),Tt=r.n(Lt),zt=r(18),Vt=r.n(zt),It=r(9),Ft=r.n(It),Mt=r(23),Ht=(r(2),r(82)),qt=r(791),Gt=r(701),Qt=r(148),Ut=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})},Wt=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 $t(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"]],Xt=function e(t){return t&&0!==t.length?t.map((function(t){return[t.name,$t($t({},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(8),ar=r(6),ir=r(27),sr=(r(722),function(e){var t=e.currentPage,r=e.displayFirstAndLastPages,n=e.displayNextAndPreviousArrows,c=e.pagesToDisplay,o=e.onPageChange,a=e.totalPages,u=function(e,t,r){if(r<=2)return{minIndex:null,maxIndex:null};var n=e-1,c=Math.max(Math.floor(t-n/2),2),o=Math.min(Math.ceil(t+(n-(t-c))),r-1);return{minIndex:Math.max(Math.floor(t-(n-(o-t))),2),maxIndex:o}}(c,t,a),l=u.minIndex,b=u.maxIndex,p=r&&Boolean(1!==l),d=r&&Boolean(b!==a),f=r&&Boolean(l>3),m=r&&Boolean(b<a-2);p&&3===l&&(l-=1),d&&b===a-2&&(b+=1);var g=[];if(l&&b)for(var j=l;j<=b;j++)g.push(j);return Object(i.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(i.createElement)(ir.Label,{screenReaderLabel:Object(s.__)("Navigate to another page","woo-gutenberg-products-block")}),n&&Object(i.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return o(t-1)},title:Object(s.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(i.createElement)(ir.Label,{label:"<",screenReaderLabel:Object(s.__)("Previous page","woo-gutenberg-products-block")})),p&&Object(i.createElement)("button",{className:O()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:function(){return o(1)},disabled:1===t},Object(i.createElement)(ir.Label,{label:1,screenReaderLabel:Object(s.sprintf)(Object(s.__)("Page %d","woo-gutenberg-products-block"),1)})),f&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),g.map((function(e){return Object(i.createElement)("button",{key:e,className:O()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?null:function(){return o(e)},disabled:t===e},Object(i.createElement)(ir.Label,{label:e,screenReaderLabel:Object(s.sprintf)(Object(s.__)("Page %d","woo-gutenberg-products-block"),e)}))})),m&&Object(i.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),d&&Object(i.createElement)("button",{className:O()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===a,"wc-block-components-pagination__page--active":t===a}),onClick:function(){return o(a)},disabled:t===a},Object(i.createElement)(ir.Label,{label:a,screenReaderLabel:Object(s.sprintf)(Object(s.__)("Page %d","woo-gutenberg-products-block"),a)})),n&&Object(i.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page",onClick:function(){return o(t+1)},title:Object(s.__)("Next page","woo-gutenberg-products-block"),disabled:t>=a},Object(i.createElement)(ir.Label,{label:">",screenReaderLabel:Object(s.__)("Next page","woo-gutenberg-products-block")})))});sr.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var ur=sr,lr=r(149),br=r(132),pr=r(184),dr=r(40),fr=r(76);function mr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Or(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var gr=function(e){var t={namespace:"/wc/store",resourceName:"products"},r=Object(pr.a)(Or(Or({},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(fr.a)(i),u=Object(fr.a)(o),l=Object(Mt.useSelect)((function(t){var c=t(dr.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",Or(Or({},t),{},{query:e})).value;return{products:n,totalProducts:parseInt(o,10),productsLoading:c}},jr=r(85),vr=r(167),hr=r(80),yr=r(124),wr=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:yr.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")))},kr=r(706),_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:kr.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(127),Pr=(r(721),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})}),Cr=r(173),Sr=Object(Cr.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=E()(n,2),l=u[0],b=u[1],p=void 0===b?{}:b,d=[];p.children&&p.children.length>0&&(d=e(t,r,p.children,c));var f=o[l];if(!f)return null;var m=r.id||0,O=["layout",l,s,c,m];return Object(i.createElement)(i.Suspense,{key:O.join("_"),fallback:Object(i.createElement)("div",{className:"wc-block-placeholder"})},Object(i.createElement)(f,a()({},p,{children:d,product:r})))}))}}(u,t,c,n))}));r(720);function Nr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Dr=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)},Br=Object(vr.a)((function(e){var t=e.attributes,r=e.currentPage,n=e.onPageChange,c=e.onSortChange,o=e.sortValue,a=e.scrollToTop,u=e.hideOutOfStockItems,l=void 0!==u&&u,b=Object(br.c)(function(e){var t=e.sortValue,r=e.currentPage,n=e.attributes,c=e.hideOutOfStockItems,o=n.columns,a=n.rows;return xr(xr({},function(e){switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}}(t)),{},{catalog_visibility:"catalog",per_page:o*a,page:r},c&&{stock_status:["instock","onbackorder"]})}({attributes:t,sortValue:o,currentPage:r,hideOutOfStockItems:l})),p=E()(b,1)[0],d=gr(p),f=d.products,m=d.totalProducts,g=d.productsLoading,j=Object(x.useInnerBlockLayoutContext)(),v=j.parentClassName,h=j.parentName,y=function(e){e.order,e.orderby,e.page,e.per_page;return S()(e,["order","orderby","page","per_page"])||{}}(p),w=Object(jr.a)().dispatchStoreEvent,k=Object(br.b)("attributes",[]),_=E()(k,2),P=_[0],C=_[1],N=Object(br.b)("min_price"),D=E()(N,2),B=D[0],R=D[1],A=Object(br.b)("max_price"),L=E()(A,2),T=L[0],z=L[1],V=Object(lr.a)({totalQuery:y,totalProducts:m},Dr);Object(i.useEffect)((function(){w("product-list-render",{products:f,listName:h})}),[f,h,w]),Object(i.useEffect)((function(){Object(ar.isEqual)(y,null==V?void 0:V.totalQuery)||(n(1),null!=V&&V.totalQuery&&function(e){Number.isFinite(e)&&(0===e?Object(hr.speak)(Object(s.__)("No products found","woo-gutenberg-products-block")):Object(hr.speak)(Object(s.sprintf)(Object(s._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))}(m))}),[null==V?void 0:V.totalQuery,m,n,y]);var I,F,M,H,q,G=t.contentVisibility,Q=t.columns*t.rows,U=!Number.isFinite(m)&&Number.isFinite(null==V?void 0:V.totalProducts)&&Object(ar.isEqual)(y,null==V?void 0:V.totalQuery)?Math.ceil(V.totalProducts/Q):Math.ceil(m/Q),W=f.length?f:Array.from({length:Q}),K=0!==f.length||g,Y=P.length>0||Number.isFinite(B)||Number.isFinite(T);return Object(i.createElement)("div",{className:(I=t.columns,F=t.rows,M=t.alignButtons,H=t.align,q=void 0!==H?"align"+H:"",O()(v,q,"has-"+I+"-columns",{"has-multiple-rows":F>1,"has-aligned-buttons":M}))},G.orderBy&&K&&Object(i.createElement)(Pr,{onChange:c,value:o}),!K&&Y&&Object(i.createElement)(_r,{resetCallback:function(){C([]),R(null),z(null)}}),!K&&!Y&&Object(i.createElement)(wr,null),K&&Object(i.createElement)("ul",{className:"".concat(v,"__products")},W.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return Object(i.createElement)(Sr,{key:e.id||r,attributes:t,product:e})}))),U>1&&Object(i.createElement)(ur,{currentPage:r,onPageChange:function(e){a({focusableSelector:"a, button"}),n(e)},totalPages:U}))})),Rr=function(e){var t=e.attributes,r=e.hideOutOfStockItems,n=void 0!==r&&r,c=Object(i.useState)(1),o=E()(c,2),a=o[0],s=o[1],u=Object(i.useState)(t.orderby),l=E()(u,2),b=l[0],p=l[1];Object(i.useEffect)((function(){p(t.orderby)}),[t.orderby]);return Object(i.createElement)(Br,{attributes:t,hideOutOfStockItems:n,currentPage:a,onPageChange:function(e){s(e)},onSortChange:function(e){var t=e.target.value;p(t),s(1)},sortValue:b})},Ar=r(160);function Lr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return 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 Vt()(this,r)}}var Tr=function(e){Tt()(r,e);var t=Lr(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;if(t.isPreview)return Ar.a;var n=Object(ce.getSetting)("hideOutOfStockItems",!1);return Object(i.createElement)(x.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(i.createElement)(Rr,{attributes:t,urlParameterSuffix:r,hideOutOfStockItems:n}))}}]),r}(or.Component);r(719);function zr(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 Vt()(this,r)}}var Vr=function(e){Tt()(r,e);var t=zr(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,minColumns:Object(ce.getSetting)("min_columns",1),maxColumns:Object(ce.getSetting)("max_columns",6),minRows:Object(ce.getSetting)("min_rows",1),maxRows:Object(ce.getSetting)("max_rows",6)})),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:Gt.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=[];Jt.map((function(e){var t=E()(e,2),r=t[0],n=t[1];return c.push(Object(l.createBlock)(r,n)),!0})),n(r.clientId,c,!1),e.setState({innerBlocks:r.innerBlocks})}},Object(s.__)("Reset Layout","woo-gutenberg-products-block")))))})),c()(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)(Tr,{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 0===f.m.productCount?Wt(n,c):Object(i.createElement)("div",{className:Ut("wc-block-all-products",t)},e.getBlockControls(),e.getInspectorControls(),r?e.renderEditMode():e.renderViewMode())})),e}return r}(i.Component),Ir=Object(y.compose)(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),Fr={columns:Object(ce.getSetting)("default_columns",3),rows:Object(ce.getSetting)("default_rows",3),alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:Jt,isPreview:!1};function Mr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Hr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mr(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var qr={title:Object(s.__)("All Products","woo-gutenberg-products-block"),icon:{src:Object(i.createElement)(b.a,{srcElement:d}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(s.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(s.__)("Display products from your store in a grid layout.","woo-gutenberg-products-block"),supports:{align:["wide","full"],html:!1,multiple:!1},example:{attributes:{isPreview:!0}},attributes:{columns:{type:"number"},rows:{type:"number"},alignButtons:{type:"boolean"},contentVisibility:{type:"object"},orderby:{type:"string"},layoutConfig:{type:"array"},isPreview:{type:"boolean",default:!1}},defaults:Fr,edit:function(e){return Object(i.createElement)(Ir,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:Ut("wc-block-all-products",t)},n),Object(i.createElement)(u.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",Hr(Hr({},qr),{},{deprecated:[{attributes:Object.assign({},qr.attributes,{rows:{type:"number",default:1}}),save:function(e){var t=e.attributes,r={"data-attributes":JSON.stringify(t)};return Object(i.createElement)("div",a()({className:Ut("wc-block-all-products",t)},r),Object(i.createElement)(u.InnerBlocks.Content,null))}}]}))},77:function(e,t){!function(){e.exports=this.wp.viewport}()},78:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));var n=r(0),c=r(23),o=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),a=function(){return Object(n.useContext)(o)},i=function(e){var t=e.children,r=e.currentPostId,a=void 0===r?0:r,i=e.previewData,s=void 0===i?{}:i,u=Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),l=Object(n.useCallback)((function(e){return e in s?s[e]:{}}),[s]),b={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:l};return Object(n.createElement)(o.Provider,{value:b},t)}},791:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(50),c=r(0),o=r(14);r.p=o.l,Object(n.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(12)]).then(r.bind(null,449))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(4),r.e(11)]).then(r.bind(null,812))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(c.lazy)((function(){return Promise.all([r.e(1),r.e(2),r.e(18)]).then(r.bind(null,813))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(c.lazy)((function(){return r.e(13).then(r.bind(null,450))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(3),r.e(9)]).then(r.bind(null,451))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(c.lazy)((function(){return r.e(16).then(r.bind(null,453))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(c.lazy)((function(){return r.e(4).then(r.bind(null,256))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(c.lazy)((function(){return r.e(14).then(r.bind(null,454))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(c.lazy)((function(){return r.e(10).then(r.bind(null,455))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(c.lazy)((function(){return r.e(17).then(r.bind(null,456))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(c.lazy)((function(){return r.e(15).then(r.bind(null,457))}))}),Object(n.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(c.lazy)((function(){return Promise.all([r.e(0),r.e(1),r.e(2),r.e(3),r.e(8)]).then(r.bind(null,814))}))});var a=function(e){return Object(n.getRegisteredBlockComponents)(e)}},795:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));var n=function(e){return e.is_purchasable||!1},c=function(e){return["simple","variable"].includes(e.type||"simple")}},8:function(e,t){!function(){e.exports=this.React}()},80:function(e,t){!function(){e.exports=this.wp.a11y}()},82:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(6),a=(r(2),r(3));t.a=function(e){var t=e.columns,r=e.rows,i=e.setAttributes,s=e.alignButtons,u=e.minColumns,l=void 0===u?1:u,b=e.maxColumns,p=void 0===b?6:b,d=e.minRows,f=void 0===d?1:d,m=e.maxRows,O=void 0===m?6:m;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:function(e){var t=Object(o.clamp)(e,l,p);i({columns:Number.isNaN(t)?"":t})},min:l,max:p}),Object(n.createElement)(a.RangeControl,{label:Object(c.__)("Rows","woo-gutenberg-products-block"),value:r,onChange:function(e){var t=Object(o.clamp)(e,f,O);i({rows:Number.isNaN(t)?"":t})},min:f,max:O}),Object(n.createElement)(a.ToggleControl,{label:Object(c.__)("Align Last Block","woo-gutenberg-products-block"),help:s?Object(c.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(c.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:s,onChange:function(){return i({alignButtons:!s})}}))}},83:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=Object(n.createContext)("page"),o=function(){return Object(n.useContext)(c)};c.Provider},84:function(e,t){!function(){e.exports=this.wp.date}()},85:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(4),c=r.n(n),o=r(51),a=r(0),i=r(52);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=function(){var e=Object(i.a)();return{dispatchStoreEvent:Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(a.useCallback)((function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-checkout-".concat(t),u(u({},r),{},{storeCart:e}))}catch(e){console.error(e)}}),[e])}}},94:function(e,t){!function(){e.exports=this.wp.autop}()}});
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' => 'a0a08a10f7271558f2f93c724259c19f');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'eab496a7a1f4a764f49281202378f1a6');
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,a,i=t[0],s=t[1],l=t[2],b=0,d=[];b<i.length;b++)a=i[b],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&d.push(o[a][0]),o[a]=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,i=1;i<r.length;i++){var s=r[i];0!==o[s]&&(n=!1)}n&&(c.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={7:0},c=[];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.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="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var u=s;return c.push([832,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){},12:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},130:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b})),r.d(t,"c",(function(){return d}));var n=r(0),o=r(1),c=r(153),a=r(3),i=r(22),s=r(5),l=r(71),u=function(e,t){return Object(n.createElement)(i.BlockControls,null,Object(n.createElement)(a.ToolbarGroup,{controls:[{icon:"edit",title:Object(o.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return t({editMode:!e})},isActive:e}]}))},b=function(e,t){var r=Object(s.getSetting)("showAvatars",!0),i=Object(s.getSetting)("reviewRatingsEnabled",!0);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:function(){return t({showReviewRating:!e.showReviewRating})}}),e.showReviewRating&&!i&&Object(n.createElement)(a.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)(a.ToggleControl,{label:Object(o.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:function(){return t({showReviewerName:!e.showReviewerName})}}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:function(){return t({showReviewImage:!e.showReviewImage})}}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:function(){return t({showReviewDate:!e.showReviewDate})}}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:function(){return t({showReviewContent:!e.showReviewContent})}}),e.showReviewImage&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(l.a,{label:Object(o.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,options:[{label:Object(o.__)("Reviewer photo","woo-gutenberg-products-block"),value:"reviewer"},{label:Object(o.__)("Product","woo-gutenberg-products-block"),value:"product"}],onChange:function(e){return t({imageType:e})}}),"reviewer"===e.imageType&&!r&&Object(n.createElement)(a.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(c.a)(Object(o.__)("Reviewer photo is disabled in your <a>site settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(s.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},d=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:function(){return t({showOrderby:!e.showOrderby})}}),Object(n.createElement)(a.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)(a.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)(a.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)(a.RangeControl,{label:Object(o.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:function(e){return t({reviewsOnLoadMore:e})},max:20,min:1}))}},14:function(e,t,r){"use strict";r.d(t,"m",(function(){return c})),r.d(t,"k",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"h",(function(){return l})),r.d(t,"c",(function(){return u})),r.d(t,"d",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"f",(function(){return p})),r.d(t,"j",(function(){return w})),r.d(t,"i",(function(){return v})),r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return m})),r.d(t,"e",(function(){return g})),r.d(t,"p",(function(){return O})),r.d(t,"q",(function(){return y})),r.d(t,"n",(function(){return j})),r.d(t,"o",(function(){return _}));var n,o=r(5),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"assets/",i=c.pluginUrl+"build/",s=c.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=o.STORE_PAGES.checkout.id,b=o.STORE_PAGES.checkout.permalink,d=o.STORE_PAGES.privacy.permalink,p=o.STORE_PAGES.privacy.title,w=o.STORE_PAGES.terms.permalink,v=o.STORE_PAGES.terms.title,f=o.STORE_PAGES.cart.id,m=o.STORE_PAGES.cart.permalink,g=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),h=r(25),O=function(e,t){if(s>2)return Object(h.registerBlockType)(e,t)},y=function(e,t){if(s>1)return Object(h.registerBlockType)(e,t)},j=function(){return s>2},_=function(){return s>1}},141: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},144:function(e,t){},145:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(7)),c=r.n(o),a=r(41),i=r(187);r(197);t.a=Object(i.a)((function(e){var t=e.className,r=e.instanceId,o=e.defaultValue,i=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)(a.a,{label:i,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)}))))}))},152:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(14),c={attributes:{editMode:!1,imageType:"reviewer",orderby:"most-recent",reviewsOnLoadMore:10,reviewsOnPageLoad:10,showLoadMore:!0,showOrderby:!0,showReviewDate:!0,showReviewerName:!0,showReviewImage:!0,showReviewRating:!0,showReviewContent:!0,previewReviews:[{id:1,date_created:"2019-07-15T17:05:04",formatted_date_created:Object(n.__)("July 15, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",reviewer:Object(n.__)("Alice","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("I bought this product last week and I'm very happy with it.","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.k+"img/avatar.jpg",96:o.k+"img/avatar.jpg"},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(n.__)("July 12, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",reviewer:Object(n.__)("Bob","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("This product is awesome, I love it!","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.k+"img/avatar.jpg",96:o.k+"img/avatar.jpg"},rating:null,verified:!1}]}}},179: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}}},180:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(0),a=(r(196),r(68));t.a=function(e){var t=e.attributes;return Object(c.createElement)("div",o()({className:Object(a.a)(t)},Object(a.b)(t)))}},184:function(e,t,r){"use strict";var n=r(15),o=r.n(n),c=r(16),a=r.n(c),i=r(17),s=r.n(i),l=r(18),u=r.n(l),b=r(9),d=r.n(b),p=r(0),w=r(1),v=r(8),f=(r(2),r(6)),m=r(3),g=r(5),h=r(94),O=r(41),y=(r(247),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})))});y.defaultProps={label:Object(w.__)("Load more","woo-gutenberg-products-block")};var j=y,_=r(145),k=(r(244),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,o=e.value;return Object(p.createElement)(_.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",defaultValue:t,label:Object(w.__)("Order by","woo-gutenberg-products-block"),onChange:r,options:[{key:"most-recent",label:Object(w.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(w.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(w.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(w.__)("Order reviews by","woo-gutenberg-products-block"),value:o})}),R=r(4),E=r.n(R),P=r(7),C=r.n(P),S=r(11),N=r.n(S),T=r(217),x=r.n(T),L=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=x()(e,{suffix:r,limit:t});return n.html},A=function(e,t,r,n){var o=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 I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var B=function(e){s()(r,e);var t=I(r);function r(e){var n;return o()(this,r),(n=t.apply(this,arguments)).state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},n.reviewSummary=Object(v.createRef)(),n.reviewContent=Object(v.createRef)(),n.getButton=n.getButton.bind(N()(n)),n.onClick=n.onClick.bind(N()(n)),n}return a()(r,[{key:"componentDidMount",value:function(){if(this.props.children){var e=this.props,t=e.maxLines,r=e.ellipsis,n=(this.reviewSummary.current.clientHeight+1)*t+1,o=this.reviewContent.current.clientHeight+1>n;this.setState({clampEnabled:o}),o&&this.setState({summary:A(this.reviewContent.current.innerHTML,this.reviewSummary.current,n,r)})}}},{key:"getButton",value:function(){var e=this.state.isExpanded,t=this.props,r=t.className,n=t.lessText,o=t.moreText,c=e?n:o;if(c)return Object(p.createElement)("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}},{key:"onClick",value:function(e){e.preventDefault();var t=this.state.isExpanded;this.setState({isExpanded:!t})}},{key:"render",value:function(){var e=this.props.className,t=this.state,r=t.content,n=t.summary,o=t.clampEnabled,c=t.isExpanded;return r?!1===o?Object(p.createElement)("div",{className:e},Object(p.createElement)("div",{ref:this.reviewContent},r)):Object(p.createElement)("div",{className:e},(!c||null===o)&&Object(p.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:n}}),(c||null===o)&&Object(p.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},r),this.getButton()):null}}]),r}(v.Component);B.defaultProps={maxLines:3,ellipsis:"&hellip;",moreText:Object(w.__)("Read more","woo-gutenberg-products-block"),lessText:Object(w.__)("Read less","woo-gutenberg-products-block"),className:"read-more-content"};var H=B;r(246);var G=function(e){var t=e.attributes,r=e.review,n=void 0===r?{}:r,o=t.imageType,c=t.showReviewDate,a=t.showReviewerName,i=t.showReviewImage,s=t.showReviewRating,l=t.showReviewContent,u=t.showProductName,b=n.rating,d=!Object.keys(n).length>0,v=Number.isFinite(b)&&s;return Object(p.createElement)("li",{className:C()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":d}),"aria-hidden":d},(u||c||a||i||v)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},i&&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||a||v||c)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},v&&function(e){var t=e.rating,r={width:t/5*100+"%"},n=Object(w.sprintf)(Object(w.__)("Rated %f out of 5","woo-gutenberg-products-block"),t);return Object(p.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(p.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":n},Object(p.createElement)("span",{style:r},n)))}(n),u&&function(e){return Object(p.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(p.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(n),a&&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(245);function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){E()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var z=function(e){var t=e.attributes,r=e.reviews,n=Object(g.getSetting)("showAvatars",!0),o=Object(g.getSetting)("reviewRatingsEnabled",!0),c=(n||"product"===t.imageType)&&t.showReviewImage,a=o&&t.showReviewRating,i=F(F({},t),{},{showReviewImage:c,showReviewRating:a});return Object(p.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(p.createElement)(G,{attributes:i}):r.map((function(e,t){return Object(p.createElement)(G,{key:e.id||t,attributes:i,review:e})})))},W=r(10),U=r.n(W),J=r(28),q=r.n(J),Y=r(12),K=r.n(Y),Q=r(33),X=r.n(Q),Z=r(68),$=r(37);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),a=0;a<t;a++)c[a]=arguments[a];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 a()(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,a={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(a.category_id=Array.isArray(r)?r.join(","):r),c&&(a.product_id=c),a}},{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,a=r.totalReviews;return Object(p.createElement)(e,U()({},this.props,{error:n,isLoading:o,reviews:c.slice(0,t),totalReviews:a}))}}]),n}(v.Component);E()(t,"defaultProps",{delayFunction:function(e){return e},onReviewsAppended:function(){},onReviewsLoadError:function(){},onReviewsReplaced:function(){}});var r=e.displayName,n=void 0===r?e.name||"Component":r;return t.displayName="WithReviews( ".concat(n," )"),t}(function(e){s()(r,e);var t=te(r);function r(){return o()(this,r),t.apply(this,arguments)}return a()(r,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.error,n=e.isLoading,o=e.noReviewsPlaceholder,c=e.reviews,a=e.totalReviews;if(r)return Object(p.createElement)(h.a,{className:"wc-block-featured-product-error",error:r,isLoading:n});if(0===c.length&&!n)return Object(p.createElement)(o,{attributes:t});var i=Object(g.getSetting)("reviewRatingsEnabled",!0);return Object(p.createElement)(m.Disabled,null,t.showOrderby&&i&&Object(p.createElement)(k,{readOnly:!0,value:t.orderby}),Object(p.createElement)(z,{attributes:t,reviews:c}),t.showLoadMore&&a>c.length&&Object(p.createElement)(j,{screenReaderLabel:Object(w.__)("Load more reviews","woo-gutenberg-products-block")}))}}]),r}(v.Component));function ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var oe=function(e){s()(r,e);var t=ne(r);function r(){return o()(this,r),t.apply(this,arguments)}return a()(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,a=t.showProductName,i=t.showReviewDate,s=t.showReviewerName,l=t.showReviewContent,u=t.showReviewImage,b=t.showReviewRating,d=Object(Z.d)(t.orderby),w=d.order,v=d.orderby;return!(l||b||i||s||u||a)?this.renderHiddenContentPlaceholder():Object(p.createElement)("div",{className:Object(Z.a)(t)},Object(p.createElement)(re,{attributes:t,categoryIds:n,delayFunction:function(e){return Object(f.debounce)(e,400)},noReviewsPlaceholder:r,orderby:v,order:w,productId:o,reviewsToDisplay:c}))}}]),r}(v.Component);t.a=oe},19:function(e,t){!function(){e.exports=this.wp.apiFetch}()},196:function(e,t){},197:function(e,t){},22:function(e,t){!function(){e.exports=this.wp.blockEditor}()},244:function(e,t){},245:function(e,t){},246:function(e,t){},247:function(e,t){},25:function(e,t){!function(){e.exports=this.wp.blocks}()},3:function(e,t){!function(){e.exports=this.wp.components}()},31:function(e,t){!function(){e.exports=this.wp.primitives}()},33:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},37:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l}));var n=r(28),o=r.n(n),c=r(12),a=r.n(c),i=r(1),s=function(){var e=o()(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)}}(),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(i.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},41:function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=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 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,a=e.wrapperProps,s=void 0===a?{}:a,u=null!=r,b=null!=n;return!u&&b?(t=o||"span",s=l(l({},s),{},{className:i()(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))}},42: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(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(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"===a?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):r:Object(o.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))}},5:function(e,t){!function(){e.exports=this.wc.wcSettings}()},57:function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(23),a=r.n(c),i=r(0);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=a()(e,["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){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){!function(){e.exports=this.lodash}()},68: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),a=r.n(c),i=r(5),s=function(e){if(Object(i.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=function(e){return o()({path:"/wc/store/products/reviews?"+Object.entries(e).map((function(e){return e.join("=")})).join("&"),parse:!1}).then((function(e){return e.json().then((function(t){return{reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}}))}))},u=function(e){var t=e.className,r=e.categoryIds,n=e.productId,o=e.showReviewDate,c=e.showReviewerName,i=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"),a()(b,t,{"has-image":l,"has-name":c,"has-date":o,"has-rating":u,"has-content":i,"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}},71:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(15),a=r.n(c),i=r(16),s=r.n(i),l=r(11),u=r.n(l),b=r(17),d=r.n(b),p=r(18),w=r.n(p),v=r(9),f=r.n(v),m=r(0),g=r(6),h=r(7),O=r.n(h),y=r(3),j=r(188);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 a()(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,a=r.instanceId,i=r.className,s=r.help,l=r.options,u=r.value,b="inspector-toggle-button-control-".concat(a);return s&&(e=Object(g.isFunction)(s)?s(c):s),Object(m.createElement)(y.BaseControl,{id:b,help:e,className:O()("components-toggle-button-control",i)},Object(m.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(m.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isSecondary=!0,c["aria-pressed"]=!1),Object(m.createElement)(y.Button,o()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},c),e.label)}))))}}]),r}(m.Component);t.a=Object(j.a)(k)},8:function(e,t){!function(){e.exports=this.React}()},832:function(e,t,r){e.exports=r(909)},909:function(e,t,r){"use strict";r.r(t);var n=r(4),o=r.n(n),c=r(0),a=r(1),i=r(25),s=r(57),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(196),r(22)),d=r(3),p=(r(2),r(184)),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(a.__)("All Reviews","woo-gutenberg-products-block")},Object(a.__)("This block shows a list of all product reviews. Your store does not have any reviews yet, but they will show up here when it does.","woo-gutenberg-products-block"))},v=r(130),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(a.__)("Content","woo-gutenberg-products-block")},Object(c.createElement)(d.ToggleControl,{label:Object(a.__)("Product name","woo-gutenberg-products-block"),checked:t.showProductName,onChange:function(){return r({showProductName:!t.showProductName})}}),Object(v.b)(t,r)),Object(c.createElement)(d.PanelBody,{title:Object(a.__)("List Settings","woo-gutenberg-products-block")},Object(v.c)(t,r))),Object(c.createElement)(p.a,{attributes:t,icon:Object(c.createElement)(s.a,{icon:u,className:"block-editor-block-icon"}),name:Object(a.__)("All Reviews","woo-gutenberg-products-block"),noReviewsPlaceholder:w}))},m=r(179),g=r(180),h=r(152);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(i.registerBlockType)("woocommerce/all-reviews",{title:Object(a.__)("All Reviews","woo-gutenberg-products-block"),icon:{src:Object(c.createElement)(s.a,{srcElement:u}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(a.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(a.__)("Show a list of all product reviews.","woo-gutenberg-products-block"),supports:{html:!1},example:y(y({},h.a),{},{attributes:y(y({},h.a.attributes),{},{showProductName:!0})}),attributes:y(y({},m.a),{},{showProductName:{type:"boolean",default:!0}}),edit:function(e){return Object(c.createElement)(f,e)},save:g.a})},94:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(57)),a=r(141),i=r(7),s=r.n(i),l=r(3),u=r(43);r(144);t.a=function(e){var t=e.className,r=e.error,i=e.isLoading,b=e.onRetry;return Object(n.createElement)(l.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:a.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,i?Object(n.createElement)(l.Spinner,null):Object(n.createElement)(l.Button,{isSecondary:!0,onClick:b},Object(o.__)("Retry","woo-gutenberg-products-block"))))}}});
1
+ this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-reviews"]=function(e){function t(t){for(var n,i,a=t[0],s=t[1],l=t[2],b=0,d=[];b<a.length;b++)i=a[b],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&d.push(o[i][0]),o[i]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);d.length;)d.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,a=1;a<r.length;a++){var s=r[a];0!==o[s]&&(n=!1)}n&&(c.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},o={7:0},c=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var l=0;l<a.length;l++)t(a[l]);var u=s;return c.push([702,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},104:function(e,t){},114:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b})),r.d(t,"c",(function(){return d}));var n=r(0),o=r(1),c=r(135),i=r(3),a=r(24),s=r(5),l=r(74),u=function(e,t){return Object(n.createElement)(a.BlockControls,null,Object(n.createElement)(i.ToolbarGroup,{controls:[{icon:"edit",title:Object(o.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return t({editMode:!e})},isActive:e}]}))},b=function(e,t){var r=Object(s.getSetting)("showAvatars",!0),a=Object(s.getSetting)("reviewRatingsEnabled",!0);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:function(){return t({showReviewRating:!e.showReviewRating})}}),e.showReviewRating&&!a&&Object(n.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(c.a)(Object(o.__)("Product rating is disabled in your <a>store settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(s.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:function(){return t({showReviewerName:!e.showReviewerName})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:function(){return t({showReviewImage:!e.showReviewImage})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:function(){return t({showReviewDate:!e.showReviewDate})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:function(){return t({showReviewContent:!e.showReviewContent})}}),e.showReviewImage&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(l.a,{label:Object(o.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,options:[{label:Object(o.__)("Reviewer photo","woo-gutenberg-products-block"),value:"reviewer"},{label:Object(o.__)("Product","woo-gutenberg-products-block"),value:"product"}],onChange:function(e){return t({imageType:e})}}),"reviewer"===e.imageType&&!r&&Object(n.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(c.a)(Object(o.__)("Reviewer photo is disabled in your <a>site settings</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(s.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},d=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:function(){return t({showOrderby:!e.showOrderby})}}),Object(n.createElement)(i.SelectControl,{label:Object(o.__)("Order Product Reviews by","woo-gutenberg-products-block"),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:function(e){return t({orderby:e})}}),Object(n.createElement)(i.RangeControl,{label:Object(o.__)("Starting Number of Reviews","woo-gutenberg-products-block"),value:e.reviewsOnPageLoad,onChange:function(e){return t({reviewsOnPageLoad:e})},max:20,min:1}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Load more","woo-gutenberg-products-block"),checked:e.showLoadMore,onChange:function(){return t({showLoadMore:!e.showLoadMore})}}),e.showLoadMore&&Object(n.createElement)(i.RangeControl,{label:Object(o.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:function(e){return t({reviewsOnLoadMore:e})},max:20,min:1}))}},124:function(e,t,r){"use strict";var n=r(0),o=r(33),c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=c},126:function(e,t){},127:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(7)),c=r.n(o),i=r(27),a=r(173);r(180);t.a=Object(a.a)((function(e){var t=e.className,r=e.instanceId,o=e.defaultValue,a=e.label,s=e.onChange,l=e.options,u=e.screenReaderLabel,b=e.readOnly,d=e.value,p="wc-block-components-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(n.createElement)(i.Label,{label:a,screenReaderLabel:u,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:p}}),Object(n.createElement)("select",{id:p,className:"wc-block-sort-select__select wc-block-components-sort-select__select",defaultValue:o,onChange:s,readOnly:b,value:d},l.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},134:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(14),c={attributes:{editMode:!1,imageType:"reviewer",orderby:"most-recent",reviewsOnLoadMore:10,reviewsOnPageLoad:10,showLoadMore:!0,showOrderby:!0,showReviewDate:!0,showReviewerName:!0,showReviewImage:!0,showReviewRating:!0,showReviewContent:!0,previewReviews:[{id:1,date_created:"2019-07-15T17:05:04",formatted_date_created:Object(n.__)("July 15, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",reviewer:Object(n.__)("Alice","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("I bought this product last week and I'm very happy with it.","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.k+"img/avatar.jpg",96:o.k+"img/avatar.jpg"},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(n.__)("July 12, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(n.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",reviewer:Object(n.__)("Bob","woo-gutenberg-products-block"),review:"<p>".concat(Object(n.__)("This product is awesome, I love it!","woo-gutenberg-products-block"),"</p>\n"),reviewer_avatar_urls:{48:o.k+"img/avatar.jpg",96:o.k+"img/avatar.jpg"},rating:null,verified:!1}]}}},14:function(e,t,r){"use strict";r.d(t,"m",(function(){return c})),r.d(t,"k",(function(){return i})),r.d(t,"l",(function(){return a})),r.d(t,"h",(function(){return l})),r.d(t,"c",(function(){return u})),r.d(t,"d",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"f",(function(){return p})),r.d(t,"j",(function(){return w})),r.d(t,"i",(function(){return v})),r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return m})),r.d(t,"e",(function(){return g})),r.d(t,"p",(function(){return O})),r.d(t,"q",(function(){return y})),r.d(t,"n",(function(){return j})),r.d(t,"o",(function(){return _}));var n,o=r(5),c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"assets/",a=c.pluginUrl+"build/",s=c.buildPhase,l=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=o.STORE_PAGES.checkout.id,b=o.STORE_PAGES.checkout.permalink,d=o.STORE_PAGES.privacy.permalink,p=o.STORE_PAGES.privacy.title,w=o.STORE_PAGES.terms.permalink,v=o.STORE_PAGES.terms.title,f=o.STORE_PAGES.cart.id,m=o.STORE_PAGES.cart.permalink,g=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),h=r(26),O=function(e,t){if(s>2)return Object(h.registerBlockType)(e,t)},y=function(e,t){if(s>1)return Object(h.registerBlockType)(e,t)},j=function(){return s>2},_=function(){return s>1}},164: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}}},165:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(0),i=(r(179),r(70));t.a=function(e){var t=e.attributes;return Object(c.createElement)("div",o()({className:Object(i.a)(t)},Object(i.b)(t)))}},169:function(e,t,r){"use strict";var n=r(15),o=r.n(n),c=r(16),i=r.n(c),a=r(17),s=r.n(a),l=r(18),u=r.n(l),b=r(9),d=r.n(b),p=r(0),w=r(1),v=r(8),f=(r(2),r(6)),m=r(3),g=r(5),h=r(92),O=r(27),y=(r(223),function(e){var t=e.onClick,r=e.label,n=e.screenReaderLabel;return Object(p.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(p.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(p.createElement)(O.Label,{label:r,screenReaderLabel:n})))});y.defaultProps={label:Object(w.__)("Load more","woo-gutenberg-products-block")};var j=y,_=r(127),k=(r(220),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,o=e.value;return Object(p.createElement)(_.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",defaultValue:t,label:Object(w.__)("Order by","woo-gutenberg-products-block"),onChange:r,options:[{key:"most-recent",label:Object(w.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(w.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(w.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(w.__)("Order reviews by","woo-gutenberg-products-block"),value:o})}),R=r(4),E=r.n(R),P=r(7),C=r.n(P),S=r(12),T=r.n(S),N=r(197),x=r.n(N),L=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=x()(e,{suffix:r,limit:t});return n.html},A=function(e,t,r,n){var o=I(e,t,r);return L(e,o-n.length,n)},I=function(e,t,r){for(var n={start:0,middle:0,end:e.length};n.start<=n.end;)n.middle=Math.floor((n.start+n.end)/2),t.innerHTML=L(e,n.middle),n=M(n,t.clientHeight,r);return n.middle},M=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e};function D(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var B=function(e){s()(r,e);var t=D(r);function r(e){var n;return o()(this,r),(n=t.apply(this,arguments)).state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},n.reviewSummary=Object(v.createRef)(),n.reviewContent=Object(v.createRef)(),n.getButton=n.getButton.bind(T()(n)),n.onClick=n.onClick.bind(T()(n)),n}return i()(r,[{key:"componentDidMount",value:function(){if(this.props.children){var e=this.props,t=e.maxLines,r=e.ellipsis,n=(this.reviewSummary.current.clientHeight+1)*t+1,o=this.reviewContent.current.clientHeight+1>n;this.setState({clampEnabled:o}),o&&this.setState({summary:A(this.reviewContent.current.innerHTML,this.reviewSummary.current,n,r)})}}},{key:"getButton",value:function(){var e=this.state.isExpanded,t=this.props,r=t.className,n=t.lessText,o=t.moreText,c=e?n:o;if(c)return Object(p.createElement)("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}},{key:"onClick",value:function(e){e.preventDefault();var t=this.state.isExpanded;this.setState({isExpanded:!t})}},{key:"render",value:function(){var e=this.props.className,t=this.state,r=t.content,n=t.summary,o=t.clampEnabled,c=t.isExpanded;return r?!1===o?Object(p.createElement)("div",{className:e},Object(p.createElement)("div",{ref:this.reviewContent},r)):Object(p.createElement)("div",{className:e},(!c||null===o)&&Object(p.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:n}}),(c||null===o)&&Object(p.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},r),this.getButton()):null}}]),r}(v.Component);B.defaultProps={maxLines:3,ellipsis:"&hellip;",moreText:Object(w.__)("Read more","woo-gutenberg-products-block"),lessText:Object(w.__)("Read less","woo-gutenberg-products-block"),className:"read-more-content"};var H=B;r(222);var G=function(e){var t=e.attributes,r=e.review,n=void 0===r?{}:r,o=t.imageType,c=t.showReviewDate,i=t.showReviewerName,a=t.showReviewImage,s=t.showReviewRating,l=t.showReviewContent,u=t.showProductName,b=n.rating,d=!Object.keys(n).length>0,v=Number.isFinite(b)&&s;return Object(p.createElement)("li",{className:C()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":d}),"aria-hidden":d},(u||c||i||a||v)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},a&&function(e,t,r){var n,o;return r||!e?Object(p.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image",width:"48",height:"48"}):Object(p.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(p.createElement)("img",{"aria-hidden":"true",alt:(null===(n=e.product_image)||void 0===n?void 0:n.alt)||"",src:(null===(o=e.product_image)||void 0===o?void 0:o.thumbnail)||""}):Object(p.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[48]||"",srcSet:e.reviewer_avatar_urls[96]+" 2x"}),e.verified&&Object(p.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(w.__)("Verified buyer","woo-gutenberg-products-block")},Object(w.__)("Verified buyer","woo-gutenberg-products-block")))}(n,o,d),(u||i||v||c)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},v&&function(e){var t=e.rating,r={width:t/5*100+"%"},n=Object(w.sprintf)(Object(w.__)("Rated %f out of 5","woo-gutenberg-products-block"),t);return Object(p.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(p.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":n},Object(p.createElement)("span",{style:r},n)))}(n),u&&function(e){return Object(p.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(p.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(n),i&&function(e){var t=e.reviewer,r=void 0===t?"":t;return Object(p.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},r)}(n),c&&function(e){var t=e.date_created,r=e.formatted_date_created;return Object(p.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(n))),l&&function(e){return Object(p.createElement)(H,{maxLines:10,moreText:Object(w.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(w.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(p.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(n))};r(221);function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){E()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var z=function(e){var t=e.attributes,r=e.reviews,n=Object(g.getSetting)("showAvatars",!0),o=Object(g.getSetting)("reviewRatingsEnabled",!0),c=(n||"product"===t.imageType)&&t.showReviewImage,i=o&&t.showReviewRating,a=F(F({},t),{},{showReviewImage:c,showReviewRating:i});return Object(p.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(p.createElement)(G,{attributes:a}):r.map((function(e,t){return Object(p.createElement)(G,{key:e.id||t,attributes:a,review:e})})))},W=r(11),U=r.n(W),J=r(31),q=r.n(J),Y=r(10),K=r.n(Y),Q=r(37),X=r.n(Q),Z=r(70),$=r(41);function ee(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}function te(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var re=function(e){var t=function(t){s()(n,t);var r=ee(n);function n(){var e;o()(this,n);for(var t=arguments.length,c=new Array(t),i=0;i<t;i++)c[i]=arguments[i];return e=r.call.apply(r,[this].concat(c)),E()(T()(e),"isPreview",!!e.props.attributes.previewReviews),E()(T()(e),"delayedAppendReviews",e.props.delayFunction(e.appendReviews)),E()(T()(e),"state",{error:null,loading:!0,reviews:e.isPreview?e.props.attributes.previewReviews:[],totalReviews:e.isPreview?e.props.attributes.previewReviews.length:0}),E()(T()(e),"setError",function(){var t=q()(K.a.mark((function t(r){var n,o;return K.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.props.onReviewsLoadError,t.next=3,Object($.a)(r);case 3:o=t.sent,e.setState({reviews:[],loading:!1,error:o}),n(o);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),e}return i()(n,[{key:"componentDidMount",value:function(){this.replaceReviews()}},{key:"componentDidUpdate",value:function(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}},{key:"shouldReplaceReviews",value:function(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!X()(e.categoryIds,t.categoryIds)}},{key:"componentWillUnMount",value:function(){this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}},{key:"getArgs",value:function(e){var t=this.props,r=t.categoryIds,n=t.order,o=t.orderby,c=t.productId,i={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(i.category_id=Array.isArray(r)?r.join(","):r),c&&(i.product_id=c),i}},{key:"replaceReviews",value:function(){if(!this.isPreview){var e=this.props.onReviewsReplaced;this.updateListOfReviews().then(e)}}},{key:"appendReviews",value:function(){if(!this.isPreview){var e=this.props,t=e.onReviewsAppended,r=e.reviewsToDisplay,n=this.state.reviews;r<=n.length||this.updateListOfReviews(n).then(t)}}},{key:"updateListOfReviews",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.props.reviewsToDisplay,n=this.state.totalReviews,o=Math.min(n,r)-t.length;return this.setState({loading:!0,reviews:t.concat(Array(o).fill({}))}),Object(Z.c)(this.getArgs(t.length)).then((function(r){var n=r.reviews,o=r.totalReviews;return e.setState({reviews:t.filter((function(e){return Object.keys(e).length})).concat(n),totalReviews:o,loading:!1,error:null}),{newReviews:n}})).catch(this.setError)}},{key:"render",value:function(){var t=this.props.reviewsToDisplay,r=this.state,n=r.error,o=r.loading,c=r.reviews,i=r.totalReviews;return Object(p.createElement)(e,U()({},this.props,{error:n,isLoading:o,reviews:c.slice(0,t),totalReviews:i}))}}]),n}(v.Component);E()(t,"defaultProps",{delayFunction:function(e){return e},onReviewsAppended:function(){},onReviewsLoadError:function(){},onReviewsReplaced:function(){}});var r=e.displayName,n=void 0===r?e.name||"Component":r;return t.displayName="WithReviews( ".concat(n," )"),t}(function(e){s()(r,e);var t=te(r);function r(){return o()(this,r),t.apply(this,arguments)}return i()(r,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.error,n=e.isLoading,o=e.noReviewsPlaceholder,c=e.reviews,i=e.totalReviews;if(r)return Object(p.createElement)(h.a,{className:"wc-block-featured-product-error",error:r,isLoading:n});if(0===c.length&&!n)return Object(p.createElement)(o,{attributes:t});var a=Object(g.getSetting)("reviewRatingsEnabled",!0);return Object(p.createElement)(m.Disabled,null,t.showOrderby&&a&&Object(p.createElement)(k,{readOnly:!0,value:t.orderby}),Object(p.createElement)(z,{attributes:t,reviews:c}),t.showLoadMore&&i>c.length&&Object(p.createElement)(j,{screenReaderLabel:Object(w.__)("Load more reviews","woo-gutenberg-products-block")}))}}]),r}(v.Component));function ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var o=d()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var oe=function(e){s()(r,e);var t=ne(r);function r(){return o()(this,r),t.apply(this,arguments)}return i()(r,[{key:"renderHiddenContentPlaceholder",value:function(){var e=this.props,t=e.icon,r=e.name;return Object(p.createElement)(m.Placeholder,{icon:t,label:r},Object(w.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))}},{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.noReviewsPlaceholder,n=t.categoryIds,o=t.productId,c=t.reviewsOnPageLoad,i=t.showProductName,a=t.showReviewDate,s=t.showReviewerName,l=t.showReviewContent,u=t.showReviewImage,b=t.showReviewRating,d=Object(Z.d)(t.orderby),w=d.order,v=d.orderby;return!(l||b||a||s||u||i)?this.renderHiddenContentPlaceholder():Object(p.createElement)("div",{className:Object(Z.a)(t)},Object(p.createElement)(re,{attributes:t,categoryIds:n,delayFunction:function(e){return Object(f.debounce)(e,400)},noReviewsPlaceholder:r,orderby:v,order:w,productId:o,reviewsToDisplay:c}))}}]),r}(v.Component);t.a=oe},179:function(e,t){},180:function(e,t){},19:function(e,t){!function(){e.exports=this.wp.apiFetch}()},22:function(e,t){!function(){e.exports=this.wp.compose}()},220:function(e,t){},221:function(e,t){},222:function(e,t){},223:function(e,t){},24:function(e,t){!function(){e.exports=this.wp.blockEditor}()},26:function(e,t){!function(){e.exports=this.wp.blocks}()},27:function(e,t){!function(){e.exports=this.wc.blocksCheckout}()},3:function(e,t){!function(){e.exports=this.wp.components}()},33:function(e,t){!function(){e.exports=this.wp.primitives}()},37:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},41:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l}));var n=r(31),o=r.n(n),c=r(10),i=r.n(c),a=r(1),s=function(){var e=o()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),l=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},45:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},46:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(45));t.a=function(e){var t,r,i,a=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=a).message,i=t.type,r?"general"===i?Object(n.createElement)("span",null,Object(o.__)("The following error was returned","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):"api"===i?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):r:Object(o.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))}},5:function(e,t){!function(){e.exports=this.wc.wcSettings}()},58:function(e,t,r){"use strict";var n=r(4),o=r.n(n),c=r(20),i=r.n(c),a=r(0);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){!function(){e.exports=this.lodash}()},70:function(e,t,r){"use strict";r.d(t,"d",(function(){return s})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b}));var n=r(19),o=r.n(n),c=r(7),i=r.n(c),a=r(5),s=function(e){if(Object(a.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=function(e){return o()({path:"/wc/store/products/reviews?"+Object.entries(e).map((function(e){return e.join("=")})).join("&"),parse:!1}).then((function(e){return e.json().then((function(t){return{reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}}))}))},u=function(e){var t=e.className,r=e.categoryIds,n=e.productId,o=e.showReviewDate,c=e.showReviewerName,a=e.showReviewContent,s=e.showProductName,l=e.showReviewImage,u=e.showReviewRating,b="wc-block-all-reviews";return n&&(b="wc-block-reviews-by-product"),Array.isArray(r)&&(b="wc-block-reviews-by-category"),i()(b,t,{"has-image":l,"has-name":c,"has-date":o,"has-rating":u,"has-content":a,"has-product-name":s})},b=function(e){var t=e.categoryIds,r=e.imageType,n=e.orderby,o=e.productId,c={"data-image-type":r,"data-orderby":n,"data-reviews-on-page-load":e.reviewsOnPageLoad,"data-reviews-on-load-more":e.reviewsOnLoadMore,"data-show-load-more":e.showLoadMore,"data-show-orderby":e.showOrderby};return o&&(c["data-product-id"]=o),Array.isArray(t)&&(c["data-category-ids"]=t.join(",")),c}},702:function(e,t,r){e.exports=r(779)},74:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(15),i=r.n(c),a=r(16),s=r.n(a),l=r(12),u=r.n(l),b=r(17),d=r.n(b),p=r(18),w=r.n(p),v=r(9),f=r.n(v),m=r(0),g=r(6),h=r(7),O=r.n(h),y=r(3),j=r(22);r(104);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=f()(e);if(t){var o=f()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return w()(this,r)}}var k=function(e){d()(r,e);var t=_(r);function r(){var e;return i()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(u()(e)),e}return s()(r,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,c=r.checked,i=r.instanceId,a=r.className,s=r.help,l=r.options,u=r.value,b="inspector-toggle-button-control-".concat(i);return s&&(e=Object(g.isFunction)(s)?s(c):s),Object(m.createElement)(y.BaseControl,{id:b,help:e,className:O()("components-toggle-button-control",a)},Object(m.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},n),Object(m.createElement)(y.ButtonGroup,{"aria-labelledby":b+"__label"},l.map((function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isSecondary=!0,c["aria-pressed"]=!1),Object(m.createElement)(y.Button,o()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},c),e.label)}))))}}]),r}(m.Component);t.a=Object(j.withInstanceId)(k)},779:function(e,t,r){"use strict";r.r(t);var n=r(4),o=r.n(n),c=r(0),i=r(1),a=r(26),s=r(58),l=r(33),u=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.createElement)("path",{d:"M15 4v7H5.17l-.59.59-.58.58V4h11m1-2H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm5 4h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1z"})),b=(r(179),r(24)),d=r(3),p=(r(2),r(169)),w=function(){return Object(c.createElement)(d.Placeholder,{className:"wc-block-all-reviews",icon:Object(c.createElement)(s.a,{srcElement:u,className:"block-editor-block-icon"}),label:Object(i.__)("All Reviews","woo-gutenberg-products-block")},Object(i.__)("This block shows a list of all product reviews. Your store does not have any reviews yet, but they will show up here when it does.","woo-gutenberg-products-block"))},v=r(114),f=function(e){var t=e.attributes,r=e.setAttributes;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(b.InspectorControls,{key:"inspector"},Object(c.createElement)(d.PanelBody,{title:Object(i.__)("Content","woo-gutenberg-products-block")},Object(c.createElement)(d.ToggleControl,{label:Object(i.__)("Product name","woo-gutenberg-products-block"),checked:t.showProductName,onChange:function(){return r({showProductName:!t.showProductName})}}),Object(v.b)(t,r)),Object(c.createElement)(d.PanelBody,{title:Object(i.__)("List Settings","woo-gutenberg-products-block")},Object(v.c)(t,r))),Object(c.createElement)(p.a,{attributes:t,icon:Object(c.createElement)(s.a,{icon:u,className:"block-editor-block-icon"}),name:Object(i.__)("All Reviews","woo-gutenberg-products-block"),noReviewsPlaceholder:w}))},m=r(164),g=r(165),h=r(134);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(a.registerBlockType)("woocommerce/all-reviews",{title:Object(i.__)("All Reviews","woo-gutenberg-products-block"),icon:{src:Object(c.createElement)(s.a,{srcElement:u}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(i.__)("Show a list of all product reviews.","woo-gutenberg-products-block"),supports:{html:!1},example:y(y({},h.a),{},{attributes:y(y({},h.a.attributes),{},{showProductName:!0})}),attributes:y(y({},m.a),{},{showProductName:{type:"boolean",default:!0}}),edit:function(e){return Object(c.createElement)(f,e)},save:g.a})},8:function(e,t){!function(){e.exports=this.React}()},92:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(58)),i=r(124),a=r(7),s=r.n(a),l=r(3),u=r(46);r(126);t.a=function(e){var t=e.className,r=e.error,a=e.isLoading,b=e.onRetry;return Object(n.createElement)(l.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:i.a}),label:Object(o.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:s()("wc-block-api-error",t)},Object(n.createElement)(u.a,{error:r}),b&&Object(n.createElement)(n.Fragment,null,a?Object(n.createElement)(l.Spinner,null):Object(n.createElement)(l.Button,{isSecondary:!0,onClick:b},Object(o.__)("Retry","woo-gutenberg-products-block"))))}}});
build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{136:function(e,t,r){"use strict";var n=r(4),c=r.n(n),i=r(13),o=r.n(i),a=r(5),s=r(1);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d=Object(a.getSetting)("countryLocale",{}),l=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(s.sprintf)(Object(s.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(t.index=parseInt(e.priority,10)),!0===e.hidden&&(t.required=!1),t},f=Object.entries(d).map((function(e){var t=o()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=o()(e,2),r=t[0],n=t[1];return[r,l(n)]})).reduce((function(e,t){var r=o()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})]})).reduce((function(e,t){var r=o()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==f[r]?f[r]:{};return e.map((function(e){var r=a.defaultAddressFields[e]||{},c=n[e]||{},i=t[e]||{};return p(p(p({key:e},r),c),i)})).sort((function(e,t){return e.index-t.index}))}},164:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(13),c=r.n(n),i=function(e){return e.reduce((function(e,t){var r=c()(t,2),n=r[0],i=r[1];return e[n]=i,e}),{})}},185:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return o}));var n=r(5),c=r(136),i=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,c=void 0===n?"":n,i=e.city,o=void 0===i?"":i,a=e.postcode,s=void 0===a?"":a;return{country:r.trim(),state:c.trim(),city:o.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},o=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(c.a)(t,{},e.country),i=Object.assign({},e);return r.forEach((function(e){e.hidden&&(i[e.key]="")})),i}},51:function(e,t,r){"use strict";r.d(t,"a",(function(){return j}));var n=r(13),c=r.n(n),i=r(4),o=r.n(i),a=r(6),s=r(0),u=r(36),p=r(21),d=r(26),l=r(164),f=r(185),b=r(75);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 g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var v={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},h=g(g({},v),{},{email:"",phone:""}),y=function(e){return Object(l.a)(Object.entries(e).map((function(e){var t=c()(e,2),r=t[0],n=t[1];return[r,Object(d.decodeEntities)(n)]})))},m={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:h,shippingAddress:v,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(b.b)(),r=t.isEditor,n=t.previewData,c=(null==n?void 0:n.previewCart)||{},i=e.shouldSelect,o=Object(s.useRef)(),d=Object(p.useSelect)((function(e,t){var n=t.dispatch;if(!i)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:h,shippingAddress:v,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(u.CART_STORE_KEY),a=o.getCartData(),s=o.getCartErrors(),p=o.getCartTotals(),d=!o.hasFinishedResolution("getCartData"),l=o.isCustomerDataUpdating(),b=n(u.CART_STORE_KEY).receiveCart,O=y(a.billingAddress),g=a.needsShipping?y(a.shippingAddress):O,j=a.fees.map((function(e){return y(e)}));return{cartCoupons:a.coupons,cartItems:a.items||[],cartFees:j,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors||[],cartTotals:p,cartIsLoading:d,cartErrors:s,billingAddress:Object(f.a)(O),shippingAddress:Object(f.a)(g),extensions:a.extensions||{},shippingRates:a.shippingRates||[],shippingRatesLoading:l,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements||[],receiveCart:b}}),[i]);return o.current&&Object(a.isEqual)(o.current,d)||(o.current=d),o.current}},75:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return a}));var n=r(0),c=r(21),i=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),o=function(){return Object(n.useContext)(i)},a=function(e){var t=e.children,r=e.currentPostId,o=void 0===r?0:r,a=e.previewData,s=void 0===a?{}:a,u=Object(c.useSelect)((function(e){return o||e("core/editor").getCurrentPostId()}),[o]),p=Object(n.useCallback)((function(e){return e in s?s[e]:{}}),[s]),d={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:p};return Object(n.createElement)(i.Provider,{value:d},t)}},85:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(4),c=r.n(n),i=r(54),o=r(0),a=r(51);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=function(){var e=Object(a.a)();return{dispatchStoreEvent:Object(o.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(i.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(i.doAction)("experimental__woocommerce_blocks-checkout-".concat(t),u(u({},r),{},{storeCart:e}))}catch(e){console.error(e)}}),[e])}}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{119:function(e,t,r){"use strict";var n=r(4),i=r.n(n),c=r(13),o=r.n(c),a=r(5),s=r(1);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(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 d=Object(a.getSetting)("countryLocale",{}),l=function(e){var t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(s.sprintf)(Object(s.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(t.index=parseInt(e.priority,10)),!0===e.hidden&&(t.required=!1),t},f=Object.entries(d).map((function(e){var t=o()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=o()(e,2),r=t[0],n=t[1];return[r,l(n)]})).reduce((function(e,t){var r=o()(t,2),n=r[0],i=r[1];return e[n]=i,e}),{})]})).reduce((function(e,t){var r=o()(t,2),n=r[0],i=r[1];return e[n]=i,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==f[r]?f[r]:{};return e.map((function(e){var r=a.defaultAddressFields[e]||{},i=n[e]||{},c=t[e]||{};return p(p(p({key:e},r),i),c)})).sort((function(e,t){return e.index-t.index}))}},147:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(13),i=r.n(n),c=function(e){return e.reduce((function(e,t){var r=i()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})}},171:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return s}));var n=r(5),i=r(119),c=r(21),o=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,i=void 0===n?"":n,c=e.city,o=void 0===c?"":c,a=e.postcode,s=void 0===a?"":a;return{country:r.trim(),state:i.trim(),city:o.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},a=function(e){var t=e.email,r=void 0===t?"":t;return Object(c.isEmail)(r)?r.trim():""},s=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(i.a)(t,{},e.country),c=Object.assign({},e);return r.forEach((function(t){var r=t.key,n=void 0===r?"":r,i=t.hidden;void 0!==i&&i&&function(e,t){return e in t}(n,e)&&(c[n]="")})),c}},52:function(e,t,r){"use strict";r.d(t,"a",(function(){return j}));var n=r(13),i=r.n(n),c=r(4),o=r.n(c),a=r(6),s=r(0),u=r(40),p=r(23),d=r(29),l=r(147),f=r(171),b=r(78);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 g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var v={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},m=g(g({},v),{},{email:"",phone:""}),h=function(e){return Object(l.a)(Object.entries(e).map((function(e){var t=i()(e,2),r=t[0],n=t[1];return[r,Object(d.decodeEntities)(n)]})))},y={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:v,shippingRates:[],shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:[],receiveCart:function(){},extensions:{}},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(b.b)(),r=t.isEditor,n=t.previewData,i=(null==n?void 0:n.previewCart)||{},c=e.shouldSelect,o=Object(s.useRef)(),d=Object(p.useSelect)((function(e,t){var n=t.dispatch;if(!c)return y;if(r)return{cartCoupons:i.coupons,cartItems:i.items,cartFees:i.fees,cartItemsCount:i.items_count,cartItemsWeight:i.items_weight,cartNeedsPayment:i.needs_payment,cartNeedsShipping:i.needs_shipping,cartItemErrors:[],cartTotals:i.totals,cartIsLoading:!1,cartErrors:[],billingAddress:m,shippingAddress:v,extensions:{},shippingRates:i.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:i.has_calculated_shipping,paymentRequirements:i.paymentRequirements,receiveCart:"function"==typeof(null==i?void 0:i.receiveCart)?i.receiveCart:function(){}};var o=e(u.CART_STORE_KEY),a=o.getCartData(),s=o.getCartErrors(),p=o.getCartTotals(),d=!o.hasFinishedResolution("getCartData"),l=o.isCustomerDataUpdating(),b=n(u.CART_STORE_KEY).receiveCart,O=h(a.billingAddress),g=a.needsShipping?h(a.shippingAddress):O,j=a.fees.map((function(e){return h(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:p,cartIsLoading:d,cartErrors:s,billingAddress:Object(f.a)(O),shippingAddress:Object(f.a)(g),extensions:a.extensions||{},shippingRates:a.shippingRates||[],shippingRatesLoading:l,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements||[],receiveCart:b}}),[c]);return o.current&&Object(a.isEqual)(o.current,d)||(o.current=d),o.current}},78:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return a}));var n=r(0),i=r(23),c=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),o=function(){return Object(n.useContext)(c)},a=function(e){var t=e.children,r=e.currentPostId,o=void 0===r?0:r,a=e.previewData,s=void 0===a?{}:a,u=Object(i.useSelect)((function(e){return o||e("core/editor").getCurrentPostId()}),[o]),p=Object(n.useCallback)((function(e){return e in s?s[e]:{}}),[s]),d={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:p};return Object(n.createElement)(c.Provider,{value:d},t)}},85:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(4),i=r.n(n),c=r(51),o=r(0),a=r(52);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){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=function(){var e=Object(a.a)();return{dispatchStoreEvent:Object(o.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(c.doAction)("experimental__woocommerce_blocks-checkout-".concat(t),u(u({},r),{},{storeCart:e}))}catch(e){console.error(e)}}),[e])}}}}]);
build/atomic-block-components/add-to-cart--atomic-block-components/button.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[3],{177:function(e,t,n){"use strict";n.d(t,"b",(function(){return y})),n.d(t,"a",(function(){return E}));var c=n(4),r=n.n(c),o=n(13),i=n.n(o),a=n(0),s=(n(2),n(21)),u=n(85),f=n(75),l=n(10),d=n.n(l),b=n(7),v=n.n(b),O=n(936),p=(n(224),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-success";case"info":case"warning":return"woocommerce-info"}return""}),m=function(e){var t=e.className,n=e.notices,c=e.removeNotice,r=n.filter((function(e){return"snackbar"!==e.type}));if(!r.length)return null;var o=v()(t,"wc-block-components-notices");return Object(a.createElement)("div",{className:o},r.map((function(e){return Object(a.createElement)(O.a,d()({key:"store-notice-"+e.id},e,{className:v()("wc-block-components-notices__notice","woocommerce-message",p(e)),onRemove:function(){e.isDismissible&&c(e.id)}}),e.content)})))},j=n(941),g=function(e){var t=e.className,n=e.notices,c=e.removeNotice;if(e.isEditor)return null;var r=n.filter((function(e){return"snackbar"===e.type})),o=v()(t,"wc-block-components-notices__snackbar");return Object(a.createElement)(j.a,{notices:r,className:o,onRemove:c})};function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var w=Object(a.createContext)({notices:[],createNotice:function(e,t,n){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),y=function(){return Object(a.useContext)(w)},E=function(e){var t=e.children,n=e.className,c=void 0===n?"":n,r=e.createNoticeContainer,o=void 0===r||r,l=e.context,d=void 0===l?"wc/core":l,b=Object(s.useDispatch)("core/notices"),v=b.createNotice,O=b.removeNotice,p=Object(a.useState)(!1),j=i()(p,2),N=j[0],y=j[1],E=Object(u.a)().dispatchStoreEvent,k=Object(f.b)().isEditor,S=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};v(e,t,h(h({},n),{},{context:n.context||d})),E("store-notice-create",{status:e,content:t,options:n})}),[v,E,d]),P=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;O(e,t)}),[O,d]),D=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};S("default",e,h(h({},t),{},{type:"snackbar"}))}),[S]),C={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(d)}}),[d]).notices,createNotice:S,createSnackbarNotice:D,removeNotice:P,context:d,setIsSuppressed:y},I=N?null:Object(a.createElement)(m,{className:c,notices:C.notices,removeNotice:C.removeNotice,isEditor:k}),x=N?null:Object(a.createElement)(g,{notices:C.notices,removeNotice:C.removeNotice,isEditor:k});return Object(a.createElement)(w.Provider,{value:C},o&&I,t,x)}},224:function(e,t){},62:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var c=n(4),r=n.n(c),o=n(0),i=n(177);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var u=function(){var e=Object(i.b)(),t=e.notices,n=e.createNotice,c=e.removeNotice,r=e.createSnackbarNotice,a=e.setIsSuppressed,u=Object(o.useRef)(t);Object(o.useEffect)((function(){u.current=t}),[t]);var f=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return u.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.current.forEach((function(t){null!==e&&t.status!==e||c(t.id)}))},removeNotice:c}}),[c]),l=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("success",e,s({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(e,t)}}}),[n,r]);return s(s(s({notices:t},f),l),{},{setIsSuppressed:a})}},846:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var c=n(13),r=n.n(c),o=n(0),i=n(21),a=n(36),s=n(26),u=n(51),f=n(62),l=function(e,t){var n=e.find((function(e){return e.id===t}));return n?n.quantity:0},d=function(e){var t=Object(i.useDispatch)(a.CART_STORE_KEY).addItemToCart,n=Object(u.a)(),c=n.cartItems,d=n.cartIsLoading,b=Object(f.a)(),v=b.addErrorNotice,O=b.removeNotice,p=Object(o.useState)(!1),m=r()(p,2),j=m[0],g=m[1],N=Object(o.useRef)(l(c,e));return Object(o.useEffect)((function(){var t=l(c,e);t!==N.current&&(N.current=t)}),[c,e]),{cartQuantity:Number.isFinite(N.current)?N.current:0,addingToCart:j,cartIsLoading:d,addToCart:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return g(!0),t(e,n).then((function(){O("add-to-cart")})).catch((function(e){v(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){g(!1)}))}}}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[3],{162:function(e,t,n){"use strict";n.d(t,"b",(function(){return y})),n.d(t,"a",(function(){return E}));var c=n(4),r=n.n(c),o=n(13),i=n.n(o),a=n(0),s=(n(2),n(23)),u=n(85),f=n(78),l=n(11),d=n.n(l),b=n(7),v=n.n(b),O=n(806),p=(n(208),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-success";case"info":case"warning":return"woocommerce-info"}return""}),m=function(e){var t=e.className,n=e.notices,c=e.removeNotice,r=n.filter((function(e){return"snackbar"!==e.type}));if(!r.length)return null;var o=v()(t,"wc-block-components-notices");return Object(a.createElement)("div",{className:o},r.map((function(e){return Object(a.createElement)(O.a,d()({key:"store-notice-"+e.id},e,{className:v()("wc-block-components-notices__notice","woocommerce-message",p(e)),onRemove:function(){e.isDismissible&&c(e.id)}}),e.content)})))},j=n(810),g=function(e){var t=e.className,n=e.notices,c=e.removeNotice;if(e.isEditor)return null;var r=n.filter((function(e){return"snackbar"===e.type})),o=v()(t,"wc-block-components-notices__snackbar");return Object(a.createElement)(j.a,{notices:r,className:o,onRemove:c})};function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var w=Object(a.createContext)({notices:[],createNotice:function(e,t,n){},createSnackbarNotice:function(e,t){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),y=function(){return Object(a.useContext)(w)},E=function(e){var t=e.children,n=e.className,c=void 0===n?"":n,r=e.createNoticeContainer,o=void 0===r||r,l=e.context,d=void 0===l?"wc/core":l,b=Object(s.useDispatch)("core/notices"),v=b.createNotice,O=b.removeNotice,p=Object(a.useState)(!1),j=i()(p,2),N=j[0],y=j[1],E=Object(u.a)().dispatchStoreEvent,k=Object(f.b)().isEditor,S=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};v(e,t,h(h({},n),{},{context:n.context||d})),E("store-notice-create",{status:e,content:t,options:n})}),[v,E,d]),P=Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;O(e,t)}),[O,d]),D=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};S("default",e,h(h({},t),{},{type:"snackbar"}))}),[S]),C={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(d)}}),[d]).notices,createNotice:S,createSnackbarNotice:D,removeNotice:P,context:d,setIsSuppressed:y},I=N?null:Object(a.createElement)(m,{className:c,notices:C.notices,removeNotice:C.removeNotice,isEditor:k}),x=N?null:Object(a.createElement)(g,{notices:C.notices,removeNotice:C.removeNotice,isEditor:k});return Object(a.createElement)(w.Provider,{value:C},o&&I,t,x)}},208:function(e,t){},63:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var c=n(4),r=n.n(c),o=n(0),i=n(162);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var u=function(){var e=Object(i.b)(),t=e.notices,n=e.createNotice,c=e.removeNotice,r=e.createSnackbarNotice,a=e.setIsSuppressed,u=Object(o.useRef)(t);Object(o.useEffect)((function(){u.current=t}),[t]);var f=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return u.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.current.forEach((function(t){null!==e&&t.status!==e||c(t.id)}))},removeNotice:c}}),[c]),l=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("success",e,s({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(e,t)}}}),[n,r]);return s(s(s({notices:t},f),l),{},{setIsSuppressed:a})}},716:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var c=n(13),r=n.n(c),o=n(0),i=n(23),a=n(40),s=n(29),u=n(52),f=n(63),l=function(e,t){var n=e.find((function(e){return e.id===t}));return n?n.quantity:0},d=function(e){var t=Object(i.useDispatch)(a.CART_STORE_KEY).addItemToCart,n=Object(u.a)(),c=n.cartItems,d=n.cartIsLoading,b=Object(f.a)(),v=b.addErrorNotice,O=b.removeNotice,p=Object(o.useState)(!1),m=r()(p,2),j=m[0],g=m[1],N=Object(o.useRef)(l(c,e));return Object(o.useEffect)((function(){var t=l(c,e);t!==N.current&&(N.current=t)}),[c,e]),{cartQuantity:Number.isFinite(N.current)?N.current:0,addingToCart:j,cartIsLoading:d,addToCart:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return g(!0),t(e,n).then((function(){O("add-to-cart")})).catch((function(e){v(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){g(!1)}))}}}}}]);
build/atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{942:function(e,n,a){"use strict";var c=a(10),r=a.n(c),t=a(0),o=function(e,n){var a=[];return Object.keys(e).forEach((function(c){if(void 0!==n[c])switch(e[c].type){case"boolean":a[c]="false"!==n[c]&&!1!==n[c];break;case"number":a[c]=parseInt(n[c],10);break;case"array":case"object":a[c]=JSON.parse(n[c]);break;default:a[c]=n[c]}else a[c]=e[c].default})),a};n.a=function(e){return function(n){return function(a){var c=o(e,a);return Object(t.createElement)(n,r()({},a,c))}}}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{811: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],{102:function(e,t,r){var n=r(70);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},103:function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},104: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},111:function(e,t,r){"use strict";r.d(t,"b",(function(){return y})),r.d(t,"a",(function(){return g}));var n=r(20),o=r.n(n),c=r(7),a=r.n(c),s=r(15),i=r.n(s),u=r(9),l=r.n(u),f=r(0),d=r(8),b=r(21),p=r.n(b);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 h=Object(f.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),y=function(){return Object(f.useContext)(h)},g=function(e){var t=e.children,r=Object(f.useState)({}),n=l()(r,2),o=n[0],c=n[1],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]),b=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({})}),[]),y=Object(f.useCallback)((function(e){e&&c((function(t){return e=Object(d.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!p()(t[r],e))})),0===Object.values(e).length?t: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 p()(r[e],n)?r:v(v({},r),{},a()({},e,n))}))}),[]),j={getValidationError:s,setValidationErrors:y,clearValidationError:b,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(h.Provider,{value:j},t)}},129: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))}}},164:function(e,t){},165:function(e,t){},196:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));r(3);var n=r(111),o=(r(164),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))})},203: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}},214:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(129),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))}}}},215:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p}));var n=r(20),o=r.n(n),c=r(52),a=r.n(c),s=r(26),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})):[]},l=r(45);function f(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,a=!0,s=!1;return{s:function(){r=r.call(e)},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 d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var b=function(){var e=a()(i.a.mark((function e(t,r,n){var c,a,s,l,d,b;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=u(t,r),a=[],s=f(c),e.prev=3,s.s();case 5:if((l=s.n()).done){e.next=19;break}return d=l.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:b=e.sent,"object"===o()(b)&&a.push(b),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),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,d,b,p;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=[],a=u(t,r),s=f(a),e.prev=3,s.s();case 5:if((d=s.n()).done){e.next=28;break}return b=d.value,e.prev=7,e.next=10,Promise.resolve(b.callback(n));case 10:if(p=e.sent,"object"===o()(p)&&null!==p){e.next=13;break}return e.abrupt("continue",26);case 13:if(p.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(p)&&!Object(l.b)(p)){e.next=18;break}return c.push(p),e.abrupt("return",c);case 18:c.push(p),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),c.push({type:"error"}),e.abrupt("return",c);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),s.e(e.t1);case 33:return e.prev=33,s.f(),e.finish(33);case 36:return e.abrupt("return",c);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},288:function(e,t,r){"use strict";var n=r(28),o=React.createElement(n.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),React.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},294:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(203);t.a=function(e){return function(t){return function(r){var n=Object(c.a)(e,r);return React.createElement(t,o()({},r,n))}}}},301:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(9),o=r.n(n),c=r(0),a=r(11),s=r(14),i=r(18),u=r(38),l=r(51),f=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},d=function(e){var t=Object(a.useDispatch)(s.CART_STORE_KEY).addItemToCart,r=Object(u.a)(),n=r.cartItems,d=r.cartIsLoading,b=Object(l.a)(),p=b.addErrorNotice,m=b.removeNotice,v=Object(c.useState)(!1),O=o()(v,2),h=O[0],y=O[1],g=Object(c.useRef)(f(n,e));return Object(c.useEffect)((function(){var t=f(n,e);t!==g.current&&(g.current=t)}),[n,e]),{cartQuantity:Number.isFinite(g.current)?g.current:0,addingToCart:h,cartIsLoading:d,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return y(!0),t(e,r).then((function(){m("add-to-cart")})).catch((function(e){p(Object(i.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){y(!1)}))}}}},307:function(e,t){},308:function(e,t){},317:function(e,t,r){"use strict";r.r(t);var n=r(294),o=(r(3),r(4)),c=r.n(o),a=r(9),s=r.n(a),i=r(0),u=r(1),l=r(54),f=function(e){return e.is_purchasable||!1},d="pristine",b="idle",p="disabled",m="processing",v="before_processing",O="after_processing",h={status:d,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},y="set_pristine",g="set_idle",j="set_disabled",E="set_processing",w="set_before_processing",P="set_after_processing",k="set_processing_response",_="set_has_error",R="set_no_error",C="set_quantity",A="set_request_params",S=y,x=g,N=j,D=E,T=w,V=P,q=k,I=_,F=R,M=C,B=A,L=function(){return{type:S}},Q=function(){return{type:x}},W=function(){return{type:N}},H=function(){return{type:D}},K=function(){return{type:T}},J=function(){return{type:V}},U=function(e){return{type:q,data:e}},Y=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?I:F;return{type:t}},z=function(e){return{type:M,quantity:e}},G=function(e){return{type:B,data:e}},X=r(7),$=r.n(X);function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var te=y,re=g,ne=j,oe=E,ce=w,ae=P,se=k,ie=_,ue=R,le=C,fe=A,de=d,be=b,pe=p,me=m,ve=v,Oe=O,he=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,o=r.type,c=r.data;switch(o){case te:e=h;break;case re:e=t.status!==be?ee(ee({},t),{},{status:be}):t;break;case ne:e=t.status!==pe?ee(ee({},t),{},{status:pe}):t;break;case le:e=n!==t.quantity?ee(ee({},t),{},{quantity:n}):t;break;case fe:e=ee(ee({},t),{},{requestParams:ee(ee({},t.requestParams),c)});break;case se:e=ee(ee({},t),{},{processingResponse:c});break;case oe:e=!1===(e=t.status!==me?ee(ee({},t),{},{status:me,hasError:!1}):t).hasError?e:ee(ee({},e),{},{hasError:!1});break;case ce:e=t.status!==ve?ee(ee({},t),{},{status:ve,hasError:!1}):t;break;case ae:e=t.status!==Oe?ee(ee({},t),{},{status:Oe}):t;break;case ie:e=t.hasError?t:ee(ee({},t),{},{hasError:!0}),e=t.status===me||t.status===ve?ee(ee({},e),{},{status:be}):e;break;case ue:e=t.hasError?ee(ee({},t),{},{hasError:!1}):t}return e!==t&&o!==te&&e.status===de&&(e.status=be),e},ye=r(129),ge=r(214),je="add_to_cart_before_processing",Ee="add_to_cart_after_processing_with_success",we="add_to_cart_after_processing_with_error",Pe=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(ge.a)(Ee,e),onAddToCartProcessingWithError:Object(ge.a)(we,e),onAddToCartBeforeProcessing:Object(ge.a)(je,e)}},ke=r(215),_e=r(111),Re=r(51),Ce=r(45),Ae=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){}}}),Se=function(){return Object(i.useContext)(Ae)},xe=function(e){var t=e.children,r=e.product,n=e.showFormElements,o=Object(i.useReducer)(he,h),c=s()(o,2),a=c[0],d=c[1],y=Object(i.useReducer)(ye.b,{}),g=s()(y,2),j=g[0],E=g[1],w=Object(l.a)(j),P=Object(Re.a)(),k=P.addErrorNotice,_=P.removeNotices,R=Object(_e.b)().setValidationErrors,C=Object(Ce.c)(),A=C.isSuccessResponse,S=C.isErrorResponse,x=C.isFailResponse,N=Object(i.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:Pe(E).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:Pe(E).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:Pe(E).onAddToCartBeforeProcessing}}),[E]),D=Object(i.useMemo)((function(){return{resetForm:function(){d(L())},submitForm:function(){d(K())},setQuantity:function(e){d(z(e))},setHasError:function(e){d(Y(e))},setRequestParams:function(e){d(G(e))},setAfterProcessing:function(e){d(U(e)),d(J())}}}),[]);Object(i.useEffect)((function(){var e=a.status,t=!r.id||!f(r);e!==p||t?e!==p&&t&&d(W()):d(Q())}),[a.status,r,d]),Object(i.useEffect)((function(){a.status===v&&(_("error"),Object(ke.a)(w,je,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&k(t),r&&R(r)})),d(Q())):d(H())})))}),[a.status,R,k,_,d,w]),Object(i.useEffect)((function(){if(a.status===O){var e={processingResponse:a.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(S(e)||x(e))&&r&&(t=!0,k(r,n?{context:n}:void 0))})),t};if(a.hasError)return void Object(ke.b)(w,we,e).then((function(r){if(!t(r)){var n,o=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");k(o,{id:"add-to-cart"})}d(Q())}));Object(ke.b)(w,Ee,e).then((function(e){t(e)?d(Y(!0)):d(Q())}))}}),[a.status,a.hasError,a.processingResponse,D,k,S,x,A,w]);var T=function(e){return["simple","variable"].includes(e.type||"simple")}(r),V={product:r,productType:r.type||"simple",productIsPurchasable:f(r),productHasOptions:r.has_options||!1,supportsFormElements:T,showFormElements:n&&T,quantity:a.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:a.requestParams,isIdle:a.status===b,isDisabled:a.status===p,isProcessing:a.status===m,isBeforeProcessing:a.status===v,isAfterProcessing:a.status===O,hasError:a.hasError,eventRegistration:N,dispatchActions:D};return React.createElement(Ae.Provider,{value:V},t)},Ne=r(60),De=r.n(Ne),Te=r(18),Ve=r(38);function qe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Ie=function(){var e=Se(),t=e.dispatchActions,r=e.product,n=e.quantity,o=e.eventRegistration,c=e.hasError,a=e.isProcessing,l=e.requestParams,f=Object(_e.b)(),d=f.hasValidationErrors,b=f.showAllValidationErrors,p=Object(Re.a)(),m=p.addErrorNotice,v=p.removeNotice,O=Object(Ve.a)().receiveCart,h=Object(i.useState)(!1),y=s()(h,2),g=y[0],j=y[1],E=!c&&a,w=Object(i.useCallback)((function(){return!d||(b(),{type:"error"})}),[d,b]);Object(i.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(w,0);return function(){e()}}),[o,w]);var P=Object(i.useCallback)((function(){j(!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){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:n},l);De()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){De.a.setNonce(e.headers),e.json().then((function(r){e.ok?O(r):(r.body&&r.body.message?m(Object(Te.decodeEntities)(r.body.message),{id:"add-to-cart"}):m(Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),j(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&O(e.data.cart),t.setHasError(),t.setAfterProcessing(e),j(!1)}))}))}),[r,m,v,O,t,n,l]);return Object(i.useEffect)((function(){E&&!g&&P()}),[E,P,g]),null},Fe=function(e){var t=e.children,r=e.product,n=e.showFormElements;return React.createElement(_e.a,null,React.createElement(xe,{product:r,showFormElements:n},t,React.createElement(Ie,null)))},Me=r(84),Be=r(8),Le=r(211),Qe=(r(307),r(89)),We=r(139),He=r(288),Ke=r(55),Je=r(301),Ue=function(e){var t=e.className,r=e.href,n=e.text,o=e.onClick;return React.createElement(Qe.a,{className:t,href:r,onClick:o,rel:"nofollow"},n)},Ye=function(e){var t=e.className,r=e.quantityInCart,n=e.isProcessing,o=e.isDisabled,c=e.isDone,a=e.onClick;return React.createElement(Qe.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(We.a,{srcElement:He.a,alt:Object(u.__)("Done","woo-gutenberg-products-block")}))},ze=function(){var e=Se(),t=e.showFormElements,r=e.productIsPurchasable,n=e.productHasOptions,o=e.product,c=e.productType,a=e.isDisabled,l=e.isProcessing,f=e.eventRegistration,d=e.hasError,b=e.dispatchActions,p=Object(Me.useInnerBlockLayoutContext)().parentName,m=Object(Ke.a)().dispatchStoreEvent,v=Object(Je.a)(o.id||0).cartQuantity,O=Object(i.useState)(!1),h=s()(O,2),y=h[0],g=h[1],j=o.add_to_cart||{url:"",text:""};return Object(i.useEffect)((function(){var e=f.onAddToCartAfterProcessingWithSuccess((function(){return d||g(!0),!0}),0);return function(){e()}}),[f,d]),(t||!n&&"simple"===c)&&r?React.createElement(Ye,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:v,isDisabled:a,isProcessing:l,isDone:y,onClick:function(){b.submitForm(),m("cart-add-item",{product:o,listName:p})}}):React.createElement(Ue,{className:"wc-block-components-product-add-to-cart-button",href:j.url,text:j.text||Object(u.__)("View Product","woo-gutenberg-products-block"),onClick:function(){m("product-view-link",{product:o,listName:p})}})},Ge=function(e){var t=e.disabled,r=e.min,n=e.max,o=e.value,c=e.onChange;return React.createElement("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:n,hidden:1===n,disabled:t,onChange:function(e){c(e.target.value)}})},Xe=function(e){var t=e.reason,r=void 0===t?Object(u.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return React.createElement("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},$e=function(){var e=Se(),t=e.product,r=e.quantity,n=e.minQuantity,o=e.maxQuantity,c=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(Xe,null):t.id&&!t.is_in_stock?React.createElement(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(Ge,{value:r,min:n,max:o,disabled:a,onChange:c.setQuantity}),React.createElement(ze,null))},Ze=(r(308),r(50)),et=r.n(Ze),tt=r(213),rt=r(2),nt=r(196),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(_e.b)(),b=d.getValidationError,p=d.setValidationErrors,m=d.clearValidationError,v=t,O=b(v)||{};return Object(rt.useEffect)((function(){a?m(v):p($()({},v,{message:f,hidden:!0}))}),[a,v,f,m,p]),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){$()(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),{},$()({},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){$()(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],b=Object(i.useState)({}),p=s()(b,2),m=p[0],v=p[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),{},$()({},e,t)))}})})))},bt=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),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(n).length||0===o.length?null:React.createElement(dt,{attributes:n,variationAttributes:o,setRequestParams:r.setRequestParams})},pt=function(){var e=Se(),t=e.product,r=e.quantity,n=e.minQuantity,o=e.maxQuantity,c=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(Xe,null):t.id&&!t.is_in_stock?React.createElement(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(bt,{product:t,dispatchers:c}),React.createElement(Ge,{value:r,min:n,max:o,disabled:a,onChange:c.setQuantity}),React.createElement(ze,null))},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.")},Ot=function(){return React.createElement(vt,null)},ht=function(){var e=Se(),t=e.showFormElements,r=e.productType;return t?"variable"===r?React.createElement(pt,null):"grouped"===r?React.createElement(Ot,null):"external"===r?React.createElement(mt,null):"simple"===r||"variation"===r?React.createElement($e,null):null:React.createElement(ze,null)},yt=Object(Le.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,n=Object(Me.useProductDataContext)().product,o=c()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Be.isEmpty)(n)});return React.createElement(Fe,{product:n,showFormElements:r},React.createElement("div",{className:o},React.createElement(ht,null)))})),gt={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}};t.default=Object(n.a)(gt)(yt)},45:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return i})),r.d(t,"c",(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}}},50:function(e,t,r){var n=r(102),o=r(103),c=r(69),a=r(104);e.exports=function(e){return n(e)||o(e)||c(e)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},51:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(7),o=r.n(n),c=r(0),a=r(125);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}var u=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,o=e.createSnackbarNotice,s=e.setIsSuppressed,u=Object(c.useRef)(t);Object(c.useEffect)((function(){u.current=t}),[t]);var l=Object(c.useMemo)((function(){return{hasNoticesOfType:function(e){return u.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),f=Object(c.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,i({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,i({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,i({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,i({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,i({},t))},addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(e,t)}}}),[r,o]);return i(i(i({notices:t},l),f),{},{setIsSuppressed:s})}},52: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},54:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),o=r(21),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}},89:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(15),a=r.n(c),s=r(73),i=r(4),u=r.n(i);r(165);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))}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{100:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},108:function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return g}));var n=r(20),o=r.n(n),c=r(7),a=r.n(c),i=r(16),s=r.n(i),u=r(9),l=r.n(u),f=r(0),d=r(8),b=r(22),p=r.n(b);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function O(e){var t=function(e,t){if("object"!==o()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==o()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o()(t)?t:String(t)}var y=Object(f.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),h=function(){return Object(f.useContext)(y)},g=function(e){var t=e.children,r=Object(f.useState)({}),n=l()(r,2),o=n[0],c=n[1],i=Object(f.useCallback)((function(e){return o[e]}),[o]),u=Object(f.useCallback)((function(e){var t=o[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[o]),b=Object(f.useCallback)((function(e){c((function(t){if(!t[e])return t;t[e];return s()(t,[e].map(O))}))}),[]),v=Object(f.useCallback)((function(){c({})}),[]),h=Object(f.useCallback)((function(e){e&&c((function(t){return e=Object(d.pickBy)(e,(function(e,r){return"string"==typeof e.message&&(!t.hasOwnProperty(r)||!p()(t[r],e))})),0===Object.values(e).length?t:m(m({},t),e)}))}),[]),g=Object(f.useCallback)((function(e,t){c((function(r){if(!r.hasOwnProperty(e))return r;var n=m(m({},r[e]),t);return p()(r[e],n)?r:m(m({},r),{},a()({},e,n))}))}),[]),j={getValidationError:i,setValidationErrors:h,clearValidationError:b,clearAllValidationErrors:v,hideValidationError:Object(f.useCallback)((function(e){g(e,{hidden:!0})}),[g]),showValidationError:Object(f.useCallback)((function(e){g(e,{hidden:!1})}),[g]),showAllValidationErrors:Object(f.useCallback)((function(){c((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=m(m({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:m(m({},e),t)}))}),[]),hasValidationErrors:Object.keys(o).length>0,getValidationErrorId:u};return React.createElement(y.Provider,{value:j},t)}},127:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return f}));var n,o=r(7),c=r.n(o),a=r(8);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,o=t.eventType,a=t.id,i=t.callback,u=t.priority,f=e.hasOwnProperty(o)?new Map(e[o]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return f.set(a,{priority:u,callback:i}),s(s({},e),{},c()({},o,f));case n.REMOVE_EVENT_CALLBACK:return f.delete(a),s(s({},e),{},c()({},o,f))}}},134:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"c",(function(){return a})),r.d(t,"b",(function(){return i})),r.d(t,"d",(function(){return s}));var n=r(20),o=r.n(n),c=function(e){return"number"==typeof e},a=function(e){return"string"==typeof e},i=function(e){return!function(e){return null===e}(e)&&"object"===o()(e)};function s(e,t){return i(e)&&t in e}},163:function(e,t){},192:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));r(3);var n=r(108),o=(r(163),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,c=void 0===o?"":o,a=e.elementId,i=void 0===a?"":a,s=Object(n.b)(),u=s.getValidationError,l=s.getValidationErrorId;if(!r){var f=u(c)||{};if(!f.message||f.hidden)return null;r=f.message}return React.createElement("div",{className:"wc-block-components-validation-error",role:"alert"},React.createElement("p",{id:l(i)},r))})},199:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e,t){var r=[];return Object.keys(e).forEach((function(n){if(void 0!==t[n])switch(e[n].type){case"boolean":r[n]="false"!==t[n]&&!1!==t[n];break;case"number":r[n]=parseInt(t[n],10);break;case"array":case"object":r[n]=JSON.parse(t[n]);break;default:r[n]=t[n]}else r[n]=e[n].default})),r}},211:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(127),o=function(e,t){return function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,c=n.a.addEventCallback(e,r,o);return t(c),function(){t(n.a.removeEventCallback(e,c.id))}}}},212:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p}));var n=r(20),o=r.n(n),c=r(52),a=r.n(c),i=r(26),s=r.n(i),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(45);function f(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,a=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,c=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw c}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var b=function(){var e=a()(s.a.mark((function e(t,r,n){var c,a,i,l,d,b;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=u(t,r),a=[],i=f(c),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return d=l.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:b=e.sent,"object"===o()(b)&&a.push(b),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(t,r,n){return e.apply(this,arguments)}}(),p=function(){var e=a()(s.a.mark((function e(t,r,n){var c,a,i,d,b,p;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=[],a=u(t,r),i=f(a),e.prev=3,i.s();case 5:if((d=i.n()).done){e.next=28;break}return b=d.value,e.prev=7,e.next=10,Promise.resolve(b.callback(n));case 10:if(p=e.sent,"object"===o()(p)&&null!==p){e.next=13;break}return e.abrupt("continue",26);case 13:if(p.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(p)&&!Object(l.b)(p)){e.next=18;break}return c.push(p),e.abrupt("return",c);case 18:c.push(p),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),c.push({type:"error"}),e.abrupt("return",c);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:return e.abrupt("return",c);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},287:function(e,t,r){"use strict";var n=r(28),o=React.createElement(n.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),React.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},292:function(e,t,r){"use strict";var n=r(10),o=r.n(n),c=r(199);t.a=function(e){return function(t){return function(r){var n=Object(c.a)(e,r);return React.createElement(t,o()({},r,n))}}}},299:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(9),o=r.n(n),c=r(0),a=r(12),i=r(15),s=r(18),u=r(38),l=r(51),f=function(e,t){var r=e.find((function(e){return e.id===t}));return r?r.quantity:0},d=function(e){var t=Object(a.useDispatch)(i.CART_STORE_KEY).addItemToCart,r=Object(u.a)(),n=r.cartItems,d=r.cartIsLoading,b=Object(l.a)(),p=b.addErrorNotice,v=b.removeNotice,m=Object(c.useState)(!1),O=o()(m,2),y=O[0],h=O[1],g=Object(c.useRef)(f(n,e));return Object(c.useEffect)((function(){var t=f(n,e);t!==g.current&&(g.current=t)}),[n,e]),{cartQuantity:Number.isFinite(g.current)?g.current:0,addingToCart:y,cartIsLoading:d,addToCart:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return h(!0),t(e,r).then((function(){v("add-to-cart")})).catch((function(e){p(Object(s.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})})).finally((function(){h(!1)}))}}}},305:function(e,t){},306:function(e,t){},315:function(e,t,r){"use strict";r.r(t);var n=r(292),o=(r(3),r(4)),c=r.n(o),a=r(9),i=r.n(a),s=r(0),u=r(1),l=r(54),f=function(e){return e.is_purchasable||!1},d="pristine",b="idle",p="disabled",v="processing",m="before_processing",O="after_processing",y={status:d,hasError:!1,quantity:1,processingResponse:null,requestParams:{}},h="set_pristine",g="set_idle",j="set_disabled",E="set_processing",w="set_before_processing",P="set_after_processing",k="set_processing_response",_="set_has_error",R="set_no_error",C="set_quantity",A="set_request_params",S=h,x=g,N=j,D=E,T=w,V=P,q=k,I=_,F=R,B=C,M=A,L=function(){return{type:S}},Q=function(){return{type:x}},W=function(){return{type:N}},H=function(){return{type:D}},K=function(){return{type:T}},J=function(){return{type:V}},U=function(e){return{type:q,data:e}},Y=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?I:F;return{type:t}},z=function(e){return{type:B,quantity:e}},G=function(e){return{type:M,data:e}},X=r(7),$=r.n(X);function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var te=h,re=g,ne=j,oe=E,ce=w,ae=P,ie=k,se=_,ue=R,le=C,fe=A,de=d,be=b,pe=p,ve=v,me=m,Oe=O,ye=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,r=arguments.length>1?arguments[1]:void 0,n=r.quantity,o=r.type,c=r.data;switch(o){case te:e=y;break;case re:e=t.status!==be?ee(ee({},t),{},{status:be}):t;break;case ne:e=t.status!==pe?ee(ee({},t),{},{status:pe}):t;break;case le:e=n!==t.quantity?ee(ee({},t),{},{quantity:n}):t;break;case fe:e=ee(ee({},t),{},{requestParams:ee(ee({},t.requestParams),c)});break;case ie:e=ee(ee({},t),{},{processingResponse:c});break;case oe:e=!1===(e=t.status!==ve?ee(ee({},t),{},{status:ve,hasError:!1}):t).hasError?e:ee(ee({},e),{},{hasError:!1});break;case ce:e=t.status!==me?ee(ee({},t),{},{status:me,hasError:!1}):t;break;case ae:e=t.status!==Oe?ee(ee({},t),{},{status:Oe}):t;break;case se:e=t.hasError?t:ee(ee({},t),{},{hasError:!0}),e=t.status===ve||t.status===me?ee(ee({},e),{},{status:be}):e;break;case ue:e=t.hasError?ee(ee({},t),{},{hasError:!1}):t}return e!==t&&o!==te&&e.status===de&&(e.status=be),e},he=r(127),ge=r(211),je="add_to_cart_before_processing",Ee="add_to_cart_after_processing_with_success",we="add_to_cart_after_processing_with_error",Pe=function(e){return{onAddToCartAfterProcessingWithSuccess:Object(ge.a)(Ee,e),onAddToCartProcessingWithError:Object(ge.a)(we,e),onAddToCartBeforeProcessing:Object(ge.a)(je,e)}},ke=r(212),_e=r(108),Re=r(51),Ce=r(45),Ae=Object(s.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:function(e){},onAddToCartAfterProcessingWithError:function(e){},onAddToCartBeforeProcessing:function(e){}},dispatchActions:{resetForm:function(){},submitForm:function(){},setQuantity:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},setRequestParams:function(e){}}}),Se=function(){return Object(s.useContext)(Ae)},xe=function(e){var t=e.children,r=e.product,n=e.showFormElements,o=Object(s.useReducer)(ye,y),c=i()(o,2),a=c[0],d=c[1],h=Object(s.useReducer)(he.b,{}),g=i()(h,2),j=g[0],E=g[1],w=Object(l.a)(j),P=Object(Re.a)(),k=P.addErrorNotice,_=P.removeNotices,R=Object(_e.b)().setValidationErrors,C=Object(Ce.c)(),A=C.isSuccessResponse,S=C.isErrorResponse,x=C.isFailResponse,N=Object(s.useMemo)((function(){return{onAddToCartAfterProcessingWithSuccess:Pe(E).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:Pe(E).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:Pe(E).onAddToCartBeforeProcessing}}),[E]),D=Object(s.useMemo)((function(){return{resetForm:function(){d(L())},submitForm:function(){d(K())},setQuantity:function(e){d(z(e))},setHasError:function(e){d(Y(e))},setRequestParams:function(e){d(G(e))},setAfterProcessing:function(e){d(U(e)),d(J())}}}),[]);Object(s.useEffect)((function(){var e=a.status,t=!r.id||!f(r);e!==p||t?e!==p&&t&&d(W()):d(Q())}),[a.status,r,d]),Object(s.useEffect)((function(){a.status===m&&(_("error"),Object(ke.a)(w,je,{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;t&&k(t),r&&R(r)})),d(Q())):d(H())})))}),[a.status,R,k,_,d,w]),Object(s.useEffect)((function(){if(a.status===O){var e={processingResponse:a.processingResponse},t=function(e){var t=!1;return e.forEach((function(e){var r=e.message,n=e.messageContext;(S(e)||x(e))&&r&&(t=!0,k(r,n?{context:n}:void 0))})),t};if(a.hasError)return void Object(ke.b)(w,we,e).then((function(r){if(!t(r)){var n,o=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");k(o,{id:"add-to-cart"})}d(Q())}));Object(ke.b)(w,Ee,e).then((function(e){t(e)?d(Y(!0)):d(Q())}))}}),[a.status,a.hasError,a.processingResponse,D,k,S,x,A,w]);var T=function(e){return["simple","variable"].includes(e.type||"simple")}(r),V={product:r,productType:r.type||"simple",productIsPurchasable:f(r),productHasOptions:r.has_options||!1,supportsFormElements:T,showFormElements:n&&T,quantity:a.quantity,minQuantity:1,maxQuantity:r.quantity_limit||99,requestParams:a.requestParams,isIdle:a.status===b,isDisabled:a.status===p,isProcessing:a.status===v,isBeforeProcessing:a.status===m,isAfterProcessing:a.status===O,hasError:a.hasError,eventRegistration:N,dispatchActions:D};return React.createElement(Ae.Provider,{value:V},t)},Ne=r(60),De=r.n(Ne),Te=r(18),Ve=r(38);function qe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Ie=function(){var e=Se(),t=e.dispatchActions,r=e.product,n=e.quantity,o=e.eventRegistration,c=e.hasError,a=e.isProcessing,l=e.requestParams,f=Object(_e.b)(),d=f.hasValidationErrors,b=f.showAllValidationErrors,p=Object(Re.a)(),v=p.addErrorNotice,m=p.removeNotice,O=Object(Ve.a)().receiveCart,y=Object(s.useState)(!1),h=i()(y,2),g=h[0],j=h[1],E=!c&&a,w=Object(s.useCallback)((function(){return!d||(b(),{type:"error"})}),[d,b]);Object(s.useEffect)((function(){var e=o.onAddToCartBeforeProcessing(w,0);return function(){e()}}),[o,w]);var P=Object(s.useCallback)((function(){j(!0),m("add-to-cart");var e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qe(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:r.id||0,quantity:n},l);De()({path:"/wc/store/cart/add-item",method:"POST",data:e,cache:"no-store",parse:!1}).then((function(e){De.a.setNonce(e.headers),e.json().then((function(r){e.ok?O(r):(r.body&&r.body.message?v(Object(Te.decodeEntities)(r.body.message),{id:"add-to-cart"}):v(Object(u.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),t.setHasError()),t.setAfterProcessing(r),j(!1)}))})).catch((function(e){e.json().then((function(e){var r;null!==(r=e.data)&&void 0!==r&&r.cart&&O(e.data.cart),t.setHasError(),t.setAfterProcessing(e),j(!1)}))}))}),[r,v,m,O,t,n,l]);return Object(s.useEffect)((function(){E&&!g&&P()}),[E,P,g]),null},Fe=function(e){var t=e.children,r=e.product,n=e.showFormElements;return React.createElement(_e.a,null,React.createElement(xe,{product:r,showFormElements:n},t,React.createElement(Ie,null)))},Be=r(81),Me=r(8),Le=r(208),Qe=(r(305),r(11)),We=r(139),He=r(287),Ke=r(56),Je=r(299),Ue=function(e){var t=e.className,r=e.href,n=e.text,o=e.onClick;return React.createElement(Qe.Button,{className:t,href:r,onClick:o,rel:"nofollow"},n)},Ye=function(e){var t=e.className,r=e.quantityInCart,n=e.isProcessing,o=e.isDisabled,c=e.isDone,a=e.onClick;return React.createElement(Qe.Button,{className:t,disabled:o,showSpinner:n,onClick:a},c&&r>0?Object(u.sprintf)(Object(u._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(u.__)("Add to cart","woo-gutenberg-products-block"),!!c&&React.createElement(We.a,{srcElement:He.a,alt:Object(u.__)("Done","woo-gutenberg-products-block")}))},ze=function(){var e=Se(),t=e.showFormElements,r=e.productIsPurchasable,n=e.productHasOptions,o=e.product,c=e.productType,a=e.isDisabled,l=e.isProcessing,f=e.eventRegistration,d=e.hasError,b=e.dispatchActions,p=Object(Be.useInnerBlockLayoutContext)().parentName,v=Object(Ke.a)().dispatchStoreEvent,m=Object(Je.a)(o.id||0).cartQuantity,O=Object(s.useState)(!1),y=i()(O,2),h=y[0],g=y[1],j=o.add_to_cart||{url:"",text:""};return Object(s.useEffect)((function(){var e=f.onAddToCartAfterProcessingWithSuccess((function(){return d||g(!0),!0}),0);return function(){e()}}),[f,d]),(t||!n&&"simple"===c)&&r?React.createElement(Ye,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:m,isDisabled:a,isProcessing:l,isDone:h,onClick:function(){b.submitForm(),v("cart-add-item",{product:o,listName:p})}}):React.createElement(Ue,{className:"wc-block-components-product-add-to-cart-button",href:j.url,text:j.text||Object(u.__)("View Product","woo-gutenberg-products-block"),onClick:function(){v("product-view-link",{product:o,listName:p})}})},Ge=function(e){var t=e.disabled,r=e.min,n=e.max,o=e.value,c=e.onChange;return React.createElement("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:o,min:r,max:n,hidden:1===n,disabled:t,onChange:function(e){c(e.target.value)}})},Xe=function(e){var t=e.reason,r=void 0===t?Object(u.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block"):t;return React.createElement("div",{className:"wc-block-components-product-add-to-cart-unavailable"},r)},$e=function(){var e=Se(),t=e.product,r=e.quantity,n=e.minQuantity,o=e.maxQuantity,c=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(Xe,null):t.id&&!t.is_in_stock?React.createElement(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(Ge,{value:r,min:n,max:o,disabled:a,onChange:c.setQuantity}),React.createElement(ze,null))},Ze=(r(306),r(49)),et=r.n(Ze),tt=r(210),rt=r(2),nt=r(192),ot={value:"",label:Object(u.__)("Select an option","woo-gutenberg-products-block")},ct=function(e){var t=e.attributeName,r=e.options,n=void 0===r?[]:r,o=e.value,a=void 0===o?"":o,i=e.onChange,s=void 0===i?function(){}:i,l=e.errorMessage,f=void 0===l?Object(u.__)("Please select a value.","woo-gutenberg-products-block"):l,d=Object(_e.b)(),b=d.getValidationError,p=d.setValidationErrors,v=d.clearValidationError,m=t,O=b(m)||{};return Object(rt.useEffect)((function(){a?v(m):p($()({},m,{message:f,hidden:!0}))}),[a,m,f,v,p]),Object(rt.useEffect)((function(){return function(){v(m)}}),[m,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},React.createElement(tt.SelectControl,{label:Object(Te.decodeEntities)(t),value:a||"",options:[ot].concat(et()(n)),onChange:s,required:!0,className:c()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":O.message&&!O.hidden})}),React.createElement(nt.a,{propertyName:m,elementId:m}))};function at(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function it(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?at(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var st=function(e,t,r){var n=Object.values(t).map((function(e){return e.id}));if(Object.values(r).every((function(e){return""===e})))return n;var o=Object.keys(e);return n.filter((function(e){return o.every((function(n){var o=r[n]||"",c=t["id:"+e].attributes[n];return""===o||(null===c||c===o)}))}))},ut=function(e,t,r){var n={},o=Object.keys(e),c=Object.values(r).filter(Boolean).length>0;return o.forEach((function(o){var a=e[o],i=it(it({},r),{},$()({},o,null)),s=c?st(e,t,i):null,u=null!==s?s.map((function(e){return t["id:"+e].attributes[o]})):null;n[o]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map((function(e){var r=e.name,n=e.slug;return null===t||t.includes(null)||t.includes(n)?{value:n,label:Object(Te.decodeEntities)(r)}:null})).filter(Boolean)}(a.terms,u)})),n};function lt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ft(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lt(Object(r),!0).forEach((function(t){$()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var dt=function(e){var t=e.attributes,r=e.variationAttributes,n=e.setRequestParams,o=Object(l.a)(t),c=Object(l.a)(r),a=Object(s.useState)(0),u=i()(a,2),f=u[0],d=u[1],b=Object(s.useState)({}),p=i()(b,2),v=p[0],m=p[1],O=Object(s.useMemo)((function(){return ut(o,c,v)}),[v,o,c]);return Object(s.useEffect)((function(){Object.values(v).filter((function(e){return""!==e})).length===Object.keys(o).length?d(function(e,t,r){return st(e,t,r)[0]||0}(o,c,v)):f>0&&d(0)}),[v,f,o,c]),Object(s.useEffect)((function(){n({id:f,variation:Object.keys(v).map((function(e){return{attribute:e,value:v[e]}}))})}),[n,f,v]),React.createElement("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map((function(e){return React.createElement(ct,{key:e,attributeName:e,options:O[e],value:v[e],onChange:function(t){m(ft(ft({},v),{},$()({},e,t)))}})})))},bt=function(e){var t=e.product,r=e.dispatchers,n=function(e){return e?Object(Me.keyBy)(Object.values(e).filter((function(e){return e.has_variations})),"name"):{}}(t.attributes),o=function(e){if(!e)return{};var t={};return e.forEach((function(e){var r=e.id,n=e.attributes;t["id:".concat(r)]={id:r,attributes:n.reduce((function(e,t){var r=t.name,n=t.value;return e[r]=n,e}),{})}})),t}(t.variations);return 0===Object.keys(n).length||0===o.length?null:React.createElement(dt,{attributes:n,variationAttributes:o,setRequestParams:r.setRequestParams})},pt=function(){var e=Se(),t=e.product,r=e.quantity,n=e.minQuantity,o=e.maxQuantity,c=e.dispatchActions,a=e.isDisabled;return t.id&&!t.is_purchasable?React.createElement(Xe,null):t.id&&!t.is_in_stock?React.createElement(Xe,{reason:Object(u.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):React.createElement(React.Fragment,null,React.createElement(bt,{product:t,dispatchers:c}),React.createElement(Ge,{value:r,min:n,max:o,disabled:a,onChange:c.setQuantity}),React.createElement(ze,null))},vt=function(){return React.createElement(ze,null)},mt=function(){return React.createElement(tt.Placeholder,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element.")},Ot=function(){return React.createElement(mt,null)},yt=function(){var e=Se(),t=e.showFormElements,r=e.productType;return t?"variable"===r?React.createElement(pt,null):"grouped"===r?React.createElement(Ot,null):"external"===r?React.createElement(vt,null):"simple"===r||"variation"===r?React.createElement($e,null):null:React.createElement(ze,null)},ht=Object(Le.withProductDataContext)((function(e){var t=e.className,r=e.showFormElements,n=Object(Be.useProductDataContext)().product,o=c()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(Me.isEmpty)(n)});return React.createElement(Fe,{product:n,showFormElements:r},React.createElement("div",{className:o},React.createElement(yt,null)))})),gt={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}};t.default=Object(n.a)(gt)(ht)},45:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return f}));var n,o,c=r(134);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(o||(o={}));var a=function(e,t){return Object(c.b)(e)&&"type"in e&&e.type===t},i=function(e){return a(e,n.SUCCESS)},s=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(c.b)(e)||void 0===e.retry||!0===e.retry},f=function(){return{responseTypes:n,noticeContexts:o,shouldRetry:l,isSuccessResponse:i,isErrorResponse:s,isFailResponse:u}}},49:function(e,t,r){var n=r(98),o=r(99),c=r(67),a=r(100);e.exports=function(e){return n(e)||o(e)||c(e)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},51:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(7),o=r.n(n),c=r(0),a=r(123);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,o=e.createSnackbarNotice,i=e.setIsSuppressed,u=Object(c.useRef)(t);Object(c.useE