Version Description
Download this release
Release Info
Developer | sadowski |
Plugin | WooCommerce |
Version | 7.1.0-rc.2 |
Comparing to | |
See all releases |
Code changes from version 7.1.0-rc.1 to 7.1.0-rc.2
- assets/client/admin/chunks/profile-wizard.js +1 -1
- i18n/languages/woocommerce.pot +114 -114
- includes/admin/meta-boxes/class-wc-meta-box-order-data.php +22 -1
- includes/class-wc-ajax.php +2 -0
- packages/woocommerce-blocks/assets/js/atomic/blocks/product-elements/button/block.js +2 -0
- packages/woocommerce-blocks/assets/js/base/components/form-token-field/style.scss +3 -0
- packages/woocommerce-blocks/assets/js/base/components/price-slider/style.scss +22 -58
- packages/woocommerce-blocks/assets/js/blocks/mini-cart/block.tsx +1 -7
- packages/woocommerce-blocks/assets/js/blocks/mini-cart/edit.tsx +1 -7
- packages/woocommerce-blocks/assets/js/blocks/mini-cart/frontend.ts +21 -0
- packages/woocommerce-blocks/assets/js/blocks/mini-cart/index.tsx +0 -1
- packages/woocommerce-blocks/assets/js/blocks/mini-cart/mini-cart-contents/edit.tsx +54 -0
- packages/woocommerce-blocks/assets/js/blocks/mini-cart/style.scss +6 -3
- packages/woocommerce-blocks/build/active-filters-frontend.asset.php +1 -1
- packages/woocommerce-blocks/build/active-filters-frontend.js +2 -2
- packages/woocommerce-blocks/build/active-filters-wrapper-frontend.js +4 -4
- packages/woocommerce-blocks/build/active-filters.asset.php +1 -1
- packages/woocommerce-blocks/build/active-filters.js +4 -4
- packages/woocommerce-blocks/build/all-products-frontend.asset.php +1 -1
- packages/woocommerce-blocks/build/all-products-frontend.js +4 -4
- packages/woocommerce-blocks/build/all-products.asset.php +1 -1
- packages/woocommerce-blocks/build/all-products.js +13 -13
- packages/woocommerce-blocks/build/all-reviews.asset.php +1 -1
- packages/woocommerce-blocks/build/all-reviews.js +3 -3
- packages/woocommerce-blocks/build/attribute-filter-frontend.asset.php +1 -1
- packages/woocommerce-blocks/build/attribute-filter-frontend.js +4 -4
- packages/woocommerce-blocks/build/attribute-filter-wrapper-frontend.js +2 -2
- packages/woocommerce-blocks/build/attribute-filter.asset.php +1 -1
- packages/woocommerce-blocks/build/attribute-filter.js +5 -5
- packages/woocommerce-blocks/build/cart-blocks/cart-cross-sells-products--product-add-to-cart-frontend.js +2 -2
assets/client/admin/chunks/profile-wizard.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
"use strict";(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[7708],{10314:(e,t,o)=>{o.d(t,{Z:()=>n});var s=o(69307),r=o(70444);const n=(0,s.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(r.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}))},37942:(e,t,o)=>{o.d(t,{Z:()=>n});var s=o(69307),r=o(70444);const n=(0,s.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(r.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}))},9426:(e,t,o)=>{o.r(t),o.d(t,{default:()=>Be});var s=o(69307),r=o(65736),n=o(92694),i=o(94333),a=o(92819),l=o(9818),c=o(10431),m=o(67221),d=o(14599),p=o(74617),u=o(5267),h=o(55609),_=o(86020),g=o(83849),w=o.n(g),C=o(54071),f=o(37657);const y=[{key:"shopify",label:(0,r.__)("Shopify","woocommerce")},{key:"bigcommerce",label:(0,r.__)("BigCommerce","woocommerce")},{key:"magento",label:(0,r.__)("Magento","woocommerce")},{key:"wix",label:(0,r.__)("Wix","woocommerce")},{key:"amazon",label:(0,r.__)("Amazon","woocommerce")},{key:"ebay",label:(0,r.__)("eBay","woocommerce")},{key:"etsy",label:(0,r.__)("Etsy","woocommerce")},{key:"squarespace",label:(0,r.__)("Squarespace","woocommerce")},{key:"wish",label:(0,r.__)("Wish","woocommerce")},{key:"walmart",label:(0,r.__)("Walmart","woocommerce")},{key:"other",label:(0,r.__)("Other","woocommerce")}],v=[{key:"1",label:(0,r.__)("It's just me","woocommerce")},{key:"<10",label:(0,r.__)("< 10","woocommerce")},{key:"10-50",label:"10 - 50"},{key:"50-250",label:"50 - 250"},{key:"+250",label:(0,r.__)("+250","woocommerce")},{key:"not specified",label:(0,r.__)("I'd rather not say","woocommerce")}],E=[{key:"no",label:(0,r.__)("No","woocommerce")},{key:"other",label:(0,r.__)("Yes, on another platform","woocommerce")},{key:"other-woocommerce",label:(0,r.__)("Yes, I own a different store powered by WooCommerce","woocommerce")},{key:"brick-mortar",label:(0,r.__)("Yes, in person at physical stores and/or events","woocommerce")},{key:"brick-mortar-other",label:(0,r.__)("Yes, on another platform and in person at physical stores and/or events","woocommerce")}];var b=o(2969),S=o(81595);const k=(e,t)=>(0,S.formatValue)(e,"number",t),N=function(e,t){let o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k;return o?(0,r.sprintf)((0,r._x)("%1$s - %2$s","store product count or revenue range","woocommerce"),s(e,t),s(e,o)):(0,r.sprintf)((0,r._x)("%s+","store product count or revenue","woocommerce"),s(e,t))},T={US:1,EU:.9,IN:71.24,GB:.76,BR:4.19,VN:23172.5,ID:14031,BD:84.87,PK:154.8,RU:63.74,TR:5.75,MX:19.37,CA:1.32},x=(e,t)=>{const o=(0,b.w)(t);if("US"===o)return e;const s=T[o]||T.US,r=s.toString().split(".")[0].length,n=Math.pow(10,2+r);return Math.round(e*s/n)*n},P=(e,t,o)=>[{key:"none",label:(0,r.sprintf)((0,r.__)("%s (I'm just getting started)","woocommerce"),o(0))},{key:"up-to-2500",label:(0,r.sprintf)((0,r.__)("Up to %s","woocommerce"),o(x(2500,t)))},{key:"2500-10000",label:N(e,x(2500,t),x(1e4,t),((e,t)=>o(t)))},{key:"10000-50000",label:N(e,x(1e4,t),x(5e4,t),((e,t)=>o(t)))},{key:"50000-250000",label:N(e,x(5e4,t),x(25e4,t),((e,t)=>o(t)))},{key:"more-than-250000",label:(0,r.sprintf)((0,r.__)("More than %s","woocommerce"),o(x(25e4,t)))},{key:"rather-not-say",label:(0,r.__)("I'd rather not say","woocommerce")}];var O=o(14812),I=o(62907),V=o(37942),F=o(10314),M=o(98534);const B=()=>(0,s.createElement)("svg",{width:"200",height:"148",viewBox:"0 0 200 148",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)("g",{clipPath:"url(#clip0)"},(0,s.createElement)("path",{d:"M197.563 2.53875e-09H62.909C62.3961 0.000450584 61.9043 0.205742 61.5416 0.570805C61.179 0.935868 60.975 1.43087 60.9746 1.94714V50.9404H93.5623C94.4445 50.9415 95.2902 51.2947 95.9141 51.9226C96.5379 52.5505 96.8888 53.4019 96.8899 54.2899V95.7402H197.563C197.843 95.7402 198.119 95.6791 198.373 95.5612C198.627 95.4432 198.853 95.2712 199.034 95.0569C199.05 95.0402 199.064 95.0222 199.076 95.0033C199.192 94.8612 199.285 94.7024 199.354 94.5322C199.451 94.2981 199.501 94.0468 199.5 93.7931V1.94714C199.499 1.43051 199.295 0.935241 198.932 0.57014C198.569 0.20504 198.077 -2.63458e-05 197.563 2.53875e-09Z",fill:"#F2F2F2"}),(0,s.createElement)("path",{d:"M199.222 7.80469H61.25V8.36132H199.222V7.80469Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M65.95 5.84371C66.8662 5.84371 67.609 5.09607 67.609 4.17381C67.609 3.25155 66.8662 2.50391 65.95 2.50391C65.0338 2.50391 64.291 3.25155 64.291 4.17381C64.291 5.09607 65.0338 5.84371 65.95 5.84371Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M70.72 5.84371C71.6363 5.84371 72.379 5.09607 72.379 4.17381C72.379 3.25155 71.6363 2.50391 70.72 2.50391C69.8038 2.50391 69.061 3.25155 69.061 4.17381C69.061 5.09607 69.8038 5.84371 70.72 5.84371Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M75.4896 5.84371C76.4058 5.84371 77.1486 5.09607 77.1486 4.17381C77.1486 3.25155 76.4058 2.50391 75.4896 2.50391C74.5733 2.50391 73.8306 3.25155 73.8306 4.17381C73.8306 5.09607 74.5733 5.84371 75.4896 5.84371Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M164.842 19.957H95.6295C94.8646 19.957 94.1311 20.2629 93.5903 20.8073C93.0494 21.3516 92.7456 22.09 92.7456 22.8599C92.7456 23.6298 93.0494 24.3681 93.5903 24.9125C94.1311 25.4569 94.8646 25.7627 95.6295 25.7627H164.842C165.607 25.7627 166.341 25.4569 166.882 24.9125C167.422 24.3681 167.726 23.6298 167.726 22.8599C167.726 22.09 167.422 21.3516 166.882 20.8073C166.341 20.2629 165.607 19.957 164.842 19.957ZM164.842 25.3161H95.6295C94.9823 25.3161 94.3616 25.0573 93.904 24.5967C93.4464 24.1361 93.1893 23.5113 93.1893 22.8599C93.1893 22.2084 93.4464 21.5837 93.904 21.123C94.3616 20.6624 94.9823 20.4036 95.6295 20.4036H164.842C165.489 20.4036 166.11 20.6624 166.568 21.123C167.025 21.5837 167.283 22.2084 167.283 22.8599C167.283 23.5113 167.025 24.1361 166.568 24.5967C166.11 25.0573 165.489 25.3161 164.842 25.3161Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M186.022 43.0859H116.809C116.044 43.0859 115.31 43.3918 114.769 43.9362C114.229 44.4806 113.925 45.2189 113.925 45.9888C113.925 46.7587 114.229 47.497 114.769 48.0414C115.31 48.5858 116.044 48.8916 116.809 48.8916H186.022C186.786 48.8916 187.52 48.5858 188.061 48.0414C188.602 47.497 188.905 46.7587 188.905 45.9888C188.905 45.2189 188.602 44.4806 188.061 43.9362C187.52 43.3918 186.786 43.0859 186.022 43.0859Z",fill:"white"}),(0,s.createElement)("path",{d:"M186.022 53.8047H116.809C116.044 53.8047 115.31 54.1105 114.769 54.6549C114.229 55.1993 113.925 55.9376 113.925 56.7075C113.925 57.4774 114.229 58.2158 114.769 58.7601C115.31 59.3045 116.044 59.6104 116.809 59.6104H186.022C186.786 59.6104 187.52 59.3045 188.061 58.7601C188.602 58.2158 188.905 57.4774 188.905 56.7075C188.905 55.9376 188.602 55.1993 188.061 54.6549C187.52 54.1105 186.786 53.8047 186.022 53.8047Z",fill:"white"}),(0,s.createElement)("path",{d:"M186.022 64.5195H116.809C116.044 64.5195 115.31 64.8254 114.769 65.3698C114.229 65.9141 113.925 66.6525 113.925 67.4224C113.925 68.1923 114.229 68.9306 114.769 69.475C115.31 70.0194 116.044 70.3252 116.809 70.3252H186.022C186.786 70.3252 187.52 70.0194 188.061 69.475C188.602 68.9306 188.905 68.1923 188.905 67.4224C188.905 66.6525 188.602 65.9141 188.061 65.3698C187.52 64.8254 186.786 64.5195 186.022 64.5195Z",fill:"white"}),(0,s.createElement)("path",{d:"M105.623 38.2852H74.1183C73.4425 38.286 72.7947 38.5565 72.3168 39.0375C71.839 39.5185 71.5702 40.1706 71.5693 40.8508V50.9416H72.013V40.8508C72.0139 40.2891 72.2359 39.7506 72.6306 39.3533C73.0252 38.9561 73.5602 38.7326 74.1183 38.7317H105.623C106.182 38.7322 106.717 38.9556 107.112 39.3529C107.506 39.7502 107.728 40.289 107.729 40.8508V72.5633C107.728 73.1251 107.506 73.6638 107.112 74.0611C106.717 74.4585 106.182 74.6819 105.623 74.6824H96.8897V75.1289H105.623C106.299 75.1285 106.947 74.858 107.425 74.377C107.903 73.8959 108.172 73.2436 108.172 72.5633V40.8508C108.172 40.1705 107.903 39.5182 107.425 39.0371C106.947 38.556 106.299 38.2856 105.623 38.2852Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M23.9309 70.9116C23.8195 70.9162 19.0705 70.5847 18.9492 70.5806L19.3758 66.294L22.0808 66.212L27.2495 56.5756C26.5327 55.1996 27.4148 53.3739 28.9355 53.0925C32 52.3914 33.0526 57.2443 29.9789 57.8901L25.7036 69.6652C25.5695 70.03 25.3278 70.3449 25.011 70.5676C24.6942 70.7904 24.3174 70.9104 23.9309 70.9116Z",fill:"#FFB8B8"}),(0,s.createElement)("path",{d:"M11.4107 73.118C6.89154 73.1291 6.49482 66.2544 11.024 65.7699C23.0006 65.0415 21.485 62.0137 22.3945 70.9448C22.4224 71.2097 22.3448 71.475 22.1787 71.6824C22.0126 71.8898 21.7715 72.0223 21.5084 72.051L11.803 73.0968C11.6727 73.1109 11.5417 73.1179 11.4107 73.118Z",className:"fill-theme-color"}),(0,s.createElement)("path",{d:"M10.3793 51.3852C16.605 54.9512 11.494 64.3601 5.15222 61.0097C-1.0733 57.4438 4.03771 48.0349 10.3793 51.3852Z",fill:"#FFB8B8"}),(0,s.createElement)("path",{d:"M16.0395 132.376L18.759 132.376L20.053 121.816L16.0391 121.817L16.0395 132.376Z",fill:"#FFB8B8"}),(0,s.createElement)("path",{d:"M15.4567 134.915L24.0042 134.915C23.9716 130.476 18.2546 131.755 15.4565 131.591L15.4567 134.915Z",fill:"#2F2E41"}),(0,s.createElement)("path",{d:"M4.28218 132.376L7.00167 132.376L8.29564 121.816L4.28174 121.817L4.28218 132.376Z",fill:"#FFB8B8"}),(0,s.createElement)("path",{d:"M3.69937 134.915L12.2469 134.915C12.2142 130.476 6.49728 131.755 3.69922 131.591L3.69937 134.915Z",fill:"#2F2E41"}),(0,s.createElement)("path",{d:"M7.37266 128.688C6.71536 128.507 3.14362 129.056 2.72209 128.335C1.24999 113.483 1.57722 98.9486 4.845 90.9619L16.0806 90.2695C18.5931 94.8863 24.3684 125.522 20.8847 127.385L16.4048 127.546C16.1493 127.554 15.8988 127.474 15.6952 127.318C15.4916 127.163 15.3475 126.941 15.2869 126.691L11.539 105.229C10.6057 103.916 8.77111 127.832 8.46815 127.742C8.42864 128.006 8.29626 128.247 8.09515 128.42C7.89404 128.594 7.63762 128.689 7.37266 128.688Z",fill:"#2F2E41"}),(0,s.createElement)("path",{d:"M4.48843 92.8373C-1.18427 86.8634 2.43414 70.8475 2.25101 71.1881C2.26655 70.7958 3.55141 64.7536 6.87506 63.762C9.51196 62.886 12.4305 65.5063 12.7906 68.1566L16.7406 91.6368C16.7611 91.7646 16.7514 91.8955 16.7123 92.0188C16.6733 92.1422 16.6059 92.2546 16.5158 92.3469C16.71 92.9556 4.76613 92.7153 4.48843 92.8373Z",className:"fill-theme-color"}),(0,s.createElement)("path",{d:"M6.32941 55.5845C6.82759 55.2675 7.07312 54.7238 7.36309 54.2285C8.89053 53.3522 10.6464 55.472 12.262 54.6809C16.8302 50.2665 12.1346 48.9642 7.92721 48.7314C6.9333 48.6081 6.08781 48.963 5.33637 49.5492C-3.06805 48.9031 0.962591 60.1519 6.26679 61.6376C7.2033 62.0505 7.90582 61.2148 7.07994 60.4551C5.93728 59.2493 4.52181 56.8221 6.32941 55.5845Z",fill:"#2F2E41"}),(0,s.createElement)("path",{d:"M93.5621 50.4922H32.779C31.7793 50.4936 30.8209 50.894 30.1139 51.6056C29.407 52.3172 29.0092 53.2819 29.0078 54.2882V131.548C29.0092 132.555 29.407 133.52 30.1139 134.231C30.8209 134.943 31.7793 135.343 32.779 135.345H93.5621C94.5619 135.343 95.5202 134.943 96.2272 134.231C96.9341 133.52 97.3319 132.555 97.3333 131.548V54.2882C97.3319 53.2819 96.9341 52.3172 96.2272 51.6056C95.5202 50.894 94.5619 50.4936 93.5621 50.4922ZM96.8896 131.548C96.8886 132.436 96.5376 133.288 95.9138 133.916C95.29 134.544 94.4443 134.897 93.5621 134.898H32.779C31.8968 134.897 31.0511 134.544 30.4273 133.916C29.8035 133.288 29.4526 132.436 29.4515 131.548V54.2882C29.4526 53.4002 29.8035 52.5489 30.4273 51.921C31.0511 51.2931 31.8968 50.9399 32.779 50.9388H93.5621C94.4443 50.9399 95.29 51.2931 95.9138 51.921C96.5376 52.5489 96.8886 53.4002 96.8896 54.2882V131.548Z",fill:"#3F3D56"}),(0,s.createElement)("path",{d:"M15.6527 83.0043C13.6494 83.2327 12.7698 78.5402 12.0039 77.3445L15.9936 75.7852L17.2918 78.1751L28.168 78.4472C28.2326 78.3591 28.3032 78.2755 28.3793 78.1971C30.5362 75.9238 34.0488 79.33 31.9 81.5984C31.663 81.8519 31.3752 82.0521 31.0557 82.1855C30.7362 82.319 30.3923 82.3828 30.0465 82.3727C29.7007 82.3627 29.361 82.2789 29.0497 82.1271C28.7384 81.9753 28.4626 81.7588 28.2405 81.4918C27.9719 81.5111 15.9153 83.0114 15.6527 83.0043Z",fill:"#FFB8B8"}),(0,s.createElement)("path",{d:"M12.6985 80.7664C12.0314 81.4133 6.91061 72.3318 6.5365 72.0751C3.94893 68.0267 10.0405 64.0298 12.6727 68.0562L17.9961 76.2911C18.1402 76.5145 18.1904 76.7864 18.1356 77.047C18.0808 77.3076 17.9255 77.5357 17.7039 77.6812C17.4613 77.7956 12.8697 81.0123 12.6985 80.7664Z",className:"fill-theme-color"}),(0,s.createElement)("path",{d:"M81.583 103.974H44.7583C40.9966 103.955 40.9809 98.1877 44.7584 98.168H81.583C85.3421 98.1857 85.3624 103.954 81.583 103.974Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M81.583 114.692H44.7583C40.9966 114.674 40.9809 108.906 44.7584 108.887H81.583C85.3421 108.904 85.3624 114.673 81.583 114.692Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M81.583 125.411H44.7583C40.9966 125.393 40.9809 119.625 44.7584 119.605H81.583C85.3421 119.623 85.3624 125.391 81.583 125.411Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M95.3371 57.6387C94.1963 57.6387 93.0812 57.2982 92.1327 56.6603C91.1842 56.0223 90.4449 55.1156 90.0084 54.0548C89.5718 52.9939 89.4576 51.8266 89.6802 50.7004C89.9027 49.5742 90.452 48.5397 91.2587 47.7278C92.0653 46.9159 93.093 46.3629 94.2118 46.1389C95.3307 45.9149 96.4904 46.0299 97.5443 46.4693C98.5982 46.9087 99.499 47.6528 100.133 48.6076C100.767 49.5623 101.105 50.6848 101.105 51.833C101.103 53.3723 100.495 54.8479 99.4136 55.9363C98.3323 57.0247 96.8662 57.637 95.3371 57.6387Z",className:"fill-theme-color"}),(0,s.createElement)("path",{d:"M97.999 51.6121H95.5588V48.821C95.5588 48.7617 95.5355 48.7049 95.4939 48.6631C95.4523 48.6212 95.3958 48.5977 95.337 48.5977C95.2782 48.5977 95.2217 48.6212 95.1801 48.6631C95.1385 48.7049 95.1152 48.7617 95.1152 48.821V51.6121H92.675C92.6161 51.6121 92.5597 51.6357 92.5181 51.6775C92.4765 51.7194 92.4531 51.7762 92.4531 51.8354C92.4531 51.8947 92.4765 51.9515 92.5181 51.9933C92.5597 52.0352 92.6161 52.0587 92.675 52.0587H95.1152V54.8499C95.1152 54.9091 95.1385 54.9659 95.1801 55.0078C95.2217 55.0497 95.2782 55.0732 95.337 55.0732C95.3958 55.0732 95.4523 55.0497 95.4939 55.0078C95.5355 54.9659 95.5588 54.9091 95.5588 54.8499V52.0587H97.999C98.0579 52.0587 98.1143 52.0352 98.1559 51.9933C98.1975 51.9515 98.2209 51.8947 98.2209 51.8354C98.2209 51.7762 98.1975 51.7194 98.1559 51.6775C98.1143 51.6357 98.0579 51.6121 97.999 51.6121Z",fill:"white"}),(0,s.createElement)("path",{d:"M80.9177 91.2002H45.424C44.4535 91.1991 43.5232 90.8105 42.837 90.1198C42.1508 89.4291 41.7648 88.4926 41.7637 87.5158V67.5086C41.7648 66.5318 42.1508 65.5953 42.837 64.9046C43.5232 64.2139 44.4535 63.8253 45.424 63.8242H80.9177C81.8882 63.8253 82.8185 64.2139 83.5047 64.9046C84.1909 65.5953 84.5769 66.5318 84.578 67.5086V87.5158C84.5769 88.4926 84.1909 89.4291 83.5047 90.1198C82.8185 90.8105 81.8882 91.1991 80.9177 91.2002Z",className:"fill-theme-color"})),(0,s.createElement)("defs",null,(0,s.createElement)("clipPath",{id:"clip0"},(0,s.createElement)("rect",{width:"199",height:"148",fill:"white",transform:"translate(0.5)"}))));var A=o(32490);const z=["obw/basics","obw/grow"],R=()=>(0,s.createElement)("div",{className:"woocommerce-admin__business-details__free-badge"},(0,r.__)("Free","woocommerce")),L=e=>{let{onChange:t,description:o,isChecked:r}=e;return(0,s.createElement)("div",{className:"woocommerce-admin__business-details__selective-extensions-bundle__extension"},(0,s.createElement)(h.CheckboxControl,{id:"woocommerce-business-extensions__checkbox",checked:r,onChange:t}),(0,s.createElement)("p",{className:"woocommerce-admin__business-details__selective-extensions-bundle__description",dangerouslySetInnerHTML:(0,A.ZP)(o),onClick:e=>{const t=e.target.closest("a");t&&e.currentTarget.contains(t)&&t.href.startsWith("https://woocommerce.com/products/")&&(0,d.recordEvent)("storeprofiler_store_business_features_link_click",{extension_name:t.href.split("https://woocommerce.com/products/")[1]})}}),(0,s.createElement)(R,null))},D=e=>{let{isResolving:t,title:o,extensions:r,installExtensionOptions:n,onCheckboxChange:i}=e;return t?(0,s.createElement)("div",null,(0,s.createElement)(h.Spinner,null)):0===r.length?null:(0,s.createElement)("div",null,(0,s.createElement)("div",{className:"woocommerce-admin__business-details__selective-extensions-bundle__category"},o),r.map((e=>{let{description:t,key:o}=e;return(0,s.createElement)(L,{key:o,description:t,isChecked:n[o],onChange:i(o)})})))},U=e=>{let{isInstallingActivating:t,onSubmit:o,setInstallExtensionOptions:n,installableExtensions:i,installExtensionOptions:a={install_extensions:!0}}=e;const[l,c]=(0,s.useState)(!1);(0,s.useEffect)((()=>{t||0===i.length||n(((e,t)=>e.reduce(((e,t)=>{const o=t.plugins.reduce(((t,o)=>e.hasOwnProperty(o.key)?t:{...t,[o.key]:!0}),{});return{...e,...o}}),t))(i,a))}),[i]);const p=e=>t=>{const o={...a,[e]:t},s=1===Object.entries(o).filter((e=>{let[,t]=e;return t})).length&&o.install_extensions;n(s?{...o,install_extensions:!1}:{...a,[e]:t,install_extensions:!0})};return(0,s.createElement)("div",{className:"woocommerce-profile-wizard__business-details__free-features"},(0,s.createElement)(h.Card,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__business-details__free-features__illustration"},(0,s.createElement)(B,null)),(0,s.createElement)("div",{className:"woocommerce-admin__business-details__selective-extensions-bundle"},(0,s.createElement)("div",{className:"woocommerce-admin__business-details__selective-extensions-bundle__extension"},(0,s.createElement)(h.CheckboxControl,{checked:a.install_extensions,onChange:e=>{var t,o;n((t=a,o=e,Object.entries(t).reduce(((e,t)=>{let[s]=t;return{...e,[s]:o}}),{})))}}),(0,s.createElement)("p",{className:"woocommerce-admin__business-details__selective-extensions-bundle__description"},(0,r.__)("Add recommended business features to my site","woocommerce")),(0,s.createElement)(h.Button,{className:"woocommerce-admin__business-details__selective-extensions-bundle__expand",disabled:!i||0===i.length,onClick:()=>{c(!l),l||(0,d.recordEvent)("storeprofiler_store_business_features_accordion_click")}},(0,s.createElement)(I.Z,{icon:l?V.Z:F.Z}))),l&&i.map((e=>{let{plugins:t,key:o,title:r}=e;return(0,s.createElement)(D,{key:o,title:r,extensions:t,installExtensionOptions:a,onCheckboxChange:p})}))),(0,s.createElement)("div",{className:"woocommerce-profile-wizard__business-details__free-features__action"},(0,s.createElement)(h.Button,{onClick:()=>{o(a,i)},isBusy:t,disabled:t,isPrimary:!0},(0,r.__)("Continue","woocommerce")))),((e,t)=>{const o=Object.keys(e).filter((t=>e[t]&&"install_extensions"!==t));if(0===o.length)return null;const n=o.reduce(((e,t)=>{const o=m.pluginNames[t];return e.includes(o)?e:[...e,o]}),[]).join(", ");if(t)return(0,s.createElement)("div",{className:"woocommerce-profile-wizard__footnote"},(0,s.createElement)(O.Text,{variant:"caption",as:"p",size:"12",lineHeight:"16px"},(0,r.sprintf)((0,r._n)("Installing the following plugin: %s","Installing the following plugins: %s",o.length,"woocommerce"),n)));const i=(0,r.__)("User accounts are required to use these features.","woocommerce"),a=o.filter((e=>"jetpack"===e||e.includes("woocommerce-services"))),l=a.includes("jetpack")&&(a.includes("woocommerce-services:shipping")||a.includes("woocommerce-services:tax"))?"Jetpack and WooCommerce Shipping & Tax":m.pluginNames[a[0]],c=(0,r.sprintf)((0,r._n)("By installing %s plugin for free you agree to our {{link}}Terms of Service{{/link}}.","By installing %s plugins for free you agree to our {{link}}Terms of Service{{/link}}.",a.length,"woocommerce"),l);return(0,s.createElement)("div",{className:"woocommerce-profile-wizard__footnote"},(0,s.createElement)(O.Text,{variant:"caption",as:"p",size:"12",lineHeight:"16px"},(0,r.sprintf)((0,r._n)("The following plugin will be installed for free: %1$s. %2$s","The following plugins will be installed for free: %1$s. %2$s",o.length,"woocommerce"),n,i)),a.length>0&&(0,s.createElement)(O.Text,{variant:"caption",as:"p",size:"12",lineHeight:"16px"},(0,M.Z)({mixedString:c,components:{link:(0,s.createElement)(_.Link,{href:"https://wordpress.com/tos/",target:"_blank",type:"external"})}})))})(a,t))};var Z=o(15635);const j="business-details",H="business-features",q=e=>["other","brick-mortar","brick-mortar-other","other-woocommerce"].includes(e),G=e=>["other","brick-mortar-other"].includes(e),W="wc-admin-free-features-tab-values";class $ extends s.Component{constructor(e){super(),this.state={isPopoverVisible:!1,isValid:!1,currentTab:"business-details",savedValues:e.initialValues},this.onContinue=this.onContinue.bind(this),this.validate=this.validate.bind(this),this.persistValues=this.persistValues.bind(this),this.persistProfileItems.bind(this),e.trackStepValueChanges(e.step.key,e.initialValues,this.state.savedValues,this.persistValues),e.invalidateResolutionForStoreSelector("getFreeExtensions")}async onContinue(e,t){const{createNotice:o,goToNextStep:s,installAndActivatePlugins:n}=this.props,i=t.reduce(((e,t)=>[...e,...t.plugins.filter((e=>e.is_activated)).map((e=>e.key))]),[]),a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object.keys(e).filter((o=>e[o]&&"install_extensions"!==o&&!t.includes(o))).map(Z.V7).filter(((e,t,o)=>o.indexOf(e)===t))}(e,i),l=(e=>{const t={};for(let[o,s]of Object.entries(e)){o=(0,Z.V7)(o);const e=(0,Z.br)(o);"install_extensions"===o||t[`install_${e}`]||(t[`install_${e}`]=s)}return t})(e);(0,d.recordEvent)("storeprofiler_store_business_features_continue",{all_extensions_installed:Object.values(e).every((e=>e)),...l});const c=[this.persistProfileItems({business_extensions:[...a,...i]})];if(a.length){const t=window.performance.now();c.push(n(a).then((o=>{const s=window.performance.now()-t,r=((e,t)=>{const o=[],s={};for(let[r]of Object.entries(e)){r=(0,Z.V7)(r);const e=(0,Z.br)(r);t&&t.data&&t.data.install_time&&t.data.install_time[r]&&(o.push(e),s[`install_time_${e}`]=(0,Z.Jm)(t.data.install_time[r]))}return s.installed_extensions=o,s.activated_extensions=t&&t.data&&t.data.activated?t.data.activated:[],s})(e,o);(0,d.recordEvent)("storeprofiler_store_business_features_installed_and_activated",{success:!0,total_time:(0,Z.Jm)(s),...r}),(0,f.a)(o)})).catch((e=>{throw(0,d.recordEvent)("storeprofiler_store_business_features_installed_and_activated",{success:!1,failed_extensions:Object.keys(e.data||{}).map((e=>(0,Z.br)(e)))}),(0,f.a)(e),new Error})))}Promise.all(c).then((()=>{s({step:H})})).catch((()=>{o("error",(0,r.__)("There was a problem updating your business details","woocommerce"))}))}async persistValues(){await this.persistProfileItems();try{window.localStorage.setItem(W,JSON.stringify(this.state.savedValues.freeFeaturesTab))}catch(e){this.props.createNotice("error",(0,r.__)("There was a problem saving free features state","woocommerce"))}}async persistProfileItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{updateProfileItems:t,createNotice:o}=this.props,{businessDetailsTab:s={}}=this.state.savedValues,{number_employees:n,other_platform:i,other_platform_name:a,product_count:l,revenue:c,selling_venues:m,setup_client:d}=s,p={number_employees:n,other_platform:i,other_platform_name:"other"===i?a:"",product_count:l,revenue:c,selling_venues:m,setup_client:d,...e};return t(Object.entries(p).reduce(((e,t)=>{let[o,s]=t;return""!==s&&(e[o]=s),e}),{})).catch((()=>{o("error",(0,r.__)("There was a problem updating your business details","woocommerce"))}))}validate(e){const t={};return e.product_count.length||(t.product_count=(0,r.__)("This field is required","woocommerce")),e.selling_venues.length||(t.selling_venues=(0,r.__)("This field is required","woocommerce")),!e.other_platform.length&&G(e.selling_venues)&&(t.other_platform=(0,r.__)("This field is required","woocommerce")),!e.other_platform_name.trim().length&&"other"===e.other_platform&&G(e.selling_venues)&&(t.other_platform_name=(0,r.__)("This field is required","woocommerce")),!e.number_employees.length&&q(e.selling_venues)&&(t.number_employees=(0,r.__)("This field is required","woocommerce")),!e.revenue.length&&q(e.selling_venues)&&(t.revenue=(0,r.__)("This field is required","woocommerce")),0===Object.keys(t).length&&this.setState({isValid:!0}),t}trackBusinessDetailsStep(e){let{number_employees:t,other_platform:o,other_platform_name:s,product_count:r,selling_venues:n,revenue:i,setup_client:a}=e;const{getCurrencyConfig:l}=this.context;(0,d.recordEvent)("storeprofiler_store_business_details_continue_variant",{number_employees:t,already_selling:n,currency:l().code,product_number:r,revenue:i,used_platform:o,used_platform_name:s,setup_client:a,wp_version:(0,p.getSetting)("wpVersion")}),(0,d.recordEvent)("storeprofiler_step_complete",{step:j,wc_version:(0,p.getSetting)("wcVersion")})}getSelectControlProps(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const{className:o,...s}=e(t);return{...s,className:w()(`woocommerce-profile-wizard__${t.replace(/\_/g,"-")}`,o)}}renderBusinessDetailsStep(){const{goToNextStep:e,isInstallingActivating:t,hasInstallActivateError:o}=this.props,{formatAmount:n,getCurrencyConfig:i}=this.context,a=(l=i(),[{key:"0",label:(0,r.__)("I don't have any products yet.","woocommerce")},{key:"1-10",label:N(l,1,10)},{key:"11-100",label:N(l,11,100)},{key:"101-1000",label:N(l,101,1e3)},{key:"1000+",label:N(l,1e3)}]);var l;return(0,s.createElement)(_.Form,{initialValues:this.state.savedValues.businessDetailsTab,onSubmit:t=>{this.props.hasInstallableExtensions?this.setState({savedValues:{...this.state.savedValues,businessDetailsTab:t},currentTab:H}):e({step:H}),this.trackBusinessDetailsStep(t),(0,d.recordEvent)("storeprofiler_step_view",{step:H,wc_version:(0,p.getSetting)("wcVersion")})},onChange:(e,t,o)=>{const s={...this.state.savedValues,businessDetailsTab:t};this.setState({savedValues:s,isValid:o}),this.props.updateCurrentStepValues(this.props.step.key,s)},validate:this.validate},(l=>{let{getInputProps:c,handleSubmit:m,values:d,isValidForm:p}=l;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},(0,s.createElement)(h.__experimentalText,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},(0,r.__)("Tell us about your business","woocommerce")),(0,s.createElement)(h.__experimentalText,{variant:"body",as:"p"},(0,r.__)("We'd love to know if you are just getting started or you already have a business in place.","woocommerce"))),(0,s.createElement)(h.Card,null,(0,s.createElement)(h.CardBody,null,(0,s.createElement)(_.SelectControl,(0,u.Z)({excludeSelectedOptions:!1,label:(0,r.__)("How many products do you plan to display?","woocommerce"),options:a,required:!0},this.getSelectControlProps(c,"product_count"))),(0,s.createElement)(_.SelectControl,(0,u.Z)({excludeSelectedOptions:!1,label:(0,r.__)("Currently selling elsewhere?","woocommerce"),options:E,required:!0},this.getSelectControlProps(c,"selling_venues"))),q(d.selling_venues)&&(0,s.createElement)(_.SelectControl,(0,u.Z)({excludeSelectedOptions:!1,label:(0,r.__)("How many employees do you have?","woocommerce"),options:v,required:!0},this.getSelectControlProps(c,"number_employees"))),q(d.selling_venues)&&(0,s.createElement)(_.SelectControl,(0,u.Z)({excludeSelectedOptions:!1,label:(0,r.__)("What's your current annual revenue?","woocommerce"),options:P(i(),this.props.settings.woocommerce_default_country,n),required:!0},this.getSelectControlProps(c,"revenue"))),G(d.selling_venues)&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"business-competitors"},(0,s.createElement)(_.SelectControl,(0,u.Z)({excludeSelectedOptions:!1,label:(0,r.__)("Which platform is the store using?","woocommerce"),options:y,required:!0},this.getSelectControlProps(c,"other_platform"))),"other"===d.other_platform&&(0,s.createElement)(_.TextControl,(0,u.Z)({label:(0,r.__)("What is the platform name?","woocommerce"),required:!0},this.getSelectControlProps(c,"other_platform_name")))))),(0,s.createElement)(h.CardFooter,{isBorderless:!0},(0,s.createElement)(h.FlexItem,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__client"},(0,s.createElement)(h.CheckboxControl,(0,u.Z)({label:(0,r.__)("I'm setting up a store for a client","woocommerce")},c("setup_client")))))),(0,s.createElement)(h.CardFooter,{justify:"center"},(0,s.createElement)(h.Button,{isPrimary:!0,onClick:async()=>{await m(),this.persistProfileItems()},disabled:!p,"aria-disabled":!p,isBusy:t},o?(0,r.__)("Retry","woocommerce"):(0,r.__)("Continue","woocommerce")),o&&(0,s.createElement)(h.Button,{onClick:()=>{this.persistProfileItems(),e({step:H})}},(0,r.__)("Continue without installing","woocommerce")))))}))}renderFreeFeaturesStep(){const{isInstallingActivating:e}=this.props,{savedValues:{freeFeaturesTab:t}}=this.state;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},(0,s.createElement)(h.__experimentalText,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},(0,r.__)("Included business features","woocommerce")),(0,s.createElement)(h.__experimentalText,{variant:"body",as:"p"},(0,r.__)("We recommend enhancing your store with these free extensions","woocommerce")),(0,s.createElement)(h.__experimentalText,{variant:"body",as:"p"},(0,r.__)("No commitment required - you can remove them at any time.","woocommerce"))),(0,s.createElement)(U,{isInstallingActivating:e,onSubmit:this.onContinue,installableExtensions:this.props.installableExtensions,installExtensionOptions:t.installExtensionOptions,setInstallExtensionOptions:e=>{const o={...this.state.savedValues,freeFeaturesTab:{...t,installExtensionOptions:e}};this.setState({savedValues:o}),this.state.savedValues.freeFeaturesTab.installExtensionOptions&&this.props.updateCurrentStepValues(this.props.step.key,o)}}))}render(){const e=[];return this.props.hasFinishedGetFreeExtensionsResolution?(e.push({name:this.state.currentTab===j?"current-tab":j,id:j,title:(0,r.__)("Business details","woocommerce")}),this.props.hasInstallableExtensions&&e.push({name:this.state.currentTab===H?"current-tab":H,id:H,title:(0,r.__)("Free features","woocommerce"),className:this.state.isValid?"":"is-disabled"}),(0,s.createElement)(h.TabPanel,{activeClass:"is-active",initialTabName:"current-tab",onSelect:e=>{this.state.currentTab!==e&&(this.setState({currentTab:e,savedValues:this.state.savedValues||this.props.initialValues}),(0,d.recordEvent)("storeprofiler_step_view",{step:e,wc_version:(0,p.getSetting)("wcVersion")}))},tabs:e},(e=>(0,s.createElement)(s.Fragment,null,this.getTab(e.id))))):(0,s.createElement)("div",{className:"woocommerce-admin__business-details__spinner"},(0,s.createElement)(h.Spinner,null))}getTab(e){return e===j?this.renderBusinessDetailsStep():this.renderFreeFeaturesStep()}}$.contextType=C.$;const J=(0,i.compose)((0,l.withSelect)((e=>{const{getSettings:t,getSettingsError:o}=e(m.SETTINGS_STORE_NAME),{getProfileItems:s,getOnboardingError:r,getFreeExtensions:n,hasFinishedResolution:i}=e(m.ONBOARDING_STORE_NAME),{getPluginsError:a,isPluginsRequesting:l}=e(m.PLUGINS_STORE_NAME),{general:c={}}=t("general"),d=n(),p=s(),u=c.woocommerce_default_country?c.woocommerce_default_country:null,h=d?(e=>{let{freeExtensionBundleByCategory:t,country:o,productTypes:s}=e;return t.filter((e=>(window.wcAdminFeatures&&window.wcAdminFeatures.subscriptions&&"US"===(0,b.so)(o)&&s.includes("subscriptions")&&(e.plugins=e.plugins.filter((e=>"woocommerce-payments"!==e.key||"woocommerce-payments"===e.key&&!e.is_activated))),z.includes(e.key))))})({freeExtensionBundleByCategory:d,country:u,productTypes:p.product_types}):[],_=h.some((e=>{let{plugins:t}=e;return t.length>0}));return{hasInstallActivateError:a("installPlugins")||a("activatePlugins"),hasInstallableExtensions:_,hasFinishedGetFreeExtensionsResolution:i("getFreeExtensions"),installableExtensions:h,isError:Boolean(r("updateProfileItems")),isSettingsError:Boolean(o("general")),isInstallingActivating:l("installPlugins")||l("activatePlugins")||l("getJetpackConnectUrl"),profileItems:p,settings:c}})),(0,l.withDispatch)((e=>{const{updateProfileItems:t,invalidateResolutionForStoreSelector:o}=e(m.ONBOARDING_STORE_NAME),{installAndActivatePlugins:s}=e(m.PLUGINS_STORE_NAME),{createNotice:r}=e("core/notices");return{createNotice:r,installAndActivatePlugins:s,updateProfileItems:t,invalidateResolutionForStoreSelector:o}})))($),Y=e=>{const{profileItems:t,isLoading:o}=(0,l.useSelect)((e=>({isLoading:!e(m.ONBOARDING_STORE_NAME).hasFinishedResolution("getProfileItems")||!e(m.SETTINGS_STORE_NAME).hasFinishedResolution("getSettings",["general"]),profileItems:e(m.ONBOARDING_STORE_NAME).getProfileItems()}))),r=(0,s.useMemo)((()=>{try{const e=JSON.parse(window.localStorage.getItem(W));if(e)return e}catch(e){}return{install_extensions:!0}}),[]);if(o)return(0,s.createElement)("div",{className:"woocommerce-admin__business-details__spinner"},(0,s.createElement)(h.Spinner,null));const n={businessDetailsTab:{number_employees:t.number_employees||"",other_platform:t.other_platform||"",other_platform_name:t.other_platform_name||"",product_count:t.product_count||"",selling_venues:t.selling_venues||"",revenue:t.revenue||"",setup_client:t.setup_client||!1},freeFeaturesTab:r};return(0,s.createElement)(J,(0,u.Z)({},e,{initialValues:n}))};var K=o(79205);const Q=(0,K.O3)("onboarding",{});class X extends s.Component{constructor(e){let t=(0,a.get)(e,"profileItems",{}).industry||[];const{locationSettings:o}=e;if("US"!==(0,b.w)(o.woocommerce_default_country)){const e="cbd-other-hemp-derived-products";t=t.filter((t=>e!==t&&e!==t.slug))}super(),this.state={error:null,selected:t,textInputListContent:{}},this.onContinue=this.onContinue.bind(this),this.onIndustryChange=this.onIndustryChange.bind(this),this.onDetailChange=this.onDetailChange.bind(this);const s=this.getSelectedSlugs();e.trackStepValueChanges(e.step.key,s,s,this.onContinue)}getSelectedSlugs(){return this.state.selected.map((e=>e.slug))}componentDidUpdate(){this.props.updateCurrentStepValues(this.props.step.key,this.getSelectedSlugs())}async onContinue(){if(await this.validateField(),this.state.error)return;const{createNotice:e,isError:t,updateProfileItems:o}=this.props,s=this.state.selected.map((e=>e.slug)),n=this.state.selected.map((e=>e.detail)).filter((e=>e)).join(",");return(0,d.recordEvent)("storeprofiler_store_industry_continue",{store_industry:s,industries_with_detail:n}),await o({industry:this.state.selected}),!t||(e("error",(0,r.__)("There was a problem updating your industries","woocommerce")),Promise.reject())}async validateField(){const e=this.state.selected.length?null:(0,r.__)("Please select at least one industry","woocommerce");this.setState({error:e})}onIndustryChange(e){this.setState((t=>{const o=t.selected,s=(0,a.find)(o,{slug:e});if(s){const o=t.textInputListContent;return o[e]=s.detail,{selected:(0,a.filter)(t.selected,(t=>t.slug!==e))||[],textInputListContent:o}}return o.push({slug:e,detail:t.textInputListContent[e]}),{selected:o}}),(()=>this.validateField()))}onDetailChange(e,t){this.setState((o=>{const s=o.selected,r=o.textInputListContent;return s[(0,a.findIndex)(s,{slug:t})].detail=e,r[t]=e,{selected:s,textInputListContent:r}}))}renderIndustryLabel(e,t,o){const{textInputListContent:r}=this.state;return(0,s.createElement)(s.Fragment,null,t.label,t.use_description&&o&&(0,s.createElement)(_.TextControl,{key:`text-control-${e}`,label:t.description_label,value:o.detail||r[e]||"",onChange:t=>this.onDetailChange(t,e),className:"woocommerce-profile-wizard__text"}))}render(){const{industries:e}=Q,{error:t,selected:o}=this.state,{locationSettings:n,isProfileItemsRequesting:i}=this.props,l=(0,b.w)(n.woocommerce_default_country),c=Object.keys(e),m="US"===l?c:c.filter((e=>"cbd-other-hemp-derived-products"!==e));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},(0,s.createElement)(O.Text,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},(0,r.__)("In which industry does the store operate?","woocommerce")),(0,s.createElement)(O.Text,{variant:"body",as:"p"},(0,r.__)("Choose any that apply","woocommerce"))),(0,s.createElement)(h.Card,null,(0,s.createElement)(h.CardBody,{size:null},(0,s.createElement)("div",{className:"woocommerce-profile-wizard__checkbox-group"},m.map((t=>{const r=(0,a.find)(o,{slug:t});return(0,s.createElement)(h.CheckboxControl,{key:`checkbox-control-${t}`,label:this.renderIndustryLabel(t,e[t],r),onChange:()=>this.onIndustryChange(t),checked:r||!1,className:"woocommerce-profile-wizard__checkbox"})})),t&&(0,s.createElement)("span",{className:"woocommerce-profile-wizard__error"},t))),(0,s.createElement)(h.CardFooter,{isBorderless:!0,justify:"center"},(0,s.createElement)(h.Button,{isPrimary:!0,onClick:()=>{this.onContinue().then(this.props.goToNextStep)},isBusy:i,disabled:!o.length||i,"aria-disabled":!o.length||i},(0,r.__)("Continue","woocommerce")))))}}const ee=(0,i.compose)((0,l.withSelect)((e=>{const{getProfileItems:t,getOnboardingError:o,isOnboardingRequesting:s,hasFinishedResolution:r}=e(m.ONBOARDING_STORE_NAME),{getSettings:n,hasFinishedResolution:i}=e(m.SETTINGS_STORE_NAME),{general:a={}}=n("general");return{isError:Boolean(o("updateProfileItems")),profileItems:t(),locationSettings:a,isProfileItemsRequesting:s("updateProfileItems"),isLoading:!r("getProfileItems",[])||!i("getSettings",["general"])}})),(0,l.withDispatch)((e=>{const{updateProfileItems:t}=e(m.ONBOARDING_STORE_NAME),{createNotice:o}=e("core/notices");return{createNotice:o,updateProfileItems:t}})))((e=>e.isLoading?(0,s.createElement)("div",{className:"woocommerce-admin__industry__spinner",style:{textAlign:"center"}},(0,s.createElement)(h.Spinner,null)):(0,s.createElement)(X,e)));var te=o(70444);const oe=(0,s.createElement)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(te.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));function se(e){let{annualPrice:t,description:o,isMonthlyPricing:n,label:i,moreUrl:a,slug:l}=e;const[c,m]=(0,s.useState)("");if(!t)return i;const p=(0,r.__)("This product type requires a paid extension.\nWe'll add this to a cart so that\nyou can purchase and install it later.","woocommerce");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("span",{className:"woocommerce-product-wizard__product-types-label"},i),(0,s.createElement)(h.Button,{isTertiary:!0,label:(0,r.__)("Learn more about recommended free business features","woocommerce"),onClick:()=>{m(!0)}},(0,s.createElement)(I.Z,{icon:oe})),c&&(0,s.createElement)(h.Popover,{focusOnMount:"container",position:"top center",onClose:()=>m(!1)},(0,M.Z)({mixedString:o+(a?" {{moreLink/}}":""),components:{moreLink:a?(0,s.createElement)(_.Link,{href:a,target:"_blank",type:"external",onClick:()=>(0,d.recordEvent)("storeprofiler_store_product_type_learn_more",{product_type:l})},(0,r.__)("Learn more","woocommerce")):""}})),(0,s.createElement)(h.Tooltip,{text:p,position:"bottom center"},(0,s.createElement)(_.Pill,null,(0,s.createElement)("span",{className:"screen-reader-text"},p),n?(0,r.sprintf)((0,r.__)("$%f per month","woocommerce"),(t/12).toFixed(2)):(0,r.sprintf)((0,r.__)("$%f per year","woocommerce"),t))))}class re extends s.Component{constructor(){super(),this.state={error:null,isMonthlyPricing:!0,selected:[],isWCPayInstalled:null},this.onContinue=this.onContinue.bind(this),this.onChange=this.onChange.bind(this)}componentDidMount(){const{installedPlugins:e,invalidateResolution:t}=this.props,{isWCPayInstalled:o}=this.state;t("getProductTypes",[]),null===o&&e&&this.setState({isWCPayInstalled:e.includes("woocommerce-payments")})}componentDidUpdate(e,t){const{profileItems:o,productTypes:s}=this.props;if(this.state.selected!==t.selected&&this.props.updateCurrentStepValues(this.props.step.key,this.state.selected),e.productTypes!==s){const e=Object.keys(s).filter((e=>!!s[e].default));this.setState({selected:o.product_types||e},(()=>{this.props.trackStepValueChanges(this.props.step.key,[...this.state.selected],this.state.selected,this.onContinue)}))}}validateField(){const e=this.state.selected.length?null:(0,r.__)("Please select at least one product type","woocommerce");return this.setState({error:e}),!e}onContinue(e){const{selected:t}=this.state,{installedPlugins:o=[]}=this.props;if(!this.validateField())return;const{countryCode:s,createNotice:n,installAndActivatePlugins:i,updateProfileItems:a,productTypes:l}=this.props,c={product_type:t,wcpay_installed:!1},m=[a({product_types:t})];window.wcAdminFeatures&&window.wcAdminFeatures.subscriptions&&"US"===s&&l.subscriptions&&!l.subscriptions.yearly_price&&!o.includes("woocommerce-payments")&&t.includes("subscriptions")&&m.push(i(["woocommerce-payments"]).then((e=>{c.wcpay_installed=!0,e.data&&e.data.install_time&&e.data.install_time["woocommerce-payments"]&&(c.install_time_wcpay=e.data.install_time["woocommerce-payments"]),(0,f.a)(e)})).catch((e=>{throw(0,f.a)(e),new Error}))),Promise.all(m).then((()=>{(0,d.recordEvent)("storeprofiler_store_product_type_continue",c),"function"==typeof e&&e()})).catch((()=>n("error",(0,r.__)("There was a problem updating your product types","woocommerce"))))}onChange(e){this.setState((t=>{if((0,a.includes)(t.selected,e))return{selected:(0,a.filter)(t.selected,(t=>t!==e))||[]};const o=t.selected;return o.push(e),{selected:o}}),(()=>this.validateField()))}render(){const{productTypes:e=[]}=this.props,{error:t,isMonthlyPricing:o,isWCPayInstalled:n,selected:i}=this.state,{countryCode:a,isInstallingActivating:l,isProductTypesRequesting:c,isProfileItemsRequesting:m}=this.props;return c?(0,s.createElement)("div",{className:"woocommerce-profile-wizard__product-types__spinner"},(0,s.createElement)(h.Spinner,null)):(0,s.createElement)("div",{className:"woocommerce-profile-wizard__product-types"},(0,s.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},(0,s.createElement)(O.Text,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},(0,r.__)("What type of products will be listed?","woocommerce")),(0,s.createElement)(O.Text,{variant:"body",as:"p"},(0,r.__)("Choose any that apply","woocommerce"))),(0,s.createElement)(h.Card,null,(0,s.createElement)(h.CardBody,{size:null},Object.keys(e).map((t=>(0,s.createElement)(h.CheckboxControl,{key:t,label:(0,s.createElement)(se,{description:e[t].description,label:e[t].label,annualPrice:e[t].yearly_price,isMonthlyPricing:o,moreUrl:e[t].more_url,slug:t}),onChange:()=>this.onChange(t),checked:i.includes(t),className:"woocommerce-profile-wizard__checkbox"}))),t&&(0,s.createElement)("span",{className:"woocommerce-profile-wizard__error"},t)),(0,s.createElement)(h.CardFooter,{isBorderless:!0,justify:"center"},(0,s.createElement)(h.Button,{isPrimary:!0,onClick:()=>{this.onContinue(this.props.goToNextStep)},isBusy:m||l,disabled:!i.length||m||l,"aria-disabled":!i.length||m||l},(0,r.__)("Continue","woocommerce")))),(0,s.createElement)("div",{className:"woocommerce-profile-wizard__card-help-footnote"},(0,s.createElement)("div",{className:"woocommerce-profile-wizard__product-types-pricing-toggle woocommerce-profile-wizard__checkbox"},(0,s.createElement)("label",{htmlFor:"woocommerce-product-types__pricing-toggle"},(0,s.createElement)(O.Text,{variant:"body",as:"p"},(0,r.__)("Display monthly prices","woocommerce")),(0,s.createElement)(h.FormToggle,{id:"woocommerce-product-types__pricing-toggle",checked:o,onChange:()=>this.setState({isMonthlyPricing:!o})}))),(0,s.createElement)(O.Text,{variant:"caption",size:"12",lineHeight:"16px"},(0,r.__)("Billing is annual. All purchases are covered by our 30 day money back guarantee and include access to support and updates. Extensions will be added to a cart for you to purchase later.","woocommerce")),window.wcAdminFeatures&&window.wcAdminFeatures.subscriptions&&"US"===a&&!n&&e.subscriptions&&!e.subscriptions.yearly_price&&i.includes("subscriptions")&&(0,s.createElement)(O.Text,{variant:"body",size:"12",lineHeight:"16px",as:"p"},(0,r.__)("The following extensions will be added to your site for free: WooCommerce Payments. An account is required to use this feature.","woocommerce"))))}}const ne=(0,i.compose)((0,l.withSelect)((e=>{const{getProfileItems:t,getProductTypes:o,getOnboardingError:s,hasFinishedResolution:r,isOnboardingRequesting:n}=e(m.ONBOARDING_STORE_NAME),{getSettings:i}=e(m.SETTINGS_STORE_NAME),{getInstalledPlugins:a,isPluginsRequesting:l}=e(m.PLUGINS_STORE_NAME),{general:c={}}=i("general");return{isError:Boolean(s("updateProfileItems")),profileItems:t(),isProfileItemsRequesting:n("updateProfileItems"),installedPlugins:a(),isInstallingActivating:l("installPlugins")||l("activatePlugins"),countryCode:(0,b.so)(c.woocommerce_default_country),productTypes:o(),isProductTypesRequesting:!r("getProductTypes")}})),(0,l.withDispatch)((e=>{const{updateProfileItems:t}=e(m.ONBOARDING_STORE_NAME),{createNotice:o}=e("core/notices"),{installAndActivatePlugins:s}=e(m.PLUGINS_STORE_NAME),{invalidateResolution:r}=e(m.ONBOARDING_STORE_NAME);return{createNotice:o,installAndActivatePlugins:s,invalidateResolution:r,updateProfileItems:t}})))(re),ie=e=>{let{onClose:t,onSave:o}=e;const n=(0,r.__)("Save changes?","woocommerce"),i=(0,r.__)("You're about to go to a different step. Do you want to save the changes you've made here so far?","woocommerce"),a=(0,r.__)("Discard","woocommerce"),l=(0,r.__)("Save","woocommerce");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(h.Modal,{title:n,className:"woocommerce-obw-unsaved-changes",onRequestClose:t},(0,s.createElement)("div",{className:"woocommerce-obw-unsaved-changes-modal__wrapper"},(0,s.createElement)("div",{className:"woocommerce-usage-modal__message"},i),(0,s.createElement)("div",{className:"woocommerce-usage-modal__actions"},(0,s.createElement)(h.Button,{onClick:()=>t()},a),(0,s.createElement)(h.Button,{isPrimary:!0,onClick:o},l)))))};class ae extends s.Component{constructor(e){super(e),this.state={showUnsavedChangesModal:!1},this.lastClickedStepKey=null,this.onStepClick=this.onStepClick.bind(this)}shouldWarnForUnsavedChanges(e){if(void 0!==this.props.stepValueChanges[e]){const t=this.props.stepValueChanges[e].initialValues,o=this.props.stepValueChanges[e].currentValues;return Array.isArray(t)&&Array.isArray(o)&&(t.sort(),o.sort()),!(0,a.isEqual)(t,o)}return!1}findCurrentStep(){return this.props.steps.find((e=>e.key===this.props.currentStep))}moveToLastClickedStep(){this.lastClickedStepKey&&((0,c.updateQueryString)({step:this.lastClickedStepKey}),this.lastClickedStepKey=null)}saveCurrentStepChanges(){const e=this.findCurrentStep();if(!e)return null;const t=this.props.stepValueChanges[e.key];"function"==typeof t.onSave&&t.onSave()}renderStepper(){const{currentStep:e,steps:t}=this.props,o=(0,a.filter)(t,(e=>!!e.label)),r=o.findIndex((t=>t.key===e));return o.forEach(((e,t)=>{const s=o[t-1];e.isComplete=e.isComplete||t<r,(!s||s.isComplete||e.isComplete)&&(e.onClick=this.onStepClick)})),(0,s.createElement)(_.Stepper,{steps:o,currentStep:e})}onStepClick(e){const{currentStep:t}=this.props;this.shouldWarnForUnsavedChanges(t)?(this.setState({showUnsavedChangesModal:!0}),this.lastClickedStepKey=e):(0,c.updateQueryString)({step:e})}render(){const e=this.findCurrentStep();return e&&e.label?(0,s.createElement)("div",{className:"woocommerce-profile-wizard__header"},this.state.showUnsavedChangesModal&&(0,s.createElement)(ie,{onClose:()=>{this.setState({showUnsavedChangesModal:!1}),this.moveToLastClickedStep()},onSave:()=>{this.saveCurrentStepChanges(),this.setState({showUnsavedChangesModal:!1}),this.moveToLastClickedStep()}}),this.renderStepper()):null}}var le=o(96483),ce=o(68987),me=o(45350);const de=h.FlexItem||(e=>{let{children:t,align:o}=e;const r={display:"flex","justify-content":o?"center":"flex-start"};return(0,s.createElement)("div",{style:r},t)}),pe=()=>(0,s.createElement)("div",{className:"woocommerce-admin__store-details__spinner"},(0,s.createElement)(h.Spinner,null));class ue extends s.Component{constructor(e){super(e),this.state={showUsageModal:!1,skipping:!1,isSkipSetupPopoverVisible:!1},this.onContinue=this.onContinue.bind(this),this.onSubmit=this.onSubmit.bind(this),this.validateStoreDetails=this.validateStoreDetails.bind(this),this.onFormValueChange=this.onFormValueChange.bind(this),this.changedFormValues={}}componentDidUpdate(){!1===this.props.isLoading&&0===Object.keys(this.changedFormValues).length&&(this.changedFormValues={...this.props.initialValues},this.props.trackStepValueChanges(this.props.step.key,this.props.initialValues,this.changedFormValues,(()=>{this.onContinue(this.changedFormValues)})))}deriveCurrencySettings(e){if(!e)return null;const t=this.context,o=(0,b.so)(e),{currencySymbols:s={},localeInfo:r={}}=(0,K.O3)("onboarding",{});return t.getDataForCountry(o,r,s)}onSubmit(){this.setState({showUsageModal:!0,skipping:!1})}onFormValueChange(e){this.changedFormValues[e.name]=e.value}async onContinue(e){const{createNotice:t,updateProfileItems:o,updateAndPersistSettingsForGroup:s,profileItems:n,settings:i,errorsRef:a}=this.props,l=this.deriveCurrencySettings(e.countryState);this.context.setCurrency(l),(0,d.recordEvent)("storeprofiler_store_details_continue",{store_country:(0,b.so)(e.countryState),derived_currency:l.code,email_signup:e.isAgreeMarketing}),await s("general",{general:{...i,woocommerce_store_address:e.addressLine1,woocommerce_store_address_2:e.addressLine2,woocommerce_default_country:e.countryState,woocommerce_store_city:e.city,woocommerce_store_postcode:e.postCode,woocommerce_currency:l.code,woocommerce_currency_pos:l.symbolPosition,woocommerce_price_thousand_sep:l.thousandSeparator,woocommerce_price_decimal_sep:l.decimalSeparator,woocommerce_price_num_decimals:l.precision}});const c={is_agree_marketing:e.isAgreeMarketing,store_email:e.storeEmail,is_store_country_set:"string"==typeof e.countryState&&""!==e.countryState};if("US"!==(0,b.w)(e.countryState)&&n.industry&&n.industry.length){const e="cbd-other-hemp-derived-products",t=n.industry.filter((t=>e!==t&&e!==t.slug));c.industry=t}let m=[];try{await o(c)}catch(e){var p;null!=e&&null!==(p=e.data)&&void 0!==p&&p.params&&(m=Object.values(e.data.params))}if(!Boolean(a.current.settings)&&!m.length)return!0;t("error",(0,r.__)("There was a problem saving your store details","woocommerce")),m.forEach((e=>t("error",e)))}validateStoreDetails(e){const{getLocale:t}=this.props,o=t(e.countryState),s=(0,ce.Yt)(o)(e);return e.storeEmail&&!(0,le.isEmail)(e.storeEmail)&&(s.storeEmail=(0,r.__)("Invalid email address","woocommerce")),!e.isAgreeMarketing||e.storeEmail&&e.storeEmail.trim().length||(s.storeEmail=(0,r.__)("Please enter your email address to subscribe","woocommerce")),s}render(){const{showUsageModal:e,skipping:t,isSkipSetupPopoverVisible:o}=this.state,{skipProfiler:n,isLoading:i,isBusy:a,initialValues:l,invalidateResolutionForStoreSelector:c}=this.props,m=(0,r.__)("Manual setup is only recommended for\n experienced WooCommerce users or developers.","woocommerce");return i?(0,s.createElement)("div",{className:"woocommerce-profile-wizard__store-details"},(0,s.createElement)(pe,null)):(0,s.createElement)("div",{className:"woocommerce-profile-wizard__store-details"},(0,s.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},(0,s.createElement)(O.Text,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},(0,r.__)("Welcome to WooCommerce","woocommerce")),(0,s.createElement)(O.Text,{variant:"body",as:"p"},(0,r.__)("Tell us where you run your business to help us configure currency, shipping, taxes, and more in a fully automated way.","woocommerce"))),(0,s.createElement)(_.Form,{initialValues:l,onSubmit:this.onSubmit,validate:this.validateStoreDetails,onChange:this.onFormValueChange},(o=>{let{getInputProps:i,handleSubmit:l,values:c,isValidForm:m,setValue:d}=o;return(0,s.createElement)(h.Card,null,e&&(0,s.createElement)(me.Z,{onContinue:()=>{t?n():this.onContinue(c).then((()=>this.props.goToNextStep()))},onClose:()=>this.setState({showUsageModal:!1,skipping:!1})}),(0,s.createElement)(h.CardBody,null,(0,s.createElement)(ce.IO,{getInputProps:i,setValue:d}),(0,s.createElement)(_.TextControl,(0,u.Z)({label:(c.isAgreeMarketing,(0,r.__)("Email address","woocommerce")),required:c.isAgreeMarketing,autoComplete:"email"},i("storeEmail"))),(0,s.createElement)(de,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__newsletter-signup"},(0,s.createElement)(h.CheckboxControl,(0,u.Z)({label:(0,s.createElement)(s.Fragment,null,(0,r.__)("Get tips, product updates and inspiration straight to your mailbox.","woocommerce")," ",(0,s.createElement)("span",{className:"woocommerce-profile-wizard__powered-by-mailchimp"},(0,r.__)("Powered by Mailchimp","woocommerce")))},i("isAgreeMarketing")))))),(0,s.createElement)(h.CardFooter,{justify:"center"},(0,s.createElement)(h.Button,{isPrimary:!0,onClick:l,isBusy:a,disabled:!m||a,"aria-disabled":!m||a},(0,r.__)("Continue","woocommerce"))))})),(0,s.createElement)("div",{className:"woocommerce-profile-wizard__footer"},(0,s.createElement)(h.Button,{isLink:!0,className:"woocommerce-profile-wizard__footer-link",onClick:()=>(c("getTaskLists"),this.setState({showUsageModal:!0,skipping:!0}),!1)},(0,r.__)("Skip setup store details","woocommerce")),(0,s.createElement)(h.Button,{isTertiary:!0,label:m,onClick:()=>this.setState({isSkipSetupPopoverVisible:!0})},(0,s.createElement)(I.Z,{icon:oe})),o&&(0,s.createElement)(h.Popover,{focusOnMount:"container",position:"top center",onClose:()=>this.setState({isSkipSetupPopoverVisible:!1})},m)))}}ue.contextType=C.$;const he=(0,i.compose)((0,l.withSelect)((e=>{const{getSettings:t,getSettingsError:o,isUpdateSettingsRequesting:r}=e(m.SETTINGS_STORE_NAME),{getProfileItems:n,isOnboardingRequesting:i,getEmailPrefill:a,hasFinishedResolution:l}=e(m.ONBOARDING_STORE_NAME),{getLocale:c,getLocales:d,getCountries:p,hasFinishedResolution:u}=e(m.COUNTRIES_STORE_NAME),{isResolving:h}=e(m.OPTIONS_STORE_NAME),_=n(),g=a(),{general:w={}}=t("general"),C=i("updateProfileItems")||r("general")||h("getOption",["woocommerce_allow_tracking"]),f=!(l("getProfileItems")&&l("getEmailPrefill")&&u("getLocales")&&u("getCountries")),y=(0,s.useRef)({settings:null});y.current={settings:o("general")};const v=_.is_store_country_set?w.woocommerce_default_country:"";return p(),d(),{getLocale:c,initialValues:{addressLine1:w.woocommerce_store_address||"",addressLine2:w.woocommerce_store_address_2||"",city:w.woocommerce_store_city||"",countryState:v,postCode:w.woocommerce_store_postcode||"",isAgreeMarketing:"boolean"==typeof _.is_agree_marketing&&_.is_agree_marketing,storeEmail:"string"==typeof _.store_email?_.store_email:g},isLoading:f,profileItems:_,isBusy:C,settings:w,errorsRef:y}})),(0,l.withDispatch)((e=>{const{createNotice:t}=e("core/notices"),{invalidateResolutionForStoreSelector:o,updateProfileItems:s}=e(m.ONBOARDING_STORE_NAME),{updateAndPersistSettingsForGroup:r}=e(m.SETTINGS_STORE_NAME);return{createNotice:t,invalidateResolutionForStoreSelector:o,updateProfileItems:s,updateAndPersistSettingsForGroup:r}})))(ue);var _e=o(86989),ge=o.n(_e),we=o(22629),Ce=o(5833),fe=o(15244),ye=o(7862),ve=o.n(ye);const Ee=e=>{let{children:t,className:o}=e;return(0,p.isWpVersion)("5.8",">=")?(0,s.createElement)("div",{className:o},t):(0,s.createElement)(h.DropZoneProvider,null,(0,s.createElement)("div",{className:o},t))};class be extends s.Component{constructor(){super(),this.state={isUploading:!1},this.handleFilesUpload=this.handleFilesUpload.bind(this),this.handleFilesDrop=this.handleFilesDrop.bind(this)}handleFilesDrop(e){const t=e[0];this.uploadTheme(t)}handleFilesUpload(e){const t=e.target.files[0];this.uploadTheme(t)}uploadTheme(e){const{createNotice:t,onUploadComplete:o}=this.props;this.setState({isUploading:!0});const s=new window.FormData;return s.append("pluginzip",e),ge()({path:"/wc-admin/themes",method:"POST",body:s}).then((e=>{o(e),this.setState({isUploading:!1}),t(e.status,e.message)})).catch((e=>{this.setState({isUploading:!1}),e&&e.message&&t("error",e.message)}))}render(){const{className:e}=this.props,{isUploading:t}=this.state,o=w()("woocommerce-theme-uploader",e,{"is-uploading":t});return(0,s.createElement)(h.Card,{className:o},(0,s.createElement)(Ee,{className:"woocommerce-theme-uploader__dropzone-wrapper"},t?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_.Spinner,null),(0,s.createElement)(_.H,{className:"woocommerce-theme-uploader__title"},(0,r.__)("Uploading theme","woocommerce")),(0,s.createElement)("p",null,(0,r.__)("Your theme is being uploaded","woocommerce"))):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(h.FormFileUpload,{accept:".zip",onChange:this.handleFilesUpload},(0,s.createElement)(fe.Z,null),(0,s.createElement)(_.H,{className:"woocommerce-theme-uploader__title"},(0,r.__)("Upload a theme","woocommerce")),(0,s.createElement)("p",null,(0,r.__)("Drop a theme zip file here to upload","woocommerce"))),(0,s.createElement)(h.DropZone,{label:(0,r.__)("Drop your theme zip file here","woocommerce"),onFilesDrop:this.handleFilesDrop}))))}}be.propTypes={className:ve().string,onUploadComplete:ve().func},be.defaultProps={onUploadComplete:a.noop};const Se=(0,i.compose)((0,l.withDispatch)((e=>{const{createNotice:t}=e("core/notices");return{createNotice:t}})))(be);var ke=o(60298),Ne=o(52260),Te=o(52384),xe=o(24929);const Pe=[{key:"mobile",icon:Ne.Z},{key:"tablet",icon:Te.Z},{key:"desktop",icon:xe.Z}];class Oe extends s.Component{constructor(){super(...arguments),this.state={device:"desktop"},this.handleDeviceClick=this.handleDeviceClick.bind(this)}handleDeviceClick(e){const{theme:t}=this.props;(0,d.recordEvent)("storeprofiler_store_theme_demo_device",{device:e,theme:t.slug}),this.setState({device:e})}render(){const{isBusy:e,onChoose:t,onClose:o,theme:n}=this.props,{demo_url:i,slug:a,title:l}=n,{device:c}=this.state;return(0,s.createElement)("div",{className:"woocommerce-theme-preview"},(0,s.createElement)("div",{className:"woocommerce-theme-preview__toolbar"},(0,s.createElement)(h.Button,{className:"woocommerce-theme-preview__close",onClick:o},(0,s.createElement)(I.Z,{icon:ke.Z})),(0,s.createElement)("div",{className:"woocommerce-theme-preview__theme-name"},(0,M.Z)({mixedString:(0,r.sprintf)((0,r.__)("{{strong}}%s{{/strong}} developed by WooCommerce","woocommerce"),l),components:{strong:(0,s.createElement)("strong",null)}})),(0,s.createElement)("div",{className:"woocommerce-theme-preview__devices"},Pe.map((e=>{const t=e.icon;return(0,s.createElement)(h.Button,{key:e.key,className:w()("woocommerce-theme-preview__device",{"is-selected":e.key===c}),onClick:()=>this.handleDeviceClick(e.key)},(0,s.createElement)(t,null))}))),(0,s.createElement)(h.Button,{isPrimary:!0,onClick:()=>t(a,"preview"),isBusy:e},(0,r.__)("Choose","woocommerce"))),(0,s.createElement)(_.WebPreview,{src:i,title:l,className:`is-${c}`}))}}const Ie=Oe;class Ve extends s.Component{constructor(){super(...arguments),this.state={activeTab:"all",chosen:null,demo:null,uploadedThemes:[]},this.handleUploadComplete=this.handleUploadComplete.bind(this),this.onChoose=this.onChoose.bind(this),this.onClosePreview=this.onClosePreview.bind(this),this.onSelectTab=this.onSelectTab.bind(this),this.openDemo=this.openDemo.bind(this),this.skipStep=this.skipStep.bind(this)}componentDidUpdate(e){const{isError:t,isUpdatingProfileItems:o,createNotice:s}=this.props,{chosen:n}=this.state,i=!o&&e.isUpdatingProfileItems&&!t&&n,a=!o&&e.isRequesting&&t;i&&(this.setState({chosen:null}),this.props.goToNextStep()),a&&(this.setState({chosen:null}),s("error",(0,r.__)("There was a problem selecting your store theme","woocommerce")))}skipStep(){const{activeTheme:e=""}=(0,K.O3)("onboarding",{});(0,d.recordEvent)("storeprofiler_store_theme_skip_step",{activeTheme:e}),this.props.goToNextStep()}onChoose(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const{updateProfileItems:o}=this.props,{is_installed:s,price:r,slug:n}=e,{activeTheme:i=""}=(0,K.O3)("onboarding",{});this.setState({chosen:n}),(0,d.recordEvent)("storeprofiler_store_theme_choose",{theme:n,location:t}),n!==i&&s?this.activateTheme(n):n!==i&&(0,b.wB)(r)<=0?this.installTheme(n):o({theme:n})}installTheme(e){const{createNotice:t}=this.props;ge()({path:"/wc-admin/onboarding/themes/install?theme="+e,method:"POST"}).then((()=>{this.activateTheme(e)})).catch((e=>{this.setState({chosen:null}),t("error",e.message)}))}activateTheme(e){const{createNotice:t,updateProfileItems:o}=this.props;ge()({path:"/wc-admin/onboarding/themes/activate?theme="+e,method:"POST"}).then((s=>{t("success",(0,r.sprintf)((0,r.__)("%s was installed and activated on your site","woocommerce"),s.name)),(0,K.K7)("onboarding",{...(0,K.O3)("onboarding",{}),activeTheme:s.slug}),o({theme:e})})).catch((e=>{this.setState({chosen:null}),t("error",e.message)}))}onClosePreview(){const{demo:e}=this.state;(0,d.recordEvent)("storeprofiler_store_theme_demo_close",{theme:e.slug}),document.body.classList.remove("woocommerce-theme-preview-active"),this.setState({demo:null})}openDemo(e){(0,d.recordEvent)("storeprofiler_store_theme_live_demo",{theme:e.slug}),document.body.classList.add("woocommerce-theme-preview-active"),this.setState({demo:e})}renderTheme(e){const{demo_url:t,has_woocommerce_support:o,image:n,slug:i,title:a}=e,{chosen:l}=this.state,{activeTheme:c=""}=(0,K.O3)("onboarding",{});return(0,s.createElement)(h.Card,{className:"woocommerce-profile-wizard__theme",key:i},(0,s.createElement)(h.CardBody,{size:null},n&&(0,s.createElement)("div",{className:"woocommerce-profile-wizard__theme-image",style:{backgroundImage:`url(${n})`},role:"img","aria-label":a})),(0,s.createElement)(h.CardBody,{className:"woocommerce-profile-wizard__theme-details"},(0,s.createElement)(_.H,{className:"woocommerce-profile-wizard__theme-name"},a,!o&&(0,s.createElement)(h.Tooltip,{text:(0,r.__)("This theme does not support WooCommerce.","woocommerce")},(0,s.createElement)("span",null,(0,s.createElement)(Ce.Z,{role:"img","aria-hidden":"true",focusable:"false"})))),(0,s.createElement)("p",{className:"woocommerce-profile-wizard__theme-status"},this.getThemeStatus(e))),(0,s.createElement)(h.CardFooter,null,i===c?(0,s.createElement)(h.Button,{isPrimary:!0,onClick:()=>this.onChoose(e,"card"),isBusy:l===i,disabled:l===i},(0,r.__)("Continue with my active theme","woocommerce")):(0,s.createElement)(h.Button,{isSecondary:!0,onClick:()=>this.onChoose(e,"card"),isBusy:l===i,disabled:l===i},(0,r.__)("Choose","woocommerce")),t&&(0,s.createElement)(h.Button,{isTertiary:!0,onClick:()=>this.openDemo(e)},(0,r.__)("Live demo","woocommerce"))))}getThemeStatus(e){const{is_installed:t,price:o,slug:s}=e,{activeTheme:n=""}=(0,K.O3)("onboarding",{});return n===s?(0,r.__)("Currently active theme","woocommerce"):t?(0,r.__)("Installed","woocommerce"):(0,b.wB)(o)<=0?(0,r.__)("Free","woocommerce"):(0,r.sprintf)((0,r.__)("%s per year","woocommerce"),(0,we.decodeEntities)(o))}doesActiveThemeSupportWooCommerce(){const{activeTheme:e=""}=(0,K.O3)("onboarding",{}),t=this.getThemes().find((t=>t.slug===e));return t&&t.has_woocommerce_support}onSelectTab(e){(0,d.recordEvent)("storeprofiler_store_theme_navigate",{navigation:e}),this.setState({activeTab:e})}getPriceValue(e){return Number((0,we.decodeEntities)(e).replace(/[^0-9.-]+/g,""))}getThemes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";const{uploadedThemes:t}=this.state,{activeTheme:o="",themes:s=[]}=(0,K.O3)("onboarding",{}),r=[...s.filter((e=>e&&(e.has_woocommerce_support||e.slug===o))),...t];switch(e){case"paid":return r.filter((e=>(0,b.wB)(e.price)>0));case"free":return r.filter((e=>(0,b.wB)(e.price)<=0));default:return r}}handleUploadComplete(e){"success"===e.status&&e.theme_data&&(this.setState({uploadedThemes:[...this.state.uploadedThemes,e.theme_data]}),(0,d.recordEvent)("storeprofiler_store_theme_upload",{theme:e.theme_data.slug}))}render(){const{activeTab:e,chosen:t,demo:o}=this.state,n=this.getThemes(e),i=this.doesActiveThemeSupportWooCommerce();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},(0,s.createElement)(O.Text,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},(0,r.__)("Choose a theme","woocommerce")),(0,s.createElement)(O.Text,{variant:"body",as:"p"},(0,r.__)("Choose how your store appears to customers. And don't worry, you can always switch themes and edit them later.","woocommerce"))),(0,s.createElement)(h.TabPanel,{className:"woocommerce-profile-wizard__themes-tab-panel",activeClass:"is-active",onSelect:this.onSelectTab,tabs:[{name:"all",title:(0,r.__)("All themes","woocommerce")},{name:"paid",title:(0,r.__)("Paid themes","woocommerce")},{name:"free",title:(0,r.__)("Free themes","woocommerce")}]},(()=>(0,s.createElement)("div",{className:"woocommerce-profile-wizard__themes"},n&&n.map((e=>this.renderTheme(e))),(0,s.createElement)(Se,{onUploadComplete:this.handleUploadComplete})))),o&&(0,s.createElement)(Ie,{theme:o,onChoose:()=>this.onChoose(o,"card"),onClose:this.onClosePreview,isBusy:t===o.slug}),i&&(0,s.createElement)("p",{className:"woocommerce-profile-wizard__themes-skip-this-step"},(0,s.createElement)(h.Button,{isLink:!0,className:"woocommerce-profile-wizard__skip",onClick:()=>this.skipStep()},(0,r.__)("Skip this step","woocommerce"))))}}const Fe=(0,i.compose)((0,l.withSelect)((e=>{const{getProfileItems:t,getOnboardingError:o,isOnboardingRequesting:s}=e(m.ONBOARDING_STORE_NAME);return{isError:Boolean(o("updateProfileItems")),isUpdatingProfileItems:s("updateProfileItems"),profileItems:t()}})),(0,l.withDispatch)((e=>{const{updateProfileItems:t}=e(m.ONBOARDING_STORE_NAME),{createNotice:o}=e("core/notices");return{createNotice:o,updateProfileItems:t}})))(Ve);class Me extends s.Component{constructor(e){super(e),this.cachedActivePlugins=e.activePlugins,this.goToNextStep=this.goToNextStep.bind(this),this.trackStepValueChanges=this.trackStepValueChanges.bind(this),this.updateCurrentStepValues=this.updateCurrentStepValues.bind(this),this.stepValueChanges={}}componentDidUpdate(e){const{step:t}=e.query,{step:o}=this.props.query,{isError:s,isGetProfileItemsRequesting:n,createNotice:i}=this.props;!n&&e.isRequesting&&s&&i("error",(0,r.__)("There was a problem finishing the setup wizard","woocommerce")),t!==o&&(window.document.documentElement.scrollTop=0,(0,d.recordEvent)("storeprofiler_step_view",{step:this.getCurrentStep().key,wc_version:(0,p.getSetting)("wcVersion")}))}componentDidMount(){document.body.classList.remove("woocommerce-admin-is-loading"),document.body.classList.add("woocommerce-profile-wizard__body"),document.body.classList.add("woocommerce-admin-full-screen"),document.body.classList.add("is-wp-toolbar-disabled"),(0,d.recordEvent)("storeprofiler_step_view",{step:this.getCurrentStep().key,wc_version:(0,p.getSetting)("wcVersion")})}componentWillUnmount(){document.body.classList.remove("woocommerce-profile-wizard__body"),document.body.classList.remove("woocommerce-admin-full-screen"),document.body.classList.remove("is-wp-toolbar-disabled")}trackStepValueChanges(e,t,o,s){this.stepValueChanges[e]={initialValues:t,currentValues:o,onSave:s}}updateCurrentStepValues(e,t){this.stepValueChanges[e]&&(this.stepValueChanges[e].currentValues=t)}getSteps(){const{profileItems:e}=this.props,t=[];return t.push({key:"store-details",container:he,label:(0,r.__)("Store Details","woocommerce"),isComplete:e.hasOwnProperty("setup_client")&&null!==e.setup_client}),t.push({key:"industry",container:ee,label:(0,r.__)("Industry","woocommerce"),isComplete:e.hasOwnProperty("industry")&&null!==e.industry}),t.push({key:"product-types",container:ne,label:(0,r.__)("Product Types","woocommerce"),isComplete:e.hasOwnProperty("product_types")&&null!==e.product_types}),t.push({key:"business-details",container:Y,label:(0,r.__)("Business Details","woocommerce"),isComplete:e.hasOwnProperty("product_count")&&null!==e.product_count}),t.push({key:"theme",container:Fe,label:(0,r.__)("Theme","woocommerce"),isComplete:e.hasOwnProperty("theme")&&null!==e.theme}),(0,n.applyFilters)("woocommerce_admin_profile_wizard_steps",t)}getCurrentStep(){const{step:e}=this.props.query;return this.getSteps().find((t=>t.key===e))||this.getSteps()[0]}async goToNextStep(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{activePlugins:t}=this.props,o=this.getCurrentStep(),s=this.getSteps().findIndex((e=>e.key===o.key));(0,d.recordEvent)("storeprofiler_step_complete",{step:o.key,wc_version:(0,p.getSetting)("wcVersion"),...e}),this.cachedActivePlugins=t;const r=this.getSteps()[s+1];if(void 0!==r)return(0,c.updateQueryString)({step:r.key});this.completeProfiler()}completeProfiler(){const{activePlugins:e,isJetpackConnected:t,notes:o,updateNote:s,updateProfileItems:r,connectToJetpack:n}=this.props;(0,d.recordEvent)("storeprofiler_complete");const i=e.includes("jetpack")&&!t,a=o.find((e=>"wc-admin-onboarding-profiler-reminder"===e.name));a&&s(a.id,{status:"actioned"}),r({completed:!0}).then((()=>{const e=new URL((0,c.getNewPath)({},"/",{}),window.location.href).href;i?(document.body.classList.add("woocommerce-admin-is-loading"),n((()=>e))):window.location.href=e}))}skipProfiler(){const{createNotice:e,updateProfileItems:t}=this.props;t({skipped:!0}).then((()=>{(0,d.recordEvent)("storeprofiler_store_details_skip"),(0,c.getHistory)().push((0,c.getNewPath)({},"/",{}))})).catch((()=>{e("error",(0,r.__)("There was a problem skipping the setup wizard","woocommerce"))}))}render(){const{query:e}=this.props,t=this.getCurrentStep(),o=t.key,r=(0,s.createElement)(t.container,{query:e,step:t,goToNextStep:this.goToNextStep,skipProfiler:()=>{this.skipProfiler()},trackStepValueChanges:this.trackStepValueChanges,updateCurrentStepValues:this.updateCurrentStepValues}),n=this.getSteps().map((e=>(0,a.pick)(e,["key","label","isComplete"]))),i=`woocommerce-profile-wizard__container ${o}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ae,{currentStep:o,steps:n,stepValueChanges:this.stepValueChanges}),(0,s.createElement)("div",{className:i},r))}}const Be=(0,i.compose)((0,l.withSelect)((e=>{const{getNotes:t}=e(m.NOTES_STORE_NAME),{getProfileItems:o,getOnboardingError:s}=e(m.ONBOARDING_STORE_NAME),{getActivePlugins:r,getPluginsError:n,isJetpackConnected:i}=e(m.PLUGINS_STORE_NAME),a=o(),l=t({page:1,per_page:m.QUERY_DEFAULTS.pageSize,type:"update",status:"unactioned"}),c=r();return{getPluginsError:n,isError:Boolean(s("updateProfileItems")),isJetpackConnected:i(),notes:l,profileItems:a,activePlugins:c}})),(0,l.withDispatch)((e=>{const{connectToJetpackWithFailureRedirect:t,createErrorNotice:o}=e(m.PLUGINS_STORE_NAME),{updateNote:s}=e(m.NOTES_STORE_NAME),{updateOptions:r}=e(m.OPTIONS_STORE_NAME),{updateProfileItems:n}=e(m.ONBOARDING_STORE_NAME),{createNotice:i}=e("core/notices");return{connectToJetpack:e=>{t(e,o,p.getAdminLink)},createNotice:i,updateNote:s,updateOptions:r,updateProfileItems:n}})),(0,K.O3)("plugins")?(0,m.withPluginsHydration)({...(0,K.O3)("plugins"),jetpackStatus:(0,K.O3)("dataEndpoints",{}).jetpackStatus}):a.identity)(Me)},29230:(e,t,o)=>{o.r(t),o.d(t,{default:()=>r});var s=o(69307);const r=e=>{let{}=e;return(0,s.createElement)("div",null,"Settings page")}},15244:(e,t,o)=>{t.Z=function(e){var t=e.size,o=void 0===t?24:t,s=e.onClick,a=(e.icon,e.className),l=function(e,t){if(null==e)return{};var o,s,r=function(e,t){if(null==e)return{};var o,s,r={},n=Object.keys(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,n),c=["gridicon","gridicons-cloud-upload",a,!1,!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",i({className:c,height:o,width:o,onClick:s},l,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M18 9c-.009 0-.017.002-.025.003A6.496 6.496 0 005 9.5a6.5 6.5 0 00.186 1.519C5.123 11.016 5.064 11 5 11a4 4 0 00-4 4c0 1.202.541 2.267 1.38 3h18.593C22.196 17.089 23 15.643 23 14a5 5 0 00-5-5zm-5 4v3h-2v-3H8l4-5 4 5h-3z"})))};var s,r=(s=o(99196))&&s.__esModule?s:{default:s},n=["size","onClick","icon","className"];function i(){return i=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var s in t=arguments[o])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i.apply(this,arguments)}},24929:(e,t,o)=>{t.Z=function(e){var t=e.size,o=void 0===t?24:t,s=e.onClick,a=(e.icon,e.className),l=function(e,t){if(null==e)return{};var o,s,r=function(e,t){if(null==e)return{};var o,s,r={},n=Object.keys(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,n),c=["gridicon","gridicons-computer",a,!1,!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",i({className:c,height:o,width:o,onClick:s},l,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M20 2H4a2 2 0 00-2 2v12a2 2 0 002 2h6v2H7v2h10v-2h-3v-2h6a2 2 0 002-2V4a2 2 0 00-2-2zm0 14H4V4h16v12z"})))};var s,r=(s=o(99196))&&s.__esModule?s:{default:s},n=["size","onClick","icon","className"];function i(){return i=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var s in t=arguments[o])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i.apply(this,arguments)}},5833:(e,t,o)=>{t.Z=function(e){var t=e.size,o=void 0===t?24:t,s=e.onClick,a=(e.icon,e.className),l=function(e,t){if(null==e)return{};var o,s,r=function(e,t){if(null==e)return{};var o,s,r={},n=Object.keys(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,n),c=["gridicon","gridicons-info",a,!!function(e){return 0==e%18}(o)&&"needs-offset",!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",i({className:c,height:o,width:o,onClick:s},l,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})))};var s,r=(s=o(99196))&&s.__esModule?s:{default:s},n=["size","onClick","icon","className"];function i(){return i=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var s in t=arguments[o])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i.apply(this,arguments)}},52260:(e,t,o)=>{t.Z=function(e){var t=e.size,o=void 0===t?24:t,s=e.onClick,a=(e.icon,e.className),l=function(e,t){if(null==e)return{};var o,s,r=function(e,t){if(null==e)return{};var o,s,r={},n=Object.keys(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,n),c=["gridicon","gridicons-phone",a,!1,!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",i({className:c,height:o,width:o,onClick:s},l,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M16 2H8a2 2 0 00-2 2v16a2 2 0 002 2h8a2 2 0 002-2V4a2 2 0 00-2-2zm-3 19h-2v-1h2v1zm3-2H8V5h8v14z"})))};var s,r=(s=o(99196))&&s.__esModule?s:{default:s},n=["size","onClick","icon","className"];function i(){return i=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var s in t=arguments[o])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i.apply(this,arguments)}},52384:(e,t,o)=>{t.Z=function(e){var t=e.size,o=void 0===t?24:t,s=e.onClick,a=(e.icon,e.className),l=function(e,t){if(null==e)return{};var o,s,r=function(e,t){if(null==e)return{};var o,s,r={},n=Object.keys(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,n),c=["gridicon","gridicons-tablet",a,!1,!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",i({className:c,height:o,width:o,onClick:s},l,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M18 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V4a2 2 0 00-2-2zm-5 19h-2v-1h2v1zm5-2H6V5h12v14z"})))};var s,r=(s=o(99196))&&s.__esModule?s:{default:s},n=["size","onClick","icon","className"];function i(){return i=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var s in t=arguments[o])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i.apply(this,arguments)}}}]);
|
1 |
+
"use strict";(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[7708],{10314:(e,t,o)=>{o.d(t,{Z:()=>n});var s=o(69307),r=o(70444);const n=(0,s.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(r.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}))},37942:(e,t,o)=>{o.d(t,{Z:()=>n});var s=o(69307),r=o(70444);const n=(0,s.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(r.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}))},9426:(e,t,o)=>{o.r(t),o.d(t,{default:()=>Be});var s=o(69307),r=o(65736),n=o(92694),i=o(94333),a=o(92819),l=o(9818),c=o(10431),m=o(67221),d=o(14599),p=o(74617),u=o(5267),h=o(55609),_=o(86020),g=o(83849),w=o.n(g),C=o(54071),f=o(37657);const y=[{key:"shopify",label:(0,r.__)("Shopify","woocommerce")},{key:"bigcommerce",label:(0,r.__)("BigCommerce","woocommerce")},{key:"magento",label:(0,r.__)("Magento","woocommerce")},{key:"wix",label:(0,r.__)("Wix","woocommerce")},{key:"amazon",label:(0,r.__)("Amazon","woocommerce")},{key:"ebay",label:(0,r.__)("eBay","woocommerce")},{key:"etsy",label:(0,r.__)("Etsy","woocommerce")},{key:"squarespace",label:(0,r.__)("Squarespace","woocommerce")},{key:"wish",label:(0,r.__)("Wish","woocommerce")},{key:"walmart",label:(0,r.__)("Walmart","woocommerce")},{key:"other",label:(0,r.__)("Other","woocommerce")}],v=[{key:"1",label:(0,r.__)("It's just me","woocommerce")},{key:"<10",label:(0,r.__)("< 10","woocommerce")},{key:"10-50",label:"10 - 50"},{key:"50-250",label:"50 - 250"},{key:"+250",label:(0,r.__)("+250","woocommerce")},{key:"not specified",label:(0,r.__)("I'd rather not say","woocommerce")}],E=[{key:"no",label:(0,r.__)("No","woocommerce")},{key:"other",label:(0,r.__)("Yes, on another platform","woocommerce")},{key:"other-woocommerce",label:(0,r.__)("Yes, I own a different store powered by WooCommerce","woocommerce")},{key:"brick-mortar",label:(0,r.__)("Yes, in person at physical stores and/or events","woocommerce")},{key:"brick-mortar-other",label:(0,r.__)("Yes, on another platform and in person at physical stores and/or events","woocommerce")}];var b=o(2969),S=o(81595);const k=(e,t)=>(0,S.formatValue)(e,"number",t),N=function(e,t){let o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k;return o?(0,r.sprintf)((0,r._x)("%1$s - %2$s","store product count or revenue range","woocommerce"),s(e,t),s(e,o)):(0,r.sprintf)((0,r._x)("%s+","store product count or revenue","woocommerce"),s(e,t))},T={US:1,EU:.9,IN:71.24,GB:.76,BR:4.19,VN:23172.5,ID:14031,BD:84.87,PK:154.8,RU:63.74,TR:5.75,MX:19.37,CA:1.32},x=(e,t)=>{const o=(0,b.w)(t);if("US"===o)return e;const s=T[o]||T.US,r=s.toString().split(".")[0].length,n=Math.pow(10,2+r);return Math.round(e*s/n)*n},P=(e,t,o)=>[{key:"none",label:(0,r.sprintf)((0,r.__)("%s (I'm just getting started)","woocommerce"),o(0))},{key:"up-to-2500",label:(0,r.sprintf)((0,r.__)("Up to %s","woocommerce"),o(x(2500,t)))},{key:"2500-10000",label:N(e,x(2500,t),x(1e4,t),((e,t)=>o(t)))},{key:"10000-50000",label:N(e,x(1e4,t),x(5e4,t),((e,t)=>o(t)))},{key:"50000-250000",label:N(e,x(5e4,t),x(25e4,t),((e,t)=>o(t)))},{key:"more-than-250000",label:(0,r.sprintf)((0,r.__)("More than %s","woocommerce"),o(x(25e4,t)))},{key:"rather-not-say",label:(0,r.__)("I'd rather not say","woocommerce")}];var O=o(14812),I=o(62907),V=o(37942),F=o(10314),M=o(98534);const B=()=>(0,s.createElement)("svg",{width:"200",height:"148",viewBox:"0 0 200 148",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)("g",{clipPath:"url(#clip0)"},(0,s.createElement)("path",{d:"M197.563 2.53875e-09H62.909C62.3961 0.000450584 61.9043 0.205742 61.5416 0.570805C61.179 0.935868 60.975 1.43087 60.9746 1.94714V50.9404H93.5623C94.4445 50.9415 95.2902 51.2947 95.9141 51.9226C96.5379 52.5505 96.8888 53.4019 96.8899 54.2899V95.7402H197.563C197.843 95.7402 198.119 95.6791 198.373 95.5612C198.627 95.4432 198.853 95.2712 199.034 95.0569C199.05 95.0402 199.064 95.0222 199.076 95.0033C199.192 94.8612 199.285 94.7024 199.354 94.5322C199.451 94.2981 199.501 94.0468 199.5 93.7931V1.94714C199.499 1.43051 199.295 0.935241 198.932 0.57014C198.569 0.20504 198.077 -2.63458e-05 197.563 2.53875e-09Z",fill:"#F2F2F2"}),(0,s.createElement)("path",{d:"M199.222 7.80469H61.25V8.36132H199.222V7.80469Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M65.95 5.84371C66.8662 5.84371 67.609 5.09607 67.609 4.17381C67.609 3.25155 66.8662 2.50391 65.95 2.50391C65.0338 2.50391 64.291 3.25155 64.291 4.17381C64.291 5.09607 65.0338 5.84371 65.95 5.84371Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M70.72 5.84371C71.6363 5.84371 72.379 5.09607 72.379 4.17381C72.379 3.25155 71.6363 2.50391 70.72 2.50391C69.8038 2.50391 69.061 3.25155 69.061 4.17381C69.061 5.09607 69.8038 5.84371 70.72 5.84371Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M75.4896 5.84371C76.4058 5.84371 77.1486 5.09607 77.1486 4.17381C77.1486 3.25155 76.4058 2.50391 75.4896 2.50391C74.5733 2.50391 73.8306 3.25155 73.8306 4.17381C73.8306 5.09607 74.5733 5.84371 75.4896 5.84371Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M164.842 19.957H95.6295C94.8646 19.957 94.1311 20.2629 93.5903 20.8073C93.0494 21.3516 92.7456 22.09 92.7456 22.8599C92.7456 23.6298 93.0494 24.3681 93.5903 24.9125C94.1311 25.4569 94.8646 25.7627 95.6295 25.7627H164.842C165.607 25.7627 166.341 25.4569 166.882 24.9125C167.422 24.3681 167.726 23.6298 167.726 22.8599C167.726 22.09 167.422 21.3516 166.882 20.8073C166.341 20.2629 165.607 19.957 164.842 19.957ZM164.842 25.3161H95.6295C94.9823 25.3161 94.3616 25.0573 93.904 24.5967C93.4464 24.1361 93.1893 23.5113 93.1893 22.8599C93.1893 22.2084 93.4464 21.5837 93.904 21.123C94.3616 20.6624 94.9823 20.4036 95.6295 20.4036H164.842C165.489 20.4036 166.11 20.6624 166.568 21.123C167.025 21.5837 167.283 22.2084 167.283 22.8599C167.283 23.5113 167.025 24.1361 166.568 24.5967C166.11 25.0573 165.489 25.3161 164.842 25.3161Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M186.022 43.0859H116.809C116.044 43.0859 115.31 43.3918 114.769 43.9362C114.229 44.4806 113.925 45.2189 113.925 45.9888C113.925 46.7587 114.229 47.497 114.769 48.0414C115.31 48.5858 116.044 48.8916 116.809 48.8916H186.022C186.786 48.8916 187.52 48.5858 188.061 48.0414C188.602 47.497 188.905 46.7587 188.905 45.9888C188.905 45.2189 188.602 44.4806 188.061 43.9362C187.52 43.3918 186.786 43.0859 186.022 43.0859Z",fill:"white"}),(0,s.createElement)("path",{d:"M186.022 53.8047H116.809C116.044 53.8047 115.31 54.1105 114.769 54.6549C114.229 55.1993 113.925 55.9376 113.925 56.7075C113.925 57.4774 114.229 58.2158 114.769 58.7601C115.31 59.3045 116.044 59.6104 116.809 59.6104H186.022C186.786 59.6104 187.52 59.3045 188.061 58.7601C188.602 58.2158 188.905 57.4774 188.905 56.7075C188.905 55.9376 188.602 55.1993 188.061 54.6549C187.52 54.1105 186.786 53.8047 186.022 53.8047Z",fill:"white"}),(0,s.createElement)("path",{d:"M186.022 64.5195H116.809C116.044 64.5195 115.31 64.8254 114.769 65.3698C114.229 65.9141 113.925 66.6525 113.925 67.4224C113.925 68.1923 114.229 68.9306 114.769 69.475C115.31 70.0194 116.044 70.3252 116.809 70.3252H186.022C186.786 70.3252 187.52 70.0194 188.061 69.475C188.602 68.9306 188.905 68.1923 188.905 67.4224C188.905 66.6525 188.602 65.9141 188.061 65.3698C187.52 64.8254 186.786 64.5195 186.022 64.5195Z",fill:"white"}),(0,s.createElement)("path",{d:"M105.623 38.2852H74.1183C73.4425 38.286 72.7947 38.5565 72.3168 39.0375C71.839 39.5185 71.5702 40.1706 71.5693 40.8508V50.9416H72.013V40.8508C72.0139 40.2891 72.2359 39.7506 72.6306 39.3533C73.0252 38.9561 73.5602 38.7326 74.1183 38.7317H105.623C106.182 38.7322 106.717 38.9556 107.112 39.3529C107.506 39.7502 107.728 40.289 107.729 40.8508V72.5633C107.728 73.1251 107.506 73.6638 107.112 74.0611C106.717 74.4585 106.182 74.6819 105.623 74.6824H96.8897V75.1289H105.623C106.299 75.1285 106.947 74.858 107.425 74.377C107.903 73.8959 108.172 73.2436 108.172 72.5633V40.8508C108.172 40.1705 107.903 39.5182 107.425 39.0371C106.947 38.556 106.299 38.2856 105.623 38.2852Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M23.9309 70.9116C23.8195 70.9162 19.0705 70.5847 18.9492 70.5806L19.3758 66.294L22.0808 66.212L27.2495 56.5756C26.5327 55.1996 27.4148 53.3739 28.9355 53.0925C32 52.3914 33.0526 57.2443 29.9789 57.8901L25.7036 69.6652C25.5695 70.03 25.3278 70.3449 25.011 70.5676C24.6942 70.7904 24.3174 70.9104 23.9309 70.9116Z",fill:"#FFB8B8"}),(0,s.createElement)("path",{d:"M11.4107 73.118C6.89154 73.1291 6.49482 66.2544 11.024 65.7699C23.0006 65.0415 21.485 62.0137 22.3945 70.9448C22.4224 71.2097 22.3448 71.475 22.1787 71.6824C22.0126 71.8898 21.7715 72.0223 21.5084 72.051L11.803 73.0968C11.6727 73.1109 11.5417 73.1179 11.4107 73.118Z",className:"fill-theme-color"}),(0,s.createElement)("path",{d:"M10.3793 51.3852C16.605 54.9512 11.494 64.3601 5.15222 61.0097C-1.0733 57.4438 4.03771 48.0349 10.3793 51.3852Z",fill:"#FFB8B8"}),(0,s.createElement)("path",{d:"M16.0395 132.376L18.759 132.376L20.053 121.816L16.0391 121.817L16.0395 132.376Z",fill:"#FFB8B8"}),(0,s.createElement)("path",{d:"M15.4567 134.915L24.0042 134.915C23.9716 130.476 18.2546 131.755 15.4565 131.591L15.4567 134.915Z",fill:"#2F2E41"}),(0,s.createElement)("path",{d:"M4.28218 132.376L7.00167 132.376L8.29564 121.816L4.28174 121.817L4.28218 132.376Z",fill:"#FFB8B8"}),(0,s.createElement)("path",{d:"M3.69937 134.915L12.2469 134.915C12.2142 130.476 6.49728 131.755 3.69922 131.591L3.69937 134.915Z",fill:"#2F2E41"}),(0,s.createElement)("path",{d:"M7.37266 128.688C6.71536 128.507 3.14362 129.056 2.72209 128.335C1.24999 113.483 1.57722 98.9486 4.845 90.9619L16.0806 90.2695C18.5931 94.8863 24.3684 125.522 20.8847 127.385L16.4048 127.546C16.1493 127.554 15.8988 127.474 15.6952 127.318C15.4916 127.163 15.3475 126.941 15.2869 126.691L11.539 105.229C10.6057 103.916 8.77111 127.832 8.46815 127.742C8.42864 128.006 8.29626 128.247 8.09515 128.42C7.89404 128.594 7.63762 128.689 7.37266 128.688Z",fill:"#2F2E41"}),(0,s.createElement)("path",{d:"M4.48843 92.8373C-1.18427 86.8634 2.43414 70.8475 2.25101 71.1881C2.26655 70.7958 3.55141 64.7536 6.87506 63.762C9.51196 62.886 12.4305 65.5063 12.7906 68.1566L16.7406 91.6368C16.7611 91.7646 16.7514 91.8955 16.7123 92.0188C16.6733 92.1422 16.6059 92.2546 16.5158 92.3469C16.71 92.9556 4.76613 92.7153 4.48843 92.8373Z",className:"fill-theme-color"}),(0,s.createElement)("path",{d:"M6.32941 55.5845C6.82759 55.2675 7.07312 54.7238 7.36309 54.2285C8.89053 53.3522 10.6464 55.472 12.262 54.6809C16.8302 50.2665 12.1346 48.9642 7.92721 48.7314C6.9333 48.6081 6.08781 48.963 5.33637 49.5492C-3.06805 48.9031 0.962591 60.1519 6.26679 61.6376C7.2033 62.0505 7.90582 61.2148 7.07994 60.4551C5.93728 59.2493 4.52181 56.8221 6.32941 55.5845Z",fill:"#2F2E41"}),(0,s.createElement)("path",{d:"M93.5621 50.4922H32.779C31.7793 50.4936 30.8209 50.894 30.1139 51.6056C29.407 52.3172 29.0092 53.2819 29.0078 54.2882V131.548C29.0092 132.555 29.407 133.52 30.1139 134.231C30.8209 134.943 31.7793 135.343 32.779 135.345H93.5621C94.5619 135.343 95.5202 134.943 96.2272 134.231C96.9341 133.52 97.3319 132.555 97.3333 131.548V54.2882C97.3319 53.2819 96.9341 52.3172 96.2272 51.6056C95.5202 50.894 94.5619 50.4936 93.5621 50.4922ZM96.8896 131.548C96.8886 132.436 96.5376 133.288 95.9138 133.916C95.29 134.544 94.4443 134.897 93.5621 134.898H32.779C31.8968 134.897 31.0511 134.544 30.4273 133.916C29.8035 133.288 29.4526 132.436 29.4515 131.548V54.2882C29.4526 53.4002 29.8035 52.5489 30.4273 51.921C31.0511 51.2931 31.8968 50.9399 32.779 50.9388H93.5621C94.4443 50.9399 95.29 51.2931 95.9138 51.921C96.5376 52.5489 96.8886 53.4002 96.8896 54.2882V131.548Z",fill:"#3F3D56"}),(0,s.createElement)("path",{d:"M15.6527 83.0043C13.6494 83.2327 12.7698 78.5402 12.0039 77.3445L15.9936 75.7852L17.2918 78.1751L28.168 78.4472C28.2326 78.3591 28.3032 78.2755 28.3793 78.1971C30.5362 75.9238 34.0488 79.33 31.9 81.5984C31.663 81.8519 31.3752 82.0521 31.0557 82.1855C30.7362 82.319 30.3923 82.3828 30.0465 82.3727C29.7007 82.3627 29.361 82.2789 29.0497 82.1271C28.7384 81.9753 28.4626 81.7588 28.2405 81.4918C27.9719 81.5111 15.9153 83.0114 15.6527 83.0043Z",fill:"#FFB8B8"}),(0,s.createElement)("path",{d:"M12.6985 80.7664C12.0314 81.4133 6.91061 72.3318 6.5365 72.0751C3.94893 68.0267 10.0405 64.0298 12.6727 68.0562L17.9961 76.2911C18.1402 76.5145 18.1904 76.7864 18.1356 77.047C18.0808 77.3076 17.9255 77.5357 17.7039 77.6812C17.4613 77.7956 12.8697 81.0123 12.6985 80.7664Z",className:"fill-theme-color"}),(0,s.createElement)("path",{d:"M81.583 103.974H44.7583C40.9966 103.955 40.9809 98.1877 44.7584 98.168H81.583C85.3421 98.1857 85.3624 103.954 81.583 103.974Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M81.583 114.692H44.7583C40.9966 114.674 40.9809 108.906 44.7584 108.887H81.583C85.3421 108.904 85.3624 114.673 81.583 114.692Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M81.583 125.411H44.7583C40.9966 125.393 40.9809 119.625 44.7584 119.605H81.583C85.3421 119.623 85.3624 125.391 81.583 125.411Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M95.3371 57.6387C94.1963 57.6387 93.0812 57.2982 92.1327 56.6603C91.1842 56.0223 90.4449 55.1156 90.0084 54.0548C89.5718 52.9939 89.4576 51.8266 89.6802 50.7004C89.9027 49.5742 90.452 48.5397 91.2587 47.7278C92.0653 46.9159 93.093 46.3629 94.2118 46.1389C95.3307 45.9149 96.4904 46.0299 97.5443 46.4693C98.5982 46.9087 99.499 47.6528 100.133 48.6076C100.767 49.5623 101.105 50.6848 101.105 51.833C101.103 53.3723 100.495 54.8479 99.4136 55.9363C98.3323 57.0247 96.8662 57.637 95.3371 57.6387Z",className:"fill-theme-color"}),(0,s.createElement)("path",{d:"M97.999 51.6121H95.5588V48.821C95.5588 48.7617 95.5355 48.7049 95.4939 48.6631C95.4523 48.6212 95.3958 48.5977 95.337 48.5977C95.2782 48.5977 95.2217 48.6212 95.1801 48.6631C95.1385 48.7049 95.1152 48.7617 95.1152 48.821V51.6121H92.675C92.6161 51.6121 92.5597 51.6357 92.5181 51.6775C92.4765 51.7194 92.4531 51.7762 92.4531 51.8354C92.4531 51.8947 92.4765 51.9515 92.5181 51.9933C92.5597 52.0352 92.6161 52.0587 92.675 52.0587H95.1152V54.8499C95.1152 54.9091 95.1385 54.9659 95.1801 55.0078C95.2217 55.0497 95.2782 55.0732 95.337 55.0732C95.3958 55.0732 95.4523 55.0497 95.4939 55.0078C95.5355 54.9659 95.5588 54.9091 95.5588 54.8499V52.0587H97.999C98.0579 52.0587 98.1143 52.0352 98.1559 51.9933C98.1975 51.9515 98.2209 51.8947 98.2209 51.8354C98.2209 51.7762 98.1975 51.7194 98.1559 51.6775C98.1143 51.6357 98.0579 51.6121 97.999 51.6121Z",fill:"white"}),(0,s.createElement)("path",{d:"M80.9177 91.2002H45.424C44.4535 91.1991 43.5232 90.8105 42.837 90.1198C42.1508 89.4291 41.7648 88.4926 41.7637 87.5158V67.5086C41.7648 66.5318 42.1508 65.5953 42.837 64.9046C43.5232 64.2139 44.4535 63.8253 45.424 63.8242H80.9177C81.8882 63.8253 82.8185 64.2139 83.5047 64.9046C84.1909 65.5953 84.5769 66.5318 84.578 67.5086V87.5158C84.5769 88.4926 84.1909 89.4291 83.5047 90.1198C82.8185 90.8105 81.8882 91.1991 80.9177 91.2002Z",className:"fill-theme-color"})),(0,s.createElement)("defs",null,(0,s.createElement)("clipPath",{id:"clip0"},(0,s.createElement)("rect",{width:"199",height:"148",fill:"white",transform:"translate(0.5)"}))));var A=o(32490);const z=["obw/basics","obw/grow"],R=()=>(0,s.createElement)("div",{className:"woocommerce-admin__business-details__free-badge"},(0,r.__)("Free","woocommerce")),L=e=>{let{onChange:t,description:o,isChecked:r}=e;return(0,s.createElement)("div",{className:"woocommerce-admin__business-details__selective-extensions-bundle__extension"},(0,s.createElement)(h.CheckboxControl,{id:"woocommerce-business-extensions__checkbox",checked:r,onChange:t}),(0,s.createElement)("p",{className:"woocommerce-admin__business-details__selective-extensions-bundle__description",dangerouslySetInnerHTML:(0,A.ZP)(o),onClick:e=>{const t=e.target.closest("a");t&&e.currentTarget.contains(t)&&t.href.startsWith("https://woocommerce.com/products/")&&(0,d.recordEvent)("storeprofiler_store_business_features_link_click",{extension_name:t.href.split("https://woocommerce.com/products/")[1]})}}),(0,s.createElement)(R,null))},D=e=>{let{isResolving:t,title:o,extensions:r,installExtensionOptions:n,onCheckboxChange:i}=e;return t?(0,s.createElement)("div",null,(0,s.createElement)(h.Spinner,null)):0===r.length?null:(0,s.createElement)("div",null,(0,s.createElement)("div",{className:"woocommerce-admin__business-details__selective-extensions-bundle__category"},o),r.map((e=>{let{description:t,key:o}=e;return(0,s.createElement)(L,{key:o,description:t,isChecked:n[o],onChange:i(o)})})))},U=e=>{let{isInstallingActivating:t,onSubmit:o,setInstallExtensionOptions:n,installableExtensions:i,installExtensionOptions:a={install_extensions:!0}}=e;const[l,c]=(0,s.useState)(!1);(0,s.useEffect)((()=>{t||0===i.length||n(((e,t)=>e.reduce(((e,t)=>{const o=t.plugins.reduce(((t,o)=>e.hasOwnProperty(o.key)?t:{...t,[o.key]:!0}),{});return{...e,...o}}),t))(i,a))}),[i]);const p=e=>t=>{const o={...a,[e]:t},s=1===Object.entries(o).filter((e=>{let[,t]=e;return t})).length&&o.install_extensions;n(s?{...o,install_extensions:!1}:{...a,[e]:t,install_extensions:!0})};return(0,s.createElement)("div",{className:"woocommerce-profile-wizard__business-details__free-features"},(0,s.createElement)(h.Card,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__business-details__free-features__illustration"},(0,s.createElement)(B,null)),(0,s.createElement)("div",{className:"woocommerce-admin__business-details__selective-extensions-bundle"},(0,s.createElement)("div",{className:"woocommerce-admin__business-details__selective-extensions-bundle__extension"},(0,s.createElement)(h.CheckboxControl,{checked:a.install_extensions,onChange:e=>{var t,o;n((t=a,o=e,Object.entries(t).reduce(((e,t)=>{let[s]=t;return{...e,[s]:o}}),{})))}}),(0,s.createElement)("p",{className:"woocommerce-admin__business-details__selective-extensions-bundle__description"},(0,r.__)("Add recommended business features to my site","woocommerce")),(0,s.createElement)(h.Button,{className:"woocommerce-admin__business-details__selective-extensions-bundle__expand",disabled:!i||0===i.length,onClick:()=>{c(!l),l||(0,d.recordEvent)("storeprofiler_store_business_features_accordion_click")}},(0,s.createElement)(I.Z,{icon:l?V.Z:F.Z}))),l&&i.map((e=>{let{plugins:t,key:o,title:r}=e;return(0,s.createElement)(D,{key:o,title:r,extensions:t,installExtensionOptions:a,onCheckboxChange:p})}))),(0,s.createElement)("div",{className:"woocommerce-profile-wizard__business-details__free-features__action"},(0,s.createElement)(h.Button,{onClick:()=>{o(a,i)},isBusy:t,disabled:t,isPrimary:!0},(0,r.__)("Continue","woocommerce")))),((e,t)=>{const o=Object.keys(e).filter((t=>e[t]&&"install_extensions"!==t));if(0===o.length)return null;const n=o.reduce(((e,t)=>{const o=m.pluginNames[t];return e.includes(o)?e:[...e,o]}),[]).join(", ");if(t)return(0,s.createElement)("div",{className:"woocommerce-profile-wizard__footnote"},(0,s.createElement)(O.Text,{variant:"caption",as:"p",size:"12",lineHeight:"16px"},(0,r.sprintf)((0,r._n)("Installing the following plugin: %s","Installing the following plugins: %s",o.length,"woocommerce"),n)));const i=(0,r.__)("User accounts are required to use these features.","woocommerce"),a=o.filter((e=>"jetpack"===e||e.includes("woocommerce-services"))),l=a.includes("jetpack")&&(a.includes("woocommerce-services:shipping")||a.includes("woocommerce-services:tax"))?"Jetpack and WooCommerce Shipping & Tax":m.pluginNames[a[0]],c=(0,r.sprintf)((0,r._n)("By installing %s plugin for free you agree to our {{link}}Terms of Service{{/link}}.","By installing %s plugins for free you agree to our {{link}}Terms of Service{{/link}}.",a.length,"woocommerce"),l);return(0,s.createElement)("div",{className:"woocommerce-profile-wizard__footnote"},(0,s.createElement)(O.Text,{variant:"caption",as:"p",size:"12",lineHeight:"16px"},(0,r.sprintf)((0,r._n)("The following plugin will be installed for free: %1$s. %2$s","The following plugins will be installed for free: %1$s. %2$s",o.length,"woocommerce"),n,i)),a.length>0&&(0,s.createElement)(O.Text,{variant:"caption",as:"p",size:"12",lineHeight:"16px"},(0,M.Z)({mixedString:c,components:{link:(0,s.createElement)(_.Link,{href:"https://wordpress.com/tos/",target:"_blank",type:"external"})}})))})(a,t))};var Z=o(15635);const j="business-details",H="business-features",q=e=>["other","brick-mortar","brick-mortar-other","other-woocommerce"].includes(e),G=e=>["other","brick-mortar-other"].includes(e),W="wc-admin-free-features-tab-values";class $ extends s.Component{constructor(e){super(),this.state={isPopoverVisible:!1,isValid:!1,currentTab:"business-details",savedValues:e.initialValues},this.onContinue=this.onContinue.bind(this),this.validate=this.validate.bind(this),this.persistValues=this.persistValues.bind(this),this.persistProfileItems.bind(this),e.trackStepValueChanges(e.step.key,e.initialValues,this.state.savedValues,this.persistValues),e.invalidateResolutionForStoreSelector("getFreeExtensions")}async onContinue(e,t){const{createNotice:o,goToNextStep:s,installAndActivatePlugins:n}=this.props,i=t.reduce(((e,t)=>[...e,...t.plugins.filter((e=>e.is_activated)).map((e=>e.key))]),[]),a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object.keys(e).filter((o=>e[o]&&"install_extensions"!==o&&!t.includes(o))).map(Z.V7).filter(((e,t,o)=>o.indexOf(e)===t))}(e,i),l=(e=>{const t={};for(let[o,s]of Object.entries(e)){o=(0,Z.V7)(o);const e=(0,Z.br)(o);"install_extensions"===o||t[`install_${e}`]||(t[`install_${e}`]=s)}return t})(e);(0,d.recordEvent)("storeprofiler_store_business_features_continue",{all_extensions_installed:Object.values(e).every((e=>e)),...l});const c=[this.persistProfileItems({business_extensions:[...a,...i]})];if(a.length){const t=window.performance.now();c.push(n(a).then((o=>{const s=window.performance.now()-t,r=((e,t)=>{const o=[],s={};for(let[r]of Object.entries(e)){r=(0,Z.V7)(r);const e=(0,Z.br)(r);t&&t.data&&t.data.install_time&&t.data.install_time[r]&&(o.push(e),s[`install_time_${e}`]=(0,Z.Jm)(t.data.install_time[r]))}return s.installed_extensions=o,s.activated_extensions=t&&t.data&&t.data.activated?t.data.activated:[],s})(e,o);(0,d.recordEvent)("storeprofiler_store_business_features_installed_and_activated",{success:!0,total_time:(0,Z.Jm)(s),...r}),(0,f.a)(o)})).catch((e=>{throw(0,d.recordEvent)("storeprofiler_store_business_features_installed_and_activated",{success:!1,failed_extensions:Object.keys(e.data||{}).map((e=>(0,Z.br)(e)))}),(0,f.a)(e),new Error})))}Promise.all(c).then((()=>{s({step:H})})).catch((()=>{o("error",(0,r.__)("There was a problem updating your business details","woocommerce"))}))}async persistValues(){await this.persistProfileItems();try{window.localStorage.setItem(W,JSON.stringify(this.state.savedValues.freeFeaturesTab))}catch(e){this.props.createNotice("error",(0,r.__)("There was a problem saving free features state","woocommerce"))}}async persistProfileItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{updateProfileItems:t,createNotice:o}=this.props,{businessDetailsTab:s={}}=this.state.savedValues,{number_employees:n,other_platform:i,other_platform_name:a,product_count:l,revenue:c,selling_venues:m,setup_client:d}=s,p={number_employees:n,other_platform:i,other_platform_name:"other"===i?a:"",product_count:l,revenue:c,selling_venues:m,setup_client:d,...e};return t(Object.entries(p).reduce(((e,t)=>{let[o,s]=t;return""!==s&&(e[o]=s),e}),{})).catch((()=>{o("error",(0,r.__)("There was a problem updating your business details","woocommerce"))}))}validate(e){const t={};return e.product_count.length||(t.product_count=(0,r.__)("This field is required","woocommerce")),e.selling_venues.length||(t.selling_venues=(0,r.__)("This field is required","woocommerce")),!e.other_platform.length&&G(e.selling_venues)&&(t.other_platform=(0,r.__)("This field is required","woocommerce")),!e.other_platform_name.trim().length&&"other"===e.other_platform&&G(e.selling_venues)&&(t.other_platform_name=(0,r.__)("This field is required","woocommerce")),!e.number_employees.length&&q(e.selling_venues)&&(t.number_employees=(0,r.__)("This field is required","woocommerce")),!e.revenue.length&&q(e.selling_venues)&&(t.revenue=(0,r.__)("This field is required","woocommerce")),0===Object.keys(t).length&&this.setState({isValid:!0}),t}trackBusinessDetailsStep(e){let{number_employees:t,other_platform:o,other_platform_name:s,product_count:r,selling_venues:n,revenue:i,setup_client:a}=e;const{getCurrencyConfig:l}=this.context;(0,d.recordEvent)("storeprofiler_store_business_details_continue_variant",{number_employees:t,already_selling:n,currency:l().code,product_number:r,revenue:i,used_platform:o,used_platform_name:s,setup_client:a,wp_version:(0,p.getSetting)("wpVersion")}),(0,d.recordEvent)("storeprofiler_step_complete",{step:j,wc_version:(0,p.getSetting)("wcVersion")})}getSelectControlProps(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const{className:o,...s}=e(t);return{...s,className:w()(`woocommerce-profile-wizard__${t.replace(/\_/g,"-")}`,o)}}renderBusinessDetailsStep(){const{goToNextStep:e,isInstallingActivating:t,hasInstallActivateError:o}=this.props,{formatAmount:n,getCurrencyConfig:i}=this.context,a=(l=i(),[{key:"0",label:(0,r.__)("I don't have any products yet.","woocommerce")},{key:"1-10",label:N(l,1,10)},{key:"11-100",label:N(l,11,100)},{key:"101-1000",label:N(l,101,1e3)},{key:"1000+",label:N(l,1e3)}]);var l;return(0,s.createElement)(_.Form,{initialValues:this.state.savedValues.businessDetailsTab,onSubmit:t=>{this.props.hasInstallableExtensions?this.setState({savedValues:{...this.state.savedValues,businessDetailsTab:t},currentTab:H}):e({step:H}),this.trackBusinessDetailsStep(t),(0,d.recordEvent)("storeprofiler_step_view",{step:H,wc_version:(0,p.getSetting)("wcVersion")})},onChange:(e,t,o)=>{const s={...this.state.savedValues,businessDetailsTab:t};this.setState({savedValues:s,isValid:o}),this.props.updateCurrentStepValues(this.props.step.key,s)},validate:this.validate},(l=>{let{getInputProps:c,handleSubmit:m,values:d,isValidForm:p}=l;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},(0,s.createElement)(h.__experimentalText,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},(0,r.__)("Tell us about your business","woocommerce")),(0,s.createElement)(h.__experimentalText,{variant:"body",as:"p"},(0,r.__)("We'd love to know if you are just getting started or you already have a business in place.","woocommerce"))),(0,s.createElement)(h.Card,null,(0,s.createElement)(h.CardBody,null,(0,s.createElement)(_.SelectControl,(0,u.Z)({excludeSelectedOptions:!1,label:(0,r.__)("How many products do you plan to display?","woocommerce"),options:a,required:!0},this.getSelectControlProps(c,"product_count"))),(0,s.createElement)(_.SelectControl,(0,u.Z)({excludeSelectedOptions:!1,label:(0,r.__)("Currently selling elsewhere?","woocommerce"),options:E,required:!0},this.getSelectControlProps(c,"selling_venues"))),q(d.selling_venues)&&(0,s.createElement)(_.SelectControl,(0,u.Z)({excludeSelectedOptions:!1,label:(0,r.__)("How many employees do you have?","woocommerce"),options:v,required:!0},this.getSelectControlProps(c,"number_employees"))),q(d.selling_venues)&&(0,s.createElement)(_.SelectControl,(0,u.Z)({excludeSelectedOptions:!1,label:(0,r.__)("What's your current annual revenue?","woocommerce"),options:P(i(),this.props.settings.woocommerce_default_country,n),required:!0},this.getSelectControlProps(c,"revenue"))),G(d.selling_venues)&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"business-competitors"},(0,s.createElement)(_.SelectControl,(0,u.Z)({excludeSelectedOptions:!1,label:(0,r.__)("Which platform is the store using?","woocommerce"),options:y,required:!0},this.getSelectControlProps(c,"other_platform"))),"other"===d.other_platform&&(0,s.createElement)(_.TextControl,(0,u.Z)({label:(0,r.__)("What is the platform name?","woocommerce"),required:!0},this.getSelectControlProps(c,"other_platform_name")))))),(0,s.createElement)(h.CardFooter,{isBorderless:!0},(0,s.createElement)(h.FlexItem,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__client"},(0,s.createElement)(h.CheckboxControl,(0,u.Z)({label:(0,r.__)("I'm setting up a store for a client","woocommerce")},c("setup_client")))))),(0,s.createElement)(h.CardFooter,{justify:"center"},(0,s.createElement)(h.Button,{isPrimary:!0,onClick:async()=>{await m(),this.persistProfileItems()},disabled:!p,"aria-disabled":!p,isBusy:t},o?(0,r.__)("Retry","woocommerce"):(0,r.__)("Continue","woocommerce")),o&&(0,s.createElement)(h.Button,{onClick:()=>{this.persistProfileItems(),e({step:H})}},(0,r.__)("Continue without installing","woocommerce")))))}))}renderFreeFeaturesStep(){const{isInstallingActivating:e}=this.props,{savedValues:{freeFeaturesTab:t}}=this.state;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},(0,s.createElement)(h.__experimentalText,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},(0,r.__)("Included business features","woocommerce")),(0,s.createElement)(h.__experimentalText,{variant:"body",as:"p"},(0,r.__)("We recommend enhancing your store with these free extensions","woocommerce")),(0,s.createElement)(h.__experimentalText,{variant:"body",as:"p"},(0,r.__)("No commitment required - you can remove them at any time.","woocommerce"))),(0,s.createElement)(U,{isInstallingActivating:e,onSubmit:this.onContinue,installableExtensions:this.props.installableExtensions,installExtensionOptions:t.installExtensionOptions,setInstallExtensionOptions:e=>{const o={...this.state.savedValues,freeFeaturesTab:{...t,installExtensionOptions:e}};this.setState({savedValues:o}),this.state.savedValues.freeFeaturesTab.installExtensionOptions&&this.props.updateCurrentStepValues(this.props.step.key,o)}}))}render(){const e=[];return this.props.hasFinishedGetFreeExtensionsResolution?(e.push({name:this.state.currentTab===j?"current-tab":j,id:j,title:(0,r.__)("Business details","woocommerce")}),this.props.hasInstallableExtensions&&e.push({name:this.state.currentTab===H?"current-tab":H,id:H,title:(0,r.__)("Free features","woocommerce"),className:this.state.isValid?"":"is-disabled"}),(0,s.createElement)(h.TabPanel,{activeClass:"is-active",initialTabName:"current-tab",onSelect:e=>{this.state.currentTab!==e&&"current-tab"!==e&&(this.setState({currentTab:e,savedValues:this.state.savedValues||this.props.initialValues}),(0,d.recordEvent)("storeprofiler_step_view",{step:e,wc_version:(0,p.getSetting)("wcVersion")}))},tabs:e},(e=>(0,s.createElement)(s.Fragment,null,this.getTab(e.id))))):(0,s.createElement)("div",{className:"woocommerce-admin__business-details__spinner"},(0,s.createElement)(h.Spinner,null))}getTab(e){return e===j?this.renderBusinessDetailsStep():this.renderFreeFeaturesStep()}}$.contextType=C.$;const J=(0,i.compose)((0,l.withSelect)((e=>{const{getSettings:t,getSettingsError:o}=e(m.SETTINGS_STORE_NAME),{getProfileItems:s,getOnboardingError:r,getFreeExtensions:n,hasFinishedResolution:i}=e(m.ONBOARDING_STORE_NAME),{getPluginsError:a,isPluginsRequesting:l}=e(m.PLUGINS_STORE_NAME),{general:c={}}=t("general"),d=n(),p=s(),u=c.woocommerce_default_country?c.woocommerce_default_country:null,h=d?(e=>{let{freeExtensionBundleByCategory:t,country:o,productTypes:s}=e;return t.filter((e=>(window.wcAdminFeatures&&window.wcAdminFeatures.subscriptions&&"US"===(0,b.so)(o)&&s.includes("subscriptions")&&(e.plugins=e.plugins.filter((e=>"woocommerce-payments"!==e.key||"woocommerce-payments"===e.key&&!e.is_activated))),z.includes(e.key))))})({freeExtensionBundleByCategory:d,country:u,productTypes:p.product_types}):[],_=h.some((e=>{let{plugins:t}=e;return t.length>0}));return{hasInstallActivateError:a("installPlugins")||a("activatePlugins"),hasInstallableExtensions:_,hasFinishedGetFreeExtensionsResolution:i("getFreeExtensions"),installableExtensions:h,isError:Boolean(r("updateProfileItems")),isSettingsError:Boolean(o("general")),isInstallingActivating:l("installPlugins")||l("activatePlugins")||l("getJetpackConnectUrl"),profileItems:p,settings:c}})),(0,l.withDispatch)((e=>{const{updateProfileItems:t,invalidateResolutionForStoreSelector:o}=e(m.ONBOARDING_STORE_NAME),{installAndActivatePlugins:s}=e(m.PLUGINS_STORE_NAME),{createNotice:r}=e("core/notices");return{createNotice:r,installAndActivatePlugins:s,updateProfileItems:t,invalidateResolutionForStoreSelector:o}})))($),Y=e=>{const{profileItems:t,isLoading:o}=(0,l.useSelect)((e=>({isLoading:!e(m.ONBOARDING_STORE_NAME).hasFinishedResolution("getProfileItems")||!e(m.SETTINGS_STORE_NAME).hasFinishedResolution("getSettings",["general"]),profileItems:e(m.ONBOARDING_STORE_NAME).getProfileItems()}))),r=(0,s.useMemo)((()=>{try{const e=JSON.parse(window.localStorage.getItem(W));if(e)return e}catch(e){}return{install_extensions:!0}}),[]);if(o)return(0,s.createElement)("div",{className:"woocommerce-admin__business-details__spinner"},(0,s.createElement)(h.Spinner,null));const n={businessDetailsTab:{number_employees:t.number_employees||"",other_platform:t.other_platform||"",other_platform_name:t.other_platform_name||"",product_count:t.product_count||"",selling_venues:t.selling_venues||"",revenue:t.revenue||"",setup_client:t.setup_client||!1},freeFeaturesTab:r};return(0,s.createElement)(J,(0,u.Z)({},e,{initialValues:n}))};var K=o(79205);const Q=(0,K.O3)("onboarding",{});class X extends s.Component{constructor(e){let t=(0,a.get)(e,"profileItems",{}).industry||[];const{locationSettings:o}=e;if("US"!==(0,b.w)(o.woocommerce_default_country)){const e="cbd-other-hemp-derived-products";t=t.filter((t=>e!==t&&e!==t.slug))}super(),this.state={error:null,selected:t,textInputListContent:{}},this.onContinue=this.onContinue.bind(this),this.onIndustryChange=this.onIndustryChange.bind(this),this.onDetailChange=this.onDetailChange.bind(this);const s=this.getSelectedSlugs();e.trackStepValueChanges(e.step.key,s,s,this.onContinue)}getSelectedSlugs(){return this.state.selected.map((e=>e.slug))}componentDidUpdate(){this.props.updateCurrentStepValues(this.props.step.key,this.getSelectedSlugs())}async onContinue(){if(await this.validateField(),this.state.error)return;const{createNotice:e,isError:t,updateProfileItems:o}=this.props,s=this.state.selected.map((e=>e.slug)),n=this.state.selected.map((e=>e.detail)).filter((e=>e)).join(",");return(0,d.recordEvent)("storeprofiler_store_industry_continue",{store_industry:s,industries_with_detail:n}),await o({industry:this.state.selected}),!t||(e("error",(0,r.__)("There was a problem updating your industries","woocommerce")),Promise.reject())}async validateField(){const e=this.state.selected.length?null:(0,r.__)("Please select at least one industry","woocommerce");this.setState({error:e})}onIndustryChange(e){this.setState((t=>{const o=t.selected,s=(0,a.find)(o,{slug:e});if(s){const o=t.textInputListContent;return o[e]=s.detail,{selected:(0,a.filter)(t.selected,(t=>t.slug!==e))||[],textInputListContent:o}}return o.push({slug:e,detail:t.textInputListContent[e]}),{selected:o}}),(()=>this.validateField()))}onDetailChange(e,t){this.setState((o=>{const s=o.selected,r=o.textInputListContent;return s[(0,a.findIndex)(s,{slug:t})].detail=e,r[t]=e,{selected:s,textInputListContent:r}}))}renderIndustryLabel(e,t,o){const{textInputListContent:r}=this.state;return(0,s.createElement)(s.Fragment,null,t.label,t.use_description&&o&&(0,s.createElement)(_.TextControl,{key:`text-control-${e}`,label:t.description_label,value:o.detail||r[e]||"",onChange:t=>this.onDetailChange(t,e),className:"woocommerce-profile-wizard__text"}))}render(){const{industries:e}=Q,{error:t,selected:o}=this.state,{locationSettings:n,isProfileItemsRequesting:i}=this.props,l=(0,b.w)(n.woocommerce_default_country),c=Object.keys(e),m="US"===l?c:c.filter((e=>"cbd-other-hemp-derived-products"!==e));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},(0,s.createElement)(O.Text,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},(0,r.__)("In which industry does the store operate?","woocommerce")),(0,s.createElement)(O.Text,{variant:"body",as:"p"},(0,r.__)("Choose any that apply","woocommerce"))),(0,s.createElement)(h.Card,null,(0,s.createElement)(h.CardBody,{size:null},(0,s.createElement)("div",{className:"woocommerce-profile-wizard__checkbox-group"},m.map((t=>{const r=(0,a.find)(o,{slug:t});return(0,s.createElement)(h.CheckboxControl,{key:`checkbox-control-${t}`,label:this.renderIndustryLabel(t,e[t],r),onChange:()=>this.onIndustryChange(t),checked:r||!1,className:"woocommerce-profile-wizard__checkbox"})})),t&&(0,s.createElement)("span",{className:"woocommerce-profile-wizard__error"},t))),(0,s.createElement)(h.CardFooter,{isBorderless:!0,justify:"center"},(0,s.createElement)(h.Button,{isPrimary:!0,onClick:()=>{this.onContinue().then(this.props.goToNextStep)},isBusy:i,disabled:!o.length||i,"aria-disabled":!o.length||i},(0,r.__)("Continue","woocommerce")))))}}const ee=(0,i.compose)((0,l.withSelect)((e=>{const{getProfileItems:t,getOnboardingError:o,isOnboardingRequesting:s,hasFinishedResolution:r}=e(m.ONBOARDING_STORE_NAME),{getSettings:n,hasFinishedResolution:i}=e(m.SETTINGS_STORE_NAME),{general:a={}}=n("general");return{isError:Boolean(o("updateProfileItems")),profileItems:t(),locationSettings:a,isProfileItemsRequesting:s("updateProfileItems"),isLoading:!r("getProfileItems",[])||!i("getSettings",["general"])}})),(0,l.withDispatch)((e=>{const{updateProfileItems:t}=e(m.ONBOARDING_STORE_NAME),{createNotice:o}=e("core/notices");return{createNotice:o,updateProfileItems:t}})))((e=>e.isLoading?(0,s.createElement)("div",{className:"woocommerce-admin__industry__spinner",style:{textAlign:"center"}},(0,s.createElement)(h.Spinner,null)):(0,s.createElement)(X,e)));var te=o(70444);const oe=(0,s.createElement)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(te.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));function se(e){let{annualPrice:t,description:o,isMonthlyPricing:n,label:i,moreUrl:a,slug:l}=e;const[c,m]=(0,s.useState)("");if(!t)return i;const p=(0,r.__)("This product type requires a paid extension.\nWe'll add this to a cart so that\nyou can purchase and install it later.","woocommerce");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("span",{className:"woocommerce-product-wizard__product-types-label"},i),(0,s.createElement)(h.Button,{isTertiary:!0,label:(0,r.__)("Learn more about recommended free business features","woocommerce"),onClick:()=>{m(!0)}},(0,s.createElement)(I.Z,{icon:oe})),c&&(0,s.createElement)(h.Popover,{focusOnMount:"container",position:"top center",onClose:()=>m(!1)},(0,M.Z)({mixedString:o+(a?" {{moreLink/}}":""),components:{moreLink:a?(0,s.createElement)(_.Link,{href:a,target:"_blank",type:"external",onClick:()=>(0,d.recordEvent)("storeprofiler_store_product_type_learn_more",{product_type:l})},(0,r.__)("Learn more","woocommerce")):""}})),(0,s.createElement)(h.Tooltip,{text:p,position:"bottom center"},(0,s.createElement)(_.Pill,null,(0,s.createElement)("span",{className:"screen-reader-text"},p),n?(0,r.sprintf)((0,r.__)("$%f per month","woocommerce"),(t/12).toFixed(2)):(0,r.sprintf)((0,r.__)("$%f per year","woocommerce"),t))))}class re extends s.Component{constructor(){super(),this.state={error:null,isMonthlyPricing:!0,selected:[],isWCPayInstalled:null},this.onContinue=this.onContinue.bind(this),this.onChange=this.onChange.bind(this)}componentDidMount(){const{installedPlugins:e,invalidateResolution:t}=this.props,{isWCPayInstalled:o}=this.state;t("getProductTypes",[]),null===o&&e&&this.setState({isWCPayInstalled:e.includes("woocommerce-payments")})}componentDidUpdate(e,t){const{profileItems:o,productTypes:s}=this.props;if(this.state.selected!==t.selected&&this.props.updateCurrentStepValues(this.props.step.key,this.state.selected),e.productTypes!==s){const e=Object.keys(s).filter((e=>!!s[e].default));this.setState({selected:o.product_types||e},(()=>{this.props.trackStepValueChanges(this.props.step.key,[...this.state.selected],this.state.selected,this.onContinue)}))}}validateField(){const e=this.state.selected.length?null:(0,r.__)("Please select at least one product type","woocommerce");return this.setState({error:e}),!e}onContinue(e){const{selected:t}=this.state,{installedPlugins:o=[]}=this.props;if(!this.validateField())return;const{countryCode:s,createNotice:n,installAndActivatePlugins:i,updateProfileItems:a,productTypes:l}=this.props,c={product_type:t,wcpay_installed:!1},m=[a({product_types:t})];window.wcAdminFeatures&&window.wcAdminFeatures.subscriptions&&"US"===s&&l.subscriptions&&!l.subscriptions.yearly_price&&!o.includes("woocommerce-payments")&&t.includes("subscriptions")&&m.push(i(["woocommerce-payments"]).then((e=>{c.wcpay_installed=!0,e.data&&e.data.install_time&&e.data.install_time["woocommerce-payments"]&&(c.install_time_wcpay=e.data.install_time["woocommerce-payments"]),(0,f.a)(e)})).catch((e=>{throw(0,f.a)(e),new Error}))),Promise.all(m).then((()=>{(0,d.recordEvent)("storeprofiler_store_product_type_continue",c),"function"==typeof e&&e()})).catch((()=>n("error",(0,r.__)("There was a problem updating your product types","woocommerce"))))}onChange(e){this.setState((t=>{if((0,a.includes)(t.selected,e))return{selected:(0,a.filter)(t.selected,(t=>t!==e))||[]};const o=t.selected;return o.push(e),{selected:o}}),(()=>this.validateField()))}render(){const{productTypes:e=[]}=this.props,{error:t,isMonthlyPricing:o,isWCPayInstalled:n,selected:i}=this.state,{countryCode:a,isInstallingActivating:l,isProductTypesRequesting:c,isProfileItemsRequesting:m}=this.props;return c?(0,s.createElement)("div",{className:"woocommerce-profile-wizard__product-types__spinner"},(0,s.createElement)(h.Spinner,null)):(0,s.createElement)("div",{className:"woocommerce-profile-wizard__product-types"},(0,s.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},(0,s.createElement)(O.Text,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},(0,r.__)("What type of products will be listed?","woocommerce")),(0,s.createElement)(O.Text,{variant:"body",as:"p"},(0,r.__)("Choose any that apply","woocommerce"))),(0,s.createElement)(h.Card,null,(0,s.createElement)(h.CardBody,{size:null},Object.keys(e).map((t=>(0,s.createElement)(h.CheckboxControl,{key:t,label:(0,s.createElement)(se,{description:e[t].description,label:e[t].label,annualPrice:e[t].yearly_price,isMonthlyPricing:o,moreUrl:e[t].more_url,slug:t}),onChange:()=>this.onChange(t),checked:i.includes(t),className:"woocommerce-profile-wizard__checkbox"}))),t&&(0,s.createElement)("span",{className:"woocommerce-profile-wizard__error"},t)),(0,s.createElement)(h.CardFooter,{isBorderless:!0,justify:"center"},(0,s.createElement)(h.Button,{isPrimary:!0,onClick:()=>{this.onContinue(this.props.goToNextStep)},isBusy:m||l,disabled:!i.length||m||l,"aria-disabled":!i.length||m||l},(0,r.__)("Continue","woocommerce")))),(0,s.createElement)("div",{className:"woocommerce-profile-wizard__card-help-footnote"},(0,s.createElement)("div",{className:"woocommerce-profile-wizard__product-types-pricing-toggle woocommerce-profile-wizard__checkbox"},(0,s.createElement)("label",{htmlFor:"woocommerce-product-types__pricing-toggle"},(0,s.createElement)(O.Text,{variant:"body",as:"p"},(0,r.__)("Display monthly prices","woocommerce")),(0,s.createElement)(h.FormToggle,{id:"woocommerce-product-types__pricing-toggle",checked:o,onChange:()=>this.setState({isMonthlyPricing:!o})}))),(0,s.createElement)(O.Text,{variant:"caption",size:"12",lineHeight:"16px"},(0,r.__)("Billing is annual. All purchases are covered by our 30 day money back guarantee and include access to support and updates. Extensions will be added to a cart for you to purchase later.","woocommerce")),window.wcAdminFeatures&&window.wcAdminFeatures.subscriptions&&"US"===a&&!n&&e.subscriptions&&!e.subscriptions.yearly_price&&i.includes("subscriptions")&&(0,s.createElement)(O.Text,{variant:"body",size:"12",lineHeight:"16px",as:"p"},(0,r.__)("The following extensions will be added to your site for free: WooCommerce Payments. An account is required to use this feature.","woocommerce"))))}}const ne=(0,i.compose)((0,l.withSelect)((e=>{const{getProfileItems:t,getProductTypes:o,getOnboardingError:s,hasFinishedResolution:r,isOnboardingRequesting:n}=e(m.ONBOARDING_STORE_NAME),{getSettings:i}=e(m.SETTINGS_STORE_NAME),{getInstalledPlugins:a,isPluginsRequesting:l}=e(m.PLUGINS_STORE_NAME),{general:c={}}=i("general");return{isError:Boolean(s("updateProfileItems")),profileItems:t(),isProfileItemsRequesting:n("updateProfileItems"),installedPlugins:a(),isInstallingActivating:l("installPlugins")||l("activatePlugins"),countryCode:(0,b.so)(c.woocommerce_default_country),productTypes:o(),isProductTypesRequesting:!r("getProductTypes")}})),(0,l.withDispatch)((e=>{const{updateProfileItems:t}=e(m.ONBOARDING_STORE_NAME),{createNotice:o}=e("core/notices"),{installAndActivatePlugins:s}=e(m.PLUGINS_STORE_NAME),{invalidateResolution:r}=e(m.ONBOARDING_STORE_NAME);return{createNotice:o,installAndActivatePlugins:s,invalidateResolution:r,updateProfileItems:t}})))(re),ie=e=>{let{onClose:t,onSave:o}=e;const n=(0,r.__)("Save changes?","woocommerce"),i=(0,r.__)("You're about to go to a different step. Do you want to save the changes you've made here so far?","woocommerce"),a=(0,r.__)("Discard","woocommerce"),l=(0,r.__)("Save","woocommerce");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(h.Modal,{title:n,className:"woocommerce-obw-unsaved-changes",onRequestClose:t},(0,s.createElement)("div",{className:"woocommerce-obw-unsaved-changes-modal__wrapper"},(0,s.createElement)("div",{className:"woocommerce-usage-modal__message"},i),(0,s.createElement)("div",{className:"woocommerce-usage-modal__actions"},(0,s.createElement)(h.Button,{onClick:()=>t()},a),(0,s.createElement)(h.Button,{isPrimary:!0,onClick:o},l)))))};class ae extends s.Component{constructor(e){super(e),this.state={showUnsavedChangesModal:!1},this.lastClickedStepKey=null,this.onStepClick=this.onStepClick.bind(this)}shouldWarnForUnsavedChanges(e){if(void 0!==this.props.stepValueChanges[e]){const t=this.props.stepValueChanges[e].initialValues,o=this.props.stepValueChanges[e].currentValues;return Array.isArray(t)&&Array.isArray(o)&&(t.sort(),o.sort()),!(0,a.isEqual)(t,o)}return!1}findCurrentStep(){return this.props.steps.find((e=>e.key===this.props.currentStep))}moveToLastClickedStep(){this.lastClickedStepKey&&((0,c.updateQueryString)({step:this.lastClickedStepKey}),this.lastClickedStepKey=null)}saveCurrentStepChanges(){const e=this.findCurrentStep();if(!e)return null;const t=this.props.stepValueChanges[e.key];"function"==typeof t.onSave&&t.onSave()}renderStepper(){const{currentStep:e,steps:t}=this.props,o=(0,a.filter)(t,(e=>!!e.label)),r=o.findIndex((t=>t.key===e));return o.forEach(((e,t)=>{const s=o[t-1];e.isComplete=e.isComplete||t<r,(!s||s.isComplete||e.isComplete)&&(e.onClick=this.onStepClick)})),(0,s.createElement)(_.Stepper,{steps:o,currentStep:e})}onStepClick(e){const{currentStep:t}=this.props;this.shouldWarnForUnsavedChanges(t)?(this.setState({showUnsavedChangesModal:!0}),this.lastClickedStepKey=e):(0,c.updateQueryString)({step:e})}render(){const e=this.findCurrentStep();return e&&e.label?(0,s.createElement)("div",{className:"woocommerce-profile-wizard__header"},this.state.showUnsavedChangesModal&&(0,s.createElement)(ie,{onClose:()=>{this.setState({showUnsavedChangesModal:!1}),this.moveToLastClickedStep()},onSave:()=>{this.saveCurrentStepChanges(),this.setState({showUnsavedChangesModal:!1}),this.moveToLastClickedStep()}}),this.renderStepper()):null}}var le=o(96483),ce=o(68987),me=o(45350);const de=h.FlexItem||(e=>{let{children:t,align:o}=e;const r={display:"flex","justify-content":o?"center":"flex-start"};return(0,s.createElement)("div",{style:r},t)}),pe=()=>(0,s.createElement)("div",{className:"woocommerce-admin__store-details__spinner"},(0,s.createElement)(h.Spinner,null));class ue extends s.Component{constructor(e){super(e),this.state={showUsageModal:!1,skipping:!1,isSkipSetupPopoverVisible:!1},this.onContinue=this.onContinue.bind(this),this.onSubmit=this.onSubmit.bind(this),this.validateStoreDetails=this.validateStoreDetails.bind(this),this.onFormValueChange=this.onFormValueChange.bind(this),this.changedFormValues={}}componentDidUpdate(){!1===this.props.isLoading&&0===Object.keys(this.changedFormValues).length&&(this.changedFormValues={...this.props.initialValues},this.props.trackStepValueChanges(this.props.step.key,this.props.initialValues,this.changedFormValues,(()=>{this.onContinue(this.changedFormValues)})))}deriveCurrencySettings(e){if(!e)return null;const t=this.context,o=(0,b.so)(e),{currencySymbols:s={},localeInfo:r={}}=(0,K.O3)("onboarding",{});return t.getDataForCountry(o,r,s)}onSubmit(){this.setState({showUsageModal:!0,skipping:!1})}onFormValueChange(e){this.changedFormValues[e.name]=e.value}async onContinue(e){const{createNotice:t,updateProfileItems:o,updateAndPersistSettingsForGroup:s,profileItems:n,settings:i,errorsRef:a}=this.props,l=this.deriveCurrencySettings(e.countryState);this.context.setCurrency(l),(0,d.recordEvent)("storeprofiler_store_details_continue",{store_country:(0,b.so)(e.countryState),derived_currency:l.code,email_signup:e.isAgreeMarketing}),await s("general",{general:{...i,woocommerce_store_address:e.addressLine1,woocommerce_store_address_2:e.addressLine2,woocommerce_default_country:e.countryState,woocommerce_store_city:e.city,woocommerce_store_postcode:e.postCode,woocommerce_currency:l.code,woocommerce_currency_pos:l.symbolPosition,woocommerce_price_thousand_sep:l.thousandSeparator,woocommerce_price_decimal_sep:l.decimalSeparator,woocommerce_price_num_decimals:l.precision}});const c={is_agree_marketing:e.isAgreeMarketing,store_email:e.storeEmail,is_store_country_set:"string"==typeof e.countryState&&""!==e.countryState};if("US"!==(0,b.w)(e.countryState)&&n.industry&&n.industry.length){const e="cbd-other-hemp-derived-products",t=n.industry.filter((t=>e!==t&&e!==t.slug));c.industry=t}let m=[];try{await o(c)}catch(e){var p;null!=e&&null!==(p=e.data)&&void 0!==p&&p.params&&(m=Object.values(e.data.params))}if(!Boolean(a.current.settings)&&!m.length)return!0;t("error",(0,r.__)("There was a problem saving your store details","woocommerce")),m.forEach((e=>t("error",e)))}validateStoreDetails(e){const{getLocale:t}=this.props,o=t(e.countryState),s=(0,ce.Yt)(o)(e);return e.storeEmail&&!(0,le.isEmail)(e.storeEmail)&&(s.storeEmail=(0,r.__)("Invalid email address","woocommerce")),!e.isAgreeMarketing||e.storeEmail&&e.storeEmail.trim().length||(s.storeEmail=(0,r.__)("Please enter your email address to subscribe","woocommerce")),s}render(){const{showUsageModal:e,skipping:t,isSkipSetupPopoverVisible:o}=this.state,{skipProfiler:n,isLoading:i,isBusy:a,initialValues:l,invalidateResolutionForStoreSelector:c}=this.props,m=(0,r.__)("Manual setup is only recommended for\n experienced WooCommerce users or developers.","woocommerce");return i?(0,s.createElement)("div",{className:"woocommerce-profile-wizard__store-details"},(0,s.createElement)(pe,null)):(0,s.createElement)("div",{className:"woocommerce-profile-wizard__store-details"},(0,s.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},(0,s.createElement)(O.Text,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},(0,r.__)("Welcome to WooCommerce","woocommerce")),(0,s.createElement)(O.Text,{variant:"body",as:"p"},(0,r.__)("Tell us where you run your business to help us configure currency, shipping, taxes, and more in a fully automated way.","woocommerce"))),(0,s.createElement)(_.Form,{initialValues:l,onSubmit:this.onSubmit,validate:this.validateStoreDetails,onChange:this.onFormValueChange},(o=>{let{getInputProps:i,handleSubmit:l,values:c,isValidForm:m,setValue:d}=o;return(0,s.createElement)(h.Card,null,e&&(0,s.createElement)(me.Z,{onContinue:()=>{t?n():this.onContinue(c).then((()=>this.props.goToNextStep()))},onClose:()=>this.setState({showUsageModal:!1,skipping:!1})}),(0,s.createElement)(h.CardBody,null,(0,s.createElement)(ce.IO,{getInputProps:i,setValue:d}),(0,s.createElement)(_.TextControl,(0,u.Z)({label:(c.isAgreeMarketing,(0,r.__)("Email address","woocommerce")),required:c.isAgreeMarketing,autoComplete:"email"},i("storeEmail"))),(0,s.createElement)(de,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__newsletter-signup"},(0,s.createElement)(h.CheckboxControl,(0,u.Z)({label:(0,s.createElement)(s.Fragment,null,(0,r.__)("Get tips, product updates and inspiration straight to your mailbox.","woocommerce")," ",(0,s.createElement)("span",{className:"woocommerce-profile-wizard__powered-by-mailchimp"},(0,r.__)("Powered by Mailchimp","woocommerce")))},i("isAgreeMarketing")))))),(0,s.createElement)(h.CardFooter,{justify:"center"},(0,s.createElement)(h.Button,{isPrimary:!0,onClick:l,isBusy:a,disabled:!m||a,"aria-disabled":!m||a},(0,r.__)("Continue","woocommerce"))))})),(0,s.createElement)("div",{className:"woocommerce-profile-wizard__footer"},(0,s.createElement)(h.Button,{isLink:!0,className:"woocommerce-profile-wizard__footer-link",onClick:()=>(c("getTaskLists"),this.setState({showUsageModal:!0,skipping:!0}),!1)},(0,r.__)("Skip setup store details","woocommerce")),(0,s.createElement)(h.Button,{isTertiary:!0,label:m,onClick:()=>this.setState({isSkipSetupPopoverVisible:!0})},(0,s.createElement)(I.Z,{icon:oe})),o&&(0,s.createElement)(h.Popover,{focusOnMount:"container",position:"top center",onClose:()=>this.setState({isSkipSetupPopoverVisible:!1})},m)))}}ue.contextType=C.$;const he=(0,i.compose)((0,l.withSelect)((e=>{const{getSettings:t,getSettingsError:o,isUpdateSettingsRequesting:r}=e(m.SETTINGS_STORE_NAME),{getProfileItems:n,isOnboardingRequesting:i,getEmailPrefill:a,hasFinishedResolution:l}=e(m.ONBOARDING_STORE_NAME),{getLocale:c,getLocales:d,getCountries:p,hasFinishedResolution:u}=e(m.COUNTRIES_STORE_NAME),{isResolving:h}=e(m.OPTIONS_STORE_NAME),_=n(),g=a(),{general:w={}}=t("general"),C=i("updateProfileItems")||r("general")||h("getOption",["woocommerce_allow_tracking"]),f=!(l("getProfileItems")&&l("getEmailPrefill")&&u("getLocales")&&u("getCountries")),y=(0,s.useRef)({settings:null});y.current={settings:o("general")};const v=_.is_store_country_set?w.woocommerce_default_country:"";return p(),d(),{getLocale:c,initialValues:{addressLine1:w.woocommerce_store_address||"",addressLine2:w.woocommerce_store_address_2||"",city:w.woocommerce_store_city||"",countryState:v,postCode:w.woocommerce_store_postcode||"",isAgreeMarketing:"boolean"==typeof _.is_agree_marketing&&_.is_agree_marketing,storeEmail:"string"==typeof _.store_email?_.store_email:g},isLoading:f,profileItems:_,isBusy:C,settings:w,errorsRef:y}})),(0,l.withDispatch)((e=>{const{createNotice:t}=e("core/notices"),{invalidateResolutionForStoreSelector:o,updateProfileItems:s}=e(m.ONBOARDING_STORE_NAME),{updateAndPersistSettingsForGroup:r}=e(m.SETTINGS_STORE_NAME);return{createNotice:t,invalidateResolutionForStoreSelector:o,updateProfileItems:s,updateAndPersistSettingsForGroup:r}})))(ue);var _e=o(86989),ge=o.n(_e),we=o(22629),Ce=o(5833),fe=o(15244),ye=o(7862),ve=o.n(ye);const Ee=e=>{let{children:t,className:o}=e;return(0,p.isWpVersion)("5.8",">=")?(0,s.createElement)("div",{className:o},t):(0,s.createElement)(h.DropZoneProvider,null,(0,s.createElement)("div",{className:o},t))};class be extends s.Component{constructor(){super(),this.state={isUploading:!1},this.handleFilesUpload=this.handleFilesUpload.bind(this),this.handleFilesDrop=this.handleFilesDrop.bind(this)}handleFilesDrop(e){const t=e[0];this.uploadTheme(t)}handleFilesUpload(e){const t=e.target.files[0];this.uploadTheme(t)}uploadTheme(e){const{createNotice:t,onUploadComplete:o}=this.props;this.setState({isUploading:!0});const s=new window.FormData;return s.append("pluginzip",e),ge()({path:"/wc-admin/themes",method:"POST",body:s}).then((e=>{o(e),this.setState({isUploading:!1}),t(e.status,e.message)})).catch((e=>{this.setState({isUploading:!1}),e&&e.message&&t("error",e.message)}))}render(){const{className:e}=this.props,{isUploading:t}=this.state,o=w()("woocommerce-theme-uploader",e,{"is-uploading":t});return(0,s.createElement)(h.Card,{className:o},(0,s.createElement)(Ee,{className:"woocommerce-theme-uploader__dropzone-wrapper"},t?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_.Spinner,null),(0,s.createElement)(_.H,{className:"woocommerce-theme-uploader__title"},(0,r.__)("Uploading theme","woocommerce")),(0,s.createElement)("p",null,(0,r.__)("Your theme is being uploaded","woocommerce"))):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(h.FormFileUpload,{accept:".zip",onChange:this.handleFilesUpload},(0,s.createElement)(fe.Z,null),(0,s.createElement)(_.H,{className:"woocommerce-theme-uploader__title"},(0,r.__)("Upload a theme","woocommerce")),(0,s.createElement)("p",null,(0,r.__)("Drop a theme zip file here to upload","woocommerce"))),(0,s.createElement)(h.DropZone,{label:(0,r.__)("Drop your theme zip file here","woocommerce"),onFilesDrop:this.handleFilesDrop}))))}}be.propTypes={className:ve().string,onUploadComplete:ve().func},be.defaultProps={onUploadComplete:a.noop};const Se=(0,i.compose)((0,l.withDispatch)((e=>{const{createNotice:t}=e("core/notices");return{createNotice:t}})))(be);var ke=o(60298),Ne=o(52260),Te=o(52384),xe=o(24929);const Pe=[{key:"mobile",icon:Ne.Z},{key:"tablet",icon:Te.Z},{key:"desktop",icon:xe.Z}];class Oe extends s.Component{constructor(){super(...arguments),this.state={device:"desktop"},this.handleDeviceClick=this.handleDeviceClick.bind(this)}handleDeviceClick(e){const{theme:t}=this.props;(0,d.recordEvent)("storeprofiler_store_theme_demo_device",{device:e,theme:t.slug}),this.setState({device:e})}render(){const{isBusy:e,onChoose:t,onClose:o,theme:n}=this.props,{demo_url:i,slug:a,title:l}=n,{device:c}=this.state;return(0,s.createElement)("div",{className:"woocommerce-theme-preview"},(0,s.createElement)("div",{className:"woocommerce-theme-preview__toolbar"},(0,s.createElement)(h.Button,{className:"woocommerce-theme-preview__close",onClick:o},(0,s.createElement)(I.Z,{icon:ke.Z})),(0,s.createElement)("div",{className:"woocommerce-theme-preview__theme-name"},(0,M.Z)({mixedString:(0,r.sprintf)((0,r.__)("{{strong}}%s{{/strong}} developed by WooCommerce","woocommerce"),l),components:{strong:(0,s.createElement)("strong",null)}})),(0,s.createElement)("div",{className:"woocommerce-theme-preview__devices"},Pe.map((e=>{const t=e.icon;return(0,s.createElement)(h.Button,{key:e.key,className:w()("woocommerce-theme-preview__device",{"is-selected":e.key===c}),onClick:()=>this.handleDeviceClick(e.key)},(0,s.createElement)(t,null))}))),(0,s.createElement)(h.Button,{isPrimary:!0,onClick:()=>t(a,"preview"),isBusy:e},(0,r.__)("Choose","woocommerce"))),(0,s.createElement)(_.WebPreview,{src:i,title:l,className:`is-${c}`}))}}const Ie=Oe;class Ve extends s.Component{constructor(){super(...arguments),this.state={activeTab:"all",chosen:null,demo:null,uploadedThemes:[]},this.handleUploadComplete=this.handleUploadComplete.bind(this),this.onChoose=this.onChoose.bind(this),this.onClosePreview=this.onClosePreview.bind(this),this.onSelectTab=this.onSelectTab.bind(this),this.openDemo=this.openDemo.bind(this),this.skipStep=this.skipStep.bind(this)}componentDidUpdate(e){const{isError:t,isUpdatingProfileItems:o,createNotice:s}=this.props,{chosen:n}=this.state,i=!o&&e.isUpdatingProfileItems&&!t&&n,a=!o&&e.isRequesting&&t;i&&(this.setState({chosen:null}),this.props.goToNextStep()),a&&(this.setState({chosen:null}),s("error",(0,r.__)("There was a problem selecting your store theme","woocommerce")))}skipStep(){const{activeTheme:e=""}=(0,K.O3)("onboarding",{});(0,d.recordEvent)("storeprofiler_store_theme_skip_step",{activeTheme:e}),this.props.goToNextStep()}onChoose(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const{updateProfileItems:o}=this.props,{is_installed:s,price:r,slug:n}=e,{activeTheme:i=""}=(0,K.O3)("onboarding",{});this.setState({chosen:n}),(0,d.recordEvent)("storeprofiler_store_theme_choose",{theme:n,location:t}),n!==i&&s?this.activateTheme(n):n!==i&&(0,b.wB)(r)<=0?this.installTheme(n):o({theme:n})}installTheme(e){const{createNotice:t}=this.props;ge()({path:"/wc-admin/onboarding/themes/install?theme="+e,method:"POST"}).then((()=>{this.activateTheme(e)})).catch((e=>{this.setState({chosen:null}),t("error",e.message)}))}activateTheme(e){const{createNotice:t,updateProfileItems:o}=this.props;ge()({path:"/wc-admin/onboarding/themes/activate?theme="+e,method:"POST"}).then((s=>{t("success",(0,r.sprintf)((0,r.__)("%s was installed and activated on your site","woocommerce"),s.name)),(0,K.K7)("onboarding",{...(0,K.O3)("onboarding",{}),activeTheme:s.slug}),o({theme:e})})).catch((e=>{this.setState({chosen:null}),t("error",e.message)}))}onClosePreview(){const{demo:e}=this.state;(0,d.recordEvent)("storeprofiler_store_theme_demo_close",{theme:e.slug}),document.body.classList.remove("woocommerce-theme-preview-active"),this.setState({demo:null})}openDemo(e){(0,d.recordEvent)("storeprofiler_store_theme_live_demo",{theme:e.slug}),document.body.classList.add("woocommerce-theme-preview-active"),this.setState({demo:e})}renderTheme(e){const{demo_url:t,has_woocommerce_support:o,image:n,slug:i,title:a}=e,{chosen:l}=this.state,{activeTheme:c=""}=(0,K.O3)("onboarding",{});return(0,s.createElement)(h.Card,{className:"woocommerce-profile-wizard__theme",key:i},(0,s.createElement)(h.CardBody,{size:null},n&&(0,s.createElement)("div",{className:"woocommerce-profile-wizard__theme-image",style:{backgroundImage:`url(${n})`},role:"img","aria-label":a})),(0,s.createElement)(h.CardBody,{className:"woocommerce-profile-wizard__theme-details"},(0,s.createElement)(_.H,{className:"woocommerce-profile-wizard__theme-name"},a,!o&&(0,s.createElement)(h.Tooltip,{text:(0,r.__)("This theme does not support WooCommerce.","woocommerce")},(0,s.createElement)("span",null,(0,s.createElement)(Ce.Z,{role:"img","aria-hidden":"true",focusable:"false"})))),(0,s.createElement)("p",{className:"woocommerce-profile-wizard__theme-status"},this.getThemeStatus(e))),(0,s.createElement)(h.CardFooter,null,i===c?(0,s.createElement)(h.Button,{isPrimary:!0,onClick:()=>this.onChoose(e,"card"),isBusy:l===i,disabled:l===i},(0,r.__)("Continue with my active theme","woocommerce")):(0,s.createElement)(h.Button,{isSecondary:!0,onClick:()=>this.onChoose(e,"card"),isBusy:l===i,disabled:l===i},(0,r.__)("Choose","woocommerce")),t&&(0,s.createElement)(h.Button,{isTertiary:!0,onClick:()=>this.openDemo(e)},(0,r.__)("Live demo","woocommerce"))))}getThemeStatus(e){const{is_installed:t,price:o,slug:s}=e,{activeTheme:n=""}=(0,K.O3)("onboarding",{});return n===s?(0,r.__)("Currently active theme","woocommerce"):t?(0,r.__)("Installed","woocommerce"):(0,b.wB)(o)<=0?(0,r.__)("Free","woocommerce"):(0,r.sprintf)((0,r.__)("%s per year","woocommerce"),(0,we.decodeEntities)(o))}doesActiveThemeSupportWooCommerce(){const{activeTheme:e=""}=(0,K.O3)("onboarding",{}),t=this.getThemes().find((t=>t.slug===e));return t&&t.has_woocommerce_support}onSelectTab(e){(0,d.recordEvent)("storeprofiler_store_theme_navigate",{navigation:e}),this.setState({activeTab:e})}getPriceValue(e){return Number((0,we.decodeEntities)(e).replace(/[^0-9.-]+/g,""))}getThemes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";const{uploadedThemes:t}=this.state,{activeTheme:o="",themes:s=[]}=(0,K.O3)("onboarding",{}),r=[...s.filter((e=>e&&(e.has_woocommerce_support||e.slug===o))),...t];switch(e){case"paid":return r.filter((e=>(0,b.wB)(e.price)>0));case"free":return r.filter((e=>(0,b.wB)(e.price)<=0));default:return r}}handleUploadComplete(e){"success"===e.status&&e.theme_data&&(this.setState({uploadedThemes:[...this.state.uploadedThemes,e.theme_data]}),(0,d.recordEvent)("storeprofiler_store_theme_upload",{theme:e.theme_data.slug}))}render(){const{activeTab:e,chosen:t,demo:o}=this.state,n=this.getThemes(e),i=this.doesActiveThemeSupportWooCommerce();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},(0,s.createElement)(O.Text,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},(0,r.__)("Choose a theme","woocommerce")),(0,s.createElement)(O.Text,{variant:"body",as:"p"},(0,r.__)("Choose how your store appears to customers. And don't worry, you can always switch themes and edit them later.","woocommerce"))),(0,s.createElement)(h.TabPanel,{className:"woocommerce-profile-wizard__themes-tab-panel",activeClass:"is-active",onSelect:this.onSelectTab,tabs:[{name:"all",title:(0,r.__)("All themes","woocommerce")},{name:"paid",title:(0,r.__)("Paid themes","woocommerce")},{name:"free",title:(0,r.__)("Free themes","woocommerce")}]},(()=>(0,s.createElement)("div",{className:"woocommerce-profile-wizard__themes"},n&&n.map((e=>this.renderTheme(e))),(0,s.createElement)(Se,{onUploadComplete:this.handleUploadComplete})))),o&&(0,s.createElement)(Ie,{theme:o,onChoose:()=>this.onChoose(o,"card"),onClose:this.onClosePreview,isBusy:t===o.slug}),i&&(0,s.createElement)("p",{className:"woocommerce-profile-wizard__themes-skip-this-step"},(0,s.createElement)(h.Button,{isLink:!0,className:"woocommerce-profile-wizard__skip",onClick:()=>this.skipStep()},(0,r.__)("Skip this step","woocommerce"))))}}const Fe=(0,i.compose)((0,l.withSelect)((e=>{const{getProfileItems:t,getOnboardingError:o,isOnboardingRequesting:s}=e(m.ONBOARDING_STORE_NAME);return{isError:Boolean(o("updateProfileItems")),isUpdatingProfileItems:s("updateProfileItems"),profileItems:t()}})),(0,l.withDispatch)((e=>{const{updateProfileItems:t}=e(m.ONBOARDING_STORE_NAME),{createNotice:o}=e("core/notices");return{createNotice:o,updateProfileItems:t}})))(Ve);class Me extends s.Component{constructor(e){super(e),this.cachedActivePlugins=e.activePlugins,this.goToNextStep=this.goToNextStep.bind(this),this.trackStepValueChanges=this.trackStepValueChanges.bind(this),this.updateCurrentStepValues=this.updateCurrentStepValues.bind(this),this.stepValueChanges={}}componentDidUpdate(e){const{step:t}=e.query,{step:o}=this.props.query,{isError:s,isGetProfileItemsRequesting:n,createNotice:i}=this.props;!n&&e.isRequesting&&s&&i("error",(0,r.__)("There was a problem finishing the setup wizard","woocommerce")),t!==o&&(window.document.documentElement.scrollTop=0,(0,d.recordEvent)("storeprofiler_step_view",{step:this.getCurrentStep().key,wc_version:(0,p.getSetting)("wcVersion")}))}componentDidMount(){document.body.classList.remove("woocommerce-admin-is-loading"),document.body.classList.add("woocommerce-profile-wizard__body"),document.body.classList.add("woocommerce-admin-full-screen"),document.body.classList.add("is-wp-toolbar-disabled"),(0,d.recordEvent)("storeprofiler_step_view",{step:this.getCurrentStep().key,wc_version:(0,p.getSetting)("wcVersion")})}componentWillUnmount(){document.body.classList.remove("woocommerce-profile-wizard__body"),document.body.classList.remove("woocommerce-admin-full-screen"),document.body.classList.remove("is-wp-toolbar-disabled")}trackStepValueChanges(e,t,o,s){this.stepValueChanges[e]={initialValues:t,currentValues:o,onSave:s}}updateCurrentStepValues(e,t){this.stepValueChanges[e]&&(this.stepValueChanges[e].currentValues=t)}getSteps(){const{profileItems:e}=this.props,t=[];return t.push({key:"store-details",container:he,label:(0,r.__)("Store Details","woocommerce"),isComplete:e.hasOwnProperty("setup_client")&&null!==e.setup_client}),t.push({key:"industry",container:ee,label:(0,r.__)("Industry","woocommerce"),isComplete:e.hasOwnProperty("industry")&&null!==e.industry}),t.push({key:"product-types",container:ne,label:(0,r.__)("Product Types","woocommerce"),isComplete:e.hasOwnProperty("product_types")&&null!==e.product_types}),t.push({key:"business-details",container:Y,label:(0,r.__)("Business Details","woocommerce"),isComplete:e.hasOwnProperty("product_count")&&null!==e.product_count}),t.push({key:"theme",container:Fe,label:(0,r.__)("Theme","woocommerce"),isComplete:e.hasOwnProperty("theme")&&null!==e.theme}),(0,n.applyFilters)("woocommerce_admin_profile_wizard_steps",t)}getCurrentStep(){const{step:e}=this.props.query;return this.getSteps().find((t=>t.key===e))||this.getSteps()[0]}async goToNextStep(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{activePlugins:t}=this.props,o=this.getCurrentStep(),s=this.getSteps().findIndex((e=>e.key===o.key));(0,d.recordEvent)("storeprofiler_step_complete",{step:o.key,wc_version:(0,p.getSetting)("wcVersion"),...e}),this.cachedActivePlugins=t;const r=this.getSteps()[s+1];if(void 0!==r)return(0,c.updateQueryString)({step:r.key});this.completeProfiler()}completeProfiler(){const{activePlugins:e,isJetpackConnected:t,notes:o,updateNote:s,updateProfileItems:r,connectToJetpack:n}=this.props;(0,d.recordEvent)("storeprofiler_complete");const i=e.includes("jetpack")&&!t,a=o.find((e=>"wc-admin-onboarding-profiler-reminder"===e.name));a&&s(a.id,{status:"actioned"}),r({completed:!0}).then((()=>{const e=new URL((0,c.getNewPath)({},"/",{}),window.location.href).href;i?(document.body.classList.add("woocommerce-admin-is-loading"),n((()=>e))):window.location.href=e}))}skipProfiler(){const{createNotice:e,updateProfileItems:t}=this.props;t({skipped:!0}).then((()=>{(0,d.recordEvent)("storeprofiler_store_details_skip"),(0,c.getHistory)().push((0,c.getNewPath)({},"/",{}))})).catch((()=>{e("error",(0,r.__)("There was a problem skipping the setup wizard","woocommerce"))}))}render(){const{query:e}=this.props,t=this.getCurrentStep(),o=t.key,r=(0,s.createElement)(t.container,{query:e,step:t,goToNextStep:this.goToNextStep,skipProfiler:()=>{this.skipProfiler()},trackStepValueChanges:this.trackStepValueChanges,updateCurrentStepValues:this.updateCurrentStepValues}),n=this.getSteps().map((e=>(0,a.pick)(e,["key","label","isComplete"]))),i=`woocommerce-profile-wizard__container ${o}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ae,{currentStep:o,steps:n,stepValueChanges:this.stepValueChanges}),(0,s.createElement)("div",{className:i},r))}}const Be=(0,i.compose)((0,l.withSelect)((e=>{const{getNotes:t}=e(m.NOTES_STORE_NAME),{getProfileItems:o,getOnboardingError:s}=e(m.ONBOARDING_STORE_NAME),{getActivePlugins:r,getPluginsError:n,isJetpackConnected:i}=e(m.PLUGINS_STORE_NAME),a=o(),l=t({page:1,per_page:m.QUERY_DEFAULTS.pageSize,type:"update",status:"unactioned"}),c=r();return{getPluginsError:n,isError:Boolean(s("updateProfileItems")),isJetpackConnected:i(),notes:l,profileItems:a,activePlugins:c}})),(0,l.withDispatch)((e=>{const{connectToJetpackWithFailureRedirect:t,createErrorNotice:o}=e(m.PLUGINS_STORE_NAME),{updateNote:s}=e(m.NOTES_STORE_NAME),{updateOptions:r}=e(m.OPTIONS_STORE_NAME),{updateProfileItems:n}=e(m.ONBOARDING_STORE_NAME),{createNotice:i}=e("core/notices");return{connectToJetpack:e=>{t(e,o,p.getAdminLink)},createNotice:i,updateNote:s,updateOptions:r,updateProfileItems:n}})),(0,K.O3)("plugins")?(0,m.withPluginsHydration)({...(0,K.O3)("plugins"),jetpackStatus:(0,K.O3)("dataEndpoints",{}).jetpackStatus}):a.identity)(Me)},29230:(e,t,o)=>{o.r(t),o.d(t,{default:()=>r});var s=o(69307);const r=e=>{let{}=e;return(0,s.createElement)("div",null,"Settings page")}},15244:(e,t,o)=>{t.Z=function(e){var t=e.size,o=void 0===t?24:t,s=e.onClick,a=(e.icon,e.className),l=function(e,t){if(null==e)return{};var o,s,r=function(e,t){if(null==e)return{};var o,s,r={},n=Object.keys(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,n),c=["gridicon","gridicons-cloud-upload",a,!1,!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",i({className:c,height:o,width:o,onClick:s},l,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M18 9c-.009 0-.017.002-.025.003A6.496 6.496 0 005 9.5a6.5 6.5 0 00.186 1.519C5.123 11.016 5.064 11 5 11a4 4 0 00-4 4c0 1.202.541 2.267 1.38 3h18.593C22.196 17.089 23 15.643 23 14a5 5 0 00-5-5zm-5 4v3h-2v-3H8l4-5 4 5h-3z"})))};var s,r=(s=o(99196))&&s.__esModule?s:{default:s},n=["size","onClick","icon","className"];function i(){return i=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var s in t=arguments[o])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i.apply(this,arguments)}},24929:(e,t,o)=>{t.Z=function(e){var t=e.size,o=void 0===t?24:t,s=e.onClick,a=(e.icon,e.className),l=function(e,t){if(null==e)return{};var o,s,r=function(e,t){if(null==e)return{};var o,s,r={},n=Object.keys(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,n),c=["gridicon","gridicons-computer",a,!1,!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",i({className:c,height:o,width:o,onClick:s},l,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M20 2H4a2 2 0 00-2 2v12a2 2 0 002 2h6v2H7v2h10v-2h-3v-2h6a2 2 0 002-2V4a2 2 0 00-2-2zm0 14H4V4h16v12z"})))};var s,r=(s=o(99196))&&s.__esModule?s:{default:s},n=["size","onClick","icon","className"];function i(){return i=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var s in t=arguments[o])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i.apply(this,arguments)}},5833:(e,t,o)=>{t.Z=function(e){var t=e.size,o=void 0===t?24:t,s=e.onClick,a=(e.icon,e.className),l=function(e,t){if(null==e)return{};var o,s,r=function(e,t){if(null==e)return{};var o,s,r={},n=Object.keys(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,n),c=["gridicon","gridicons-info",a,!!function(e){return 0==e%18}(o)&&"needs-offset",!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",i({className:c,height:o,width:o,onClick:s},l,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})))};var s,r=(s=o(99196))&&s.__esModule?s:{default:s},n=["size","onClick","icon","className"];function i(){return i=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var s in t=arguments[o])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i.apply(this,arguments)}},52260:(e,t,o)=>{t.Z=function(e){var t=e.size,o=void 0===t?24:t,s=e.onClick,a=(e.icon,e.className),l=function(e,t){if(null==e)return{};var o,s,r=function(e,t){if(null==e)return{};var o,s,r={},n=Object.keys(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,n),c=["gridicon","gridicons-phone",a,!1,!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",i({className:c,height:o,width:o,onClick:s},l,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M16 2H8a2 2 0 00-2 2v16a2 2 0 002 2h8a2 2 0 002-2V4a2 2 0 00-2-2zm-3 19h-2v-1h2v1zm3-2H8V5h8v14z"})))};var s,r=(s=o(99196))&&s.__esModule?s:{default:s},n=["size","onClick","icon","className"];function i(){return i=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var s in t=arguments[o])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i.apply(this,arguments)}},52384:(e,t,o)=>{t.Z=function(e){var t=e.size,o=void 0===t?24:t,s=e.onClick,a=(e.icon,e.className),l=function(e,t){if(null==e)return{};var o,s,r=function(e,t){if(null==e)return{};var o,s,r={},n=Object.keys(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(s=0;s<n.length;s++)o=n[s],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,n),c=["gridicon","gridicons-tablet",a,!1,!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",i({className:c,height:o,width:o,onClick:s},l,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M18 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V4a2 2 0 00-2-2zm-5 19h-2v-1h2v1zm5-2H6V5h12v14z"})))};var s,r=(s=o(99196))&&s.__esModule?s:{default:s},n=["size","onClick","icon","className"];function i(){return i=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var s in t=arguments[o])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i.apply(this,arguments)}}}]);
|
i18n/languages/woocommerce.pot
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
# This file is distributed under the same license as the WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: WooCommerce 7.1.0-rc.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2022-
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.6.0\n"
|
15 |
"X-Domain: woocommerce\n"
|
@@ -8672,7 +8672,7 @@ msgid "Invalid coupon code"
|
|
8672 |
msgstr ""
|
8673 |
|
8674 |
#: includes/abstracts/abstract-wc-order.php:1180
|
8675 |
-
#: includes/class-wc-ajax.php:
|
8676 |
#: includes/class-wc-discounts.php:249
|
8677 |
#: src/Internal/Orders/CouponsController.php:62
|
8678 |
msgid "Invalid coupon"
|
@@ -8734,7 +8734,7 @@ msgstr ""
|
|
8734 |
#: includes/abstracts/abstract-wc-order.php:2309
|
8735 |
#: includes/admin/class-wc-admin-dashboard.php:424
|
8736 |
#: includes/admin/list-tables/class-wc-admin-list-table-orders.php:122
|
8737 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
8738 |
#: includes/admin/reports/class-wc-report-downloads.php:87
|
8739 |
#: includes/admin/reports/class-wc-report-downloads.php:221
|
8740 |
#: includes/gateways/paypal/includes/class-wc-gateway-paypal-request.php:310
|
@@ -9683,8 +9683,8 @@ msgstr ""
|
|
9683 |
#: includes/admin/class-wc-admin-attributes.php:336
|
9684 |
#: includes/admin/class-wc-admin-post-types.php:688
|
9685 |
#: includes/admin/class-wc-admin-webhooks-table-list.php:82
|
9686 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
9687 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
9688 |
#: includes/admin/reports/class-wc-report-customer-list.php:163
|
9689 |
#: includes/admin/reports/class-wc-report-stock.php:135
|
9690 |
#: includes/admin/settings/views/html-admin-page-shipping-classes.php:54
|
@@ -10735,8 +10735,8 @@ msgstr ""
|
|
10735 |
|
10736 |
#: includes/admin/class-wc-admin-profile.php:46
|
10737 |
#: includes/admin/class-wc-admin-profile.php:106
|
10738 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10739 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10740 |
#: includes/class-wc-countries.php:685
|
10741 |
#: includes/class-wc-form-handler.php:268
|
10742 |
#: packages/woocommerce-blocks/src/StoreApi/Schemas/V1/AbstractAddressSchema.php:19
|
@@ -10748,8 +10748,8 @@ msgstr ""
|
|
10748 |
|
10749 |
#: includes/admin/class-wc-admin-profile.php:50
|
10750 |
#: includes/admin/class-wc-admin-profile.php:110
|
10751 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10752 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10753 |
#: includes/class-wc-countries.php:692
|
10754 |
#: includes/class-wc-form-handler.php:269
|
10755 |
#: packages/woocommerce-blocks/src/StoreApi/Schemas/V1/AbstractAddressSchema.php:25
|
@@ -10761,8 +10761,8 @@ msgstr ""
|
|
10761 |
|
10762 |
#: includes/admin/class-wc-admin-profile.php:54
|
10763 |
#: includes/admin/class-wc-admin-profile.php:114
|
10764 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10765 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10766 |
#: packages/woocommerce-blocks/src/StoreApi/Schemas/V1/AbstractAddressSchema.php:31
|
10767 |
#: packages/woocommerce-blocks/src/StoreApi/Utilities/OrderController.php:326
|
10768 |
#: packages/woocommerce-blocks/build/checkout.js:46
|
@@ -10772,8 +10772,8 @@ msgstr ""
|
|
10772 |
|
10773 |
#: includes/admin/class-wc-admin-profile.php:58
|
10774 |
#: includes/admin/class-wc-admin-profile.php:118
|
10775 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10776 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10777 |
#: includes/admin/settings/class-wc-settings-general.php:53
|
10778 |
#: includes/rest-api/Controllers/Version2/class-wc-rest-customers-v2-controller.php:215
|
10779 |
#: includes/rest-api/Controllers/Version2/class-wc-rest-customers-v2-controller.php:278
|
@@ -10787,8 +10787,8 @@ msgstr ""
|
|
10787 |
#: includes/admin/class-wc-admin-profile.php:62
|
10788 |
#: includes/admin/class-wc-admin-profile.php:122
|
10789 |
#: includes/admin/class-wc-admin-setup-wizard.php:514
|
10790 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10791 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10792 |
#: includes/admin/settings/class-wc-settings-general.php:62
|
10793 |
#: includes/customizer/class-wc-shop-customizer.php:688
|
10794 |
#: includes/rest-api/Controllers/Version2/class-wc-rest-customers-v2-controller.php:220
|
@@ -10803,8 +10803,8 @@ msgstr ""
|
|
10803 |
#: includes/admin/class-wc-admin-profile.php:66
|
10804 |
#: includes/admin/class-wc-admin-profile.php:126
|
10805 |
#: includes/admin/class-wc-admin-setup-wizard.php:519
|
10806 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10807 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10808 |
#: includes/admin/settings/class-wc-settings-general.php:71
|
10809 |
#: includes/admin/settings/class-wc-settings-tax.php:229
|
10810 |
#: includes/admin/settings/views/html-settings-tax.php:35
|
@@ -10821,8 +10821,8 @@ msgstr ""
|
|
10821 |
#: includes/admin/class-wc-admin-profile.php:70
|
10822 |
#: includes/admin/class-wc-admin-profile.php:130
|
10823 |
#: includes/admin/class-wc-admin-setup-wizard.php:529
|
10824 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10825 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10826 |
#: includes/admin/settings/class-wc-settings-general.php:89
|
10827 |
#: includes/admin/settings/class-wc-settings-tax.php:228
|
10828 |
#: includes/admin/settings/views/html-settings-tax.php:34
|
@@ -10836,8 +10836,8 @@ msgstr ""
|
|
10836 |
#: includes/admin/class-wc-admin-settings.php:657
|
10837 |
#: includes/admin/class-wc-admin-settings.php:682
|
10838 |
#: includes/admin/class-wc-admin-setup-wizard.php:505
|
10839 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10840 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10841 |
#: includes/class-wc-countries.php:707
|
10842 |
#: src/Admin/API/Reports/Customers/Controller.php:613
|
10843 |
#: assets/client/admin/app/index.js:2
|
@@ -10847,8 +10847,8 @@ msgstr ""
|
|
10847 |
|
10848 |
#: includes/admin/class-wc-admin-profile.php:78
|
10849 |
#: includes/admin/class-wc-admin-profile.php:138
|
10850 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10851 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10852 |
#: includes/wc-template-functions.php:2835
|
10853 |
#: templates/cart/shipping-calculator.php:32
|
10854 |
msgid "Select a country / region…"
|
@@ -10856,8 +10856,8 @@ msgstr ""
|
|
10856 |
|
10857 |
#: includes/admin/class-wc-admin-profile.php:81
|
10858 |
#: includes/admin/class-wc-admin-profile.php:141
|
10859 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10860 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10861 |
#: includes/class-wc-countries.php:740
|
10862 |
#: templates/cart/shipping-calculator.php:51
|
10863 |
#: templates/cart/shipping-calculator.php:57
|
@@ -10872,8 +10872,8 @@ msgstr ""
|
|
10872 |
|
10873 |
#: includes/admin/class-wc-admin-profile.php:86
|
10874 |
#: includes/admin/class-wc-admin-profile.php:146
|
10875 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10876 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10877 |
#: includes/class-wc-countries.php:1602
|
10878 |
#: includes/customizer/class-wc-shop-customizer.php:689
|
10879 |
#: packages/woocommerce-blocks/src/StoreApi/Schemas/V1/AbstractAddressSchema.php:73
|
@@ -10886,7 +10886,7 @@ msgstr ""
|
|
10886 |
|
10887 |
#: includes/admin/class-wc-admin-profile.php:90
|
10888 |
#: includes/admin/class-wc-admin-setup-wizard.php:2238
|
10889 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
10890 |
#: includes/class-wc-countries.php:1612
|
10891 |
#: includes/class-wc-form-handler.php:271
|
10892 |
#: templates/myaccount/form-edit-account.php:43
|
@@ -11074,7 +11074,7 @@ msgstr ""
|
|
11074 |
|
11075 |
#. translators: 1: page name 2: page ID
|
11076 |
#: includes/admin/class-wc-admin-settings.php:607
|
11077 |
-
#: includes/class-wc-ajax.php:
|
11078 |
msgid "%1$s (ID: %2$s)"
|
11079 |
msgstr ""
|
11080 |
|
@@ -11122,7 +11122,7 @@ msgstr ""
|
|
11122 |
|
11123 |
#: includes/admin/class-wc-admin-setup-wizard.php:241
|
11124 |
#: includes/admin/class-wc-admin-setup-wizard.php:1020
|
11125 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
11126 |
#: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:99
|
11127 |
#: includes/admin/meta-boxes/views/html-order-shipping.php:22
|
11128 |
#: includes/admin/meta-boxes/views/html-product-data-variations.php:80
|
@@ -11909,7 +11909,7 @@ msgstr ""
|
|
11909 |
#: includes/admin/class-wc-admin-status.php:430
|
11910 |
#: includes/admin/meta-boxes/views/html-order-notes.php:34
|
11911 |
#: includes/admin/views/html-admin-page-status-report.php:677
|
11912 |
-
#: includes/class-wc-ajax.php:
|
11913 |
#: templates/content-widget-reviews.php:38
|
11914 |
msgid "by %s"
|
11915 |
msgstr ""
|
@@ -13304,7 +13304,7 @@ msgid "Date"
|
|
13304 |
msgstr ""
|
13305 |
|
13306 |
#: includes/admin/list-tables/class-wc-admin-list-table-orders.php:125
|
13307 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13308 |
#: src/Internal/Admin/Orders/ListTable.php:563
|
13309 |
msgid "Billing"
|
13310 |
msgstr ""
|
@@ -13390,7 +13390,7 @@ msgstr ""
|
|
13390 |
|
13391 |
#: includes/admin/list-tables/class-wc-admin-list-table-orders.php:430
|
13392 |
#: includes/admin/list-tables/class-wc-admin-list-table-orders.php:431
|
13393 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13394 |
#: includes/admin/meta-boxes/views/html-order-shipping.php:29
|
13395 |
#: includes/admin/settings/class-wc-settings-accounts.php:180
|
13396 |
#: includes/admin/settings/class-wc-settings-accounts.php:192
|
@@ -13570,7 +13570,7 @@ msgid "Browse the Marketplace"
|
|
13570 |
msgstr ""
|
13571 |
|
13572 |
#: includes/admin/meta-boxes/class-wc-meta-box-coupon-data.php:48
|
13573 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13574 |
#: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:87
|
13575 |
#: includes/admin/settings/class-wc-settings-general.php:24
|
13576 |
#: includes/admin/settings/class-wc-settings-page.php:173
|
@@ -13801,96 +13801,96 @@ msgid "Regenerate download permissions"
|
|
13801 |
msgstr ""
|
13802 |
|
13803 |
#. translators: 1: order type 2: order number
|
13804 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13805 |
msgid "%1$s #%2$s details"
|
13806 |
msgstr ""
|
13807 |
|
13808 |
#. translators: %s: payment method
|
13809 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13810 |
msgid "Payment via %s"
|
13811 |
msgstr ""
|
13812 |
|
13813 |
#. translators: 1: date 2: time
|
13814 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13815 |
msgid "Paid on %1$s @ %2$s"
|
13816 |
msgstr ""
|
13817 |
|
13818 |
#. translators: %s: IP address
|
13819 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13820 |
msgid "Customer IP: %s"
|
13821 |
msgstr ""
|
13822 |
|
13823 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13824 |
msgid "Date created:"
|
13825 |
msgstr ""
|
13826 |
|
13827 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13828 |
msgid "h"
|
13829 |
msgstr ""
|
13830 |
|
13831 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13832 |
#: includes/admin/settings/class-wc-settings-products.php:132
|
13833 |
msgid "m"
|
13834 |
msgstr ""
|
13835 |
|
13836 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13837 |
#: assets/client/admin/chunks/analytics-settings.js:1
|
13838 |
msgid "Status:"
|
13839 |
msgstr ""
|
13840 |
|
13841 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13842 |
msgid "Customer payment page →"
|
13843 |
msgstr ""
|
13844 |
|
13845 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13846 |
msgid "Customer:"
|
13847 |
msgstr ""
|
13848 |
|
13849 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13850 |
msgid "View other orders →"
|
13851 |
msgstr ""
|
13852 |
|
13853 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13854 |
msgid "Profile →"
|
13855 |
msgstr ""
|
13856 |
|
13857 |
#. translators: 1: user display name 2: user ID 3: user email
|
13858 |
#. translators: $1: customer name, $2 customer id, $3: customer email
|
13859 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13860 |
#: includes/admin/settings/views/html-keys-edit.php:43
|
13861 |
-
#: includes/class-wc-ajax.php:
|
13862 |
#: src/Internal/Admin/Orders/ListTable.php:537
|
13863 |
msgid "%1$s (#%2$s – %3$s)"
|
13864 |
msgstr ""
|
13865 |
|
13866 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13867 |
#: includes/admin/reports/class-wc-report-downloads.php:198
|
13868 |
msgid "Guest"
|
13869 |
msgstr ""
|
13870 |
|
13871 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13872 |
msgid "Load billing address"
|
13873 |
msgstr ""
|
13874 |
|
13875 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13876 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13877 |
msgid "Address:"
|
13878 |
msgstr ""
|
13879 |
|
13880 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13881 |
msgid "No billing address set."
|
13882 |
msgstr ""
|
13883 |
|
13884 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13885 |
#: includes/class-wc-order.php:2225
|
13886 |
#: templates/checkout/order-receipt.php:38
|
13887 |
#: templates/checkout/thankyou.php:70
|
13888 |
msgid "Payment method:"
|
13889 |
msgstr ""
|
13890 |
|
13891 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13892 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13893 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13894 |
#: includes/admin/meta-boxes/views/html-order-shipping.php:44
|
13895 |
#: includes/admin/meta-boxes/views/html-order-shipping.php:46
|
13896 |
#: src/Internal/Admin/Onboarding/OnboardingIndustries.php:65
|
@@ -13898,44 +13898,44 @@ msgstr ""
|
|
13898 |
msgid "Other"
|
13899 |
msgstr ""
|
13900 |
|
13901 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13902 |
#: includes/class-wc-privacy-exporters.php:308
|
13903 |
msgid "Transaction ID"
|
13904 |
msgstr ""
|
13905 |
|
13906 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13907 |
msgid "Load shipping address"
|
13908 |
msgstr ""
|
13909 |
|
13910 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13911 |
msgid "Copy billing address"
|
13912 |
msgstr ""
|
13913 |
|
13914 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13915 |
msgid "No shipping address set."
|
13916 |
msgstr ""
|
13917 |
|
13918 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13919 |
msgid "Customer provided note:"
|
13920 |
msgstr ""
|
13921 |
|
13922 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13923 |
msgid "Customer provided note"
|
13924 |
msgstr ""
|
13925 |
|
13926 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13927 |
msgid "Customer notes about the order"
|
13928 |
msgstr ""
|
13929 |
|
13930 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13931 |
msgid "Order status is missing."
|
13932 |
msgstr ""
|
13933 |
|
13934 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13935 |
msgid "Payment method is missing."
|
13936 |
msgstr ""
|
13937 |
|
13938 |
-
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:
|
13939 |
msgid "Order date, hour, minute and/or second are missing."
|
13940 |
msgstr ""
|
13941 |
|
@@ -14367,7 +14367,7 @@ msgid "Optional"
|
|
14367 |
msgstr ""
|
14368 |
|
14369 |
#: includes/admin/meta-boxes/views/html-order-notes.php:37
|
14370 |
-
#: includes/class-wc-ajax.php:
|
14371 |
msgid "Delete note"
|
14372 |
msgstr ""
|
14373 |
|
@@ -17253,7 +17253,7 @@ msgid "Generate API key"
|
|
17253 |
msgstr ""
|
17254 |
|
17255 |
#: includes/admin/settings/views/html-keys-edit.php:119
|
17256 |
-
#: includes/class-wc-ajax.php:
|
17257 |
msgid "Revoke key"
|
17258 |
msgstr ""
|
17259 |
|
@@ -18818,58 +18818,58 @@ msgstr ""
|
|
18818 |
msgid "Return to shop"
|
18819 |
msgstr ""
|
18820 |
|
18821 |
-
#: includes/class-wc-ajax.php:
|
18822 |
-
#: includes/class-wc-ajax.php:
|
18823 |
-
#: includes/class-wc-ajax.php:
|
18824 |
-
#: includes/class-wc-ajax.php:
|
18825 |
-
#: includes/class-wc-ajax.php:
|
18826 |
-
#: includes/class-wc-ajax.php:
|
18827 |
-
#: includes/class-wc-ajax.php:
|
18828 |
#: src/Internal/Orders/CouponsController.php:58
|
18829 |
msgid "Invalid order"
|
18830 |
msgstr ""
|
18831 |
|
18832 |
-
#: includes/class-wc-ajax.php:
|
18833 |
#: includes/class-wc-order-item-product.php:72
|
18834 |
msgid "Invalid product ID"
|
18835 |
msgstr ""
|
18836 |
|
18837 |
#. translators: %s product name
|
18838 |
-
#: includes/class-wc-ajax.php:
|
18839 |
msgid "%s is a variable product parent and cannot be added."
|
18840 |
msgstr ""
|
18841 |
|
18842 |
#. translators: %s: error message
|
18843 |
-
#: includes/class-wc-ajax.php:
|
18844 |
#: includes/wc-rest-functions.php:98
|
18845 |
msgid "Error: %s"
|
18846 |
msgstr ""
|
18847 |
|
18848 |
#. translators: %s item name.
|
18849 |
-
#: includes/class-wc-ajax.php:
|
18850 |
msgid "Added line items: %s"
|
18851 |
msgstr ""
|
18852 |
|
18853 |
#. translators: %s fee amount
|
18854 |
-
#: includes/class-wc-ajax.php:
|
18855 |
msgid "%s fee"
|
18856 |
msgstr ""
|
18857 |
|
18858 |
-
#: includes/class-wc-ajax.php:
|
18859 |
msgid "Invalid rate"
|
18860 |
msgstr ""
|
18861 |
|
18862 |
-
#: includes/class-wc-ajax.php:
|
18863 |
msgid "Invalid items"
|
18864 |
msgstr ""
|
18865 |
|
18866 |
#. translators: %1$s: item name %2$s: stock change
|
18867 |
-
#: includes/class-wc-ajax.php:
|
18868 |
msgid "Deleted %1$s and adjusted stock (%2$s)"
|
18869 |
msgstr ""
|
18870 |
|
18871 |
#. translators: %s item name.
|
18872 |
-
#: includes/class-wc-ajax.php:
|
18873 |
#: includes/legacy/api/v1/class-wc-api-resource.php:333
|
18874 |
#: includes/legacy/api/v2/class-wc-api-products.php:468
|
18875 |
#: includes/legacy/api/v2/class-wc-api-products.php:2176
|
@@ -18886,57 +18886,57 @@ msgstr ""
|
|
18886 |
msgid "Deleted %s"
|
18887 |
msgstr ""
|
18888 |
|
18889 |
-
#: includes/class-wc-ajax.php:
|
18890 |
msgid "Order not editable"
|
18891 |
msgstr ""
|
18892 |
|
18893 |
#. translators: $1: Date created, $2 Time created
|
18894 |
-
#: includes/class-wc-ajax.php:
|
18895 |
msgid "added on %1$s at %2$s"
|
18896 |
msgstr ""
|
18897 |
|
18898 |
#. Translators: %d stock amount
|
18899 |
-
#: includes/class-wc-ajax.php:
|
18900 |
msgid "Stock: %d"
|
18901 |
msgstr ""
|
18902 |
|
18903 |
-
#: includes/class-wc-ajax.php:
|
18904 |
msgid "Invalid refund amount"
|
18905 |
msgstr ""
|
18906 |
|
18907 |
-
#: includes/class-wc-ajax.php:
|
18908 |
msgid "Error processing refund. Please try again."
|
18909 |
msgstr ""
|
18910 |
|
18911 |
-
#: includes/class-wc-ajax.php:
|
18912 |
msgid "Description is missing."
|
18913 |
msgstr ""
|
18914 |
|
18915 |
-
#: includes/class-wc-ajax.php:
|
18916 |
msgid "User is missing."
|
18917 |
msgstr ""
|
18918 |
|
18919 |
-
#: includes/class-wc-ajax.php:
|
18920 |
msgid "Permissions is missing."
|
18921 |
msgstr ""
|
18922 |
|
18923 |
-
#: includes/class-wc-ajax.php:
|
18924 |
msgid "You do not have permission to assign API Keys to the selected user."
|
18925 |
msgstr ""
|
18926 |
|
18927 |
-
#: includes/class-wc-ajax.php:
|
18928 |
msgid "API Key updated successfully."
|
18929 |
msgstr ""
|
18930 |
|
18931 |
-
#: includes/class-wc-ajax.php:
|
18932 |
msgid "There was an error generating your API Key."
|
18933 |
msgstr ""
|
18934 |
|
18935 |
-
#: includes/class-wc-ajax.php:
|
18936 |
msgid "API Key generated successfully. Make sure to copy your new keys now as the secret key will be hidden once you leave this page."
|
18937 |
msgstr ""
|
18938 |
|
18939 |
-
#: includes/class-wc-ajax.php:
|
18940 |
#: src/Internal/Admin/ProductReviews/ReviewsCommentsOverrides.php:92
|
18941 |
msgid "Dismiss this notice."
|
18942 |
msgstr ""
|
@@ -31076,18 +31076,18 @@ msgid "Locations outside all other zones"
|
|
31076 |
msgstr ""
|
31077 |
|
31078 |
#. translators: %1$d is the number of products in the cart. %2$s is the cart total
|
31079 |
-
#: packages/woocommerce-blocks/src/BlockTypes/MiniCart.php:
|
31080 |
#: packages/woocommerce-blocks/build/mini-cart-component-frontend.js:5
|
31081 |
msgid "%1$d item in cart, total price of %2$s"
|
31082 |
msgid_plural "%1$d items in cart, total price of %2$s"
|
31083 |
msgstr[0] ""
|
31084 |
msgstr[1] ""
|
31085 |
|
31086 |
-
#: packages/woocommerce-blocks/src/BlockTypes/MiniCart.php:
|
31087 |
msgid "Empty Mini Cart Message"
|
31088 |
msgstr ""
|
31089 |
|
31090 |
-
#: packages/woocommerce-blocks/src/BlockTypes/MiniCart.php:
|
31091 |
#: packages/woocommerce-blocks/assets/js/blocks/checkout/empty-cart/index.js:23
|
31092 |
#: packages/woocommerce-blocks/build/cart.js:52
|
31093 |
#: packages/woocommerce-blocks/build/checkout-frontend.js:4
|
@@ -33277,8 +33277,8 @@ msgid "Net Revenue"
|
|
33277 |
msgstr ""
|
33278 |
|
33279 |
#: src/Admin/API/Reports/Categories/DataStore.php:275
|
33280 |
-
#: src/Admin/API/Reports/Orders/Stats/DataStore.php:
|
33281 |
-
#: src/Admin/API/Reports/Orders/Stats/DataStore.php:
|
33282 |
#: src/Admin/API/Reports/Products/Stats/DataStore.php:186
|
33283 |
#: src/Admin/API/Reports/Products/Stats/DataStore.php:202
|
33284 |
#: src/Admin/API/Reports/Taxes/Stats/DataStore.php:195
|
@@ -36688,20 +36688,20 @@ msgstr ""
|
|
36688 |
msgid "Create the tables first by going to %1$sWooCommerce > Status > Tools%2$s and running %1$sCreate the custom orders tables%2$s."
|
36689 |
msgstr ""
|
36690 |
|
36691 |
-
#: src/Internal/DataStores/Orders/DataSynchronizer.php:
|
36692 |
msgid "⚠ There's one order pending sync from the orders table to the posts table. The feature shouldn't be disabled until this order is synchronized."
|
36693 |
msgid_plural "⚠ There are %1$d orders pending sync from the orders table to the posts table. The feature shouldn't be disabled until these orders are synchronized."
|
36694 |
msgstr[0] ""
|
36695 |
msgstr[1] ""
|
36696 |
|
36697 |
-
#: src/Internal/DataStores/Orders/DataSynchronizer.php:
|
36698 |
msgid "⚠ There's one order pending sync from the posts table to the orders table. The feature shouldn't be disabled until this order is synchronized."
|
36699 |
-
msgid_plural "⚠ There are
|
36700 |
msgstr[0] ""
|
36701 |
msgstr[1] ""
|
36702 |
|
36703 |
#. translators: %s = URL of the custom data stores settings page
|
36704 |
-
#: src/Internal/DataStores/Orders/DataSynchronizer.php:
|
36705 |
msgid "<a href='%s'>Manage orders synchronization</a>"
|
36706 |
msgstr ""
|
36707 |
|
@@ -36828,20 +36828,20 @@ msgstr[1] ""
|
|
36828 |
msgid " <a href='%s'>Manage incompatible plugins</a>"
|
36829 |
msgstr ""
|
36830 |
|
36831 |
-
#: src/Internal/Features/FeaturesController.php:
|
36832 |
msgid "WooCommerce has detected that some of your active plugins are incompatible with currently enabled WooCommerce features. Please <a>review the details</a>."
|
36833 |
msgstr ""
|
36834 |
|
36835 |
-
#: src/Internal/Features/FeaturesController.php:
|
36836 |
-
msgid "You are viewing plugins that are incompatible with currently enabled WooCommerce features."
|
36837 |
msgstr ""
|
36838 |
|
36839 |
#. translators: %s is a feature name.
|
36840 |
-
#: src/Internal/Features/FeaturesController.php:
|
36841 |
-
msgid "You are viewing the plugins that are incompatible with the '%s' feature."
|
36842 |
msgstr ""
|
36843 |
|
36844 |
-
#: src/Internal/Features/FeaturesController.php:
|
36845 |
msgid "<a href='%1$s'>View all plugins</a> - <a href='%2$s'>Manage WooCommerce features</a>"
|
36846 |
msgstr ""
|
36847 |
|
2 |
# This file is distributed under the same license as the WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: WooCommerce 7.1.0-rc.2\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2022-11-03T14:57:16+00:00\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.6.0\n"
|
15 |
"X-Domain: woocommerce\n"
|
8672 |
msgstr ""
|
8673 |
|
8674 |
#: includes/abstracts/abstract-wc-order.php:1180
|
8675 |
+
#: includes/class-wc-ajax.php:1203
|
8676 |
#: includes/class-wc-discounts.php:249
|
8677 |
#: src/Internal/Orders/CouponsController.php:62
|
8678 |
msgid "Invalid coupon"
|
8734 |
#: includes/abstracts/abstract-wc-order.php:2309
|
8735 |
#: includes/admin/class-wc-admin-dashboard.php:424
|
8736 |
#: includes/admin/list-tables/class-wc-admin-list-table-orders.php:122
|
8737 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:186
|
8738 |
#: includes/admin/reports/class-wc-report-downloads.php:87
|
8739 |
#: includes/admin/reports/class-wc-report-downloads.php:221
|
8740 |
#: includes/gateways/paypal/includes/class-wc-gateway-paypal-request.php:310
|
9683 |
#: includes/admin/class-wc-admin-attributes.php:336
|
9684 |
#: includes/admin/class-wc-admin-post-types.php:688
|
9685 |
#: includes/admin/class-wc-admin-webhooks-table-list.php:82
|
9686 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:347
|
9687 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:466
|
9688 |
#: includes/admin/reports/class-wc-report-customer-list.php:163
|
9689 |
#: includes/admin/reports/class-wc-report-stock.php:135
|
9690 |
#: includes/admin/settings/views/html-admin-page-shipping-classes.php:54
|
10735 |
|
10736 |
#: includes/admin/class-wc-admin-profile.php:46
|
10737 |
#: includes/admin/class-wc-admin-profile.php:106
|
10738 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:52
|
10739 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:111
|
10740 |
#: includes/class-wc-countries.php:685
|
10741 |
#: includes/class-wc-form-handler.php:268
|
10742 |
#: packages/woocommerce-blocks/src/StoreApi/Schemas/V1/AbstractAddressSchema.php:19
|
10748 |
|
10749 |
#: includes/admin/class-wc-admin-profile.php:50
|
10750 |
#: includes/admin/class-wc-admin-profile.php:110
|
10751 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:56
|
10752 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:115
|
10753 |
#: includes/class-wc-countries.php:692
|
10754 |
#: includes/class-wc-form-handler.php:269
|
10755 |
#: packages/woocommerce-blocks/src/StoreApi/Schemas/V1/AbstractAddressSchema.php:25
|
10761 |
|
10762 |
#: includes/admin/class-wc-admin-profile.php:54
|
10763 |
#: includes/admin/class-wc-admin-profile.php:114
|
10764 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:60
|
10765 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:119
|
10766 |
#: packages/woocommerce-blocks/src/StoreApi/Schemas/V1/AbstractAddressSchema.php:31
|
10767 |
#: packages/woocommerce-blocks/src/StoreApi/Utilities/OrderController.php:326
|
10768 |
#: packages/woocommerce-blocks/build/checkout.js:46
|
10772 |
|
10773 |
#: includes/admin/class-wc-admin-profile.php:58
|
10774 |
#: includes/admin/class-wc-admin-profile.php:118
|
10775 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:64
|
10776 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:123
|
10777 |
#: includes/admin/settings/class-wc-settings-general.php:53
|
10778 |
#: includes/rest-api/Controllers/Version2/class-wc-rest-customers-v2-controller.php:215
|
10779 |
#: includes/rest-api/Controllers/Version2/class-wc-rest-customers-v2-controller.php:278
|
10787 |
#: includes/admin/class-wc-admin-profile.php:62
|
10788 |
#: includes/admin/class-wc-admin-profile.php:122
|
10789 |
#: includes/admin/class-wc-admin-setup-wizard.php:514
|
10790 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:68
|
10791 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:127
|
10792 |
#: includes/admin/settings/class-wc-settings-general.php:62
|
10793 |
#: includes/customizer/class-wc-shop-customizer.php:688
|
10794 |
#: includes/rest-api/Controllers/Version2/class-wc-rest-customers-v2-controller.php:220
|
10803 |
#: includes/admin/class-wc-admin-profile.php:66
|
10804 |
#: includes/admin/class-wc-admin-profile.php:126
|
10805 |
#: includes/admin/class-wc-admin-setup-wizard.php:519
|
10806 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:72
|
10807 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:131
|
10808 |
#: includes/admin/settings/class-wc-settings-general.php:71
|
10809 |
#: includes/admin/settings/class-wc-settings-tax.php:229
|
10810 |
#: includes/admin/settings/views/html-settings-tax.php:35
|
10821 |
#: includes/admin/class-wc-admin-profile.php:70
|
10822 |
#: includes/admin/class-wc-admin-profile.php:130
|
10823 |
#: includes/admin/class-wc-admin-setup-wizard.php:529
|
10824 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:76
|
10825 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:135
|
10826 |
#: includes/admin/settings/class-wc-settings-general.php:89
|
10827 |
#: includes/admin/settings/class-wc-settings-tax.php:228
|
10828 |
#: includes/admin/settings/views/html-settings-tax.php:34
|
10836 |
#: includes/admin/class-wc-admin-settings.php:657
|
10837 |
#: includes/admin/class-wc-admin-settings.php:682
|
10838 |
#: includes/admin/class-wc-admin-setup-wizard.php:505
|
10839 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:80
|
10840 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:139
|
10841 |
#: includes/class-wc-countries.php:707
|
10842 |
#: src/Admin/API/Reports/Customers/Controller.php:613
|
10843 |
#: assets/client/admin/app/index.js:2
|
10847 |
|
10848 |
#: includes/admin/class-wc-admin-profile.php:78
|
10849 |
#: includes/admin/class-wc-admin-profile.php:138
|
10850 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:84
|
10851 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:143
|
10852 |
#: includes/wc-template-functions.php:2835
|
10853 |
#: templates/cart/shipping-calculator.php:32
|
10854 |
msgid "Select a country / region…"
|
10856 |
|
10857 |
#: includes/admin/class-wc-admin-profile.php:81
|
10858 |
#: includes/admin/class-wc-admin-profile.php:141
|
10859 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:87
|
10860 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:146
|
10861 |
#: includes/class-wc-countries.php:740
|
10862 |
#: templates/cart/shipping-calculator.php:51
|
10863 |
#: templates/cart/shipping-calculator.php:57
|
10872 |
|
10873 |
#: includes/admin/class-wc-admin-profile.php:86
|
10874 |
#: includes/admin/class-wc-admin-profile.php:146
|
10875 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:95
|
10876 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:151
|
10877 |
#: includes/class-wc-countries.php:1602
|
10878 |
#: includes/customizer/class-wc-shop-customizer.php:689
|
10879 |
#: packages/woocommerce-blocks/src/StoreApi/Schemas/V1/AbstractAddressSchema.php:73
|
10886 |
|
10887 |
#: includes/admin/class-wc-admin-profile.php:90
|
10888 |
#: includes/admin/class-wc-admin-setup-wizard.php:2238
|
10889 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:92
|
10890 |
#: includes/class-wc-countries.php:1612
|
10891 |
#: includes/class-wc-form-handler.php:271
|
10892 |
#: templates/myaccount/form-edit-account.php:43
|
11074 |
|
11075 |
#. translators: 1: page name 2: page ID
|
11076 |
#: includes/admin/class-wc-admin-settings.php:607
|
11077 |
+
#: includes/class-wc-ajax.php:1857
|
11078 |
msgid "%1$s (ID: %2$s)"
|
11079 |
msgstr ""
|
11080 |
|
11122 |
|
11123 |
#: includes/admin/class-wc-admin-setup-wizard.php:241
|
11124 |
#: includes/admin/class-wc-admin-setup-wizard.php:1020
|
11125 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:465
|
11126 |
#: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:99
|
11127 |
#: includes/admin/meta-boxes/views/html-order-shipping.php:22
|
11128 |
#: includes/admin/meta-boxes/views/html-product-data-variations.php:80
|
11909 |
#: includes/admin/class-wc-admin-status.php:430
|
11910 |
#: includes/admin/meta-boxes/views/html-order-notes.php:34
|
11911 |
#: includes/admin/views/html-admin-page-status-report.php:677
|
11912 |
+
#: includes/class-wc-ajax.php:1476
|
11913 |
#: templates/content-widget-reviews.php:38
|
11914 |
msgid "by %s"
|
11915 |
msgstr ""
|
13304 |
msgstr ""
|
13305 |
|
13306 |
#: includes/admin/list-tables/class-wc-admin-list-table-orders.php:125
|
13307 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:346
|
13308 |
#: src/Internal/Admin/Orders/ListTable.php:563
|
13309 |
msgid "Billing"
|
13310 |
msgstr ""
|
13390 |
|
13391 |
#: includes/admin/list-tables/class-wc-admin-list-table-orders.php:430
|
13392 |
#: includes/admin/list-tables/class-wc-admin-list-table-orders.php:431
|
13393 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:427
|
13394 |
#: includes/admin/meta-boxes/views/html-order-shipping.php:29
|
13395 |
#: includes/admin/settings/class-wc-settings-accounts.php:180
|
13396 |
#: includes/admin/settings/class-wc-settings-accounts.php:192
|
13570 |
msgstr ""
|
13571 |
|
13572 |
#: includes/admin/meta-boxes/class-wc-meta-box-coupon-data.php:48
|
13573 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:256
|
13574 |
#: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:87
|
13575 |
#: includes/admin/settings/class-wc-settings-general.php:24
|
13576 |
#: includes/admin/settings/class-wc-settings-page.php:173
|
13801 |
msgstr ""
|
13802 |
|
13803 |
#. translators: 1: order type 2: order number
|
13804 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:194
|
13805 |
msgid "%1$s #%2$s details"
|
13806 |
msgstr ""
|
13807 |
|
13808 |
#. translators: %s: payment method
|
13809 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:209
|
13810 |
msgid "Payment via %s"
|
13811 |
msgstr ""
|
13812 |
|
13813 |
#. translators: 1: date 2: time
|
13814 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:234
|
13815 |
msgid "Paid on %1$s @ %2$s"
|
13816 |
msgstr ""
|
13817 |
|
13818 |
#. translators: %s: IP address
|
13819 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:245
|
13820 |
msgid "Customer IP: %s"
|
13821 |
msgstr ""
|
13822 |
|
13823 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:262
|
13824 |
msgid "Date created:"
|
13825 |
msgstr ""
|
13826 |
|
13827 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:265
|
13828 |
msgid "h"
|
13829 |
msgstr ""
|
13830 |
|
13831 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:266
|
13832 |
#: includes/admin/settings/class-wc-settings-products.php:132
|
13833 |
msgid "m"
|
13834 |
msgstr ""
|
13835 |
|
13836 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:273
|
13837 |
#: assets/client/admin/chunks/analytics-settings.js:1
|
13838 |
msgid "Status:"
|
13839 |
msgstr ""
|
13840 |
|
13841 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:278
|
13842 |
msgid "Customer payment page →"
|
13843 |
msgstr ""
|
13844 |
|
13845 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:297
|
13846 |
msgid "Customer:"
|
13847 |
msgstr ""
|
13848 |
|
13849 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:307
|
13850 |
msgid "View other orders →"
|
13851 |
msgstr ""
|
13852 |
|
13853 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:312
|
13854 |
msgid "Profile →"
|
13855 |
msgstr ""
|
13856 |
|
13857 |
#. translators: 1: user display name 2: user ID 3: user email
|
13858 |
#. translators: $1: customer name, $2 customer id, $3: customer email
|
13859 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:325
|
13860 |
#: includes/admin/settings/views/html-keys-edit.php:43
|
13861 |
+
#: includes/class-wc-ajax.php:1673
|
13862 |
#: src/Internal/Admin/Orders/ListTable.php:537
|
13863 |
msgid "%1$s (#%2$s – %3$s)"
|
13864 |
msgstr ""
|
13865 |
|
13866 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:332
|
13867 |
#: includes/admin/reports/class-wc-report-downloads.php:198
|
13868 |
msgid "Guest"
|
13869 |
msgstr ""
|
13870 |
|
13871 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:349
|
13872 |
msgid "Load billing address"
|
13873 |
msgstr ""
|
13874 |
|
13875 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:359
|
13876 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:479
|
13877 |
msgid "Address:"
|
13878 |
msgstr ""
|
13879 |
|
13880 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:359
|
13881 |
msgid "No billing address set."
|
13882 |
msgstr ""
|
13883 |
|
13884 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:425
|
13885 |
#: includes/class-wc-order.php:2225
|
13886 |
#: templates/checkout/order-receipt.php:38
|
13887 |
#: templates/checkout/thankyou.php:70
|
13888 |
msgid "Payment method:"
|
13889 |
msgstr ""
|
13890 |
|
13891 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:441
|
13892 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:443
|
13893 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:659
|
13894 |
#: includes/admin/meta-boxes/views/html-order-shipping.php:44
|
13895 |
#: includes/admin/meta-boxes/views/html-order-shipping.php:46
|
13896 |
#: src/Internal/Admin/Onboarding/OnboardingIndustries.php:65
|
13898 |
msgid "Other"
|
13899 |
msgstr ""
|
13900 |
|
13901 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:453
|
13902 |
#: includes/class-wc-privacy-exporters.php:308
|
13903 |
msgid "Transaction ID"
|
13904 |
msgstr ""
|
13905 |
|
13906 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:468
|
13907 |
msgid "Load shipping address"
|
13908 |
msgstr ""
|
13909 |
|
13910 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:469
|
13911 |
msgid "Copy billing address"
|
13912 |
msgstr ""
|
13913 |
|
13914 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:479
|
13915 |
msgid "No shipping address set."
|
13916 |
msgstr ""
|
13917 |
|
13918 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:507
|
13919 |
msgid "Customer provided note:"
|
13920 |
msgstr ""
|
13921 |
|
13922 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:553
|
13923 |
msgid "Customer provided note"
|
13924 |
msgstr ""
|
13925 |
|
13926 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:554
|
13927 |
msgid "Customer notes about the order"
|
13928 |
msgstr ""
|
13929 |
|
13930 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:578
|
13931 |
msgid "Order status is missing."
|
13932 |
msgstr ""
|
13933 |
|
13934 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:582
|
13935 |
msgid "Payment method is missing."
|
13936 |
msgstr ""
|
13937 |
|
13938 |
+
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:671
|
13939 |
msgid "Order date, hour, minute and/or second are missing."
|
13940 |
msgstr ""
|
13941 |
|
14367 |
msgstr ""
|
14368 |
|
14369 |
#: includes/admin/meta-boxes/views/html-order-notes.php:37
|
14370 |
+
#: includes/class-wc-ajax.php:1479
|
14371 |
msgid "Delete note"
|
14372 |
msgstr ""
|
14373 |
|
17253 |
msgstr ""
|
17254 |
|
17255 |
#: includes/admin/settings/views/html-keys-edit.php:119
|
17256 |
+
#: includes/class-wc-ajax.php:2177
|
17257 |
msgid "Revoke key"
|
17258 |
msgstr ""
|
17259 |
|
18818 |
msgid "Return to shop"
|
18819 |
msgstr ""
|
18820 |
|
18821 |
+
#: includes/class-wc-ajax.php:909
|
18822 |
+
#: includes/class-wc-ajax.php:941
|
18823 |
+
#: includes/class-wc-ajax.php:1031
|
18824 |
+
#: includes/class-wc-ajax.php:1095
|
18825 |
+
#: includes/class-wc-ajax.php:1137
|
18826 |
+
#: includes/class-wc-ajax.php:1199
|
18827 |
+
#: includes/class-wc-ajax.php:1240
|
18828 |
#: src/Internal/Orders/CouponsController.php:58
|
18829 |
msgid "Invalid order"
|
18830 |
msgstr ""
|
18831 |
|
18832 |
+
#: includes/class-wc-ajax.php:963
|
18833 |
#: includes/class-wc-order-item-product.php:72
|
18834 |
msgid "Invalid product ID"
|
18835 |
msgstr ""
|
18836 |
|
18837 |
#. translators: %s product name
|
18838 |
+
#: includes/class-wc-ajax.php:967
|
18839 |
msgid "%s is a variable product parent and cannot be added."
|
18840 |
msgstr ""
|
18841 |
|
18842 |
#. translators: %s: error message
|
18843 |
+
#: includes/class-wc-ajax.php:974
|
18844 |
#: includes/wc-rest-functions.php:98
|
18845 |
msgid "Error: %s"
|
18846 |
msgstr ""
|
18847 |
|
18848 |
#. translators: %s item name.
|
18849 |
+
#: includes/class-wc-ajax.php:987
|
18850 |
msgid "Added line items: %s"
|
18851 |
msgstr ""
|
18852 |
|
18853 |
#. translators: %s fee amount
|
18854 |
+
#: includes/class-wc-ajax.php:1058
|
18855 |
msgid "%s fee"
|
18856 |
msgstr ""
|
18857 |
|
18858 |
+
#: includes/class-wc-ajax.php:1143
|
18859 |
msgid "Invalid rate"
|
18860 |
msgstr ""
|
18861 |
|
18862 |
+
#: includes/class-wc-ajax.php:1244
|
18863 |
msgid "Invalid items"
|
18864 |
msgstr ""
|
18865 |
|
18866 |
#. translators: %1$s: item name %2$s: stock change
|
18867 |
+
#: includes/class-wc-ajax.php:1279
|
18868 |
msgid "Deleted %1$s and adjusted stock (%2$s)"
|
18869 |
msgstr ""
|
18870 |
|
18871 |
#. translators: %s item name.
|
18872 |
+
#: includes/class-wc-ajax.php:1282
|
18873 |
#: includes/legacy/api/v1/class-wc-api-resource.php:333
|
18874 |
#: includes/legacy/api/v2/class-wc-api-products.php:468
|
18875 |
#: includes/legacy/api/v2/class-wc-api-products.php:2176
|
18886 |
msgid "Deleted %s"
|
18887 |
msgstr ""
|
18888 |
|
18889 |
+
#: includes/class-wc-ajax.php:1350
|
18890 |
msgid "Order not editable"
|
18891 |
msgstr ""
|
18892 |
|
18893 |
#. translators: $1: Date created, $2 Time created
|
18894 |
+
#: includes/class-wc-ajax.php:1470
|
18895 |
msgid "added on %1$s at %2$s"
|
18896 |
msgstr ""
|
18897 |
|
18898 |
#. Translators: %d stock amount
|
18899 |
+
#: includes/class-wc-ajax.php:1571
|
18900 |
msgid "Stock: %d"
|
18901 |
msgstr ""
|
18902 |
|
18903 |
+
#: includes/class-wc-ajax.php:1990
|
18904 |
msgid "Invalid refund amount"
|
18905 |
msgstr ""
|
18906 |
|
18907 |
+
#: includes/class-wc-ajax.php:1994
|
18908 |
msgid "Error processing refund. Please try again."
|
18909 |
msgstr ""
|
18910 |
|
18911 |
+
#: includes/class-wc-ajax.php:2098
|
18912 |
msgid "Description is missing."
|
18913 |
msgstr ""
|
18914 |
|
18915 |
+
#: includes/class-wc-ajax.php:2101
|
18916 |
msgid "User is missing."
|
18917 |
msgstr ""
|
18918 |
|
18919 |
+
#: includes/class-wc-ajax.php:2104
|
18920 |
msgid "Permissions is missing."
|
18921 |
msgstr ""
|
18922 |
|
18923 |
+
#: includes/class-wc-ajax.php:2115
|
18924 |
msgid "You do not have permission to assign API Keys to the selected user."
|
18925 |
msgstr ""
|
18926 |
|
18927 |
+
#: includes/class-wc-ajax.php:2141
|
18928 |
msgid "API Key updated successfully."
|
18929 |
msgstr ""
|
18930 |
|
18931 |
+
#: includes/class-wc-ajax.php:2169
|
18932 |
msgid "There was an error generating your API Key."
|
18933 |
msgstr ""
|
18934 |
|
18935 |
+
#: includes/class-wc-ajax.php:2176
|
18936 |
msgid "API Key generated successfully. Make sure to copy your new keys now as the secret key will be hidden once you leave this page."
|
18937 |
msgstr ""
|
18938 |
|
18939 |
+
#: includes/class-wc-ajax.php:2265
|
18940 |
#: src/Internal/Admin/ProductReviews/ReviewsCommentsOverrides.php:92
|
18941 |
msgid "Dismiss this notice."
|
18942 |
msgstr ""
|
31076 |
msgstr ""
|
31077 |
|
31078 |
#. translators: %1$d is the number of products in the cart. %2$s is the cart total
|
31079 |
+
#: packages/woocommerce-blocks/src/BlockTypes/MiniCart.php:368
|
31080 |
#: packages/woocommerce-blocks/build/mini-cart-component-frontend.js:5
|
31081 |
msgid "%1$d item in cart, total price of %2$s"
|
31082 |
msgid_plural "%1$d items in cart, total price of %2$s"
|
31083 |
msgstr[0] ""
|
31084 |
msgstr[1] ""
|
31085 |
|
31086 |
+
#: packages/woocommerce-blocks/src/BlockTypes/MiniCart.php:524
|
31087 |
msgid "Empty Mini Cart Message"
|
31088 |
msgstr ""
|
31089 |
|
31090 |
+
#: packages/woocommerce-blocks/src/BlockTypes/MiniCart.php:526
|
31091 |
#: packages/woocommerce-blocks/assets/js/blocks/checkout/empty-cart/index.js:23
|
31092 |
#: packages/woocommerce-blocks/build/cart.js:52
|
31093 |
#: packages/woocommerce-blocks/build/checkout-frontend.js:4
|
33277 |
msgstr ""
|
33278 |
|
33279 |
#: src/Admin/API/Reports/Categories/DataStore.php:275
|
33280 |
+
#: src/Admin/API/Reports/Orders/Stats/DataStore.php:337
|
33281 |
+
#: src/Admin/API/Reports/Orders/Stats/DataStore.php:391
|
33282 |
#: src/Admin/API/Reports/Products/Stats/DataStore.php:186
|
33283 |
#: src/Admin/API/Reports/Products/Stats/DataStore.php:202
|
33284 |
#: src/Admin/API/Reports/Taxes/Stats/DataStore.php:195
|
36688 |
msgid "Create the tables first by going to %1$sWooCommerce > Status > Tools%2$s and running %1$sCreate the custom orders tables%2$s."
|
36689 |
msgstr ""
|
36690 |
|
36691 |
+
#: src/Internal/DataStores/Orders/DataSynchronizer.php:463
|
36692 |
msgid "⚠ There's one order pending sync from the orders table to the posts table. The feature shouldn't be disabled until this order is synchronized."
|
36693 |
msgid_plural "⚠ There are %1$d orders pending sync from the orders table to the posts table. The feature shouldn't be disabled until these orders are synchronized."
|
36694 |
msgstr[0] ""
|
36695 |
msgstr[1] ""
|
36696 |
|
36697 |
+
#: src/Internal/DataStores/Orders/DataSynchronizer.php:473
|
36698 |
msgid "⚠ There's one order pending sync from the posts table to the orders table. The feature shouldn't be disabled until this order is synchronized."
|
36699 |
+
msgid_plural "⚠ There are %1$d orders pending sync from the posts table to the orders table. The feature shouldn't be disabled until these orders are synchronized."
|
36700 |
msgstr[0] ""
|
36701 |
msgstr[1] ""
|
36702 |
|
36703 |
#. translators: %s = URL of the custom data stores settings page
|
36704 |
+
#: src/Internal/DataStores/Orders/DataSynchronizer.php:493
|
36705 |
msgid "<a href='%s'>Manage orders synchronization</a>"
|
36706 |
msgstr ""
|
36707 |
|
36828 |
msgid " <a href='%s'>Manage incompatible plugins</a>"
|
36829 |
msgstr ""
|
36830 |
|
36831 |
+
#: src/Internal/Features/FeaturesController.php:788
|
36832 |
msgid "WooCommerce has detected that some of your active plugins are incompatible with currently enabled WooCommerce features. Please <a>review the details</a>."
|
36833 |
msgstr ""
|
36834 |
|
36835 |
+
#: src/Internal/Features/FeaturesController.php:831
|
36836 |
+
msgid "You are viewing active plugins that are incompatible with currently enabled WooCommerce features."
|
36837 |
msgstr ""
|
36838 |
|
36839 |
#. translators: %s is a feature name.
|
36840 |
+
#: src/Internal/Features/FeaturesController.php:834
|
36841 |
+
msgid "You are viewing the active plugins that are incompatible with the '%s' feature."
|
36842 |
msgstr ""
|
36843 |
|
36844 |
+
#: src/Internal/Features/FeaturesController.php:840
|
36845 |
msgid "<a href='%1$s'>View all plugins</a> - <a href='%2$s'>Manage WooCommerce features</a>"
|
36846 |
msgstr ""
|
36847 |
|
includes/admin/meta-boxes/class-wc-meta-box-order-data.php
CHANGED
@@ -38,6 +38,13 @@ class WC_Meta_Box_Order_Data {
|
|
38 |
*/
|
39 |
public static function init_address_fields() {
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
self::$billing_fields = apply_filters(
|
42 |
'woocommerce_admin_billing_fields',
|
43 |
array(
|
@@ -90,6 +97,13 @@ class WC_Meta_Box_Order_Data {
|
|
90 |
)
|
91 |
);
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
self::$shipping_fields = apply_filters(
|
94 |
'woocommerce_admin_shipping_fields',
|
95 |
array(
|
@@ -526,6 +540,13 @@ class WC_Meta_Box_Order_Data {
|
|
526 |
}
|
527 |
}
|
528 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
529 |
if ( apply_filters( 'woocommerce_enable_order_notes_field', 'yes' === get_option( 'woocommerce_enable_order_comments', 'yes' ) ) ) :
|
530 |
?>
|
531 |
<p class="form-field form-field-wide">
|
@@ -662,7 +683,7 @@ class WC_Meta_Box_Order_Data {
|
|
662 |
|
663 |
// Customer note.
|
664 |
if ( isset( $_POST['customer_note'] ) ) {
|
665 |
-
$props['customer_note'] =
|
666 |
}
|
667 |
|
668 |
// Save order data.
|
38 |
*/
|
39 |
public static function init_address_fields() {
|
40 |
|
41 |
+
/**
|
42 |
+
* Provides an opportunity to modify the list of order billing fields displayed on the admin.
|
43 |
+
*
|
44 |
+
* @since 1.4.0
|
45 |
+
*
|
46 |
+
* @param array Billing fields.
|
47 |
+
*/
|
48 |
self::$billing_fields = apply_filters(
|
49 |
'woocommerce_admin_billing_fields',
|
50 |
array(
|
97 |
)
|
98 |
);
|
99 |
|
100 |
+
/**
|
101 |
+
* Provides an opportunity to modify the list of order shipping fields displayed on the admin.
|
102 |
+
*
|
103 |
+
* @since 1.4.0
|
104 |
+
*
|
105 |
+
* @param array Shipping fields.
|
106 |
+
*/
|
107 |
self::$shipping_fields = apply_filters(
|
108 |
'woocommerce_admin_shipping_fields',
|
109 |
array(
|
540 |
}
|
541 |
}
|
542 |
|
543 |
+
/**
|
544 |
+
* Allows 3rd parties to alter whether the customer note should be displayed on the admin.
|
545 |
+
*
|
546 |
+
* @since 2.1.0
|
547 |
+
*
|
548 |
+
* @param bool TRUE if the note should be displayed. FALSE otherwise.
|
549 |
+
*/
|
550 |
if ( apply_filters( 'woocommerce_enable_order_notes_field', 'yes' === get_option( 'woocommerce_enable_order_comments', 'yes' ) ) ) :
|
551 |
?>
|
552 |
<p class="form-field form-field-wide">
|
683 |
|
684 |
// Customer note.
|
685 |
if ( isset( $_POST['customer_note'] ) ) {
|
686 |
+
$props['customer_note'] = sanitize_textarea_field( wp_unslash( $_POST['customer_note'] ) );
|
687 |
}
|
688 |
|
689 |
// Save order data.
|
includes/class-wc-ajax.php
CHANGED
@@ -887,6 +887,8 @@ class WC_AJAX {
|
|
887 |
$data['date_created'] = $data['date_created'] ? $data['date_created']->getTimestamp() : null;
|
888 |
$data['date_modified'] = $data['date_modified'] ? $data['date_modified']->getTimestamp() : null;
|
889 |
|
|
|
|
|
890 |
$customer_data = apply_filters( 'woocommerce_ajax_get_customer_details', $data, $customer, $user_id );
|
891 |
wp_send_json( $customer_data );
|
892 |
}
|
887 |
$data['date_created'] = $data['date_created'] ? $data['date_created']->getTimestamp() : null;
|
888 |
$data['date_modified'] = $data['date_modified'] ? $data['date_modified']->getTimestamp() : null;
|
889 |
|
890 |
+
unset( $data['meta_data'] );
|
891 |
+
|
892 |
$customer_data = apply_filters( 'woocommerce_ajax_get_customer_details', $data, $customer, $user_id );
|
893 |
wp_send_json( $customer_data );
|
894 |
}
|
packages/woocommerce-blocks/assets/js/atomic/blocks/product-elements/button/block.js
CHANGED
@@ -162,6 +162,7 @@ const AddToCartButton = ( {
|
|
162 |
aria-label={ buttonAriaLabel }
|
163 |
className={ classnames(
|
164 |
'wp-block-button__link',
|
|
|
165 |
'add_to_cart_button',
|
166 |
'wc-block-components-product-button__button',
|
167 |
colorStyles.className,
|
@@ -206,6 +207,7 @@ const AddToCartButtonPlaceholder = ( {
|
|
206 |
<button
|
207 |
className={ classnames(
|
208 |
'wp-block-button__link',
|
|
|
209 |
'add_to_cart_button',
|
210 |
'wc-block-components-product-button__button',
|
211 |
'wc-block-components-product-button__button--placeholder',
|
162 |
aria-label={ buttonAriaLabel }
|
163 |
className={ classnames(
|
164 |
'wp-block-button__link',
|
165 |
+
'wp-element-button',
|
166 |
'add_to_cart_button',
|
167 |
'wc-block-components-product-button__button',
|
168 |
colorStyles.className,
|
207 |
<button
|
208 |
className={ classnames(
|
209 |
'wp-block-button__link',
|
210 |
+
'wp-element-button',
|
211 |
'add_to_cart_button',
|
212 |
'wc-block-components-product-button__button',
|
213 |
'wc-block-components-product-button__button--placeholder',
|
packages/woocommerce-blocks/assets/js/base/components/form-token-field/style.scss
CHANGED
@@ -16,8 +16,10 @@
|
|
16 |
}
|
17 |
|
18 |
.components-form-token-field__input-container {
|
|
|
19 |
border-radius: 0;
|
20 |
box-shadow: none;
|
|
|
21 |
position: relative;
|
22 |
|
23 |
input[type="text"].components-form-token-field__input {
|
@@ -64,6 +66,7 @@
|
|
64 |
margin-right: 0;
|
65 |
position: relative;
|
66 |
width: 100%;
|
|
|
67 |
}
|
68 |
|
69 |
.components-form-token-field__remove-token.components-button,
|
16 |
}
|
17 |
|
18 |
.components-form-token-field__input-container {
|
19 |
+
background-color: #fff;
|
20 |
border-radius: 0;
|
21 |
box-shadow: none;
|
22 |
+
color: #000;
|
23 |
position: relative;
|
24 |
|
25 |
input[type="text"].components-form-token-field__input {
|
66 |
margin-right: 0;
|
67 |
position: relative;
|
68 |
width: 100%;
|
69 |
+
z-index: 1;
|
70 |
}
|
71 |
|
72 |
.components-form-token-field__remove-token.components-button,
|
packages/woocommerce-blocks/assets/js/base/components/price-slider/style.scss
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
|
2 |
@mixin thumb {
|
3 |
-
background
|
4 |
background-position: 0 0;
|
5 |
box-sizing: content-box;
|
6 |
width: 12px;
|
@@ -13,12 +13,10 @@
|
|
13 |
cursor: pointer;
|
14 |
z-index: 20;
|
15 |
pointer-events: auto;
|
16 |
-
|
17 |
-
transition: transform .2s ease-in-out;
|
18 |
-webkit-appearance: none;
|
19 |
-moz-appearance: none;
|
20 |
appearance: none;
|
21 |
-
|
22 |
&:hover {
|
23 |
@include thumbFocus;
|
24 |
}
|
@@ -26,12 +24,14 @@
|
|
26 |
|
27 |
@mixin thumbFocus {
|
28 |
background: $gray-900;
|
|
|
29 |
}
|
30 |
|
31 |
-
|
32 |
@mixin track {
|
33 |
cursor: default;
|
34 |
-
height: 1px;
|
|
|
35 |
outline: 0;
|
36 |
-webkit-appearance: none;
|
37 |
-moz-appearance: none;
|
@@ -54,7 +54,6 @@
|
|
54 |
|
55 |
.wc-block-components-price-slider {
|
56 |
margin-bottom: $gap-large;
|
57 |
-
|
58 |
&.is-loading.is-disabled {
|
59 |
.wc-block-components-price-slider__range-input-wrapper,
|
60 |
.wc-block-components-filter-reset-button,
|
@@ -62,12 +61,10 @@
|
|
62 |
@include placeholder();
|
63 |
box-shadow: none;
|
64 |
}
|
65 |
-
|
66 |
.wc-block-components-price-slider__amount {
|
67 |
display: none;
|
68 |
}
|
69 |
}
|
70 |
-
|
71 |
&.is-disabled:not(.is-loading) {
|
72 |
.wc-block-components-price-slider__range-input-wrapper,
|
73 |
.wc-block-components-price-slider__amount,
|
@@ -79,7 +76,7 @@
|
|
79 |
|
80 |
.wc-block-components-price-slider__range-input-wrapper {
|
81 |
@include reset;
|
82 |
-
background:
|
83 |
border-radius: 4px;
|
84 |
clear: both;
|
85 |
flex-grow: 1;
|
@@ -87,6 +84,17 @@
|
|
87 |
margin: 15px 0;
|
88 |
position: relative;
|
89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
&.is-loading {
|
91 |
@include placeholder();
|
92 |
height: em(9px);
|
@@ -101,7 +109,7 @@
|
|
101 |
top: 0;
|
102 |
width: 100%;
|
103 |
--track-background: linear-gradient(to right, transparent var(--low), var(--range-color) 0, var(--range-color) var(--high), transparent 0) no-repeat 0 100% / 100% 100%;
|
104 |
-
--range-color:
|
105 |
/*rtl:ignore*/
|
106 |
background: var(--track-background);
|
107 |
}
|
@@ -112,7 +120,6 @@
|
|
112 |
gap: $gap-smaller;
|
113 |
justify-content: space-between;
|
114 |
margin: $gap 0;
|
115 |
-
|
116 |
.wc-block-components-price-slider__amount {
|
117 |
margin: 0;
|
118 |
border-radius: 4px;
|
@@ -121,11 +128,9 @@
|
|
121 |
max-width: 80px;
|
122 |
min-width: 0;
|
123 |
padding: $gap-smaller;
|
124 |
-
|
125 |
.wc-block-components-price-slider--is-input-inline & {
|
126 |
max-width: 60px;
|
127 |
}
|
128 |
-
|
129 |
&.is-loading {
|
130 |
@include placeholder();
|
131 |
border-radius: 0 !important;
|
@@ -146,7 +151,6 @@
|
|
146 |
display: flex;
|
147 |
gap: $gap;
|
148 |
justify-content: flex-end;
|
149 |
-
|
150 |
// The specificity here is needed to overwrite the margin-top that is inherited on WC block template pages such as Shop.
|
151 |
button[type="submit"]:not(.wp-block-search__button).wc-block-components-filter-submit-button {
|
152 |
margin-top: 0;
|
@@ -165,85 +169,66 @@
|
|
165 |
position: absolute;
|
166 |
left: 0;
|
167 |
top: 0;
|
168 |
-
|
169 |
&::-webkit-slider-runnable-track {
|
170 |
@include track;
|
171 |
}
|
172 |
-
|
173 |
&::-webkit-slider-thumb {
|
174 |
@include thumb;
|
175 |
margin: -5px 0 0 0;
|
176 |
}
|
177 |
-
|
178 |
&::-webkit-slider-progress {
|
179 |
@include reset;
|
180 |
}
|
181 |
-
|
182 |
&::-moz-focus-outer {
|
183 |
border: 0;
|
184 |
}
|
185 |
-
|
186 |
&::-moz-range-track {
|
187 |
@include track;
|
188 |
}
|
189 |
-
|
190 |
&::-moz-range-progress {
|
191 |
@include reset;
|
192 |
}
|
193 |
-
|
194 |
&::-moz-range-thumb {
|
195 |
@include thumb;
|
196 |
}
|
197 |
-
|
198 |
&::-ms-thumb {
|
199 |
@include thumb;
|
200 |
}
|
201 |
-
|
202 |
&:focus {
|
203 |
&::-webkit-slider-thumb {
|
204 |
@include thumbFocus;
|
205 |
}
|
206 |
-
|
207 |
&::-moz-range-thumb {
|
208 |
@include thumbFocus;
|
209 |
}
|
210 |
-
|
211 |
&::-ms-thumb {
|
212 |
@include thumbFocus;
|
213 |
}
|
214 |
}
|
215 |
-
|
216 |
&.wc-block-components-price-slider__range-input--min {
|
217 |
z-index: 21;
|
218 |
-
|
219 |
&::-webkit-slider-thumb {
|
220 |
margin-left: -2px;
|
221 |
background-position-x: left;
|
222 |
}
|
223 |
-
|
224 |
&::-moz-range-thumb {
|
225 |
background-position-x: left;
|
226 |
transform: translate(-2px, 2px);
|
227 |
}
|
228 |
-
|
229 |
&::-ms-thumb {
|
230 |
background-position-x: left;
|
231 |
}
|
232 |
}
|
233 |
-
|
234 |
&.wc-block-components-price-slider__range-input--max {
|
235 |
z-index: 20;
|
236 |
-
|
237 |
&::-webkit-slider-thumb {
|
238 |
background-position-x: right;
|
239 |
margin-left: 2px;
|
240 |
}
|
241 |
-
|
242 |
&::-moz-range-thumb {
|
243 |
background-position-x: right;
|
244 |
transform: translate(2px, 2px);
|
245 |
}
|
246 |
-
|
247 |
&::-ms-thumb {
|
248 |
background-position-x: right;
|
249 |
}
|
@@ -272,32 +257,25 @@
|
|
272 |
.wc-block-components-price-slider__range-input {
|
273 |
height: 24px;
|
274 |
pointer-events: auto;
|
275 |
-
|
276 |
&::-ms-track {
|
277 |
/*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
|
278 |
background: transparent;
|
279 |
-
|
280 |
/*leave room for the larger thumb to overflow with a transparent border */
|
281 |
border-color: transparent;
|
282 |
border-width: 7px 0;
|
283 |
-
|
284 |
/*remove default tick marks*/
|
285 |
color: transparent;
|
286 |
}
|
287 |
-
|
288 |
&::-ms-fill-lower {
|
289 |
background: #e1e1e1;
|
290 |
box-shadow: 0 0 0 1px inset #b8b8b8;
|
291 |
}
|
292 |
-
|
293 |
&::-ms-fill-upper {
|
294 |
background: transparent;
|
295 |
}
|
296 |
-
|
297 |
&::-ms-tooltip {
|
298 |
display: none;
|
299 |
}
|
300 |
-
|
301 |
&::-ms-thumb {
|
302 |
transform: translate(1px, 0);
|
303 |
pointer-events: auto;
|
@@ -308,12 +286,10 @@
|
|
308 |
background: #e1e1e1;
|
309 |
box-shadow: 0 0 0 1px inset #b8b8b8;
|
310 |
}
|
311 |
-
|
312 |
&::-ms-fill-lower {
|
313 |
background: transparent;
|
314 |
}
|
315 |
}
|
316 |
-
|
317 |
.wc-block-components-price-slider {
|
318 |
&.is-loading.is-disabled {
|
319 |
.wc-block-components-price-slider__range-input-wrapper {
|
@@ -321,7 +297,6 @@
|
|
321 |
box-shadow: none;
|
322 |
}
|
323 |
}
|
324 |
-
|
325 |
&.is-disabled:not(.is-loading) {
|
326 |
.wc-block-components-price-slider__range-input-wrapper {
|
327 |
animation: none;
|
@@ -330,7 +305,9 @@
|
|
330 |
}
|
331 |
}
|
332 |
|
|
|
333 |
/* IE 11 will not support multi-range slider due to poor pointer-events support on the thumb. Reverts to 2 sliders. */
|
|
|
334 |
@include ie11() {
|
335 |
@include ie-fixes();
|
336 |
}
|
@@ -342,55 +319,44 @@
|
|
342 |
|
343 |
.theme-twentytwentyone {
|
344 |
$border-width: 3px;
|
345 |
-
|
346 |
.wc-block-components-price-slider__range-input-wrapper {
|
347 |
background: transparent;
|
348 |
border: $border-width solid currentColor;
|
349 |
box-sizing: border-box;
|
350 |
}
|
351 |
-
|
352 |
.wc-block-components-price-slider__range-input-progress {
|
353 |
--range-color: currentColor;
|
354 |
margin: -$border-width;
|
355 |
}
|
356 |
-
|
357 |
.wc-block-price-filter__range-input {
|
358 |
background: transparent;
|
359 |
margin: -$border-width;
|
360 |
width: calc(100% + #{$border-width * 2});
|
361 |
-
|
362 |
&:hover,
|
363 |
&:focus {
|
364 |
&::-webkit-slider-thumb {
|
365 |
filter: none;
|
366 |
}
|
367 |
-
|
368 |
&::-moz-range-thumb {
|
369 |
filter: none;
|
370 |
}
|
371 |
-
|
372 |
&::-ms-thumb {
|
373 |
filter: none;
|
374 |
}
|
375 |
}
|
376 |
-
|
377 |
&::-webkit-slider-thumb {
|
378 |
margin-top: -9px;
|
379 |
}
|
380 |
-
|
381 |
&.wc-block-components-price-slider__range-input--max::-moz-range-thumb {
|
382 |
transform: translate(2px, 1px);
|
383 |
}
|
384 |
-
|
385 |
&.wc-block-components-price-slider__range-input--min::-moz-range-thumb {
|
386 |
transform: translate(-2px, 1px);
|
387 |
}
|
388 |
-
|
389 |
&::-ms-track {
|
390 |
border-color: transparent !important;
|
391 |
}
|
392 |
}
|
393 |
-
|
394 |
@include ie11() {
|
395 |
.wc-block-components-price-slider__range-input-wrapper {
|
396 |
border: 0;
|
@@ -398,11 +364,9 @@
|
|
398 |
position: relative;
|
399 |
height: 50px;
|
400 |
}
|
401 |
-
|
402 |
.wc-block-components-price-slider__range-input-progress {
|
403 |
display: none;
|
404 |
}
|
405 |
-
|
406 |
.wc-block-price-filter__range-input {
|
407 |
height: 100%;
|
408 |
margin: 0;
|
1 |
+
|
2 |
@mixin thumb {
|
3 |
+
background: $white;
|
4 |
background-position: 0 0;
|
5 |
box-sizing: content-box;
|
6 |
width: 12px;
|
13 |
cursor: pointer;
|
14 |
z-index: 20;
|
15 |
pointer-events: auto;
|
16 |
+
transition: transform 0.2s ease-in-out;
|
|
|
17 |
-webkit-appearance: none;
|
18 |
-moz-appearance: none;
|
19 |
appearance: none;
|
|
|
20 |
&:hover {
|
21 |
@include thumbFocus;
|
22 |
}
|
24 |
|
25 |
@mixin thumbFocus {
|
26 |
background: $gray-900;
|
27 |
+
border-color: $white;
|
28 |
}
|
29 |
|
30 |
+
|
31 |
@mixin track {
|
32 |
cursor: default;
|
33 |
+
height: 1px;
|
34 |
+
/* Required for Samsung internet based browsers */
|
35 |
outline: 0;
|
36 |
-webkit-appearance: none;
|
37 |
-moz-appearance: none;
|
54 |
|
55 |
.wc-block-components-price-slider {
|
56 |
margin-bottom: $gap-large;
|
|
|
57 |
&.is-loading.is-disabled {
|
58 |
.wc-block-components-price-slider__range-input-wrapper,
|
59 |
.wc-block-components-filter-reset-button,
|
61 |
@include placeholder();
|
62 |
box-shadow: none;
|
63 |
}
|
|
|
64 |
.wc-block-components-price-slider__amount {
|
65 |
display: none;
|
66 |
}
|
67 |
}
|
|
|
68 |
&.is-disabled:not(.is-loading) {
|
69 |
.wc-block-components-price-slider__range-input-wrapper,
|
70 |
.wc-block-components-price-slider__amount,
|
76 |
|
77 |
.wc-block-components-price-slider__range-input-wrapper {
|
78 |
@include reset;
|
79 |
+
background: transparent;
|
80 |
border-radius: 4px;
|
81 |
clear: both;
|
82 |
flex-grow: 1;
|
84 |
margin: 15px 0;
|
85 |
position: relative;
|
86 |
|
87 |
+
&::before {
|
88 |
+
content: "";
|
89 |
+
position: absolute;
|
90 |
+
top: 0;
|
91 |
+
right: 0;
|
92 |
+
left: 0;
|
93 |
+
bottom: 0;
|
94 |
+
background: currentColor;
|
95 |
+
opacity: 0.2;
|
96 |
+
}
|
97 |
+
|
98 |
&.is-loading {
|
99 |
@include placeholder();
|
100 |
height: em(9px);
|
109 |
top: 0;
|
110 |
width: 100%;
|
111 |
--track-background: linear-gradient(to right, transparent var(--low), var(--range-color) 0, var(--range-color) var(--high), transparent 0) no-repeat 0 100% / 100% 100%;
|
112 |
+
--range-color: currentColor;
|
113 |
/*rtl:ignore*/
|
114 |
background: var(--track-background);
|
115 |
}
|
120 |
gap: $gap-smaller;
|
121 |
justify-content: space-between;
|
122 |
margin: $gap 0;
|
|
|
123 |
.wc-block-components-price-slider__amount {
|
124 |
margin: 0;
|
125 |
border-radius: 4px;
|
128 |
max-width: 80px;
|
129 |
min-width: 0;
|
130 |
padding: $gap-smaller;
|
|
|
131 |
.wc-block-components-price-slider--is-input-inline & {
|
132 |
max-width: 60px;
|
133 |
}
|
|
|
134 |
&.is-loading {
|
135 |
@include placeholder();
|
136 |
border-radius: 0 !important;
|
151 |
display: flex;
|
152 |
gap: $gap;
|
153 |
justify-content: flex-end;
|
|
|
154 |
// The specificity here is needed to overwrite the margin-top that is inherited on WC block template pages such as Shop.
|
155 |
button[type="submit"]:not(.wp-block-search__button).wc-block-components-filter-submit-button {
|
156 |
margin-top: 0;
|
169 |
position: absolute;
|
170 |
left: 0;
|
171 |
top: 0;
|
|
|
172 |
&::-webkit-slider-runnable-track {
|
173 |
@include track;
|
174 |
}
|
|
|
175 |
&::-webkit-slider-thumb {
|
176 |
@include thumb;
|
177 |
margin: -5px 0 0 0;
|
178 |
}
|
|
|
179 |
&::-webkit-slider-progress {
|
180 |
@include reset;
|
181 |
}
|
|
|
182 |
&::-moz-focus-outer {
|
183 |
border: 0;
|
184 |
}
|
|
|
185 |
&::-moz-range-track {
|
186 |
@include track;
|
187 |
}
|
|
|
188 |
&::-moz-range-progress {
|
189 |
@include reset;
|
190 |
}
|
|
|
191 |
&::-moz-range-thumb {
|
192 |
@include thumb;
|
193 |
}
|
|
|
194 |
&::-ms-thumb {
|
195 |
@include thumb;
|
196 |
}
|
|
|
197 |
&:focus {
|
198 |
&::-webkit-slider-thumb {
|
199 |
@include thumbFocus;
|
200 |
}
|
|
|
201 |
&::-moz-range-thumb {
|
202 |
@include thumbFocus;
|
203 |
}
|
|
|
204 |
&::-ms-thumb {
|
205 |
@include thumbFocus;
|
206 |
}
|
207 |
}
|
|
|
208 |
&.wc-block-components-price-slider__range-input--min {
|
209 |
z-index: 21;
|
|
|
210 |
&::-webkit-slider-thumb {
|
211 |
margin-left: -2px;
|
212 |
background-position-x: left;
|
213 |
}
|
|
|
214 |
&::-moz-range-thumb {
|
215 |
background-position-x: left;
|
216 |
transform: translate(-2px, 2px);
|
217 |
}
|
|
|
218 |
&::-ms-thumb {
|
219 |
background-position-x: left;
|
220 |
}
|
221 |
}
|
|
|
222 |
&.wc-block-components-price-slider__range-input--max {
|
223 |
z-index: 20;
|
|
|
224 |
&::-webkit-slider-thumb {
|
225 |
background-position-x: right;
|
226 |
margin-left: 2px;
|
227 |
}
|
|
|
228 |
&::-moz-range-thumb {
|
229 |
background-position-x: right;
|
230 |
transform: translate(2px, 2px);
|
231 |
}
|
|
|
232 |
&::-ms-thumb {
|
233 |
background-position-x: right;
|
234 |
}
|
257 |
.wc-block-components-price-slider__range-input {
|
258 |
height: 24px;
|
259 |
pointer-events: auto;
|
|
|
260 |
&::-ms-track {
|
261 |
/*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
|
262 |
background: transparent;
|
|
|
263 |
/*leave room for the larger thumb to overflow with a transparent border */
|
264 |
border-color: transparent;
|
265 |
border-width: 7px 0;
|
|
|
266 |
/*remove default tick marks*/
|
267 |
color: transparent;
|
268 |
}
|
|
|
269 |
&::-ms-fill-lower {
|
270 |
background: #e1e1e1;
|
271 |
box-shadow: 0 0 0 1px inset #b8b8b8;
|
272 |
}
|
|
|
273 |
&::-ms-fill-upper {
|
274 |
background: transparent;
|
275 |
}
|
|
|
276 |
&::-ms-tooltip {
|
277 |
display: none;
|
278 |
}
|
|
|
279 |
&::-ms-thumb {
|
280 |
transform: translate(1px, 0);
|
281 |
pointer-events: auto;
|
286 |
background: #e1e1e1;
|
287 |
box-shadow: 0 0 0 1px inset #b8b8b8;
|
288 |
}
|
|
|
289 |
&::-ms-fill-lower {
|
290 |
background: transparent;
|
291 |
}
|
292 |
}
|
|
|
293 |
.wc-block-components-price-slider {
|
294 |
&.is-loading.is-disabled {
|
295 |
.wc-block-components-price-slider__range-input-wrapper {
|
297 |
box-shadow: none;
|
298 |
}
|
299 |
}
|
|
|
300 |
&.is-disabled:not(.is-loading) {
|
301 |
.wc-block-components-price-slider__range-input-wrapper {
|
302 |
animation: none;
|
305 |
}
|
306 |
}
|
307 |
|
308 |
+
|
309 |
/* IE 11 will not support multi-range slider due to poor pointer-events support on the thumb. Reverts to 2 sliders. */
|
310 |
+
|
311 |
@include ie11() {
|
312 |
@include ie-fixes();
|
313 |
}
|
319 |
|
320 |
.theme-twentytwentyone {
|
321 |
$border-width: 3px;
|
|
|
322 |
.wc-block-components-price-slider__range-input-wrapper {
|
323 |
background: transparent;
|
324 |
border: $border-width solid currentColor;
|
325 |
box-sizing: border-box;
|
326 |
}
|
|
|
327 |
.wc-block-components-price-slider__range-input-progress {
|
328 |
--range-color: currentColor;
|
329 |
margin: -$border-width;
|
330 |
}
|
|
|
331 |
.wc-block-price-filter__range-input {
|
332 |
background: transparent;
|
333 |
margin: -$border-width;
|
334 |
width: calc(100% + #{$border-width * 2});
|
|
|
335 |
&:hover,
|
336 |
&:focus {
|
337 |
&::-webkit-slider-thumb {
|
338 |
filter: none;
|
339 |
}
|
|
|
340 |
&::-moz-range-thumb {
|
341 |
filter: none;
|
342 |
}
|
|
|
343 |
&::-ms-thumb {
|
344 |
filter: none;
|
345 |
}
|
346 |
}
|
|
|
347 |
&::-webkit-slider-thumb {
|
348 |
margin-top: -9px;
|
349 |
}
|
|
|
350 |
&.wc-block-components-price-slider__range-input--max::-moz-range-thumb {
|
351 |
transform: translate(2px, 1px);
|
352 |
}
|
|
|
353 |
&.wc-block-components-price-slider__range-input--min::-moz-range-thumb {
|
354 |
transform: translate(-2px, 1px);
|
355 |
}
|
|
|
356 |
&::-ms-track {
|
357 |
border-color: transparent !important;
|
358 |
}
|
359 |
}
|
|
|
360 |
@include ie11() {
|
361 |
.wc-block-components-price-slider__range-input-wrapper {
|
362 |
border: 0;
|
364 |
position: relative;
|
365 |
height: 50px;
|
366 |
}
|
|
|
367 |
.wc-block-components-price-slider__range-input-progress {
|
368 |
display: none;
|
369 |
}
|
|
|
370 |
.wc-block-price-filter__range-input {
|
371 |
height: 100%;
|
372 |
margin: 0;
|
packages/woocommerce-blocks/assets/js/blocks/mini-cart/block.tsx
CHANGED
@@ -4,7 +4,6 @@
|
|
4 |
import { renderParentBlock } from '@woocommerce/atomic-utils';
|
5 |
import Drawer from '@woocommerce/base-components/drawer';
|
6 |
import { useStoreCart } from '@woocommerce/base-context/hooks';
|
7 |
-
import { useTypographyProps } from '@woocommerce/base-hooks';
|
8 |
import { translateJQueryEventToNative } from '@woocommerce/base-utils';
|
9 |
import { getRegisteredBlockComponents } from '@woocommerce/blocks-registry';
|
10 |
import {
|
@@ -205,8 +204,6 @@ const MiniCartBlock = ( attributes: Props ): JSX.Element => {
|
|
205 |
color: style?.color?.text,
|
206 |
};
|
207 |
|
208 |
-
const typographyProps = useTypographyProps( attributes );
|
209 |
-
|
210 |
return (
|
211 |
<>
|
212 |
<button
|
@@ -221,10 +218,7 @@ const MiniCartBlock = ( attributes: Props ): JSX.Element => {
|
|
221 |
aria-label={ ariaLabel }
|
222 |
>
|
223 |
{ ! hasHiddenPrice && (
|
224 |
-
<span
|
225 |
-
className="wc-block-mini-cart__amount"
|
226 |
-
style={ typographyProps.style }
|
227 |
-
>
|
228 |
{ formatPrice(
|
229 |
subTotal,
|
230 |
getCurrencyFromPriceResponse( cartTotals )
|
4 |
import { renderParentBlock } from '@woocommerce/atomic-utils';
|
5 |
import Drawer from '@woocommerce/base-components/drawer';
|
6 |
import { useStoreCart } from '@woocommerce/base-context/hooks';
|
|
|
7 |
import { translateJQueryEventToNative } from '@woocommerce/base-utils';
|
8 |
import { getRegisteredBlockComponents } from '@woocommerce/blocks-registry';
|
9 |
import {
|
204 |
color: style?.color?.text,
|
205 |
};
|
206 |
|
|
|
|
|
207 |
return (
|
208 |
<>
|
209 |
<button
|
218 |
aria-label={ ariaLabel }
|
219 |
>
|
220 |
{ ! hasHiddenPrice && (
|
221 |
+
<span className="wc-block-mini-cart__amount">
|
|
|
|
|
|
|
222 |
{ formatPrice(
|
223 |
subTotal,
|
224 |
getCurrencyFromPriceResponse( cartTotals )
|
packages/woocommerce-blocks/assets/js/blocks/mini-cart/edit.tsx
CHANGED
@@ -13,7 +13,6 @@ import {
|
|
13 |
import { getSetting } from '@woocommerce/settings';
|
14 |
import { __ } from '@wordpress/i18n';
|
15 |
import Noninteractive from '@woocommerce/base-components/noninteractive';
|
16 |
-
import { useTypographyProps } from '@woocommerce/base-hooks';
|
17 |
|
18 |
/**
|
19 |
* Internal dependencies
|
@@ -44,8 +43,6 @@ const Edit = ( { attributes, setAttributes }: Props ): ReactElement => {
|
|
44 |
const productCount = 0;
|
45 |
const productTotal = 0;
|
46 |
|
47 |
-
const typographyProps = useTypographyProps( attributes );
|
48 |
-
|
49 |
return (
|
50 |
<div { ...blockProps }>
|
51 |
<InspectorControls>
|
@@ -127,10 +124,7 @@ const Edit = ( { attributes, setAttributes }: Props ): ReactElement => {
|
|
127 |
<Noninteractive>
|
128 |
<button className="wc-block-mini-cart__button">
|
129 |
{ ! hasHiddenPrice && (
|
130 |
-
<span
|
131 |
-
className="wc-block-mini-cart__amount"
|
132 |
-
style={ typographyProps.style }
|
133 |
-
>
|
134 |
{ formatPrice( productTotal ) }
|
135 |
</span>
|
136 |
) }
|
13 |
import { getSetting } from '@woocommerce/settings';
|
14 |
import { __ } from '@wordpress/i18n';
|
15 |
import Noninteractive from '@woocommerce/base-components/noninteractive';
|
|
|
16 |
|
17 |
/**
|
18 |
* Internal dependencies
|
43 |
const productCount = 0;
|
44 |
const productTotal = 0;
|
45 |
|
|
|
|
|
46 |
return (
|
47 |
<div { ...blockProps }>
|
48 |
<InspectorControls>
|
124 |
<Noninteractive>
|
125 |
<button className="wc-block-mini-cart__button">
|
126 |
{ ! hasHiddenPrice && (
|
127 |
+
<span className="wc-block-mini-cart__amount">
|
|
|
|
|
|
|
128 |
{ formatPrice( productTotal ) }
|
129 |
</span>
|
130 |
) }
|
packages/woocommerce-blocks/assets/js/blocks/mini-cart/frontend.ts
CHANGED
@@ -152,4 +152,25 @@ window.addEventListener( 'load', () => {
|
|
152 |
);
|
153 |
}
|
154 |
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
} );
|
152 |
);
|
153 |
}
|
154 |
} );
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Get the background color of the body then set it as the background color
|
158 |
+
* of the Mini Cart Contents block. We use :where here to make customized
|
159 |
+
* background color alway have higher priority.
|
160 |
+
*
|
161 |
+
* We only set the background color, instead of the whole background. As
|
162 |
+
* we only provide the option to customize the background color.
|
163 |
+
*/
|
164 |
+
const style = document.createElement( 'style' );
|
165 |
+
const backgroundColor = getComputedStyle( document.body ).backgroundColor;
|
166 |
+
|
167 |
+
style.appendChild(
|
168 |
+
document.createTextNode(
|
169 |
+
`:where(.wp-block-woocommerce-mini-cart-contents) {
|
170 |
+
background-color: ${ backgroundColor };
|
171 |
+
}`
|
172 |
+
)
|
173 |
+
);
|
174 |
+
|
175 |
+
document.head.appendChild( style );
|
176 |
} );
|
packages/woocommerce-blocks/assets/js/blocks/mini-cart/index.tsx
CHANGED
@@ -39,7 +39,6 @@ const settings: BlockConfiguration = {
|
|
39 |
...( isFeaturePluginBuild() && {
|
40 |
__experimentalFontFamily: true,
|
41 |
__experimentalFontWeight: true,
|
42 |
-
__experimentalSkipSerialization: true,
|
43 |
} ),
|
44 |
},
|
45 |
},
|
39 |
...( isFeaturePluginBuild() && {
|
40 |
__experimentalFontFamily: true,
|
41 |
__experimentalFontWeight: true,
|
|
|
42 |
} ),
|
43 |
},
|
44 |
},
|
packages/woocommerce-blocks/assets/js/blocks/mini-cart/mini-cart-contents/edit.tsx
CHANGED
@@ -13,6 +13,7 @@ import { filledCart, removeCart } from '@woocommerce/icons';
|
|
13 |
import { Icon } from '@wordpress/icons';
|
14 |
import { EditorProvider } from '@woocommerce/base-context';
|
15 |
import type { TemplateArray } from '@wordpress/blocks';
|
|
|
16 |
|
17 |
/**
|
18 |
* Internal dependencies
|
@@ -73,6 +74,59 @@ const Edit = ( { clientId }: Props ): ReactElement => {
|
|
73 |
defaultTemplate,
|
74 |
} );
|
75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
return (
|
77 |
<div { ...blockProps }>
|
78 |
<EditorProvider currentView={ currentView }>
|
13 |
import { Icon } from '@wordpress/icons';
|
14 |
import { EditorProvider } from '@woocommerce/base-context';
|
15 |
import type { TemplateArray } from '@wordpress/blocks';
|
16 |
+
import { useEffect } from '@wordpress/element';
|
17 |
|
18 |
/**
|
19 |
* Internal dependencies
|
74 |
defaultTemplate,
|
75 |
} );
|
76 |
|
77 |
+
/**
|
78 |
+
* This is a workaround for the Site Editor to set the correct
|
79 |
+
* background color of the Mini Cart Contents block base on
|
80 |
+
* the main background color set by the theme.
|
81 |
+
*/
|
82 |
+
useEffect( () => {
|
83 |
+
const canvasEl = document.querySelector(
|
84 |
+
'.edit-site-visual-editor__editor-canvas'
|
85 |
+
);
|
86 |
+
if ( ! ( canvasEl instanceof HTMLIFrameElement ) ) {
|
87 |
+
return;
|
88 |
+
}
|
89 |
+
const canvas =
|
90 |
+
canvasEl.contentDocument || canvasEl.contentWindow?.document;
|
91 |
+
if ( ! canvas ) {
|
92 |
+
return;
|
93 |
+
}
|
94 |
+
if ( canvas.getElementById( 'mini-cart-contents-background-color' ) ) {
|
95 |
+
return;
|
96 |
+
}
|
97 |
+
const styles = canvas.querySelectorAll( 'style' );
|
98 |
+
const [ cssRule ] = Array.from( styles )
|
99 |
+
.map( ( style ) => Array.from( style.sheet?.cssRules || [] ) )
|
100 |
+
.flatMap( ( style ) => style )
|
101 |
+
.filter( Boolean )
|
102 |
+
.filter(
|
103 |
+
( rule ) =>
|
104 |
+
rule.selectorText === '.editor-styles-wrapper' &&
|
105 |
+
rule.style.backgroundColor
|
106 |
+
);
|
107 |
+
if ( ! cssRule ) {
|
108 |
+
return;
|
109 |
+
}
|
110 |
+
const backgroundColor = cssRule.style.backgroundColor;
|
111 |
+
if ( ! backgroundColor ) {
|
112 |
+
return;
|
113 |
+
}
|
114 |
+
const style = document.createElement( 'style' );
|
115 |
+
style.id = 'mini-cart-contents-background-color';
|
116 |
+
style.appendChild(
|
117 |
+
document.createTextNode(
|
118 |
+
`:where(.wp-block-woocommerce-mini-cart-contents) {
|
119 |
+
background-color: ${ backgroundColor };
|
120 |
+
}`
|
121 |
+
)
|
122 |
+
);
|
123 |
+
const body = canvas.querySelector( '.editor-styles-wrapper' );
|
124 |
+
if ( ! body ) {
|
125 |
+
return;
|
126 |
+
}
|
127 |
+
body.appendChild( style );
|
128 |
+
}, [] );
|
129 |
+
|
130 |
return (
|
131 |
<div { ...blockProps }>
|
132 |
<EditorProvider currentView={ currentView }>
|
packages/woocommerce-blocks/assets/js/blocks/mini-cart/style.scss
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
display: flex;
|
11 |
font-size: inherit;
|
12 |
font-family: inherit;
|
13 |
-
font-weight:
|
14 |
padding: em($gap-small) em($gap-smaller);
|
15 |
|
16 |
&:hover:not([disabled]) {
|
@@ -29,7 +29,8 @@
|
|
29 |
@media screen and (min-width: 768px) {
|
30 |
.wc-block-mini-cart__amount {
|
31 |
display: initial;
|
32 |
-
font-
|
|
|
33 |
margin-right: $gap-smaller;
|
34 |
}
|
35 |
}
|
@@ -64,12 +65,14 @@
|
|
64 |
}
|
65 |
|
66 |
.wp-block-woocommerce-mini-cart-contents {
|
67 |
-
background: #fff;
|
68 |
box-sizing: border-box;
|
69 |
height: 100vh;
|
70 |
padding: 0;
|
71 |
justify-content: center;
|
72 |
}
|
|
|
|
|
|
|
73 |
|
74 |
.wp-block-woocommerce-empty-mini-cart-contents-block,
|
75 |
.wp-block-woocommerce-filled-mini-cart-contents-block {
|
10 |
display: flex;
|
11 |
font-size: inherit;
|
12 |
font-family: inherit;
|
13 |
+
font-weight: inherit;
|
14 |
padding: em($gap-small) em($gap-smaller);
|
15 |
|
16 |
&:hover:not([disabled]) {
|
29 |
@media screen and (min-width: 768px) {
|
30 |
.wc-block-mini-cart__amount {
|
31 |
display: initial;
|
32 |
+
font-size: inherit;
|
33 |
+
font-weight: inherit;
|
34 |
margin-right: $gap-smaller;
|
35 |
}
|
36 |
}
|
65 |
}
|
66 |
|
67 |
.wp-block-woocommerce-mini-cart-contents {
|
|
|
68 |
box-sizing: border-box;
|
69 |
height: 100vh;
|
70 |
padding: 0;
|
71 |
justify-content: center;
|
72 |
}
|
73 |
+
:where(.wp-block-woocommerce-mini-cart-contents) {
|
74 |
+
background: #fff;
|
75 |
+
}
|
76 |
|
77 |
.wp-block-woocommerce-empty-mini-cart-contents-block,
|
78 |
.wp-block-woocommerce-filled-mini-cart-contents-block {
|
packages/woocommerce-blocks/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-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '2c1899570ec56125d609dcf4196e6984');
|
packages/woocommerce-blocks/build/active-filters-frontend.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var c=t[n]={i:n,l:!1,exports:{}};return e[n].call(c.exports,c,c.exports,r),c.l=!0,c.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 c in e)r.d(n,c,function(t){return e[t]}.bind(null,c));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=247)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},11:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,r.apply(this,arguments)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},111:function(e,t,r){"use strict";var n=r(0);t.a=function(e){let{icon:t,size:r=24,...c}=e;return Object(n.cloneElement)(t,{width:r,height:r,...c})}},112:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return o}));var n=r(6);const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const o=e.filter(e=>e.attribute===r.taxonomy),s=o.length?o[0]:null;if(!(s&&s.slug&&Array.isArray(s.slug)&&s.slug.includes(c)))return;const a=s.slug.filter(e=>e!==c),i=e.filter(e=>e.attribute!==r.taxonomy);a.length>0&&(s.slug=a.sort(),i.push(s)),t(Object(n.sortBy)(i,"attribute"))},o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=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";if(!r||!r.taxonomy)return[];const s=e.filter(e=>e.attribute!==r.taxonomy);return 0===c.length?t(s):(s.push({attribute:r.taxonomy,operator:o,slug:c.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(n.sortBy)(s,"attribute"))),s}},119:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return s}));var n=r(2);const c=Object(n.getSetting)("attributes",[]).reduce((e,t)=>{const 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;var n;return r&&r.id&&e.push(r),e},[]),o=e=>{if(e)return c.find(t=>t.id===e)},s=e=>{if(e)return c.find(t=>t.taxonomy===e)}},12:function(e,t){e.exports=window.wp.isShallowEqual},13:function(e,t){e.exports=window.wp.url},
|
2 |
/* translators: %s is referring to the average rating value */
|
3 |
Object(c.__)("Rated %s out of 5","woocommerce"),e),removeCallback:()=>{if(j)return Object(g.e)({rating_filter:e});const t=T.filter(t=>t!==e);B(t)},displayStyle:t.displayStyle})):null;var e},[E,T,B,t.displayStyle,j]);if(!E&&!(k.length>0||x.length>0||T.length>0||Number.isFinite(P)||Number.isFinite(C))&&!r)return a(!1),null;const Y="h"+t.headingLevel,q=Object(n.createElement)(Y,{className:"wc-block-active-filters__title"},t.heading),V=E?Object(n.createElement)(f.a,null,q):q;if(!Object(s.getSettingWithCoercion)("has_filterable_products",!1,u.a))return a(!1),null;a(!0);const D=i()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle,"wc-block-active-filters--loading":E});return Object(n.createElement)(n.Fragment,null,!r&&t.heading&&V,Object(n.createElement)("div",{className:"wc-block-active-filters"},Object(n.createElement)("ul",{className:D},r?Object(n.createElement)(n.Fragment,null,Object(g.f)({type:Object(c.__)("Size","woocommerce"),name:Object(c.__)("Small","woocommerce"),displayStyle:t.displayStyle}),Object(g.f)({type:Object(c.__)("Color","woocommerce"),name:Object(c.__)("Blue","woocommerce"),displayStyle:t.displayStyle})):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(w,{isLoading:E,displayStyle:t.displayStyle}),Q,M,G,U)),E?Object(n.createElement)("span",{className:"wc-block-active-filters__clear-all-placeholder"}):Object(n.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:()=>{Object(g.a)(),j||(N(void 0),R(void 0),S([]),A([]),B([]))}},Object(n.createElement)(l.a,{label:Object(c.__)("Clear All","woocommerce"),screenReaderLabel:Object(c.__)("Clear All Filters","woocommerce")}))))}},16: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.__esModule=!0,e.exports.default=e.exports},18:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));const n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function c(e,t){return n(e)&&t in e}},2:function(e,t){e.exports=window.wc.wcSettings},21:function(e,t){e.exports=window.wp.htmlEntities},217:function(e,t){},22:function(e,t,r){"use strict";var n=r(0),c=r(5),o=r.n(c);t.a=e=>{let t,{label:r,screenReaderLabel:c,wrapperElement:s,wrapperProps:a={}}=e;const i=null!=r,l=null!=c;return!i&&l?(t=s||"span",a={...a,className:o()(a.className,"screen-reader-text")},Object(n.createElement)(t,a,c)):(t=s||n.Fragment,i&&l&&r!==c?Object(n.createElement)(t,a,Object(n.createElement)("span",{"aria-hidden":"true"},r),Object(n.createElement)("span",{className:"screen-reader-text"},c)):Object(n.createElement)(t,a,r))}},224:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return a}));var n=r(18);const c=e=>Object(n.b)(e,"count")&&Object(n.b)(e,"description")&&Object(n.b)(e,"id")&&Object(n.b)(e,"name")&&Object(n.b)(e,"parent")&&Object(n.b)(e,"slug")&&"number"==typeof e.count&&"string"==typeof e.description&&"number"==typeof e.id&&"string"==typeof e.name&&"number"==typeof e.parent&&"string"==typeof e.slug,o=e=>Array.isArray(e)&&e.every(c),s=e=>Object(n.b)(e,"attribute")&&Object(n.b)(e,"operator")&&Object(n.b)(e,"slug")&&"string"==typeof e.attribute&&"string"==typeof e.operator&&Array.isArray(e.slug)&&e.slug.every(e=>"string"==typeof e),a=e=>Array.isArray(e)&&e.every(s)},227:function(e,t,r){"use strict";var n=r(0),c=r(14);const o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=o},228:function(e,t){},23:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const c=Object(n.createContext)("page"),o=()=>Object(n.useContext)(c);c.Provider},231:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(0),s=r(5),a=r.n(s),i=r(1),l=r(111),u=r(227);r(217);var b=e=>{let{text:t,screenReaderText:r="",element:n="li",className:s="",radius:i="small",children:l=null,...u}=e;const b=n,p=a()(s,"wc-block-components-chip","wc-block-components-chip--radius-"+i),d=Boolean(r&&r!==t);return Object(o.createElement)(b,c()({className:p},u),Object(o.createElement)("span",{"aria-hidden":d,className:"wc-block-components-chip__text"},t),d&&Object(o.createElement)("span",{className:"screen-reader-text"},r),l)};t.a=e=>{let{ariaLabel:t="",className:r="",disabled:n=!1,onRemove:s=(()=>{}),removeOnAnyClick:p=!1,text:d,screenReaderText:f="",...m}=e;const g=p?"span":"button";if(!t){const e=f&&"string"==typeof f?f:d;t="string"!=typeof e?
|
4 |
/* translators: Remove chip. */
|
5 |
Object(i.__)("Remove","woocommerce"):Object(i.sprintf)(
|
6 |
/* translators: %s text of the chip to remove. */
|
7 |
-
Object(i.__)('Remove "%s"',"woocommerce"),e)}const O={"aria-label":t,disabled:n,onClick:s,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||s()}},j=p?O:{},y=p?{"aria-hidden":!0}:O;return Object(o.createElement)(b,c()({},m,j,{className:a()(r,"is-removable"),element:p?"button":m.element,screenReaderText:f,text:d}),Object(o.createElement)(g,c()({className:"wc-block-components-chip__remove"},y),Object(o.createElement)(l.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},247:function(e,t,r){e.exports=r(248)},248:function(e,t,r){"use strict";r.r(t);var n=r(38),c=r(
|
8 |
/* translators: %1$s min price, %2$s max price */
|
9 |
Object(c.__)("Between %1$s and %2$s","woocommerce"),Object(o.formatPrice)(e),Object(o.formatPrice)(t)):Number.isFinite(e)?Object(c.sprintf)(
|
10 |
/* translators: %s min price */
|
1 |
+
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var c=t[n]={i:n,l:!1,exports:{}};return e[n].call(c.exports,c,c.exports,r),c.l=!0,c.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 c in e)r.d(n,c,function(t){return e[t]}.bind(null,c));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=247)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},11:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,r.apply(this,arguments)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},111:function(e,t,r){"use strict";var n=r(0);t.a=function(e){let{icon:t,size:r=24,...c}=e;return Object(n.cloneElement)(t,{width:r,height:r,...c})}},112:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return o}));var n=r(6);const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const o=e.filter(e=>e.attribute===r.taxonomy),s=o.length?o[0]:null;if(!(s&&s.slug&&Array.isArray(s.slug)&&s.slug.includes(c)))return;const a=s.slug.filter(e=>e!==c),i=e.filter(e=>e.attribute!==r.taxonomy);a.length>0&&(s.slug=a.sort(),i.push(s)),t(Object(n.sortBy)(i,"attribute"))},o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=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";if(!r||!r.taxonomy)return[];const s=e.filter(e=>e.attribute!==r.taxonomy);return 0===c.length?t(s):(s.push({attribute:r.taxonomy,operator:o,slug:c.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(n.sortBy)(s,"attribute"))),s}},119:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return s}));var n=r(2);const c=Object(n.getSetting)("attributes",[]).reduce((e,t)=>{const 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;var n;return r&&r.id&&e.push(r),e},[]),o=e=>{if(e)return c.find(t=>t.id===e)},s=e=>{if(e)return c.find(t=>t.taxonomy===e)}},12:function(e,t){e.exports=window.wp.isShallowEqual},13:function(e,t){e.exports=window.wp.url},137:function(e){e.exports=JSON.parse('{"name":"woocommerce/active-filters","version":"1.0.0","title":"Active Product Filters Controls","description":"Display the currently active product filters.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"multiple":false,"inserter":false,"color":{"text":true,"background":false},"lock":false},"attributes":{"displayStyle":{"type":"string","default":"list"},"headingLevel":{"type":"number","default":3}},"textdomain":"woocommerce","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},14:function(e,t){e.exports=window.wp.primitives},15:function(e,t,r){"use strict";var n=r(16),c=r.n(n),o=r(0),s=r(7),a=r(1),i=r(44),l=e=>{let{imageUrl:t=i.l+"/block-error.svg",header:r=Object(a.__)("Oops!","woocommerce"),text:n=Object(a.__)("There was an error loading the content.","woocommerce"),errorMessage:c,errorMessagePrefix:s=Object(a.__)("Error:","woocommerce"),button:l,showErrorBlock:u=!0}=e;return u?Object(o.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(o.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(o.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&Object(o.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),n&&Object(o.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},n),c&&Object(o.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",c),l&&Object(o.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};r(33);class u extends s.Component{constructor(){super(...arguments),c()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(o.createElement)(o.Fragment,null,Object(o.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:r=!0,showErrorBlock:n=!0,text:c,errorMessagePrefix:s,renderError:a,button:i}=this.props,{errorMessage:u,hasError:b}=this.state;return b?"function"==typeof a?a({errorMessage:u}):Object(o.createElement)(l,{showErrorBlock:n,errorMessage:r?u:null,header:e,imageUrl:t,text:c,errorMessagePrefix:s,button:i}):this.props.children}}t.a=u},157:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(29),s=r(2),a=r(5),i=r.n(a),l=r(22),u=r(69),b=r(18),p=r(224),d=r(70),f=r(51);r(228);var m=r(119),g=r(41),O=r(60),j=r(21),y=r(112),_=e=>{let{attributeObject:t,slugs:r=[],operator:a="in",displayStyle:i,isLoadingCallback:l}=e;const{results:b,isLoading:d}=Object(O.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[t.id]}),[f,m]=Object(o.b)("attributes",[]);if(Object(n.useEffect)(()=>{l(d)},[d,l]),!Array.isArray(b)||!Object(p.b)(b)||!Object(p.a)(f))return null;const _=t.label,w=Object(s.getSettingWithCoercion)("is_rendering_php_template",!1,u.a);return Object(n.createElement)("li",null,Object(n.createElement)("span",{className:"wc-block-active-filters__list-item-type"},_,":"),Object(n.createElement)("ul",null,r.map((e,r)=>{const o=b.find(t=>t.slug===e);if(!o)return null;let s="";return r>0&&"and"===a&&(s=Object(n.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(c.__)("All","woocommerce"))),Object(g.f)({type:_,name:Object(j.decodeEntities)(o.name||e),prefix:s,isLoading:d,removeCallback:()=>{const r=f.find(e=>{let{attribute:r}=e;return r==="pa_"+t.name});1===(null==r?void 0:r.slug.length)?Object(g.e)("query_type_"+t.name,"filter_"+t.name):Object(g.e)({["filter_"+t.name]:e}),w||Object(y.a)(f,m,t,e)},showLabel:!1,displayStyle:i})})))},w=e=>{let{displayStyle:t,isLoading:r}=e;return r?Object(n.createElement)(n.Fragment,null,[...Array("list"===t?2:3)].map((e,r)=>Object(n.createElement)("li",{className:"list"===t?"show-loading-state-list":"show-loading-state-chips",key:r},Object(n.createElement)("span",{className:"show-loading-state__inner"})))):null},h=r(55);t.a=e=>{let{attributes:t,isEditor:r=!1}=e;const a=Object(h.b)(),O=function(){const e=Object(n.useRef)(!1);return Object(n.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),Object(n.useCallback)(()=>e.current,[])}()(),j=Object(s.getSettingWithCoercion)("is_rendering_php_template",!1,u.a),[y,v]=Object(n.useState)(!0),E=Object(g.c)()&&!r&&y,[k,S]=Object(o.b)("attributes",[]),[x,A]=Object(o.b)("stock_status",[]),[P,N]=Object(o.b)("min_price"),[C,R]=Object(o.b)("max_price"),[T,B]=Object(o.b)("rating"),L=Object(s.getSetting)("stockStatusOptions",[]),F=Object(s.getSetting)("attributes",[]),M=Object(n.useMemo)(()=>{return!E&&0!==x.length&&(e=x,Array.isArray(e)&&e.every(e=>["instock","outofstock","onbackorder"].includes(e)))&&(e=>Object(b.a)(e)&&Object.keys(e).every(e=>["instock","outofstock","onbackorder"].includes(e)))(L)?x.map(e=>Object(g.f)({type:Object(c.__)("Stock Status","woocommerce"),name:L[e],removeCallback:()=>{if(Object(g.e)({filter_stock_status:e}),!j){const t=x.filter(t=>t!==e);A(t)}},displayStyle:t.displayStyle})):null;var e},[E,L,x,A,t.displayStyle,j]),Q=Object(n.useMemo)(()=>E||!Number.isFinite(P)&&!Number.isFinite(C)?null:Object(g.f)({type:Object(c.__)("Price","woocommerce"),name:Object(g.b)(P,C),removeCallback:()=>{Object(g.e)("max_price","min_price"),j||(N(void 0),R(void 0))},displayStyle:t.displayStyle}),[E,P,C,t.displayStyle,N,R,j]),G=Object(n.useMemo)(()=>!Object(p.a)(k)&&O||!k.length&&!Object(g.g)(F)?(y&&v(!1),null):k.map(e=>{const r=Object(m.b)(e.attribute);return r?Object(n.createElement)(_,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator,isLoadingCallback:v}):(y&&v(!1),null)}),[k,O,F,y,t.displayStyle]);Object(n.useEffect)(()=>{var e;if(!j)return;if(T.length&&T.length>0)return;const t=null===(e=Object(d.d)("rating_filter"))||void 0===e?void 0:e.toString();t&&B(t.split(","))},[j,T,B]);const U=Object(n.useMemo)(()=>{return!E&&0!==T.length&&(e=T,Array.isArray(e)&&e.every(e=>["1","2","3","4","5"].includes(e)))?T.map(e=>Object(g.f)({type:Object(c.__)("Rating","woocommerce"),name:Object(c.sprintf)(
|
2 |
/* translators: %s is referring to the average rating value */
|
3 |
Object(c.__)("Rated %s out of 5","woocommerce"),e),removeCallback:()=>{if(j)return Object(g.e)({rating_filter:e});const t=T.filter(t=>t!==e);B(t)},displayStyle:t.displayStyle})):null;var e},[E,T,B,t.displayStyle,j]);if(!E&&!(k.length>0||x.length>0||T.length>0||Number.isFinite(P)||Number.isFinite(C))&&!r)return a(!1),null;const Y="h"+t.headingLevel,q=Object(n.createElement)(Y,{className:"wc-block-active-filters__title"},t.heading),V=E?Object(n.createElement)(f.a,null,q):q;if(!Object(s.getSettingWithCoercion)("has_filterable_products",!1,u.a))return a(!1),null;a(!0);const D=i()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle,"wc-block-active-filters--loading":E});return Object(n.createElement)(n.Fragment,null,!r&&t.heading&&V,Object(n.createElement)("div",{className:"wc-block-active-filters"},Object(n.createElement)("ul",{className:D},r?Object(n.createElement)(n.Fragment,null,Object(g.f)({type:Object(c.__)("Size","woocommerce"),name:Object(c.__)("Small","woocommerce"),displayStyle:t.displayStyle}),Object(g.f)({type:Object(c.__)("Color","woocommerce"),name:Object(c.__)("Blue","woocommerce"),displayStyle:t.displayStyle})):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(w,{isLoading:E,displayStyle:t.displayStyle}),Q,M,G,U)),E?Object(n.createElement)("span",{className:"wc-block-active-filters__clear-all-placeholder"}):Object(n.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:()=>{Object(g.a)(),j||(N(void 0),R(void 0),S([]),A([]),B([]))}},Object(n.createElement)(l.a,{label:Object(c.__)("Clear All","woocommerce"),screenReaderLabel:Object(c.__)("Clear All Filters","woocommerce")}))))}},16: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.__esModule=!0,e.exports.default=e.exports},18:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));const n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function c(e,t){return n(e)&&t in e}},2:function(e,t){e.exports=window.wc.wcSettings},21:function(e,t){e.exports=window.wp.htmlEntities},217:function(e,t){},22:function(e,t,r){"use strict";var n=r(0),c=r(5),o=r.n(c);t.a=e=>{let t,{label:r,screenReaderLabel:c,wrapperElement:s,wrapperProps:a={}}=e;const i=null!=r,l=null!=c;return!i&&l?(t=s||"span",a={...a,className:o()(a.className,"screen-reader-text")},Object(n.createElement)(t,a,c)):(t=s||n.Fragment,i&&l&&r!==c?Object(n.createElement)(t,a,Object(n.createElement)("span",{"aria-hidden":"true"},r),Object(n.createElement)("span",{className:"screen-reader-text"},c)):Object(n.createElement)(t,a,r))}},224:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return a}));var n=r(18);const c=e=>Object(n.b)(e,"count")&&Object(n.b)(e,"description")&&Object(n.b)(e,"id")&&Object(n.b)(e,"name")&&Object(n.b)(e,"parent")&&Object(n.b)(e,"slug")&&"number"==typeof e.count&&"string"==typeof e.description&&"number"==typeof e.id&&"string"==typeof e.name&&"number"==typeof e.parent&&"string"==typeof e.slug,o=e=>Array.isArray(e)&&e.every(c),s=e=>Object(n.b)(e,"attribute")&&Object(n.b)(e,"operator")&&Object(n.b)(e,"slug")&&"string"==typeof e.attribute&&"string"==typeof e.operator&&Array.isArray(e.slug)&&e.slug.every(e=>"string"==typeof e),a=e=>Array.isArray(e)&&e.every(s)},227:function(e,t,r){"use strict";var n=r(0),c=r(14);const o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=o},228:function(e,t){},23:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const c=Object(n.createContext)("page"),o=()=>Object(n.useContext)(c);c.Provider},231:function(e,t,r){"use strict";var n=r(11),c=r.n(n),o=r(0),s=r(5),a=r.n(s),i=r(1),l=r(111),u=r(227);r(217);var b=e=>{let{text:t,screenReaderText:r="",element:n="li",className:s="",radius:i="small",children:l=null,...u}=e;const b=n,p=a()(s,"wc-block-components-chip","wc-block-components-chip--radius-"+i),d=Boolean(r&&r!==t);return Object(o.createElement)(b,c()({className:p},u),Object(o.createElement)("span",{"aria-hidden":d,className:"wc-block-components-chip__text"},t),d&&Object(o.createElement)("span",{className:"screen-reader-text"},r),l)};t.a=e=>{let{ariaLabel:t="",className:r="",disabled:n=!1,onRemove:s=(()=>{}),removeOnAnyClick:p=!1,text:d,screenReaderText:f="",...m}=e;const g=p?"span":"button";if(!t){const e=f&&"string"==typeof f?f:d;t="string"!=typeof e?
|
4 |
/* translators: Remove chip. */
|
5 |
Object(i.__)("Remove","woocommerce"):Object(i.sprintf)(
|
6 |
/* translators: %s text of the chip to remove. */
|
7 |
+
Object(i.__)('Remove "%s"',"woocommerce"),e)}const O={"aria-label":t,disabled:n,onClick:s,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||s()}},j=p?O:{},y=p?{"aria-hidden":!0}:O;return Object(o.createElement)(b,c()({},m,j,{className:a()(r,"is-removable"),element:p?"button":m.element,screenReaderText:f,text:d}),Object(o.createElement)(g,c()({className:"wc-block-components-chip__remove"},y),Object(o.createElement)(l.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},247:function(e,t,r){e.exports=r(248)},248:function(e,t,r){"use strict";r.r(t);var n=r(38),c=r(157),o=r(41);Object(n.a)({selector:".wp-block-woocommerce-active-filters",Block:c.a,getProps:e=>({attributes:Object(o.d)(e.dataset),isEditor:!1})})},27:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(0),c=r(12),o=r.n(c);function s(e){const t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},28:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"string"==typeof e},29:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return d}));var n=r(3),c=r(4),o=r(0),s=r(12),a=r.n(s),i=r(27),l=r(61),u=r(23);const b=e=>{const t=Object(u.a)();e=e||t;const r=Object(c.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:s}=Object(c.useDispatch)(n.QUERY_STATE_STORE_KEY);return[r,Object(o.useCallback)(t=>{s(e,t)},[e,s])]},p=(e,t,r)=>{const s=Object(u.a)();r=r||s;const a=Object(c.useSelect)(c=>c(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t),[r,e]),{setQueryValue:i}=Object(c.useDispatch)(n.QUERY_STATE_STORE_KEY);return[a,Object(o.useCallback)(t=>{i(r,e,t)},[r,e,i])]},d=(e,t)=>{const r=Object(u.a)();t=t||r;const[n,c]=b(t),s=Object(i.a)(n),p=Object(i.a)(e),d=Object(l.a)(p),f=Object(o.useRef)(!1);return Object(o.useEffect)(()=>{a()(d,p)||(c(Object.assign({},s,p)),f.current=!0)},[s,p,d,c]),f.current?[n,c]:[e,c]}},3:function(e,t){e.exports=window.wc.wcBlocksData},33:function(e,t){},38:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(11),c=r.n(n),o=r(0),s=r(15);const a=[".wp-block-woocommerce-cart"],i=e=>{let{Block:t,containers:r,getProps:n=(()=>({})),getErrorBoundaryProps:a=(()=>({}))}=e;0!==r.length&&Array.prototype.forEach.call(r,(e,r)=>{const i=n(e,r),l=a(e,r),u={...e.dataset,...i.attributes||{}};(e=>{let{Block:t,container:r,attributes:n={},props:a={},errorBoundaryProps:i={}}=e;Object(o.render)(Object(o.createElement)(s.a,i,Object(o.createElement)(o.Suspense,{fallback:Object(o.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(o.createElement)(t,c()({},a,{attributes:n})))),r,()=>{r.classList&&r.classList.remove("is-loading")})})({Block:t,container:e,props:i,attributes:u,errorBoundaryProps:l})})},l=e=>{const t=document.body.querySelectorAll(a.join(",")),{Block:r,getProps:n,getErrorBoundaryProps:c,selector:o}=e;(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:c,wrappers:o}=e;const s=document.body.querySelectorAll(c);o&&o.length>0&&Array.prototype.filter.call(s,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,o)),i({Block:t,containers:s,getProps:r,getErrorBoundaryProps:n})})({Block:r,getProps:n,getErrorBoundaryProps:c,selector:o,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:c,wrapper:o}=e;const s=o.querySelectorAll(c);i({Block:t,containers:s,getProps:r,getErrorBoundaryProps:n})})({...e,wrapper:t})})})}},39:function(e,t){e.exports=window.wc.priceFormat},4:function(e,t){e.exports=window.wp.data},41:function(e,t,r){"use strict";r.d(t,"b",(function(){return f})),r.d(t,"f",(function(){return m})),r.d(t,"e",(function(){return g})),r.d(t,"a",(function(){return y})),r.d(t,"c",(function(){return _})),r.d(t,"g",(function(){return w})),r.d(t,"d",(function(){return h}));var n=r(0),c=r(1),o=r(39),s=r(231),a=r(22),i=r(13),l=r(70),u=r(111),b=r(227),p=r(28),d=r(137);const f=(e,t)=>Number.isFinite(e)&&Number.isFinite(t)?Object(c.sprintf)(
|
8 |
/* translators: %1$s min price, %2$s max price */
|
9 |
Object(c.__)("Between %1$s and %2$s","woocommerce"),Object(o.formatPrice)(e),Object(o.formatPrice)(t)):Number.isFinite(e)?Object(c.sprintf)(
|
10 |
/* translators: %s min price */
|
packages/woocommerce-blocks/build/active-filters-wrapper-frontend.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[12],{111:function(e,t,r){"use strict";var n=r(0);t.a=function(e){let{icon:t,size:r=24,...c}=e;return Object(n.cloneElement)(t,{width:r,height:r,...c})}},112:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return a}));var n=r(6);const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const a=e.filter(e=>e.attribute===r.taxonomy),o=a.length?a[0]:null;if(!(o&&o.slug&&Array.isArray(o.slug)&&o.slug.includes(c)))return;const i=o.slug.filter(e=>e!==c),s=e.filter(e=>e.attribute!==r.taxonomy);i.length>0&&(o.slug=i.sort(),s.push(o)),t(Object(n.sortBy)(s,"attribute"))},a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";if(!r||!r.taxonomy)return[];const o=e.filter(e=>e.attribute!==r.taxonomy);return 0===c.length?t(o):(o.push({attribute:r.taxonomy,operator:a,slug:c.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(n.sortBy)(o,"attribute"))),o}},119:function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return o}));var n=r(2);const c=Object(n.getSetting)("attributes",[]).reduce((e,t)=>{const 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;var n;return r&&r.id&&e.push(r),e},[]),a=e=>{if(e)return c.find(t=>t.id===e)},o=e=>{if(e)return c.find(t=>t.taxonomy===e)}},
|
2 |
/* translators: %s is referring to the average rating value */
|
3 |
-
Object(c.__)("Rated %s out of 5","woocommerce"),e),removeCallback:()=>{if(g)return Object(m.e)({rating_filter:e});const t=F.filter(t=>t!==e);T(t)},displayStyle:t.displayStyle})):null;var e},[k,F,T,t.displayStyle,g]);if(!k&&!(E.length>0||N.length>0||F.length>0||Number.isFinite(A)||Number.isFinite(R))&&!r)return i(!1),null;const W="h"+t.headingLevel,U=Object(n.createElement)(W,{className:"wc-block-active-filters__title"},t.heading),z=k?Object(n.createElement)(p.a,null,U):U;if(!Object(o.getSettingWithCoercion)("has_filterable_products",!1,u.a))return i(!1),null;i(!0);const D=s()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle,"wc-block-active-filters--loading":k});return Object(n.createElement)(n.Fragment,null,!r&&t.heading&&z,Object(n.createElement)("div",{className:"wc-block-active-filters"},Object(n.createElement)("ul",{className:D},r?Object(n.createElement)(n.Fragment,null,Object(m.f)({type:Object(c.__)("Size","woocommerce"),name:Object(c.__)("Small","woocommerce"),displayStyle:t.displayStyle}),Object(m.f)({type:Object(c.__)("Color","woocommerce"),name:Object(c.__)("Blue","woocommerce"),displayStyle:t.displayStyle})):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(v,{isLoading:k,displayStyle:t.displayStyle}),Y,B,V,K)),k?Object(n.createElement)("span",{className:"wc-block-active-filters__clear-all-placeholder"}):Object(n.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:()=>{Object(m.a)(),g||(C(void 0),L(void 0),S([]),x([]),T([]))}},Object(n.createElement)(l.a,{label:Object(c.__)("Clear All","woocommerce"),screenReaderLabel:Object(c.__)("Clear All Filters","woocommerce")}))))}},18:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));const n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function c(e,t){return n(e)&&t in e}},
|
4 |
/* translators: Remove chip. */
|
5 |
Object(s.__)("Remove","woocommerce"):Object(s.sprintf)(
|
6 |
/* translators: %s text of the chip to remove. */
|
7 |
-
Object(s.__)('Remove "%s"',"woocommerce"),e)}const j={"aria-label":t,disabled:n,onClick:o,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||o()}},g=f?j:{},y=f?{"aria-hidden":!0}:j;return Object(a.createElement)(b,c()({},O,g,{className:i()(r,"is-removable"),element:f?"button":O.element,screenReaderText:p,text:d}),Object(a.createElement)(m,c()({className:"wc-block-components-chip__remove"},y),Object(a.createElement)(l.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},27:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(12),a=r.n(c);function o(e){const t=Object(n.useRef)(e);return a()(e,t.current)||(t.current=e),t.current}},28:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"string"==typeof e},
|
8 |
/* translators: %1$s min price, %2$s max price */
|
9 |
Object(c.__)("Between %1$s and %2$s","woocommerce"),Object(a.formatPrice)(e),Object(a.formatPrice)(t)):Number.isFinite(e)?Object(c.sprintf)(
|
10 |
/* translators: %s min price */
|
@@ -12,4 +12,4 @@ Object(c.__)("From %s","woocommerce"),Object(a.formatPrice)(e)):Object(c.sprintf
|
|
12 |
/* translators: %s max price */
|
13 |
Object(c.__)("Up to %s","woocommerce"),Object(a.formatPrice)(t)),O=e=>{let{type:t,name:r,prefix:a="",removeCallback:s=(()=>null),showLabel:l=!0,displayStyle:f}=e;const d=a?Object(n.createElement)(n.Fragment,null,a," ",r):r,p=Object(c.sprintf)(
|
14 |
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
|
15 |
-
Object(c.__)("Remove %s filter","woocommerce"),r);return Object(n.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},l&&Object(n.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===f?Object(n.createElement)(o.a,{element:"span",text:d,onRemove:s,radius:"large",ariaLabel:p}):Object(n.createElement)("span",{className:"wc-block-active-filters__list-item-name"},Object(n.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:s},Object(n.createElement)(u.a,{className:"wc-block-components-chip__remove-icon",icon:b.a,size:16}),Object(n.createElement)(i.a,{screenReaderLabel:p})),d))},m=function(){if(!window)return;const e=window.location.href,t=Object(s.getQueryArgs)(e),r=Object(s.removeQueryArgs)(e,...Object.keys(t));for(var n=arguments.length,c=new Array(n),a=0;a<n;a++)c[a]=arguments[a];c.forEach(e=>{if("string"==typeof e)return delete t[e];if("object"==typeof e){const r=Object.keys(e)[0],n=t[r].toString().split(",");t[r]=n.filter(t=>t!==e[r]).join(",")}});const o=Object.fromEntries(Object.entries(t).filter(e=>{let[,t]=e;return t})),i=Object(s.addQueryArgs)(r,o);Object(l.c)(i)},j=["min_price","max_price","rating_filter","filter_","query_type_"],g=e=>{let t=!1;for(let r=0;j.length>r;r++){const n=j[r];if(n===e.substring(0,n.length)){t=!0;break}}return t},y=()=>{if(!window)return;const e=window.location.href,t=Object(s.getQueryArgs)(e),r=Object(s.removeQueryArgs)(e,...Object.keys(t)),n=Object.fromEntries(Object.keys(t).filter(e=>!g(e)).map(e=>[e,t[e]])),c=Object(s.addQueryArgs)(r,n);Object(l.c)(c)},_=()=>{if(!window)return!1;const e=window.location.href,t=Object(s.getQueryArgs)(e),r=Object.keys(t);let n=!1;for(let e=0;r.length>e;e++){const t=r[e];if(g(t)){n=!0;break}}return n},v=e=>{if(!window)return!1;const t=e.map(e=>"filter_"+e.attribute_name),r=window.location.href,n=Object(s.getQueryArgs)(r),c=Object.keys(n);let a=!1;for(let e=0;c.length>e;e++){const r=c[e];if(t.includes(r)){a=!0;break}}return a},h=e=>({heading:Object(f.a)(null==e?void 0:e.heading)?e.heading:"",headingLevel:Object(f.a)(null==e?void 0:e.headingLevel)&&parseInt(e.headingLevel,10)||d.attributes.headingLevel.default,displayStyle:Object(f.a)(null==e?void 0:e.displayStyle)&&e.displayStyle||d.attributes.displayStyle.default})},454:function(e,t,r){"use strict";r.r(t);var n=r(0),c=r(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[12],{111:function(e,t,r){"use strict";var n=r(0);t.a=function(e){let{icon:t,size:r=24,...c}=e;return Object(n.cloneElement)(t,{width:r,height:r,...c})}},112:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return a}));var n=r(6);const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const a=e.filter(e=>e.attribute===r.taxonomy),o=a.length?a[0]:null;if(!(o&&o.slug&&Array.isArray(o.slug)&&o.slug.includes(c)))return;const i=o.slug.filter(e=>e!==c),s=e.filter(e=>e.attribute!==r.taxonomy);i.length>0&&(o.slug=i.sort(),s.push(o)),t(Object(n.sortBy)(s,"attribute"))},a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";if(!r||!r.taxonomy)return[];const o=e.filter(e=>e.attribute!==r.taxonomy);return 0===c.length?t(o):(o.push({attribute:r.taxonomy,operator:a,slug:c.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(n.sortBy)(o,"attribute"))),o}},119:function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return o}));var n=r(2);const c=Object(n.getSetting)("attributes",[]).reduce((e,t)=>{const 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;var n;return r&&r.id&&e.push(r),e},[]),a=e=>{if(e)return c.find(t=>t.id===e)},o=e=>{if(e)return c.find(t=>t.taxonomy===e)}},137:function(e){e.exports=JSON.parse('{"name":"woocommerce/active-filters","version":"1.0.0","title":"Active Product Filters Controls","description":"Display the currently active product filters.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"multiple":false,"inserter":false,"color":{"text":true,"background":false},"lock":false},"attributes":{"displayStyle":{"type":"string","default":"list"},"headingLevel":{"type":"number","default":3}},"textdomain":"woocommerce","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},157:function(e,t,r){"use strict";var n=r(0),c=r(1),a=r(29),o=r(2),i=r(5),s=r.n(i),l=r(22),u=r(69),b=r(18),f=r(224),d=r(70),p=r(51);r(228);var O=r(119),m=r(41),j=r(60),g=r(21),y=r(112),_=e=>{let{attributeObject:t,slugs:r=[],operator:i="in",displayStyle:s,isLoadingCallback:l}=e;const{results:b,isLoading:d}=Object(j.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[t.id]}),[p,O]=Object(a.b)("attributes",[]);if(Object(n.useEffect)(()=>{l(d)},[d,l]),!Array.isArray(b)||!Object(f.b)(b)||!Object(f.a)(p))return null;const _=t.label,v=Object(o.getSettingWithCoercion)("is_rendering_php_template",!1,u.a);return Object(n.createElement)("li",null,Object(n.createElement)("span",{className:"wc-block-active-filters__list-item-type"},_,":"),Object(n.createElement)("ul",null,r.map((e,r)=>{const a=b.find(t=>t.slug===e);if(!a)return null;let o="";return r>0&&"and"===i&&(o=Object(n.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(c.__)("All","woocommerce"))),Object(m.f)({type:_,name:Object(g.decodeEntities)(a.name||e),prefix:o,isLoading:d,removeCallback:()=>{const r=p.find(e=>{let{attribute:r}=e;return r==="pa_"+t.name});1===(null==r?void 0:r.slug.length)?Object(m.e)("query_type_"+t.name,"filter_"+t.name):Object(m.e)({["filter_"+t.name]:e}),v||Object(y.a)(p,O,t,e)},showLabel:!1,displayStyle:s})})))},v=e=>{let{displayStyle:t,isLoading:r}=e;return r?Object(n.createElement)(n.Fragment,null,[...Array("list"===t?2:3)].map((e,r)=>Object(n.createElement)("li",{className:"list"===t?"show-loading-state-list":"show-loading-state-chips",key:r},Object(n.createElement)("span",{className:"show-loading-state__inner"})))):null},h=r(55);t.a=e=>{let{attributes:t,isEditor:r=!1}=e;const i=Object(h.b)(),j=function(){const e=Object(n.useRef)(!1);return Object(n.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),Object(n.useCallback)(()=>e.current,[])}()(),g=Object(o.getSettingWithCoercion)("is_rendering_php_template",!1,u.a),[y,w]=Object(n.useState)(!0),k=Object(m.c)()&&!r&&y,[E,S]=Object(a.b)("attributes",[]),[N,x]=Object(a.b)("stock_status",[]),[A,C]=Object(a.b)("min_price"),[R,L]=Object(a.b)("max_price"),[F,T]=Object(a.b)("rating"),Q=Object(o.getSetting)("stockStatusOptions",[]),P=Object(o.getSetting)("attributes",[]),B=Object(n.useMemo)(()=>{return!k&&0!==N.length&&(e=N,Array.isArray(e)&&e.every(e=>["instock","outofstock","onbackorder"].includes(e)))&&(e=>Object(b.a)(e)&&Object.keys(e).every(e=>["instock","outofstock","onbackorder"].includes(e)))(Q)?N.map(e=>Object(m.f)({type:Object(c.__)("Stock Status","woocommerce"),name:Q[e],removeCallback:()=>{if(Object(m.e)({filter_stock_status:e}),!g){const t=N.filter(t=>t!==e);x(t)}},displayStyle:t.displayStyle})):null;var e},[k,Q,N,x,t.displayStyle,g]),Y=Object(n.useMemo)(()=>k||!Number.isFinite(A)&&!Number.isFinite(R)?null:Object(m.f)({type:Object(c.__)("Price","woocommerce"),name:Object(m.b)(A,R),removeCallback:()=>{Object(m.e)("max_price","min_price"),g||(C(void 0),L(void 0))},displayStyle:t.displayStyle}),[k,A,R,t.displayStyle,C,L,g]),V=Object(n.useMemo)(()=>!Object(f.a)(E)&&j||!E.length&&!Object(m.g)(P)?(y&&w(!1),null):E.map(e=>{const r=Object(O.b)(e.attribute);return r?Object(n.createElement)(_,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator,isLoadingCallback:w}):(y&&w(!1),null)}),[E,j,P,y,t.displayStyle]);Object(n.useEffect)(()=>{var e;if(!g)return;if(F.length&&F.length>0)return;const t=null===(e=Object(d.d)("rating_filter"))||void 0===e?void 0:e.toString();t&&T(t.split(","))},[g,F,T]);const K=Object(n.useMemo)(()=>{return!k&&0!==F.length&&(e=F,Array.isArray(e)&&e.every(e=>["1","2","3","4","5"].includes(e)))?F.map(e=>Object(m.f)({type:Object(c.__)("Rating","woocommerce"),name:Object(c.sprintf)(
|
2 |
/* translators: %s is referring to the average rating value */
|
3 |
+
Object(c.__)("Rated %s out of 5","woocommerce"),e),removeCallback:()=>{if(g)return Object(m.e)({rating_filter:e});const t=F.filter(t=>t!==e);T(t)},displayStyle:t.displayStyle})):null;var e},[k,F,T,t.displayStyle,g]);if(!k&&!(E.length>0||N.length>0||F.length>0||Number.isFinite(A)||Number.isFinite(R))&&!r)return i(!1),null;const W="h"+t.headingLevel,U=Object(n.createElement)(W,{className:"wc-block-active-filters__title"},t.heading),z=k?Object(n.createElement)(p.a,null,U):U;if(!Object(o.getSettingWithCoercion)("has_filterable_products",!1,u.a))return i(!1),null;i(!0);const D=s()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle,"wc-block-active-filters--loading":k});return Object(n.createElement)(n.Fragment,null,!r&&t.heading&&z,Object(n.createElement)("div",{className:"wc-block-active-filters"},Object(n.createElement)("ul",{className:D},r?Object(n.createElement)(n.Fragment,null,Object(m.f)({type:Object(c.__)("Size","woocommerce"),name:Object(c.__)("Small","woocommerce"),displayStyle:t.displayStyle}),Object(m.f)({type:Object(c.__)("Color","woocommerce"),name:Object(c.__)("Blue","woocommerce"),displayStyle:t.displayStyle})):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(v,{isLoading:k,displayStyle:t.displayStyle}),Y,B,V,K)),k?Object(n.createElement)("span",{className:"wc-block-active-filters__clear-all-placeholder"}):Object(n.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:()=>{Object(m.a)(),g||(C(void 0),L(void 0),S([]),x([]),T([]))}},Object(n.createElement)(l.a,{label:Object(c.__)("Clear All","woocommerce"),screenReaderLabel:Object(c.__)("Clear All Filters","woocommerce")}))))}},18:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));const n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function c(e,t){return n(e)&&t in e}},214:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r(100);var n=r(44);const c=()=>n.m>1},215:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(28),c=r(18);const a=e=>Object(n.a)(e)?JSON.parse(e)||{}:Object(c.a)(e)?e:{}},217:function(e,t){},22:function(e,t,r){"use strict";var n=r(0),c=r(5),a=r.n(c);t.a=e=>{let t,{label:r,screenReaderLabel:c,wrapperElement:o,wrapperProps:i={}}=e;const s=null!=r,l=null!=c;return!s&&l?(t=o||"span",i={...i,className:a()(i.className,"screen-reader-text")},Object(n.createElement)(t,i,c)):(t=o||n.Fragment,s&&l&&r!==c?Object(n.createElement)(t,i,Object(n.createElement)("span",{"aria-hidden":"true"},r),Object(n.createElement)("span",{className:"screen-reader-text"},c)):Object(n.createElement)(t,i,r))}},224:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));var n=r(18);const c=e=>Object(n.b)(e,"count")&&Object(n.b)(e,"description")&&Object(n.b)(e,"id")&&Object(n.b)(e,"name")&&Object(n.b)(e,"parent")&&Object(n.b)(e,"slug")&&"number"==typeof e.count&&"string"==typeof e.description&&"number"==typeof e.id&&"string"==typeof e.name&&"number"==typeof e.parent&&"string"==typeof e.slug,a=e=>Array.isArray(e)&&e.every(c),o=e=>Object(n.b)(e,"attribute")&&Object(n.b)(e,"operator")&&Object(n.b)(e,"slug")&&"string"==typeof e.attribute&&"string"==typeof e.operator&&Array.isArray(e.slug)&&e.slug.every(e=>"string"==typeof e),i=e=>Array.isArray(e)&&e.every(o)},227:function(e,t,r){"use strict";var n=r(0),c=r(14);const a=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=a},228:function(e,t){},23:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0);const c=Object(n.createContext)("page"),a=()=>Object(n.useContext)(c);c.Provider},231:function(e,t,r){"use strict";var n=r(11),c=r.n(n),a=r(0),o=r(5),i=r.n(o),s=r(1),l=r(111),u=r(227);r(217);var b=e=>{let{text:t,screenReaderText:r="",element:n="li",className:o="",radius:s="small",children:l=null,...u}=e;const b=n,f=i()(o,"wc-block-components-chip","wc-block-components-chip--radius-"+s),d=Boolean(r&&r!==t);return Object(a.createElement)(b,c()({className:f},u),Object(a.createElement)("span",{"aria-hidden":d,className:"wc-block-components-chip__text"},t),d&&Object(a.createElement)("span",{className:"screen-reader-text"},r),l)};t.a=e=>{let{ariaLabel:t="",className:r="",disabled:n=!1,onRemove:o=(()=>{}),removeOnAnyClick:f=!1,text:d,screenReaderText:p="",...O}=e;const m=f?"span":"button";if(!t){const e=p&&"string"==typeof p?p:d;t="string"!=typeof e?
|
4 |
/* translators: Remove chip. */
|
5 |
Object(s.__)("Remove","woocommerce"):Object(s.sprintf)(
|
6 |
/* translators: %s text of the chip to remove. */
|
7 |
+
Object(s.__)('Remove "%s"',"woocommerce"),e)}const j={"aria-label":t,disabled:n,onClick:o,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||o()}},g=f?j:{},y=f?{"aria-hidden":!0}:j;return Object(a.createElement)(b,c()({},O,g,{className:i()(r,"is-removable"),element:f?"button":O.element,screenReaderText:p,text:d}),Object(a.createElement)(m,c()({className:"wc-block-components-chip__remove"},y),Object(a.createElement)(l.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},27:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(12),a=r.n(c);function o(e){const t=Object(n.useRef)(e);return a()(e,t.current)||(t.current=e),t.current}},28:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"string"==typeof e},29:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return f})),r.d(t,"c",(function(){return d}));var n=r(3),c=r(4),a=r(0),o=r(12),i=r.n(o),s=r(27),l=r(61),u=r(23);const b=e=>{const t=Object(u.a)();e=e||t;const r=Object(c.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:o}=Object(c.useDispatch)(n.QUERY_STATE_STORE_KEY);return[r,Object(a.useCallback)(t=>{o(e,t)},[e,o])]},f=(e,t,r)=>{const o=Object(u.a)();r=r||o;const i=Object(c.useSelect)(c=>c(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t),[r,e]),{setQueryValue:s}=Object(c.useDispatch)(n.QUERY_STATE_STORE_KEY);return[i,Object(a.useCallback)(t=>{s(r,e,t)},[r,e,s])]},d=(e,t)=>{const r=Object(u.a)();t=t||r;const[n,c]=b(t),o=Object(s.a)(n),f=Object(s.a)(e),d=Object(l.a)(f),p=Object(a.useRef)(!1);return Object(a.useEffect)(()=>{i()(d,f)||(c(Object.assign({},o,f)),p.current=!0)},[o,f,d,c]),p.current?[n,c]:[e,c]}},291:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(108),c=r(214),a=r(18),o=r(215);const i=e=>{if(!Object(c.a)())return{className:"",style:{}};const t=Object(a.a)(e)?e:{},r=Object(o.a)(t.style);return Object(n.__experimentalUseColorProps)({...t,style:r})}},41:function(e,t,r){"use strict";r.d(t,"b",(function(){return p})),r.d(t,"f",(function(){return O})),r.d(t,"e",(function(){return m})),r.d(t,"a",(function(){return y})),r.d(t,"c",(function(){return _})),r.d(t,"g",(function(){return v})),r.d(t,"d",(function(){return h}));var n=r(0),c=r(1),a=r(39),o=r(231),i=r(22),s=r(13),l=r(70),u=r(111),b=r(227),f=r(28),d=r(137);const p=(e,t)=>Number.isFinite(e)&&Number.isFinite(t)?Object(c.sprintf)(
|
8 |
/* translators: %1$s min price, %2$s max price */
|
9 |
Object(c.__)("Between %1$s and %2$s","woocommerce"),Object(a.formatPrice)(e),Object(a.formatPrice)(t)):Number.isFinite(e)?Object(c.sprintf)(
|
10 |
/* translators: %s min price */
|
12 |
/* translators: %s max price */
|
13 |
Object(c.__)("Up to %s","woocommerce"),Object(a.formatPrice)(t)),O=e=>{let{type:t,name:r,prefix:a="",removeCallback:s=(()=>null),showLabel:l=!0,displayStyle:f}=e;const d=a?Object(n.createElement)(n.Fragment,null,a," ",r):r,p=Object(c.sprintf)(
|
14 |
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
|
15 |
+
Object(c.__)("Remove %s filter","woocommerce"),r);return Object(n.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},l&&Object(n.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===f?Object(n.createElement)(o.a,{element:"span",text:d,onRemove:s,radius:"large",ariaLabel:p}):Object(n.createElement)("span",{className:"wc-block-active-filters__list-item-name"},Object(n.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:s},Object(n.createElement)(u.a,{className:"wc-block-components-chip__remove-icon",icon:b.a,size:16}),Object(n.createElement)(i.a,{screenReaderLabel:p})),d))},m=function(){if(!window)return;const e=window.location.href,t=Object(s.getQueryArgs)(e),r=Object(s.removeQueryArgs)(e,...Object.keys(t));for(var n=arguments.length,c=new Array(n),a=0;a<n;a++)c[a]=arguments[a];c.forEach(e=>{if("string"==typeof e)return delete t[e];if("object"==typeof e){const r=Object.keys(e)[0],n=t[r].toString().split(",");t[r]=n.filter(t=>t!==e[r]).join(",")}});const o=Object.fromEntries(Object.entries(t).filter(e=>{let[,t]=e;return t})),i=Object(s.addQueryArgs)(r,o);Object(l.c)(i)},j=["min_price","max_price","rating_filter","filter_","query_type_"],g=e=>{let t=!1;for(let r=0;j.length>r;r++){const n=j[r];if(n===e.substring(0,n.length)){t=!0;break}}return t},y=()=>{if(!window)return;const e=window.location.href,t=Object(s.getQueryArgs)(e),r=Object(s.removeQueryArgs)(e,...Object.keys(t)),n=Object.fromEntries(Object.keys(t).filter(e=>!g(e)).map(e=>[e,t[e]])),c=Object(s.addQueryArgs)(r,n);Object(l.c)(c)},_=()=>{if(!window)return!1;const e=window.location.href,t=Object(s.getQueryArgs)(e),r=Object.keys(t);let n=!1;for(let e=0;r.length>e;e++){const t=r[e];if(g(t)){n=!0;break}}return n},v=e=>{if(!window)return!1;const t=e.map(e=>"filter_"+e.attribute_name),r=window.location.href,n=Object(s.getQueryArgs)(r),c=Object.keys(n);let a=!1;for(let e=0;c.length>e;e++){const r=c[e];if(t.includes(r)){a=!0;break}}return a},h=e=>({heading:Object(f.a)(null==e?void 0:e.heading)?e.heading:"",headingLevel:Object(f.a)(null==e?void 0:e.headingLevel)&&parseInt(e.headingLevel,10)||d.attributes.headingLevel.default,displayStyle:Object(f.a)(null==e?void 0:e.displayStyle)&&e.displayStyle||d.attributes.displayStyle.default})},454:function(e,t,r){"use strict";r.r(t);var n=r(0),c=r(291),a=r(28),o=r(157),i=r(41);t.default=e=>{const t=Object(c.a)(e);return Object(n.createElement)("div",{className:Object(a.a)(e.className)?e.className:"",style:{...t.style}},Object(n.createElement)(o.a,{isEditor:!1,attributes:Object(i.d)(e)}))}},5:function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function c(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var o=c.apply(null,n);o&&e.push(o)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var i in n)r.call(n,i)&&n[i]&&e.push(i);else e.push(n.toString())}}return e.join(" ")}e.exports?(c.default=c,e.exports=c):void 0===(n=function(){return c}.apply(t,[]))||(e.exports=n)}()},51:function(e,t,r){"use strict";var n=r(0);r(71),t.a=e=>{let{children:t}=e;return Object(n.createElement)("div",{className:"wc-block-filter-title-placeholder"},t)}},60:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(3),c=r(4),a=r(0),o=r(27),i=r(73);const s=e=>{const{namespace:t,resourceName:r,resourceValues:s=[],query:l={},shouldSelect:u=!0}=e;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(a.useRef)({results:[],isLoading:!0}),f=Object(o.a)(l),d=Object(o.a)(s),p=Object(i.a)(),O=Object(c.useSelect)(e=>{if(!u)return null;const c=e(n.COLLECTIONS_STORE_KEY),a=[t,r,f,d],o=c.getCollectionError(...a);if(o){if(!(o instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");p(o)}return{results:c.getCollection(...a),isLoading:!c.hasFinishedResolution("getCollection",a)}},[t,r,d,f,u]);return null!==O&&(b.current=O),b.current}},61:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(7);function c(e,t){const r=Object(n.useRef)();return Object(n.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},69:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"boolean"==typeof e},70:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return s})),r.d(t,"d",(function(){return l})),r.d(t,"c",(function(){return u}));var n=r(13),c=r(2),a=r(69);const o=Object(c.getSettingWithCoercion)("is_rendering_php_template",!1,a.a),i="query_type_",s="filter_";function l(e){return window?Object(n.getQueryArg)(window.location.href,e):null}function u(e){o?window.location.href=e:window.history.replaceState({},"",e)}},71:function(e,t){},73:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0);const c=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}}}]);
|
packages/woocommerce-blocks/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-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '
|
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-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'b5c346c6f0d97984e28358639b1ad807');
|
packages/woocommerce-blocks/build/active-filters.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["active-filters"]=function(e){function t(t){for(var n,l,i=t[0],a=t[1],s=t[2],b=0,p=[];b<i.length;b++)l=i[b],Object.prototype.hasOwnProperty.call(c,l)&&c[l]&&p.push(c[l][0]),c[l]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(u&&u(t);p.length;)p.shift()();return o.push.apply(o,s||[]),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 a=r[i];0!==c[a]&&(n=!1)}n&&(o.splice(t--,1),e=l(l.s=r[0]))}return e}var n={},c={5:0,1:0},o=[];function l(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,l),r.l=!0,r.exports}l.m=e,l.c=n,l.d=function(e,t,r){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(l.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)l.d(r,n,function(t){return e[t]}.bind(null,n));return r},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],a=i.push.bind(i);i.push=t,i=i.slice();for(var s=0;s<i.length;s++)t(i[s]);var u=a;return o.push([417,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.blocks},102:function(e,t,r){"use strict";var n=r(0),c=r(5),o=r(11),l=r(1);r(139),t.a=Object(o.withInstanceId)(e=>{let{className:t,headingLevel:r,onChange:o,heading:i,instanceId:a}=e;const s="h"+r;return Object(n.createElement)(s,{className:t},Object(n.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-"+a},Object(l.__)("Block title","woocommerce")),Object(n.createElement)(c.PlainText,{id:"block-title-"+a,className:"wc-block-editor-components-title",value:i,onChange:o}))})},103:function(e,t,r){"use strict";var n=r(0);r(140),t.a=e=>{let{children:t}=e;return Object(n.createElement)("div",{className:"wc-block-filter-title-placeholder"},t)}},104:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(12);function c(e,t){const r=Object(n.useRef)();return Object(n.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},108:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(9),c=r(7),o=r(0),l=r(40),i=r(142);const a=e=>{const{namespace:t,resourceName:r,resourceValues:a=[],query:s={},shouldSelect:u=!0}=e;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(o.useRef)({results:[],isLoading:!0}),p=Object(l.a)(s),d=Object(l.a)(a),f=Object(i.a)(),m=Object(c.useSelect)(e=>{if(!u)return null;const c=e(n.COLLECTIONS_STORE_KEY),o=[t,r,p,d],l=c.getCollectionError(...o);if(l){if(!(l instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");f(l)}return{results:c.getCollection(...o),isLoading:!c.hasFinishedResolution("getCollection",o)}},[t,r,d,p,u]);return null!==m&&(b.current=m),b.current}},11:function(e,t){e.exports=window.wp.compose},12:function(e,t){e.exports=window.React},
|
2 |
/* translators: Remove chip. */
|
3 |
Object(a.__)("Remove","woocommerce"):Object(a.sprintf)(
|
4 |
/* translators: %s text of the chip to remove. */
|
5 |
-
Object(a.__)('Remove "%s"',"woocommerce"),e)}const O={"aria-label":t,disabled:n,onClick:l,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||l()}},j=p?O:{},y=p?{"aria-hidden":!0}:O;return Object(o.createElement)(b,c()({},m,j,{className:i()(r,"is-removable"),element:p?"button":m.element,screenReaderText:f,text:d}),Object(o.createElement)(g,c()({className:"wc-block-components-chip__remove"},y),Object(o.createElement)(s.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},26:function(e,t){e.exports=window.wc.priceFormat},29:function(e,t,r){"use strict";var n=r(0),c=r(4),o=r.n(c);t.a=e=>{let t,{label:r,screenReaderLabel:c,wrapperElement:l,wrapperProps:i={}}=e;const a=null!=r,s=null!=c;return!a&&s?(t=l||"span",i={...i,className:o()(i.className,"screen-reader-text")},Object(n.createElement)(t,i,c)):(t=l||n.Fragment,a&&s&&r!==c?Object(n.createElement)(t,i,Object(n.createElement)("span",{"aria-hidden":"true"},r),Object(n.createElement)("span",{className:"screen-reader-text"},c)):Object(n.createElement)(t,i,r))}},3:function(e,t){e.exports=window.wp.components},
|
6 |
/* translators: %1$s min price, %2$s max price */
|
7 |
Object(l.__)("Between %1$s and %2$s","woocommerce"),Object(k.formatPrice)(e),Object(k.formatPrice)(t)):Number.isFinite(e)?Object(l.sprintf)(
|
8 |
/* translators: %s min price */
|
@@ -10,6 +10,6 @@ Object(l.__)("From %s","woocommerce"),Object(k.formatPrice)(e)):Object(l.sprintf
|
|
10 |
/* translators: %s max price */
|
11 |
Object(l.__)("Up to %s","woocommerce"),Object(k.formatPrice)(t)),A=e=>{let{type:t,name:r,prefix:n="",removeCallback:c=(()=>null),showLabel:i=!0,displayStyle:a}=e;const u=n?Object(o.createElement)(o.Fragment,null,n," ",r):r,b=Object(l.sprintf)(
|
12 |
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
|
13 |
-
Object(l.__)("Remove %s filter","woocommerce"),r);return Object(o.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},i&&Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===a?Object(o.createElement)(E.a,{element:"span",text:u,onRemove:c,radius:"large",ariaLabel:b}):Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-name"},Object(o.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:c},Object(o.createElement)(s.a,{className:"wc-block-components-chip__remove-icon",icon:x.a,size:16}),Object(o.createElement)(O.a,{screenReaderLabel:b})),u))},R=function(){if(!window)return;const e=window.location.href,t=Object(S.getQueryArgs)(e),r=Object(S.removeQueryArgs)(e,...Object.keys(t));for(var n=arguments.length,c=new Array(n),o=0;o<n;o++)c[o]=arguments[o];c.forEach(e=>{if("string"==typeof e)return delete t[e];if("object"==typeof e){const r=Object.keys(e)[0],n=t[r].toString().split(",");t[r]=n.filter(t=>t!==e[r]).join(",")}});const l=Object.fromEntries(Object.entries(t).filter(e=>{let[,t]=e;return t})),i=Object(S.addQueryArgs)(r,l);Object(_.c)(i)},T=["min_price","max_price","rating_filter","filter_","query_type_"],L=e=>{let t=!1;for(let r=0;T.length>r;r++){const n=T[r];if(n===e.substring(0,n.length)){t=!0;break}}return t};var B=r(108),F=r(15),P=r(181),Q=e=>{let{attributeObject:t,slugs:r=[],operator:n="in",displayStyle:c,isLoadingCallback:i}=e;const{results:a,isLoading:s}=Object(B.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[t.id]}),[u,b]=Object(m.b)("attributes",[]);if(Object(o.useEffect)(()=>{i(s)},[s,i]),!Array.isArray(a)||!Object(w.b)(a)||!Object(w.a)(u))return null;const p=t.label,d=Object(g.getSettingWithCoercion)("is_rendering_php_template",!1,j.a);return Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},p,":"),Object(o.createElement)("ul",null,r.map((e,r)=>{const i=a.find(t=>t.slug===e);if(!i)return null;let f="";return r>0&&"and"===n&&(f=Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(l.__)("All","woocommerce"))),A({type:p,name:Object(F.decodeEntities)(i.name||e),prefix:f,isLoading:s,removeCallback:()=>{const r=u.find(e=>{let{attribute:r}=e;return r==="pa_"+t.name});1===(null==r?void 0:r.slug.length)?R("query_type_"+t.name,"filter_"+t.name):R({["filter_"+t.name]:e}),d||Object(P.a)(u,b,t,e)},showLabel:!1,displayStyle:c})})))},M=e=>{let{displayStyle:t,isLoading:r}=e;return r?Object(o.createElement)(o.Fragment,null,[...Array("list"===t?2:3)].map((e,r)=>Object(o.createElement)("li",{className:"list"===t?"show-loading-state-list":"show-loading-state-chips",key:r},Object(o.createElement)("span",{className:"show-loading-state__inner"})))):null},D=r(
|
14 |
/* translators: %s is referring to the average rating value */
|
15 |
-
Object(l.__)("Rated %s out of 5","woocommerce"),e),removeCallback:()=>{if(i)return R({rating_filter:e});const t=B.filter(t=>t!==e);F(t)},displayStyle:t.displayStyle})):null;var e},[u,B,F,t.displayStyle,i]);if(!u&&!(p.length>0||f.length>0||B.length>0||Number.isFinite(E)||Number.isFinite(N))&&!r)return n(!1),null;const K="h"+t.headingLevel,U=Object(o.createElement)(K,{className:"wc-block-active-filters__title"},t.heading),q=u?Object(o.createElement)(h.a,null,U):U;if(!Object(g.getSettingWithCoercion)("has_filterable_products",!1,j.a))return n(!1),null;n(!0);const G=b()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle,"wc-block-active-filters--loading":u});return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&q,Object(o.createElement)("div",{className:"wc-block-active-filters"},Object(o.createElement)("ul",{className:G},r?Object(o.createElement)(o.Fragment,null,A({type:Object(l.__)("Size","woocommerce"),name:Object(l.__)("Small","woocommerce"),displayStyle:t.displayStyle}),A({type:Object(l.__)("Color","woocommerce"),name:Object(l.__)("Blue","woocommerce"),displayStyle:t.displayStyle})):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(M,{isLoading:u,displayStyle:t.displayStyle}),W,V,Y,z)),u?Object(o.createElement)("span",{className:"wc-block-active-filters__clear-all-placeholder"}):Object(o.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:()=>{(()=>{if(!window)return;const e=window.location.href,t=Object(S.getQueryArgs)(e),r=Object(S.removeQueryArgs)(e,...Object.keys(t)),n=Object.fromEntries(Object.keys(t).filter(e=>!L(e)).map(e=>[e,t[e]])),c=Object(S.addQueryArgs)(r,n);Object(_.c)(c)})(),i||(x(void 0),T(void 0),d([]),k([]),F([]))}},Object(o.createElement)(O.a,{label:Object(l.__)("Clear All","woocommerce"),screenReaderLabel:Object(l.__)("Clear All Filters","woocommerce")}))))},V=(r(419),r(
|
1 |
+
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["active-filters"]=function(e){function t(t){for(var n,l,i=t[0],a=t[1],s=t[2],b=0,p=[];b<i.length;b++)l=i[b],Object.prototype.hasOwnProperty.call(c,l)&&c[l]&&p.push(c[l][0]),c[l]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(u&&u(t);p.length;)p.shift()();return o.push.apply(o,s||[]),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 a=r[i];0!==c[a]&&(n=!1)}n&&(o.splice(t--,1),e=l(l.s=r[0]))}return e}var n={},c={5:0,1:0},o=[];function l(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,l),r.l=!0,r.exports}l.m=e,l.c=n,l.d=function(e,t,r){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(l.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)l.d(r,n,function(t){return e[t]}.bind(null,n));return r},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],a=i.push.bind(i);i.push=t,i=i.slice();for(var s=0;s<i.length;s++)t(i[s]);var u=a;return o.push([417,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.blocks},102:function(e,t,r){"use strict";var n=r(0),c=r(5),o=r(11),l=r(1);r(139),t.a=Object(o.withInstanceId)(e=>{let{className:t,headingLevel:r,onChange:o,heading:i,instanceId:a}=e;const s="h"+r;return Object(n.createElement)(s,{className:t},Object(n.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-"+a},Object(l.__)("Block title","woocommerce")),Object(n.createElement)(c.PlainText,{id:"block-title-"+a,className:"wc-block-editor-components-title",value:i,onChange:o}))})},103:function(e,t,r){"use strict";var n=r(0);r(140),t.a=e=>{let{children:t}=e;return Object(n.createElement)("div",{className:"wc-block-filter-title-placeholder"},t)}},104:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(12);function c(e,t){const r=Object(n.useRef)();return Object(n.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},108:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(9),c=r(7),o=r(0),l=r(40),i=r(142);const a=e=>{const{namespace:t,resourceName:r,resourceValues:a=[],query:s={},shouldSelect:u=!0}=e;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(o.useRef)({results:[],isLoading:!0}),p=Object(l.a)(s),d=Object(l.a)(a),f=Object(i.a)(),m=Object(c.useSelect)(e=>{if(!u)return null;const c=e(n.COLLECTIONS_STORE_KEY),o=[t,r,p,d],l=c.getCollectionError(...o);if(l){if(!(l instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");f(l)}return{results:c.getCollection(...o),isLoading:!c.hasFinishedResolution("getCollection",o)}},[t,r,d,p,u]);return null!==m&&(b.current=m),b.current}},11:function(e,t){e.exports=window.wp.compose},12:function(e,t){e.exports=window.React},123:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(0),c=r(1),o=r(10),l=r(7),i=r(3),a=r(5);const s=e=>{let{clientId:t,setAttributes:r,filterType:s,attributes:u}=e;const{replaceBlock:b}=Object(l.useDispatch)("core/block-editor"),{heading:p,headingLevel:d}=u;if(Object(l.useSelect)(e=>{const{getBlockParentsByBlockName:r}=e("core/block-editor");return r(t,"woocommerce/filter-wrapper").length>0},[t])||!s)return null;const f=[Object(n.createElement)(i.Button,{key:"convert",onClick:()=>{const e=[Object(o.createBlock)("woocommerce/"+s,{...u,heading:""})];p&&""!==p&&e.unshift(Object(o.createBlock)("core/heading",{content:p,level:null!=d?d:2})),b(t,Object(o.createBlock)("woocommerce/filter-wrapper",{heading:p,filterType:s},[...e])),r({heading:"",lock:{remove:!0}})},variant:"primary"},Object(c.__)("Upgrade block","woocommerce"))];return Object(n.createElement)(a.Warning,{actions:f},Object(c.__)("Filter block: We have improved this block to make styling easier. Upgrade it using the button below.","woocommerce"))}},124:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const c=Object(n.createContext)({}),o=()=>{const{wrapper:e}=Object(n.useContext)(c);return t=>{e&&e.current&&(e.current.hidden=!t)}}},125:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"boolean"==typeof e},13:function(e,t){e.exports=window.wp.primitives},139:function(e,t){},140:function(e,t){},142:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0);const c=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},15:function(e,t){e.exports=window.wp.htmlEntities},16:function(e,t){e.exports=window.wp.url},181:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return o}));var n=r(8);const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const o=e.filter(e=>e.attribute===r.taxonomy),l=o.length?o[0]:null;if(!(l&&l.slug&&Array.isArray(l.slug)&&l.slug.includes(c)))return;const i=l.slug.filter(e=>e!==c),a=e.filter(e=>e.attribute!==r.taxonomy);i.length>0&&(l.slug=i.sort(),a.push(l)),t(Object(n.sortBy)(a,"attribute"))},o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=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";if(!r||!r.taxonomy)return[];const l=e.filter(e=>e.attribute!==r.taxonomy);return 0===c.length?t(l):(l.push({attribute:r.taxonomy,operator:o,slug:c.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(n.sortBy)(l,"attribute"))),l}},183:function(e){e.exports=JSON.parse('{"name":"woocommerce/active-filters","version":"1.0.0","title":"Active Product Filters Controls","description":"Display the currently active product filters.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"multiple":false,"inserter":false,"color":{"text":true,"background":false},"lock":false},"attributes":{"displayStyle":{"type":"string","default":"list"},"headingLevel":{"type":"number","default":3}},"textdomain":"woocommerce","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},2:function(e,t){e.exports=window.wc.wcSettings},200:function(e,t){},223:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return l}));var n=r(2);const c=Object(n.getSetting)("attributes",[]).reduce((e,t)=>{const 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;var n;return r&&r.id&&e.push(r),e},[]),o=e=>{if(e)return c.find(t=>t.id===e)},l=e=>{if(e)return c.find(t=>t.taxonomy===e)}},241:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return a})),r.d(t,"d",(function(){return s})),r.d(t,"c",(function(){return u}));var n=r(16),c=r(2),o=r(125);const l=Object(c.getSettingWithCoercion)("is_rendering_php_template",!1,o.a),i="query_type_",a="filter_";function s(e){return window?Object(n.getQueryArg)(window.location.href,e):null}function u(e){l?window.location.href=e:window.history.replaceState({},"",e)}},25:function(e,t){e.exports=window.wp.isShallowEqual},256:function(e,t,r){"use strict";var n=r(6),c=r.n(n),o=r(0),l=r(4),i=r.n(l),a=r(1),s=r(118),u=r(551);r(200);var b=e=>{let{text:t,screenReaderText:r="",element:n="li",className:l="",radius:a="small",children:s=null,...u}=e;const b=n,p=i()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+a),d=Boolean(r&&r!==t);return Object(o.createElement)(b,c()({className:p},u),Object(o.createElement)("span",{"aria-hidden":d,className:"wc-block-components-chip__text"},t),d&&Object(o.createElement)("span",{className:"screen-reader-text"},r),s)};t.a=e=>{let{ariaLabel:t="",className:r="",disabled:n=!1,onRemove:l=(()=>{}),removeOnAnyClick:p=!1,text:d,screenReaderText:f="",...m}=e;const g=p?"span":"button";if(!t){const e=f&&"string"==typeof f?f:d;t="string"!=typeof e?
|
2 |
/* translators: Remove chip. */
|
3 |
Object(a.__)("Remove","woocommerce"):Object(a.sprintf)(
|
4 |
/* translators: %s text of the chip to remove. */
|
5 |
+
Object(a.__)('Remove "%s"',"woocommerce"),e)}const O={"aria-label":t,disabled:n,onClick:l,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||l()}},j=p?O:{},y=p?{"aria-hidden":!0}:O;return Object(o.createElement)(b,c()({},m,j,{className:i()(r,"is-removable"),element:p?"button":m.element,screenReaderText:f,text:d}),Object(o.createElement)(g,c()({className:"wc-block-components-chip__remove"},y),Object(o.createElement)(s.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},26:function(e,t){e.exports=window.wc.priceFormat},29:function(e,t,r){"use strict";var n=r(0),c=r(4),o=r.n(c);t.a=e=>{let t,{label:r,screenReaderLabel:c,wrapperElement:l,wrapperProps:i={}}=e;const a=null!=r,s=null!=c;return!a&&s?(t=l||"span",i={...i,className:o()(i.className,"screen-reader-text")},Object(n.createElement)(t,i,c)):(t=l||n.Fragment,a&&s&&r!==c?Object(n.createElement)(t,i,Object(n.createElement)("span",{"aria-hidden":"true"},r),Object(n.createElement)("span",{className:"screen-reader-text"},c)):Object(n.createElement)(t,i,r))}},3:function(e,t){e.exports=window.wp.components},35:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));const n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function c(e,t){return n(e)&&t in e}},40:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(0),c=r(25),o=r.n(c);function l(e){const t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},410:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return i}));var n=r(35);const c=e=>Object(n.b)(e,"count")&&Object(n.b)(e,"description")&&Object(n.b)(e,"id")&&Object(n.b)(e,"name")&&Object(n.b)(e,"parent")&&Object(n.b)(e,"slug")&&"number"==typeof e.count&&"string"==typeof e.description&&"number"==typeof e.id&&"string"==typeof e.name&&"number"==typeof e.parent&&"string"==typeof e.slug,o=e=>Array.isArray(e)&&e.every(c),l=e=>Object(n.b)(e,"attribute")&&Object(n.b)(e,"operator")&&Object(n.b)(e,"slug")&&"string"==typeof e.attribute&&"string"==typeof e.operator&&Array.isArray(e.slug)&&e.slug.every(e=>"string"==typeof e),i=e=>Array.isArray(e)&&e.every(l)},417:function(e,t,r){e.exports=r(483)},418:function(e,t,r){"use strict";var n=r(0),c=r(13);const 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:"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"}));t.a=o},419:function(e,t){},420:function(e,t){},44:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const c=Object(n.createContext)("page"),o=()=>Object(n.useContext)(c);c.Provider},483:function(e,t,r){"use strict";r.r(t);var n=r(6),c=r.n(n),o=r(0),l=r(1),i=r(10),a=r(418),s=r(118),u=r(4),b=r.n(u),p=r(5),d=r(102),f=r(3),m=r(52),g=r(2),O=r(29),j=r(125),y=r(35),w=r(410),_=r(241),h=r(103);r(420);var v=r(223),k=r(26),E=r(256),S=r(16),x=r(551),N=(r(96),r(183));const C=(e,t)=>Number.isFinite(e)&&Number.isFinite(t)?Object(l.sprintf)(
|
6 |
/* translators: %1$s min price, %2$s max price */
|
7 |
Object(l.__)("Between %1$s and %2$s","woocommerce"),Object(k.formatPrice)(e),Object(k.formatPrice)(t)):Number.isFinite(e)?Object(l.sprintf)(
|
8 |
/* translators: %s min price */
|
10 |
/* translators: %s max price */
|
11 |
Object(l.__)("Up to %s","woocommerce"),Object(k.formatPrice)(t)),A=e=>{let{type:t,name:r,prefix:n="",removeCallback:c=(()=>null),showLabel:i=!0,displayStyle:a}=e;const u=n?Object(o.createElement)(o.Fragment,null,n," ",r):r,b=Object(l.sprintf)(
|
12 |
/* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
|
13 |
+
Object(l.__)("Remove %s filter","woocommerce"),r);return Object(o.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},i&&Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===a?Object(o.createElement)(E.a,{element:"span",text:u,onRemove:c,radius:"large",ariaLabel:b}):Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-name"},Object(o.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:c},Object(o.createElement)(s.a,{className:"wc-block-components-chip__remove-icon",icon:x.a,size:16}),Object(o.createElement)(O.a,{screenReaderLabel:b})),u))},R=function(){if(!window)return;const e=window.location.href,t=Object(S.getQueryArgs)(e),r=Object(S.removeQueryArgs)(e,...Object.keys(t));for(var n=arguments.length,c=new Array(n),o=0;o<n;o++)c[o]=arguments[o];c.forEach(e=>{if("string"==typeof e)return delete t[e];if("object"==typeof e){const r=Object.keys(e)[0],n=t[r].toString().split(",");t[r]=n.filter(t=>t!==e[r]).join(",")}});const l=Object.fromEntries(Object.entries(t).filter(e=>{let[,t]=e;return t})),i=Object(S.addQueryArgs)(r,l);Object(_.c)(i)},T=["min_price","max_price","rating_filter","filter_","query_type_"],L=e=>{let t=!1;for(let r=0;T.length>r;r++){const n=T[r];if(n===e.substring(0,n.length)){t=!0;break}}return t};var B=r(108),F=r(15),P=r(181),Q=e=>{let{attributeObject:t,slugs:r=[],operator:n="in",displayStyle:c,isLoadingCallback:i}=e;const{results:a,isLoading:s}=Object(B.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[t.id]}),[u,b]=Object(m.b)("attributes",[]);if(Object(o.useEffect)(()=>{i(s)},[s,i]),!Array.isArray(a)||!Object(w.b)(a)||!Object(w.a)(u))return null;const p=t.label,d=Object(g.getSettingWithCoercion)("is_rendering_php_template",!1,j.a);return Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},p,":"),Object(o.createElement)("ul",null,r.map((e,r)=>{const i=a.find(t=>t.slug===e);if(!i)return null;let f="";return r>0&&"and"===n&&(f=Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(l.__)("All","woocommerce"))),A({type:p,name:Object(F.decodeEntities)(i.name||e),prefix:f,isLoading:s,removeCallback:()=>{const r=u.find(e=>{let{attribute:r}=e;return r==="pa_"+t.name});1===(null==r?void 0:r.slug.length)?R("query_type_"+t.name,"filter_"+t.name):R({["filter_"+t.name]:e}),d||Object(P.a)(u,b,t,e)},showLabel:!1,displayStyle:c})})))},M=e=>{let{displayStyle:t,isLoading:r}=e;return r?Object(o.createElement)(o.Fragment,null,[...Array("list"===t?2:3)].map((e,r)=>Object(o.createElement)("li",{className:"list"===t?"show-loading-state-list":"show-loading-state-chips",key:r},Object(o.createElement)("span",{className:"show-loading-state__inner"})))):null},D=r(124),I=e=>{let{attributes:t,isEditor:r=!1}=e;const n=Object(D.a)(),c=function(){const e=Object(o.useRef)(!1);return Object(o.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),Object(o.useCallback)(()=>e.current,[])}()(),i=Object(g.getSettingWithCoercion)("is_rendering_php_template",!1,j.a),[a,s]=Object(o.useState)(!0),u=(()=>{if(!window)return!1;const e=window.location.href,t=Object(S.getQueryArgs)(e),r=Object.keys(t);let n=!1;for(let e=0;r.length>e;e++){const t=r[e];if(L(t)){n=!0;break}}return n})()&&!r&&a,[p,d]=Object(m.b)("attributes",[]),[f,k]=Object(m.b)("stock_status",[]),[E,x]=Object(m.b)("min_price"),[N,T]=Object(m.b)("max_price"),[B,F]=Object(m.b)("rating"),P=Object(g.getSetting)("stockStatusOptions",[]),I=Object(g.getSetting)("attributes",[]),V=Object(o.useMemo)(()=>{return!u&&0!==f.length&&(e=f,Array.isArray(e)&&e.every(e=>["instock","outofstock","onbackorder"].includes(e)))&&(e=>Object(y.a)(e)&&Object.keys(e).every(e=>["instock","outofstock","onbackorder"].includes(e)))(P)?f.map(e=>A({type:Object(l.__)("Stock Status","woocommerce"),name:P[e],removeCallback:()=>{if(R({filter_stock_status:e}),!i){const t=f.filter(t=>t!==e);k(t)}},displayStyle:t.displayStyle})):null;var e},[u,P,f,k,t.displayStyle,i]),W=Object(o.useMemo)(()=>u||!Number.isFinite(E)&&!Number.isFinite(N)?null:A({type:Object(l.__)("Price","woocommerce"),name:C(E,N),removeCallback:()=>{R("max_price","min_price"),i||(x(void 0),T(void 0))},displayStyle:t.displayStyle}),[u,E,N,t.displayStyle,x,T,i]),Y=Object(o.useMemo)(()=>!Object(w.a)(p)&&c||!p.length&&!(e=>{if(!window)return!1;const t=e.map(e=>"filter_"+e.attribute_name),r=window.location.href,n=Object(S.getQueryArgs)(r),c=Object.keys(n);let o=!1;for(let e=0;c.length>e;e++){const r=c[e];if(t.includes(r)){o=!0;break}}return o})(I)?(a&&s(!1),null):p.map(e=>{const r=Object(v.b)(e.attribute);return r?Object(o.createElement)(Q,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator,isLoadingCallback:s}):(a&&s(!1),null)}),[p,c,I,a,t.displayStyle]);Object(o.useEffect)(()=>{var e;if(!i)return;if(B.length&&B.length>0)return;const t=null===(e=Object(_.d)("rating_filter"))||void 0===e?void 0:e.toString();t&&F(t.split(","))},[i,B,F]);const z=Object(o.useMemo)(()=>{return!u&&0!==B.length&&(e=B,Array.isArray(e)&&e.every(e=>["1","2","3","4","5"].includes(e)))?B.map(e=>A({type:Object(l.__)("Rating","woocommerce"),name:Object(l.sprintf)(
|
14 |
/* translators: %s is referring to the average rating value */
|
15 |
+
Object(l.__)("Rated %s out of 5","woocommerce"),e),removeCallback:()=>{if(i)return R({rating_filter:e});const t=B.filter(t=>t!==e);F(t)},displayStyle:t.displayStyle})):null;var e},[u,B,F,t.displayStyle,i]);if(!u&&!(p.length>0||f.length>0||B.length>0||Number.isFinite(E)||Number.isFinite(N))&&!r)return n(!1),null;const K="h"+t.headingLevel,U=Object(o.createElement)(K,{className:"wc-block-active-filters__title"},t.heading),q=u?Object(o.createElement)(h.a,null,U):U;if(!Object(g.getSettingWithCoercion)("has_filterable_products",!1,j.a))return n(!1),null;n(!0);const G=b()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle,"wc-block-active-filters--loading":u});return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&q,Object(o.createElement)("div",{className:"wc-block-active-filters"},Object(o.createElement)("ul",{className:G},r?Object(o.createElement)(o.Fragment,null,A({type:Object(l.__)("Size","woocommerce"),name:Object(l.__)("Small","woocommerce"),displayStyle:t.displayStyle}),A({type:Object(l.__)("Color","woocommerce"),name:Object(l.__)("Blue","woocommerce"),displayStyle:t.displayStyle})):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(M,{isLoading:u,displayStyle:t.displayStyle}),W,V,Y,z)),u?Object(o.createElement)("span",{className:"wc-block-active-filters__clear-all-placeholder"}):Object(o.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:()=>{(()=>{if(!window)return;const e=window.location.href,t=Object(S.getQueryArgs)(e),r=Object(S.removeQueryArgs)(e,...Object.keys(t)),n=Object.fromEntries(Object.keys(t).filter(e=>!L(e)).map(e=>[e,t[e]])),c=Object(S.addQueryArgs)(r,n);Object(_.c)(c)})(),i||(x(void 0),T(void 0),d([]),k([]),F([]))}},Object(o.createElement)(O.a,{label:Object(l.__)("Clear All","woocommerce"),screenReaderLabel:Object(l.__)("Clear All Filters","woocommerce")}))))},V=(r(419),r(123)),W=Object(f.withSpokenMessages)(e=>{let{attributes:t,setAttributes:r,clientId:n}=e;const{className:c,displayStyle:i,heading:a,headingLevel:s}=t,u=Object(p.useBlockProps)({className:c});return Object(o.createElement)("div",u,Object(o.createElement)(p.InspectorControls,{key:"inspector"},Object(o.createElement)(f.PanelBody,{title:Object(l.__)("Display Settings","woocommerce")},Object(o.createElement)(f.__experimentalToggleGroupControl,{label:Object(l.__)("Display Style","woocommerce"),value:i,onChange:e=>r({displayStyle:e}),className:"wc-block-active-filter__style-toggle"},Object(o.createElement)(f.__experimentalToggleGroupControlOption,{value:"list",label:Object(l.__)("List","woocommerce")}),Object(o.createElement)(f.__experimentalToggleGroupControlOption,{value:"chips",label:Object(l.__)("Chips","woocommerce")})))),Object(o.createElement)(V.a,{attributes:t,clientId:n,setAttributes:r,filterType:"active-filters"}),a&&Object(o.createElement)(d.a,{className:"wc-block-active-filters__title",headingLevel:s,heading:a,onChange:e=>r({heading:e})}),Object(o.createElement)(f.Disabled,null,Object(o.createElement)(I,{attributes:t,isEditor:!0})))});const Y={heading:{type:"string",default:Object(l.__)("Active filters","woocommerce")}};Object(i.registerBlockType)(N,{icon:{src:Object(o.createElement)(s.a,{icon:a.a,className:"wc-block-editor-components-block-icon"})},attributes:{...N.attributes,...Y},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:r}=e;return"woocommerce_layered_nav_filters"===t&&!(null==r||!r.raw)},transform:e=>{var t;let{instance:r}=e;return Object(i.createBlock)("woocommerce/active-filters",{displayStyle:"list",heading:(null==r||null===(t=r.raw)||void 0===t?void 0:t.title)||Object(l.__)("Active filters","woocommerce"),headingLevel:3})}}]},edit:W,save(e){let{attributes:t}=e;const{className:r,displayStyle:n,heading:l,headingLevel:i}=t,a={"data-display-style":n,"data-heading":l,"data-heading-level":i};return Object(o.createElement)("div",c()({},p.useBlockProps.save({className:b()("is-loading",r)}),a),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-product-filters__placeholder"}))}})},5:function(e,t){e.exports=window.wp.blockEditor},52:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return d}));var n=r(9),c=r(7),o=r(0),l=r(25),i=r.n(l),a=r(40),s=r(104),u=r(44);const b=e=>{const t=Object(u.a)();e=e||t;const r=Object(c.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:l}=Object(c.useDispatch)(n.QUERY_STATE_STORE_KEY);return[r,Object(o.useCallback)(t=>{l(e,t)},[e,l])]},p=(e,t,r)=>{const l=Object(u.a)();r=r||l;const i=Object(c.useSelect)(c=>c(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t),[r,e]),{setQueryValue:a}=Object(c.useDispatch)(n.QUERY_STATE_STORE_KEY);return[i,Object(o.useCallback)(t=>{a(r,e,t)},[r,e,a])]},d=(e,t)=>{const r=Object(u.a)();t=t||r;const[n,c]=b(t),l=Object(a.a)(n),p=Object(a.a)(e),d=Object(s.a)(p),f=Object(o.useRef)(!1);return Object(o.useEffect)(()=>{i()(d,p)||(c(Object.assign({},l,p)),f.current=!0)},[l,p,d,c]),f.current?[n,c]:[e,c]}},7:function(e,t){e.exports=window.wp.data},8:function(e,t){e.exports=window.lodash},9:function(e,t){e.exports=window.wc.wcBlocksData},96:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>"string"==typeof e}});
|
packages/woocommerce-blocks/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-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'bc331b2bf9352403ee480598c63b21f8');
|
packages/woocommerce-blocks/build/all-products-frontend.js
CHANGED
@@ -1,11 +1,11 @@
|
|
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(l&&l(t);s.length;)s.shift()()}var n={},r={13:0,9:0};function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(e){var t=[],n=r[e];if(0!==n)if(n)t.push(n[2]);else{var c=new Promise((function(t,o){n=r[e]=[t,o]}));t.push(n[2]=c);var i,a=document.createElement("script");a.charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.src=function(e){return o.p+""+({0:"vendors--cart-blocks/cart-cross-sells-products--cart-blocks/cart-line-items--cart-blocks/cart-order--671ca56f",1:"vendors--cart-blocks/cart-cross-sells-products--cart-blocks/order-summary-shipping--checkout-blocks--18f9376a",4:"cart-blocks/cart-cross-sells-products--product-add-to-cart",10:"vendors--cart-blocks/cart-cross-sells-products--product-add-to-cart",67:"product-add-to-cart",68:"product-button",69:"product-category-list",70:"product-image",71:"product-price",72:"product-rating",73:"product-sale-badge",74:"product-sku",75:"product-stock-indicator",76:"product-summary",77:"product-tag-list",78:"product-title"}[e]||e)+"-frontend.js?ver="+{0:"57e05ea9ff2ec18b2173",1:"ac9f9ace474f492db2d1",4:"f9ccd5f8b020ae11aad8",10:"9b3325642e17a25a3f2f",67:"b854724dcb721f3154ca",68:"79df5554e3d121cf86c9",69:"ee28f6d44a243e246691",70:"46ab4d0eca0a03cdf411",71:"5a11b2dd2a3e45bf5039",72:"e33571a23b3982a22bb4",73:"cd7912c7e1f93b1bcbf7",74:"3d4e0936bf29626c7fe7",75:"37bfa489d901c21edd93",76:"2120e5303ac2c50f9a11",77:"af981af1ce6c97429407",78:"fe5b6f4f27c7d3821916"}[e]}(e);var l=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;l.message="Loading chunk "+e+" failed.\n("+o+": "+c+")",l.name="ChunkLoadError",l.type=o,l.request=c,n[1](l)}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 l=i;o(o.s=237)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t){e.exports=window.wp.data},function(e,t,n){var r;!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)){if(r.length){var i=o.apply(null,r);i&&e.push(i)}}else if("object"===c)if(r.toString===Object.prototype.toString)for(var a in r)n.call(r,a)&&r[a]&&e.push(a);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.React},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=window.wp.compose},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.__esModule=!0,e.exports.default=e.exports,n.apply(this,arguments)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t){e.exports=window.wp.url},function(e,t){e.exports=window.wp.primitives},function(e,t,n){"use strict";var r=n(16),o=n.n(r),c=n(0),i=n(7),a=n(1),l=n(44),s=e=>{let{imageUrl:t=l.l+"/block-error.svg",header:n=Object(a.__)("Oops!","woocommerce"),text:r=Object(a.__)("There was an error loading the content.","woocommerce"),errorMessage:o,errorMessagePrefix:i=Object(a.__)("Error:","woocommerce"),button:s,showErrorBlock:u=!0}=e;return u?Object(c.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(c.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(c.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},n&&Object(c.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},n),r&&Object(c.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},r),o&&Object(c.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},i?i+" ":"",o),s&&Object(c.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},s))):null};n(33);class u extends i.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(c.createElement)(c.Fragment,null,Object(c.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:n=!0,showErrorBlock:r=!0,text:o,errorMessagePrefix:i,renderError:a,button:l}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof a?a({errorMessage:u}):Object(c.createElement)(s,{showErrorBlock:r,errorMessage:n?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:i,button:l}):this.props.children}}t.a=u},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.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wc.wcBlocksRegistry},,,function(e,t){e.exports=window.wp.deprecated},function(e,t){e.exports=window.wp.htmlEntities},function(e,t,n){"use strict";var r=n(0),o=n(5),c=n.n(o);t.a=e=>{let t,{label:n,screenReaderLabel:o,wrapperElement:i,wrapperProps:a={}}=e;const l=null!=n,s=null!=o;return!l&&s?(t=i||"span",a={...a,className:c()(a.className,"screen-reader-text")},Object(r.createElement)(t,a,o)):(t=i||r.Fragment,l&&s&&n!==o?Object(r.createElement)(t,a,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,a,n))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0);const o=Object(r.createContext)("page"),c=()=>Object(r.useContext)(o);o.Provider},function(e,t){e.exports=window.wp.a11y},,function(e,t,n){"use strict";(function(e){var r=n(0);n(37);const o=Object(r.createContext)({slots:{},fills:{},registerSlot:()=>{void 0!==e&&e.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});t.a=o}).call(this,n(65))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(12),c=n.n(o);function i(e){const t=Object(r.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"string"==typeof e},,function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return m}));var r=n(3),o=n(4),c=n(0),i=n(12),a=n.n(i),l=n(27),s=n(61),u=n(23);const d=e=>{const t=Object(u.a)();e=e||t;const n=Object(o.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:i}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[n,Object(c.useCallback)(t=>{i(e,t)},[e,i])]},p=(e,t,n)=>{const i=Object(u.a)();n=n||i;const a=Object(o.useSelect)(o=>o(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t),[n,e]),{setQueryValue:l}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[a,Object(c.useCallback)(t=>{l(n,e,t)},[n,e,l])]},m=(e,t)=>{const n=Object(u.a)();t=t||n;const[r,o]=d(t),i=Object(l.a)(r),p=Object(l.a)(e),m=Object(s.a)(p),b=Object(c.useRef)(!1);return Object(c.useEffect)(()=>{a()(m,p)||(o(Object.assign({},i,p)),b.current=!0)},[i,p,m,o]),b.current?[r,o]:[e,o]}},function(e,t){e.exports=window.wp.apiFetch},,function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0);n(4);const o=Object(r.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),c=()=>Object(r.useContext)(o)},function(e,t,n){"use strict";var r=n(5),o=n.n(r),c=n(0);t.a=Object(c.forwardRef)((function({as:e="div",className:t,...n},r){return function({as:e="div",...t}){return"function"==typeof t.children?t.children(t):Object(c.createElement)(e,t)}({as:e,className:o()("components-visually-hidden",t),...n,ref:r})}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return O}));var r=n(6),o=n(0),c=n(3),i=n(4),a=n(21),l=n(130),s=n(34),u=n(89);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(i.dispatch)(c.CART_STORE_KEY).invalidateResolutionForStore()},p=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},m=()=>{Object(o.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.b)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.b)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),p),[])},b={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},f={...b,email:""},g={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:c.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},h=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,n]=e;return[t,Object(a.decodeEntities)(n)]})),E={cartCoupons:c.EMPTY_CART_COUPONS,cartItems:c.EMPTY_CART_ITEMS,cartFees:c.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,crossSellsProducts:c.EMPTY_CART_CROSS_SELLS,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:c.EMPTY_CART_ITEM_ERRORS,cartTotals:g,cartIsLoading:!0,cartErrors:c.EMPTY_CART_ERRORS,billingAddress:f,shippingAddress:b,shippingRates:c.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:c.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:c.EMPTY_EXTENSIONS},O=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:n}=Object(s.a)(),a=null==n?void 0:n.previewCart,{shouldSelect:u}=e,d=Object(o.useRef)();m();const p=Object(i.useSelect)((e,n)=>{let{dispatch:r}=n;if(!u)return E;if(t)return{cartCoupons:a.coupons,cartItems:a.items,crossSellsProducts:a.cross_sells,cartFees:a.fees,cartItemsCount:a.items_count,cartItemsWeight:a.items_weight,cartNeedsPayment:a.needs_payment,cartNeedsShipping:a.needs_shipping,cartItemErrors:c.EMPTY_CART_ITEM_ERRORS,cartTotals:a.totals,cartIsLoading:!1,cartErrors:c.EMPTY_CART_ERRORS,billingData:f,billingAddress:f,shippingAddress:b,extensions:c.EMPTY_EXTENSIONS,shippingRates:a.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:a.has_calculated_shipping,paymentRequirements:a.paymentRequirements,receiveCart:"function"==typeof(null==a?void 0:a.receiveCart)?a.receiveCart:()=>{}};const o=e(c.CART_STORE_KEY),i=o.getCartData(),s=o.getCartErrors(),d=o.getCartTotals(),p=!o.hasFinishedResolution("getCartData"),m=o.isCustomerDataUpdating(),{receiveCart:g}=r(c.CART_STORE_KEY),O=h(i.billingAddress),w=i.needsShipping?h(i.shippingAddress):O,y=i.fees.length>0?i.fees.map(e=>h(e)):c.EMPTY_CART_FEES;return{cartCoupons:i.coupons.length>0?i.coupons.map(e=>({...e,label:e.code})):c.EMPTY_CART_COUPONS,cartItems:i.items,crossSellsProducts:i.crossSells,cartFees:y,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors,cartTotals:d,cartIsLoading:p,cartErrors:s,billingData:Object(l.a)(O),billingAddress:Object(l.a)(O),shippingAddress:Object(l.a)(w),extensions:i.extensions,shippingRates:i.shippingRates,isLoadingRates:m,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements,receiveCart:g}},[u]);return d.current&&Object(r.isEqual)(d.current,p)||(d.current=p),d.current}},function(e,t){e.exports=window.wp.warning},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(11),o=n.n(r),c=n(0),i=n(15);const a=[".wp-block-woocommerce-cart"],l=e=>{let{Block:t,containers:n,getProps:r=(()=>({})),getErrorBoundaryProps:a=(()=>({}))}=e;0!==n.length&&Array.prototype.forEach.call(n,(e,n)=>{const l=r(e,n),s=a(e,n),u={...e.dataset,...l.attributes||{}};(e=>{let{Block:t,container:n,attributes:r={},props:a={},errorBoundaryProps:l={}}=e;Object(c.render)(Object(c.createElement)(i.a,l,Object(c.createElement)(c.Suspense,{fallback:Object(c.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(c.createElement)(t,o()({},a,{attributes:r})))),n,()=>{n.classList&&n.classList.remove("is-loading")})})({Block:t,container:e,props:l,attributes:u,errorBoundaryProps:s})})},s=e=>{const t=document.body.querySelectorAll(a.join(",")),{Block:n,getProps:r,getErrorBoundaryProps:o,selector:c}=e;(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrappers:c}=e;const i=document.body.querySelectorAll(o);c&&c.length>0&&Array.prototype.filter.call(i,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,c)),l({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})})({Block:n,getProps:r,getErrorBoundaryProps:o,selector:c,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrapper:c}=e;const i=c.querySelectorAll(o);l({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})})({...e,wrapper:t})})})}},function(e,t){e.exports=window.wc.priceFormat},function(e,t,n){"use strict";var r=n(8),o=n(0),c=n(14),i=function({icon:e,className:t,...n}){const c=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return Object(o.createElement)("span",Object(r.a)({className:c},n))};t.a=function({icon:e=null,size:t=24,...n}){if("string"==typeof e)return Object(o.createElement)(i,Object(r.a)({icon:e},n));if(Object(o.isValidElement)(e)&&i===e.type)return Object(o.cloneElement)(e,{...n});if("function"==typeof e)return e.prototype instanceof o.Component?Object(o.createElement)(e,{size:t,...n}):e({size:t,...n});if(e&&("svg"===e.type||e.type===c.SVG)){const r={width:t,height:t,...e.props,...n};return Object(o.createElement)(c.SVG,r)}return Object(o.isValidElement)(e)?Object(o.cloneElement)(e,{size:t,...n}):e}},,,function(e,t,n){"use strict";var r=n(8),o=n(0),c=n(5),i=n.n(c),a=n(6),l=n(20),s=n.n(l),u=n(10),d=n(45),p=n(90),m=n(1);function b(e,t,n){const{defaultView:r}=t,{frameElement:o}=r;if(!o||t===n.ownerDocument)return e;const c=o.getBoundingClientRect();return new r.DOMRect(e.left+c.left,e.top+c.top,e.width,e.height)}let f=0;function g(e){const t=document.scrollingElement||document.body;e&&(f=t.scrollTop);const n=e?"add":"remove";t.classList[n]("lockscroll"),document.documentElement.classList[n]("lockscroll"),e||(t.scrollTop=f)}let h=0;function E(){return Object(o.useEffect)(()=>(0===h&&g(!0),++h,()=>{1===h&&g(!1),--h}),[]),null}var O=n(26);function w(e){const t=Object(o.useContext)(O.a),n=t.slots[e]||{},r=t.fills[e],c=Object(o.useMemo)(()=>r||[],[r]);return{...n,updateSlot:Object(o.useCallback)(n=>{t.updateSlot(e,n)},[e,t.updateSlot]),unregisterSlot:Object(o.useCallback)(n=>{t.unregisterSlot(e,n)},[e,t.unregisterSlot]),fills:c,registerFill:Object(o.useCallback)(n=>{t.registerFill(e,n)},[e,t.registerFill]),unregisterFill:Object(o.useCallback)(n=>{t.unregisterFill(e,n)},[e,t.unregisterFill])}}var y=Object(o.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});function v({name:e,children:t,registerFill:n,unregisterFill:r}){const c=(e=>{const{getSlot:t,subscribe:n}=Object(o.useContext)(y),[r,c]=Object(o.useState)(t(e));return Object(o.useEffect)(()=>(c(t(e)),n(()=>{c(t(e))})),[e]),r})(e),i=Object(o.useRef)({name:e,children:t});return Object(o.useLayoutEffect)(()=>(n(e,i.current),()=>r(e,i.current)),[]),Object(o.useLayoutEffect)(()=>{i.current.children=t,c&&c.forceUpdate()},[t]),Object(o.useLayoutEffect)(()=>{e!==i.current.name&&(r(i.current.name,i.current),i.current.name=e,n(e,i.current))},[e]),c&&c.node?(Object(a.isFunction)(t)&&(t=t(c.props.fillProps)),Object(o.createPortal)(t,c.node)):null}var j=e=>Object(o.createElement)(y.Consumer,null,({registerFill:t,unregisterFill:n})=>Object(o.createElement)(v,Object(r.a)({},e,{registerFill:t,unregisterFill:n})));class _ extends o.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:n,registerSlot:r}=this.props;e.name!==t&&(n(e.name),r(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:n={},getFills:r}=this.props,c=Object(a.map)(r(t,this),e=>{const t=Object(a.isFunction)(e.children)?e.children(n):e.children;return o.Children.map(t,(e,t)=>{if(!e||Object(a.isString)(e))return e;const n=e.key||t;return Object(o.cloneElement)(e,{key:n})})}).filter(Object(a.negate)(o.isEmptyElement));return Object(o.createElement)(o.Fragment,null,Object(a.isFunction)(e)?e(c):c)}}var x=e=>Object(o.createElement)(y.Consumer,null,({registerSlot:t,unregisterSlot:n,getFills:c})=>Object(o.createElement)(_,Object(r.a)({},e,{registerSlot:t,unregisterSlot:n,getFills:c})));function k(){const[,e]=Object(o.useState)({}),t=Object(o.useRef)(!0);return Object(o.useEffect)(()=>()=>{t.current=!1},[]),()=>{t.current&&e({})}}function S({name:e,children:t}){const n=w(e),r=Object(o.useRef)({rerender:k()});return Object(o.useEffect)(()=>(n.registerFill(r),()=>{n.unregisterFill(r)}),[n.registerFill,n.unregisterFill]),n.ref&&n.ref.current?("function"==typeof t&&(t=t(n.fillProps)),Object(o.createPortal)(t,n.ref.current)):null}var T=Object(o.forwardRef)((function({name:e,fillProps:t={},as:n="div",...c},i){const a=Object(o.useContext)(O.a),l=Object(o.useRef)();return Object(o.useLayoutEffect)(()=>(a.registerSlot(e,l,t),()=>{a.unregisterSlot(e,l)}),[a.registerSlot,a.unregisterSlot,e]),Object(o.useLayoutEffect)(()=>{a.updateSlot(e,t)}),Object(o.createElement)(n,Object(r.a)({ref:Object(u.useMergeRefs)([i,l])},c))}));function N(e){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(j,e),Object(o.createElement)(S,e))}n(12),o.Component;const C=Object(o.forwardRef)(({bubblesVirtually:e,...t},n)=>e?Object(o.createElement)(T,Object(r.a)({},t,{ref:n})):Object(o.createElement)(x,t));function R(e){return"appear"===e?"top":"left"}function A(e,t){const{paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:c}=(i=t).ownerDocument.defaultView.getComputedStyle(i);var i;const a=n?parseInt(n,10):0,l=r?parseInt(r,10):0,s=o?parseInt(o,10):0,u=c?parseInt(c,10):0;return{x:e.left+s,y:e.top+a,width:e.width-s-u,height:e.height-a-l,left:e.left+s,right:e.right-u,top:e.top+a,bottom:e.bottom-l}}function L(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function P(e,t,n=""){e.style[t]!==n&&(e.style[t]=n)}function M(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const D=Object(o.forwardRef)(({headerTitle:e,onClose:t,children:n,className:c,noArrow:a=!0,isAlternate:l,position:f="bottom right",range:g,focusOnMount:h="firstElement",anchorRef:O,shouldAnchorIncludePadding:y,anchorRect:v,getAnchorRect:j,expandOnMobile:_,animate:x=!0,onClickOutside:k,onFocusOutside:S,__unstableStickyBoundaryElement:T,__unstableSlotName:C="Popover",__unstableObserveElement:D,__unstableBoundaryParent:F,__unstableForcePosition:B,__unstableForceXAlignment:I,...H},z)=>{const U=Object(o.useRef)(null),W=Object(o.useRef)(null),G=Object(o.useRef)(),Y=Object(u.useViewportMatch)("medium","<"),[V,Q]=Object(o.useState)(),K=w(C),X=_&&Y,[$,J]=Object(u.useResizeObserver)();a=X||a,Object(o.useLayoutEffect)(()=>{if(X)return M(G.current,"is-without-arrow",a),M(G.current,"is-alternate",l),L(G.current,"data-x-axis"),L(G.current,"data-y-axis"),P(G.current,"top"),P(G.current,"left"),P(W.current,"maxHeight"),void P(W.current,"maxWidth");const e=()=>{if(!G.current||!W.current)return;let e=function(e,t,n,r=!1,o,c){if(t)return t;if(n){if(!e.current)return;const t=n(e.current);return b(t,t.ownerDocument||e.current.ownerDocument,c)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==r?void 0:r.cloneRange))return b(Object(d.getRectangleFromRange)(r),r.endContainer.ownerDocument,c);if("function"==typeof(null==r?void 0:r.getBoundingClientRect)){const e=b(r.getBoundingClientRect(),r.ownerDocument,c);return o?e:A(e,r)}const{top:e,bottom:t}=r,n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=b(new window.DOMRect(n.left,n.top,n.width,i.bottom-n.top),e.ownerDocument,c);return o?a:A(a,r)}if(!e.current)return;const{parentNode:i}=e.current,a=i.getBoundingClientRect();return o?a:A(a,i)}(U,v,j,O,y,G.current);if(!e)return;const{offsetParent:t,ownerDocument:n}=G.current;let r,o=0;if(t&&t!==n.body){const n=t.getBoundingClientRect();o=n.top,e=new window.DOMRect(e.left-n.left,e.top-n.top,e.width,e.height)}var c;F&&(r=null===(c=G.current.closest(".popover-slot"))||void 0===c?void 0:c.parentNode);const i=J.height?J:W.current.getBoundingClientRect(),{popoverTop:s,popoverLeft:u,xAxis:p,yAxis:g,contentHeight:h,contentWidth:E}=function(e,t,n="top",r,o,c,i,a,l){const[s,u="center",d]=n.split(" "),p=function(e,t,n,r,o,c,i,a){const{height:l}=t;if(o){const t=o.getBoundingClientRect().top+l-i;if(e.top<=t)return{yAxis:n,popoverTop:Math.min(e.bottom,t)}}let s=e.top+e.height/2;"bottom"===r?s=e.bottom:"top"===r&&(s=e.top);const u={popoverTop:s,contentHeight:(s-l/2>0?l/2:s)+(s+l/2>window.innerHeight?window.innerHeight-s:l/2)},d={popoverTop:e.top,contentHeight:e.top-10-l>0?l:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+l>window.innerHeight?window.innerHeight-10-e.bottom:l};let m,b=n,f=null;if(!o&&!a)if("middle"===n&&u.contentHeight===l)b="middle";else if("top"===n&&d.contentHeight===l)b="top";else if("bottom"===n&&p.contentHeight===l)b="bottom";else{b=d.contentHeight>p.contentHeight?"top":"bottom";const e="top"===b?d.contentHeight:p.contentHeight;f=e!==l?e:null}return m="middle"===b?u.popoverTop:"top"===b?d.popoverTop:p.popoverTop,{yAxis:b,popoverTop:m,contentHeight:f}}(e,t,s,d,r,0,c,a);return{...function(e,t,n,r,o,c,i,a,l){const{width:s}=t;"left"===n&&Object(m.isRTL)()?n="right":"right"===n&&Object(m.isRTL)()&&(n="left"),"left"===r&&Object(m.isRTL)()?r="right":"right"===r&&Object(m.isRTL)()&&(r="left");const u=Math.round(e.left+e.width/2),d={popoverLeft:u,contentWidth:(u-s/2>0?s/2:u)+(u+s/2>window.innerWidth?window.innerWidth-u:s/2)};let p=e.left;"right"===r?p=e.right:"middle"===c||l||(p=u);let b=e.right;"left"===r?b=e.left:"middle"===c||l||(b=u);const f={popoverLeft:p,contentWidth:p-s>0?s:p},g={popoverLeft:b,contentWidth:b+s>window.innerWidth?window.innerWidth-b:s};let h,E=n,O=null;if(!o&&!a)if("center"===n&&d.contentWidth===s)E="center";else if("left"===n&&f.contentWidth===s)E="left";else if("right"===n&&g.contentWidth===s)E="right";else{E=f.contentWidth>g.contentWidth?"left":"right";const e="left"===E?f.contentWidth:g.contentWidth;s>window.innerWidth&&(O=window.innerWidth),e!==s&&(E="center",d.popoverLeft=window.innerWidth/2)}if(h="center"===E?d.popoverLeft:"left"===E?f.popoverLeft:g.popoverLeft,i){const e=i.getBoundingClientRect();h=Math.min(h,e.right-s),Object(m.isRTL)()||(h=Math.max(h,0))}return{xAxis:E,popoverLeft:h,contentWidth:O}}(e,t,u,d,r,p.yAxis,i,a,l),...p}}(e,i,f,T,G.current,o,r,B,I);"number"==typeof s&&"number"==typeof u&&(P(G.current,"top",s+"px"),P(G.current,"left",u+"px")),M(G.current,"is-without-arrow",a||"center"===p&&"middle"===g),M(G.current,"is-alternate",l),L(G.current,"data-x-axis",p),L(G.current,"data-y-axis",g),P(W.current,"maxHeight","number"==typeof h?h+"px":""),P(W.current,"maxWidth","number"==typeof E?E+"px":""),Q(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[g]||"middle"))};e();const{ownerDocument:t}=G.current,{defaultView:n}=t,r=n.setInterval(e,500);let o;const c=()=>{n.cancelAnimationFrame(o),o=n.requestAnimationFrame(e)};n.addEventListener("click",c),n.addEventListener("resize",e),n.addEventListener("scroll",e,!0);const i=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(O);let s;return i&&i!==t&&(i.defaultView.addEventListener("resize",e),i.defaultView.addEventListener("scroll",e,!0)),D&&(s=new n.MutationObserver(e),s.observe(D,{attributes:!0})),()=>{n.clearInterval(r),n.removeEventListener("resize",e),n.removeEventListener("scroll",e,!0),n.removeEventListener("click",c),n.cancelAnimationFrame(o),i&&i!==t&&(i.defaultView.removeEventListener("resize",e),i.defaultView.removeEventListener("scroll",e,!0)),s&&s.disconnect()}},[X,v,j,O,y,f,J,T,D,F]);const Z=(e,n)=>{if("focus-outside"===e&&S)S(n);else if("focus-outside"===e&&k){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>n.relatedTarget}),s()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),k(e)}else t&&t()},[ee,te]=Object(u.__experimentalUseDialog)({focusOnMount:h,__unstableOnClose:Z,onClose:Z}),ne=Object(u.useMergeRefs)([G,ee,z]),re=Boolean(x&&V)&&function(e){if("loading"===e.type)return i()("components-animate__loading");const{type:t,origin:n=R(t)}=e;if("appear"===t){const[e,t="center"]=n.split(" ");return i()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?i()("components-animate__slide-in","is-from-"+n):void 0}({type:"appear",origin:V});let oe=Object(o.createElement)("div",Object(r.a)({className:i()("components-popover",c,re,{"is-expanded":X,"is-without-arrow":a,"is-alternate":l})},H,{ref:ne},te,{tabIndex:"-1"}),X&&Object(o.createElement)(E,null),X&&Object(o.createElement)("div",{className:"components-popover__header"},Object(o.createElement)("span",{className:"components-popover__header-title"},e),Object(o.createElement)(q,{className:"components-popover__close",icon:p.a,onClick:t})),Object(o.createElement)("div",{ref:W,className:"components-popover__content"},Object(o.createElement)("div",{style:{position:"relative"}},$,n)));return K.ref&&(oe=Object(o.createElement)(N,{name:C},oe)),O||v?oe:Object(o.createElement)("span",{ref:U},oe)});D.Slot=Object(o.forwardRef)((function({name:e="Popover"},t){return Object(o.createElement)(C,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));var F=D,B=function({shortcut:e,className:t}){if(!e)return null;let n,r;return Object(a.isString)(e)&&(n=e),Object(a.isObject)(e)&&(n=e.display,r=e.ariaLabel),Object(o.createElement)("span",{className:t,"aria-label":r},n)};const I=Object(o.createElement)("div",{className:"event-catcher"}),H=({eventHandlers:e,child:t,childrenWithPopover:n})=>Object(o.cloneElement)(Object(o.createElement)("span",{className:"disabled-element-wrapper"},Object(o.cloneElement)(I,e),Object(o.cloneElement)(t,{children:n}),","),e),z=({child:e,eventHandlers:t,childrenWithPopover:n})=>Object(o.cloneElement)(e,{...t,children:n}),U=(e,t,n)=>{if(1!==o.Children.count(e))return;const r=o.Children.only(e);"function"==typeof r.props[t]&&r.props[t](n)};var W=function({children:e,position:t,text:n,shortcut:r}){const[c,i]=Object(o.useState)(!1),[l,s]=Object(o.useState)(!1),d=Object(u.useDebounce)(s,700),p=t=>{U(e,"onMouseDown",t),document.addEventListener("mouseup",f),i(!0)},m=t=>{U(e,"onMouseUp",t),document.removeEventListener("mouseup",f),i(!1)},b=e=>"mouseUp"===e?m:"mouseDown"===e?p:void 0,f=b("mouseUp"),g=(t,n)=>r=>{if(U(e,t,r),r.currentTarget.disabled)return;if("focus"===r.type&&c)return;d.cancel();const o=Object(a.includes)(["focus","mouseenter"],r.type);o!==l&&(n?d(o):s(o))},h=()=>{d.cancel(),document.removeEventListener("mouseup",f)};if(Object(o.useEffect)(()=>h,[]),1!==o.Children.count(e))return e;const E={onMouseEnter:g("onMouseEnter",!0),onMouseLeave:g("onMouseLeave"),onClick:g("onClick"),onFocus:g("onFocus"),onBlur:g("onBlur"),onMouseDown:b("mouseDown")},O=o.Children.only(e),{children:w,disabled:y}=O.props;return(y?H:z)({child:O,eventHandlers:E,childrenWithPopover:(({grandchildren:e,isOver:t,position:n,text:r,shortcut:c})=>Object(o.concatChildren)(e,t&&Object(o.createElement)(F,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(o.createElement)(B,{className:"components-tooltip__shortcut",shortcut:c}))))({grandchildren:w,isOver:l,position:t,text:n,shortcut:r})})},G=n(40),Y=n(35);const V=["onMouseDown","onClick"];var q=t.a=Object(o.forwardRef)((function(e,t){const{href:n,target:c,isSmall:l,isPressed:u,isBusy:d,isDestructive:p,className:m,disabled:b,icon:f,iconPosition:g="left",iconSize:h,showTooltip:E,tooltipPosition:O,shortcut:w,label:y,children:v,text:j,variant:_,__experimentalIsFocusable:x,describedBy:k,...S}=function({isDefault:e,isPrimary:t,isSecondary:n,isTertiary:r,isLink:o,variant:c,...i}){let a=c;var l,u,d,p,m;return t&&(null!==(l=a)&&void 0!==l||(a="primary")),r&&(null!==(u=a)&&void 0!==u||(a="tertiary")),n&&(null!==(d=a)&&void 0!==d||(a="secondary")),e&&(s()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(p=a)&&void 0!==p||(a="secondary")),o&&(null!==(m=a)&&void 0!==m||(a="link")),{...i,variant:a}}(e),T=i()("components-button",m,{"is-secondary":"secondary"===_,"is-primary":"primary"===_,"is-small":l,"is-tertiary":"tertiary"===_,"is-pressed":u,"is-busy":d,"is-link":"link"===_,"is-destructive":p,"has-text":!!f&&!!v,"has-icon":!!f}),N=b&&!x,C=void 0===n||N?"button":"a",R="a"===C?{href:n,target:c}:{type:"button",disabled:N,"aria-pressed":u};if(b&&x){R["aria-disabled"]=!0;for(const e of V)S[e]=e=>{e.stopPropagation(),e.preventDefault()}}const A=!N&&(E&&y||w||!!y&&(!v||Object(a.isArray)(v)&&!v.length)&&!1!==E),L=k?Object(a.uniqueId)():null,P=S["aria-describedby"]||L,M=Object(o.createElement)(C,Object(r.a)({},R,S,{className:T,"aria-label":S["aria-label"]||y,"aria-describedby":P,ref:t}),f&&"left"===g&&Object(o.createElement)(G.a,{icon:f,size:h}),j&&Object(o.createElement)(o.Fragment,null,j),f&&"right"===g&&Object(o.createElement)(G.a,{icon:f,size:h}),v);return A?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(W,{text:k||y,shortcut:w,position:O},M),k&&Object(o.createElement)(Y.a,null,Object(o.createElement)("span",{id:L},k))):Object(o.createElement)(o.Fragment,null,M,k&&Object(o.createElement)(Y.a,null,Object(o.createElement)("span",{id:L},k)))}))},function(e,t,n){"use strict";n.d(t,"n",(function(){return c})),n.d(t,"l",(function(){return i})),n.d(t,"k",(function(){return a})),n.d(t,"m",(function(){return l})),n.d(t,"i",(function(){return s})),n.d(t,"d",(function(){return u})),n.d(t,"f",(function(){return d})),n.d(t,"j",(function(){return p})),n.d(t,"c",(function(){return m})),n.d(t,"e",(function(){return b})),n.d(t,"g",(function(){return f})),n.d(t,"a",(function(){return g})),n.d(t,"h",(function(){return h})),n.d(t,"b",(function(){return E}));var r,o=n(2);const c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"images/",a=c.pluginUrl+"build/",l=c.buildPhase,s=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),m=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),b=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),f=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),E=Object(o.getSetting)("allowedStates",{})},function(e,t){e.exports=window.wp.dom},function(e,t){e.exports=window.wp.hooks},function(e,t){e.exports=window.wc.wcBlocksSharedContext},,,,,,,,,function(e,t,n){"use strict";var r=n(2),o=n(1),c=n(92),i=n(28);const a=Object(r.getSetting)("countryLocale",{}),l=e=>{const 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(o.sprintf)(
|
2 |
/* translators: %s Field label. */
|
3 |
-
Object(o.__)("%s (optional)","woocommerce"),e.label)),e.priority&&(Object(c.a)(e.priority)&&(t.index=e.priority),Object(i.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},s=Object.entries(a).map(e=>{let[t,n]=e;return[t,Object.entries(n).map(e=>{let[t,n]=e;return[t,l(n)]}).reduce((e,t)=>{let[n,r]=t;return e[n]=r,e},{})]}).reduce((e,t)=>{let[n,r]=t;return e[n]=r,e},{});t.a=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=n&&void 0!==s[n]?s[n]:{};return e.map(e=>({key:e,...r.defaultAddressFields[e]||{},...o[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(3),o=n(4),c=n(0),i=n(27),a=n(73);const l=e=>{const{namespace:t,resourceName:n,resourceValues:l=[],query:s={},shouldSelect:u=!0}=e;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");const d=Object(c.useRef)({results:[],isLoading:!0}),p=Object(i.a)(s),m=Object(i.a)(l),b=Object(a.a)(),f=Object(o.useSelect)(e=>{if(!u)return null;const o=e(r.COLLECTIONS_STORE_KEY),c=[t,n,p,m],i=o.getCollectionError(...c);if(i){if(!(i instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");b(i)}return{results:o.getCollection(...c),isLoading:!o.hasFinishedResolution("getCollection",c)}},[t,n,m,p,u]);return null!==f&&(d.current=f),d.current}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(7);function o(e,t){const n=Object(r.useRef)();return Object(r.useEffect)(()=>{n.current===e||t&&!t(e,n.current)||(n.current=e)},[e,t]),n.current}},,,,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 l,s=[],u=!1,d=-1;function p(){u&&l&&(u=!1,l.length?s=l.concat(s):d=-1,s.length&&m())}function m(){if(!u){var e=a(p);u=!0;for(var t=s.length;t;){for(l=s,s=[];++d<t;)l&&l[d].run();d=-1,t=s.length}l=null,u=!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 f(){}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||u||a(m)},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=f,o.addListener=f,o.once=f,o.off=f,o.removeListener=f,o.removeAllListeners=f,o.emit=f,o.prependListener=f,o.prependOnceListener=f,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";n.d(t,"a",(function(){return i}));var r=n(46),o=n(0),c=n(36);const i=()=>{const e=Object(c.a)(),t=Object(o.useRef)(e);return Object(o.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...n,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},function(e,t,n){e.exports=function(){"use strict";function e(t){return(e="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})(t)}function t(e,n){return(t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,n)}function n(){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}}function r(e,o,c){return(r=n()?Reflect.construct:function(e,n,r){var o=[null];o.push.apply(o,n);var c=new(Function.bind.apply(e,o));return r&&t(c,r.prototype),c}).apply(null,arguments)}function o(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,void 0);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)?c(e,void 0):void 0}}(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 c(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 i=Object.hasOwnProperty,a=Object.setPrototypeOf,l=Object.isFrozen,s=Object.getPrototypeOf,u=Object.getOwnPropertyDescriptor,d=Object.freeze,p=Object.seal,m=Object.create,b="undefined"!=typeof Reflect&&Reflect,f=b.apply,g=b.construct;f||(f=function(e,t,n){return e.apply(t,n)}),d||(d=function(e){return e}),p||(p=function(e){return e}),g||(g=function(e,t){return r(e,o(t))});var h,E=T(Array.prototype.forEach),O=T(Array.prototype.pop),w=T(Array.prototype.push),y=T(String.prototype.toLowerCase),v=T(String.prototype.match),j=T(String.prototype.replace),_=T(String.prototype.indexOf),x=T(String.prototype.trim),k=T(RegExp.prototype.test),S=(h=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g(h,t)});function T(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return f(e,t,r)}}function N(e,t,n){n=n||y,a&&a(e,null);for(var r=t.length;r--;){var o=t[r];if("string"==typeof o){var c=n(o);c!==o&&(l(t)||(t[r]=c),o=c)}e[o]=!0}return e}function C(e){var t,n=m(null);for(t in e)f(i,e,[t])&&(n[t]=e[t]);return n}function R(e,t){for(;null!==e;){var n=u(e,t);if(n){if(n.get)return T(n.get);if("function"==typeof n.value)return T(n.value)}e=s(e)}return function(e){return console.warn("fallback value for",e),null}}var A=d(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),L=d(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),P=d(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),M=d(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),D=d(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),F=d(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),B=d(["#text"]),I=d(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),H=d(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),z=d(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),U=d(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),W=p(/\{\{[\w\W]*|[\w\W]*\}\}/gm),G=p(/<%[\w\W]*|[\w\W]*%>/gm),Y=p(/^data-[\-\w.\u00B7-\uFFFF]/),V=p(/^aria-[\-\w]+$/),q=p(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Q=p(/^(?:\w+script|data):/i),K=p(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),X=p(/^html$/i),$=function(){return"undefined"==typeof window?null:window},J=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var r=null;n.currentScript&&n.currentScript.hasAttribute("data-tt-policy-suffix")&&(r=n.currentScript.getAttribute("data-tt-policy-suffix"));var o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};return function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$(),r=function(e){return t(e)};if(r.version="2.4.0",r.removed=[],!n||!n.document||9!==n.document.nodeType)return r.isSupported=!1,r;var c=n.document,i=n.document,a=n.DocumentFragment,l=n.HTMLTemplateElement,s=n.Node,u=n.Element,p=n.NodeFilter,m=n.NamedNodeMap,b=void 0===m?n.NamedNodeMap||n.MozNamedAttrMap:m,f=n.HTMLFormElement,g=n.DOMParser,h=n.trustedTypes,T=u.prototype,Z=R(T,"cloneNode"),ee=R(T,"nextSibling"),te=R(T,"childNodes"),ne=R(T,"parentNode");if("function"==typeof l){var re=i.createElement("template");re.content&&re.content.ownerDocument&&(i=re.content.ownerDocument)}var oe=J(h,c),ce=oe?oe.createHTML(""):"",ie=i,ae=ie.implementation,le=ie.createNodeIterator,se=ie.createDocumentFragment,ue=ie.getElementsByTagName,de=c.importNode,pe={};try{pe=C(i).documentMode?i.documentMode:{}}catch(e){}var me={};r.isSupported="function"==typeof ne&&ae&&void 0!==ae.createHTMLDocument&&9!==pe;var be,fe,ge=W,he=G,Ee=Y,Oe=V,we=Q,ye=K,ve=q,je=null,_e=N({},[].concat(o(A),o(L),o(P),o(D),o(B))),xe=null,ke=N({},[].concat(o(I),o(H),o(z),o(U))),Se=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Te=null,Ne=null,Ce=!0,Re=!0,Ae=!1,Le=!1,Pe=!1,Me=!1,De=!1,Fe=!1,Be=!1,Ie=!1,He=!0,ze=!1,Ue="user-content-",We=!0,Ge=!1,Ye={},Ve=null,qe=N({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Qe=null,Ke=N({},["audio","video","img","source","image","track"]),Xe=null,$e=N({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Je="http://www.w3.org/1998/Math/MathML",Ze="http://www.w3.org/2000/svg",et="http://www.w3.org/1999/xhtml",tt=et,nt=!1,rt=["application/xhtml+xml","text/html"],ot="text/html",ct=null,it=i.createElement("form"),at=function(e){return e instanceof RegExp||e instanceof Function},lt=function(t){ct&&ct===t||(t&&"object"===e(t)||(t={}),t=C(t),be=be=-1===rt.indexOf(t.PARSER_MEDIA_TYPE)?ot:t.PARSER_MEDIA_TYPE,fe="application/xhtml+xml"===be?function(e){return e}:y,je="ALLOWED_TAGS"in t?N({},t.ALLOWED_TAGS,fe):_e,xe="ALLOWED_ATTR"in t?N({},t.ALLOWED_ATTR,fe):ke,Xe="ADD_URI_SAFE_ATTR"in t?N(C($e),t.ADD_URI_SAFE_ATTR,fe):$e,Qe="ADD_DATA_URI_TAGS"in t?N(C(Ke),t.ADD_DATA_URI_TAGS,fe):Ke,Ve="FORBID_CONTENTS"in t?N({},t.FORBID_CONTENTS,fe):qe,Te="FORBID_TAGS"in t?N({},t.FORBID_TAGS,fe):{},Ne="FORBID_ATTR"in t?N({},t.FORBID_ATTR,fe):{},Ye="USE_PROFILES"in t&&t.USE_PROFILES,Ce=!1!==t.ALLOW_ARIA_ATTR,Re=!1!==t.ALLOW_DATA_ATTR,Ae=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Le=t.SAFE_FOR_TEMPLATES||!1,Pe=t.WHOLE_DOCUMENT||!1,Fe=t.RETURN_DOM||!1,Be=t.RETURN_DOM_FRAGMENT||!1,Ie=t.RETURN_TRUSTED_TYPE||!1,De=t.FORCE_BODY||!1,He=!1!==t.SANITIZE_DOM,ze=t.SANITIZE_NAMED_PROPS||!1,We=!1!==t.KEEP_CONTENT,Ge=t.IN_PLACE||!1,ve=t.ALLOWED_URI_REGEXP||ve,tt=t.NAMESPACE||et,t.CUSTOM_ELEMENT_HANDLING&&at(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Se.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&at(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Se.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Se.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Le&&(Re=!1),Be&&(Fe=!0),Ye&&(je=N({},o(B)),xe=[],!0===Ye.html&&(N(je,A),N(xe,I)),!0===Ye.svg&&(N(je,L),N(xe,H),N(xe,U)),!0===Ye.svgFilters&&(N(je,P),N(xe,H),N(xe,U)),!0===Ye.mathMl&&(N(je,D),N(xe,z),N(xe,U))),t.ADD_TAGS&&(je===_e&&(je=C(je)),N(je,t.ADD_TAGS,fe)),t.ADD_ATTR&&(xe===ke&&(xe=C(xe)),N(xe,t.ADD_ATTR,fe)),t.ADD_URI_SAFE_ATTR&&N(Xe,t.ADD_URI_SAFE_ATTR,fe),t.FORBID_CONTENTS&&(Ve===qe&&(Ve=C(Ve)),N(Ve,t.FORBID_CONTENTS,fe)),We&&(je["#text"]=!0),Pe&&N(je,["html","head","body"]),je.table&&(N(je,["tbody"]),delete Te.tbody),d&&d(t),ct=t)},st=N({},["mi","mo","mn","ms","mtext"]),ut=N({},["foreignobject","desc","title","annotation-xml"]),dt=N({},["title","style","font","a","script"]),pt=N({},L);N(pt,P),N(pt,M);var mt=N({},D);N(mt,F);var bt=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:et,tagName:"template"});var n=y(e.tagName),r=y(t.tagName);return e.namespaceURI===Ze?t.namespaceURI===et?"svg"===n:t.namespaceURI===Je?"svg"===n&&("annotation-xml"===r||st[r]):Boolean(pt[n]):e.namespaceURI===Je?t.namespaceURI===et?"math"===n:t.namespaceURI===Ze?"math"===n&&ut[r]:Boolean(mt[n]):e.namespaceURI===et&&!(t.namespaceURI===Ze&&!ut[r])&&!(t.namespaceURI===Je&&!st[r])&&!mt[n]&&(dt[n]||!pt[n])},ft=function(e){w(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ce}catch(t){e.remove()}}},gt=function(e,t){try{w(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){w(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!xe[e])if(Fe||Be)try{ft(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ht=function(e){var t,n;if(De)e="<remove></remove>"+e;else{var r=v(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===be&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var o=oe?oe.createHTML(e):e;if(tt===et)try{t=(new g).parseFromString(o,be)}catch(e){}if(!t||!t.documentElement){t=ae.createDocument(tt,"template",null);try{t.documentElement.innerHTML=nt?"":o}catch(e){}}var c=t.body||t.documentElement;return e&&n&&c.insertBefore(i.createTextNode(n),c.childNodes[0]||null),tt===et?ue.call(t,Pe?"html":"body")[0]:Pe?t.documentElement:c},Et=function(e){return le.call(e.ownerDocument||e,e,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT,null,!1)},Ot=function(e){return e instanceof f&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof b)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},wt=function(t){return"object"===e(s)?t instanceof s:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},yt=function(e,t,n){me[e]&&E(me[e],(function(e){e.call(r,t,n,ct)}))},vt=function(e){var t;if(yt("beforeSanitizeElements",e,null),Ot(e))return ft(e),!0;if(k(/[\u0080-\uFFFF]/,e.nodeName))return ft(e),!0;var n=fe(e.nodeName);if(yt("uponSanitizeElement",e,{tagName:n,allowedTags:je}),e.hasChildNodes()&&!wt(e.firstElementChild)&&(!wt(e.content)||!wt(e.content.firstElementChild))&&k(/<[/\w]/g,e.innerHTML)&&k(/<[/\w]/g,e.textContent))return ft(e),!0;if("select"===n&&k(/<template/i,e.innerHTML))return ft(e),!0;if(!je[n]||Te[n]){if(!Te[n]&&_t(n)){if(Se.tagNameCheck instanceof RegExp&&k(Se.tagNameCheck,n))return!1;if(Se.tagNameCheck instanceof Function&&Se.tagNameCheck(n))return!1}if(We&&!Ve[n]){var o=ne(e)||e.parentNode,c=te(e)||e.childNodes;if(c&&o)for(var i=c.length-1;i>=0;--i)o.insertBefore(Z(c[i],!0),ee(e))}return ft(e),!0}return e instanceof u&&!bt(e)?(ft(e),!0):"noscript"!==n&&"noembed"!==n||!k(/<\/no(script|embed)/i,e.innerHTML)?(Le&&3===e.nodeType&&(t=e.textContent,t=j(t,ge," "),t=j(t,he," "),e.textContent!==t&&(w(r.removed,{element:e.cloneNode()}),e.textContent=t)),yt("afterSanitizeElements",e,null),!1):(ft(e),!0)},jt=function(e,t,n){if(He&&("id"===t||"name"===t)&&(n in i||n in it))return!1;if(Re&&!Ne[t]&&k(Ee,t));else if(Ce&&k(Oe,t));else if(!xe[t]||Ne[t]){if(!(_t(e)&&(Se.tagNameCheck instanceof RegExp&&k(Se.tagNameCheck,e)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(e))&&(Se.attributeNameCheck instanceof RegExp&&k(Se.attributeNameCheck,t)||Se.attributeNameCheck instanceof Function&&Se.attributeNameCheck(t))||"is"===t&&Se.allowCustomizedBuiltInElements&&(Se.tagNameCheck instanceof RegExp&&k(Se.tagNameCheck,n)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(n))))return!1}else if(Xe[t]);else if(k(ve,j(n,ye,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==_(n,"data:")||!Qe[e])if(Ae&&!k(we,j(n,ye,"")));else if(n)return!1;return!0},_t=function(e){return e.indexOf("-")>0},xt=function(t){var n,o,c,i;yt("beforeSanitizeAttributes",t,null);var a=t.attributes;if(a){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe};for(i=a.length;i--;){var s=n=a[i],u=s.name,d=s.namespaceURI;if(o="value"===u?n.value:x(n.value),c=fe(u),l.attrName=c,l.attrValue=o,l.keepAttr=!0,l.forceKeepAttr=void 0,yt("uponSanitizeAttribute",t,l),o=l.attrValue,!l.forceKeepAttr&&(gt(u,t),l.keepAttr))if(k(/\/>/i,o))gt(u,t);else{Le&&(o=j(o,ge," "),o=j(o,he," "));var p=fe(t.nodeName);if(jt(p,c,o)){if(!ze||"id"!==c&&"name"!==c||(gt(u,t),o=Ue+o),oe&&"object"===e(h)&&"function"==typeof h.getAttributeType)if(d);else switch(h.getAttributeType(p,c)){case"TrustedHTML":o=oe.createHTML(o);break;case"TrustedScriptURL":o=oe.createScriptURL(o)}try{d?t.setAttributeNS(d,u,o):t.setAttribute(u,o),O(r.removed)}catch(e){}}}}yt("afterSanitizeAttributes",t,null)}},kt=function e(t){var n,r=Et(t);for(yt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)yt("uponSanitizeShadowNode",n,null),vt(n)||(n.content instanceof a&&e(n.content),xt(n));yt("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(t){var o,i,l,u,d,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((nt=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!wt(t)){if("function"!=typeof t.toString)throw S("toString is not a function");if("string"!=typeof(t=t.toString()))throw S("dirty is not a string, aborting")}if(!r.isSupported){if("object"===e(n.toStaticHTML)||"function"==typeof n.toStaticHTML){if("string"==typeof t)return n.toStaticHTML(t);if(wt(t))return n.toStaticHTML(t.outerHTML)}return t}if(Me||lt(p),r.removed=[],"string"==typeof t&&(Ge=!1),Ge){if(t.nodeName){var m=fe(t.nodeName);if(!je[m]||Te[m])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof s)1===(i=(o=ht("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?o=i:o.appendChild(i);else{if(!Fe&&!Le&&!Pe&&-1===t.indexOf("<"))return oe&&Ie?oe.createHTML(t):t;if(!(o=ht(t)))return Fe?null:Ie?ce:""}o&&De&&ft(o.firstChild);for(var b=Et(Ge?t:o);l=b.nextNode();)3===l.nodeType&&l===u||vt(l)||(l.content instanceof a&&kt(l.content),xt(l),u=l);if(u=null,Ge)return t;if(Fe){if(Be)for(d=se.call(o.ownerDocument);o.firstChild;)d.appendChild(o.firstChild);else d=o;return xe.shadowroot&&(d=de.call(c,d,!0)),d}var f=Pe?o.outerHTML:o.innerHTML;return Pe&&je["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&k(X,o.ownerDocument.doctype.name)&&(f="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+f),Le&&(f=j(f,ge," "),f=j(f,he," ")),oe&&Ie?oe.createHTML(f):f},r.setConfig=function(e){lt(e),Me=!0},r.clearConfig=function(){ct=null,Me=!1},r.isValidAttribute=function(e,t,n){ct||lt({});var r=fe(e),o=fe(t);return jt(r,o,n)},r.addHook=function(e,t){"function"==typeof t&&(me[e]=me[e]||[],w(me[e],t))},r.removeHook=function(e){if(me[e])return O(me[e])},r.removeHooks=function(e){me[e]&&(me[e]=[])},r.removeAllHooks=function(){me={}},r}()}()},,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);const o=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return l}));const r=window.CustomEvent||null,o=(e,t)=>{let{bubbles:n=!1,cancelable:o=!1,element:c,detail:i={}}=t;if(!r)return;c||(c=document.body);const a=new r(e,{bubbles:n,cancelable:o,detail:i});c.dispatchEvent(a)};let c;const i=()=>{c&&clearTimeout(c),c=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},a=e=>{let{preserveCartData:t=!1}=e;o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},l=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const c=()=>{o(t,{bubbles:n,cancelable:r})};return jQuery(document).on(e,c),()=>jQuery(document).off(e,c)}},function(e,t,n){"use strict";var r=n(0),o=n(14);const 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";n.d(t,"a",(function(){return r}));const r=e=>"number"==typeof e},,,,,,function(e,t,n){"use strict";var r=n(0),o=n(6),c=n(5),i=n.n(c),a=n(1),l=n(24),s=n(90),u=n(43);function d(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}t.a=function({className:e,status:t="info",children:n,spokenMessage:c=n,onRemove:p=o.noop,isDismissible:m=!0,actions:b=[],politeness:f=d(t),__unstableHTML:g,onDismiss:h=o.noop}){!function(e,t){const n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)(()=>{n&&Object(l.speak)(n,t)},[n,t])}(c,f);const E=i()(e,"components-notice","is-"+t,{"is-dismissible":m});return g&&(n=Object(r.createElement)(r.RawHTML,null,n)),Object(r.createElement)("div",{className:E},Object(r.createElement)("div",{className:"components-notice__content"},n,Object(r.createElement)("div",{className:"components-notice__actions"},b.map(({className:e,label:t,isPrimary:n,variant:o,noDefaultClasses:c=!1,onClick:a,url:l},s)=>{let d=o;return"primary"===o||c||(d=l?"link":"secondary"),void 0===d&&n&&(d="primary"),Object(r.createElement)(u.a,{key:s,href:l,variant:d,onClick:l?void 0:a,className:i()("components-notice__action",e)},t)}))),m&&Object(r.createElement)(u.a,{className:"components-notice__dismiss",icon:s.a,label:Object(a.__)("Dismiss this notice"),onClick:e=>{var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),h(),p()},showTooltip:!1}))}},function(e,t,n){"use strict";var r=n(11),o=n.n(r),c=n(0);n(122);const i=e=>{if(!e)return;const t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()};t.a=e=>t=>{const n=Object(c.useRef)(null);return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:n,"aria-hidden":!0}),Object(c.createElement)(e,o()({},t,{scrollToTop:e=>{null!==n.current&&((e,t)=>{const{focusableSelector:n}=t||{};window&&Number.isFinite(window.innerHeight)&&(n?((e,t)=>{var n;const r=(null===(n=e.parentElement)||void 0===n?void 0:n.querySelectorAll(t))||[];if(r.length){const e=r[0];i(e),null==e||e.focus()}else i(e)})(e,n):i(e))})(n.current,e)}})))}},function(e,t){e.exports=window.wp.blocks},,function(e,t){},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(67);const o=["a","b","em","i","strong","p","br"],c=["target","href","rel","name","download"],i=(e,t)=>{const n=(null==t?void 0:t.tags)||o,i=(null==t?void 0:t.attr)||c;return Object(r.sanitize)(e,{ALLOWED_TAGS:n,ALLOWED_ATTR:i})}},,function(e,t){e.exports=window.wp.blockEditor},,,function(e,t,n){"use strict";var r=n(0);t.a=function(e){let{icon:t,size:n=24,...o}=e;return Object(r.cloneElement)(t,{width:n,height:n,...o})}},,,,,,,,,,,function(e,t){},function(e,t,n){"use strict";var r=n(0),o=n(5),c=n.n(o),i=n(22),a=n(10);n(136),t.a=Object(a.withInstanceId)(e=>{let{className:t,instanceId:n,label:o="",onChange:a,options:l,screenReaderLabel:s,value:u=""}=e;const d="wc-block-components-sort-select__select-"+n;return Object(r.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(r.createElement)(i.a,{label:o,screenReaderLabel:s,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(r.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:a,value:u},l&&l.map(e=>Object(r.createElement)("option",{key:e.key,value:e.key},e.label))))})},,,,function(e,t){e.exports=window.wp.wordcount},function(e,t){e.exports=window.wp.autop},,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(56),o=(n(13),n(2));const c=e=>{const t=Object.keys(o.defaultAddressFields),n=Object(r.a)(t,{},e.country),c=Object.assign({},e);return n.forEach(t=>{let{key:n="",hidden:r=!1}=t;r&&((e,t)=>e in t)(n,e)&&(c[n]="")}),c}},,function(e,t){e.exports=window.wc.wcBlocksSharedHocs},,,,function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var r=n(11),o=n.n(r),c=n(0),i=n(5),a=n.n(i),l=n(98),s=n(106),u=n(4),d=n(3);n(102);const p=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""},m=e=>{let{className:t,context:n="default",additionalNotices:r=[]}=e;const i=Object(u.useSelect)(e=>e(d.PAYMENT_STORE_KEY).isExpressPaymentMethodActive()),{notices:m}=Object(u.useSelect)(e=>({notices:e("core/notices").getNotices(n)})),{removeNotice:b}=Object(u.useDispatch)("core/notices"),f=m.filter(e=>"snackbar"!==e.type).concat(r);if(!f.length)return null;const g=a()(t,"wc-block-components-notices");return i?null:Object(c.createElement)("div",{className:g},f.map(e=>Object(c.createElement)(l.a,o()({key:"store-notice-"+e.id},e,{className:a()("wc-block-components-notices__notice",p(e)),onRemove:()=>{e.isDismissible&&b(e.id,n)}}),Object(s.a)(e.content))))}},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(17),o=n(0),c=n(44);n.p=c.k,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)(()=>Promise.all([n.e(0),n.e(71)]).then(n.bind(null,359)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)(()=>n.e(70).then(n.bind(null,499)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)(()=>n.e(78).then(n.bind(null,500)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)(()=>n.e(72).then(n.bind(null,360)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)(()=>n.e(68).then(n.bind(null,361)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)(()=>n.e(76).then(n.bind(null,436)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)(()=>n.e(73).then(n.bind(null,317)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)(()=>n.e(74).then(n.bind(null,437)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)(()=>n.e(69).then(n.bind(null,438)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)(()=>n.e(77).then(n.bind(null,439)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)(()=>n.e(75).then(n.bind(null,440)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)(()=>Promise.all([n.e(1),n.e(10),n.e(4),n.e(67)]).then(n.bind(null,501)))});const i=e=>Object(r.getRegisteredBlockComponents)(e)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){e.exports=n(263)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(38),c=n(7),i=n(1),a=n(6),l=n(5),s=n.n(l),u=n(22);n(240);var d=e=>{let{currentPage:t,displayFirstAndLastPages:n=!0,displayNextAndPreviousArrows:o=!0,pagesToDisplay:c=3,onPageChange:a,totalPages:l}=e,{minIndex:d,maxIndex:p}=((e,t,n)=>{if(n<=2)return{minIndex:null,maxIndex:null};const 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}})(c,t,l);const m=n&&Boolean(1!==d),b=n&&Boolean(p!==l),f=n&&Boolean(d&&d>3),g=n&&Boolean(p&&p<l-2);m&&3===d&&(d-=1),b&&p===l-2&&(p+=1);const h=[];if(d&&p)for(let e=d;e<=p;e++)h.push(e);return Object(r.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(r.createElement)(u.a,{screenReaderLabel:Object(i.__)("Navigate to another page","woocommerce")}),o&&Object(r.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>a(t-1),title:Object(i.__)("Previous page","woocommerce"),disabled:t<=1},Object(r.createElement)(u.a,{label:"←",screenReaderLabel:Object(i.__)("Previous page","woocommerce")})),m&&Object(r.createElement)("button",{className:s()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:()=>a(1),disabled:1===t},Object(r.createElement)(u.a,{label:"1",screenReaderLabel:Object(i.sprintf)(
|
4 |
/* translators: %d is the page number (1, 2, 3...). */
|
5 |
Object(i.__)("Page %d","woocommerce"),1)})),f&&Object(r.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(i.__)("…","woocommerce")),h.map(e=>Object(r.createElement)("button",{key:e,className:s()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?void 0:()=>a(e),disabled:t===e},Object(r.createElement)(u.a,{label:e.toString(),screenReaderLabel:Object(i.sprintf)(
|
6 |
/* translators: %d is the page number (1, 2, 3...). */
|
7 |
Object(i.__)("Page %d","woocommerce"),e)}))),g&&Object(r.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(i.__)("…","woocommerce")),b&&Object(r.createElement)("button",{className:s()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===l,"wc-block-components-pagination__page--active":t===l}),onClick:()=>a(l),disabled:t===l},Object(r.createElement)(u.a,{label:l.toString(),screenReaderLabel:Object(i.sprintf)(
|
8 |
/* translators: %d is the page number (1, 2, 3...). */
|
9 |
-
Object(i.__)("Page %d","woocommerce"),l)})),o&&Object(r.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>a(t+1),title:Object(i.__)("Next page","woocommerce"),disabled:t>=l},Object(r.createElement)(u.a,{label:"→",screenReaderLabel:Object(i.__)("Next page","woocommerce")})))},p=n(61),m=n(
|
10 |
/* translators: %s is an integer higher than 0 (1, 2, 3...) */
|
11 |
-
Object(i._n)("%d product found","%d products found",e,"woocommerce"),e)))})(D))},[null==U?void 0:U.totalQuery,D,o,H]);const{contentVisibility:W}=t,G=t.columns*t.rows,Y=!Number.isFinite(D)&&Number.isFinite(null==U?void 0:U.totalProducts)&&Object(a.isEqual)(H,null==U?void 0:U.totalQuery)?Math.ceil(((null==U?void 0:U.totalProducts)||0)/G):Math.ceil(D/G),V=M.length?M:Array.from({length:G}),q=0!==M.length||F,Q=g.length>0||w.length>0||j.length>0||Number.isFinite(S)||Number.isFinite(N);return Object(r.createElement)("div",{className:(()=>{const{columns:e,rows:n,alignButtons:r,align:o}=t,c=void 0!==o?"align"+o:"";return s()(B,c,"has-"+e+"-columns",{"has-multiple-rows":n>1,"has-aligned-buttons":r})})()},(null==W?void 0:W.orderBy)&&q&&Object(r.createElement)(k,{onChange:c,value:l}),!q&&Q&&Object(r.createElement)(_,{resetCallback:()=>{O([]),y([]),x([]),T(null),C(null)}}),!q&&!Q&&Object(r.createElement)(v,null),q&&Object(r.createElement)("ul",{className:s()(B+"__products",{"is-loading-products":F})},V.map((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return Object(r.createElement)(A,{key:e.id||n,attributes:t,product:e})}))),Y>1&&Object(r.createElement)(d,{currentPage:n,onPageChange:e=>{u({focusableSelector:"a, button"}),o(e)},totalPages:Y}))}),D=e=>{let{attributes:t}=e;const[n,o]=Object(r.useState)(1),[c,i]=Object(r.useState)(t.orderby);return Object(r.useEffect)(()=>{i(t.orderby)},[t.orderby]),Object(r.createElement)(M,{attributes:t,currentPage:n,onPageChange:e=>{o(e)},onSortChange:e=>{var t;const n=null==e||null===(t=e.target)||void 0===t?void 0:t.value;i(n),o(1)},sortValue:c})};const F=Object(r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(r.createElement)("title",null,"Grid Block Preview"),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}));var B=n(
|
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(l&&l(t);s.length;)s.shift()()}var n={},r={13:0,9:0};function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(e){var t=[],n=r[e];if(0!==n)if(n)t.push(n[2]);else{var c=new Promise((function(t,o){n=r[e]=[t,o]}));t.push(n[2]=c);var i,a=document.createElement("script");a.charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.src=function(e){return o.p+""+({0:"vendors--cart-blocks/cart-cross-sells-products--cart-blocks/cart-line-items--cart-blocks/cart-order--671ca56f",1:"vendors--cart-blocks/cart-cross-sells-products--cart-blocks/order-summary-shipping--checkout-blocks--18f9376a",4:"cart-blocks/cart-cross-sells-products--product-add-to-cart",10:"vendors--cart-blocks/cart-cross-sells-products--product-add-to-cart",67:"product-add-to-cart",68:"product-button",69:"product-category-list",70:"product-image",71:"product-price",72:"product-rating",73:"product-sale-badge",74:"product-sku",75:"product-stock-indicator",76:"product-summary",77:"product-tag-list",78:"product-title"}[e]||e)+"-frontend.js?ver="+{0:"070996725b0f85b980b0",1:"c3d50bcc29f266d9ddb6",4:"852262dbe62aecf419ba",10:"9b3325642e17a25a3f2f",67:"1695cd1ac4845286de84",68:"f3d4cab6a8cbb8a23739",69:"790d0652e5529f190bbb",70:"ad52eb40aee82fb53d92",71:"27801080ac55016dd69c",72:"4920b59a6ac79dc73e60",73:"ba2e09394e2bb987da52",74:"3d4e0936bf29626c7fe7",75:"4945ee4237027909d3fd",76:"3224e1480b096c45d166",77:"67acc441aa0b01fdc4ae",78:"4865bbbe700448cc8d47"}[e]}(e);var l=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;l.message="Loading chunk "+e+" failed.\n("+o+": "+c+")",l.name="ChunkLoadError",l.type=o,l.request=c,n[1](l)}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 l=i;o(o.s=237)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t){e.exports=window.wp.data},function(e,t,n){var r;!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)){if(r.length){var i=o.apply(null,r);i&&e.push(i)}}else if("object"===c)if(r.toString===Object.prototype.toString)for(var a in r)n.call(r,a)&&r[a]&&e.push(a);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.React},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=window.wp.compose},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.__esModule=!0,e.exports.default=e.exports,n.apply(this,arguments)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t){e.exports=window.wp.url},function(e,t){e.exports=window.wp.primitives},function(e,t,n){"use strict";var r=n(16),o=n.n(r),c=n(0),i=n(7),a=n(1),l=n(44),s=e=>{let{imageUrl:t=l.l+"/block-error.svg",header:n=Object(a.__)("Oops!","woocommerce"),text:r=Object(a.__)("There was an error loading the content.","woocommerce"),errorMessage:o,errorMessagePrefix:i=Object(a.__)("Error:","woocommerce"),button:s,showErrorBlock:u=!0}=e;return u?Object(c.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(c.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(c.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},n&&Object(c.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},n),r&&Object(c.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},r),o&&Object(c.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},i?i+" ":"",o),s&&Object(c.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},s))):null};n(33);class u extends i.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(c.createElement)(c.Fragment,null,Object(c.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:n=!0,showErrorBlock:r=!0,text:o,errorMessagePrefix:i,renderError:a,button:l}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof a?a({errorMessage:u}):Object(c.createElement)(s,{showErrorBlock:r,errorMessage:n?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:i,button:l}):this.props.children}}t.a=u},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.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wc.wcBlocksRegistry},,function(e,t){e.exports=window.wp.deprecated},,function(e,t){e.exports=window.wp.htmlEntities},function(e,t,n){"use strict";var r=n(0),o=n(5),c=n.n(o);t.a=e=>{let t,{label:n,screenReaderLabel:o,wrapperElement:i,wrapperProps:a={}}=e;const l=null!=n,s=null!=o;return!l&&s?(t=i||"span",a={...a,className:c()(a.className,"screen-reader-text")},Object(r.createElement)(t,a,o)):(t=i||r.Fragment,l&&s&&n!==o?Object(r.createElement)(t,a,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,a,n))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0);const o=Object(r.createContext)("page"),c=()=>Object(r.useContext)(o);o.Provider},function(e,t){e.exports=window.wp.a11y},function(e,t,n){"use strict";(function(e){var r=n(0);n(37);const o=Object(r.createContext)({slots:{},fills:{},registerSlot:()=>{void 0!==e&&e.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});t.a=o}).call(this,n(65))},,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(12),c=n.n(o);function i(e){const t=Object(r.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"string"==typeof e},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return m}));var r=n(3),o=n(4),c=n(0),i=n(12),a=n.n(i),l=n(27),s=n(61),u=n(23);const d=e=>{const t=Object(u.a)();e=e||t;const n=Object(o.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:i}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[n,Object(c.useCallback)(t=>{i(e,t)},[e,i])]},p=(e,t,n)=>{const i=Object(u.a)();n=n||i;const a=Object(o.useSelect)(o=>o(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t),[n,e]),{setQueryValue:l}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[a,Object(c.useCallback)(t=>{l(n,e,t)},[n,e,l])]},m=(e,t)=>{const n=Object(u.a)();t=t||n;const[r,o]=d(t),i=Object(l.a)(r),p=Object(l.a)(e),m=Object(s.a)(p),b=Object(c.useRef)(!1);return Object(c.useEffect)(()=>{a()(m,p)||(o(Object.assign({},i,p)),b.current=!0)},[i,p,m,o]),b.current?[r,o]:[e,o]}},,function(e,t){e.exports=window.wp.apiFetch},,function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0);n(4);const o=Object(r.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),c=()=>Object(r.useContext)(o)},function(e,t,n){"use strict";var r=n(5),o=n.n(r),c=n(0);t.a=Object(c.forwardRef)((function({as:e="div",className:t,...n},r){return function({as:e="div",...t}){return"function"==typeof t.children?t.children(t):Object(c.createElement)(e,t)}({as:e,className:o()("components-visually-hidden",t),...n,ref:r})}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return O}));var r=n(6),o=n(0),c=n(3),i=n(4),a=n(21),l=n(130),s=n(34),u=n(89);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(i.dispatch)(c.CART_STORE_KEY).invalidateResolutionForStore()},p=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},m=()=>{Object(o.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.b)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.b)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),p),[])},b={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},f={...b,email:""},g={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:c.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},h=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,n]=e;return[t,Object(a.decodeEntities)(n)]})),E={cartCoupons:c.EMPTY_CART_COUPONS,cartItems:c.EMPTY_CART_ITEMS,cartFees:c.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,crossSellsProducts:c.EMPTY_CART_CROSS_SELLS,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:c.EMPTY_CART_ITEM_ERRORS,cartTotals:g,cartIsLoading:!0,cartErrors:c.EMPTY_CART_ERRORS,billingAddress:f,shippingAddress:b,shippingRates:c.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:c.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:c.EMPTY_EXTENSIONS},O=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:n}=Object(s.a)(),a=null==n?void 0:n.previewCart,{shouldSelect:u}=e,d=Object(o.useRef)();m();const p=Object(i.useSelect)((e,n)=>{let{dispatch:r}=n;if(!u)return E;if(t)return{cartCoupons:a.coupons,cartItems:a.items,crossSellsProducts:a.cross_sells,cartFees:a.fees,cartItemsCount:a.items_count,cartItemsWeight:a.items_weight,cartNeedsPayment:a.needs_payment,cartNeedsShipping:a.needs_shipping,cartItemErrors:c.EMPTY_CART_ITEM_ERRORS,cartTotals:a.totals,cartIsLoading:!1,cartErrors:c.EMPTY_CART_ERRORS,billingData:f,billingAddress:f,shippingAddress:b,extensions:c.EMPTY_EXTENSIONS,shippingRates:a.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:a.has_calculated_shipping,paymentRequirements:a.paymentRequirements,receiveCart:"function"==typeof(null==a?void 0:a.receiveCart)?a.receiveCart:()=>{}};const o=e(c.CART_STORE_KEY),i=o.getCartData(),s=o.getCartErrors(),d=o.getCartTotals(),p=!o.hasFinishedResolution("getCartData"),m=o.isCustomerDataUpdating(),{receiveCart:g}=r(c.CART_STORE_KEY),O=h(i.billingAddress),w=i.needsShipping?h(i.shippingAddress):O,y=i.fees.length>0?i.fees.map(e=>h(e)):c.EMPTY_CART_FEES;return{cartCoupons:i.coupons.length>0?i.coupons.map(e=>({...e,label:e.code})):c.EMPTY_CART_COUPONS,cartItems:i.items,crossSellsProducts:i.crossSells,cartFees:y,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors,cartTotals:d,cartIsLoading:p,cartErrors:s,billingData:Object(l.a)(O),billingAddress:Object(l.a)(O),shippingAddress:Object(l.a)(w),extensions:i.extensions,shippingRates:i.shippingRates,isLoadingRates:m,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements,receiveCart:g}},[u]);return d.current&&Object(r.isEqual)(d.current,p)||(d.current=p),d.current}},function(e,t){e.exports=window.wp.warning},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(11),o=n.n(r),c=n(0),i=n(15);const a=[".wp-block-woocommerce-cart"],l=e=>{let{Block:t,containers:n,getProps:r=(()=>({})),getErrorBoundaryProps:a=(()=>({}))}=e;0!==n.length&&Array.prototype.forEach.call(n,(e,n)=>{const l=r(e,n),s=a(e,n),u={...e.dataset,...l.attributes||{}};(e=>{let{Block:t,container:n,attributes:r={},props:a={},errorBoundaryProps:l={}}=e;Object(c.render)(Object(c.createElement)(i.a,l,Object(c.createElement)(c.Suspense,{fallback:Object(c.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(c.createElement)(t,o()({},a,{attributes:r})))),n,()=>{n.classList&&n.classList.remove("is-loading")})})({Block:t,container:e,props:l,attributes:u,errorBoundaryProps:s})})},s=e=>{const t=document.body.querySelectorAll(a.join(",")),{Block:n,getProps:r,getErrorBoundaryProps:o,selector:c}=e;(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrappers:c}=e;const i=document.body.querySelectorAll(o);c&&c.length>0&&Array.prototype.filter.call(i,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,c)),l({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})})({Block:n,getProps:r,getErrorBoundaryProps:o,selector:c,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrapper:c}=e;const i=c.querySelectorAll(o);l({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})})({...e,wrapper:t})})})}},function(e,t){e.exports=window.wc.priceFormat},function(e,t,n){"use strict";var r=n(8),o=n(0),c=n(14),i=function({icon:e,className:t,...n}){const c=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return Object(o.createElement)("span",Object(r.a)({className:c},n))};t.a=function({icon:e=null,size:t=24,...n}){if("string"==typeof e)return Object(o.createElement)(i,Object(r.a)({icon:e},n));if(Object(o.isValidElement)(e)&&i===e.type)return Object(o.cloneElement)(e,{...n});if("function"==typeof e)return e.prototype instanceof o.Component?Object(o.createElement)(e,{size:t,...n}):e({size:t,...n});if(e&&("svg"===e.type||e.type===c.SVG)){const r={width:t,height:t,...e.props,...n};return Object(o.createElement)(c.SVG,r)}return Object(o.isValidElement)(e)?Object(o.cloneElement)(e,{size:t,...n}):e}},,,function(e,t,n){"use strict";var r=n(8),o=n(0),c=n(5),i=n.n(c),a=n(6),l=n(19),s=n.n(l),u=n(10),d=n(45),p=n(90),m=n(1);function b(e,t,n){const{defaultView:r}=t,{frameElement:o}=r;if(!o||t===n.ownerDocument)return e;const c=o.getBoundingClientRect();return new r.DOMRect(e.left+c.left,e.top+c.top,e.width,e.height)}let f=0;function g(e){const t=document.scrollingElement||document.body;e&&(f=t.scrollTop);const n=e?"add":"remove";t.classList[n]("lockscroll"),document.documentElement.classList[n]("lockscroll"),e||(t.scrollTop=f)}let h=0;function E(){return Object(o.useEffect)(()=>(0===h&&g(!0),++h,()=>{1===h&&g(!1),--h}),[]),null}var O=n(25);function w(e){const t=Object(o.useContext)(O.a),n=t.slots[e]||{},r=t.fills[e],c=Object(o.useMemo)(()=>r||[],[r]);return{...n,updateSlot:Object(o.useCallback)(n=>{t.updateSlot(e,n)},[e,t.updateSlot]),unregisterSlot:Object(o.useCallback)(n=>{t.unregisterSlot(e,n)},[e,t.unregisterSlot]),fills:c,registerFill:Object(o.useCallback)(n=>{t.registerFill(e,n)},[e,t.registerFill]),unregisterFill:Object(o.useCallback)(n=>{t.unregisterFill(e,n)},[e,t.unregisterFill])}}var y=Object(o.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});function v({name:e,children:t,registerFill:n,unregisterFill:r}){const c=(e=>{const{getSlot:t,subscribe:n}=Object(o.useContext)(y),[r,c]=Object(o.useState)(t(e));return Object(o.useEffect)(()=>(c(t(e)),n(()=>{c(t(e))})),[e]),r})(e),i=Object(o.useRef)({name:e,children:t});return Object(o.useLayoutEffect)(()=>(n(e,i.current),()=>r(e,i.current)),[]),Object(o.useLayoutEffect)(()=>{i.current.children=t,c&&c.forceUpdate()},[t]),Object(o.useLayoutEffect)(()=>{e!==i.current.name&&(r(i.current.name,i.current),i.current.name=e,n(e,i.current))},[e]),c&&c.node?(Object(a.isFunction)(t)&&(t=t(c.props.fillProps)),Object(o.createPortal)(t,c.node)):null}var j=e=>Object(o.createElement)(y.Consumer,null,({registerFill:t,unregisterFill:n})=>Object(o.createElement)(v,Object(r.a)({},e,{registerFill:t,unregisterFill:n})));class _ extends o.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:n,registerSlot:r}=this.props;e.name!==t&&(n(e.name),r(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:n={},getFills:r}=this.props,c=Object(a.map)(r(t,this),e=>{const t=Object(a.isFunction)(e.children)?e.children(n):e.children;return o.Children.map(t,(e,t)=>{if(!e||Object(a.isString)(e))return e;const n=e.key||t;return Object(o.cloneElement)(e,{key:n})})}).filter(Object(a.negate)(o.isEmptyElement));return Object(o.createElement)(o.Fragment,null,Object(a.isFunction)(e)?e(c):c)}}var x=e=>Object(o.createElement)(y.Consumer,null,({registerSlot:t,unregisterSlot:n,getFills:c})=>Object(o.createElement)(_,Object(r.a)({},e,{registerSlot:t,unregisterSlot:n,getFills:c})));function k(){const[,e]=Object(o.useState)({}),t=Object(o.useRef)(!0);return Object(o.useEffect)(()=>()=>{t.current=!1},[]),()=>{t.current&&e({})}}function S({name:e,children:t}){const n=w(e),r=Object(o.useRef)({rerender:k()});return Object(o.useEffect)(()=>(n.registerFill(r),()=>{n.unregisterFill(r)}),[n.registerFill,n.unregisterFill]),n.ref&&n.ref.current?("function"==typeof t&&(t=t(n.fillProps)),Object(o.createPortal)(t,n.ref.current)):null}var T=Object(o.forwardRef)((function({name:e,fillProps:t={},as:n="div",...c},i){const a=Object(o.useContext)(O.a),l=Object(o.useRef)();return Object(o.useLayoutEffect)(()=>(a.registerSlot(e,l,t),()=>{a.unregisterSlot(e,l)}),[a.registerSlot,a.unregisterSlot,e]),Object(o.useLayoutEffect)(()=>{a.updateSlot(e,t)}),Object(o.createElement)(n,Object(r.a)({ref:Object(u.useMergeRefs)([i,l])},c))}));function N(e){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(j,e),Object(o.createElement)(S,e))}n(12),o.Component;const C=Object(o.forwardRef)(({bubblesVirtually:e,...t},n)=>e?Object(o.createElement)(T,Object(r.a)({},t,{ref:n})):Object(o.createElement)(x,t));function R(e){return"appear"===e?"top":"left"}function A(e,t){const{paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:c}=(i=t).ownerDocument.defaultView.getComputedStyle(i);var i;const a=n?parseInt(n,10):0,l=r?parseInt(r,10):0,s=o?parseInt(o,10):0,u=c?parseInt(c,10):0;return{x:e.left+s,y:e.top+a,width:e.width-s-u,height:e.height-a-l,left:e.left+s,right:e.right-u,top:e.top+a,bottom:e.bottom-l}}function L(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function P(e,t,n=""){e.style[t]!==n&&(e.style[t]=n)}function M(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const D=Object(o.forwardRef)(({headerTitle:e,onClose:t,children:n,className:c,noArrow:a=!0,isAlternate:l,position:f="bottom right",range:g,focusOnMount:h="firstElement",anchorRef:O,shouldAnchorIncludePadding:y,anchorRect:v,getAnchorRect:j,expandOnMobile:_,animate:x=!0,onClickOutside:k,onFocusOutside:S,__unstableStickyBoundaryElement:T,__unstableSlotName:C="Popover",__unstableObserveElement:D,__unstableBoundaryParent:F,__unstableForcePosition:B,__unstableForceXAlignment:I,...H},z)=>{const U=Object(o.useRef)(null),W=Object(o.useRef)(null),G=Object(o.useRef)(),Y=Object(u.useViewportMatch)("medium","<"),[V,Q]=Object(o.useState)(),K=w(C),X=_&&Y,[$,J]=Object(u.useResizeObserver)();a=X||a,Object(o.useLayoutEffect)(()=>{if(X)return M(G.current,"is-without-arrow",a),M(G.current,"is-alternate",l),L(G.current,"data-x-axis"),L(G.current,"data-y-axis"),P(G.current,"top"),P(G.current,"left"),P(W.current,"maxHeight"),void P(W.current,"maxWidth");const e=()=>{if(!G.current||!W.current)return;let e=function(e,t,n,r=!1,o,c){if(t)return t;if(n){if(!e.current)return;const t=n(e.current);return b(t,t.ownerDocument||e.current.ownerDocument,c)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==r?void 0:r.cloneRange))return b(Object(d.getRectangleFromRange)(r),r.endContainer.ownerDocument,c);if("function"==typeof(null==r?void 0:r.getBoundingClientRect)){const e=b(r.getBoundingClientRect(),r.ownerDocument,c);return o?e:A(e,r)}const{top:e,bottom:t}=r,n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=b(new window.DOMRect(n.left,n.top,n.width,i.bottom-n.top),e.ownerDocument,c);return o?a:A(a,r)}if(!e.current)return;const{parentNode:i}=e.current,a=i.getBoundingClientRect();return o?a:A(a,i)}(U,v,j,O,y,G.current);if(!e)return;const{offsetParent:t,ownerDocument:n}=G.current;let r,o=0;if(t&&t!==n.body){const n=t.getBoundingClientRect();o=n.top,e=new window.DOMRect(e.left-n.left,e.top-n.top,e.width,e.height)}var c;F&&(r=null===(c=G.current.closest(".popover-slot"))||void 0===c?void 0:c.parentNode);const i=J.height?J:W.current.getBoundingClientRect(),{popoverTop:s,popoverLeft:u,xAxis:p,yAxis:g,contentHeight:h,contentWidth:E}=function(e,t,n="top",r,o,c,i,a,l){const[s,u="center",d]=n.split(" "),p=function(e,t,n,r,o,c,i,a){const{height:l}=t;if(o){const t=o.getBoundingClientRect().top+l-i;if(e.top<=t)return{yAxis:n,popoverTop:Math.min(e.bottom,t)}}let s=e.top+e.height/2;"bottom"===r?s=e.bottom:"top"===r&&(s=e.top);const u={popoverTop:s,contentHeight:(s-l/2>0?l/2:s)+(s+l/2>window.innerHeight?window.innerHeight-s:l/2)},d={popoverTop:e.top,contentHeight:e.top-10-l>0?l:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+l>window.innerHeight?window.innerHeight-10-e.bottom:l};let m,b=n,f=null;if(!o&&!a)if("middle"===n&&u.contentHeight===l)b="middle";else if("top"===n&&d.contentHeight===l)b="top";else if("bottom"===n&&p.contentHeight===l)b="bottom";else{b=d.contentHeight>p.contentHeight?"top":"bottom";const e="top"===b?d.contentHeight:p.contentHeight;f=e!==l?e:null}return m="middle"===b?u.popoverTop:"top"===b?d.popoverTop:p.popoverTop,{yAxis:b,popoverTop:m,contentHeight:f}}(e,t,s,d,r,0,c,a);return{...function(e,t,n,r,o,c,i,a,l){const{width:s}=t;"left"===n&&Object(m.isRTL)()?n="right":"right"===n&&Object(m.isRTL)()&&(n="left"),"left"===r&&Object(m.isRTL)()?r="right":"right"===r&&Object(m.isRTL)()&&(r="left");const u=Math.round(e.left+e.width/2),d={popoverLeft:u,contentWidth:(u-s/2>0?s/2:u)+(u+s/2>window.innerWidth?window.innerWidth-u:s/2)};let p=e.left;"right"===r?p=e.right:"middle"===c||l||(p=u);let b=e.right;"left"===r?b=e.left:"middle"===c||l||(b=u);const f={popoverLeft:p,contentWidth:p-s>0?s:p},g={popoverLeft:b,contentWidth:b+s>window.innerWidth?window.innerWidth-b:s};let h,E=n,O=null;if(!o&&!a)if("center"===n&&d.contentWidth===s)E="center";else if("left"===n&&f.contentWidth===s)E="left";else if("right"===n&&g.contentWidth===s)E="right";else{E=f.contentWidth>g.contentWidth?"left":"right";const e="left"===E?f.contentWidth:g.contentWidth;s>window.innerWidth&&(O=window.innerWidth),e!==s&&(E="center",d.popoverLeft=window.innerWidth/2)}if(h="center"===E?d.popoverLeft:"left"===E?f.popoverLeft:g.popoverLeft,i){const e=i.getBoundingClientRect();h=Math.min(h,e.right-s),Object(m.isRTL)()||(h=Math.max(h,0))}return{xAxis:E,popoverLeft:h,contentWidth:O}}(e,t,u,d,r,p.yAxis,i,a,l),...p}}(e,i,f,T,G.current,o,r,B,I);"number"==typeof s&&"number"==typeof u&&(P(G.current,"top",s+"px"),P(G.current,"left",u+"px")),M(G.current,"is-without-arrow",a||"center"===p&&"middle"===g),M(G.current,"is-alternate",l),L(G.current,"data-x-axis",p),L(G.current,"data-y-axis",g),P(W.current,"maxHeight","number"==typeof h?h+"px":""),P(W.current,"maxWidth","number"==typeof E?E+"px":""),Q(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[g]||"middle"))};e();const{ownerDocument:t}=G.current,{defaultView:n}=t,r=n.setInterval(e,500);let o;const c=()=>{n.cancelAnimationFrame(o),o=n.requestAnimationFrame(e)};n.addEventListener("click",c),n.addEventListener("resize",e),n.addEventListener("scroll",e,!0);const i=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(O);let s;return i&&i!==t&&(i.defaultView.addEventListener("resize",e),i.defaultView.addEventListener("scroll",e,!0)),D&&(s=new n.MutationObserver(e),s.observe(D,{attributes:!0})),()=>{n.clearInterval(r),n.removeEventListener("resize",e),n.removeEventListener("scroll",e,!0),n.removeEventListener("click",c),n.cancelAnimationFrame(o),i&&i!==t&&(i.defaultView.removeEventListener("resize",e),i.defaultView.removeEventListener("scroll",e,!0)),s&&s.disconnect()}},[X,v,j,O,y,f,J,T,D,F]);const Z=(e,n)=>{if("focus-outside"===e&&S)S(n);else if("focus-outside"===e&&k){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>n.relatedTarget}),s()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),k(e)}else t&&t()},[ee,te]=Object(u.__experimentalUseDialog)({focusOnMount:h,__unstableOnClose:Z,onClose:Z}),ne=Object(u.useMergeRefs)([G,ee,z]),re=Boolean(x&&V)&&function(e){if("loading"===e.type)return i()("components-animate__loading");const{type:t,origin:n=R(t)}=e;if("appear"===t){const[e,t="center"]=n.split(" ");return i()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?i()("components-animate__slide-in","is-from-"+n):void 0}({type:"appear",origin:V});let oe=Object(o.createElement)("div",Object(r.a)({className:i()("components-popover",c,re,{"is-expanded":X,"is-without-arrow":a,"is-alternate":l})},H,{ref:ne},te,{tabIndex:"-1"}),X&&Object(o.createElement)(E,null),X&&Object(o.createElement)("div",{className:"components-popover__header"},Object(o.createElement)("span",{className:"components-popover__header-title"},e),Object(o.createElement)(q,{className:"components-popover__close",icon:p.a,onClick:t})),Object(o.createElement)("div",{ref:W,className:"components-popover__content"},Object(o.createElement)("div",{style:{position:"relative"}},$,n)));return K.ref&&(oe=Object(o.createElement)(N,{name:C},oe)),O||v?oe:Object(o.createElement)("span",{ref:U},oe)});D.Slot=Object(o.forwardRef)((function({name:e="Popover"},t){return Object(o.createElement)(C,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));var F=D,B=function({shortcut:e,className:t}){if(!e)return null;let n,r;return Object(a.isString)(e)&&(n=e),Object(a.isObject)(e)&&(n=e.display,r=e.ariaLabel),Object(o.createElement)("span",{className:t,"aria-label":r},n)};const I=Object(o.createElement)("div",{className:"event-catcher"}),H=({eventHandlers:e,child:t,childrenWithPopover:n})=>Object(o.cloneElement)(Object(o.createElement)("span",{className:"disabled-element-wrapper"},Object(o.cloneElement)(I,e),Object(o.cloneElement)(t,{children:n}),","),e),z=({child:e,eventHandlers:t,childrenWithPopover:n})=>Object(o.cloneElement)(e,{...t,children:n}),U=(e,t,n)=>{if(1!==o.Children.count(e))return;const r=o.Children.only(e);"function"==typeof r.props[t]&&r.props[t](n)};var W=function({children:e,position:t,text:n,shortcut:r}){const[c,i]=Object(o.useState)(!1),[l,s]=Object(o.useState)(!1),d=Object(u.useDebounce)(s,700),p=t=>{U(e,"onMouseDown",t),document.addEventListener("mouseup",f),i(!0)},m=t=>{U(e,"onMouseUp",t),document.removeEventListener("mouseup",f),i(!1)},b=e=>"mouseUp"===e?m:"mouseDown"===e?p:void 0,f=b("mouseUp"),g=(t,n)=>r=>{if(U(e,t,r),r.currentTarget.disabled)return;if("focus"===r.type&&c)return;d.cancel();const o=Object(a.includes)(["focus","mouseenter"],r.type);o!==l&&(n?d(o):s(o))},h=()=>{d.cancel(),document.removeEventListener("mouseup",f)};if(Object(o.useEffect)(()=>h,[]),1!==o.Children.count(e))return e;const E={onMouseEnter:g("onMouseEnter",!0),onMouseLeave:g("onMouseLeave"),onClick:g("onClick"),onFocus:g("onFocus"),onBlur:g("onBlur"),onMouseDown:b("mouseDown")},O=o.Children.only(e),{children:w,disabled:y}=O.props;return(y?H:z)({child:O,eventHandlers:E,childrenWithPopover:(({grandchildren:e,isOver:t,position:n,text:r,shortcut:c})=>Object(o.concatChildren)(e,t&&Object(o.createElement)(F,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(o.createElement)(B,{className:"components-tooltip__shortcut",shortcut:c}))))({grandchildren:w,isOver:l,position:t,text:n,shortcut:r})})},G=n(40),Y=n(35);const V=["onMouseDown","onClick"];var q=t.a=Object(o.forwardRef)((function(e,t){const{href:n,target:c,isSmall:l,isPressed:u,isBusy:d,isDestructive:p,className:m,disabled:b,icon:f,iconPosition:g="left",iconSize:h,showTooltip:E,tooltipPosition:O,shortcut:w,label:y,children:v,text:j,variant:_,__experimentalIsFocusable:x,describedBy:k,...S}=function({isDefault:e,isPrimary:t,isSecondary:n,isTertiary:r,isLink:o,variant:c,...i}){let a=c;var l,u,d,p,m;return t&&(null!==(l=a)&&void 0!==l||(a="primary")),r&&(null!==(u=a)&&void 0!==u||(a="tertiary")),n&&(null!==(d=a)&&void 0!==d||(a="secondary")),e&&(s()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(p=a)&&void 0!==p||(a="secondary")),o&&(null!==(m=a)&&void 0!==m||(a="link")),{...i,variant:a}}(e),T=i()("components-button",m,{"is-secondary":"secondary"===_,"is-primary":"primary"===_,"is-small":l,"is-tertiary":"tertiary"===_,"is-pressed":u,"is-busy":d,"is-link":"link"===_,"is-destructive":p,"has-text":!!f&&!!v,"has-icon":!!f}),N=b&&!x,C=void 0===n||N?"button":"a",R="a"===C?{href:n,target:c}:{type:"button",disabled:N,"aria-pressed":u};if(b&&x){R["aria-disabled"]=!0;for(const e of V)S[e]=e=>{e.stopPropagation(),e.preventDefault()}}const A=!N&&(E&&y||w||!!y&&(!v||Object(a.isArray)(v)&&!v.length)&&!1!==E),L=k?Object(a.uniqueId)():null,P=S["aria-describedby"]||L,M=Object(o.createElement)(C,Object(r.a)({},R,S,{className:T,"aria-label":S["aria-label"]||y,"aria-describedby":P,ref:t}),f&&"left"===g&&Object(o.createElement)(G.a,{icon:f,size:h}),j&&Object(o.createElement)(o.Fragment,null,j),f&&"right"===g&&Object(o.createElement)(G.a,{icon:f,size:h}),v);return A?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(W,{text:k||y,shortcut:w,position:O},M),k&&Object(o.createElement)(Y.a,null,Object(o.createElement)("span",{id:L},k))):Object(o.createElement)(o.Fragment,null,M,k&&Object(o.createElement)(Y.a,null,Object(o.createElement)("span",{id:L},k)))}))},function(e,t,n){"use strict";n.d(t,"n",(function(){return c})),n.d(t,"l",(function(){return i})),n.d(t,"k",(function(){return a})),n.d(t,"m",(function(){return l})),n.d(t,"i",(function(){return s})),n.d(t,"d",(function(){return u})),n.d(t,"f",(function(){return d})),n.d(t,"j",(function(){return p})),n.d(t,"c",(function(){return m})),n.d(t,"e",(function(){return b})),n.d(t,"g",(function(){return f})),n.d(t,"a",(function(){return g})),n.d(t,"h",(function(){return h})),n.d(t,"b",(function(){return E}));var r,o=n(2);const c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"images/",a=c.pluginUrl+"build/",l=c.buildPhase,s=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),m=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),b=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),f=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),E=Object(o.getSetting)("allowedStates",{})},function(e,t){e.exports=window.wp.dom},function(e,t){e.exports=window.wp.hooks},function(e,t){e.exports=window.wc.wcBlocksSharedContext},,,,,,,,,function(e,t,n){"use strict";var r=n(2),o=n(1),c=n(92),i=n(28);const a=Object(r.getSetting)("countryLocale",{}),l=e=>{const 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(o.sprintf)(
|
2 |
/* translators: %s Field label. */
|
3 |
+
Object(o.__)("%s (optional)","woocommerce"),e.label)),e.priority&&(Object(c.a)(e.priority)&&(t.index=e.priority),Object(i.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},s=Object.entries(a).map(e=>{let[t,n]=e;return[t,Object.entries(n).map(e=>{let[t,n]=e;return[t,l(n)]}).reduce((e,t)=>{let[n,r]=t;return e[n]=r,e},{})]}).reduce((e,t)=>{let[n,r]=t;return e[n]=r,e},{});t.a=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=n&&void 0!==s[n]?s[n]:{};return e.map(e=>({key:e,...r.defaultAddressFields[e]||{},...o[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(3),o=n(4),c=n(0),i=n(27),a=n(73);const l=e=>{const{namespace:t,resourceName:n,resourceValues:l=[],query:s={},shouldSelect:u=!0}=e;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");const d=Object(c.useRef)({results:[],isLoading:!0}),p=Object(i.a)(s),m=Object(i.a)(l),b=Object(a.a)(),f=Object(o.useSelect)(e=>{if(!u)return null;const o=e(r.COLLECTIONS_STORE_KEY),c=[t,n,p,m],i=o.getCollectionError(...c);if(i){if(!(i instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");b(i)}return{results:o.getCollection(...c),isLoading:!o.hasFinishedResolution("getCollection",c)}},[t,n,m,p,u]);return null!==f&&(d.current=f),d.current}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(7);function o(e,t){const n=Object(r.useRef)();return Object(r.useEffect)(()=>{n.current===e||t&&!t(e,n.current)||(n.current=e)},[e,t]),n.current}},,,,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 l,s=[],u=!1,d=-1;function p(){u&&l&&(u=!1,l.length?s=l.concat(s):d=-1,s.length&&m())}function m(){if(!u){var e=a(p);u=!0;for(var t=s.length;t;){for(l=s,s=[];++d<t;)l&&l[d].run();d=-1,t=s.length}l=null,u=!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 f(){}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||u||a(m)},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=f,o.addListener=f,o.once=f,o.off=f,o.removeListener=f,o.removeAllListeners=f,o.emit=f,o.prependListener=f,o.prependOnceListener=f,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";n.d(t,"a",(function(){return i}));var r=n(46),o=n(0),c=n(36);const i=()=>{const e=Object(c.a)(),t=Object(o.useRef)(e);return Object(o.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...n,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},function(e,t,n){e.exports=function(){"use strict";function e(t){return(e="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})(t)}function t(e,n){return(t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,n)}function n(){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}}function r(e,o,c){return(r=n()?Reflect.construct:function(e,n,r){var o=[null];o.push.apply(o,n);var c=new(Function.bind.apply(e,o));return r&&t(c,r.prototype),c}).apply(null,arguments)}function o(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,void 0);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)?c(e,void 0):void 0}}(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 c(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 i=Object.hasOwnProperty,a=Object.setPrototypeOf,l=Object.isFrozen,s=Object.getPrototypeOf,u=Object.getOwnPropertyDescriptor,d=Object.freeze,p=Object.seal,m=Object.create,b="undefined"!=typeof Reflect&&Reflect,f=b.apply,g=b.construct;f||(f=function(e,t,n){return e.apply(t,n)}),d||(d=function(e){return e}),p||(p=function(e){return e}),g||(g=function(e,t){return r(e,o(t))});var h,E=T(Array.prototype.forEach),O=T(Array.prototype.pop),w=T(Array.prototype.push),y=T(String.prototype.toLowerCase),v=T(String.prototype.match),j=T(String.prototype.replace),_=T(String.prototype.indexOf),x=T(String.prototype.trim),k=T(RegExp.prototype.test),S=(h=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g(h,t)});function T(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return f(e,t,r)}}function N(e,t,n){n=n||y,a&&a(e,null);for(var r=t.length;r--;){var o=t[r];if("string"==typeof o){var c=n(o);c!==o&&(l(t)||(t[r]=c),o=c)}e[o]=!0}return e}function C(e){var t,n=m(null);for(t in e)f(i,e,[t])&&(n[t]=e[t]);return n}function R(e,t){for(;null!==e;){var n=u(e,t);if(n){if(n.get)return T(n.get);if("function"==typeof n.value)return T(n.value)}e=s(e)}return function(e){return console.warn("fallback value for",e),null}}var A=d(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),L=d(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),P=d(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),M=d(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),D=d(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),F=d(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),B=d(["#text"]),I=d(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),H=d(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),z=d(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),U=d(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),W=p(/\{\{[\w\W]*|[\w\W]*\}\}/gm),G=p(/<%[\w\W]*|[\w\W]*%>/gm),Y=p(/^data-[\-\w.\u00B7-\uFFFF]/),V=p(/^aria-[\-\w]+$/),q=p(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Q=p(/^(?:\w+script|data):/i),K=p(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),X=p(/^html$/i),$=function(){return"undefined"==typeof window?null:window},J=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var r=null;n.currentScript&&n.currentScript.hasAttribute("data-tt-policy-suffix")&&(r=n.currentScript.getAttribute("data-tt-policy-suffix"));var o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};return function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$(),r=function(e){return t(e)};if(r.version="2.4.0",r.removed=[],!n||!n.document||9!==n.document.nodeType)return r.isSupported=!1,r;var c=n.document,i=n.document,a=n.DocumentFragment,l=n.HTMLTemplateElement,s=n.Node,u=n.Element,p=n.NodeFilter,m=n.NamedNodeMap,b=void 0===m?n.NamedNodeMap||n.MozNamedAttrMap:m,f=n.HTMLFormElement,g=n.DOMParser,h=n.trustedTypes,T=u.prototype,Z=R(T,"cloneNode"),ee=R(T,"nextSibling"),te=R(T,"childNodes"),ne=R(T,"parentNode");if("function"==typeof l){var re=i.createElement("template");re.content&&re.content.ownerDocument&&(i=re.content.ownerDocument)}var oe=J(h,c),ce=oe?oe.createHTML(""):"",ie=i,ae=ie.implementation,le=ie.createNodeIterator,se=ie.createDocumentFragment,ue=ie.getElementsByTagName,de=c.importNode,pe={};try{pe=C(i).documentMode?i.documentMode:{}}catch(e){}var me={};r.isSupported="function"==typeof ne&&ae&&void 0!==ae.createHTMLDocument&&9!==pe;var be,fe,ge=W,he=G,Ee=Y,Oe=V,we=Q,ye=K,ve=q,je=null,_e=N({},[].concat(o(A),o(L),o(P),o(D),o(B))),xe=null,ke=N({},[].concat(o(I),o(H),o(z),o(U))),Se=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Te=null,Ne=null,Ce=!0,Re=!0,Ae=!1,Le=!1,Pe=!1,Me=!1,De=!1,Fe=!1,Be=!1,Ie=!1,He=!0,ze=!1,Ue="user-content-",We=!0,Ge=!1,Ye={},Ve=null,qe=N({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Qe=null,Ke=N({},["audio","video","img","source","image","track"]),Xe=null,$e=N({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Je="http://www.w3.org/1998/Math/MathML",Ze="http://www.w3.org/2000/svg",et="http://www.w3.org/1999/xhtml",tt=et,nt=!1,rt=["application/xhtml+xml","text/html"],ot="text/html",ct=null,it=i.createElement("form"),at=function(e){return e instanceof RegExp||e instanceof Function},lt=function(t){ct&&ct===t||(t&&"object"===e(t)||(t={}),t=C(t),be=be=-1===rt.indexOf(t.PARSER_MEDIA_TYPE)?ot:t.PARSER_MEDIA_TYPE,fe="application/xhtml+xml"===be?function(e){return e}:y,je="ALLOWED_TAGS"in t?N({},t.ALLOWED_TAGS,fe):_e,xe="ALLOWED_ATTR"in t?N({},t.ALLOWED_ATTR,fe):ke,Xe="ADD_URI_SAFE_ATTR"in t?N(C($e),t.ADD_URI_SAFE_ATTR,fe):$e,Qe="ADD_DATA_URI_TAGS"in t?N(C(Ke),t.ADD_DATA_URI_TAGS,fe):Ke,Ve="FORBID_CONTENTS"in t?N({},t.FORBID_CONTENTS,fe):qe,Te="FORBID_TAGS"in t?N({},t.FORBID_TAGS,fe):{},Ne="FORBID_ATTR"in t?N({},t.FORBID_ATTR,fe):{},Ye="USE_PROFILES"in t&&t.USE_PROFILES,Ce=!1!==t.ALLOW_ARIA_ATTR,Re=!1!==t.ALLOW_DATA_ATTR,Ae=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Le=t.SAFE_FOR_TEMPLATES||!1,Pe=t.WHOLE_DOCUMENT||!1,Fe=t.RETURN_DOM||!1,Be=t.RETURN_DOM_FRAGMENT||!1,Ie=t.RETURN_TRUSTED_TYPE||!1,De=t.FORCE_BODY||!1,He=!1!==t.SANITIZE_DOM,ze=t.SANITIZE_NAMED_PROPS||!1,We=!1!==t.KEEP_CONTENT,Ge=t.IN_PLACE||!1,ve=t.ALLOWED_URI_REGEXP||ve,tt=t.NAMESPACE||et,t.CUSTOM_ELEMENT_HANDLING&&at(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Se.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&at(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Se.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Se.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Le&&(Re=!1),Be&&(Fe=!0),Ye&&(je=N({},o(B)),xe=[],!0===Ye.html&&(N(je,A),N(xe,I)),!0===Ye.svg&&(N(je,L),N(xe,H),N(xe,U)),!0===Ye.svgFilters&&(N(je,P),N(xe,H),N(xe,U)),!0===Ye.mathMl&&(N(je,D),N(xe,z),N(xe,U))),t.ADD_TAGS&&(je===_e&&(je=C(je)),N(je,t.ADD_TAGS,fe)),t.ADD_ATTR&&(xe===ke&&(xe=C(xe)),N(xe,t.ADD_ATTR,fe)),t.ADD_URI_SAFE_ATTR&&N(Xe,t.ADD_URI_SAFE_ATTR,fe),t.FORBID_CONTENTS&&(Ve===qe&&(Ve=C(Ve)),N(Ve,t.FORBID_CONTENTS,fe)),We&&(je["#text"]=!0),Pe&&N(je,["html","head","body"]),je.table&&(N(je,["tbody"]),delete Te.tbody),d&&d(t),ct=t)},st=N({},["mi","mo","mn","ms","mtext"]),ut=N({},["foreignobject","desc","title","annotation-xml"]),dt=N({},["title","style","font","a","script"]),pt=N({},L);N(pt,P),N(pt,M);var mt=N({},D);N(mt,F);var bt=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:et,tagName:"template"});var n=y(e.tagName),r=y(t.tagName);return e.namespaceURI===Ze?t.namespaceURI===et?"svg"===n:t.namespaceURI===Je?"svg"===n&&("annotation-xml"===r||st[r]):Boolean(pt[n]):e.namespaceURI===Je?t.namespaceURI===et?"math"===n:t.namespaceURI===Ze?"math"===n&&ut[r]:Boolean(mt[n]):e.namespaceURI===et&&!(t.namespaceURI===Ze&&!ut[r])&&!(t.namespaceURI===Je&&!st[r])&&!mt[n]&&(dt[n]||!pt[n])},ft=function(e){w(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ce}catch(t){e.remove()}}},gt=function(e,t){try{w(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){w(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!xe[e])if(Fe||Be)try{ft(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ht=function(e){var t,n;if(De)e="<remove></remove>"+e;else{var r=v(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===be&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var o=oe?oe.createHTML(e):e;if(tt===et)try{t=(new g).parseFromString(o,be)}catch(e){}if(!t||!t.documentElement){t=ae.createDocument(tt,"template",null);try{t.documentElement.innerHTML=nt?"":o}catch(e){}}var c=t.body||t.documentElement;return e&&n&&c.insertBefore(i.createTextNode(n),c.childNodes[0]||null),tt===et?ue.call(t,Pe?"html":"body")[0]:Pe?t.documentElement:c},Et=function(e){return le.call(e.ownerDocument||e,e,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT,null,!1)},Ot=function(e){return e instanceof f&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof b)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},wt=function(t){return"object"===e(s)?t instanceof s:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},yt=function(e,t,n){me[e]&&E(me[e],(function(e){e.call(r,t,n,ct)}))},vt=function(e){var t;if(yt("beforeSanitizeElements",e,null),Ot(e))return ft(e),!0;if(k(/[\u0080-\uFFFF]/,e.nodeName))return ft(e),!0;var n=fe(e.nodeName);if(yt("uponSanitizeElement",e,{tagName:n,allowedTags:je}),e.hasChildNodes()&&!wt(e.firstElementChild)&&(!wt(e.content)||!wt(e.content.firstElementChild))&&k(/<[/\w]/g,e.innerHTML)&&k(/<[/\w]/g,e.textContent))return ft(e),!0;if("select"===n&&k(/<template/i,e.innerHTML))return ft(e),!0;if(!je[n]||Te[n]){if(!Te[n]&&_t(n)){if(Se.tagNameCheck instanceof RegExp&&k(Se.tagNameCheck,n))return!1;if(Se.tagNameCheck instanceof Function&&Se.tagNameCheck(n))return!1}if(We&&!Ve[n]){var o=ne(e)||e.parentNode,c=te(e)||e.childNodes;if(c&&o)for(var i=c.length-1;i>=0;--i)o.insertBefore(Z(c[i],!0),ee(e))}return ft(e),!0}return e instanceof u&&!bt(e)?(ft(e),!0):"noscript"!==n&&"noembed"!==n||!k(/<\/no(script|embed)/i,e.innerHTML)?(Le&&3===e.nodeType&&(t=e.textContent,t=j(t,ge," "),t=j(t,he," "),e.textContent!==t&&(w(r.removed,{element:e.cloneNode()}),e.textContent=t)),yt("afterSanitizeElements",e,null),!1):(ft(e),!0)},jt=function(e,t,n){if(He&&("id"===t||"name"===t)&&(n in i||n in it))return!1;if(Re&&!Ne[t]&&k(Ee,t));else if(Ce&&k(Oe,t));else if(!xe[t]||Ne[t]){if(!(_t(e)&&(Se.tagNameCheck instanceof RegExp&&k(Se.tagNameCheck,e)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(e))&&(Se.attributeNameCheck instanceof RegExp&&k(Se.attributeNameCheck,t)||Se.attributeNameCheck instanceof Function&&Se.attributeNameCheck(t))||"is"===t&&Se.allowCustomizedBuiltInElements&&(Se.tagNameCheck instanceof RegExp&&k(Se.tagNameCheck,n)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(n))))return!1}else if(Xe[t]);else if(k(ve,j(n,ye,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==_(n,"data:")||!Qe[e])if(Ae&&!k(we,j(n,ye,"")));else if(n)return!1;return!0},_t=function(e){return e.indexOf("-")>0},xt=function(t){var n,o,c,i;yt("beforeSanitizeAttributes",t,null);var a=t.attributes;if(a){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe};for(i=a.length;i--;){var s=n=a[i],u=s.name,d=s.namespaceURI;if(o="value"===u?n.value:x(n.value),c=fe(u),l.attrName=c,l.attrValue=o,l.keepAttr=!0,l.forceKeepAttr=void 0,yt("uponSanitizeAttribute",t,l),o=l.attrValue,!l.forceKeepAttr&&(gt(u,t),l.keepAttr))if(k(/\/>/i,o))gt(u,t);else{Le&&(o=j(o,ge," "),o=j(o,he," "));var p=fe(t.nodeName);if(jt(p,c,o)){if(!ze||"id"!==c&&"name"!==c||(gt(u,t),o=Ue+o),oe&&"object"===e(h)&&"function"==typeof h.getAttributeType)if(d);else switch(h.getAttributeType(p,c)){case"TrustedHTML":o=oe.createHTML(o);break;case"TrustedScriptURL":o=oe.createScriptURL(o)}try{d?t.setAttributeNS(d,u,o):t.setAttribute(u,o),O(r.removed)}catch(e){}}}}yt("afterSanitizeAttributes",t,null)}},kt=function e(t){var n,r=Et(t);for(yt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)yt("uponSanitizeShadowNode",n,null),vt(n)||(n.content instanceof a&&e(n.content),xt(n));yt("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(t){var o,i,l,u,d,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((nt=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!wt(t)){if("function"!=typeof t.toString)throw S("toString is not a function");if("string"!=typeof(t=t.toString()))throw S("dirty is not a string, aborting")}if(!r.isSupported){if("object"===e(n.toStaticHTML)||"function"==typeof n.toStaticHTML){if("string"==typeof t)return n.toStaticHTML(t);if(wt(t))return n.toStaticHTML(t.outerHTML)}return t}if(Me||lt(p),r.removed=[],"string"==typeof t&&(Ge=!1),Ge){if(t.nodeName){var m=fe(t.nodeName);if(!je[m]||Te[m])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof s)1===(i=(o=ht("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?o=i:o.appendChild(i);else{if(!Fe&&!Le&&!Pe&&-1===t.indexOf("<"))return oe&&Ie?oe.createHTML(t):t;if(!(o=ht(t)))return Fe?null:Ie?ce:""}o&&De&&ft(o.firstChild);for(var b=Et(Ge?t:o);l=b.nextNode();)3===l.nodeType&&l===u||vt(l)||(l.content instanceof a&&kt(l.content),xt(l),u=l);if(u=null,Ge)return t;if(Fe){if(Be)for(d=se.call(o.ownerDocument);o.firstChild;)d.appendChild(o.firstChild);else d=o;return xe.shadowroot&&(d=de.call(c,d,!0)),d}var f=Pe?o.outerHTML:o.innerHTML;return Pe&&je["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&k(X,o.ownerDocument.doctype.name)&&(f="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+f),Le&&(f=j(f,ge," "),f=j(f,he," ")),oe&&Ie?oe.createHTML(f):f},r.setConfig=function(e){lt(e),Me=!0},r.clearConfig=function(){ct=null,Me=!1},r.isValidAttribute=function(e,t,n){ct||lt({});var r=fe(e),o=fe(t);return jt(r,o,n)},r.addHook=function(e,t){"function"==typeof t&&(me[e]=me[e]||[],w(me[e],t))},r.removeHook=function(e){if(me[e])return O(me[e])},r.removeHooks=function(e){me[e]&&(me[e]=[])},r.removeAllHooks=function(){me={}},r}()}()},,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);const o=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return l}));const r=window.CustomEvent||null,o=(e,t)=>{let{bubbles:n=!1,cancelable:o=!1,element:c,detail:i={}}=t;if(!r)return;c||(c=document.body);const a=new r(e,{bubbles:n,cancelable:o,detail:i});c.dispatchEvent(a)};let c;const i=()=>{c&&clearTimeout(c),c=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},a=e=>{let{preserveCartData:t=!1}=e;o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},l=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const c=()=>{o(t,{bubbles:n,cancelable:r})};return jQuery(document).on(e,c),()=>jQuery(document).off(e,c)}},function(e,t,n){"use strict";var r=n(0),o=n(14);const 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";n.d(t,"a",(function(){return r}));const r=e=>"number"==typeof e},,,,,,function(e,t,n){"use strict";var r=n(0),o=n(6),c=n(5),i=n.n(c),a=n(1),l=n(24),s=n(90),u=n(43);function d(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}t.a=function({className:e,status:t="info",children:n,spokenMessage:c=n,onRemove:p=o.noop,isDismissible:m=!0,actions:b=[],politeness:f=d(t),__unstableHTML:g,onDismiss:h=o.noop}){!function(e,t){const n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)(()=>{n&&Object(l.speak)(n,t)},[n,t])}(c,f);const E=i()(e,"components-notice","is-"+t,{"is-dismissible":m});return g&&(n=Object(r.createElement)(r.RawHTML,null,n)),Object(r.createElement)("div",{className:E},Object(r.createElement)("div",{className:"components-notice__content"},n,Object(r.createElement)("div",{className:"components-notice__actions"},b.map(({className:e,label:t,isPrimary:n,variant:o,noDefaultClasses:c=!1,onClick:a,url:l},s)=>{let d=o;return"primary"===o||c||(d=l?"link":"secondary"),void 0===d&&n&&(d="primary"),Object(r.createElement)(u.a,{key:s,href:l,variant:d,onClick:l?void 0:a,className:i()("components-notice__action",e)},t)}))),m&&Object(r.createElement)(u.a,{className:"components-notice__dismiss",icon:s.a,label:Object(a.__)("Dismiss this notice"),onClick:e=>{var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),h(),p()},showTooltip:!1}))}},function(e,t,n){"use strict";var r=n(11),o=n.n(r),c=n(0);n(122);const i=e=>{if(!e)return;const t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()};t.a=e=>t=>{const n=Object(c.useRef)(null);return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:n,"aria-hidden":!0}),Object(c.createElement)(e,o()({},t,{scrollToTop:e=>{null!==n.current&&((e,t)=>{const{focusableSelector:n}=t||{};window&&Number.isFinite(window.innerHeight)&&(n?((e,t)=>{var n;const r=(null===(n=e.parentElement)||void 0===n?void 0:n.querySelectorAll(t))||[];if(r.length){const e=r[0];i(e),null==e||e.focus()}else i(e)})(e,n):i(e))})(n.current,e)}})))}},function(e,t){e.exports=window.wp.blocks},,function(e,t){},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(67);const o=["a","b","em","i","strong","p","br"],c=["target","href","rel","name","download"],i=(e,t)=>{const n=(null==t?void 0:t.tags)||o,i=(null==t?void 0:t.attr)||c;return Object(r.sanitize)(e,{ALLOWED_TAGS:n,ALLOWED_ATTR:i})}},,function(e,t){e.exports=window.wp.blockEditor},,,function(e,t,n){"use strict";var r=n(0);t.a=function(e){let{icon:t,size:n=24,...o}=e;return Object(r.cloneElement)(t,{width:n,height:n,...o})}},,,,,,,,,,,function(e,t){},function(e,t,n){"use strict";var r=n(0),o=n(5),c=n.n(o),i=n(22),a=n(10);n(135),t.a=Object(a.withInstanceId)(e=>{let{className:t,instanceId:n,label:o="",onChange:a,options:l,screenReaderLabel:s,value:u=""}=e;const d="wc-block-components-sort-select__select-"+n;return Object(r.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(r.createElement)(i.a,{label:o,screenReaderLabel:s,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(r.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:a,value:u},l&&l.map(e=>Object(r.createElement)("option",{key:e.key,value:e.key},e.label))))})},,,,function(e,t){e.exports=window.wp.wordcount},function(e,t){e.exports=window.wp.autop},,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(56),o=(n(13),n(2));const c=e=>{const t=Object.keys(o.defaultAddressFields),n=Object(r.a)(t,{},e.country),c=Object.assign({},e);return n.forEach(t=>{let{key:n="",hidden:r=!1}=t;r&&((e,t)=>e in t)(n,e)&&(c[n]="")}),c}},,function(e,t){e.exports=window.wc.wcBlocksSharedHocs},,,function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var r=n(11),o=n.n(r),c=n(0),i=n(5),a=n.n(i),l=n(98),s=n(106),u=n(4),d=n(3);n(102);const p=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""},m=e=>{let{className:t,context:n="default",additionalNotices:r=[]}=e;const i=Object(u.useSelect)(e=>e(d.PAYMENT_STORE_KEY).isExpressPaymentMethodActive()),{notices:m}=Object(u.useSelect)(e=>({notices:e("core/notices").getNotices(n)})),{removeNotice:b}=Object(u.useDispatch)("core/notices"),f=m.filter(e=>"snackbar"!==e.type).concat(r);if(!f.length)return null;const g=a()(t,"wc-block-components-notices");return i?null:Object(c.createElement)("div",{className:g},f.map(e=>Object(c.createElement)(l.a,o()({key:"store-notice-"+e.id},e,{className:a()("wc-block-components-notices__notice",p(e)),onRemove:()=>{e.isDismissible&&b(e.id,n)}}),Object(s.a)(e.content))))}},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(17),o=n(0),c=n(44);n.p=c.k,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)(()=>Promise.all([n.e(0),n.e(71)]).then(n.bind(null,359)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)(()=>n.e(70).then(n.bind(null,499)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)(()=>n.e(78).then(n.bind(null,500)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)(()=>n.e(72).then(n.bind(null,360)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)(()=>n.e(68).then(n.bind(null,361)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)(()=>n.e(76).then(n.bind(null,436)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)(()=>n.e(73).then(n.bind(null,317)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)(()=>n.e(74).then(n.bind(null,437)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)(()=>n.e(69).then(n.bind(null,438)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)(()=>n.e(77).then(n.bind(null,439)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)(()=>n.e(75).then(n.bind(null,440)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)(()=>Promise.all([n.e(1),n.e(10),n.e(4),n.e(67)]).then(n.bind(null,501)))});const i=e=>Object(r.getRegisteredBlockComponents)(e)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){e.exports=n(263)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(38),c=n(7),i=n(1),a=n(6),l=n(5),s=n.n(l),u=n(22);n(240);var d=e=>{let{currentPage:t,displayFirstAndLastPages:n=!0,displayNextAndPreviousArrows:o=!0,pagesToDisplay:c=3,onPageChange:a,totalPages:l}=e,{minIndex:d,maxIndex:p}=((e,t,n)=>{if(n<=2)return{minIndex:null,maxIndex:null};const 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}})(c,t,l);const m=n&&Boolean(1!==d),b=n&&Boolean(p!==l),f=n&&Boolean(d&&d>3),g=n&&Boolean(p&&p<l-2);m&&3===d&&(d-=1),b&&p===l-2&&(p+=1);const h=[];if(d&&p)for(let e=d;e<=p;e++)h.push(e);return Object(r.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(r.createElement)(u.a,{screenReaderLabel:Object(i.__)("Navigate to another page","woocommerce")}),o&&Object(r.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>a(t-1),title:Object(i.__)("Previous page","woocommerce"),disabled:t<=1},Object(r.createElement)(u.a,{label:"←",screenReaderLabel:Object(i.__)("Previous page","woocommerce")})),m&&Object(r.createElement)("button",{className:s()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:()=>a(1),disabled:1===t},Object(r.createElement)(u.a,{label:"1",screenReaderLabel:Object(i.sprintf)(
|
4 |
/* translators: %d is the page number (1, 2, 3...). */
|
5 |
Object(i.__)("Page %d","woocommerce"),1)})),f&&Object(r.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(i.__)("…","woocommerce")),h.map(e=>Object(r.createElement)("button",{key:e,className:s()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?void 0:()=>a(e),disabled:t===e},Object(r.createElement)(u.a,{label:e.toString(),screenReaderLabel:Object(i.sprintf)(
|
6 |
/* translators: %d is the page number (1, 2, 3...). */
|
7 |
Object(i.__)("Page %d","woocommerce"),e)}))),g&&Object(r.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(i.__)("…","woocommerce")),b&&Object(r.createElement)("button",{className:s()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===l,"wc-block-components-pagination__page--active":t===l}),onClick:()=>a(l),disabled:t===l},Object(r.createElement)(u.a,{label:l.toString(),screenReaderLabel:Object(i.sprintf)(
|
8 |
/* translators: %d is the page number (1, 2, 3...). */
|
9 |
+
Object(i.__)("Page %d","woocommerce"),l)})),o&&Object(r.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>a(t+1),title:Object(i.__)("Next page","woocommerce"),disabled:t>=l},Object(r.createElement)(u.a,{label:"→",screenReaderLabel:Object(i.__)("Next page","woocommerce")})))},p=n(61),m=n(29),b=n(279),f=n(66),g=n(99),h=n(47),E=n(24),O=n(111),w=n(14),y=Object(r.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(r.createElement)(w.Path,{d:"M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1.13 9.38l.35-6.46H8.52l.35 6.46h2.26zm-.09 3.36c.24-.23.37-.55.37-.96 0-.42-.12-.74-.36-.97s-.59-.35-1.06-.35-.82.12-1.07.35-.37.55-.37.97c0 .41.13.73.38.96.26.23.61.34 1.06.34s.8-.11 1.05-.34z"})),v=()=>{const{parentClassName:e}=Object(h.useInnerBlockLayoutContext)();return Object(r.createElement)("div",{className:e+"__no-products"},Object(r.createElement)(O.a,{className:e+"__no-products-image",icon:y,size:100}),Object(r.createElement)("strong",{className:e+"__no-products-title"},Object(i.__)("No products","woocommerce")),Object(r.createElement)("p",{className:e+"__no-products-description"},Object(i.__)("There are currently no products available to display.","woocommerce")))},j=Object(r.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(w.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"})),_=e=>{let{resetCallback:t=(()=>{})}=e;const{parentClassName:n}=Object(h.useInnerBlockLayoutContext)();return Object(r.createElement)("div",{className:n+"__no-products"},Object(r.createElement)(O.a,{className:n+"__no-products-image",icon:j,size:100}),Object(r.createElement)("strong",{className:n+"__no-products-title"},Object(i.__)("No products found","woocommerce")),Object(r.createElement)("p",{className:n+"__no-products-description"},Object(i.__)("We were unable to find any results based on your search.","woocommerce")),Object(r.createElement)("button",{onClick:t},Object(i.__)("Reset Search","woocommerce")))},x=n(123);n(239);var k=e=>{let{onChange:t,value:n}=e;return Object(r.createElement)(x.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",onChange:t,options:[{key:"menu_order",label:Object(i.__)("Default sorting","woocommerce")},{key:"popularity",label:Object(i.__)("Popularity","woocommerce")},{key:"rating",label:Object(i.__)("Average rating","woocommerce")},{key:"date",label:Object(i.__)("Latest","woocommerce")},{key:"price",label:Object(i.__)("Price: low to high","woocommerce")},{key:"price-desc",label:Object(i.__)("Price: high to low","woocommerce")}],screenReaderLabel:Object(i.__)("Order products by","woocommerce"),value:n})},S=n(10),T=n(11),N=n.n(T),C=n(143);const R=(e,t,n,o)=>{if(!n)return;const c=Object(C.a)(e);return n.map((n,i)=>{let[a,l={}]=n,s=[];l.children&&l.children.length>0&&(s=R(e,t,l.children,o));const u=c[a];if(!u)return null;const d=t.id||0,p=["layout",a,i,o,d];return Object(r.createElement)(r.Suspense,{key:p.join("_"),fallback:Object(r.createElement)("div",{className:"wc-block-placeholder"})},Object(r.createElement)(u,N()({},l,{children:s,product:t})))})};var A=Object(S.withInstanceId)(e=>{let{product:t={},attributes:n,instanceId:o}=e;const{layoutConfig:c}=n,{parentClassName:i,parentName:a}=Object(h.useInnerBlockLayoutContext)(),l=0===Object.keys(t).length,u=s()(i+"__product","wc-block-layout",{"is-loading":l});return Object(r.createElement)("li",{className:u,"aria-hidden":l},R(a,t,c,o))});n(238);const L=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"}}},P=function(e){let{totalQuery:t,totalProducts:n}=e,{totalQuery:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!Object(a.isEqual)(t,r)&&Number.isFinite(n)};var M=Object(g.a)(e=>{let{attributes:t,currentPage:n,onPageChange:o,onSortChange:c,sortValue:l,scrollToTop:u}=e;const[g,O]=Object(m.b)("attributes",[]),[w,y]=Object(m.b)("stock_status",[]),[j,x]=Object(m.b)("rating",[]),[S,T]=Object(m.b)("min_price"),[N,C]=Object(m.b)("max_price"),[R]=Object(m.c)((e=>{let{sortValue:t,currentPage:n,attributes:r}=e;const{columns:o,rows:c}=r;return{...L(t),catalog_visibility:"catalog",per_page:o*c,page:n}})({attributes:t,sortValue:l,currentPage:n})),{products:M,totalProducts:D,productsLoading:F}=Object(b.a)(R),{parentClassName:B,parentName:I}=Object(h.useInnerBlockLayoutContext)(),H=(e=>{const{order:t,orderby:n,page:r,per_page:o,...c}=e;return c||{}})(R),{dispatchStoreEvent:z}=Object(f.a)(),U=Object(p.a)({totalQuery:H,totalProducts:D},P);Object(r.useEffect)(()=>{z("product-list-render",{products:M,listName:I})},[M,I,z]),Object(r.useEffect)(()=>{Object(a.isEqual)(H,null==U?void 0:U.totalQuery)||(o(1),null!=U&&U.totalQuery&&(e=>{Number.isFinite(e)&&(0===e?Object(E.speak)(Object(i.__)("No products found","woocommerce")):Object(E.speak)(Object(i.sprintf)(
|
10 |
/* translators: %s is an integer higher than 0 (1, 2, 3...) */
|
11 |
+
Object(i._n)("%d product found","%d products found",e,"woocommerce"),e)))})(D))},[null==U?void 0:U.totalQuery,D,o,H]);const{contentVisibility:W}=t,G=t.columns*t.rows,Y=!Number.isFinite(D)&&Number.isFinite(null==U?void 0:U.totalProducts)&&Object(a.isEqual)(H,null==U?void 0:U.totalQuery)?Math.ceil(((null==U?void 0:U.totalProducts)||0)/G):Math.ceil(D/G),V=M.length?M:Array.from({length:G}),q=0!==M.length||F,Q=g.length>0||w.length>0||j.length>0||Number.isFinite(S)||Number.isFinite(N);return Object(r.createElement)("div",{className:(()=>{const{columns:e,rows:n,alignButtons:r,align:o}=t,c=void 0!==o?"align"+o:"";return s()(B,c,"has-"+e+"-columns",{"has-multiple-rows":n>1,"has-aligned-buttons":r})})()},(null==W?void 0:W.orderBy)&&q&&Object(r.createElement)(k,{onChange:c,value:l}),!q&&Q&&Object(r.createElement)(_,{resetCallback:()=>{O([]),y([]),x([]),T(null),C(null)}}),!q&&!Q&&Object(r.createElement)(v,null),q&&Object(r.createElement)("ul",{className:s()(B+"__products",{"is-loading-products":F})},V.map((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return Object(r.createElement)(A,{key:e.id||n,attributes:t,product:e})}))),Y>1&&Object(r.createElement)(d,{currentPage:n,onPageChange:e=>{u({focusableSelector:"a, button"}),o(e)},totalPages:Y}))}),D=e=>{let{attributes:t}=e;const[n,o]=Object(r.useState)(1),[c,i]=Object(r.useState)(t.orderby);return Object(r.useEffect)(()=>{i(t.orderby)},[t.orderby]),Object(r.createElement)(M,{attributes:t,currentPage:n,onPageChange:e=>{o(e)},onSortChange:e=>{var t;const n=null==e||null===(t=e.target)||void 0===t?void 0:t.value;i(n),o(1)},sortValue:c})};const F=Object(r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(r.createElement)("title",null,"Grid Block Preview"),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}));var B=n(136);class I extends c.Component{render(){const{attributes:e,urlParameterSuffix:t}=this.props;return e.isPreview?F:Object(r.createElement)(h.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(r.createElement)(B.a,{context:"wc/all-products"}),Object(r.createElement)(D,{attributes:e,urlParameterSuffix:t}))}}var H=I;Object(o.a)({selector:".wp-block-woocommerce-all-products",Block:e=>Object(r.createElement)(H,e),getProps:e=>({attributes:JSON.parse(e.dataset.attributes)})})},,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(60),o=n(3),c=n(4),i=n(27);const a=e=>{const t={namespace:"/wc/store/v1",resourceName:"products"},{results:n,isLoading:a}=Object(r.a)({...t,query:e}),{value:l}=((e,t)=>{const{namespace:n,resourceName:r,resourceValues:a=[],query:l={}}=t;if(!n||!r)throw new Error("The options object must have valid values for the namespace and the resource name properties.");const s=Object(i.a)(l),u=Object(i.a)(a),{value:d,isLoading:p=!0}=Object(c.useSelect)(e=>{const t=e(o.COLLECTIONS_STORE_KEY),c=["x-wp-total",n,r,s,u];return{value:t.getCollectionHeader(...c),isLoading:t.hasFinishedResolution("getCollectionHeader",c)}},["x-wp-total",n,r,u,s]);return{value:d,isLoading:p}})(0,{...t,query:e});return{products:n,totalProducts:parseInt(l,10),productsLoading:a}}}]);
|
packages/woocommerce-blocks/build/all-products.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '9fed0b9eb737353e5703d85290f9b255');
|
packages/woocommerce-blocks/build/all-products.js
CHANGED
@@ -1,36 +1,36 @@
|
|
1 |
-
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-products"]=function(e){function t(t){for(var r,a,s=t[0],l=t[1],i=t[2],d=0,b=[];d<s.length;d++)a=s[d],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&b.push(o[a][0]),o[a]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(u&&u(t);b.length;)b.shift()();return n.push.apply(n,i||[]),c()}function c(){for(var e,t=0;t<n.length;t++){for(var c=n[t],r=!0,s=1;s<c.length;s++){var l=c[s];0!==o[l]&&(r=!1)}r&&(n.splice(t--,1),e=a(a.s=c[0]))}return e}var r={},o={6:0,1:0,2:0,3:0,4:0,21:0,24:0,28:0,30:0,31:0,33:0,34:0,35:0,37:0},n=[];function a(t){if(r[t])return r[t].exports;var c=r[t]={i:t,l:!1,exports:{}};return e[t].call(c.exports,c,c.exports,a),c.l=!0,c.exports}a.e=function(e){var t=[],c=o[e];if(0!==c)if(c)t.push(c[2]);else{var r=new Promise((function(t,r){c=o[e]=[t,r]}));t.push(c[2]=r);var n,s=document.createElement("script");s.charset="utf-8",s.timeout=120,a.nc&&s.setAttribute("nonce",a.nc),s.src=function(e){return a.p+""+({1:"product-add-to-cart--product-button--product-category-list--product-image--product-price--product-r--a0326d00",2:"product-button--product-category-list--product-image--product-price--product-rating--product-sale-b--e17c7c01",3:"product-button--product-image--product-rating--product-sale-badge--product-title",4:"product-add-to-cart--product-button--product-image--product-title",19:"product-add-to-cart",21:"product-button",24:"product-category-list",25:"product-image",28:"product-price",30:"product-rating",31:"product-sale-badge",33:"product-sku",34:"product-stock-indicator",35:"product-summary",37:"product-tag-list",38:"product-title"}[e]||e)+".js?ver="+{1:"
|
2 |
/* Translators: %s search term */
|
3 |
noResults:Object(n.__)("No results for %s","woocommerce"),search:Object(n.__)("Search for items","woocommerce"),selected:e=>Object(n.sprintf)(
|
4 |
/* translators: Number of items selected from list. */
|
5 |
-
Object(n._n)("%d item selected","%d items selected",e,"woocommerce"),e),updated:Object(n.__)("Search results updated.","woocommerce")},s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const c=Object(o.groupBy)(e,"parent"),r=Object(o.keyBy)(t,"id"),n=["0"],a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=a(r[e.parent]);return[...t,e.name]},s=e=>e.map(e=>{const t=c[e.id];return n.push(""+e.id),{...e,breadcrumbs:a(r[e.parent]),children:t&&t.length?s(t):[]}}),l=s(c[0]||[]);return Object.entries(c).forEach(e=>{let[t,c]=e;n.includes(t)||l.push(...s(c||[]))}),l},l=(e,t,c)=>{if(!t)return c?s(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),o=e.map(e=>!!r.test(e.name)&&e).filter(Boolean);return c?s(o,e):o},i=(e,t)=>{if(!t)return e;const c=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(c).map((e,t)=>c.test(e)?Object(r.createElement)("strong",{key:t},e):Object(r.createElement)(r.Fragment,{key:t},e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},,,function(e,t,c){"use strict";c.d(t,"o",(function(){return n})),c.d(t,"m",(function(){return a})),c.d(t,"l",(function(){return s})),c.d(t,"n",(function(){return l})),c.d(t,"j",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"f",(function(){return d})),c.d(t,"g",(function(){return b})),c.d(t,"k",(function(){return p})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return g})),c.d(t,"h",(function(){return O})),c.d(t,"a",(function(){return j})),c.d(t,"i",(function(){return h})),c.d(t,"b",(function(){return _}));var r,o=c(2);const n=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=n.pluginUrl+"images/",s=n.pluginUrl+"build/",l=n.buildPhase,i=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=o.STORE_PAGES.checkout.id,d=o.STORE_PAGES.checkout.permalink,b=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),m=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),g=o.STORE_PAGES.cart.permalink,O=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),j=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),_=Object(o.getSetting)("allowedStates",{})},function(e,t){e.exports=window.wc.wcBlocksSharedContext},,function(e,t){e.exports=window.wp.isShallowEqual},function(e,t){e.exports=window.wc.priceFormat},function(e,t,c){"use strict";c.d(t,"h",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"b",(function(){return d})),c.d(t,"i",(function(){return b})),c.d(t,"f",(function(){return p})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return g})),c.d(t,"g",(function(){return O})),c.d(t,"a",(function(){return j}));var r=c(16),o=c(14),n=c.n(o),a=c(8),s=c(2),l=c(22);const i=e=>{let{selected:t=[],search:c="",queryArgs:o={}}=e;const s=(e=>{let{selected:t=[],search:c="",queryArgs:o={}}=e;const n=l.o.productCount>100,a={per_page:n?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},s=[Object(r.addQueryArgs)("/wc/store/v1/products",{...a,...o})];return n&&t.length&&s.push(Object(r.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),s})({selected:t,search:c,queryArgs:o});return Promise.all(s.map(e=>n()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>n()({path:"/wc/store/v1/products/"+e}),d=()=>n()({path:"wc/store/v1/products/attributes"}),b=e=>n()({path:`wc/store/v1/products/attributes/${e}/terms`}),p=e=>{let{selected:t=[],search:c}=e;const o=(e=>{let{selected:t=[],search:c}=e;const o=Object(s.getSetting)("limitTags",!1),n=[Object(r.addQueryArgs)("wc/store/v1/products/tags",{per_page:o?100:0,orderby:o?"count":"name",order:o?"desc":"asc",search:c})];return o&&t.length&&n.push(Object(r.addQueryArgs)("wc/store/v1/products/tags",{include:t})),n})({selected:t,search:c});return Promise.all(o.map(e=>n()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id"))},m=e=>n()({path:Object(r.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),g=e=>n()({path:"wc/store/v1/products/categories/"+e}),O=e=>n()({path:Object(r.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),j=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return a}));var r=c(1),o=c(15);const n=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},a=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(o.decodeEntities)(e.message):Object(r.__)("Something went wrong. Please contact us to get assistance.","woocommerce")}},function(e,t,c){"use strict";var r=c(0),o=c(4),n=c.n(o);t.a=e=>{let t,{label:c,screenReaderLabel:o,wrapperElement:a,wrapperProps:s={}}=e;const l=null!=c,i=null!=o;return!l&&i?(t=a||"span",s={...s,className:n()(s.className,"screen-reader-text")},Object(r.createElement)(t,s,o)):(t=a||r.Fragment,l&&i&&c!==o?Object(r.createElement)(t,s,Object(r.createElement)("span",{"aria-hidden":"true"},c),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,s,c))}},,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return o}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return r(e)&&t in e}},function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(35);t.a=e=>{let{error:t}=e;return Object(r.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:c}=e;return t?"general"===c?Object(r.createElement)("span",null,Object(o.__)("The following error was returned","woocommerce"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(n.escapeHTML)(t))):"api"===c?Object(r.createElement)("span",null,Object(o.__)("The following error was returned from the API","woocommerce"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(n.escapeHTML)(t))):t:Object(o.__)("An error has prevented the block from being updated.","woocommerce")})(t))}},function(e,t){e.exports=window.wp.escapeHtml},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var r=c(6),o=c.n(r),n=c(0),a=c(19);const s=e=>{let{countLabel:t,className:c,depth:r=0,controlId:s="",item:l,isSelected:i,isSingle:u,onSelect:d,search:b="",...p}=e;const m=null!=t&&void 0!==l.count&&null!==l.count,g=[c,"woocommerce-search-list__item"];g.push("depth-"+r),u&&g.push("is-radio-button"),m&&g.push("has-count");const O=l.breadcrumbs&&l.breadcrumbs.length,j=p.name||"search-list-item-"+s,h=`${j}-${l.id}`;return Object(n.createElement)("label",{htmlFor:h,className:g.join(" ")},u?Object(n.createElement)("input",o()({type:"radio",id:h,name:j,value:l.value,onChange:d(l),checked:i,className:"woocommerce-search-list__item-input"},p)):Object(n.createElement)("input",o()({type:"checkbox",id:h,name:j,value:l.value,onChange:d(l),checked:i,className:"woocommerce-search-list__item-input"},p)),Object(n.createElement)("span",{className:"woocommerce-search-list__item-label"},O?Object(n.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(a.b)(l.breadcrumbs)):null,Object(n.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(a.d)(l.name,b))),!!m&&Object(n.createElement)("span",{className:"woocommerce-search-list__item-count"},t||l.count))};t.b=s},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(131),s=c(4),l=c.n(s);c(137);const i=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:c,currency:r,onValueChange:s,displayType:u="text",...d}=e;const b="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(b))return null;const p=b/10**r.minorUnit;if(!Number.isFinite(p))return null;const m=l()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),g={...d,...i(r),value:void 0,currency:void 0,onValueChange:void 0},O=s?e=>{const t=+e.value*10**r.minorUnit;s(t)}:()=>{};return Object(n.createElement)(a.a,o()({className:m,displayType:u},g,{value:p,onValueChange:O}))}},,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(0),o=c(25),n=c.n(o);function a(e){const t=Object(r.useRef)(e);return n()(e,t.current)||(t.current=e),t.current}},function(e,t,c){"use strict";c.d(t,"a",(function(){return _}));var r=c(8),o=c(0),n=c(9),a=c(7),s=c(15),l=c(267),i=c(85),u=c(266);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(a.dispatch)(n.CART_STORE_KEY).invalidateResolutionForStore()},b=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},p=()=>{Object(o.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.a)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.a)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),b),[])},m={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},g={...m,email:""},O={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:n.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},j=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,c]=e;return[t,Object(s.decodeEntities)(c)]})),h={cartCoupons:n.EMPTY_CART_COUPONS,cartItems:n.EMPTY_CART_ITEMS,cartFees:n.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,crossSellsProducts:n.EMPTY_CART_CROSS_SELLS,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:n.EMPTY_CART_ITEM_ERRORS,cartTotals:O,cartIsLoading:!0,cartErrors:n.EMPTY_CART_ERRORS,billingAddress:g,shippingAddress:m,shippingRates:n.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:n.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:n.EMPTY_EXTENSIONS},_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:c}=Object(i.b)(),s=null==c?void 0:c.previewCart,{shouldSelect:u}=e,d=Object(o.useRef)();p();const b=Object(a.useSelect)((e,c)=>{let{dispatch:r}=c;if(!u)return h;if(t)return{cartCoupons:s.coupons,cartItems:s.items,crossSellsProducts:s.cross_sells,cartFees:s.fees,cartItemsCount:s.items_count,cartItemsWeight:s.items_weight,cartNeedsPayment:s.needs_payment,cartNeedsShipping:s.needs_shipping,cartItemErrors:n.EMPTY_CART_ITEM_ERRORS,cartTotals:s.totals,cartIsLoading:!1,cartErrors:n.EMPTY_CART_ERRORS,billingData:g,billingAddress:g,shippingAddress:m,extensions:n.EMPTY_EXTENSIONS,shippingRates:s.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:s.has_calculated_shipping,paymentRequirements:s.paymentRequirements,receiveCart:"function"==typeof(null==s?void 0:s.receiveCart)?s.receiveCart:()=>{}};const o=e(n.CART_STORE_KEY),a=o.getCartData(),i=o.getCartErrors(),d=o.getCartTotals(),b=!o.hasFinishedResolution("getCartData"),p=o.isCustomerDataUpdating(),{receiveCart:O}=r(n.CART_STORE_KEY),_=j(a.billingAddress),E=a.needsShipping?j(a.shippingAddress):_,w=a.fees.length>0?a.fees.map(e=>j(e)):n.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map(e=>({...e,label:e.code})):n.EMPTY_CART_COUPONS,cartItems:a.items,crossSellsProducts:a.crossSells,cartFees:w,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:d,cartIsLoading:b,cartErrors:i,billingData:Object(l.a)(_),billingAddress:Object(l.a)(_),shippingAddress:Object(l.a)(E),extensions:a.extensions,shippingRates:a.shippingRates,isLoadingRates:p,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:O}},[u]);return d.current&&Object(r.isEqual)(d.current,b)||(d.current=b),d.current}},function(e,t){e.exports=window.wc.wcBlocksSharedHocs},,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(0);const o=Object(r.createContext)("page"),n=()=>Object(r.useContext)(o);o.Provider},,function(e,t){e.exports=window.wp.hooks},,function(e,t){e.exports=window.wp.a11y},,,,function(e,t){e.exports=window.wp.deprecated},function(e,t,c){"use strict";c.d(t,"a",(function(){return d})),c.d(t,"b",(function(){return b})),c.d(t,"c",(function(){return p}));var r=c(9),o=c(7),n=c(0),a=c(25),s=c.n(a),l=c(40),i=c(104),u=c(44);const d=e=>{const t=Object(u.a)();e=e||t;const c=Object(o.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:a}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[c,Object(n.useCallback)(t=>{a(e,t)},[e,a])]},b=(e,t,c)=>{const a=Object(u.a)();c=c||a;const s=Object(o.useSelect)(o=>o(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(c,e,t),[c,e]),{setQueryValue:l}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[s,Object(n.useCallback)(t=>{l(c,e,t)},[c,e,l])]},p=(e,t)=>{const c=Object(u.a)();t=t||c;const[r,o]=d(t),a=Object(l.a)(r),b=Object(l.a)(e),p=Object(i.a)(b),m=Object(n.useRef)(!1);return Object(n.useEffect)(()=>{s()(p,b)||(o(Object.assign({},a,b)),m.current=!0)},[a,b,p,o]),m.current?[r,o]:[e,o]}},,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"e",(function(){return n})),c.d(t,"d",(function(){return a})),c.d(t,"b",(function(){return l})),c.d(t,"c",(function(){return i}));var r=c(33);const o=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];let n,a;!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"}(a||(a={}));const s=(e,t)=>Object(r.a)(e)&&"type"in e&&e.type===t,l=e=>s(e,n.ERROR),i=e=>s(e,n.FAIL)},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(136),s=c(4),l=c.n(s),i=c(96);c(163),t.a=e=>{let{className:t,showSpinner:c=!1,children:r,variant:s="contained",...u}=e;const d=l()("wc-block-components-button",t,s,{"wc-block-components-button--loading":c});return Object(n.createElement)(a.a,o()({className:d},u),c&&Object(n.createElement)(i.a,null),Object(n.createElement)("span",{className:"wc-block-components-button__text"},r))}},function(e,t){e.exports=window.wp.autop},function(e,t,c){"use strict";c.d(t,"c",(function(){return n})),c.d(t,"a",(function(){return a})),c.d(t,"b",(function(){return s}));var r=c(10),o=c(22);const n=(e,t)=>{if(o.n>2)return Object(r.registerBlockType)(e,t)},a=()=>o.n>2,s=()=>o.n>1},,,function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(8),a=c(3);t.a=e=>{let{columns:t,rows:c,setAttributes:s,alignButtons:l,minColumns:i=1,maxColumns:u=6,minRows:d=1,maxRows:b=6}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.RangeControl,{label:Object(o.__)("Columns","woocommerce"),value:t,onChange:e=>{const t=Object(n.clamp)(e,i,u);s({columns:Number.isNaN(t)?"":t})},min:i,max:u}),Object(r.createElement)(a.RangeControl,{label:Object(o.__)("Rows","woocommerce"),value:c,onChange:e=>{const t=Object(n.clamp)(e,d,b);s({rows:Number.isNaN(t)?"":t})},min:d,max:b}),Object(r.createElement)(a.ToggleControl,{label:Object(o.__)("Align the last block to the bottom","woocommerce"),help:l?Object(o.__)("Align the last block to the bottom.","woocommerce"):Object(o.__)("The last inner block will follow other content.","woocommerce"),checked:l,onChange:()=>s({alignButtons:!l})}))}},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(0),o=c(7),n=c(9);c(185);const a=e=>{let{errorMessage:t="",propertyName:c="",elementId:a=""}=e;const{validationError:s,validationErrorId:l}=Object(o.useSelect)(e=>{const t=e(n.VALIDATION_STORE_KEY);return{validationError:t.getValidationError(c),validationErrorId:t.getValidationErrorId(a)}});if(!t||"string"!=typeof t){if(null==s||!s.message||null!=s&&s.hidden)return null;t=s.message}return Object(r.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(r.createElement)("p",{id:l},t))};t.b=a},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(46),o=c(0),n=c(41);const a=()=>{const e=Object(n.a)(),t=Object(o.useRef)(e);return Object(o.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...c,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},,,function(e,t){e.exports=window.wp.dom},,,,,,,function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(38),a=c(4),s=c.n(a),l=c(26);c(162);const i=e=>{let{currency:t,maxPrice:c,minPrice:a,priceClassName:i,priceStyle:u={}}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},Object(o.sprintf)(
|
6 |
/* translators: %1$s min price, %2$s max price */
|
7 |
-
Object(o.__)("Price between %1$s and %2$s","woocommerce"),Object(l.formatPrice)(a),Object(l.formatPrice)(c))),Object(r.createElement)("span",{"aria-hidden":!0},Object(r.createElement)(n.a,{className:s()("wc-block-components-product-price__value",i),currency:t,value:a,style:u})," — ",Object(r.createElement)(n.a,{className:s()("wc-block-components-product-price__value",i),currency:t,value:c,style:u})))},u=e=>{let{currency:t,regularPriceClassName:c,regularPriceStyle:a,regularPrice:l,priceClassName:i,priceStyle:u,price:d}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Previous price:","woocommerce")),Object(r.createElement)(n.a,{currency:t,renderText:e=>Object(r.createElement)("del",{className:s()("wc-block-components-product-price__regular",c),style:a},e),value:l}),Object(r.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Discounted price:","woocommerce")),Object(r.createElement)(n.a,{currency:t,renderText:e=>Object(r.createElement)("ins",{className:s()("wc-block-components-product-price__value","is-discounted",i),style:u},e),value:d}))};t.a=e=>{let{align:t,className:c,currency:o,format:a="<price/>",maxPrice:l,minPrice:d,price:b,priceClassName:p,priceStyle:m,regularPrice:g,regularPriceClassName:O,regularPriceStyle:j}=e;const h=s()(c,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+t]:t});a.includes("<price/>")||(a="<price/>",console.error("Price formats need to include the `<price/>` tag."));const _=g&&b!==g;let E=Object(r.createElement)("span",{className:s()("wc-block-components-product-price__value",p)});return _?E=Object(r.createElement)(u,{currency:o,price:b,priceClassName:p,priceStyle:m,regularPrice:g,regularPriceClassName:O,regularPriceStyle:j}):void 0!==d&&void 0!==l?E=Object(r.createElement)(i,{currency:o,maxPrice:l,minPrice:d,priceClassName:p,priceStyle:m}):b&&(E=Object(r.createElement)(n.a,{className:s()("wc-block-components-product-price__value",p),currency:o,value:b,style:m})),Object(r.createElement)("span",{className:h},Object(r.createInterpolateElement)(a,{price:E}))}}
|
8 |
/* translators: %s Field label. */
|
9 |
-
Object(o.__)("%s (optional)","woocommerce"),e.label)),e.priority&&(Object(n.a)(e.priority)&&(t.index=e.priority),Object(a.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},i=Object.entries(s).map(e=>{let[t,c]=e;return[t,Object.entries(c).map(e=>{let[t,c]=e;return[t,l(c)]}).reduce((e,t)=>{let[c,r]=t;return e[c]=r,e},{})]}).reduce((e,t)=>{let[c,r]=t;return e[c]=r,e},{});t.a=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=c&&void 0!==i[c]?i[c]:{};return e.map(e=>({key:e,...r.defaultAddressFields[e]||{},...o[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},function(e,t,c){"use strict";var r=c(0);c(164),t.a=()=>Object(r.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(1),s=c(8),l=c(37),i=c(100),u=c(11),d=Object(u.createHigherOrderComponent)(e=>{class t extends n.Component{render(){const{selected:t}=this.props,c=null==t;return Array.isArray(t)?Object(n.createElement)(e,this.props):Object(n.createElement)(e,o()({},this.props,{selected:c?[]:[t]}))}}return t.defaultProps={selected:null},t},"withTransformSingleSelectToMultipleSelect"),b=c(188),p=c(24),m=c.n(p),g=c(25),O=c.n(g),j=c(27),h=c(28),_=Object(u.createHigherOrderComponent)(e=>{class t extends n.Component{constructor(){super(...arguments),m()(this,"state",{error:null,loading:!1,variations:{}}),m()(this,"loadVariations",()=>{const{products:e}=this.props,{loading:t,variations:c}=this.state;if(t)return;const r=this.getExpandedProduct();if(!r||c[r])return;const o=e.find(e=>e.id===r);o.variations&&0!==o.variations.length?(this.setState({loading:!0}),Object(j.g)(r).then(e=>{const t=e.map(e=>({...e,parent:r}));this.setState({variations:{...this.state.variations,[r]:t},loading:!1,error:null})}).catch(async e=>{const t=await Object(h.a)(e);this.setState({variations:{...this.state.variations,[r]:null},loading:!1,error:t})})):this.setState({variations:{...this.state.variations,[r]:null},loading:!1,error:null})})}componentDidMount(){const{selected:e,showVariations:t}=this.props;e&&t&&this.loadVariations()}componentDidUpdate(e){const{isLoading:t,selected:c,showVariations:r}=this.props;r&&(!O()(e.selected,c)||e.isLoading&&!t)&&this.loadVariations()}isProductId(e){const{products:t}=this.props;return t.some(t=>t.id===e)}findParentProduct(e){var t;const{products:c}=this.props;return null===(t=c.filter(t=>t.variations&&t.variations.find(t=>{let{id:c}=t;return c===e}))[0])||void 0===t?void 0:t.id}getExpandedProduct(){const{isLoading:e,selected:t,showVariations:c}=this.props;if(!c)return null;let r=t&&t.length?t[0]:null;return r?this.prevSelectedItem=r:this.prevSelectedItem&&(e||this.isProductId(this.prevSelectedItem)||(r=this.prevSelectedItem)),!e&&r?this.isProductId(r)?r:this.findParentProduct(r):null}render(){const{error:t,isLoading:c}=this.props,{error:r,loading:a,variations:s}=this.state;return Object(n.createElement)(e,o()({},this.props,{error:r||t,expandedProduct:this.getExpandedProduct(),isLoading:c,variations:s,variationsLoading:a}))}}return m()(t,"defaultProps",{selected:[],showVariations:!1}),t},"withProductVariations"),E=c(
|
10 |
/* translators: %1$d is the number of variations of a product product. */
|
11 |
Object(a.__)("%1$d variations","woocommerce"),t.variations.length):null,name:"products-"+r,"aria-label":Object(a.sprintf)(
|
12 |
/* translators: %1$s is the product name, %2$d is the number of variations of that product. */
|
13 |
-
Object(a._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,"woocommerce"),t.name,t.variations.length)}));const g=Object(s.isEmpty)(t.variation)?e:{...e,item:{...e.item,name:t.variation},"aria-label":`${t.breadcrumbs[0]}: ${t.variation}`};return Object(n.createElement)(l.a,o()({},g,{className:m,name:"variations-"+r}))}:null),onSearch:p,messages:y,isHierarchical:!0})};v.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1},t.a=d(Object(b.a)(_(Object(u.withInstanceId)(v))))},function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return s}));var r=c(8);let o;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(o||(o={}));const n={addEventCallback:function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(r.uniqueId)(),type:o.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:c}},removeEventCallback:(e,t)=>({id:t,type:o.REMOVE_EVENT_CALLBACK,eventType:e})},a={},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,{type:t,eventType:c,id:r,callback:n,priority:s}=arguments.length>1?arguments[1]:void 0;const l=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(t){case o.ADD_EVENT_CALLBACK:return l.set(r,{priority:s,callback:n}),{...e,[c]:l};case o.REMOVE_EVENT_CALLBACK:return l.delete(r),{...e,[c]:l}}}},function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var r=c(5),o=c(61),n=c(
|
14 |
-
Object(a.__)("Remove %s","woocommerce"),c),"aria-describedby":E},Object(n.createElement)(l.a,{icon:g.a,size:20,className:"clear-icon"})))};var h=j;const _=e=>Object(n.createElement)(m.b,e),E=e=>{const{list:t,selected:c,renderItem:r,depth:a=0,onSelect:s,instanceId:l,isSingle:i,search:u}=e;return t?Object(n.createElement)(n.Fragment,null,t.map(t=>{const d=-1!==c.findIndex(e=>{let{id:c}=e;return c===t.id});return Object(n.createElement)(n.Fragment,{key:t.id},Object(n.createElement)("li",null,r({item:t,isSelected:d,onSelect:s,isSingle:i,search:u,depth:a,controlId:l})),Object(n.createElement)(E,o()({},e,{list:t.children,depth:a+1})))})):null},w=e=>{let{isLoading:t,isSingle:c,selected:r,messages:o,onChange:l,onRemove:i}=e;if(t||c||!r)return null;const u=r.length;return Object(n.createElement)("div",{className:"woocommerce-search-list__selected"},Object(n.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(n.createElement)("strong",null,o.selected(u)),u>0?Object(n.createElement)(s.Button,{isLink:!0,isDestructive:!0,onClick:()=>l([]),"aria-label":o.clear},Object(a.__)("Clear all","woocommerce")):null),u>0?Object(n.createElement)("ul",null,r.map((e,t)=>Object(n.createElement)("li",{key:t},Object(n.createElement)(h,{label:e.name,id:e.id,remove:i})))):null)},f=e=>{let{filteredList:t,search:c,onSelect:r,instanceId:o,...s}=e;const{messages:u,renderItem:d,selected:b,isSingle:p}=s,m=d||_;return 0===t.length?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(n.createElement)(l.a,{icon:i.a})),Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-text"},c?Object(a.sprintf)(u.noResults,c):u.noItems)):Object(n.createElement)("ul",{className:"woocommerce-search-list__list"},Object(n.createElement)(E,{list:t,selected:b,renderItem:m,onSelect:r,instanceId:o,isSingle:p,search:c}))},k=e=>{const{className:t="",isCompact:c,isHierarchical:r,isLoading:a,isSingle:l,list:i,messages:u=p.a,onChange:m,onSearch:g,selected:O,debouncedSpeak:j}=e,[h,_]=Object(n.useState)(""),E=Object(b.useInstanceId)(k),y=Object(n.useMemo)(()=>({...p.a,...u}),[u]),v=Object(n.useMemo)(()=>Object(p.c)(i,h,r),[i,h,r]);Object(n.useEffect)(()=>{j&&j(y.updated)},[j,y]),Object(n.useEffect)(()=>{"function"==typeof g&&g(h)},[h,g]);const S=Object(n.useCallback)(e=>()=>{l&&m([]);const t=O.findIndex(t=>{let{id:c}=t;return c===e});m([...O.slice(0,t),...O.slice(t+1)])},[l,O,m]),C=Object(n.useCallback)(e=>()=>{-1===O.findIndex(t=>{let{id:c}=t;return c===e.id})?m(l?[e]:[...O,e]):S(e.id)()},[l,S,m,O]);return Object(n.createElement)("div",{className:d()("woocommerce-search-list",t,{"is-compact":c})},Object(n.createElement)(w,o()({},e,{onRemove:S,messages:y})),Object(n.createElement)("div",{className:"woocommerce-search-list__search"},Object(n.createElement)(s.TextControl,{label:y.search,type:"search",value:h,onChange:e=>_(e)})),a?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(n.createElement)(s.Spinner,null)):Object(n.createElement)(f,o()({},e,{search:h,filteredList:v,messages:y,onSelect:C,instanceId:E})))};Object(s.withSpokenMessages)(k)},,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(12);function o(e,t){const c=Object(r.useRef)();return Object(r.useEffect)(()=>{c.current===e||t&&!t(e,c.current)||(c.current=e)},[e,t]),c.current}},,function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(15),s=c(4),l=c.n(s);c(161),t.a=e=>{let{className:t="",disabled:c=!1,name:r,permalink:s="",target:i,rel:u,style:d,onClick:b,...p}=e;const m=l()("wc-block-components-product-name",t);if(c){const e=p;return Object(n.createElement)("span",o()({className:m},e,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(r)}}))}return Object(n.createElement)("a",o()({className:m,href:s,target:i},p,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(r)},style:d}))}},function(e,t){e.exports=window.wp.warning},function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var r=c(9),o=c(7),n=c(0),a=c(40),s=c(142);const l=e=>{const{namespace:t,resourceName:c,resourceValues:l=[],query:i={},shouldSelect:u=!0}=e;if(!t||!c)throw new Error("The options object must have valid values for the namespace and the resource properties.");const d=Object(n.useRef)({results:[],isLoading:!0}),b=Object(a.a)(i),p=Object(a.a)(l),m=Object(s.a)(),g=Object(o.useSelect)(e=>{if(!u)return null;const o=e(r.COLLECTIONS_STORE_KEY),n=[t,c,b,p],a=o.getCollectionError(...n);if(a){if(!(a instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");m(a)}return{results:o.getCollection(...n),isLoading:!o.hasFinishedResolution("getCollection",n)}},[t,c,p,b,u]);return null!==g&&(d.current=g),d.current}},function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(119),a=c(258),s=c(2),l=c(5),i=c(23);t.a=e=>{const t=(Object(i.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(r.createElement)(l.InspectorControls,null,Object(r.createElement)("div",{className:"wc-block-single-product__edit-card"},Object(r.createElement)("div",{className:"wc-block-single-product__edit-card-title"},Object(r.createElement)("a",{href:`${s.ADMIN_URL}post.php?post=${t}&action=edit`,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Edit this product's details","woocommerce"),Object(r.createElement)(n.a,{icon:a.a,size:16}))),Object(r.createElement)("div",{className:"wc-block-single-product__edit-card-description"},Object(o.__)("Edit details such as title, price, description and more.","woocommerce")))):null}},,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(86),o=c(33);const n=e=>Object(r.a)(e)?JSON.parse(e)||{}:Object(o.a)(e)?e:{}},,,,,,function(e,t,c){"use strict";var r=c(0),o=c(91),n=c(60);const a=e=>{const t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},s=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),l=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,i=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…";const r=s(e),o=r.split(" ").splice(0,t).join(" ");return Object(n.autop)(l(o,c))},u=function(e,t){let c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…";const o=s(e),a=o.slice(0,t);if(c)return Object(n.autop)(l(a,r));const i=a.match(/([\s]+)/g),u=i?i.length:0,d=o.slice(0,t+u);return Object(n.autop)(l(d,r))};t.a=e=>{let{source:t,maxLength:c=15,countType:s="words",className:l="",style:d={}}=e;const b=Object(r.useMemo)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const r=Object(n.autop)(e),s=Object(o.count)(r,c);if(s<=t)return r;const l=a(r),d=Object(o.count)(l,c);return d<=t?l:"words"===c?i(l,t):u(l,t,"characters_including_spaces"===c)}(t,c,s),[t,c,s]);return Object(r.createElement)(r.RawHTML,{style:d,className:l},b)}},,function(e,t,c){"use strict";var r=c(0),o=c(4),n=c.n(o),a=c(29),s=c(11);c(167),t.a=Object(s.withInstanceId)(e=>{let{className:t,instanceId:c,label:o="",onChange:s,options:l,screenReaderLabel:i,value:u=""}=e;const d="wc-block-components-sort-select__select-"+c;return Object(r.createElement)("div",{className:n()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(r.createElement)(a.a,{label:o,screenReaderLabel:i,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(r.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:s,value:u},l&&l.map(e=>Object(r.createElement)("option",{key:e.key,value:e.key},e.label))))})},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r=e=>"boolean"==typeof e},function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(5);const o=()=>"function"==typeof r.__experimentalGetSpacingClassesAndStyles},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var r=c(5),o=c(61),n=c(33),a=c(127),s=c(115);const l=e=>{if(!Object(o.b)()||!Object(a.a)())return{style:{}};const t=Object(n.a)(e)?e:{},c=Object(s.a)(t.style);return Object(r.__experimentalGetSpacingClassesAndStyles)({...t,style:c})}},,,,,,,function(e,t){},function(e,t){},,,function(e,t,c){"use strict";c.r(t),c.d(t,"Block",(function(){return m}));var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(29),l=c(23),i=c(154),u=c(99),d=c(82),b=c(130),p=c(42);c(260);const m=e=>{const{className:t,align:c}=e,{parentClassName:n}=Object(l.useInnerBlockLayoutContext)(),{product:p}=Object(l.useProductDataContext)(),m=Object(i.a)(e),g=Object(u.a)(e),O=Object(d.a)(e),j=Object(b.a)(e);if(!p.id||!p.on_sale)return null;const h="string"==typeof c?"wc-block-components-product-sale-badge--align-"+c:"";return Object(r.createElement)("div",{className:a()("wc-block-components-product-sale-badge",t,h,{[n+"__product-onsale"]:n},g.className,m.className),style:{...g.style,...m.style,...O.style,...j.style}},Object(r.createElement)(s.a,{label:Object(o.__)("Sale","woocommerce"),screenReaderLabel:Object(o.__)("Product on sale","woocommerce")}))};t.default=Object(p.withProductDataContext)(m)},function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(0);const o=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(0);const o=Object(r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(r.createElement)("title",null,"Grid Block Preview"),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(3),s=c(4),l=c.n(s);c(189),t.a=function(e){let{className:t="",...c}=e;const r=l()("wc-block-text-toolbar-button",t);return Object(n.createElement)(a.Button,o()({className:r},c))}},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var r=c(5),o=c(61),n=c(33),a=c(115);const s=e=>{if(!Object(o.b)())return{className:"",style:{}};const t=Object(n.a)(e)?e:{},c=Object(a.a)(t.style);return Object(r.__experimentalUseBorderProps)({...t,style:c})}},,,,,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,function(e,t){},function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var r=c(0),o=c(7),n=c(9),a=c(15),s=c(41);const l=(e,t)=>{const c=e.find(e=>{let{id:c}=e;return c===t});return c?c.quantity:0},i=e=>{const{addItemToCart:t}=Object(o.useDispatch)(n.CART_STORE_KEY),{cartItems:c,cartIsLoading:i}=Object(s.a)(),{createErrorNotice:u,removeNotice:d}=Object(o.useDispatch)("core/notices"),[b,p]=Object(r.useState)(!1),m=Object(r.useRef)(l(c,e));return Object(r.useEffect)(()=>{const t=l(c,e);t!==m.current&&(m.current=t)},[c,e]),{cartQuantity:Number.isFinite(m.current)?m.current:0,addingToCart:b,cartIsLoading:i,addToCart:function(){let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return p(!0),t(e,c).then(()=>{d("add-to-cart")}).catch(e=>{u(Object(a.decodeEntities)(e.message),{id:"add-to-cart",context:"wc/all-products",isDismissible:!0})}).finally(()=>{p(!1)})}}}},function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r=e=>"number"==typeof e},,,,,,,,,,,,,,,,function(e,t){},,,function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(22),s=c(27),l=c(118),i=c(28);t.a=e=>t=>{let{selected:c,...r}=t;const[u,d]=Object(n.useState)(!0),[b,p]=Object(n.useState)(null),[m,g]=Object(n.useState)([]),O=a.o.productCount>100,j=async e=>{const t=await Object(i.a)(e);p(t),d(!1)},h=Object(n.useRef)(c);Object(n.useEffect)(()=>{Object(s.h)({selected:h.current}).then(e=>{g(e),d(!1)}).catch(j)},[h]);const _=Object(l.a)(e=>{Object(s.h)({selected:c,search:e}).then(e=>{g(e),d(!1)}).catch(j)},400),E=Object(n.useCallback)(e=>{d(!0),_(e)},[d,_]);return Object(n.createElement)(e,o()({},r,{selected:c,error:b,products:m,isLoading:u,onSearch:O?E:null}))}},function(e,t){},,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return g}));var r=c(0),o=c(4),n=c.n(o),a=c(23),s=c(61),l=c(42),i=c(106),u=c(70),d=c(99),b=c(130),p=c(82);c(261);const m=e=>{let{children:t,headingLevel:c,elementType:o="h"+c,...n}=e;return Object(r.createElement)(o,n,t)},g=e=>{const{className:t,headingLevel:c=2,showProductLink:o=!0,linkTarget:l,align:g}=e,{parentClassName:O}=Object(a.useInnerBlockLayoutContext)(),{product:j}=Object(a.useProductDataContext)(),{dispatchStoreEvent:h}=Object(u.a)(),_=Object(d.a)(e),E=Object(b.a)(e),w=Object(p.a)(e);return j.id?Object(r.createElement)(m,{headingLevel:c,className:n()(t,_.className,"wc-block-components-product-title",{[O+"__product-title"]:O,["wc-block-components-product-title--align-"+g]:g&&Object(s.b)()}),style:Object(s.b)()?{...E.style,...w.style,..._.style}:{}},Object(r.createElement)(i.a,{disabled:!o,name:j.name,permalink:j.permalink,target:l,onClick:()=>{h("product-view-link",{product:j})}})):Object(r.createElement)(m,{headingLevel:c,className:n()(t,_.className,"wc-block-components-product-title",{[O+"__product-title"]:O,["wc-block-components-product-title--align-"+g]:g&&Object(s.b)()}),style:Object(s.b)()?{...E.style,...w.style,..._.style}:{}})};t.b=Object(l.withProductDataContext)(g)},function(e,t,c){"use strict";c.d(t,"a",(function(){return j}));var r=c(6),o=c.n(r),n=c(0),a=c(1),s=c(4),l=c.n(s),i=c(2),u=c(23),d=c(82),b=c(154),p=c(130),m=c(42),g=c(70),O=c(141);c(262);const j=e=>{const{className:t,imageSizing:c="full-size",showProductLink:r=!0,showSaleBadge:o,saleBadgeAlign:s="right"}=e,{parentClassName:i}=Object(u.useInnerBlockLayoutContext)(),{product:m,isLoading:j}=Object(u.useProductDataContext)(),{dispatchStoreEvent:E}=Object(g.a)(),w=Object(d.a)(e),f=Object(b.a)(e),k=Object(p.a)(e);if(!m.id)return Object(n.createElement)("div",{className:l()(t,"wc-block-components-product-image",{[i+"__product-image"]:i},f.className),style:{...w.style,...f.style,...k.style}},Object(n.createElement)(h,null));const y=!!m.images.length,v=y?m.images[0]:null,S=r?"a":n.Fragment,C=Object(a.sprintf)(
|
15 |
/* translators: %s is referring to the product name */
|
16 |
-
Object(a.__)("Link to %s","woocommerce"),m.name),x={href:m.permalink,...!y&&{"aria-label":C},onClick:()=>{E("product-view-link",{product:m})}};return Object(n.createElement)("div",{className:l()(t,"wc-block-components-product-image",{[i+"__product-image"]:i},f.className),style:{...w.style,...f.style,...k.style}},Object(n.createElement)(S,r&&x,!!o&&Object(n.createElement)(O.default,{align:s,product:m}),Object(n.createElement)(_,{fallbackAlt:m.name,image:v,loaded:!j,showFullSize:"cropped"!==c})))},h=()=>Object(n.createElement)("img",{src:i.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500}),_=e=>{let{image:t,loaded:c,showFullSize:r,fallbackAlt:a}=e;const{thumbnail:s,src:l,srcset:i,sizes:u,alt:d}=t||{},b={alt:d||a,hidden:!c,src:s,...r&&{src:l,srcSet:i,sizes:u}};return Object(n.createElement)(n.Fragment,null,b.src&&Object(n.createElement)("img",o()({"data-testid":"product-image"},b)),!t&&Object(n.createElement)(h,null))};t.b=Object(m.withProductDataContext)(j)},function(e,t){},,,,,,,,,,,,,function(e,t,c){"use strict";var r=c(0),o=c(4),n=c.n(o),a=c(1),s=c(40),l=c(359),i=c(7),u=c(9);const d={PRISTINE:"pristine",IDLE:"idle",DISABLED:"disabled",PROCESSING:"processing",BEFORE_PROCESSING:"before_processing",AFTER_PROCESSING:"after_processing"},b={status:d.PRISTINE,hasError:!1,quantity:0,processingResponse:null,requestParams:{}},p={SET_PRISTINE:"set_pristine",SET_IDLE:"set_idle",SET_DISABLED:"set_disabled",SET_PROCESSING:"set_processing",SET_BEFORE_PROCESSING:"set_before_processing",SET_AFTER_PROCESSING:"set_after_processing",SET_PROCESSING_RESPONSE:"set_processing_response",SET_HAS_ERROR:"set_has_error",SET_NO_ERROR:"set_no_error",SET_QUANTITY:"set_quantity",SET_REQUEST_PARAMS:"set_request_params"},{SET_PRISTINE:m,SET_IDLE:g,SET_DISABLED:O,SET_PROCESSING:j,SET_BEFORE_PROCESSING:h,SET_AFTER_PROCESSING:_,SET_PROCESSING_RESPONSE:E,SET_HAS_ERROR:w,SET_NO_ERROR:f,SET_QUANTITY:k,SET_REQUEST_PARAMS:y}=p,v=()=>({type:g}),S=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=e?w:f;return{type:t}},{SET_PRISTINE:C,SET_IDLE:x,SET_DISABLED:N,SET_PROCESSING:P,SET_BEFORE_PROCESSING:T,SET_AFTER_PROCESSING:I,SET_PROCESSING_RESPONSE:R,SET_HAS_ERROR:A,SET_NO_ERROR:B,SET_QUANTITY:L,SET_REQUEST_PARAMS:D}=p,{PRISTINE:F,IDLE:V,DISABLED:z,PROCESSING:M,BEFORE_PROCESSING:q,AFTER_PROCESSING:H}=d,G=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,{quantity:c,type:r,data:o}=arguments.length>1?arguments[1]:void 0;switch(r){case C:e=b;break;case x:e=t.status!==V?{...t,status:V}:t;break;case N:e=t.status!==z?{...t,status:z}:t;break;case L:e=c!==t.quantity?{...t,quantity:c}:t;break;case D:e={...t,requestParams:{...t.requestParams,...o}};break;case R:e={...t,processingResponse:o};break;case P:e=t.status!==M?{...t,status:M,hasError:!1}:t,e=!1===e.hasError?e:{...e,hasError:!1};break;case T:e=t.status!==q?{...t,status:q,hasError:!1}:t;break;case I:e=t.status!==H?{...t,status:H}:t;break;case A:e=t.hasError?t:{...t,hasError:!0},e=t.status===M||t.status===q?{...e,status:V}:e;break;case B:e=t.hasError?{...t,hasError:!1}:t}return e!==t&&r!==C&&e.status===F&&(e.status=V),e};var Q=c(98),Y=c(268);const U=e=>({onAddToCartAfterProcessingWithSuccess:Object(Y.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(Y.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(Y.a)("add_to_cart_before_processing",e)});var W=c(317),K=c(58);const $=Object(r.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:e=>{},onAddToCartAfterProcessingWithError:e=>{},onAddToCartBeforeProcessing:e=>{}},dispatchActions:{resetForm:()=>{},submitForm:()=>{},setQuantity:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},setRequestParams:e=>{}}}),J=()=>Object(r.useContext)($),X=e=>{var t,c,o,n;let{children:p,product:g,showFormElements:w}=e;const[f,C]=Object(r.useReducer)(G,b),[x,N]=Object(r.useReducer)(Q.b,{}),P=Object(s.a)(x),{createErrorNotice:T}=Object(i.useDispatch)("core/notices"),{setValidationErrors:I}=Object(i.useDispatch)(u.VALIDATION_STORE_KEY),R=Object(r.useMemo)(()=>({onAddToCartAfterProcessingWithSuccess:U(N).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:U(N).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:U(N).onAddToCartBeforeProcessing}),[N]),A=Object(r.useMemo)(()=>({resetForm:()=>{C({type:m})},submitForm:()=>{C({type:h})},setQuantity:e=>{C((e=>({type:k,quantity:e}))(e))},setHasError:e=>{C(S(e))},setRequestParams:e=>{C((e=>({type:y,data:e}))(e))},setAfterProcessing:e=>{C({type:E,data:e}),C({type:_})}}),[]);Object(r.useEffect)(()=>{const e=f.status,t=!g.id||!Object(l.a)(g);e!==d.DISABLED||t?e!==d.DISABLED&&t&&C({type:O}):C(v())},[f.status,g,C]),Object(r.useEffect)(()=>{f.status===d.BEFORE_PROCESSING&&(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const c=Object(i.select)("core/notices").getNotices(),{removeNotice:r}=Object(i.dispatch)("core/notices"),o=c.filter(t=>t.status===e);o.forEach(e=>r(e.id,t))}("error","wc/add-to-cart"),Object(W.a)(P,"add_to_cart_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:c}=e;t&&T(t,{context:"wc/add-to-cart"}),c&&I(c)}),C(v())):C({type:j})}))},[f.status,I,T,C,P,null==g?void 0:g.id]),Object(r.useEffect)(()=>{if(f.status===d.AFTER_PROCESSING){const e={processingResponse:f.processingResponse},t=e=>{let t=!1;return e.forEach(e=>{const{message:c,messageContext:r}=e;(Object(K.b)(e)||Object(K.c)(e))&&c&&(t=!0,T(c,r?{context:r}:void 0))}),t};if(f.hasError)return void Object(W.b)(P,"add_to_cart_after_processing_with_error",e).then(c=>{if(!t(c)){var r;const t=(null===(r=e.processingResponse)||void 0===r?void 0:r.message)||Object(a.__)("Something went wrong. Please contact us for assistance.","woocommerce");T(t,{id:"add-to-cart",context:"woocommerce/single-product/"+((null==g?void 0:g.id)||0)})}C(v())});Object(W.b)(P,"add_to_cart_after_processing_with_success",e).then(e=>{t(e)?C(S(!0)):C(v())})}},[f.status,f.hasError,f.processingResponse,A,T,P,null==g?void 0:g.id]);const B=Object(l.b)(g),L={product:g,productType:g.type||"simple",productIsPurchasable:Object(l.a)(g),productHasOptions:g.has_options||!1,supportsFormElements:B,showFormElements:w&&B,quantity:f.quantity||(null==g||null===(t=g.add_to_cart)||void 0===t?void 0:t.minimum)||1,minQuantity:(null==g||null===(c=g.add_to_cart)||void 0===c?void 0:c.minimum)||1,maxQuantity:(null==g||null===(o=g.add_to_cart)||void 0===o?void 0:o.maximum)||99,multipleOf:(null==g||null===(n=g.add_to_cart)||void 0===n?void 0:n.multiple_of)||1,requestParams:f.requestParams,isIdle:f.status===d.IDLE,isDisabled:f.status===d.DISABLED,isProcessing:f.status===d.PROCESSING,isBeforeProcessing:f.status===d.BEFORE_PROCESSING,isAfterProcessing:f.status===d.AFTER_PROCESSING,hasError:f.hasError,eventRegistration:R,dispatchActions:A};return Object(r.createElement)($.Provider,{value:L},p)};var Z=c(14),ee=c.n(Z),te=c(15),ce=c(266),re=c(41),oe=()=>{const{dispatchActions:e,product:t,quantity:c,eventRegistration:o,hasError:n,isProcessing:s,requestParams:l}=J(),{showAllValidationErrors:d}=Object(i.useDispatch)(u.VALIDATION_STORE_KEY),b=Object(i.useSelect)(e=>e(u.VALIDATION_STORE_KEY).hasValidationErrors),{createErrorNotice:p,removeNotice:m}=Object(i.useDispatch)("core/notices"),{receiveCart:g}=Object(re.a)(),[O,j]=Object(r.useState)(!1),h=!n&&s,_=Object(r.useCallback)(()=>!b()||(d(),{type:"error"}),[b,d]);Object(r.useEffect)(()=>{const e=o.onAddToCartBeforeProcessing(_,0);return()=>{e()}},[o,_]);const E=Object(r.useCallback)(()=>{j(!0),m("add-to-cart","woocommerce/single-product/"+((null==t?void 0:t.id)||0));const r={id:t.id||0,quantity:c,...l};ee()({path:"/wc/store/v1/cart/add-item",method:"POST",data:r,cache:"no-store",parse:!1}).then(c=>{ee.a.setNonce(c.headers),c.json().then((function(r){c.ok?g(r):(r.body&&r.body.message?p(Object(te.decodeEntities)(r.body.message),{id:"add-to-cart",context:"woocommerce/single-product/"+((null==t?void 0:t.id)||0)}):p(Object(a.__)("Something went wrong. Please contact us for assistance.","woocommerce"),{id:"add-to-cart",context:"woocommerce/single-product/"+((null==t?void 0:t.id)||0)}),e.setHasError()),Object(ce.b)({preserveCartData:!0}),e.setAfterProcessing(r),j(!1)}))}).catch(t=>{t.json().then((function(t){var c;null!==(c=t.data)&&void 0!==c&&c.cart&&g(t.data.cart),e.setHasError(),e.setAfterProcessing(t),j(!1)}))})},[t,p,m,g,e,c,l]);return Object(r.useEffect)(()=>{h&&!O&&E()},[h,E,O]),null};const ne=e=>{let{children:t,product:c,showFormElements:o}=e;return Object(r.createElement)(X,{product:c,showFormElements:o},t,Object(r.createElement)(oe,null))};var ae=c(23),se=c(8),le=c(42),ie=(c(236),c(59)),ue=c(
|
17 |
/* translators: %s number of products in cart. */
|
18 |
-
Object(a._n)("%d in cart","%d in cart",c,"woocommerce"),c):Object(a.__)("Add to cart","woocommerce"),!!s&&Object(r.createElement)(ue.a,{icon:de.a}))};var Oe=()=>{const{showFormElements:e,productIsPurchasable:t,productHasOptions:c,product:o,productType:n,isDisabled:s,isProcessing:l,eventRegistration:i,hasError:u,dispatchActions:d}=J(),{parentName:b}=Object(ae.useInnerBlockLayoutContext)(),{dispatchStoreEvent:p}=Object(be.a)(),{cartQuantity:m}=Object(pe.a)(o.id||0),[g,O]=Object(r.useState)(!1),j=o.add_to_cart||{url:"",text:""};return Object(r.useEffect)(()=>{const e=i.onAddToCartAfterProcessingWithSuccess(()=>(u||O(!0),!0),0);return()=>{e()}},[i,u]),(e||!c&&"simple"===n)&&t?Object(r.createElement)(ge,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:m,isDisabled:s,isProcessing:l,isDone:g,onClick:()=>{d.submitForm("woocommerce/single-product/"+((null==o?void 0:o.id)||0)),p("cart-add-item",{product:o,listName:b})}}):Object(r.createElement)(me,{className:"wc-block-components-product-add-to-cart-button",href:j.url,text:j.text||Object(a.__)("View Product","woocommerce"),onClick:()=>{p("product-view-link",{product:o,listName:b})}})},je=c(
|
19 |
/* translators: %f is referring to the average rating value */
|
20 |
Object(o.__)("Rated %f out of 5","woocommerce"),n),h=m(c),_={__html:Object(o.sprintf)(
|
21 |
/* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
|
22 |
-
Object(o._n)("Rated %1$s out of 5 based on %2$s customer rating","Rated %1$s out of 5 based on %2$s customer ratings",h,"woocommerce"),Object(o.sprintf)('<strong class="rating">%f</strong>',n),Object(o.sprintf)('<span class="rating">%d</span>',h))};return Object(r.createElement)("div",{className:a()(d.className,"wc-block-components-product-rating",{[t+"__product-rating"]:t}),style:{...d.style,...b.style,...g.style}},Object(r.createElement)("div",{className:a()("wc-block-components-product-rating__stars",t+"__product-rating__stars"),role:"img","aria-label":j},Object(r.createElement)("span",{style:O,dangerouslySetInnerHTML:_})))},p=e=>{const t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0},m=e=>{const t=parseInt(e.review_count,10);return Number.isFinite(t)&&t>0?t:0};t.default=Object(d.withProductDataContext)(b)},function(e,t,c){"use strict";c.r(t),c.d(t,"Block",(function(){return E}));var r=c(6),o=c.n(r),n=c(0),a=c(4),s=c.n(a),l=c(1),i=c(70),u=c(168),d=c(99),b=c(154),p=c(
|
23 |
/* translators: %s number of products in cart. */
|
24 |
-
Object(l._n)("%d in cart","%d in cart",f,"woocommerce"),f):Object(g.decodeEntities)((null==m?void 0:m.text)||Object(l.__)("Add to cart","woocommerce")),N=S?"button":"a",P={};return S?P.onClick=async()=>{await y(),w("cart-add-item",{product:t});const{cartRedirectAfterAdd:e}=Object(j.getSetting)("productsSettings");e&&(window.location.href=O.d)}:(P.href=p,P.rel="nofollow",P.onClick=()=>{w("product-view-link",{product:t})}),Object(n.createElement)(N,o()({"aria-label":C,className:s()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",c.className,r.className,{loading:k,added:v}),style:{...c.style,...r.style,...a.style,...d.style},disabled:k},P),x)},f=e=>{let{colorStyles:t,borderStyles:c,typographyStyles:r,spacingStyles:o}=e;return Object(n.createElement)("button",{className:s()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder",t.className,c.className),style:{...t.style,...c.style,...r.style,...o.style},disabled:!0})};t.default=Object(_.withProductDataContext)(E)},,,,,,,,,,function(e){e.exports=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":1,"textdomain":"woocommerce","name":"woocommerce/all-products","title":"All Products","category":"woocommerce","keywords":["WooCommerce"],"description":"Display products from your store in a grid layout.","supports":{"align":["wide","full"],"html":false,"multiple":false},"example":{"attributes":{"isPreview":true}},"attributes":{"columns":{"type":"number"},"rows":{"type":"number"},"alignButtons":{"type":"boolean"},"contentVisibility":{"type":"object"},"orderby":{"type":"string"},"layoutConfig":{"type":"array"},"isPreview":{"type":"boolean","default":false}}}')},,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(180);const o=["a","b","em","i","strong","p","br"],n=["target","href","rel","name","download"],a=(e,t)=>{const c=(null==t?void 0:t.tags)||o,a=(null==t?void 0:t.attr)||n;return Object(r.sanitize)(e,{ALLOWED_TAGS:c,ALLOWED_ATTR:a})}},,,function(e,t){},,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var r=c(108),o=c(9),n=c(7),a=c(40);const s=e=>{const t={namespace:"/wc/store/v1",resourceName:"products"},{results:c,isLoading:s}=Object(r.a)({...t,query:e}),{value:l}=((e,t)=>{const{namespace:c,resourceName:r,resourceValues:s=[],query:l={}}=t;if(!c||!r)throw new Error("The options object must have valid values for the namespace and the resource name properties.");const i=Object(a.a)(l),u=Object(a.a)(s),{value:d,isLoading:b=!0}=Object(n.useSelect)(e=>{const t=e(o.COLLECTIONS_STORE_KEY),n=["x-wp-total",c,r,i,u];return{value:t.getCollectionHeader(...n),isLoading:t.hasFinishedResolution("getCollectionHeader",n)}},["x-wp-total",c,r,u,i]);return{value:d,isLoading:b}})(0,{...t,query:e});return{products:c,totalProducts:parseInt(l,10),productsLoading:s}}},,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return p}));var r=c(6),o=c.n(r),n=c(0),a=c(4),s=c.n(a),l=c(314),i=c(233),u=c(7),d=c(9);c(196);const b=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""},p=e=>{let{className:t,context:c="default",additionalNotices:r=[]}=e;const a=Object(u.useSelect)(e=>e(d.PAYMENT_STORE_KEY).isExpressPaymentMethodActive()),{notices:p}=Object(u.useSelect)(e=>({notices:e("core/notices").getNotices(c)})),{removeNotice:m}=Object(u.useDispatch)("core/notices"),g=p.filter(e=>"snackbar"!==e.type).concat(r);if(!g.length)return null;const O=s()(t,"wc-block-components-notices");return a?null:Object(n.createElement)("div",{className:O},g.map(e=>Object(n.createElement)(l.a,o()({key:"store-notice-"+e.id},e,{className:s()("wc-block-components-notices__notice",b(e)),onRemove:()=>{e.isDismissible&&m(e.id,c)}}),Object(i.a)(e.content))))}},,,,,,,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,c){"use strict";c.d(t,"c",(function(){return a})),c.d(t,"b",(function(){return s})),c.d(t,"a",(function(){return l}));const r=window.CustomEvent||null,o=(e,t)=>{let{bubbles:c=!1,cancelable:o=!1,element:n,detail:a={}}=t;if(!r)return;n||(n=document.body);const s=new r(e,{bubbles:c,cancelable:o,detail:a});n.dispatchEvent(s)};let n;const a=()=>{n&&clearTimeout(n),n=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},s=e=>{let{preserveCartData:t=!1}=e;o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},l=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const n=()=>{o(t,{bubbles:c,cancelable:r})};return jQuery(document).on(e,n),()=>jQuery(document).off(e,n)}},function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(95),o=(c(16),c(2));const n=e=>{const t=Object.keys(o.defaultAddressFields),c=Object(r.a)(t,{},e.country),n=Object.assign({},e);return c.forEach(t=>{let{key:c="",hidden:r=!1}=t;r&&((e,t)=>e in t)(c,e)&&(n[c]="")}),n}},function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(98);const o=(e,t)=>function(c){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const n=r.a.addEventCallback(e,c,o);return t(n),()=>{t(r.a.removeEventCallback(e,n.id))}}},,,,,,,,,,function(e,t,c){"use strict";var r=c(0),o=c(13);const n=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.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=n},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";var r=c(61);let o={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},linkTarget:{type:"string"},productId:{type:"number",default:0}};Object(r.b)()&&(o={...o,align:{type:"string"}}),t.a=o},function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r={showProductLink:{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},isDescendentOfQueryLoop:{type:"boolean",default:!1}}},function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return n}));var r=c(58);const o=async(e,t,c)=>{const o=Object(r.a)(e,t),n=[];for(const e of o)try{const t=await Promise.resolve(e.callback(c));"object"==typeof t&&n.push(t)}catch(e){console.error(e)}return!n.length||n},n=async(e,t,c)=>{const o=[],n=Object(r.a)(e,t);for(const e of n)try{const t=await Promise.resolve(e.callback(c));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(r.b)(t)||Object(r.c)(t))return o.push(t),o;o.push(t)}catch(e){return console.error(e),o.push({type:"error"}),o}return o}},function(e,t,c){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},,,,,,,,,function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(4),n=c.n(o),a=c(121),s=c(22),l=c(23),i=c(99),u=c(82),d=c(42);c(354),t.default=Object(d.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(l.useInnerBlockLayoutContext)(),{product:o}=Object(l.useProductDataContext)(),d=Object(i.a)(e),b=Object(u.a)(e);if(!o)return Object(r.createElement)("div",{className:n()(t,"wc-block-components-product-summary",{[c+"__product-summary"]:c})});const p=o.short_description?o.short_description:o.description;return p?Object(r.createElement)(a.a,{className:n()(t,d.className,"wc-block-components-product-summary",{[c+"__product-summary"]:c}),source:p,maxLength:150,countType:s.o.wordCountType||"words",style:{...d.style,...b.style}}):null})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(23),l=c(42);c(355),t.default=Object(l.withProductDataContext)(e=>{let{className:t}=e;const{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),l=n.sku;return l?Object(r.createElement)("div",{className:a()(t,"wc-block-components-product-sku",{[c+"__product-sku"]:c})},Object(o.__)("SKU:","woocommerce")," ",Object(r.createElement)("strong",null,l)):null})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(23),l=c(99),i=c(82),u=c(8),d=c(42);c(356),t.default=Object(d.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),d=Object(l.a)(e),b=Object(i.a)(e);return Object(u.isEmpty)(n.categories)?null:Object(r.createElement)("div",{className:a()(t,"wc-block-components-product-category-list",d.className,{[c+"__product-category-list"]:c}),style:{...d.style,...b.style}},Object(o.__)("Categories:","woocommerce")," ",Object(r.createElement)("ul",null,Object.values(n.categories).map(e=>{let{name:t,link:c,slug:o}=e;return Object(r.createElement)("li",{key:"category-list-item-"+o},Object(r.createElement)("a",{href:c},t))})))})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(23),l=c(99),i=c(82),u=c(8),d=c(42);c(357),t.default=Object(d.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),d=Object(l.a)(e),b=Object(i.a)(e);return Object(u.isEmpty)(n.tags)?null:Object(r.createElement)("div",{className:a()(t,d.className,"wc-block-components-product-tag-list",{[c+"__product-tag-list"]:c}),style:{...d.style,...b.style}},Object(o.__)("Tags:","woocommerce")," ",Object(r.createElement)("ul",null,Object.values(n.tags).map(e=>{let{name:t,link:c,slug:o}=e;return Object(r.createElement)("li",{key:"tag-list-item-"+o},Object(r.createElement)("a",{href:c},t))})))})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(23),l=c(99),i=c(82),u=c(42);c(358);t.default=Object(u.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),u=Object(l.a)(e),d=Object(i.a)(e);if(!n.id||!n.is_purchasable)return null;const b=!!n.is_in_stock,p=n.low_stock_remaining,m=n.is_on_backorder;return Object(r.createElement)("div",{className:a()(t,u.className,"wc-block-components-product-stock-indicator",{[c+"__stock-indicator"]:c,"wc-block-components-product-stock-indicator--in-stock":b,"wc-block-components-product-stock-indicator--out-of-stock":!b,"wc-block-components-product-stock-indicator--low-stock":!!p,"wc-block-components-product-stock-indicator--available-on-backorder":!!m}),style:{...u.style,...d.style}},p?(e=>Object(o.sprintf)(
|
25 |
/* translators: %d stock amount (number of items in stock for product) */
|
26 |
-
Object(o.__)("%d left in stock","woocommerce"),e))(p):((e,t)=>t?Object(o.__)("Available on backorder","woocommerce"):e?Object(o.__)("In Stock","woocommerce"):Object(o.__)("Out of Stock","woocommerce"))(b,m))})},,,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return o}));const r=e=>e.is_purchasable||!1,o=e=>["simple","variable"].includes(e.type||"simple")},,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(1),o=c(22);const n=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:Object(r.__)("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!","woocommerce"),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:o.m+"previews/pennant.jpg",thumbnail:o.m+"previews/pennant.jpg",name:"pennant-1.jpg",alt:"WordPress Pennant",srcset:"",sizes:""}],average_rating:5,categories:[{id:1,name:"Decor",slug:"decor",link:"https://example.org"}],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(r.__)("Add to cart","woocommerce"),description:Object(r.__)("Add to cart","woocommerce")},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},,,,,,,,,,function(e,t,c){e.exports=c(479)},function(e,t){},function(e,t){},function(e,t){},,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.r(t),c.d(t,"metadata",(function(){return ot})),c.d(t,"name",(function(){return Yt}));var r=c(0),o=c(10),n=c(
|
27 |
/* translators: %s: heading level e.g: "2", "3", "4" */
|
28 |
-
Object(l.__)("Heading %d","woocommerce"),e),isActive:o,onClick:()=>c(e)}}render(){const{isCollapsed:e=!0,minLevel:t,maxLevel:c,selectedLevel:o,onChange:n}=this.props;return Object(r.createElement)(p.ToolbarGroup,{isCollapsed:e,icon:Object(r.createElement)(h,{level:o}),controls:Object(O.range)(t,c).map(e=>this.createLevelControl(e,o,n))})}}var E=_,w=c(194),f=c(97),k=c(151),y=c(23);c(393);var v=e=>t=>c=>{const o=Object(y.useProductDataContext)(),{attributes:n,setAttributes:a}=c,{productId:s}=n,[i,u]=Object(r.useState)(!s);return o.hasContext?Object(r.createElement)(t,c):Object(r.createElement)(r.Fragment,null,i?Object(r.createElement)(p.Placeholder,{icon:e.icon||"",label:e.label||"",className:"wc-atomic-blocks-product"},!!e.description&&Object(r.createElement)("div",null,e.description),Object(r.createElement)("div",{className:"wc-atomic-blocks-product__selection"},Object(r.createElement)(f.a,{selected:s||0,showVariations:!0,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];a({productId:e[0]?e[0].id:0})}}),Object(r.createElement)(p.Button,{isSecondary:!0,disabled:!s,onClick:()=>{u(!1)}},Object(l.__)("Done","woocommerce")))):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(g.BlockControls,null,Object(r.createElement)(p.ToolbarGroup,null,Object(r.createElement)(k.a,{onClick:()=>u(!0)},Object(l.__)("Switch product…","woocommerce")))),Object(r.createElement)(t,c)))},S=c(539);const C=Object(l.__)("Product Title","woocommerce"),x=Object(r.createElement)(n.a,{icon:S.a,className:"wc-block-editor-components-block-icon"}),N=Object(l.__)("Display the title of a product.","woocommerce");c(394);const P=e=>{let{attributes:t,setAttributes:c}=e;const o=Object(g.useBlockProps)(),{headingLevel:n,showProductLink:a,align:i,linkTarget:u}=t;return Object(r.createElement)("div",o,Object(r.createElement)(g.BlockControls,null,Object(r.createElement)(E,{isCollapsed:!0,minLevel:1,maxLevel:7,selectedLevel:n,onChange:e=>c({headingLevel:e})}),Object(s.b)()&&Object(r.createElement)(g.AlignmentToolbar,{value:i,onChange:e=>{c({align:e})}})),Object(r.createElement)(g.InspectorControls,null,Object(r.createElement)(p.PanelBody,{title:Object(l.__)("Link settings","woocommerce")},Object(r.createElement)(p.ToggleControl,{label:Object(l.__)("Make title a link","woocommerce"),checked:a,onChange:()=>c({showProductLink:!a})}),a&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(p.ToggleControl,{label:Object(l.__)("Open in new tab","woocommerce"),onChange:e=>c({linkTarget:e?"_blank":"_self"}),checked:"_blank"===u})))),Object(r.createElement)(p.Disabled,null,Object(r.createElement)(w.b,t)))};var T=Object(s.b)()?Object(m.compose)([v({icon:x,label:C,description:Object(l.__)("Choose a product to display its title.","woocommerce")})])(P):P,I=c(127);const R={...d,apiVersion:2,title:C,description:N,icon:{src:x},attributes:b.a,edit:T,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))},supports:{...d.supports,...Object(s.b)()&&{typography:{fontSize:!0,lineHeight:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0},color:{text:!0,background:!0,link:!1,gradients:!0,__experimentalSkipSerialization:!0},...Object(I.a)()&&{spacing:{margin:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-title"}}};Object(o.registerBlockType)("woocommerce/product-title",R);var A=c(12),B=c(210),L=c(540);const D=Object(l.__)("Product Price","woocommerce"),F=Object(r.createElement)(n.a,{icon:L.a,className:"wc-block-editor-components-block-icon"}),V=Object(l.__)("Display the price of a product.","woocommerce");var z=v({icon:F,label:D,description:Object(l.__)("Choose a product to display its price.","woocommerce")})(e=>{let{attributes:t,setAttributes:c,context:o}=e;const n=Object(g.useBlockProps)(),a={...t,...o},l=Number.isFinite(o.queryId);return Object(A.useEffect)(()=>c({isDescendentOfQueryLoop:l}),[c,l]),Object(r.createElement)(r.Fragment,null,Object(r.createElement)(g.BlockControls,null,Object(s.b)()&&Object(r.createElement)(g.AlignmentToolbar,{value:t.textAlign,onChange:e=>{c({textAlign:e})}})),Object(r.createElement)("div",n,Object(r.createElement)(B.default,a)))});let M={productId:{type:"number",default:0},isDescendentOfQueryLoop:{type:"boolean",default:!1}};Object(s.b)()&&(M={...M,textAlign:{type:"string"}});var q=M;const H={...d,apiVersion:2,title:D,description:V,parent:["core/group"],ancestor:["@woocommerce/all-products","@woocommerce/single-product","core/post-template"],usesContext:["query","queryId","postId"],icon:{src:F},attributes:q,edit:z,supports:{...d.supports,...Object(s.b)()&&{color:{text:!0,background:!1,link:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wc-block-components-product-price"}}};Object(o.registerBlockType)("woocommerce/product-price",H);var G=c(541),Q=c(6),Y=c.n(Q),U=c(2),W=c(126),K=c(195);const $={html:!1,...Object(s.b)()&&{__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},...Object(I.a)()&&{spacing:{margin:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-image"}};var J=c(316);const X={apiVersion:2,name:"woocommerce/product-image",title:Object(l.__)("Product Image","woocommerce"),icon:{src:Object(r.createElement)(n.a,{icon:G.a,className:"wc-block-editor-components-block-icon"})},keywords:["WooCommerce"],description:Object(l.__)("Display the main product image.","woocommerce"),usesContext:["query","queryId","postId"],parent:["@woocommerce/all-products","@woocommerce/single-product","core/post-template"],textdomain:"woocommerce",attributes:J.a,supports:$,edit:e=>{let{attributes:t,setAttributes:c,context:o}=e;const{showProductLink:n,imageSizing:a,showSaleBadge:s,saleBadgeAlign:i}=t,u=Object(g.useBlockProps)(),d=Number.isFinite(o.queryId);Object(r.useEffect)(()=>c({isDescendentOfQueryLoop:d}),[c,d]);const b=Object(U.getSettingWithCoercion)("is_block_theme_enabled",!1,W.a);return Object(r.useEffect)(()=>{b&&"full-size"!==t.imageSizing&&c({imageSizing:"full-size"})},[t.imageSizing,b,c]),Object(r.createElement)("div",u,Object(r.createElement)(g.InspectorControls,null,Object(r.createElement)(p.PanelBody,{title:Object(l.__)("Content","woocommerce")},Object(r.createElement)(p.ToggleControl,{label:Object(l.__)("Link to Product Page","woocommerce"),help:Object(l.__)("Links the image to the single product listing.","woocommerce"),checked:n,onChange:()=>c({showProductLink:!n})}),Object(r.createElement)(p.ToggleControl,{label:Object(l.__)("Show On-Sale Badge","woocommerce"),help:Object(l.__)("Display a “sale” badge if the product is on-sale.","woocommerce"),checked:s,onChange:()=>c({showSaleBadge:!s})}),s&&Object(r.createElement)(p.__experimentalToggleGroupControl,{label:Object(l.__)("Sale Badge Alignment","woocommerce"),value:i,onChange:e=>c({saleBadgeAlign:e})},Object(r.createElement)(p.__experimentalToggleGroupControlOption,{value:"left",label:Object(l.__)("Left","woocommerce")}),Object(r.createElement)(p.__experimentalToggleGroupControlOption,{value:"center",label:Object(l.__)("Center","woocommerce")}),Object(r.createElement)(p.__experimentalToggleGroupControlOption,{value:"right",label:Object(l.__)("Right","woocommerce")})),!b&&Object(r.createElement)(p.__experimentalToggleGroupControl,{label:Object(l.__)("Image Sizing","woocommerce"),help:Object(r.createInterpolateElement)(Object(l.__)("Product image cropping can be modified in the <a>Customizer</a>.","woocommerce"),{a:Object(r.createElement)("a",{href:Object(U.getAdminLink)("customize.php")+"?autofocus[panel]=woocommerce&autofocus[section]=woocommerce_product_images",target:"_blank",rel:"noopener noreferrer"})}),value:a,onChange:e=>c({imageSizing:e})},Object(r.createElement)(p.__experimentalToggleGroupControlOption,{value:"full-size",label:Object(l.__)("Full Size","woocommerce")}),Object(r.createElement)(p.__experimentalToggleGroupControlOption,{value:"cropped",label:Object(l.__)("Cropped","woocommerce")})))),Object(r.createElement)(p.Disabled,null,Object(r.createElement)(K.b,Y()({},t,o))))}};Object(o.registerBlockType)("woocommerce/product-image",{...d,...X});var Z=c(211),ee=c(534);const te=Object(l.__)("Product Rating","woocommerce"),ce=Object(r.createElement)(n.a,{icon:ee.a,className:"wc-block-editor-components-block-icon"}),re=Object(l.__)("Display the average rating of a product.","woocommerce");var oe=v({icon:ce,label:te,description:Object(l.__)("Choose a product to display its rating.","woocommerce")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)({className:"wp-block-woocommerce-product-rating"});return Object(r.createElement)("div",c,Object(r.createElement)(Z.default,t))});const ne={apiVersion:2,title:te,description:re,icon:{src:ce},attributes:{productId:{type:"number",default:0}},supports:{...Object(s.b)()&&{color:{text:!0,background:!1,link:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},...Object(I.a)()&&{spacing:{margin:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-rating"}},edit:oe,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))}};Object(o.registerBlockType)("woocommerce/product-rating",{...d,...ne});var ae=c(212),se=c(542);const le=Object(l.__)("Add to Cart Button","woocommerce"),ie=Object(r.createElement)(n.a,{icon:se.a,className:"wc-block-editor-components-block-icon"}),ue={apiVersion:2,title:le,description:Object(l.__)("Display a call to action button which either adds the product to the cart, or links to the product page.","woocommerce"),parent:["core/group"],ancestor:["@woocommerce/all-products","@woocommerce/single-product","core/post-template"],usesContext:["query","queryId","postId"],icon:{src:ie},attributes:{productId:{type:"number",default:0},isDescendentOfQueryLoop:{type:"boolean",default:!1}},supports:{...Object(s.b)()&&{color:{text:!0,background:!0,link:!1,__experimentalSkipSerialization:!0},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},...Object(I.a)()&&{spacing:{padding:!0,__experimentalSkipSerialization:!0}},typography:{fontSize:!0,__experimentalFontWeight:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button"}},edit:e=>{let{attributes:t,setAttributes:c,context:o}=e;const n=Object(g.useBlockProps)(),a=Number.isFinite(o.queryId);return Object(r.useEffect)(()=>c({isDescendentOfQueryLoop:a}),[c,a]),Object(r.createElement)("div",n,Object(r.createElement)(p.Disabled,null,Object(r.createElement)(ae.default,Y()({},t,o))))}};Object(o.registerBlockType)("woocommerce/product-button",{...d,...ue});var de=c(327),be=c(543);const pe=Object(l.__)("Product Summary","woocommerce"),me=Object(r.createElement)(n.a,{icon:be.a,className:"wc-block-editor-components-block-icon"}),ge=Object(l.__)("Display a short description about a product.","woocommerce");c(395);var Oe=v({icon:me,label:pe,description:Object(l.__)("Choose a product to display its short description.","woocommerce")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)();return Object(r.createElement)("div",c,Object(r.createElement)(de.default,t))});const je={apiVersion:2,title:pe,description:ge,icon:{src:me},attributes:{productId:{type:"number",default:0}},supports:{...Object(s.b)()&&{color:{text:!0,background:!1,link:!1},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-summary"}},edit:Oe,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))}};Object(o.registerBlockType)("woocommerce/product-summary",{...d,...je});var he=c(141),_e=c(532);const Ee=Object(l.__)("On-Sale Badge","woocommerce"),we=Object(r.createElement)(n.a,{icon:_e.a,className:"wc-block-editor-components-block-icon"}),fe=Object(l.__)("Displays an on-sale badge if the product is on-sale.","woocommerce");var ke=v({icon:we,label:Ee,description:Object(l.__)("Choose a product to display its sale-badge.","woocommerce")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)();return Object(r.createElement)("div",c,Object(r.createElement)(he.default,t))});const ye={title:Ee,description:fe,icon:{src:we},apiVersion:2,supports:{html:!1,...Object(s.b)()&&{color:{gradients:!0,background:!0,link:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0},...Object(I.a)()&&{spacing:{padding:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-sale-badge"}},attributes:{productId:{type:"number",default:0}},edit:ke,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))}};Object(o.registerBlockType)("woocommerce/product-sale-badge",{...d,...ye});var ve=c(109),Se=c(328),Ce=Object(r.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("path",{d:"M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z"}));const xe=Object(l.__)("Product SKU","woocommerce"),Ne=Object(r.createElement)(n.a,{icon:Ce,className:"wc-block-editor-components-block-icon"}),Pe={title:xe,description:Object(l.__)("Display the SKU of a product.","woocommerce"),icon:{src:Ne},attributes:{productId:{type:"number",default:0}},edit:v({icon:Ne,label:xe,description:Object(l.__)("Choose a product to display its SKU.","woocommerce")})(e=>{let{attributes:t}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(ve.a,null),Object(r.createElement)(Se.default,t))})};Object(s.c)("woocommerce/product-sku",{...d,...Pe});var Te=c(329),Ie=c(544);const Re=Object(l.__)("Product Category List","woocommerce"),Ae=Object(r.createElement)(n.a,{icon:Ie.a,className:"wc-block-editor-components-block-icon"}),Be=Object(l.__)("Display the list of categories that are assigned to a product.","woocommerce");var Le=v({icon:Ae,label:Re,description:Object(l.__)("Choose a product to display its categories.","woocommerce")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)();return Object(r.createElement)("div",c,Object(r.createElement)(ve.a,null),Object(r.createElement)(p.Disabled,null,Object(r.createElement)(Te.default,t)))});const De={...d,apiVersion:2,title:Re,description:Be,icon:{src:Ae},attributes:{productId:{type:"number",default:0}},supports:{...Object(s.b)()&&{color:{text:!0,link:!0,background:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wc-block-components-product-category-list"}},save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))},edit:Le};Object(s.c)("woocommerce/product-category-list",De);var Fe=c(330),Ve=c(537);const ze=Object(l.__)("Product Tag List","woocommerce"),Me=Object(r.createElement)(n.a,{icon:Ve.a,className:"wc-block-editor-components-block-icon"}),qe=Object(l.__)("Display the list of tags that are assigned to a product.","woocommerce");var He=v({icon:Me,label:ze,description:Object(l.__)("Choose a product to display its tags.","woocommerce")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)();return Object(r.createElement)("div",c,Object(r.createElement)(ve.a,null),Object(r.createElement)(p.Disabled,null,Object(r.createElement)(Fe.default,t)))});const Ge={apiVersion:2,title:ze,description:qe,icon:{src:Me},attributes:{productId:{type:"number",default:0}},supports:{...Object(s.b)()&&{color:{text:!0,background:!1,link:!0},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-tag-list"}},edit:He,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))}};Object(s.c)("woocommerce/product-tag-list",{...d,...Ge});var Qe=c(331),Ye=c(545);const Ue=Object(l.__)("Product Stock Indicator","woocommerce"),We=Object(r.createElement)(n.a,{icon:Ye.a,className:"wc-block-editor-components-block-icon"}),Ke=Object(l.__)("Display product stock status.","woocommerce");var $e=v({icon:We,label:Ue,description:Object(l.__)("Choose a product to display its stock.","woocommerce")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)();return Object(r.createElement)("div",c,Object(r.createElement)(ve.a,null),Object(r.createElement)(Qe.default,t))});const Je={apiVersion:2,title:Ue,description:Ke,icon:{src:We},attributes:{productId:{type:"number",default:0}},supports:{...Object(s.b)()&&{color:{text:!0,background:!1,link:!1},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-stock-indicator"}},edit:$e,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))}};Object(s.c)("woocommerce/product-stock-indicator",{...d,...Je});var Xe=c(359),Ze=(c(236),c(209)),et=c(278);const tt=Object(l.__)("Add to Cart","woocommerce"),ct=Object(r.createElement)(n.a,{icon:et.a,className:"wc-block-editor-components-block-icon"}),rt={title:tt,description:Object(l.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woocommerce"),icon:{src:ct},edit:v({icon:ct,label:tt,description:Object(l.__)("Choose a product to display its add to cart form.","woocommerce")})(e=>{let{attributes:t,setAttributes:c}=e;const{product:o}=Object(y.useProductDataContext)(),{className:n,showFormElements:a}=t;return Object(r.createElement)("div",{className:u()(n,"wc-block-components-product-add-to-cart")},Object(r.createElement)(ve.a,{productId:o.id}),Object(r.createElement)(g.InspectorControls,null,Object(r.createElement)(p.PanelBody,{title:Object(l.__)("Layout","woocommerce")},Object(Xe.b)(o)?Object(r.createElement)(p.ToggleControl,{label:Object(l.__)("Display form elements","woocommerce"),help:Object(l.__)("Depending on product type, allow customers to select a quantity, variations etc.","woocommerce"),checked:a,onChange:()=>c({showFormElements:!a})}):Object(r.createElement)(p.Notice,{className:"wc-block-components-product-add-to-cart-notice",isDismissible:!1,status:"info"},Object(l.__)("This product does not support the block based add to cart form. A link to the product page will be shown instead.","woocommerce")))),Object(r.createElement)(p.Disabled,null,Object(r.createElement)(Ze.a,t)))}),attributes:c(318).a};Object(s.c)("woocommerce/product-add-to-cart",{...d,...rt});var ot=c(222);const nt=(e,t)=>{const{className:c,contentVisibility:r}=t;return u()(e,c,{"has-image":r&&r.image,"has-title":r&&r.title,"has-rating":r&&r.rating,"has-price":r&&r.price,"has-button":r&&r.button})},{attributes:at}=ot;var st=[{attributes:Object.assign({},at,{rows:{type:"number",default:1}}),save(e){let{attributes:t}=e;const c={"data-attributes":JSON.stringify(t)};return Object(r.createElement)("div",Y()({className:nt("wc-block-all-products",t)},c),Object(r.createElement)(g.InnerBlocks.Content,null))}}],lt=c(24),it=c.n(lt),ut=c(7),dt=c(64),bt=c(509),pt=c(382),mt=c(22),gt=c(258);const Ot=[["woocommerce/product-image",{imageSizing:"cropped"}],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],jt=e=>e&&0!==e.length?e.map(e=>[e.name,{...e.attributes,product:void 0,children:e.innerBlocks.length>0?jt(e.innerBlocks):[]}]):[];var ht=c(29);c(401);var _t=e=>{let{currentPage:t,displayFirstAndLastPages:c=!0,displayNextAndPreviousArrows:o=!0,pagesToDisplay:n=3,onPageChange:a,totalPages:s}=e,{minIndex:i,maxIndex:d}=((e,t,c)=>{if(c<=2)return{minIndex:null,maxIndex:null};const r=e-1,o=Math.max(Math.floor(t-r/2),2),n=Math.min(Math.ceil(t+(r-(t-o))),c-1);return{minIndex:Math.max(Math.floor(t-(r-(n-t))),2),maxIndex:n}})(n,t,s);const b=c&&Boolean(1!==i),p=c&&Boolean(d!==s),m=c&&Boolean(i&&i>3),g=c&&Boolean(d&&d<s-2);b&&3===i&&(i-=1),p&&d===s-2&&(d+=1);const O=[];if(i&&d)for(let e=i;e<=d;e++)O.push(e);return Object(r.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(r.createElement)(ht.a,{screenReaderLabel:Object(l.__)("Navigate to another page","woocommerce")}),o&&Object(r.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>a(t-1),title:Object(l.__)("Previous page","woocommerce"),disabled:t<=1},Object(r.createElement)(ht.a,{label:"←",screenReaderLabel:Object(l.__)("Previous page","woocommerce")})),b&&Object(r.createElement)("button",{className:u()("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:()=>a(1),disabled:1===t},Object(r.createElement)(ht.a,{label:"1",screenReaderLabel:Object(l.sprintf)(
|
29 |
/* translators: %d is the page number (1, 2, 3...). */
|
30 |
Object(l.__)("Page %d","woocommerce"),1)})),m&&Object(r.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(l.__)("…","woocommerce")),O.map(e=>Object(r.createElement)("button",{key:e,className:u()("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?void 0:()=>a(e),disabled:t===e},Object(r.createElement)(ht.a,{label:e.toString(),screenReaderLabel:Object(l.sprintf)(
|
31 |
/* translators: %d is the page number (1, 2, 3...). */
|
32 |
Object(l.__)("Page %d","woocommerce"),e)}))),g&&Object(r.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(l.__)("…","woocommerce")),p&&Object(r.createElement)("button",{className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===s,"wc-block-components-pagination__page--active":t===s}),onClick:()=>a(s),disabled:t===s},Object(r.createElement)(ht.a,{label:s.toString(),screenReaderLabel:Object(l.sprintf)(
|
33 |
/* translators: %d is the page number (1, 2, 3...). */
|
34 |
-
Object(l.__)("Page %d","woocommerce"),s)})),o&&Object(r.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>a(t+1),title:Object(l.__)("Next page","woocommerce"),disabled:t>=s},Object(r.createElement)(ht.a,{label:"→",screenReaderLabel:Object(l.__)("Next page","woocommerce")})))},Et=c(104),wt=c(
|
35 |
/* translators: %s is an integer higher than 0 (1, 2, 3...) */
|
36 |
Object(l._n)("%d product found","%d products found",e,"woocommerce"),e)))})(k))},[null==P?void 0:P.totalQuery,k,o,x]);const{contentVisibility:T}=t,I=t.columns*t.rows,R=!Number.isFinite(k)&&Number.isFinite(null==P?void 0:P.totalProducts)&&Object(O.isEqual)(x,null==P?void 0:P.totalQuery)?Math.ceil(((null==P?void 0:P.totalProducts)||0)/I):Math.ceil(k/I),A=f.length?f:Array.from({length:I}),B=0!==f.length||v,L=i.length>0||b.length>0||m.length>0||Number.isFinite(j)||Number.isFinite(_);return Object(r.createElement)("div",{className:(()=>{const{columns:e,rows:c,alignButtons:r,align:o}=t,n=void 0!==o?"align"+o:"";return u()(S,n,"has-"+e+"-columns",{"has-multiple-rows":c>1,"has-aligned-buttons":r})})()},(null==T?void 0:T.orderBy)&&B&&Object(r.createElement)(Tt,{onChange:n,value:a}),!B&&L&&Object(r.createElement)(Nt,{resetCallback:()=>{d([]),p([]),g([]),h(null),E(null)}}),!B&&!L&&Object(r.createElement)(Ct,null),B&&Object(r.createElement)("ul",{className:u()(S+"__products",{"is-loading-products":v})},A.map((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=arguments.length>1?arguments[1]:void 0;return Object(r.createElement)(Rt,{key:e.id||c,attributes:t,product:e})}))),R>1&&Object(r.createElement)(_t,{currentPage:c,onPageChange:e=>{s({focusableSelector:"a, button"}),o(e)},totalPages:R}))},e=>{const t=Object(r.useRef)(null);return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:t,"aria-hidden":!0}),Object(r.createElement)(Lt,Y()({},e,{scrollToTop:e=>{null!==t.current&&((e,t)=>{const{focusableSelector:c}=t||{};window&&Number.isFinite(window.innerHeight)&&(c?((e,t)=>{var c;const r=(null===(c=e.parentElement)||void 0===c?void 0:c.querySelectorAll(t))||[];if(r.length){const e=r[0];yt(e),null==e||e.focus()}else yt(e)})(e,c):yt(e))})(t.current,e)}})))}),Ft=e=>{let{attributes:t}=e;const[c,o]=Object(r.useState)(1),[n,a]=Object(r.useState)(t.orderby);return Object(r.useEffect)(()=>{a(t.orderby)},[t.orderby]),Object(r.createElement)(Dt,{attributes:t,currentPage:c,onPageChange:e=>{o(e)},onSortChange:e=>{var t;const c=null==e||null===(t=e.target)||void 0===t?void 0:t.value;a(c),o(1)},sortValue:n})},Vt=c(150),zt=c(251);class Mt extends A.Component{render(){const{attributes:e,urlParameterSuffix:t}=this.props;return e.isPreview?Vt.a:Object(r.createElement)(y.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(r.createElement)(zt.a,{context:"wc/all-products"}),Object(r.createElement)(Ft,{attributes:e,urlParameterSuffix:t}))}}var qt=Mt;c(398);class Ht extends r.Component{constructor(){super(...arguments),it()(this,"state",{isEditing:!1,innerBlocks:[]}),it()(this,"blockMap",Object(bt.a)("woocommerce/all-products")),it()(this,"componentDidMount",()=>{const{block:e}=this.props;this.setState({innerBlocks:e.innerBlocks})}),it()(this,"getTitle",()=>Object(l.__)("All Products","woocommerce")),it()(this,"getIcon",()=>Object(r.createElement)(n.a,{icon:a.a})),it()(this,"togglePreview",()=>{const{debouncedSpeak:e}=this.props;this.setState({isEditing:!this.state.isEditing}),this.state.isEditing||e(Object(l.__)("Showing All Products block preview.","woocommerce"))}),it()(this,"getInspectorControls",()=>{const{attributes:e,setAttributes:t}=this.props,{columns:c,rows:o,alignButtons:n}=e;return Object(r.createElement)(g.InspectorControls,{key:"inspector"},Object(r.createElement)(p.PanelBody,{title:Object(l.__)("Layout Settings","woocommerce"),initialOpen:!0},Object(r.createElement)(dt.a,{columns:c,rows:o,alignButtons:n,setAttributes:t,minColumns:Object(U.getSetting)("min_columns",1),maxColumns:Object(U.getSetting)("max_columns",6),minRows:Object(U.getSetting)("min_rows",1),maxRows:Object(U.getSetting)("max_rows",6)})),Object(r.createElement)(p.PanelBody,{title:Object(l.__)("Content Settings","woocommerce")},((e,t)=>{const{contentVisibility:c}=e;return Object(r.createElement)(p.ToggleControl,{label:Object(l.__)("Show Sorting Dropdown","woocommerce"),checked:c.orderBy,onChange:()=>t({contentVisibility:{...c,orderBy:!c.orderBy}})})})(e,t),((e,t)=>Object(r.createElement)(p.SelectControl,{label:Object(l.__)("Order Products By","woocommerce"),value:e.orderby,options:[{label:Object(l.__)("Default sorting (menu order)","woocommerce"),value:"menu_order"},{label:Object(l.__)("Popularity","woocommerce"),value:"popularity"},{label:Object(l.__)("Average rating","woocommerce"),value:"rating"},{label:Object(l.__)("Latest","woocommerce"),value:"date"},{label:Object(l.__)("Price: low to high","woocommerce"),value:"price"},{label:Object(l.__)("Price: high to low","woocommerce"),value:"price-desc"}],onChange:e=>t({orderby:e})}))(e,t)))}),it()(this,"getBlockControls",()=>{const{isEditing:e}=this.state;return Object(r.createElement)(g.BlockControls,null,Object(r.createElement)(p.ToolbarGroup,{controls:[{icon:"edit",title:Object(l.__)("Edit the layout of each product","woocommerce"),onClick:()=>this.togglePreview(),isActive:e}]}))}),it()(this,"renderEditMode",()=>{const e={template:this.props.attributes.layoutConfig,templateLock:!1,allowedBlocks:Object.keys(this.blockMap)};return 0!==this.props.attributes.layoutConfig.length&&(e.renderAppender=!1),Object(r.createElement)(p.Placeholder,{icon:this.getIcon(),label:this.getTitle()},Object(l.__)("Display all products from your store as a grid.","woocommerce"),Object(r.createElement)("div",{className:"wc-block-all-products-grid-item-template"},Object(r.createElement)(p.Tip,null,Object(l.__)("Edit the blocks inside the example below to change the content displayed for all products within the product grid.","woocommerce")),Object(r.createElement)(y.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(r.createElement)("div",{className:"wc-block-grid wc-block-layout has-1-columns"},Object(r.createElement)("ul",{className:"wc-block-grid__products"},Object(r.createElement)("li",{className:"wc-block-grid__product"},Object(r.createElement)(y.ProductDataContextProvider,{product:pt.a[0]},Object(r.createElement)(g.InnerBlocks,e)))))),Object(r.createElement)("div",{className:"wc-block-all-products__actions"},Object(r.createElement)(p.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,onClick:()=>{const{block:e,setAttributes:t}=this.props;t({layoutConfig:jt(e.innerBlocks)}),this.setState({innerBlocks:e.innerBlocks}),this.togglePreview()}},Object(l.__)("Done","woocommerce")),Object(r.createElement)(p.Button,{className:"wc-block-all-products__cancel-button",isTertiary:!0,onClick:()=>{const{block:e,replaceInnerBlocks:t}=this.props,{innerBlocks:c}=this.state;t(e.clientId,c,!1),this.togglePreview()}},Object(l.__)("Cancel","woocommerce")),Object(r.createElement)(p.Button,{className:"wc-block-all-products__reset-button",icon:Object(r.createElement)(n.a,{icon:a.a}),label:Object(l.__)("Reset layout to default","woocommerce"),onClick:()=>{const{block:e,replaceInnerBlocks:t}=this.props,c=[];Ot.map(e=>{let[t,r]=e;return c.push(Object(o.createBlock)(t,r)),!0}),t(e.clientId,c,!1),this.setState({innerBlocks:e.innerBlocks})}},Object(l.__)("Reset Layout","woocommerce")))))}),it()(this,"renderViewMode",()=>{const{attributes:e}=this.props,{layoutConfig:t}=e,c=t&&0!==t.length,o=this.getTitle(),n=this.getIcon();return c?Object(r.createElement)(p.Disabled,null,Object(r.createElement)(qt,{attributes:e})):((e,t)=>Object(r.createElement)(p.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(l.__)("The content for this block is hidden due to block settings.","woocommerce")))(o,n)}),it()(this,"render",()=>{const{attributes:e}=this.props,{isEditing:t}=this.state,c=this.getTitle(),o=this.getIcon();return 0===mt.o.productCount?((e,t)=>Object(r.createElement)(p.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(r.createElement)("p",null,Object(l.__)("You haven't published any products to list here yet.","woocommerce")),Object(r.createElement)(p.Button,{className:"wc-block-products__add-product-button",isSecondary:!0,href:U.ADMIN_URL+"post-new.php?post_type=product"},Object(l.__)("Add new product","woocommerce")+" ",Object(r.createElement)(n.a,{icon:gt.a})),Object(r.createElement)(p.Button,{className:"wc-block-products__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(l.__)("Learn more","woocommerce"))))(c,o):Object(r.createElement)("div",{className:nt("wc-block-all-products",e)},this.getBlockControls(),this.getInspectorControls(),t?this.renderEditMode():this.renderViewMode())})}}var Gt=Object(m.compose)(p.withSpokenMessages,Object(ut.withSelect)((e,t)=>{let{clientId:c}=t;const{getBlock:r}=e("core/block-editor");return{block:r(c)}}),Object(ut.withDispatch)(e=>{const{replaceInnerBlocks:t}=e("core/block-editor");return{replaceInnerBlocks:t}}))(Ht),Qt={columns:Object(U.getSetting)("default_columns",3),rows:Object(U.getSetting)("default_rows",3),alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:Ot,isPreview:!1};const{name:Yt}=ot,Ut={icon:{src:Object(r.createElement)(n.a,{icon:a.a,className:"wc-block-editor-components-block-icon"})},edit:Gt,save:function(e){let{attributes:t}=e;const c={};Object.keys(t).sort().forEach(e=>{c[e]=t[e]});const o={"data-attributes":JSON.stringify(c)};return Object(r.createElement)("div",Y()({className:nt("wc-block-all-products",t)},o),Object(r.createElement)(g.InnerBlocks.Content,null))},deprecated:st,defaults:Qt};Object(o.registerBlockType)(Yt,Ut)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(36),o=c(0),n=c(22);c.p=n.l,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)(()=>Promise.all([c.e(0),c.e(1),c.e(2),c.e(28)]).then(c.bind(null,210)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(4),c.e(25)]).then(c.bind(null,567)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(4),c.e(38)]).then(c.bind(null,568)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(30)]).then(c.bind(null,211)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(4),c.e(21)]).then(c.bind(null,212)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(35)]).then(c.bind(null,327)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(31)]).then(c.bind(null,141)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)(()=>c.e(33).then(c.bind(null,328)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(24)]).then(c.bind(null,329)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(37)]).then(c.bind(null,330)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(34)]).then(c.bind(null,331)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)(()=>Promise.all([c.e(0),c.e(1),c.e(4),c.e(19)]).then(c.bind(null,569)))});const a=e=>Object(r.getRegisteredBlockComponents)(e)}]);
|
1 |
+
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-products"]=function(e){function t(t){for(var r,a,s=t[0],l=t[1],i=t[2],d=0,b=[];d<s.length;d++)a=s[d],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&b.push(o[a][0]),o[a]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(u&&u(t);b.length;)b.shift()();return n.push.apply(n,i||[]),c()}function c(){for(var e,t=0;t<n.length;t++){for(var c=n[t],r=!0,s=1;s<c.length;s++){var l=c[s];0!==o[l]&&(r=!1)}r&&(n.splice(t--,1),e=a(a.s=c[0]))}return e}var r={},o={6:0,1:0,2:0,3:0,4:0,21:0,24:0,28:0,30:0,31:0,33:0,34:0,35:0,37:0},n=[];function a(t){if(r[t])return r[t].exports;var c=r[t]={i:t,l:!1,exports:{}};return e[t].call(c.exports,c,c.exports,a),c.l=!0,c.exports}a.e=function(e){var t=[],c=o[e];if(0!==c)if(c)t.push(c[2]);else{var r=new Promise((function(t,r){c=o[e]=[t,r]}));t.push(c[2]=r);var n,s=document.createElement("script");s.charset="utf-8",s.timeout=120,a.nc&&s.setAttribute("nonce",a.nc),s.src=function(e){return a.p+""+({1:"product-add-to-cart--product-button--product-category-list--product-image--product-price--product-r--a0326d00",2:"product-button--product-category-list--product-image--product-price--product-rating--product-sale-b--e17c7c01",3:"product-button--product-image--product-rating--product-sale-badge--product-title",4:"product-add-to-cart--product-button--product-image--product-title",19:"product-add-to-cart",21:"product-button",24:"product-category-list",25:"product-image",28:"product-price",30:"product-rating",31:"product-sale-badge",33:"product-sku",34:"product-stock-indicator",35:"product-summary",37:"product-tag-list",38:"product-title"}[e]||e)+".js?ver="+{1:"cd85088c6c440d103fa6",2:"82a31633a946790de5d6",3:"d717f5e60ed9f7dd7dd6",4:"81b2387f4ce1bf436863",19:"57871562e4c6100bf151",21:"2862efe32f4d0dcec10a",24:"9f103911143fe3e0db45",25:"e8da028e191e36d69a6f",28:"50814a1cd256be7b460c",30:"f2a52d4891f270c054cb",31:"14eedd3da86921bef8fd",33:"7ec1f49ffd46d608c4bf",34:"186cee69f27036527ba4",35:"352b627d83a60b9b0c1b",37:"d9d8eb5a8ed3a0a69cc3",38:"d8a8b0f14c0b05b2b502"}[e]}(e);var l=new Error;n=function(t){s.onerror=s.onload=null,clearTimeout(i);var c=o[e];if(0!==c){if(c){var r=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;l.message="Loading chunk "+e+" failed.\n("+r+": "+n+")",l.name="ChunkLoadError",l.type=r,l.request=n,c[1](l)}o[e]=void 0}};var i=setTimeout((function(){n({type:"timeout",target:s})}),12e4);s.onerror=s.onload=n,document.head.appendChild(s)}return Promise.all(t)},a.m=e,a.c=r,a.d=function(e,t,c){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},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 c=Object.create(null);if(a.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(c,r,function(t){return e[t]}.bind(null,r));return c},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 s=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var i=0;i<s.length;i++)t(s[i]);var u=l;return n.push([392,0]),c()}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.wp.components},,function(e,t){e.exports=window.wp.blockEditor},,function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t){e.exports=window.wp.blocks},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.React},function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.apiFetch},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=window.wp.url},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a})),c.d(t,"c",(function(){return l})),c.d(t,"d",(function(){return i})),c.d(t,"b",(function(){return u}));var r=c(0),o=c(8),n=c(1);const a={clear:Object(n.__)("Clear all selected items","woocommerce"),noItems:Object(n.__)("No items found.","woocommerce"),
|
2 |
/* Translators: %s search term */
|
3 |
noResults:Object(n.__)("No results for %s","woocommerce"),search:Object(n.__)("Search for items","woocommerce"),selected:e=>Object(n.sprintf)(
|
4 |
/* translators: Number of items selected from list. */
|
5 |
+
Object(n._n)("%d item selected","%d items selected",e,"woocommerce"),e),updated:Object(n.__)("Search results updated.","woocommerce")},s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const c=Object(o.groupBy)(e,"parent"),r=Object(o.keyBy)(t,"id"),n=["0"],a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=a(r[e.parent]);return[...t,e.name]},s=e=>e.map(e=>{const t=c[e.id];return n.push(""+e.id),{...e,breadcrumbs:a(r[e.parent]),children:t&&t.length?s(t):[]}}),l=s(c[0]||[]);return Object.entries(c).forEach(e=>{let[t,c]=e;n.includes(t)||l.push(...s(c||[]))}),l},l=(e,t,c)=>{if(!t)return c?s(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),o=e.map(e=>!!r.test(e.name)&&e).filter(Boolean);return c?s(o,e):o},i=(e,t)=>{if(!t)return e;const c=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(c).map((e,t)=>c.test(e)?Object(r.createElement)("strong",{key:t},e):Object(r.createElement)(r.Fragment,{key:t},e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},,,function(e,t,c){"use strict";c.d(t,"o",(function(){return n})),c.d(t,"m",(function(){return a})),c.d(t,"l",(function(){return s})),c.d(t,"n",(function(){return l})),c.d(t,"j",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"f",(function(){return d})),c.d(t,"g",(function(){return b})),c.d(t,"k",(function(){return p})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return g})),c.d(t,"h",(function(){return O})),c.d(t,"a",(function(){return j})),c.d(t,"i",(function(){return h})),c.d(t,"b",(function(){return _}));var r,o=c(2);const n=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=n.pluginUrl+"images/",s=n.pluginUrl+"build/",l=n.buildPhase,i=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=o.STORE_PAGES.checkout.id,d=o.STORE_PAGES.checkout.permalink,b=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),m=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),g=o.STORE_PAGES.cart.permalink,O=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),j=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),_=Object(o.getSetting)("allowedStates",{})},function(e,t){e.exports=window.wc.wcBlocksSharedContext},,function(e,t){e.exports=window.wp.isShallowEqual},function(e,t){e.exports=window.wc.priceFormat},function(e,t,c){"use strict";c.d(t,"h",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"b",(function(){return d})),c.d(t,"i",(function(){return b})),c.d(t,"f",(function(){return p})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return g})),c.d(t,"g",(function(){return O})),c.d(t,"a",(function(){return j}));var r=c(16),o=c(14),n=c.n(o),a=c(8),s=c(2),l=c(22);const i=e=>{let{selected:t=[],search:c="",queryArgs:o={}}=e;const s=(e=>{let{selected:t=[],search:c="",queryArgs:o={}}=e;const n=l.o.productCount>100,a={per_page:n?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},s=[Object(r.addQueryArgs)("/wc/store/v1/products",{...a,...o})];return n&&t.length&&s.push(Object(r.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),s})({selected:t,search:c,queryArgs:o});return Promise.all(s.map(e=>n()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>n()({path:"/wc/store/v1/products/"+e}),d=()=>n()({path:"wc/store/v1/products/attributes"}),b=e=>n()({path:`wc/store/v1/products/attributes/${e}/terms`}),p=e=>{let{selected:t=[],search:c}=e;const o=(e=>{let{selected:t=[],search:c}=e;const o=Object(s.getSetting)("limitTags",!1),n=[Object(r.addQueryArgs)("wc/store/v1/products/tags",{per_page:o?100:0,orderby:o?"count":"name",order:o?"desc":"asc",search:c})];return o&&t.length&&n.push(Object(r.addQueryArgs)("wc/store/v1/products/tags",{include:t})),n})({selected:t,search:c});return Promise.all(o.map(e=>n()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id"))},m=e=>n()({path:Object(r.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),g=e=>n()({path:"wc/store/v1/products/categories/"+e}),O=e=>n()({path:Object(r.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),j=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return a}));var r=c(1),o=c(15);const n=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},a=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(o.decodeEntities)(e.message):Object(r.__)("Something went wrong. Please contact us to get assistance.","woocommerce")}},function(e,t,c){"use strict";var r=c(0),o=c(4),n=c.n(o);t.a=e=>{let t,{label:c,screenReaderLabel:o,wrapperElement:a,wrapperProps:s={}}=e;const l=null!=c,i=null!=o;return!l&&i?(t=a||"span",s={...s,className:n()(s.className,"screen-reader-text")},Object(r.createElement)(t,s,o)):(t=a||r.Fragment,l&&i&&c!==o?Object(r.createElement)(t,s,Object(r.createElement)("span",{"aria-hidden":"true"},c),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,s,c))}},,,,function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(34);t.a=e=>{let{error:t}=e;return Object(r.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:c}=e;return t?"general"===c?Object(r.createElement)("span",null,Object(o.__)("The following error was returned","woocommerce"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(n.escapeHTML)(t))):"api"===c?Object(r.createElement)("span",null,Object(o.__)("The following error was returned from the API","woocommerce"),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(n.escapeHTML)(t))):t:Object(o.__)("An error has prevented the block from being updated.","woocommerce")})(t))}},function(e,t){e.exports=window.wp.escapeHtml},function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return o}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return r(e)&&t in e}},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var r=c(6),o=c.n(r),n=c(0),a=c(19);const s=e=>{let{countLabel:t,className:c,depth:r=0,controlId:s="",item:l,isSelected:i,isSingle:u,onSelect:d,search:b="",...p}=e;const m=null!=t&&void 0!==l.count&&null!==l.count,g=[c,"woocommerce-search-list__item"];g.push("depth-"+r),u&&g.push("is-radio-button"),m&&g.push("has-count");const O=l.breadcrumbs&&l.breadcrumbs.length,j=p.name||"search-list-item-"+s,h=`${j}-${l.id}`;return Object(n.createElement)("label",{htmlFor:h,className:g.join(" ")},u?Object(n.createElement)("input",o()({type:"radio",id:h,name:j,value:l.value,onChange:d(l),checked:i,className:"woocommerce-search-list__item-input"},p)):Object(n.createElement)("input",o()({type:"checkbox",id:h,name:j,value:l.value,onChange:d(l),checked:i,className:"woocommerce-search-list__item-input"},p)),Object(n.createElement)("span",{className:"woocommerce-search-list__item-label"},O?Object(n.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(a.b)(l.breadcrumbs)):null,Object(n.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(a.d)(l.name,b))),!!m&&Object(n.createElement)("span",{className:"woocommerce-search-list__item-count"},t||l.count))};t.b=s},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(131),s=c(4),l=c.n(s);c(137);const i=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:c,currency:r,onValueChange:s,displayType:u="text",...d}=e;const b="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(b))return null;const p=b/10**r.minorUnit;if(!Number.isFinite(p))return null;const m=l()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),g={...d,...i(r),value:void 0,currency:void 0,onValueChange:void 0},O=s?e=>{const t=+e.value*10**r.minorUnit;s(t)}:()=>{};return Object(n.createElement)(a.a,o()({className:m,displayType:u},g,{value:p,onValueChange:O}))}},,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(0),o=c(25),n=c.n(o);function a(e){const t=Object(r.useRef)(e);return n()(e,t.current)||(t.current=e),t.current}},function(e,t,c){"use strict";c.d(t,"a",(function(){return _}));var r=c(8),o=c(0),n=c(9),a=c(7),s=c(15),l=c(267),i=c(84),u=c(266);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(a.dispatch)(n.CART_STORE_KEY).invalidateResolutionForStore()},b=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},p=()=>{Object(o.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(u.a)("added_to_cart","wc-blocks_added_to_cart"),t=Object(u.a)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),b),[])},m={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},g={...m,email:""},O={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:n.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},j=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,c]=e;return[t,Object(s.decodeEntities)(c)]})),h={cartCoupons:n.EMPTY_CART_COUPONS,cartItems:n.EMPTY_CART_ITEMS,cartFees:n.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,crossSellsProducts:n.EMPTY_CART_CROSS_SELLS,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:n.EMPTY_CART_ITEM_ERRORS,cartTotals:O,cartIsLoading:!0,cartErrors:n.EMPTY_CART_ERRORS,billingAddress:g,shippingAddress:m,shippingRates:n.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentRequirements:n.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:n.EMPTY_EXTENSIONS},_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:c}=Object(i.b)(),s=null==c?void 0:c.previewCart,{shouldSelect:u}=e,d=Object(o.useRef)();p();const b=Object(a.useSelect)((e,c)=>{let{dispatch:r}=c;if(!u)return h;if(t)return{cartCoupons:s.coupons,cartItems:s.items,crossSellsProducts:s.cross_sells,cartFees:s.fees,cartItemsCount:s.items_count,cartItemsWeight:s.items_weight,cartNeedsPayment:s.needs_payment,cartNeedsShipping:s.needs_shipping,cartItemErrors:n.EMPTY_CART_ITEM_ERRORS,cartTotals:s.totals,cartIsLoading:!1,cartErrors:n.EMPTY_CART_ERRORS,billingData:g,billingAddress:g,shippingAddress:m,extensions:n.EMPTY_EXTENSIONS,shippingRates:s.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:s.has_calculated_shipping,paymentRequirements:s.paymentRequirements,receiveCart:"function"==typeof(null==s?void 0:s.receiveCart)?s.receiveCart:()=>{}};const o=e(n.CART_STORE_KEY),a=o.getCartData(),i=o.getCartErrors(),d=o.getCartTotals(),b=!o.hasFinishedResolution("getCartData"),p=o.isCustomerDataUpdating(),{receiveCart:O}=r(n.CART_STORE_KEY),_=j(a.billingAddress),E=a.needsShipping?j(a.shippingAddress):_,w=a.fees.length>0?a.fees.map(e=>j(e)):n.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map(e=>({...e,label:e.code})):n.EMPTY_CART_COUPONS,cartItems:a.items,crossSellsProducts:a.crossSells,cartFees:w,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:d,cartIsLoading:b,cartErrors:i,billingData:Object(l.a)(_),billingAddress:Object(l.a)(_),shippingAddress:Object(l.a)(E),extensions:a.extensions,shippingRates:a.shippingRates,isLoadingRates:p,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:O}},[u]);return d.current&&Object(r.isEqual)(d.current,b)||(d.current=b),d.current}},function(e,t){e.exports=window.wc.wcBlocksSharedHocs},,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(0);const o=Object(r.createContext)("page"),n=()=>Object(r.useContext)(o);o.Provider},,function(e,t){e.exports=window.wp.hooks},,function(e,t){e.exports=window.wp.a11y},,,function(e,t){e.exports=window.wp.deprecated},function(e,t,c){"use strict";c.d(t,"a",(function(){return d})),c.d(t,"b",(function(){return b})),c.d(t,"c",(function(){return p}));var r=c(9),o=c(7),n=c(0),a=c(25),s=c.n(a),l=c(40),i=c(104),u=c(44);const d=e=>{const t=Object(u.a)();e=e||t;const c=Object(o.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:a}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[c,Object(n.useCallback)(t=>{a(e,t)},[e,a])]},b=(e,t,c)=>{const a=Object(u.a)();c=c||a;const s=Object(o.useSelect)(o=>o(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(c,e,t),[c,e]),{setQueryValue:l}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[s,Object(n.useCallback)(t=>{l(c,e,t)},[c,e,l])]},p=(e,t)=>{const c=Object(u.a)();t=t||c;const[r,o]=d(t),a=Object(l.a)(r),b=Object(l.a)(e),p=Object(i.a)(b),m=Object(n.useRef)(!1);return Object(n.useEffect)(()=>{s()(p,b)||(o(Object.assign({},a,b)),m.current=!0)},[a,b,p,o]),m.current?[r,o]:[e,o]}},,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"e",(function(){return n})),c.d(t,"d",(function(){return a})),c.d(t,"b",(function(){return l})),c.d(t,"c",(function(){return i}));var r=c(35);const o=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];let n,a;!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"}(a||(a={}));const s=(e,t)=>Object(r.a)(e)&&"type"in e&&e.type===t,l=e=>s(e,n.ERROR),i=e=>s(e,n.FAIL)},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(136),s=c(4),l=c.n(s),i=c(95);c(163),t.a=e=>{let{className:t,showSpinner:c=!1,children:r,variant:s="contained",...u}=e;const d=l()("wc-block-components-button",t,s,{"wc-block-components-button--loading":c});return Object(n.createElement)(a.a,o()({className:d},u),c&&Object(n.createElement)(i.a,null),Object(n.createElement)("span",{className:"wc-block-components-button__text"},r))}},function(e,t){e.exports=window.wp.autop},function(e,t,c){"use strict";c.d(t,"c",(function(){return n})),c.d(t,"a",(function(){return a})),c.d(t,"b",(function(){return s}));var r=c(10),o=c(22);const n=(e,t)=>{if(o.n>2)return Object(r.registerBlockType)(e,t)},a=()=>o.n>2,s=()=>o.n>1},,,function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(8),a=c(3);t.a=e=>{let{columns:t,rows:c,setAttributes:s,alignButtons:l,minColumns:i=1,maxColumns:u=6,minRows:d=1,maxRows:b=6}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.RangeControl,{label:Object(o.__)("Columns","woocommerce"),value:t,onChange:e=>{const t=Object(n.clamp)(e,i,u);s({columns:Number.isNaN(t)?"":t})},min:i,max:u}),Object(r.createElement)(a.RangeControl,{label:Object(o.__)("Rows","woocommerce"),value:c,onChange:e=>{const t=Object(n.clamp)(e,d,b);s({rows:Number.isNaN(t)?"":t})},min:d,max:b}),Object(r.createElement)(a.ToggleControl,{label:Object(o.__)("Align the last block to the bottom","woocommerce"),help:l?Object(o.__)("Align the last block to the bottom.","woocommerce"):Object(o.__)("The last inner block will follow other content.","woocommerce"),checked:l,onChange:()=>s({alignButtons:!l})}))}},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(0),o=c(7),n=c(9);c(185);const a=e=>{let{errorMessage:t="",propertyName:c="",elementId:a=""}=e;const{validationError:s,validationErrorId:l}=Object(o.useSelect)(e=>{const t=e(n.VALIDATION_STORE_KEY);return{validationError:t.getValidationError(c),validationErrorId:t.getValidationErrorId(a)}});if(!t||"string"!=typeof t){if(null==s||!s.message||null!=s&&s.hidden)return null;t=s.message}return Object(r.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(r.createElement)("p",{id:l},t))};t.b=a},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(46),o=c(0),n=c(41);const a=()=>{const e=Object(n.a)(),t=Object(o.useRef)(e);return Object(o.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...c,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},,,function(e,t){e.exports=window.wp.dom},,,,,,,function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(38),a=c(4),s=c.n(a),l=c(26);c(162);const i=e=>{let{currency:t,maxPrice:c,minPrice:a,priceClassName:i,priceStyle:u={}}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},Object(o.sprintf)(
|
6 |
/* translators: %1$s min price, %2$s max price */
|
7 |
+
Object(o.__)("Price between %1$s and %2$s","woocommerce"),Object(l.formatPrice)(a),Object(l.formatPrice)(c))),Object(r.createElement)("span",{"aria-hidden":!0},Object(r.createElement)(n.a,{className:s()("wc-block-components-product-price__value",i),currency:t,value:a,style:u})," — ",Object(r.createElement)(n.a,{className:s()("wc-block-components-product-price__value",i),currency:t,value:c,style:u})))},u=e=>{let{currency:t,regularPriceClassName:c,regularPriceStyle:a,regularPrice:l,priceClassName:i,priceStyle:u,price:d}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Previous price:","woocommerce")),Object(r.createElement)(n.a,{currency:t,renderText:e=>Object(r.createElement)("del",{className:s()("wc-block-components-product-price__regular",c),style:a},e),value:l}),Object(r.createElement)("span",{className:"screen-reader-text"},Object(o.__)("Discounted price:","woocommerce")),Object(r.createElement)(n.a,{currency:t,renderText:e=>Object(r.createElement)("ins",{className:s()("wc-block-components-product-price__value","is-discounted",i),style:u},e),value:d}))};t.a=e=>{let{align:t,className:c,currency:o,format:a="<price/>",maxPrice:l,minPrice:d,price:b,priceClassName:p,priceStyle:m,regularPrice:g,regularPriceClassName:O,regularPriceStyle:j}=e;const h=s()(c,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+t]:t});a.includes("<price/>")||(a="<price/>",console.error("Price formats need to include the `<price/>` tag."));const _=g&&b!==g;let E=Object(r.createElement)("span",{className:s()("wc-block-components-product-price__value",p)});return _?E=Object(r.createElement)(u,{currency:o,price:b,priceClassName:p,priceStyle:m,regularPrice:g,regularPriceClassName:O,regularPriceStyle:j}):void 0!==d&&void 0!==l?E=Object(r.createElement)(i,{currency:o,maxPrice:l,minPrice:d,priceClassName:p,priceStyle:m}):b&&(E=Object(r.createElement)(n.a,{className:s()("wc-block-components-product-price__value",p),currency:o,value:b,style:m})),Object(r.createElement)("span",{className:h},Object(r.createInterpolateElement)(a,{price:E}))}},,,function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(37),s=c(3),l=c(4),i=c.n(l);t.a=e=>{let{className:t,item:c,isSelected:r,isLoading:l,onSelect:u,disabled:d,...b}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.a,o()({},b,{key:c.id,className:t,isSelected:r,item:c,onSelect:u,isSingle:!0,disabled:d})),r&&l&&Object(n.createElement)("div",{key:"loading",className:i()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(n.createElement)(s.Spinner,null)))}},function(e,t,c){"use strict";c.d(t,"b",(function(){return a})),c.d(t,"a",(function(){return s}));var r=c(0),o=c(7);const n=Object(r.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),a=()=>Object(r.useContext)(n),s=e=>{let{children:t,currentPostId:c=0,currentView:a="",previewData:s={}}=e;const l=Object(o.useSelect)(e=>c||e("core/editor").getCurrentPostId(),[c]),i=Object(r.useCallback)(e=>e in s?s[e]:{},[s]),u={isEditor:!0,currentPostId:l,currentView:a,previewData:s,getPreviewData:i};return Object(r.createElement)(n.Provider,{value:u},t)}},,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(35),o=c(129);const n=e=>{const t=Object(r.a)(e)?e:{},c=Object(o.a)(t.style),n=Object(r.a)(c.typography)?c.typography:{};return{style:{fontSize:t.fontSize?`var(--wp--preset--font-size--${t.fontSize})`:n.fontSize,lineHeight:n.lineHeight,fontWeight:n.fontWeight,textTransform:n.textTransform,fontFamily:t.fontFamily}}}},,function(e,t){e.exports=window.wp.wordcount},,,,function(e,t,c){"use strict";var r=c(2),o=c(1),n=c(169),a=c(96);const s=Object(r.getSetting)("countryLocale",{}),l=e=>{const 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(o.sprintf)(
|
8 |
/* translators: %s Field label. */
|
9 |
+
Object(o.__)("%s (optional)","woocommerce"),e.label)),e.priority&&(Object(n.a)(e.priority)&&(t.index=e.priority),Object(a.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},i=Object.entries(s).map(e=>{let[t,c]=e;return[t,Object.entries(c).map(e=>{let[t,c]=e;return[t,l(c)]}).reduce((e,t)=>{let[c,r]=t;return e[c]=r,e},{})]}).reduce((e,t)=>{let[c,r]=t;return e[c]=r,e},{});t.a=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=c&&void 0!==i[c]?i[c]:{};return e.map(e=>({key:e,...r.defaultAddressFields[e]||{},...o[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},function(e,t,c){"use strict";var r=c(0);c(164),t.a=()=>Object(r.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r=e=>"string"==typeof e},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(1),s=c(8),l=c(37),i=c(100),u=c(11),d=Object(u.createHigherOrderComponent)(e=>{class t extends n.Component{render(){const{selected:t}=this.props,c=null==t;return Array.isArray(t)?Object(n.createElement)(e,this.props):Object(n.createElement)(e,o()({},this.props,{selected:c?[]:[t]}))}}return t.defaultProps={selected:null},t},"withTransformSingleSelectToMultipleSelect"),b=c(188),p=c(24),m=c.n(p),g=c(25),O=c.n(g),j=c(27),h=c(28),_=Object(u.createHigherOrderComponent)(e=>{class t extends n.Component{constructor(){super(...arguments),m()(this,"state",{error:null,loading:!1,variations:{}}),m()(this,"loadVariations",()=>{const{products:e}=this.props,{loading:t,variations:c}=this.state;if(t)return;const r=this.getExpandedProduct();if(!r||c[r])return;const o=e.find(e=>e.id===r);o.variations&&0!==o.variations.length?(this.setState({loading:!0}),Object(j.g)(r).then(e=>{const t=e.map(e=>({...e,parent:r}));this.setState({variations:{...this.state.variations,[r]:t},loading:!1,error:null})}).catch(async e=>{const t=await Object(h.a)(e);this.setState({variations:{...this.state.variations,[r]:null},loading:!1,error:t})})):this.setState({variations:{...this.state.variations,[r]:null},loading:!1,error:null})})}componentDidMount(){const{selected:e,showVariations:t}=this.props;e&&t&&this.loadVariations()}componentDidUpdate(e){const{isLoading:t,selected:c,showVariations:r}=this.props;r&&(!O()(e.selected,c)||e.isLoading&&!t)&&this.loadVariations()}isProductId(e){const{products:t}=this.props;return t.some(t=>t.id===e)}findParentProduct(e){var t;const{products:c}=this.props;return null===(t=c.filter(t=>t.variations&&t.variations.find(t=>{let{id:c}=t;return c===e}))[0])||void 0===t?void 0:t.id}getExpandedProduct(){const{isLoading:e,selected:t,showVariations:c}=this.props;if(!c)return null;let r=t&&t.length?t[0]:null;return r?this.prevSelectedItem=r:this.prevSelectedItem&&(e||this.isProductId(this.prevSelectedItem)||(r=this.prevSelectedItem)),!e&&r?this.isProductId(r)?r:this.findParentProduct(r):null}render(){const{error:t,isLoading:c}=this.props,{error:r,loading:a,variations:s}=this.state;return Object(n.createElement)(e,o()({},this.props,{error:r||t,expandedProduct:this.getExpandedProduct(),isLoading:c,variations:s,variationsLoading:a}))}}return m()(t,"defaultProps",{selected:[],showVariations:!1}),t},"withProductVariations"),E=c(33),w=c(4),f=c.n(w),k=c(83);c(138);const y={list:Object(a.__)("Products","woocommerce"),noItems:Object(a.__)("Your store doesn't have any products.","woocommerce"),search:Object(a.__)("Search for a product to display","woocommerce"),updated:Object(a.__)("Product search results updated.","woocommerce")},v=e=>{let{expandedProduct:t,error:c,instanceId:r,isCompact:u,isLoading:d,onChange:b,onSearch:p,products:m,renderItem:g,selected:O,showVariations:j,variations:h,variationsLoading:_}=e;if(c)return Object(n.createElement)(E.a,{error:c});const w=[...m,...h&&h[t]?h[t]:[]];return Object(n.createElement)(i.a,{className:"woocommerce-products",list:w,isCompact:u,isLoading:d,isSingle:!0,selected:w.filter(e=>{let{id:t}=e;return O.includes(t)}),onChange:b,renderItem:g||(j?e=>{const{item:t,search:c,depth:i=0,isSelected:u,onSelect:b}=e,p=t.variations&&Array.isArray(t.variations)?t.variations.length:0,m=f()("woocommerce-search-product__item","woocommerce-search-list__item","depth-"+i,"has-count",{"is-searching":c.length>0,"is-skip-level":0===i&&0!==t.parent,"is-variable":p>0});if(!t.breadcrumbs.length)return Object(n.createElement)(k.a,o()({},e,{className:f()(m,{"is-selected":u}),isSelected:u,item:t,onSelect:()=>()=>{b(t)()},isLoading:d||_,countLabel:t.variations.length>0?Object(a.sprintf)(
|
10 |
/* translators: %1$d is the number of variations of a product product. */
|
11 |
Object(a.__)("%1$d variations","woocommerce"),t.variations.length):null,name:"products-"+r,"aria-label":Object(a.sprintf)(
|
12 |
/* translators: %1$s is the product name, %2$d is the number of variations of that product. */
|
13 |
+
Object(a._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,"woocommerce"),t.name,t.variations.length)}));const g=Object(s.isEmpty)(t.variation)?e:{...e,item:{...e.item,name:t.variation},"aria-label":`${t.breadcrumbs[0]}: ${t.variation}`};return Object(n.createElement)(l.a,o()({},g,{className:m,name:"variations-"+r}))}:null),onSearch:p,messages:y,isHierarchical:!0})};v.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1},t.a=d(Object(b.a)(_(Object(u.withInstanceId)(v))))},function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return s}));var r=c(8);let o;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(o||(o={}));const n={addEventCallback:function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(r.uniqueId)(),type:o.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:c}},removeEventCallback:(e,t)=>({id:t,type:o.REMOVE_EVENT_CALLBACK,eventType:e})},a={},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,{type:t,eventType:c,id:r,callback:n,priority:s}=arguments.length>1?arguments[1]:void 0;const l=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(t){case o.ADD_EVENT_CALLBACK:return l.set(r,{priority:s,callback:n}),{...e,[c]:l};case o.REMOVE_EVENT_CALLBACK:return l.delete(r),{...e,[c]:l}}}},function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var r=c(5),o=c(61),n=c(35),a=c(129);const s=e=>{if(!Object(o.b)())return{className:"",style:{}};const t=Object(n.a)(e)?e:{},c=Object(a.a)(t.style);return Object(r.__experimentalUseColorProps)({...t,style:c})}},function(e,t,c){"use strict";c.d(t,"a",(function(){return k}));var r=c(6),o=c.n(r),n=c(0),a=c(1),s=c(3),l=c(118),i=c(527),u=c(4),d=c.n(u),b=c(11),p=c(19),m=c(37),g=c(526),O=c(15);const j=e=>{let{id:t,label:c,popoverContents:r,remove:o,screenReaderLabel:i,className:u=""}=e;const[p,m]=Object(n.useState)(!1),h=Object(b.useInstanceId)(j);if(i=i||c,!c)return null;c=Object(O.decodeEntities)(c);const _=d()("woocommerce-tag",u,{"has-remove":!!o}),E="woocommerce-tag__label-"+h,w=Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{className:"screen-reader-text"},i),Object(n.createElement)("span",{"aria-hidden":"true"},c));return Object(n.createElement)("span",{className:_},r?Object(n.createElement)(s.Button,{className:"woocommerce-tag__text",id:E,onClick:()=>m(!0)},w):Object(n.createElement)("span",{className:"woocommerce-tag__text",id:E},w),r&&p&&Object(n.createElement)(s.Popover,{onClose:()=>m(!1)},r),o&&Object(n.createElement)(s.Button,{className:"woocommerce-tag__remove",onClick:o(t),label:Object(a.sprintf)(// Translators: %s label.
|
14 |
+
Object(a.__)("Remove %s","woocommerce"),c),"aria-describedby":E},Object(n.createElement)(l.a,{icon:g.a,size:20,className:"clear-icon"})))};var h=j;const _=e=>Object(n.createElement)(m.b,e),E=e=>{const{list:t,selected:c,renderItem:r,depth:a=0,onSelect:s,instanceId:l,isSingle:i,search:u}=e;return t?Object(n.createElement)(n.Fragment,null,t.map(t=>{const d=-1!==c.findIndex(e=>{let{id:c}=e;return c===t.id});return Object(n.createElement)(n.Fragment,{key:t.id},Object(n.createElement)("li",null,r({item:t,isSelected:d,onSelect:s,isSingle:i,search:u,depth:a,controlId:l})),Object(n.createElement)(E,o()({},e,{list:t.children,depth:a+1})))})):null},w=e=>{let{isLoading:t,isSingle:c,selected:r,messages:o,onChange:l,onRemove:i}=e;if(t||c||!r)return null;const u=r.length;return Object(n.createElement)("div",{className:"woocommerce-search-list__selected"},Object(n.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(n.createElement)("strong",null,o.selected(u)),u>0?Object(n.createElement)(s.Button,{isLink:!0,isDestructive:!0,onClick:()=>l([]),"aria-label":o.clear},Object(a.__)("Clear all","woocommerce")):null),u>0?Object(n.createElement)("ul",null,r.map((e,t)=>Object(n.createElement)("li",{key:t},Object(n.createElement)(h,{label:e.name,id:e.id,remove:i})))):null)},f=e=>{let{filteredList:t,search:c,onSelect:r,instanceId:o,...s}=e;const{messages:u,renderItem:d,selected:b,isSingle:p}=s,m=d||_;return 0===t.length?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(n.createElement)(l.a,{icon:i.a})),Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-text"},c?Object(a.sprintf)(u.noResults,c):u.noItems)):Object(n.createElement)("ul",{className:"woocommerce-search-list__list"},Object(n.createElement)(E,{list:t,selected:b,renderItem:m,onSelect:r,instanceId:o,isSingle:p,search:c}))},k=e=>{const{className:t="",isCompact:c,isHierarchical:r,isLoading:a,isSingle:l,list:i,messages:u=p.a,onChange:m,onSearch:g,selected:O,debouncedSpeak:j}=e,[h,_]=Object(n.useState)(""),E=Object(b.useInstanceId)(k),y=Object(n.useMemo)(()=>({...p.a,...u}),[u]),v=Object(n.useMemo)(()=>Object(p.c)(i,h,r),[i,h,r]);Object(n.useEffect)(()=>{j&&j(y.updated)},[j,y]),Object(n.useEffect)(()=>{"function"==typeof g&&g(h)},[h,g]);const S=Object(n.useCallback)(e=>()=>{l&&m([]);const t=O.findIndex(t=>{let{id:c}=t;return c===e});m([...O.slice(0,t),...O.slice(t+1)])},[l,O,m]),C=Object(n.useCallback)(e=>()=>{-1===O.findIndex(t=>{let{id:c}=t;return c===e.id})?m(l?[e]:[...O,e]):S(e.id)()},[l,S,m,O]);return Object(n.createElement)("div",{className:d()("woocommerce-search-list",t,{"is-compact":c})},Object(n.createElement)(w,o()({},e,{onRemove:S,messages:y})),Object(n.createElement)("div",{className:"woocommerce-search-list__search"},Object(n.createElement)(s.TextControl,{label:y.search,type:"search",value:h,onChange:e=>_(e)})),a?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(n.createElement)(s.Spinner,null)):Object(n.createElement)(f,o()({},e,{search:h,filteredList:v,messages:y,onSelect:C,instanceId:E})))};Object(s.withSpokenMessages)(k)},,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(12);function o(e,t){const c=Object(r.useRef)();return Object(r.useEffect)(()=>{c.current===e||t&&!t(e,c.current)||(c.current=e)},[e,t]),c.current}},,function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(15),s=c(4),l=c.n(s);c(161),t.a=e=>{let{className:t="",disabled:c=!1,name:r,permalink:s="",target:i,rel:u,style:d,onClick:b,...p}=e;const m=l()("wc-block-components-product-name",t);if(c){const e=p;return Object(n.createElement)("span",o()({className:m},e,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(r)}}))}return Object(n.createElement)("a",o()({className:m,href:s,target:i},p,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(r)},style:d}))}},function(e,t){e.exports=window.wp.warning},function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var r=c(9),o=c(7),n=c(0),a=c(40),s=c(142);const l=e=>{const{namespace:t,resourceName:c,resourceValues:l=[],query:i={},shouldSelect:u=!0}=e;if(!t||!c)throw new Error("The options object must have valid values for the namespace and the resource properties.");const d=Object(n.useRef)({results:[],isLoading:!0}),b=Object(a.a)(i),p=Object(a.a)(l),m=Object(s.a)(),g=Object(o.useSelect)(e=>{if(!u)return null;const o=e(r.COLLECTIONS_STORE_KEY),n=[t,c,b,p],a=o.getCollectionError(...n);if(a){if(!(a instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");m(a)}return{results:o.getCollection(...n),isLoading:!o.hasFinishedResolution("getCollection",n)}},[t,c,p,b,u]);return null!==g&&(d.current=g),d.current}},function(e,t,c){"use strict";var r=c(0),o=c(1),n=c(118),a=c(258),s=c(2),l=c(5),i=c(23);t.a=e=>{const t=(Object(i.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(r.createElement)(l.InspectorControls,null,Object(r.createElement)("div",{className:"wc-block-single-product__edit-card"},Object(r.createElement)("div",{className:"wc-block-single-product__edit-card-title"},Object(r.createElement)("a",{href:`${s.ADMIN_URL}post.php?post=${t}&action=edit`,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Edit this product's details","woocommerce"),Object(r.createElement)(n.a,{icon:a.a,size:16}))),Object(r.createElement)("div",{className:"wc-block-single-product__edit-card-description"},Object(o.__)("Edit details such as title, price, description and more.","woocommerce")))):null}},,,,,,,,,,,function(e,t,c){"use strict";var r=c(0),o=c(90),n=c(60);const a=e=>{const t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},s=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),l=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,i=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…";const r=s(e),o=r.split(" ").splice(0,t).join(" ");return Object(n.autop)(l(o,c))},u=function(e,t){let c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…";const o=s(e),a=o.slice(0,t);if(c)return Object(n.autop)(l(a,r));const i=a.match(/([\s]+)/g),u=i?i.length:0,d=o.slice(0,t+u);return Object(n.autop)(l(d,r))};t.a=e=>{let{source:t,maxLength:c=15,countType:s="words",className:l="",style:d={}}=e;const b=Object(r.useMemo)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const r=Object(n.autop)(e),s=Object(o.count)(r,c);if(s<=t)return r;const l=a(r),d=Object(o.count)(l,c);return d<=t?l:"words"===c?i(l,t):u(l,t,"characters_including_spaces"===c)}(t,c,s),[t,c,s]);return Object(r.createElement)(r.RawHTML,{style:d,className:l},b)}},,function(e,t,c){"use strict";var r=c(0),o=c(4),n=c.n(o),a=c(29),s=c(11);c(167),t.a=Object(s.withInstanceId)(e=>{let{className:t,instanceId:c,label:o="",onChange:s,options:l,screenReaderLabel:i,value:u=""}=e;const d="wc-block-components-sort-select__select-"+c;return Object(r.createElement)("div",{className:n()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(r.createElement)(a.a,{label:o,screenReaderLabel:i,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(r.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:s,value:u},l&&l.map(e=>Object(r.createElement)("option",{key:e.key,value:e.key},e.label))))})},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r=e=>"boolean"==typeof e},function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(5);const o=()=>"function"==typeof r.__experimentalGetSpacingClassesAndStyles},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(96),o=c(35);const n=e=>Object(r.a)(e)?JSON.parse(e)||{}:Object(o.a)(e)?e:{}},function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var r=c(5),o=c(61),n=c(35),a=c(126),s=c(129);const l=e=>{if(!Object(o.b)()||!Object(a.a)())return{style:{}};const t=Object(n.a)(e)?e:{},c=Object(s.a)(t.style);return Object(r.__experimentalGetSpacingClassesAndStyles)({...t,style:c})}},,,,,,,function(e,t){},function(e,t){},,,function(e,t,c){"use strict";c.r(t),c.d(t,"Block",(function(){return m}));var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(29),l=c(23),i=c(154),u=c(99),d=c(88),b=c(130),p=c(42);c(260);const m=e=>{const{className:t,align:c}=e,{parentClassName:n}=Object(l.useInnerBlockLayoutContext)(),{product:p}=Object(l.useProductDataContext)(),m=Object(i.a)(e),g=Object(u.a)(e),O=Object(d.a)(e),j=Object(b.a)(e);if(!p.id||!p.on_sale)return null;const h="string"==typeof c?"wc-block-components-product-sale-badge--align-"+c:"";return Object(r.createElement)("div",{className:a()("wc-block-components-product-sale-badge",t,h,{[n+"__product-onsale"]:n},g.className,m.className),style:{...g.style,...m.style,...O.style,...j.style}},Object(r.createElement)(s.a,{label:Object(o.__)("Sale","woocommerce"),screenReaderLabel:Object(o.__)("Product on sale","woocommerce")}))};t.default=Object(p.withProductDataContext)(m)},function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(0);const o=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(0);const o=Object(r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(r.createElement)("title",null,"Grid Block Preview"),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(3),s=c(4),l=c.n(s);c(189),t.a=function(e){let{className:t="",...c}=e;const r=l()("wc-block-text-toolbar-button",t);return Object(n.createElement)(a.Button,o()({className:r},c))}},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var r=c(5),o=c(61),n=c(35),a=c(129);const s=e=>{if(!Object(o.b)())return{className:"",style:{}};const t=Object(n.a)(e)?e:{},c=Object(a.a)(t.style);return Object(r.__experimentalUseBorderProps)({...t,style:c})}},,,,,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,function(e,t){},function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var r=c(0),o=c(7),n=c(9),a=c(15),s=c(41);const l=(e,t)=>{const c=e.find(e=>{let{id:c}=e;return c===t});return c?c.quantity:0},i=e=>{const{addItemToCart:t}=Object(o.useDispatch)(n.CART_STORE_KEY),{cartItems:c,cartIsLoading:i}=Object(s.a)(),{createErrorNotice:u,removeNotice:d}=Object(o.useDispatch)("core/notices"),[b,p]=Object(r.useState)(!1),m=Object(r.useRef)(l(c,e));return Object(r.useEffect)(()=>{const t=l(c,e);t!==m.current&&(m.current=t)},[c,e]),{cartQuantity:Number.isFinite(m.current)?m.current:0,addingToCart:b,cartIsLoading:i,addToCart:function(){let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return p(!0),t(e,c).then(()=>{d("add-to-cart")}).catch(e=>{u(Object(a.decodeEntities)(e.message),{id:"add-to-cart",context:"wc/all-products",isDismissible:!0})}).finally(()=>{p(!1)})}}}},function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r=e=>"number"==typeof e},,,,,,,,,,,,,,,,function(e,t){},,,function(e,t,c){"use strict";var r=c(6),o=c.n(r),n=c(0),a=c(22),s=c(27),l=c(117),i=c(28);t.a=e=>t=>{let{selected:c,...r}=t;const[u,d]=Object(n.useState)(!0),[b,p]=Object(n.useState)(null),[m,g]=Object(n.useState)([]),O=a.o.productCount>100,j=async e=>{const t=await Object(i.a)(e);p(t),d(!1)},h=Object(n.useRef)(c);Object(n.useEffect)(()=>{Object(s.h)({selected:h.current}).then(e=>{g(e),d(!1)}).catch(j)},[h]);const _=Object(l.a)(e=>{Object(s.h)({selected:c,search:e}).then(e=>{g(e),d(!1)}).catch(j)},400),E=Object(n.useCallback)(e=>{d(!0),_(e)},[d,_]);return Object(n.createElement)(e,o()({},r,{selected:c,error:b,products:m,isLoading:u,onSearch:O?E:null}))}},function(e,t){},,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return g}));var r=c(0),o=c(4),n=c.n(o),a=c(23),s=c(61),l=c(42),i=c(106),u=c(70),d=c(99),b=c(130),p=c(88);c(261);const m=e=>{let{children:t,headingLevel:c,elementType:o="h"+c,...n}=e;return Object(r.createElement)(o,n,t)},g=e=>{const{className:t,headingLevel:c=2,showProductLink:o=!0,linkTarget:l,align:g}=e,{parentClassName:O}=Object(a.useInnerBlockLayoutContext)(),{product:j}=Object(a.useProductDataContext)(),{dispatchStoreEvent:h}=Object(u.a)(),_=Object(d.a)(e),E=Object(b.a)(e),w=Object(p.a)(e);return j.id?Object(r.createElement)(m,{headingLevel:c,className:n()(t,_.className,"wc-block-components-product-title",{[O+"__product-title"]:O,["wc-block-components-product-title--align-"+g]:g&&Object(s.b)()}),style:Object(s.b)()?{...E.style,...w.style,..._.style}:{}},Object(r.createElement)(i.a,{disabled:!o,name:j.name,permalink:j.permalink,target:l,onClick:()=>{h("product-view-link",{product:j})}})):Object(r.createElement)(m,{headingLevel:c,className:n()(t,_.className,"wc-block-components-product-title",{[O+"__product-title"]:O,["wc-block-components-product-title--align-"+g]:g&&Object(s.b)()}),style:Object(s.b)()?{...E.style,...w.style,..._.style}:{}})};t.b=Object(l.withProductDataContext)(g)},function(e,t,c){"use strict";c.d(t,"a",(function(){return j}));var r=c(6),o=c.n(r),n=c(0),a=c(1),s=c(4),l=c.n(s),i=c(2),u=c(23),d=c(88),b=c(154),p=c(130),m=c(42),g=c(70),O=c(141);c(262);const j=e=>{const{className:t,imageSizing:c="full-size",showProductLink:r=!0,showSaleBadge:o,saleBadgeAlign:s="right"}=e,{parentClassName:i}=Object(u.useInnerBlockLayoutContext)(),{product:m,isLoading:j}=Object(u.useProductDataContext)(),{dispatchStoreEvent:E}=Object(g.a)(),w=Object(d.a)(e),f=Object(b.a)(e),k=Object(p.a)(e);if(!m.id)return Object(n.createElement)("div",{className:l()(t,"wc-block-components-product-image",{[i+"__product-image"]:i},f.className),style:{...w.style,...f.style,...k.style}},Object(n.createElement)(h,null));const y=!!m.images.length,v=y?m.images[0]:null,S=r?"a":n.Fragment,C=Object(a.sprintf)(
|
15 |
/* translators: %s is referring to the product name */
|
16 |
+
Object(a.__)("Link to %s","woocommerce"),m.name),x={href:m.permalink,...!y&&{"aria-label":C},onClick:()=>{E("product-view-link",{product:m})}};return Object(n.createElement)("div",{className:l()(t,"wc-block-components-product-image",{[i+"__product-image"]:i},f.className),style:{...w.style,...f.style,...k.style}},Object(n.createElement)(S,r&&x,!!o&&Object(n.createElement)(O.default,{align:s,product:m}),Object(n.createElement)(_,{fallbackAlt:m.name,image:v,loaded:!j,showFullSize:"cropped"!==c})))},h=()=>Object(n.createElement)("img",{src:i.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500}),_=e=>{let{image:t,loaded:c,showFullSize:r,fallbackAlt:a}=e;const{thumbnail:s,src:l,srcset:i,sizes:u,alt:d}=t||{},b={alt:d||a,hidden:!c,src:s,...r&&{src:l,srcSet:i,sizes:u}};return Object(n.createElement)(n.Fragment,null,b.src&&Object(n.createElement)("img",o()({"data-testid":"product-image"},b)),!t&&Object(n.createElement)(h,null))};t.b=Object(m.withProductDataContext)(j)},function(e,t){},,,,,,,,,,,,,function(e,t,c){"use strict";var r=c(0),o=c(4),n=c.n(o),a=c(1),s=c(40),l=c(359),i=c(7),u=c(9);const d={PRISTINE:"pristine",IDLE:"idle",DISABLED:"disabled",PROCESSING:"processing",BEFORE_PROCESSING:"before_processing",AFTER_PROCESSING:"after_processing"},b={status:d.PRISTINE,hasError:!1,quantity:0,processingResponse:null,requestParams:{}},p={SET_PRISTINE:"set_pristine",SET_IDLE:"set_idle",SET_DISABLED:"set_disabled",SET_PROCESSING:"set_processing",SET_BEFORE_PROCESSING:"set_before_processing",SET_AFTER_PROCESSING:"set_after_processing",SET_PROCESSING_RESPONSE:"set_processing_response",SET_HAS_ERROR:"set_has_error",SET_NO_ERROR:"set_no_error",SET_QUANTITY:"set_quantity",SET_REQUEST_PARAMS:"set_request_params"},{SET_PRISTINE:m,SET_IDLE:g,SET_DISABLED:O,SET_PROCESSING:j,SET_BEFORE_PROCESSING:h,SET_AFTER_PROCESSING:_,SET_PROCESSING_RESPONSE:E,SET_HAS_ERROR:w,SET_NO_ERROR:f,SET_QUANTITY:k,SET_REQUEST_PARAMS:y}=p,v=()=>({type:g}),S=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=e?w:f;return{type:t}},{SET_PRISTINE:C,SET_IDLE:x,SET_DISABLED:N,SET_PROCESSING:P,SET_BEFORE_PROCESSING:T,SET_AFTER_PROCESSING:I,SET_PROCESSING_RESPONSE:R,SET_HAS_ERROR:A,SET_NO_ERROR:B,SET_QUANTITY:L,SET_REQUEST_PARAMS:D}=p,{PRISTINE:F,IDLE:V,DISABLED:z,PROCESSING:M,BEFORE_PROCESSING:q,AFTER_PROCESSING:H}=d,G=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,{quantity:c,type:r,data:o}=arguments.length>1?arguments[1]:void 0;switch(r){case C:e=b;break;case x:e=t.status!==V?{...t,status:V}:t;break;case N:e=t.status!==z?{...t,status:z}:t;break;case L:e=c!==t.quantity?{...t,quantity:c}:t;break;case D:e={...t,requestParams:{...t.requestParams,...o}};break;case R:e={...t,processingResponse:o};break;case P:e=t.status!==M?{...t,status:M,hasError:!1}:t,e=!1===e.hasError?e:{...e,hasError:!1};break;case T:e=t.status!==q?{...t,status:q,hasError:!1}:t;break;case I:e=t.status!==H?{...t,status:H}:t;break;case A:e=t.hasError?t:{...t,hasError:!0},e=t.status===M||t.status===q?{...e,status:V}:e;break;case B:e=t.hasError?{...t,hasError:!1}:t}return e!==t&&r!==C&&e.status===F&&(e.status=V),e};var Q=c(98),Y=c(268);const U=e=>({onAddToCartAfterProcessingWithSuccess:Object(Y.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(Y.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(Y.a)("add_to_cart_before_processing",e)});var W=c(317),K=c(58);const $=Object(r.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:e=>{},onAddToCartAfterProcessingWithError:e=>{},onAddToCartBeforeProcessing:e=>{}},dispatchActions:{resetForm:()=>{},submitForm:()=>{},setQuantity:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},setRequestParams:e=>{}}}),J=()=>Object(r.useContext)($),X=e=>{var t,c,o,n;let{children:p,product:g,showFormElements:w}=e;const[f,C]=Object(r.useReducer)(G,b),[x,N]=Object(r.useReducer)(Q.b,{}),P=Object(s.a)(x),{createErrorNotice:T}=Object(i.useDispatch)("core/notices"),{setValidationErrors:I}=Object(i.useDispatch)(u.VALIDATION_STORE_KEY),R=Object(r.useMemo)(()=>({onAddToCartAfterProcessingWithSuccess:U(N).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:U(N).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:U(N).onAddToCartBeforeProcessing}),[N]),A=Object(r.useMemo)(()=>({resetForm:()=>{C({type:m})},submitForm:()=>{C({type:h})},setQuantity:e=>{C((e=>({type:k,quantity:e}))(e))},setHasError:e=>{C(S(e))},setRequestParams:e=>{C((e=>({type:y,data:e}))(e))},setAfterProcessing:e=>{C({type:E,data:e}),C({type:_})}}),[]);Object(r.useEffect)(()=>{const e=f.status,t=!g.id||!Object(l.a)(g);e!==d.DISABLED||t?e!==d.DISABLED&&t&&C({type:O}):C(v())},[f.status,g,C]),Object(r.useEffect)(()=>{f.status===d.BEFORE_PROCESSING&&(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const c=Object(i.select)("core/notices").getNotices(),{removeNotice:r}=Object(i.dispatch)("core/notices"),o=c.filter(t=>t.status===e);o.forEach(e=>r(e.id,t))}("error","wc/add-to-cart"),Object(W.a)(P,"add_to_cart_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:c}=e;t&&T(t,{context:"wc/add-to-cart"}),c&&I(c)}),C(v())):C({type:j})}))},[f.status,I,T,C,P,null==g?void 0:g.id]),Object(r.useEffect)(()=>{if(f.status===d.AFTER_PROCESSING){const e={processingResponse:f.processingResponse},t=e=>{let t=!1;return e.forEach(e=>{const{message:c,messageContext:r}=e;(Object(K.b)(e)||Object(K.c)(e))&&c&&(t=!0,T(c,r?{context:r}:void 0))}),t};if(f.hasError)return void Object(W.b)(P,"add_to_cart_after_processing_with_error",e).then(c=>{if(!t(c)){var r;const t=(null===(r=e.processingResponse)||void 0===r?void 0:r.message)||Object(a.__)("Something went wrong. Please contact us for assistance.","woocommerce");T(t,{id:"add-to-cart",context:"woocommerce/single-product/"+((null==g?void 0:g.id)||0)})}C(v())});Object(W.b)(P,"add_to_cart_after_processing_with_success",e).then(e=>{t(e)?C(S(!0)):C(v())})}},[f.status,f.hasError,f.processingResponse,A,T,P,null==g?void 0:g.id]);const B=Object(l.b)(g),L={product:g,productType:g.type||"simple",productIsPurchasable:Object(l.a)(g),productHasOptions:g.has_options||!1,supportsFormElements:B,showFormElements:w&&B,quantity:f.quantity||(null==g||null===(t=g.add_to_cart)||void 0===t?void 0:t.minimum)||1,minQuantity:(null==g||null===(c=g.add_to_cart)||void 0===c?void 0:c.minimum)||1,maxQuantity:(null==g||null===(o=g.add_to_cart)||void 0===o?void 0:o.maximum)||99,multipleOf:(null==g||null===(n=g.add_to_cart)||void 0===n?void 0:n.multiple_of)||1,requestParams:f.requestParams,isIdle:f.status===d.IDLE,isDisabled:f.status===d.DISABLED,isProcessing:f.status===d.PROCESSING,isBeforeProcessing:f.status===d.BEFORE_PROCESSING,isAfterProcessing:f.status===d.AFTER_PROCESSING,hasError:f.hasError,eventRegistration:R,dispatchActions:A};return Object(r.createElement)($.Provider,{value:L},p)};var Z=c(14),ee=c.n(Z),te=c(15),ce=c(266),re=c(41),oe=()=>{const{dispatchActions:e,product:t,quantity:c,eventRegistration:o,hasError:n,isProcessing:s,requestParams:l}=J(),{showAllValidationErrors:d}=Object(i.useDispatch)(u.VALIDATION_STORE_KEY),b=Object(i.useSelect)(e=>e(u.VALIDATION_STORE_KEY).hasValidationErrors),{createErrorNotice:p,removeNotice:m}=Object(i.useDispatch)("core/notices"),{receiveCart:g}=Object(re.a)(),[O,j]=Object(r.useState)(!1),h=!n&&s,_=Object(r.useCallback)(()=>!b()||(d(),{type:"error"}),[b,d]);Object(r.useEffect)(()=>{const e=o.onAddToCartBeforeProcessing(_,0);return()=>{e()}},[o,_]);const E=Object(r.useCallback)(()=>{j(!0),m("add-to-cart","woocommerce/single-product/"+((null==t?void 0:t.id)||0));const r={id:t.id||0,quantity:c,...l};ee()({path:"/wc/store/v1/cart/add-item",method:"POST",data:r,cache:"no-store",parse:!1}).then(c=>{ee.a.setNonce(c.headers),c.json().then((function(r){c.ok?g(r):(r.body&&r.body.message?p(Object(te.decodeEntities)(r.body.message),{id:"add-to-cart",context:"woocommerce/single-product/"+((null==t?void 0:t.id)||0)}):p(Object(a.__)("Something went wrong. Please contact us for assistance.","woocommerce"),{id:"add-to-cart",context:"woocommerce/single-product/"+((null==t?void 0:t.id)||0)}),e.setHasError()),Object(ce.b)({preserveCartData:!0}),e.setAfterProcessing(r),j(!1)}))}).catch(t=>{t.json().then((function(t){var c;null!==(c=t.data)&&void 0!==c&&c.cart&&g(t.data.cart),e.setHasError(),e.setAfterProcessing(t),j(!1)}))})},[t,p,m,g,e,c,l]);return Object(r.useEffect)(()=>{h&&!O&&E()},[h,E,O]),null};const ne=e=>{let{children:t,product:c,showFormElements:o}=e;return Object(r.createElement)(X,{product:c,showFormElements:o},t,Object(r.createElement)(oe,null))};var ae=c(23),se=c(8),le=c(42),ie=(c(236),c(59)),ue=c(118),de=c(546),be=c(70),pe=c(168);const me=e=>{let{className:t,href:c,text:o,onClick:n}=e;return Object(r.createElement)(ie.a,{className:t,href:c,onClick:n,rel:"nofollow"},o)},ge=e=>{let{className:t,quantityInCart:c,isProcessing:o,isDisabled:n,isDone:s,onClick:l}=e;return Object(r.createElement)(ie.a,{className:t,disabled:n,showSpinner:o,onClick:l},s&&c>0?Object(a.sprintf)(
|
17 |
/* translators: %s number of products in cart. */
|
18 |
+
Object(a._n)("%d in cart","%d in cart",c,"woocommerce"),c):Object(a.__)("Add to cart","woocommerce"),!!s&&Object(r.createElement)(ue.a,{icon:de.a}))};var Oe=()=>{const{showFormElements:e,productIsPurchasable:t,productHasOptions:c,product:o,productType:n,isDisabled:s,isProcessing:l,eventRegistration:i,hasError:u,dispatchActions:d}=J(),{parentName:b}=Object(ae.useInnerBlockLayoutContext)(),{dispatchStoreEvent:p}=Object(be.a)(),{cartQuantity:m}=Object(pe.a)(o.id||0),[g,O]=Object(r.useState)(!1),j=o.add_to_cart||{url:"",text:""};return Object(r.useEffect)(()=>{const e=i.onAddToCartAfterProcessingWithSuccess(()=>(u||O(!0),!0),0);return()=>{e()}},[i,u]),(e||!c&&"simple"===n)&&t?Object(r.createElement)(ge,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:m,isDisabled:s,isProcessing:l,isDone:g,onClick:()=>{d.submitForm("woocommerce/single-product/"+((null==o?void 0:o.id)||0)),p("cart-add-item",{product:o,listName:b})}}):Object(r.createElement)(me,{className:"wc-block-components-product-add-to-cart-button",href:j.url,text:j.text||Object(a.__)("View Product","woocommerce"),onClick:()=>{p("product-view-link",{product:o,listName:b})}})},je=c(117),he=e=>{let{disabled:t,min:c,max:o,step:n=1,value:a,onChange:s}=e;const l=void 0!==o,i=Object(je.a)(e=>{let t=e;l&&(t=Math.min(t,Math.floor(o/n)*n)),t=Math.max(t,Math.ceil(c/n)*n),t=Math.floor(t/n)*n,t!==e&&s(t)},300);return Object(r.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:a,min:c,max:o,step:n,hidden:1===o,disabled:t,onChange:e=>{s(e.target.value),i(e.target.value)}})},_e=e=>{let{reason:t=Object(a.__)("Sorry, this product cannot be purchased.","woocommerce")}=e;return Object(r.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},t)},Ee=()=>{const{product:e,quantity:t,minQuantity:c,maxQuantity:o,multipleOf:n,dispatchActions:s,isDisabled:l}=J();return e.id&&!e.is_purchasable?Object(r.createElement)(_e,null):e.id&&!e.is_in_stock?Object(r.createElement)(_e,{reason:Object(a.__)("This product is currently out of stock and cannot be purchased.","woocommerce")}):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(he,{value:t,min:c,max:o,step:n,disabled:l,onChange:s.setQuantity}),Object(r.createElement)(Oe,null))},we=(c(265),c(563)),fe=c(12),ke=c(67);const ye={value:"",label:Object(a.__)("Select an option","woocommerce")};var ve=e=>{let{attributeName:t,options:c=[],value:o="",onChange:s=(()=>{}),errorMessage:l=Object(a.__)("Please select a value.","woocommerce")}=e;const d=t,{setValidationErrors:b,clearValidationError:p}=Object(i.useDispatch)(u.VALIDATION_STORE_KEY),{error:m}=Object(i.useSelect)(e=>({error:e(u.VALIDATION_STORE_KEY).getValidationError(d)||{}}));return Object(fe.useEffect)(()=>{o?p(d):b({[d]:{message:l,hidden:!0}})},[o,d,l,p,b]),Object(fe.useEffect)(()=>()=>{p(d)},[d,p]),Object(r.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(r.createElement)(we.a,{label:Object(te.decodeEntities)(t),value:o||"",options:[ye,...c],onChange:s,required:!0,className:n()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":(null==m?void 0:m.message)&&!(null!=m&&m.hidden)})}),Object(r.createElement)(ke.a,{propertyName:d,elementId:d}))},Se=c(35);const Ce=(e,t,c)=>{const r=Object.values(t).map(e=>{let{id:t}=e;return t});if(Object.values(c).every(e=>""===e))return r;const o=Object.keys(e);return r.filter(e=>o.every(r=>{const o=c[r]||"",n=t["id:"+e].attributes[r];return""===o||null===n||n===o}))};var xe=e=>{let{attributes:t,variationAttributes:c,setRequestParams:o}=e;const n=Object(s.a)(t),a=Object(s.a)(c),[l,i]=Object(r.useState)(0),[u,d]=Object(r.useState)({}),[b,p]=Object(r.useState)(!1),m=Object(r.useMemo)(()=>((e,t,c)=>{const r={},o=Object.keys(e),n=Object.values(c).filter(Boolean).length>0;return o.forEach(o=>{const a=e[o],s={...c,[o]:null},l=n?Ce(e,t,s):null,i=null!==l?l.map(e=>t["id:"+e].attributes[o]):null;r[o]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map(e=>{let{name:c,slug:r}=e;return null===t||t.includes(null)||t.includes(r)?{value:r,label:Object(te.decodeEntities)(c)}:null}).filter(Boolean)}(a.terms,i)}),r})(n,a,u),[u,n,a]);return Object(r.useEffect)(()=>{if(!b){const e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(Se.a)(e))return{};const t=Object.keys(e),c={};return 0===t.length||t.forEach(t=>{const r=e[t],o=r.terms.filter(e=>e.default);var n;o.length>0&&(c[r.name]=null===(n=o[0])||void 0===n?void 0:n.slug)}),c}(t);e&&d({...e}),p(!0)}},[u,t,b]),Object(r.useEffect)(()=>{Object.values(u).filter(e=>""!==e).length===Object.keys(n).length?i(((e,t,c)=>Ce(e,t,c)[0]||0)(n,a,u)):l>0&&i(0)},[u,l,n,a]),Object(r.useEffect)(()=>{o({id:l,variation:Object.keys(u).map(e=>({attribute:e,value:u[e]}))})},[o,l,u]),Object(r.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(n).map(e=>Object(r.createElement)(ve,{key:e,attributeName:e,options:m[e],value:u[e],onChange:t=>{d({...u,[e]:t})}})))},Ne=e=>{let{product:t,dispatchers:c}=e;const o=(e=>e?Object(se.keyBy)(Object.values(e).filter(e=>{let{has_variations:t}=e;return t}),"name"):{})(t.attributes),n=(e=>{if(!e)return{};const t={};return e.forEach(e=>{let{id:c,attributes:r}=e;t["id:"+c]={id:c,attributes:r.reduce((e,t)=>{let{name:c,value:r}=t;return e[c]=r,e},{})}}),t})(t.variations);return 0===Object.keys(o).length||0===n.length?null:Object(r.createElement)(xe,{attributes:o,variationAttributes:n,setRequestParams:c.setRequestParams})},Pe=()=>{const{product:e,quantity:t,minQuantity:c,maxQuantity:o,multipleOf:n,dispatchActions:s,isDisabled:l}=J();return e.id&&!e.is_purchasable?Object(r.createElement)(_e,null):e.id&&!e.is_in_stock?Object(r.createElement)(_e,{reason:Object(a.__)("This product is currently out of stock and cannot be purchased.","woocommerce")}):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Ne,{product:e,dispatchers:s}),Object(r.createElement)(he,{value:t,min:c,max:o,step:n,disabled:l,onChange:s.setQuantity}),Object(r.createElement)(Oe,null))},Te=()=>Object(r.createElement)(Oe,null),Ie=c(548),Re=()=>Object(r.createElement)(Ie.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element."),Ae=()=>Object(r.createElement)(Re,null);const Be=()=>{const{showFormElements:e,productType:t}=J();return e?"variable"===t?Object(r.createElement)(Pe,null):"grouped"===t?Object(r.createElement)(Ae,null):"external"===t?Object(r.createElement)(Te,null):"simple"===t||"variation"===t?Object(r.createElement)(Ee,null):null:Object(r.createElement)(Oe,null)};t.a=Object(le.withProductDataContext)(e=>{let{className:t,showFormElements:c}=e;const{product:o}=Object(ae.useProductDataContext)(),a=n()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(se.isEmpty)(o)});return Object(r.createElement)(ne,{product:o,showFormElements:c},Object(r.createElement)("div",{className:a},Object(r.createElement)(Be,null)))})},function(e,t,c){"use strict";c.r(t),c.d(t,"Block",(function(){return b}));var r=c(0),o=c(4),n=c.n(o),a=c(80),s=c(26),l=c(23),i=c(99),u=c(88),d=c(42);const b=e=>{var t,c;const{className:o,textAlign:d}=e,{parentClassName:b}=Object(l.useInnerBlockLayoutContext)(),{product:p}=Object(l.useProductDataContext)(),m=Object(i.a)(e),g=Object(u.a)(e),O=n()("wc-block-components-product-price",o,m.className,{[b+"__product-price"]:b}),j={...g.style,...m.style};if(!p.id)return Object(r.createElement)(a.a,{align:d,className:O});const h=p.prices,_=Object(s.getCurrencyFromPriceResponse)(h),E=h.price!==h.regular_price,w=n()({[b+"__product-price__value"]:b,[b+"__product-price__value--on-sale"]:E});return Object(r.createElement)(a.a,{align:d,className:O,priceStyle:j,regularPriceStyle:j,priceClassName:w,currency:_,price:h.price,minPrice:null==h||null===(t=h.price_range)||void 0===t?void 0:t.min_amount,maxPrice:null==h||null===(c=h.price_range)||void 0===c?void 0:c.max_amount,regularPrice:h.regular_price,regularPriceClassName:n()({[b+"__product-price__regular"]:b})})};t.default=Object(d.withProductDataContext)(b)},function(e,t,c){"use strict";c.r(t),c.d(t,"Block",(function(){return b}));var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(23),l=c(99),i=c(88),u=c(130),d=c(42);c(263);const b=e=>{const{parentClassName:t}=Object(s.useInnerBlockLayoutContext)(),{product:c}=Object(s.useProductDataContext)(),n=p(c),d=Object(l.a)(e),b=Object(i.a)(e),g=Object(u.a)(e);if(!n)return null;const O={width:n/5*100+"%"},j=Object(o.sprintf)(
|
19 |
/* translators: %f is referring to the average rating value */
|
20 |
Object(o.__)("Rated %f out of 5","woocommerce"),n),h=m(c),_={__html:Object(o.sprintf)(
|
21 |
/* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
|
22 |
+
Object(o._n)("Rated %1$s out of 5 based on %2$s customer rating","Rated %1$s out of 5 based on %2$s customer ratings",h,"woocommerce"),Object(o.sprintf)('<strong class="rating">%f</strong>',n),Object(o.sprintf)('<span class="rating">%d</span>',h))};return Object(r.createElement)("div",{className:a()(d.className,"wc-block-components-product-rating",{[t+"__product-rating"]:t}),style:{...d.style,...b.style,...g.style}},Object(r.createElement)("div",{className:a()("wc-block-components-product-rating__stars",t+"__product-rating__stars"),role:"img","aria-label":j},Object(r.createElement)("span",{style:O,dangerouslySetInnerHTML:_})))},p=e=>{const t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0},m=e=>{const t=parseInt(e.review_count,10);return Number.isFinite(t)&&t>0?t:0};t.default=Object(d.withProductDataContext)(b)},function(e,t,c){"use strict";c.r(t),c.d(t,"Block",(function(){return E}));var r=c(6),o=c.n(r),n=c(0),a=c(4),s=c.n(a),l=c(1),i=c(70),u=c(168),d=c(99),b=c(154),p=c(88),m=c(130),g=c(15),O=c(22),j=c(2),h=c(23),_=c(42);c(264);const E=e=>{const{className:t}=e,{parentClassName:c}=Object(h.useInnerBlockLayoutContext)(),{product:r}=Object(h.useProductDataContext)(),o=Object(d.a)(e),a=Object(b.a)(e),l=Object(p.a)(e),i=Object(m.a)(e);return Object(n.createElement)("div",{className:s()(t,"wp-block-button","wc-block-components-product-button",{[c+"__product-add-to-cart"]:c})},r.id?Object(n.createElement)(w,{product:r,colorStyles:o,borderStyles:a,typographyStyles:l,spacingStyles:i}):Object(n.createElement)(f,{colorStyles:o,borderStyles:a,typographyStyles:l,spacingStyles:i}))},w=e=>{let{product:t,colorStyles:c,borderStyles:r,typographyStyles:a,spacingStyles:d}=e;const{id:b,permalink:p,add_to_cart:m,has_options:h,is_purchasable:_,is_in_stock:E}=t,{dispatchStoreEvent:w}=Object(i.a)(),{cartQuantity:f,addingToCart:k,addToCart:y}=Object(u.a)(b,"woocommerce/single-product/"+(b||0)),v=Number.isFinite(f)&&f>0,S=!h&&_&&E,C=Object(g.decodeEntities)((null==m?void 0:m.description)||""),x=v?Object(l.sprintf)(
|
23 |
/* translators: %s number of products in cart. */
|
24 |
+
Object(l._n)("%d in cart","%d in cart",f,"woocommerce"),f):Object(g.decodeEntities)((null==m?void 0:m.text)||Object(l.__)("Add to cart","woocommerce")),N=S?"button":"a",P={};return S?P.onClick=async()=>{await y(),w("cart-add-item",{product:t});const{cartRedirectAfterAdd:e}=Object(j.getSetting)("productsSettings");e&&(window.location.href=O.d)}:(P.href=p,P.rel="nofollow",P.onClick=()=>{w("product-view-link",{product:t})}),Object(n.createElement)(N,o()({"aria-label":C,className:s()("wp-block-button__link","wp-element-button","add_to_cart_button","wc-block-components-product-button__button",c.className,r.className,{loading:k,added:v}),style:{...c.style,...r.style,...a.style,...d.style},disabled:k},P),x)},f=e=>{let{colorStyles:t,borderStyles:c,typographyStyles:r,spacingStyles:o}=e;return Object(n.createElement)("button",{className:s()("wp-block-button__link","wp-element-button","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder",t.className,c.className),style:{...t.style,...c.style,...r.style,...o.style},disabled:!0})};t.default=Object(_.withProductDataContext)(E)},,,,,,,,,,function(e){e.exports=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":1,"textdomain":"woocommerce","name":"woocommerce/all-products","title":"All Products","category":"woocommerce","keywords":["WooCommerce"],"description":"Display products from your store in a grid layout.","supports":{"align":["wide","full"],"html":false,"multiple":false},"example":{"attributes":{"isPreview":true}},"attributes":{"columns":{"type":"number"},"rows":{"type":"number"},"alignButtons":{"type":"boolean"},"contentVisibility":{"type":"object"},"orderby":{"type":"string"},"layoutConfig":{"type":"array"},"isPreview":{"type":"boolean","default":false}}}')},,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(180);const o=["a","b","em","i","strong","p","br"],n=["target","href","rel","name","download"],a=(e,t)=>{const c=(null==t?void 0:t.tags)||o,a=(null==t?void 0:t.attr)||n;return Object(r.sanitize)(e,{ALLOWED_TAGS:c,ALLOWED_ATTR:a})}},,,function(e,t){},,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var r=c(108),o=c(9),n=c(7),a=c(40);const s=e=>{const t={namespace:"/wc/store/v1",resourceName:"products"},{results:c,isLoading:s}=Object(r.a)({...t,query:e}),{value:l}=((e,t)=>{const{namespace:c,resourceName:r,resourceValues:s=[],query:l={}}=t;if(!c||!r)throw new Error("The options object must have valid values for the namespace and the resource name properties.");const i=Object(a.a)(l),u=Object(a.a)(s),{value:d,isLoading:b=!0}=Object(n.useSelect)(e=>{const t=e(o.COLLECTIONS_STORE_KEY),n=["x-wp-total",c,r,i,u];return{value:t.getCollectionHeader(...n),isLoading:t.hasFinishedResolution("getCollectionHeader",n)}},["x-wp-total",c,r,u,i]);return{value:d,isLoading:b}})(0,{...t,query:e});return{products:c,totalProducts:parseInt(l,10),productsLoading:s}}},,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return p}));var r=c(6),o=c.n(r),n=c(0),a=c(4),s=c.n(a),l=c(314),i=c(233),u=c(7),d=c(9);c(196);const b=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""},p=e=>{let{className:t,context:c="default",additionalNotices:r=[]}=e;const a=Object(u.useSelect)(e=>e(d.PAYMENT_STORE_KEY).isExpressPaymentMethodActive()),{notices:p}=Object(u.useSelect)(e=>({notices:e("core/notices").getNotices(c)})),{removeNotice:m}=Object(u.useDispatch)("core/notices"),g=p.filter(e=>"snackbar"!==e.type).concat(r);if(!g.length)return null;const O=s()(t,"wc-block-components-notices");return a?null:Object(n.createElement)("div",{className:O},g.map(e=>Object(n.createElement)(l.a,o()({key:"store-notice-"+e.id},e,{className:s()("wc-block-components-notices__notice",b(e)),onRemove:()=>{e.isDismissible&&m(e.id,c)}}),Object(i.a)(e.content))))}},,,,,,,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,c){"use strict";c.d(t,"c",(function(){return a})),c.d(t,"b",(function(){return s})),c.d(t,"a",(function(){return l}));const r=window.CustomEvent||null,o=(e,t)=>{let{bubbles:c=!1,cancelable:o=!1,element:n,detail:a={}}=t;if(!r)return;n||(n=document.body);const s=new r(e,{bubbles:c,cancelable:o,detail:a});n.dispatchEvent(s)};let n;const a=()=>{n&&clearTimeout(n),n=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},s=e=>{let{preserveCartData:t=!1}=e;o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},l=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const n=()=>{o(t,{bubbles:c,cancelable:r})};return jQuery(document).on(e,n),()=>jQuery(document).off(e,n)}},function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(94),o=(c(16),c(2));const n=e=>{const t=Object.keys(o.defaultAddressFields),c=Object(r.a)(t,{},e.country),n=Object.assign({},e);return c.forEach(t=>{let{key:c="",hidden:r=!1}=t;r&&((e,t)=>e in t)(c,e)&&(n[c]="")}),n}},function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var r=c(98);const o=(e,t)=>function(c){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const n=r.a.addEventCallback(e,c,o);return t(n),()=>{t(r.a.removeEventCallback(e,n.id))}}},,,,,,,,,,function(e,t,c){"use strict";var r=c(0),o=c(13);const n=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.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=n},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";var r=c(61);let o={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},linkTarget:{type:"string"},productId:{type:"number",default:0}};Object(r.b)()&&(o={...o,align:{type:"string"}}),t.a=o},function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));const r={showProductLink:{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},isDescendentOfQueryLoop:{type:"boolean",default:!1}}},function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return n}));var r=c(58);const o=async(e,t,c)=>{const o=Object(r.a)(e,t),n=[];for(const e of o)try{const t=await Promise.resolve(e.callback(c));"object"==typeof t&&n.push(t)}catch(e){console.error(e)}return!n.length||n},n=async(e,t,c)=>{const o=[],n=Object(r.a)(e,t);for(const e of n)try{const t=await Promise.resolve(e.callback(c));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(r.b)(t)||Object(r.c)(t))return o.push(t),o;o.push(t)}catch(e){return console.error(e),o.push({type:"error"}),o}return o}},function(e,t,c){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},,,,,,,,,function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(4),n=c.n(o),a=c(120),s=c(22),l=c(23),i=c(99),u=c(88),d=c(42);c(354),t.default=Object(d.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(l.useInnerBlockLayoutContext)(),{product:o}=Object(l.useProductDataContext)(),d=Object(i.a)(e),b=Object(u.a)(e);if(!o)return Object(r.createElement)("div",{className:n()(t,"wc-block-components-product-summary",{[c+"__product-summary"]:c})});const p=o.short_description?o.short_description:o.description;return p?Object(r.createElement)(a.a,{className:n()(t,d.className,"wc-block-components-product-summary",{[c+"__product-summary"]:c}),source:p,maxLength:150,countType:s.o.wordCountType||"words",style:{...d.style,...b.style}}):null})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(23),l=c(42);c(355),t.default=Object(l.withProductDataContext)(e=>{let{className:t}=e;const{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),l=n.sku;return l?Object(r.createElement)("div",{className:a()(t,"wc-block-components-product-sku",{[c+"__product-sku"]:c})},Object(o.__)("SKU:","woocommerce")," ",Object(r.createElement)("strong",null,l)):null})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(23),l=c(99),i=c(88),u=c(8),d=c(42);c(356),t.default=Object(d.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),d=Object(l.a)(e),b=Object(i.a)(e);return Object(u.isEmpty)(n.categories)?null:Object(r.createElement)("div",{className:a()(t,"wc-block-components-product-category-list",d.className,{[c+"__product-category-list"]:c}),style:{...d.style,...b.style}},Object(o.__)("Categories:","woocommerce")," ",Object(r.createElement)("ul",null,Object.values(n.categories).map(e=>{let{name:t,link:c,slug:o}=e;return Object(r.createElement)("li",{key:"category-list-item-"+o},Object(r.createElement)("a",{href:c},t))})))})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(23),l=c(99),i=c(88),u=c(8),d=c(42);c(357),t.default=Object(d.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),d=Object(l.a)(e),b=Object(i.a)(e);return Object(u.isEmpty)(n.tags)?null:Object(r.createElement)("div",{className:a()(t,d.className,"wc-block-components-product-tag-list",{[c+"__product-tag-list"]:c}),style:{...d.style,...b.style}},Object(o.__)("Tags:","woocommerce")," ",Object(r.createElement)("ul",null,Object.values(n.tags).map(e=>{let{name:t,link:c,slug:o}=e;return Object(r.createElement)("li",{key:"tag-list-item-"+o},Object(r.createElement)("a",{href:c},t))})))})},function(e,t,c){"use strict";c.r(t);var r=c(0),o=c(1),n=c(4),a=c.n(n),s=c(23),l=c(99),i=c(88),u=c(42);c(358);t.default=Object(u.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),u=Object(l.a)(e),d=Object(i.a)(e);if(!n.id||!n.is_purchasable)return null;const b=!!n.is_in_stock,p=n.low_stock_remaining,m=n.is_on_backorder;return Object(r.createElement)("div",{className:a()(t,u.className,"wc-block-components-product-stock-indicator",{[c+"__stock-indicator"]:c,"wc-block-components-product-stock-indicator--in-stock":b,"wc-block-components-product-stock-indicator--out-of-stock":!b,"wc-block-components-product-stock-indicator--low-stock":!!p,"wc-block-components-product-stock-indicator--available-on-backorder":!!m}),style:{...u.style,...d.style}},p?(e=>Object(o.sprintf)(
|
25 |
/* translators: %d stock amount (number of items in stock for product) */
|
26 |
+
Object(o.__)("%d left in stock","woocommerce"),e))(p):((e,t)=>t?Object(o.__)("Available on backorder","woocommerce"):e?Object(o.__)("In Stock","woocommerce"):Object(o.__)("Out of Stock","woocommerce"))(b,m))})},,,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return o}));const r=e=>e.is_purchasable||!1,o=e=>["simple","variable"].includes(e.type||"simple")},,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(1),o=c(22);const n=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:Object(r.__)("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!","woocommerce"),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:o.m+"previews/pennant.jpg",thumbnail:o.m+"previews/pennant.jpg",name:"pennant-1.jpg",alt:"WordPress Pennant",srcset:"",sizes:""}],average_rating:5,categories:[{id:1,name:"Decor",slug:"decor",link:"https://example.org"}],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(r.__)("Add to cart","woocommerce"),description:Object(r.__)("Add to cart","woocommerce")},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},,,,,,,,,,function(e,t,c){e.exports=c(479)},function(e,t){},function(e,t){},function(e,t){},,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.r(t),c.d(t,"metadata",(function(){return ot})),c.d(t,"name",(function(){return Yt}));var r=c(0),o=c(10),n=c(118),a=c(538),s=c(61),l=c(1),i=c(4),u=c.n(i),d={category:"woocommerce-product-elements",keywords:[Object(l.__)("WooCommerce","woocommerce")],icon:{src:Object(r.createElement)(n.a,{icon:a.a,className:"wc-block-editor-components-block-icon"})},supports:{html:!1},parent:["@woocommerce/all-products","@woocommerce/single-product"],save:e=>{let{attributes:t}=e;return t.isDescendentOfQueryLoop?null:Object(r.createElement)("div",{className:u()("is-loading",t.className)})},deprecated:[{attributes:{},save:()=>null}]},b=c(315),p=c(3),m=c(11),g=c(5),O=c(8),j=c(13);function h(e){let{level:t}=e;const c={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 c.hasOwnProperty(t)?Object(r.createElement)(j.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(j.Path,{d:c[t]})):null}class _ extends r.Component{createLevelControl(e,t,c){const o=e===t;return{icon:Object(r.createElement)(h,{level:e}),title:Object(l.sprintf)(
|
27 |
/* translators: %s: heading level e.g: "2", "3", "4" */
|
28 |
+
Object(l.__)("Heading %d","woocommerce"),e),isActive:o,onClick:()=>c(e)}}render(){const{isCollapsed:e=!0,minLevel:t,maxLevel:c,selectedLevel:o,onChange:n}=this.props;return Object(r.createElement)(p.ToolbarGroup,{isCollapsed:e,icon:Object(r.createElement)(h,{level:o}),controls:Object(O.range)(t,c).map(e=>this.createLevelControl(e,o,n))})}}var E=_,w=c(194),f=c(97),k=c(151),y=c(23);c(393);var v=e=>t=>c=>{const o=Object(y.useProductDataContext)(),{attributes:n,setAttributes:a}=c,{productId:s}=n,[i,u]=Object(r.useState)(!s);return o.hasContext?Object(r.createElement)(t,c):Object(r.createElement)(r.Fragment,null,i?Object(r.createElement)(p.Placeholder,{icon:e.icon||"",label:e.label||"",className:"wc-atomic-blocks-product"},!!e.description&&Object(r.createElement)("div",null,e.description),Object(r.createElement)("div",{className:"wc-atomic-blocks-product__selection"},Object(r.createElement)(f.a,{selected:s||0,showVariations:!0,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];a({productId:e[0]?e[0].id:0})}}),Object(r.createElement)(p.Button,{isSecondary:!0,disabled:!s,onClick:()=>{u(!1)}},Object(l.__)("Done","woocommerce")))):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(g.BlockControls,null,Object(r.createElement)(p.ToolbarGroup,null,Object(r.createElement)(k.a,{onClick:()=>u(!0)},Object(l.__)("Switch product…","woocommerce")))),Object(r.createElement)(t,c)))},S=c(539);const C=Object(l.__)("Product Title","woocommerce"),x=Object(r.createElement)(n.a,{icon:S.a,className:"wc-block-editor-components-block-icon"}),N=Object(l.__)("Display the title of a product.","woocommerce");c(394);const P=e=>{let{attributes:t,setAttributes:c}=e;const o=Object(g.useBlockProps)(),{headingLevel:n,showProductLink:a,align:i,linkTarget:u}=t;return Object(r.createElement)("div",o,Object(r.createElement)(g.BlockControls,null,Object(r.createElement)(E,{isCollapsed:!0,minLevel:1,maxLevel:7,selectedLevel:n,onChange:e=>c({headingLevel:e})}),Object(s.b)()&&Object(r.createElement)(g.AlignmentToolbar,{value:i,onChange:e=>{c({align:e})}})),Object(r.createElement)(g.InspectorControls,null,Object(r.createElement)(p.PanelBody,{title:Object(l.__)("Link settings","woocommerce")},Object(r.createElement)(p.ToggleControl,{label:Object(l.__)("Make title a link","woocommerce"),checked:a,onChange:()=>c({showProductLink:!a})}),a&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(p.ToggleControl,{label:Object(l.__)("Open in new tab","woocommerce"),onChange:e=>c({linkTarget:e?"_blank":"_self"}),checked:"_blank"===u})))),Object(r.createElement)(p.Disabled,null,Object(r.createElement)(w.b,t)))};var T=Object(s.b)()?Object(m.compose)([v({icon:x,label:C,description:Object(l.__)("Choose a product to display its title.","woocommerce")})])(P):P,I=c(126);const R={...d,apiVersion:2,title:C,description:N,icon:{src:x},attributes:b.a,edit:T,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))},supports:{...d.supports,...Object(s.b)()&&{typography:{fontSize:!0,lineHeight:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0},color:{text:!0,background:!0,link:!1,gradients:!0,__experimentalSkipSerialization:!0},...Object(I.a)()&&{spacing:{margin:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-title"}}};Object(o.registerBlockType)("woocommerce/product-title",R);var A=c(12),B=c(210),L=c(540);const D=Object(l.__)("Product Price","woocommerce"),F=Object(r.createElement)(n.a,{icon:L.a,className:"wc-block-editor-components-block-icon"}),V=Object(l.__)("Display the price of a product.","woocommerce");var z=v({icon:F,label:D,description:Object(l.__)("Choose a product to display its price.","woocommerce")})(e=>{let{attributes:t,setAttributes:c,context:o}=e;const n=Object(g.useBlockProps)(),a={...t,...o},l=Number.isFinite(o.queryId);return Object(A.useEffect)(()=>c({isDescendentOfQueryLoop:l}),[c,l]),Object(r.createElement)(r.Fragment,null,Object(r.createElement)(g.BlockControls,null,Object(s.b)()&&Object(r.createElement)(g.AlignmentToolbar,{value:t.textAlign,onChange:e=>{c({textAlign:e})}})),Object(r.createElement)("div",n,Object(r.createElement)(B.default,a)))});let M={productId:{type:"number",default:0},isDescendentOfQueryLoop:{type:"boolean",default:!1}};Object(s.b)()&&(M={...M,textAlign:{type:"string"}});var q=M;const H={...d,apiVersion:2,title:D,description:V,parent:["core/group"],ancestor:["@woocommerce/all-products","@woocommerce/single-product","core/post-template"],usesContext:["query","queryId","postId"],icon:{src:F},attributes:q,edit:z,supports:{...d.supports,...Object(s.b)()&&{color:{text:!0,background:!1,link:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wc-block-components-product-price"}}};Object(o.registerBlockType)("woocommerce/product-price",H);var G=c(541),Q=c(6),Y=c.n(Q),U=c(2),W=c(125),K=c(195);const $={html:!1,...Object(s.b)()&&{__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},...Object(I.a)()&&{spacing:{margin:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-image"}};var J=c(316);const X={apiVersion:2,name:"woocommerce/product-image",title:Object(l.__)("Product Image","woocommerce"),icon:{src:Object(r.createElement)(n.a,{icon:G.a,className:"wc-block-editor-components-block-icon"})},keywords:["WooCommerce"],description:Object(l.__)("Display the main product image.","woocommerce"),usesContext:["query","queryId","postId"],parent:["@woocommerce/all-products","@woocommerce/single-product","core/post-template"],textdomain:"woocommerce",attributes:J.a,supports:$,edit:e=>{let{attributes:t,setAttributes:c,context:o}=e;const{showProductLink:n,imageSizing:a,showSaleBadge:s,saleBadgeAlign:i}=t,u=Object(g.useBlockProps)(),d=Number.isFinite(o.queryId);Object(r.useEffect)(()=>c({isDescendentOfQueryLoop:d}),[c,d]);const b=Object(U.getSettingWithCoercion)("is_block_theme_enabled",!1,W.a);return Object(r.useEffect)(()=>{b&&"full-size"!==t.imageSizing&&c({imageSizing:"full-size"})},[t.imageSizing,b,c]),Object(r.createElement)("div",u,Object(r.createElement)(g.InspectorControls,null,Object(r.createElement)(p.PanelBody,{title:Object(l.__)("Content","woocommerce")},Object(r.createElement)(p.ToggleControl,{label:Object(l.__)("Link to Product Page","woocommerce"),help:Object(l.__)("Links the image to the single product listing.","woocommerce"),checked:n,onChange:()=>c({showProductLink:!n})}),Object(r.createElement)(p.ToggleControl,{label:Object(l.__)("Show On-Sale Badge","woocommerce"),help:Object(l.__)("Display a “sale” badge if the product is on-sale.","woocommerce"),checked:s,onChange:()=>c({showSaleBadge:!s})}),s&&Object(r.createElement)(p.__experimentalToggleGroupControl,{label:Object(l.__)("Sale Badge Alignment","woocommerce"),value:i,onChange:e=>c({saleBadgeAlign:e})},Object(r.createElement)(p.__experimentalToggleGroupControlOption,{value:"left",label:Object(l.__)("Left","woocommerce")}),Object(r.createElement)(p.__experimentalToggleGroupControlOption,{value:"center",label:Object(l.__)("Center","woocommerce")}),Object(r.createElement)(p.__experimentalToggleGroupControlOption,{value:"right",label:Object(l.__)("Right","woocommerce")})),!b&&Object(r.createElement)(p.__experimentalToggleGroupControl,{label:Object(l.__)("Image Sizing","woocommerce"),help:Object(r.createInterpolateElement)(Object(l.__)("Product image cropping can be modified in the <a>Customizer</a>.","woocommerce"),{a:Object(r.createElement)("a",{href:Object(U.getAdminLink)("customize.php")+"?autofocus[panel]=woocommerce&autofocus[section]=woocommerce_product_images",target:"_blank",rel:"noopener noreferrer"})}),value:a,onChange:e=>c({imageSizing:e})},Object(r.createElement)(p.__experimentalToggleGroupControlOption,{value:"full-size",label:Object(l.__)("Full Size","woocommerce")}),Object(r.createElement)(p.__experimentalToggleGroupControlOption,{value:"cropped",label:Object(l.__)("Cropped","woocommerce")})))),Object(r.createElement)(p.Disabled,null,Object(r.createElement)(K.b,Y()({},t,o))))}};Object(o.registerBlockType)("woocommerce/product-image",{...d,...X});var Z=c(211),ee=c(534);const te=Object(l.__)("Product Rating","woocommerce"),ce=Object(r.createElement)(n.a,{icon:ee.a,className:"wc-block-editor-components-block-icon"}),re=Object(l.__)("Display the average rating of a product.","woocommerce");var oe=v({icon:ce,label:te,description:Object(l.__)("Choose a product to display its rating.","woocommerce")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)({className:"wp-block-woocommerce-product-rating"});return Object(r.createElement)("div",c,Object(r.createElement)(Z.default,t))});const ne={apiVersion:2,title:te,description:re,icon:{src:ce},attributes:{productId:{type:"number",default:0}},supports:{...Object(s.b)()&&{color:{text:!0,background:!1,link:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},...Object(I.a)()&&{spacing:{margin:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-rating"}},edit:oe,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))}};Object(o.registerBlockType)("woocommerce/product-rating",{...d,...ne});var ae=c(212),se=c(542);const le=Object(l.__)("Add to Cart Button","woocommerce"),ie=Object(r.createElement)(n.a,{icon:se.a,className:"wc-block-editor-components-block-icon"}),ue={apiVersion:2,title:le,description:Object(l.__)("Display a call to action button which either adds the product to the cart, or links to the product page.","woocommerce"),parent:["core/group"],ancestor:["@woocommerce/all-products","@woocommerce/single-product","core/post-template"],usesContext:["query","queryId","postId"],icon:{src:ie},attributes:{productId:{type:"number",default:0},isDescendentOfQueryLoop:{type:"boolean",default:!1}},supports:{...Object(s.b)()&&{color:{text:!0,background:!0,link:!1,__experimentalSkipSerialization:!0},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},...Object(I.a)()&&{spacing:{padding:!0,__experimentalSkipSerialization:!0}},typography:{fontSize:!0,__experimentalFontWeight:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button"}},edit:e=>{let{attributes:t,setAttributes:c,context:o}=e;const n=Object(g.useBlockProps)(),a=Number.isFinite(o.queryId);return Object(r.useEffect)(()=>c({isDescendentOfQueryLoop:a}),[c,a]),Object(r.createElement)("div",n,Object(r.createElement)(p.Disabled,null,Object(r.createElement)(ae.default,Y()({},t,o))))}};Object(o.registerBlockType)("woocommerce/product-button",{...d,...ue});var de=c(327),be=c(543);const pe=Object(l.__)("Product Summary","woocommerce"),me=Object(r.createElement)(n.a,{icon:be.a,className:"wc-block-editor-components-block-icon"}),ge=Object(l.__)("Display a short description about a product.","woocommerce");c(395);var Oe=v({icon:me,label:pe,description:Object(l.__)("Choose a product to display its short description.","woocommerce")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)();return Object(r.createElement)("div",c,Object(r.createElement)(de.default,t))});const je={apiVersion:2,title:pe,description:ge,icon:{src:me},attributes:{productId:{type:"number",default:0}},supports:{...Object(s.b)()&&{color:{text:!0,background:!1,link:!1},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-summary"}},edit:Oe,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))}};Object(o.registerBlockType)("woocommerce/product-summary",{...d,...je});var he=c(141),_e=c(532);const Ee=Object(l.__)("On-Sale Badge","woocommerce"),we=Object(r.createElement)(n.a,{icon:_e.a,className:"wc-block-editor-components-block-icon"}),fe=Object(l.__)("Displays an on-sale badge if the product is on-sale.","woocommerce");var ke=v({icon:we,label:Ee,description:Object(l.__)("Choose a product to display its sale-badge.","woocommerce")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)();return Object(r.createElement)("div",c,Object(r.createElement)(he.default,t))});const ye={title:Ee,description:fe,icon:{src:we},apiVersion:2,supports:{html:!1,...Object(s.b)()&&{color:{gradients:!0,background:!0,link:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0},...Object(I.a)()&&{spacing:{padding:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-sale-badge"}},attributes:{productId:{type:"number",default:0}},edit:ke,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))}};Object(o.registerBlockType)("woocommerce/product-sale-badge",{...d,...ye});var ve=c(109),Se=c(328),Ce=Object(r.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("path",{d:"M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z"}));const xe=Object(l.__)("Product SKU","woocommerce"),Ne=Object(r.createElement)(n.a,{icon:Ce,className:"wc-block-editor-components-block-icon"}),Pe={title:xe,description:Object(l.__)("Display the SKU of a product.","woocommerce"),icon:{src:Ne},attributes:{productId:{type:"number",default:0}},edit:v({icon:Ne,label:xe,description:Object(l.__)("Choose a product to display its SKU.","woocommerce")})(e=>{let{attributes:t}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(ve.a,null),Object(r.createElement)(Se.default,t))})};Object(s.c)("woocommerce/product-sku",{...d,...Pe});var Te=c(329),Ie=c(544);const Re=Object(l.__)("Product Category List","woocommerce"),Ae=Object(r.createElement)(n.a,{icon:Ie.a,className:"wc-block-editor-components-block-icon"}),Be=Object(l.__)("Display the list of categories that are assigned to a product.","woocommerce");var Le=v({icon:Ae,label:Re,description:Object(l.__)("Choose a product to display its categories.","woocommerce")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)();return Object(r.createElement)("div",c,Object(r.createElement)(ve.a,null),Object(r.createElement)(p.Disabled,null,Object(r.createElement)(Te.default,t)))});const De={...d,apiVersion:2,title:Re,description:Be,icon:{src:Ae},attributes:{productId:{type:"number",default:0}},supports:{...Object(s.b)()&&{color:{text:!0,link:!0,background:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wc-block-components-product-category-list"}},save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))},edit:Le};Object(s.c)("woocommerce/product-category-list",De);var Fe=c(330),Ve=c(537);const ze=Object(l.__)("Product Tag List","woocommerce"),Me=Object(r.createElement)(n.a,{icon:Ve.a,className:"wc-block-editor-components-block-icon"}),qe=Object(l.__)("Display the list of tags that are assigned to a product.","woocommerce");var He=v({icon:Me,label:ze,description:Object(l.__)("Choose a product to display its tags.","woocommerce")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)();return Object(r.createElement)("div",c,Object(r.createElement)(ve.a,null),Object(r.createElement)(p.Disabled,null,Object(r.createElement)(Fe.default,t)))});const Ge={apiVersion:2,title:ze,description:qe,icon:{src:Me},attributes:{productId:{type:"number",default:0}},supports:{...Object(s.b)()&&{color:{text:!0,background:!1,link:!0},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-tag-list"}},edit:He,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))}};Object(s.c)("woocommerce/product-tag-list",{...d,...Ge});var Qe=c(331),Ye=c(545);const Ue=Object(l.__)("Product Stock Indicator","woocommerce"),We=Object(r.createElement)(n.a,{icon:Ye.a,className:"wc-block-editor-components-block-icon"}),Ke=Object(l.__)("Display product stock status.","woocommerce");var $e=v({icon:We,label:Ue,description:Object(l.__)("Choose a product to display its stock.","woocommerce")})(e=>{let{attributes:t}=e;const c=Object(g.useBlockProps)();return Object(r.createElement)("div",c,Object(r.createElement)(ve.a,null),Object(r.createElement)(Qe.default,t))});const Je={apiVersion:2,title:Ue,description:Ke,icon:{src:We},attributes:{productId:{type:"number",default:0}},supports:{...Object(s.b)()&&{color:{text:!0,background:!1,link:!1},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-stock-indicator"}},edit:$e,save:e=>{let{attributes:t}=e;return Object(r.createElement)("div",g.useBlockProps.save({className:u()("is-loading",t.className)}))}};Object(s.c)("woocommerce/product-stock-indicator",{...d,...Je});var Xe=c(359),Ze=(c(236),c(209)),et=c(278);const tt=Object(l.__)("Add to Cart","woocommerce"),ct=Object(r.createElement)(n.a,{icon:et.a,className:"wc-block-editor-components-block-icon"}),rt={title:tt,description:Object(l.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woocommerce"),icon:{src:ct},edit:v({icon:ct,label:tt,description:Object(l.__)("Choose a product to display its add to cart form.","woocommerce")})(e=>{let{attributes:t,setAttributes:c}=e;const{product:o}=Object(y.useProductDataContext)(),{className:n,showFormElements:a}=t;return Object(r.createElement)("div",{className:u()(n,"wc-block-components-product-add-to-cart")},Object(r.createElement)(ve.a,{productId:o.id}),Object(r.createElement)(g.InspectorControls,null,Object(r.createElement)(p.PanelBody,{title:Object(l.__)("Layout","woocommerce")},Object(Xe.b)(o)?Object(r.createElement)(p.ToggleControl,{label:Object(l.__)("Display form elements","woocommerce"),help:Object(l.__)("Depending on product type, allow customers to select a quantity, variations etc.","woocommerce"),checked:a,onChange:()=>c({showFormElements:!a})}):Object(r.createElement)(p.Notice,{className:"wc-block-components-product-add-to-cart-notice",isDismissible:!1,status:"info"},Object(l.__)("This product does not support the block based add to cart form. A link to the product page will be shown instead.","woocommerce")))),Object(r.createElement)(p.Disabled,null,Object(r.createElement)(Ze.a,t)))}),attributes:c(318).a};Object(s.c)("woocommerce/product-add-to-cart",{...d,...rt});var ot=c(222);const nt=(e,t)=>{const{className:c,contentVisibility:r}=t;return u()(e,c,{"has-image":r&&r.image,"has-title":r&&r.title,"has-rating":r&&r.rating,"has-price":r&&r.price,"has-button":r&&r.button})},{attributes:at}=ot;var st=[{attributes:Object.assign({},at,{rows:{type:"number",default:1}}),save(e){let{attributes:t}=e;const c={"data-attributes":JSON.stringify(t)};return Object(r.createElement)("div",Y()({className:nt("wc-block-all-products",t)},c),Object(r.createElement)(g.InnerBlocks.Content,null))}}],lt=c(24),it=c.n(lt),ut=c(7),dt=c(64),bt=c(509),pt=c(382),mt=c(22),gt=c(258);const Ot=[["woocommerce/product-image",{imageSizing:"cropped"}],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],jt=e=>e&&0!==e.length?e.map(e=>[e.name,{...e.attributes,product:void 0,children:e.innerBlocks.length>0?jt(e.innerBlocks):[]}]):[];var ht=c(29);c(401);var _t=e=>{let{currentPage:t,displayFirstAndLastPages:c=!0,displayNextAndPreviousArrows:o=!0,pagesToDisplay:n=3,onPageChange:a,totalPages:s}=e,{minIndex:i,maxIndex:d}=((e,t,c)=>{if(c<=2)return{minIndex:null,maxIndex:null};const r=e-1,o=Math.max(Math.floor(t-r/2),2),n=Math.min(Math.ceil(t+(r-(t-o))),c-1);return{minIndex:Math.max(Math.floor(t-(r-(n-t))),2),maxIndex:n}})(n,t,s);const b=c&&Boolean(1!==i),p=c&&Boolean(d!==s),m=c&&Boolean(i&&i>3),g=c&&Boolean(d&&d<s-2);b&&3===i&&(i-=1),p&&d===s-2&&(d+=1);const O=[];if(i&&d)for(let e=i;e<=d;e++)O.push(e);return Object(r.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(r.createElement)(ht.a,{screenReaderLabel:Object(l.__)("Navigate to another page","woocommerce")}),o&&Object(r.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>a(t-1),title:Object(l.__)("Previous page","woocommerce"),disabled:t<=1},Object(r.createElement)(ht.a,{label:"←",screenReaderLabel:Object(l.__)("Previous page","woocommerce")})),b&&Object(r.createElement)("button",{className:u()("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:()=>a(1),disabled:1===t},Object(r.createElement)(ht.a,{label:"1",screenReaderLabel:Object(l.sprintf)(
|
29 |
/* translators: %d is the page number (1, 2, 3...). */
|
30 |
Object(l.__)("Page %d","woocommerce"),1)})),m&&Object(r.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(l.__)("…","woocommerce")),O.map(e=>Object(r.createElement)("button",{key:e,className:u()("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?void 0:()=>a(e),disabled:t===e},Object(r.createElement)(ht.a,{label:e.toString(),screenReaderLabel:Object(l.sprintf)(
|
31 |
/* translators: %d is the page number (1, 2, 3...). */
|
32 |
Object(l.__)("Page %d","woocommerce"),e)}))),g&&Object(r.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(l.__)("…","woocommerce")),p&&Object(r.createElement)("button",{className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===s,"wc-block-components-pagination__page--active":t===s}),onClick:()=>a(s),disabled:t===s},Object(r.createElement)(ht.a,{label:s.toString(),screenReaderLabel:Object(l.sprintf)(
|
33 |
/* translators: %d is the page number (1, 2, 3...). */
|
34 |
+
Object(l.__)("Page %d","woocommerce"),s)})),o&&Object(r.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>a(t+1),title:Object(l.__)("Next page","woocommerce"),disabled:t>=s},Object(r.createElement)(ht.a,{label:"→",screenReaderLabel:Object(l.__)("Next page","woocommerce")})))},Et=c(104),wt=c(52),ft=c(244),kt=c(70);c(402);const yt=e=>{if(!e)return;const t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()};var vt=c(48),St=c(184),Ct=()=>{const{parentClassName:e}=Object(y.useInnerBlockLayoutContext)();return Object(r.createElement)("div",{className:e+"__no-products"},Object(r.createElement)(n.a,{className:e+"__no-products-image",icon:St.a,size:100}),Object(r.createElement)("strong",{className:e+"__no-products-title"},Object(l.__)("No products","woocommerce")),Object(r.createElement)("p",{className:e+"__no-products-description"},Object(l.__)("There are currently no products available to display.","woocommerce")))},xt=c(536),Nt=e=>{let{resetCallback:t=(()=>{})}=e;const{parentClassName:c}=Object(y.useInnerBlockLayoutContext)();return Object(r.createElement)("div",{className:c+"__no-products"},Object(r.createElement)(n.a,{className:c+"__no-products-image",icon:xt.a,size:100}),Object(r.createElement)("strong",{className:c+"__no-products-title"},Object(l.__)("No products found","woocommerce")),Object(r.createElement)("p",{className:c+"__no-products-description"},Object(l.__)("We were unable to find any results based on your search.","woocommerce")),Object(r.createElement)("button",{onClick:t},Object(l.__)("Reset Search","woocommerce")))},Pt=c(122);c(400);var Tt=e=>{let{onChange:t,value:c}=e;return Object(r.createElement)(Pt.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",onChange:t,options:[{key:"menu_order",label:Object(l.__)("Default sorting","woocommerce")},{key:"popularity",label:Object(l.__)("Popularity","woocommerce")},{key:"rating",label:Object(l.__)("Average rating","woocommerce")},{key:"date",label:Object(l.__)("Latest","woocommerce")},{key:"price",label:Object(l.__)("Price: low to high","woocommerce")},{key:"price-desc",label:Object(l.__)("Price: high to low","woocommerce")}],screenReaderLabel:Object(l.__)("Order products by","woocommerce"),value:c})};const It=(e,t,c,o)=>{if(!c)return;const n=Object(bt.a)(e);return c.map((c,a)=>{let[s,l={}]=c,i=[];l.children&&l.children.length>0&&(i=It(e,t,l.children,o));const u=n[s];if(!u)return null;const d=t.id||0,b=["layout",s,a,o,d];return Object(r.createElement)(r.Suspense,{key:b.join("_"),fallback:Object(r.createElement)("div",{className:"wc-block-placeholder"})},Object(r.createElement)(u,Y()({},l,{children:i,product:t})))})};var Rt=Object(m.withInstanceId)(e=>{let{product:t={},attributes:c,instanceId:o}=e;const{layoutConfig:n}=c,{parentClassName:a,parentName:s}=Object(y.useInnerBlockLayoutContext)(),l=0===Object.keys(t).length,i=u()(a+"__product","wc-block-layout",{"is-loading":l});return Object(r.createElement)("li",{className:i,"aria-hidden":l},It(s,t,n,o))});c(399);const At=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"}}},Bt=function(e){let{totalQuery:t,totalProducts:c}=e,{totalQuery:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!Object(O.isEqual)(t,r)&&Number.isFinite(c)};var Lt,Dt=(Lt=e=>{let{attributes:t,currentPage:c,onPageChange:o,onSortChange:n,sortValue:a,scrollToTop:s}=e;const[i,d]=Object(wt.b)("attributes",[]),[b,p]=Object(wt.b)("stock_status",[]),[m,g]=Object(wt.b)("rating",[]),[j,h]=Object(wt.b)("min_price"),[_,E]=Object(wt.b)("max_price"),[w]=Object(wt.c)((e=>{let{sortValue:t,currentPage:c,attributes:r}=e;const{columns:o,rows:n}=r;return{...At(t),catalog_visibility:"catalog",per_page:o*n,page:c}})({attributes:t,sortValue:a,currentPage:c})),{products:f,totalProducts:k,productsLoading:v}=Object(ft.a)(w),{parentClassName:S,parentName:C}=Object(y.useInnerBlockLayoutContext)(),x=(e=>{const{order:t,orderby:c,page:r,per_page:o,...n}=e;return n||{}})(w),{dispatchStoreEvent:N}=Object(kt.a)(),P=Object(Et.a)({totalQuery:x,totalProducts:k},Bt);Object(r.useEffect)(()=>{N("product-list-render",{products:f,listName:C})},[f,C,N]),Object(r.useEffect)(()=>{Object(O.isEqual)(x,null==P?void 0:P.totalQuery)||(o(1),null!=P&&P.totalQuery&&(e=>{Number.isFinite(e)&&(0===e?Object(vt.speak)(Object(l.__)("No products found","woocommerce")):Object(vt.speak)(Object(l.sprintf)(
|
35 |
/* translators: %s is an integer higher than 0 (1, 2, 3...) */
|
36 |
Object(l._n)("%d product found","%d products found",e,"woocommerce"),e)))})(k))},[null==P?void 0:P.totalQuery,k,o,x]);const{contentVisibility:T}=t,I=t.columns*t.rows,R=!Number.isFinite(k)&&Number.isFinite(null==P?void 0:P.totalProducts)&&Object(O.isEqual)(x,null==P?void 0:P.totalQuery)?Math.ceil(((null==P?void 0:P.totalProducts)||0)/I):Math.ceil(k/I),A=f.length?f:Array.from({length:I}),B=0!==f.length||v,L=i.length>0||b.length>0||m.length>0||Number.isFinite(j)||Number.isFinite(_);return Object(r.createElement)("div",{className:(()=>{const{columns:e,rows:c,alignButtons:r,align:o}=t,n=void 0!==o?"align"+o:"";return u()(S,n,"has-"+e+"-columns",{"has-multiple-rows":c>1,"has-aligned-buttons":r})})()},(null==T?void 0:T.orderBy)&&B&&Object(r.createElement)(Tt,{onChange:n,value:a}),!B&&L&&Object(r.createElement)(Nt,{resetCallback:()=>{d([]),p([]),g([]),h(null),E(null)}}),!B&&!L&&Object(r.createElement)(Ct,null),B&&Object(r.createElement)("ul",{className:u()(S+"__products",{"is-loading-products":v})},A.map((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=arguments.length>1?arguments[1]:void 0;return Object(r.createElement)(Rt,{key:e.id||c,attributes:t,product:e})}))),R>1&&Object(r.createElement)(_t,{currentPage:c,onPageChange:e=>{s({focusableSelector:"a, button"}),o(e)},totalPages:R}))},e=>{const t=Object(r.useRef)(null);return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:t,"aria-hidden":!0}),Object(r.createElement)(Lt,Y()({},e,{scrollToTop:e=>{null!==t.current&&((e,t)=>{const{focusableSelector:c}=t||{};window&&Number.isFinite(window.innerHeight)&&(c?((e,t)=>{var c;const r=(null===(c=e.parentElement)||void 0===c?void 0:c.querySelectorAll(t))||[];if(r.length){const e=r[0];yt(e),null==e||e.focus()}else yt(e)})(e,c):yt(e))})(t.current,e)}})))}),Ft=e=>{let{attributes:t}=e;const[c,o]=Object(r.useState)(1),[n,a]=Object(r.useState)(t.orderby);return Object(r.useEffect)(()=>{a(t.orderby)},[t.orderby]),Object(r.createElement)(Dt,{attributes:t,currentPage:c,onPageChange:e=>{o(e)},onSortChange:e=>{var t;const c=null==e||null===(t=e.target)||void 0===t?void 0:t.value;a(c),o(1)},sortValue:n})},Vt=c(150),zt=c(251);class Mt extends A.Component{render(){const{attributes:e,urlParameterSuffix:t}=this.props;return e.isPreview?Vt.a:Object(r.createElement)(y.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(r.createElement)(zt.a,{context:"wc/all-products"}),Object(r.createElement)(Ft,{attributes:e,urlParameterSuffix:t}))}}var qt=Mt;c(398);class Ht extends r.Component{constructor(){super(...arguments),it()(this,"state",{isEditing:!1,innerBlocks:[]}),it()(this,"blockMap",Object(bt.a)("woocommerce/all-products")),it()(this,"componentDidMount",()=>{const{block:e}=this.props;this.setState({innerBlocks:e.innerBlocks})}),it()(this,"getTitle",()=>Object(l.__)("All Products","woocommerce")),it()(this,"getIcon",()=>Object(r.createElement)(n.a,{icon:a.a})),it()(this,"togglePreview",()=>{const{debouncedSpeak:e}=this.props;this.setState({isEditing:!this.state.isEditing}),this.state.isEditing||e(Object(l.__)("Showing All Products block preview.","woocommerce"))}),it()(this,"getInspectorControls",()=>{const{attributes:e,setAttributes:t}=this.props,{columns:c,rows:o,alignButtons:n}=e;return Object(r.createElement)(g.InspectorControls,{key:"inspector"},Object(r.createElement)(p.PanelBody,{title:Object(l.__)("Layout Settings","woocommerce"),initialOpen:!0},Object(r.createElement)(dt.a,{columns:c,rows:o,alignButtons:n,setAttributes:t,minColumns:Object(U.getSetting)("min_columns",1),maxColumns:Object(U.getSetting)("max_columns",6),minRows:Object(U.getSetting)("min_rows",1),maxRows:Object(U.getSetting)("max_rows",6)})),Object(r.createElement)(p.PanelBody,{title:Object(l.__)("Content Settings","woocommerce")},((e,t)=>{const{contentVisibility:c}=e;return Object(r.createElement)(p.ToggleControl,{label:Object(l.__)("Show Sorting Dropdown","woocommerce"),checked:c.orderBy,onChange:()=>t({contentVisibility:{...c,orderBy:!c.orderBy}})})})(e,t),((e,t)=>Object(r.createElement)(p.SelectControl,{label:Object(l.__)("Order Products By","woocommerce"),value:e.orderby,options:[{label:Object(l.__)("Default sorting (menu order)","woocommerce"),value:"menu_order"},{label:Object(l.__)("Popularity","woocommerce"),value:"popularity"},{label:Object(l.__)("Average rating","woocommerce"),value:"rating"},{label:Object(l.__)("Latest","woocommerce"),value:"date"},{label:Object(l.__)("Price: low to high","woocommerce"),value:"price"},{label:Object(l.__)("Price: high to low","woocommerce"),value:"price-desc"}],onChange:e=>t({orderby:e})}))(e,t)))}),it()(this,"getBlockControls",()=>{const{isEditing:e}=this.state;return Object(r.createElement)(g.BlockControls,null,Object(r.createElement)(p.ToolbarGroup,{controls:[{icon:"edit",title:Object(l.__)("Edit the layout of each product","woocommerce"),onClick:()=>this.togglePreview(),isActive:e}]}))}),it()(this,"renderEditMode",()=>{const e={template:this.props.attributes.layoutConfig,templateLock:!1,allowedBlocks:Object.keys(this.blockMap)};return 0!==this.props.attributes.layoutConfig.length&&(e.renderAppender=!1),Object(r.createElement)(p.Placeholder,{icon:this.getIcon(),label:this.getTitle()},Object(l.__)("Display all products from your store as a grid.","woocommerce"),Object(r.createElement)("div",{className:"wc-block-all-products-grid-item-template"},Object(r.createElement)(p.Tip,null,Object(l.__)("Edit the blocks inside the example below to change the content displayed for all products within the product grid.","woocommerce")),Object(r.createElement)(y.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(r.createElement)("div",{className:"wc-block-grid wc-block-layout has-1-columns"},Object(r.createElement)("ul",{className:"wc-block-grid__products"},Object(r.createElement)("li",{className:"wc-block-grid__product"},Object(r.createElement)(y.ProductDataContextProvider,{product:pt.a[0]},Object(r.createElement)(g.InnerBlocks,e)))))),Object(r.createElement)("div",{className:"wc-block-all-products__actions"},Object(r.createElement)(p.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,onClick:()=>{const{block:e,setAttributes:t}=this.props;t({layoutConfig:jt(e.innerBlocks)}),this.setState({innerBlocks:e.innerBlocks}),this.togglePreview()}},Object(l.__)("Done","woocommerce")),Object(r.createElement)(p.Button,{className:"wc-block-all-products__cancel-button",isTertiary:!0,onClick:()=>{const{block:e,replaceInnerBlocks:t}=this.props,{innerBlocks:c}=this.state;t(e.clientId,c,!1),this.togglePreview()}},Object(l.__)("Cancel","woocommerce")),Object(r.createElement)(p.Button,{className:"wc-block-all-products__reset-button",icon:Object(r.createElement)(n.a,{icon:a.a}),label:Object(l.__)("Reset layout to default","woocommerce"),onClick:()=>{const{block:e,replaceInnerBlocks:t}=this.props,c=[];Ot.map(e=>{let[t,r]=e;return c.push(Object(o.createBlock)(t,r)),!0}),t(e.clientId,c,!1),this.setState({innerBlocks:e.innerBlocks})}},Object(l.__)("Reset Layout","woocommerce")))))}),it()(this,"renderViewMode",()=>{const{attributes:e}=this.props,{layoutConfig:t}=e,c=t&&0!==t.length,o=this.getTitle(),n=this.getIcon();return c?Object(r.createElement)(p.Disabled,null,Object(r.createElement)(qt,{attributes:e})):((e,t)=>Object(r.createElement)(p.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(l.__)("The content for this block is hidden due to block settings.","woocommerce")))(o,n)}),it()(this,"render",()=>{const{attributes:e}=this.props,{isEditing:t}=this.state,c=this.getTitle(),o=this.getIcon();return 0===mt.o.productCount?((e,t)=>Object(r.createElement)(p.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(r.createElement)("p",null,Object(l.__)("You haven't published any products to list here yet.","woocommerce")),Object(r.createElement)(p.Button,{className:"wc-block-products__add-product-button",isSecondary:!0,href:U.ADMIN_URL+"post-new.php?post_type=product"},Object(l.__)("Add new product","woocommerce")+" ",Object(r.createElement)(n.a,{icon:gt.a})),Object(r.createElement)(p.Button,{className:"wc-block-products__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(l.__)("Learn more","woocommerce"))))(c,o):Object(r.createElement)("div",{className:nt("wc-block-all-products",e)},this.getBlockControls(),this.getInspectorControls(),t?this.renderEditMode():this.renderViewMode())})}}var Gt=Object(m.compose)(p.withSpokenMessages,Object(ut.withSelect)((e,t)=>{let{clientId:c}=t;const{getBlock:r}=e("core/block-editor");return{block:r(c)}}),Object(ut.withDispatch)(e=>{const{replaceInnerBlocks:t}=e("core/block-editor");return{replaceInnerBlocks:t}}))(Ht),Qt={columns:Object(U.getSetting)("default_columns",3),rows:Object(U.getSetting)("default_rows",3),alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:Ot,isPreview:!1};const{name:Yt}=ot,Ut={icon:{src:Object(r.createElement)(n.a,{icon:a.a,className:"wc-block-editor-components-block-icon"})},edit:Gt,save:function(e){let{attributes:t}=e;const c={};Object.keys(t).sort().forEach(e=>{c[e]=t[e]});const o={"data-attributes":JSON.stringify(c)};return Object(r.createElement)("div",Y()({className:nt("wc-block-all-products",t)},o),Object(r.createElement)(g.InnerBlocks.Content,null))},deprecated:st,defaults:Qt};Object(o.registerBlockType)(Yt,Ut)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var r=c(36),o=c(0),n=c(22);c.p=n.l,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)(()=>Promise.all([c.e(0),c.e(1),c.e(2),c.e(28)]).then(c.bind(null,210)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(4),c.e(25)]).then(c.bind(null,567)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(4),c.e(38)]).then(c.bind(null,568)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(30)]).then(c.bind(null,211)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(4),c.e(21)]).then(c.bind(null,212)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(35)]).then(c.bind(null,327)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(31)]).then(c.bind(null,141)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)(()=>c.e(33).then(c.bind(null,328)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(24)]).then(c.bind(null,329)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(37)]).then(c.bind(null,330)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(34)]).then(c.bind(null,331)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)(()=>Promise.all([c.e(0),c.e(1),c.e(4),c.e(19)]).then(c.bind(null,569)))});const a=e=>Object(r.getRegisteredBlockComponents)(e)}]);
|
packages/woocommerce-blocks/build/all-reviews.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '3f1046d184c210a536924c73acbe43bf');
|
packages/woocommerce-blocks/build/all-reviews.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-reviews"]=function(e){function t(t){for(var o,a,i=t[0],s=t[1],l=t[2],u=0,b=[];u<i.length;u++)a=i[u],Object.prototype.hasOwnProperty.call(n,a)&&n[a]&&b.push(n[a][0]),n[a]=0;for(o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o]);for(d&&d(t);b.length;)b.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],o=!0,i=1;i<r.length;i++){var s=r[i];0!==n[s]&&(o=!1)}o&&(c.splice(t--,1),e=a(a.s=r[0]))}return e}var o={},n={7:0},c=[];function a(t){if(o[t])return o[t].exports;var r=o[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=o,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 o in e)a.d(r,o,function(t){return e[t]}.bind(null,o));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 d=s;return c.push([383,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.blocks},11:function(e,t){e.exports=window.wp.compose},112:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"c",(function(){return d}));var o=r(0),n=r(1),c=r(5),a=r(2),i=r(3);const s=(e,t,r)=>Object(o.createElement)(c.BlockControls,null,Object(o.createElement)(i.ToolbarGroup,{controls:[{icon:"edit",title:r,onClick:()=>t({editMode:!e}),isActive:e}]})),l=(e,t)=>{const r=Object(a.getSetting)("showAvatars",!0),c=Object(a.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Product rating","woocommerce"),checked:e.showReviewRating,onChange:()=>t({showReviewRating:!e.showReviewRating})}),e.showReviewRating&&!c&&Object(o.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(n.__)("Product rating is disabled in your <a>store settings</a>.","woocommerce"),{a:Object(o.createElement)("a",{href:Object(a.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Reviewer name","woocommerce"),checked:e.showReviewerName,onChange:()=>t({showReviewerName:!e.showReviewerName})}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Image","woocommerce"),checked:e.showReviewImage,onChange:()=>t({showReviewImage:!e.showReviewImage})}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Review date","woocommerce"),checked:e.showReviewDate,onChange:()=>t({showReviewDate:!e.showReviewDate})}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Review content","woocommerce"),checked:e.showReviewContent,onChange:()=>t({showReviewContent:!e.showReviewContent})}),e.showReviewImage&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.__experimentalToggleGroupControl,{label:Object(n.__)("Review image","woocommerce"),value:e.imageType,onChange:e=>t({imageType:e})},Object(o.createElement)(i.__experimentalToggleGroupControlOption,{value:"reviewer",label:Object(n.__)("Reviewer photo","woocommerce")}),Object(o.createElement)(i.__experimentalToggleGroupControlOption,{value:"product",label:Object(n.__)("Product","woocommerce")})),"reviewer"===e.imageType&&!r&&Object(o.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(n.__)("Reviewer photo is disabled in your <a>site settings</a>.","woocommerce"),{a:Object(o.createElement)("a",{href:Object(a.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},d=(e,t)=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Order by","woocommerce"),checked:e.showOrderby,onChange:()=>t({showOrderby:!e.showOrderby})}),Object(o.createElement)(i.SelectControl,{label:Object(n.__)("Order Product Reviews by","woocommerce"),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:e=>t({orderby:e})}),Object(o.createElement)(i.RangeControl,{label:Object(n.__)("Starting Number of Reviews","woocommerce"),value:e.reviewsOnPageLoad,onChange:e=>t({reviewsOnPageLoad:e}),max:20,min:1}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Load more","woocommerce"),checked:e.showLoadMore,onChange:()=>t({showLoadMore:!e.showLoadMore})}),e.showLoadMore&&Object(o.createElement)(i.RangeControl,{label:Object(n.__)("Load More Reviews","woocommerce"),value:e.reviewsOnLoadMore,onChange:e=>t({reviewsOnLoadMore:e}),max:20,min:1}))},
|
2 |
/* translators: An example person name used for the block previews. */
|
3 |
reviewer:Object(o.__)("Alice","woocommerce"),review:`<p>${Object(o.__)("I bought this product last week and I'm very happy with it.","woocommerce")}</p>\n`,reviewer_avatar_urls:{48:n.o.defaultAvatar,96:n.o.defaultAvatar},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(o.__)("July 12, 2019","woocommerce"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(o.__)("WordPress Pennant","woocommerce"),product_permalink:"#",
|
4 |
/* translators: An example person name used for the block previews. */
|
5 |
-
reviewer:Object(o.__)("Bob","woocommerce"),review:`<p>${Object(o.__)("This product is awesome, I love it!","woocommerce")}</p>\n`,reviewer_avatar_urls:{48:n.o.defaultAvatar,96:n.o.defaultAvatar},rating:null,verified:!1}]}}},13:function(e,t){e.exports=window.wp.primitives},14:function(e,t){e.exports=window.wp.apiFetch},15:function(e,t){e.exports=window.wp.htmlEntities},152: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}}},153:function(e,t,r){"use strict";var o=r(6),n=r.n(o),c=r(0),a=r(5),i=(r(166),r(57));t.a=e=>{let{attributes:t}=e;return Object(c.createElement)("div",n()({},a.useBlockProps.save({className:Object(i.a)(t)}),Object(i.b)(t)))}},158:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(8),a=r(3),i=r(5),s=r(12),l=r(2),d=r(75),u=r(29);r(193);var b=e=>{let{onClick:t,label:r=Object(n.__)("Load more","woocommerce"),screenReaderLabel:c=Object(n.__)("Load more","woocommerce")}=e;return Object(o.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(o.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(o.createElement)(u.a,{label:r,screenReaderLabel:c})))},w=r(
|
6 |
/* translators: %f is referring to the average rating value */
|
7 |
Object(n.__)("Rated %f out of 5","woocommerce"),t),a={__html:Object(n.sprintf)(
|
8 |
/* translators: %s is referring to the average rating value */
|
9 |
-
Object(n.__)("Rated %s out of 5","woocommerce"),Object(n.sprintf)('<strong class="rating">%f</strong>',t))};return Object(o.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(o.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":c},Object(o.createElement)("span",{style:r,dangerouslySetInnerHTML:a})))}(r),u&&function(e){return Object(o.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(o.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(r),i&&function(e){const{reviewer:t=""}=e;return Object(o.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},t)}(r),a&&function(e){const{date_created:t,formatted_date_created:r}=e;return Object(o.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(r))),d&&function(e){return Object(o.createElement)(E,{maxLines:10,moreText:Object(n.__)("Read full review","woocommerce"),lessText:Object(n.__)("Hide full review","woocommerce"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(o.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(r))};r(191);var C=e=>{let{attributes:t,reviews:r}=e;const n=Object(l.getSetting)("showAvatars",!0),c=Object(l.getSetting)("reviewRatingsEnabled",!0),a=(n||"product"===t.imageType)&&t.showReviewImage,i=c&&t.showReviewRating,s={...t,showReviewImage:a,showReviewRating:i};return Object(o.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(o.createElement)(S,{attributes:s}):r.map((e,t)=>Object(o.createElement)(S,{key:e.id||t,attributes:s,review:e})))},T=r(6),P=r.n(T),N=r(25),L=r.n(N),x=r(57),A=r(28);class M extends s.Component{render(){const{attributes:e,error:t,isLoading:r,noReviewsPlaceholder:c,reviews:i,totalReviews:s}=this.props;if(t)return Object(o.createElement)(d.a,{className:"wc-block-featured-product-error",error:t,isLoading:r});if(0===i.length&&!r)return Object(o.createElement)(c,{attributes:e});const u=Object(l.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(a.Disabled,null,e.showOrderby&&u&&Object(o.createElement)(p,{readOnly:!0,value:e.orderby}),Object(o.createElement)(C,{attributes:e,reviews:i}),e.showLoadMore&&s>i.length&&Object(o.createElement)(b,{screenReaderLabel:Object(n.__)("Load more reviews","woocommerce")}))}}var I=(e=>{class t extends s.Component{constructor(){super(...arguments),h()(this,"isPreview",!!this.props.attributes.previewReviews),h()(this,"delayedAppendReviews",this.props.delayFunction(this.appendReviews)),h()(this,"isMounted",!1),h()(this,"state",{error:null,loading:!0,reviews:this.isPreview?this.props.attributes.previewReviews:[],totalReviews:this.isPreview?this.props.attributes.previewReviews.length:0}),h()(this,"setError",async e=>{if(!this.isMounted)return;const{onReviewsLoadError:t}=this.props,r=await Object(A.a)(e);this.setState({reviews:[],loading:!1,error:r}),t(r)})}componentDidMount(){this.isMounted=!0,this.replaceReviews()}componentDidUpdate(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}shouldReplaceReviews(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!L()(e.categoryIds,t.categoryIds)}componentWillUnmount(){this.isMounted=!1,this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}getArgs(e){const{categoryIds:t,order:r,orderby:o,productId:n,reviewsToDisplay:c}=this.props,a={order:r,orderby:o,per_page:c-e,offset:e};if(t){const e=Array.isArray(t)?t:JSON.parse(t);a.category_id=Array.isArray(e)?e.join(","):e}return n&&(a.product_id=n),a}replaceReviews(){if(this.isPreview)return;const{onReviewsReplaced:e}=this.props;this.updateListOfReviews().then(e)}appendReviews(){if(this.isPreview)return;const{onReviewsAppended:e,reviewsToDisplay:t}=this.props,{reviews:r}=this.state;t<=r.length||this.updateListOfReviews(r).then(e)}updateListOfReviews(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const{reviewsToDisplay:t}=this.props,{totalReviews:r}=this.state,o=Math.min(r,t)-e.length;return this.setState({loading:!0,reviews:e.concat(Array(o).fill({}))}),Object(x.c)(this.getArgs(e.length)).then(t=>{let{reviews:r,totalReviews:o}=t;return this.isMounted&&this.setState({reviews:e.filter(e=>Object.keys(e).length).concat(r),totalReviews:o,loading:!1,error:null}),{newReviews:r}}).catch(this.setError)}render(){const{reviewsToDisplay:t}=this.props,{error:r,loading:n,reviews:c,totalReviews:a}=this.state;return Object(o.createElement)(e,P()({},this.props,{error:r,isLoading:n,reviews:c.slice(0,t),totalReviews:a}))}}h()(t,"defaultProps",{delayFunction:e=>e,onReviewsAppended:()=>{},onReviewsLoadError:()=>{},onReviewsReplaced:()=>{}});const{displayName:r=e.name||"Component"}=e;return t.displayName=`WithReviews( ${r} )`,t})(M);t.a=e=>{let{attributes:t,icon:r,name:s,noReviewsPlaceholder:l}=e;const{categoryIds:d,productId:u,reviewsOnPageLoad:b,showProductName:w,showReviewDate:p,showReviewerName:m,showReviewContent:g,showReviewImage:v,showReviewRating:h}=t,{order:_,orderby:O}=Object(x.d)(t.orderby),j=!(g||h||p||m||v||w),f=Object(i.useBlockProps)({className:Object(x.a)(t)});return j?Object(o.createElement)(a.Placeholder,{icon:r,label:s},Object(n.__)("The content for this block is hidden due to block settings.","woocommerce")):Object(o.createElement)("div",f,Object(o.createElement)(I,{attributes:t,categoryIds:d,delayFunction:e=>Object(c.debounce)(e,400),noReviewsPlaceholder:l,orderby:O,order:_,productId:u,reviewsToDisplay:b}))}},166:function(e,t){},167:function(e,t){},190:function(e,t){},191:function(e,t){},192:function(e,t){},193:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},22:function(e,t,r){"use strict";r.d(t,"o",(function(){return c})),r.d(t,"m",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"n",(function(){return s})),r.d(t,"j",(function(){return l})),r.d(t,"e",(function(){return d})),r.d(t,"f",(function(){return u})),r.d(t,"g",(function(){return b})),r.d(t,"k",(function(){return w})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return m})),r.d(t,"h",(function(){return g})),r.d(t,"a",(function(){return v})),r.d(t,"i",(function(){return h})),r.d(t,"b",(function(){return _}));var o,n=r(2);const c=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",i=c.pluginUrl+"build/",s=c.buildPhase,l=null===(o=n.STORE_PAGES.shop)||void 0===o?void 0:o.permalink,d=n.STORE_PAGES.checkout.id,u=n.STORE_PAGES.checkout.permalink,b=n.STORE_PAGES.privacy.permalink,w=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),p=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),m=n.STORE_PAGES.cart.permalink,g=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),v=Object(n.getSetting)("allowedCountries",{}),h=Object(n.getSetting)("shippingStates",{}),_=Object(n.getSetting)("allowedStates",{})},25:function(e,t){e.exports=window.wp.isShallowEqual},28:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return a}));var o=r(1),n=r(15);const c=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},a=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(n.decodeEntities)(e.message):Object(o.__)("Something went wrong. Please contact us to get assistance.","woocommerce")}},29:function(e,t,r){"use strict";var o=r(0),n=r(4),c=r.n(n);t.a=e=>{let t,{label:r,screenReaderLabel:n,wrapperElement:a,wrapperProps:i={}}=e;const s=null!=r,l=null!=n;return!s&&l?(t=a||"span",i={...i,className:c()(i.className,"screen-reader-text")},Object(o.createElement)(t,i,n)):(t=a||o.Fragment,s&&l&&r!==n?Object(o.createElement)(t,i,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,i,r))}},3:function(e,t){e.exports=window.wp.components},34:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(35);t.a=e=>{let{error:t}=e;return Object(o.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:r}=e;return t?"general"===r?Object(o.createElement)("span",null,Object(n.__)("The following error was returned","woocommerce"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(c.escapeHTML)(t))):"api"===r?Object(o.createElement)("span",null,Object(n.__)("The following error was returned from the API","woocommerce"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(c.escapeHTML)(t))):t:Object(n.__)("An error has prevented the block from being updated.","woocommerce")})(t))}},35:function(e,t){e.exports=window.wp.escapeHtml},383:function(e,t,r){e.exports=r(501)},5:function(e,t){e.exports=window.wp.blockEditor},501:function(e,t,r){"use strict";r.r(t);var o=r(0),n=r(1),c=r(10),a=r(119),i=r(535),s=(r(166),r(5)),l=r(3),d=r(158),u=()=>Object(o.createElement)(l.Placeholder,{className:"wc-block-all-reviews",icon:Object(o.createElement)(a.a,{icon:i.a,className:"block-editor-block-icon"}),label:Object(n.__)("All Reviews","woocommerce")},Object(n.__)("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.","woocommerce")),b=r(112),w=r(152),p=r(153),m=r(129);Object(c.registerBlockType)("woocommerce/all-reviews",{apiVersion:2,title:Object(n.__)("All Reviews","woocommerce"),icon:{src:Object(o.createElement)(a.a,{icon:i.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(n.__)("WooCommerce","woocommerce")],description:Object(n.__)("Show a list of all product reviews.","woocommerce"),supports:{html:!1,color:{background:!1},typography:{fontSize:!0}},example:{...m.a,attributes:{...m.a.attributes,showProductName:!0}},attributes:{...w.a,showProductName:{type:"boolean",default:!0}},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:r}=e;return"woocommerce_recent_reviews"===t&&!(null==r||!r.raw)},transform:e=>{let{instance:t}=e;return Object(c.createBlock)("woocommerce/all-reviews",{reviewsOnPageLoad:t.raw.number,imageType:"product",showLoadMore:!1,showOrderby:!1,showReviewDate:!1,showReviewContent:!1})}}]},edit:e=>{let{attributes:t,setAttributes:r}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(s.InspectorControls,{key:"inspector"},Object(o.createElement)(l.PanelBody,{title:Object(n.__)("Content","woocommerce")},Object(o.createElement)(l.ToggleControl,{label:Object(n.__)("Product name","woocommerce"),checked:t.showProductName,onChange:()=>r({showProductName:!t.showProductName})}),Object(b.b)(t,r)),Object(o.createElement)(l.PanelBody,{title:Object(n.__)("List Settings","woocommerce")},Object(b.c)(t,r))),Object(o.createElement)(d.a,{attributes:t,icon:Object(o.createElement)(a.a,{icon:i.a,className:"block-editor-block-icon"}),name:Object(n.__)("All Reviews","woocommerce"),noReviewsPlaceholder:u}))},save:p.a})},57: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 d})),r.d(t,"b",(function(){return u}));var o=r(14),n=r.n(o),c=r(4),a=r.n(c),i=r(2);const s=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=e=>n()({path:"/wc/store/v1/products/reviews?"+Object.entries(e).map(e=>e.join("=")).join("&"),parse:!1}).then(e=>e.json().then(t=>({reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}))),d=e=>{const{className:t,categoryIds:r,productId:o,showReviewDate:n,showReviewerName:c,showReviewContent:i,showProductName:s,showReviewImage:l,showReviewRating:d}=e;let u="wc-block-all-reviews";return o&&(u="wc-block-reviews-by-product"),Array.isArray(r)&&(u="wc-block-reviews-by-category"),a()(u,t,{"has-image":l,"has-name":c,"has-date":n,"has-rating":d,"has-content":i,"has-product-name":s})},u=e=>{const{categoryIds:t,imageType:r,orderby:o,productId:n,reviewsOnPageLoad:c,reviewsOnLoadMore:a,showLoadMore:i,showOrderby:s}=e,l={"data-image-type":r,"data-orderby":o,"data-reviews-on-page-load":c,"data-reviews-on-load-more":a,"data-show-load-more":i,"data-show-orderby":s};return n&&(l["data-product-id"]=n),Array.isArray(t)&&(l["data-category-ids"]=t.join(",")),l}},75:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(119),a=r(184),i=r(4),s=r.n(i),l=r(3),d=r(34);r(120),t.a=e=>{let{className:t,error:r,isLoading:i=!1,onRetry:u}=e;return Object(o.createElement)(l.Placeholder,{icon:Object(o.createElement)(c.a,{icon:a.a}),label:Object(n.__)("Sorry, an error occurred","woocommerce"),className:s()("wc-block-api-error",t)},Object(o.createElement)(d.a,{error:r}),u&&Object(o.createElement)(o.Fragment,null,i?Object(o.createElement)(l.Spinner,null):Object(o.createElement)(l.Button,{isSecondary:!0,onClick:u},Object(n.__)("Retry","woocommerce"))))}},8:function(e,t){e.exports=window.lodash}});
|
1 |
+
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-reviews"]=function(e){function t(t){for(var o,a,i=t[0],s=t[1],l=t[2],u=0,b=[];u<i.length;u++)a=i[u],Object.prototype.hasOwnProperty.call(n,a)&&n[a]&&b.push(n[a][0]),n[a]=0;for(o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o]);for(d&&d(t);b.length;)b.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],o=!0,i=1;i<r.length;i++){var s=r[i];0!==n[s]&&(o=!1)}o&&(c.splice(t--,1),e=a(a.s=r[0]))}return e}var o={},n={7:0},c=[];function a(t){if(o[t])return o[t].exports;var r=o[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=o,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 o in e)a.d(r,o,function(t){return e[t]}.bind(null,o));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 d=s;return c.push([383,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.blocks},11:function(e,t){e.exports=window.wp.compose},112:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"c",(function(){return d}));var o=r(0),n=r(1),c=r(5),a=r(2),i=r(3);const s=(e,t,r)=>Object(o.createElement)(c.BlockControls,null,Object(o.createElement)(i.ToolbarGroup,{controls:[{icon:"edit",title:r,onClick:()=>t({editMode:!e}),isActive:e}]})),l=(e,t)=>{const r=Object(a.getSetting)("showAvatars",!0),c=Object(a.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Product rating","woocommerce"),checked:e.showReviewRating,onChange:()=>t({showReviewRating:!e.showReviewRating})}),e.showReviewRating&&!c&&Object(o.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(n.__)("Product rating is disabled in your <a>store settings</a>.","woocommerce"),{a:Object(o.createElement)("a",{href:Object(a.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Reviewer name","woocommerce"),checked:e.showReviewerName,onChange:()=>t({showReviewerName:!e.showReviewerName})}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Image","woocommerce"),checked:e.showReviewImage,onChange:()=>t({showReviewImage:!e.showReviewImage})}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Review date","woocommerce"),checked:e.showReviewDate,onChange:()=>t({showReviewDate:!e.showReviewDate})}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Review content","woocommerce"),checked:e.showReviewContent,onChange:()=>t({showReviewContent:!e.showReviewContent})}),e.showReviewImage&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.__experimentalToggleGroupControl,{label:Object(n.__)("Review image","woocommerce"),value:e.imageType,onChange:e=>t({imageType:e})},Object(o.createElement)(i.__experimentalToggleGroupControlOption,{value:"reviewer",label:Object(n.__)("Reviewer photo","woocommerce")}),Object(o.createElement)(i.__experimentalToggleGroupControlOption,{value:"product",label:Object(n.__)("Product","woocommerce")})),"reviewer"===e.imageType&&!r&&Object(o.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(n.__)("Reviewer photo is disabled in your <a>site settings</a>.","woocommerce"),{a:Object(o.createElement)("a",{href:Object(a.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},d=(e,t)=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Order by","woocommerce"),checked:e.showOrderby,onChange:()=>t({showOrderby:!e.showOrderby})}),Object(o.createElement)(i.SelectControl,{label:Object(n.__)("Order Product Reviews by","woocommerce"),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:e=>t({orderby:e})}),Object(o.createElement)(i.RangeControl,{label:Object(n.__)("Starting Number of Reviews","woocommerce"),value:e.reviewsOnPageLoad,onChange:e=>t({reviewsOnPageLoad:e}),max:20,min:1}),Object(o.createElement)(i.ToggleControl,{label:Object(n.__)("Load more","woocommerce"),checked:e.showLoadMore,onChange:()=>t({showLoadMore:!e.showLoadMore})}),e.showLoadMore&&Object(o.createElement)(i.RangeControl,{label:Object(n.__)("Load More Reviews","woocommerce"),value:e.reviewsOnLoadMore,onChange:e=>t({reviewsOnLoadMore:e}),max:20,min:1}))},119:function(e,t){},12:function(e,t){e.exports=window.React},122:function(e,t,r){"use strict";var o=r(0),n=r(4),c=r.n(n),a=r(29),i=r(11);r(167),t.a=Object(i.withInstanceId)(e=>{let{className:t,instanceId:r,label:n="",onChange:i,options:s,screenReaderLabel:l,value:d=""}=e;const u="wc-block-components-sort-select__select-"+r;return Object(o.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(o.createElement)(a.a,{label:n,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:u}}),Object(o.createElement)("select",{id:u,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:i,value:d},s&&s.map(e=>Object(o.createElement)("option",{key:e.key,value:e.key},e.label))))})},128:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var o=r(1),n=r(22);const 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(o.__)("July 15, 2019","woocommerce"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(o.__)("WordPress Pennant","woocommerce"),product_permalink:"#",
|
2 |
/* translators: An example person name used for the block previews. */
|
3 |
reviewer:Object(o.__)("Alice","woocommerce"),review:`<p>${Object(o.__)("I bought this product last week and I'm very happy with it.","woocommerce")}</p>\n`,reviewer_avatar_urls:{48:n.o.defaultAvatar,96:n.o.defaultAvatar},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(o.__)("July 12, 2019","woocommerce"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(o.__)("WordPress Pennant","woocommerce"),product_permalink:"#",
|
4 |
/* translators: An example person name used for the block previews. */
|
5 |
+
reviewer:Object(o.__)("Bob","woocommerce"),review:`<p>${Object(o.__)("This product is awesome, I love it!","woocommerce")}</p>\n`,reviewer_avatar_urls:{48:n.o.defaultAvatar,96:n.o.defaultAvatar},rating:null,verified:!1}]}}},13:function(e,t){e.exports=window.wp.primitives},14:function(e,t){e.exports=window.wp.apiFetch},15:function(e,t){e.exports=window.wp.htmlEntities},152: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}}},153:function(e,t,r){"use strict";var o=r(6),n=r.n(o),c=r(0),a=r(5),i=(r(166),r(57));t.a=e=>{let{attributes:t}=e;return Object(c.createElement)("div",n()({},a.useBlockProps.save({className:Object(i.a)(t)}),Object(i.b)(t)))}},158:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(8),a=r(3),i=r(5),s=r(12),l=r(2),d=r(75),u=r(29);r(193);var b=e=>{let{onClick:t,label:r=Object(n.__)("Load more","woocommerce"),screenReaderLabel:c=Object(n.__)("Load more","woocommerce")}=e;return Object(o.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(o.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(o.createElement)(u.a,{label:r,screenReaderLabel:c})))},w=r(122);r(190);var p=e=>{let{onChange:t,readOnly:r,value:c}=e;return Object(o.createElement)(w.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",label:Object(n.__)("Order by","woocommerce"),onChange:t,options:[{key:"most-recent",label:Object(n.__)("Most recent","woocommerce")},{key:"highest-rating",label:Object(n.__)("Highest rating","woocommerce")},{key:"lowest-rating",label:Object(n.__)("Lowest rating","woocommerce")}],readOnly:r,screenReaderLabel:Object(n.__)("Order reviews by","woocommerce"),value:c})},m=r(4),g=r.n(m),v=r(24),h=r.n(v),_=r(177),O=r.n(_);const j=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";const o=O()(e,{suffix:r,limit:t});return o.html},f=(e,t,r)=>(t<=r?e.start=e.middle+1:e.end=e.middle-1,e),k=(e,t,r,o)=>{const n=((e,t,r)=>{let o={start:0,middle:0,end:e.length};for(;o.start<=o.end;)o.middle=Math.floor((o.start+o.end)/2),t.innerHTML=j(e,o.middle),o=f(o,t.clientHeight,r);return o.middle})(e,t,r);return j(e,n-o.length,o)},y={className:"read-more-content",ellipsis:"…",lessText:Object(n.__)("Read less","woocommerce"),maxLines:3,moreText:Object(n.__)("Read more","woocommerce")};class R extends s.Component{constructor(e){super(e),this.state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},this.reviewContent=Object(s.createRef)(),this.reviewSummary=Object(s.createRef)(),this.getButton=this.getButton.bind(this),this.onClick=this.onClick.bind(this)}componentDidMount(){this.setSummary()}componentDidUpdate(e){e.maxLines===this.props.maxLines&&e.children===this.props.children||this.setState({clampEnabled:null,summary:"."},this.setSummary)}setSummary(){if(this.props.children){const{maxLines:e,ellipsis:t}=this.props;if(!this.reviewSummary.current||!this.reviewContent.current)return;const r=(this.reviewSummary.current.clientHeight+1)*e+1,o=this.reviewContent.current.clientHeight+1>r;this.setState({clampEnabled:o}),o&&this.setState({summary:k(this.reviewContent.current.innerHTML,this.reviewSummary.current,r,t)})}}getButton(){const{isExpanded:e}=this.state,{className:t,lessText:r,moreText:n}=this.props,c=e?r:n;if(c)return Object(o.createElement)("a",{href:"#more",className:t+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}onClick(e){e.preventDefault();const{isExpanded:t}=this.state;this.setState({isExpanded:!t})}render(){const{className:e}=this.props,{content:t,summary:r,clampEnabled:n,isExpanded:c}=this.state;return t?!1===n?Object(o.createElement)("div",{className:e},Object(o.createElement)("div",{ref:this.reviewContent},t)):Object(o.createElement)("div",{className:e},(!c||null===n)&&Object(o.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:r}}),(c||null===n)&&Object(o.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},t),this.getButton()):null}}h()(R,"defaultProps",y);var E=R;r(192);var S=e=>{let{attributes:t,review:r={}}=e;const{imageType:c,showReviewDate:a,showReviewerName:i,showReviewImage:s,showReviewRating:l,showReviewContent:d,showProductName:u}=t,{rating:b}=r,w=!Object.keys(r).length>0,p=Number.isFinite(b)&&l;return Object(o.createElement)("li",{className:g()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":w,"wc-block-components-review-list-item__item--has-image":s}),"aria-hidden":w},(u||a||i||s||p)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},s&&function(e,t,r){var c,a;return r||!e?Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"}):Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(o.createElement)("img",{"aria-hidden":"true",alt:(null===(c=e.product_image)||void 0===c?void 0:c.alt)||"",src:(null===(a=e.product_image)||void 0===a?void 0:a.thumbnail)||""}):Object(o.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[96]||""}),e.verified&&Object(o.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(n.__)("Verified buyer","woocommerce")},Object(n.__)("Verified buyer","woocommerce")))}(r,c,w),(u||i||p||a)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},p&&function(e){const{rating:t}=e,r={width:t/5*100+"%"},c=Object(n.sprintf)(
|
6 |
/* translators: %f is referring to the average rating value */
|
7 |
Object(n.__)("Rated %f out of 5","woocommerce"),t),a={__html:Object(n.sprintf)(
|
8 |
/* translators: %s is referring to the average rating value */
|
9 |
+
Object(n.__)("Rated %s out of 5","woocommerce"),Object(n.sprintf)('<strong class="rating">%f</strong>',t))};return Object(o.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(o.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":c},Object(o.createElement)("span",{style:r,dangerouslySetInnerHTML:a})))}(r),u&&function(e){return Object(o.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(o.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(r),i&&function(e){const{reviewer:t=""}=e;return Object(o.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},t)}(r),a&&function(e){const{date_created:t,formatted_date_created:r}=e;return Object(o.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(r))),d&&function(e){return Object(o.createElement)(E,{maxLines:10,moreText:Object(n.__)("Read full review","woocommerce"),lessText:Object(n.__)("Hide full review","woocommerce"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(o.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(r))};r(191);var C=e=>{let{attributes:t,reviews:r}=e;const n=Object(l.getSetting)("showAvatars",!0),c=Object(l.getSetting)("reviewRatingsEnabled",!0),a=(n||"product"===t.imageType)&&t.showReviewImage,i=c&&t.showReviewRating,s={...t,showReviewImage:a,showReviewRating:i};return Object(o.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(o.createElement)(S,{attributes:s}):r.map((e,t)=>Object(o.createElement)(S,{key:e.id||t,attributes:s,review:e})))},T=r(6),P=r.n(T),N=r(25),L=r.n(N),x=r(57),A=r(28);class M extends s.Component{render(){const{attributes:e,error:t,isLoading:r,noReviewsPlaceholder:c,reviews:i,totalReviews:s}=this.props;if(t)return Object(o.createElement)(d.a,{className:"wc-block-featured-product-error",error:t,isLoading:r});if(0===i.length&&!r)return Object(o.createElement)(c,{attributes:e});const u=Object(l.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(a.Disabled,null,e.showOrderby&&u&&Object(o.createElement)(p,{readOnly:!0,value:e.orderby}),Object(o.createElement)(C,{attributes:e,reviews:i}),e.showLoadMore&&s>i.length&&Object(o.createElement)(b,{screenReaderLabel:Object(n.__)("Load more reviews","woocommerce")}))}}var I=(e=>{class t extends s.Component{constructor(){super(...arguments),h()(this,"isPreview",!!this.props.attributes.previewReviews),h()(this,"delayedAppendReviews",this.props.delayFunction(this.appendReviews)),h()(this,"isMounted",!1),h()(this,"state",{error:null,loading:!0,reviews:this.isPreview?this.props.attributes.previewReviews:[],totalReviews:this.isPreview?this.props.attributes.previewReviews.length:0}),h()(this,"setError",async e=>{if(!this.isMounted)return;const{onReviewsLoadError:t}=this.props,r=await Object(A.a)(e);this.setState({reviews:[],loading:!1,error:r}),t(r)})}componentDidMount(){this.isMounted=!0,this.replaceReviews()}componentDidUpdate(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}shouldReplaceReviews(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!L()(e.categoryIds,t.categoryIds)}componentWillUnmount(){this.isMounted=!1,this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}getArgs(e){const{categoryIds:t,order:r,orderby:o,productId:n,reviewsToDisplay:c}=this.props,a={order:r,orderby:o,per_page:c-e,offset:e};if(t){const e=Array.isArray(t)?t:JSON.parse(t);a.category_id=Array.isArray(e)?e.join(","):e}return n&&(a.product_id=n),a}replaceReviews(){if(this.isPreview)return;const{onReviewsReplaced:e}=this.props;this.updateListOfReviews().then(e)}appendReviews(){if(this.isPreview)return;const{onReviewsAppended:e,reviewsToDisplay:t}=this.props,{reviews:r}=this.state;t<=r.length||this.updateListOfReviews(r).then(e)}updateListOfReviews(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const{reviewsToDisplay:t}=this.props,{totalReviews:r}=this.state,o=Math.min(r,t)-e.length;return this.setState({loading:!0,reviews:e.concat(Array(o).fill({}))}),Object(x.c)(this.getArgs(e.length)).then(t=>{let{reviews:r,totalReviews:o}=t;return this.isMounted&&this.setState({reviews:e.filter(e=>Object.keys(e).length).concat(r),totalReviews:o,loading:!1,error:null}),{newReviews:r}}).catch(this.setError)}render(){const{reviewsToDisplay:t}=this.props,{error:r,loading:n,reviews:c,totalReviews:a}=this.state;return Object(o.createElement)(e,P()({},this.props,{error:r,isLoading:n,reviews:c.slice(0,t),totalReviews:a}))}}h()(t,"defaultProps",{delayFunction:e=>e,onReviewsAppended:()=>{},onReviewsLoadError:()=>{},onReviewsReplaced:()=>{}});const{displayName:r=e.name||"Component"}=e;return t.displayName=`WithReviews( ${r} )`,t})(M);t.a=e=>{let{attributes:t,icon:r,name:s,noReviewsPlaceholder:l}=e;const{categoryIds:d,productId:u,reviewsOnPageLoad:b,showProductName:w,showReviewDate:p,showReviewerName:m,showReviewContent:g,showReviewImage:v,showReviewRating:h}=t,{order:_,orderby:O}=Object(x.d)(t.orderby),j=!(g||h||p||m||v||w),f=Object(i.useBlockProps)({className:Object(x.a)(t)});return j?Object(o.createElement)(a.Placeholder,{icon:r,label:s},Object(n.__)("The content for this block is hidden due to block settings.","woocommerce")):Object(o.createElement)("div",f,Object(o.createElement)(I,{attributes:t,categoryIds:d,delayFunction:e=>Object(c.debounce)(e,400),noReviewsPlaceholder:l,orderby:O,order:_,productId:u,reviewsToDisplay:b}))}},166:function(e,t){},167:function(e,t){},190:function(e,t){},191:function(e,t){},192:function(e,t){},193:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},22:function(e,t,r){"use strict";r.d(t,"o",(function(){return c})),r.d(t,"m",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"n",(function(){return s})),r.d(t,"j",(function(){return l})),r.d(t,"e",(function(){return d})),r.d(t,"f",(function(){return u})),r.d(t,"g",(function(){return b})),r.d(t,"k",(function(){return w})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return m})),r.d(t,"h",(function(){return g})),r.d(t,"a",(function(){return v})),r.d(t,"i",(function(){return h})),r.d(t,"b",(function(){return _}));var o,n=r(2);const c=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",i=c.pluginUrl+"build/",s=c.buildPhase,l=null===(o=n.STORE_PAGES.shop)||void 0===o?void 0:o.permalink,d=n.STORE_PAGES.checkout.id,u=n.STORE_PAGES.checkout.permalink,b=n.STORE_PAGES.privacy.permalink,w=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),p=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),m=n.STORE_PAGES.cart.permalink,g=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),v=Object(n.getSetting)("allowedCountries",{}),h=Object(n.getSetting)("shippingStates",{}),_=Object(n.getSetting)("allowedStates",{})},25:function(e,t){e.exports=window.wp.isShallowEqual},28:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return a}));var o=r(1),n=r(15);const c=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},a=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return null!=e&&e.message?Object(n.decodeEntities)(e.message):Object(o.__)("Something went wrong. Please contact us to get assistance.","woocommerce")}},29:function(e,t,r){"use strict";var o=r(0),n=r(4),c=r.n(n);t.a=e=>{let t,{label:r,screenReaderLabel:n,wrapperElement:a,wrapperProps:i={}}=e;const s=null!=r,l=null!=n;return!s&&l?(t=a||"span",i={...i,className:c()(i.className,"screen-reader-text")},Object(o.createElement)(t,i,n)):(t=a||o.Fragment,s&&l&&r!==n?Object(o.createElement)(t,i,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,i,r))}},3:function(e,t){e.exports=window.wp.components},33:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(34);t.a=e=>{let{error:t}=e;return Object(o.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:r}=e;return t?"general"===r?Object(o.createElement)("span",null,Object(n.__)("The following error was returned","woocommerce"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(c.escapeHTML)(t))):"api"===r?Object(o.createElement)("span",null,Object(n.__)("The following error was returned from the API","woocommerce"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(c.escapeHTML)(t))):t:Object(n.__)("An error has prevented the block from being updated.","woocommerce")})(t))}},34:function(e,t){e.exports=window.wp.escapeHtml},383:function(e,t,r){e.exports=r(501)},5:function(e,t){e.exports=window.wp.blockEditor},501:function(e,t,r){"use strict";r.r(t);var o=r(0),n=r(1),c=r(10),a=r(118),i=r(535),s=(r(166),r(5)),l=r(3),d=r(158),u=()=>Object(o.createElement)(l.Placeholder,{className:"wc-block-all-reviews",icon:Object(o.createElement)(a.a,{icon:i.a,className:"block-editor-block-icon"}),label:Object(n.__)("All Reviews","woocommerce")},Object(n.__)("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.","woocommerce")),b=r(112),w=r(152),p=r(153),m=r(128);Object(c.registerBlockType)("woocommerce/all-reviews",{apiVersion:2,title:Object(n.__)("All Reviews","woocommerce"),icon:{src:Object(o.createElement)(a.a,{icon:i.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(n.__)("WooCommerce","woocommerce")],description:Object(n.__)("Show a list of all product reviews.","woocommerce"),supports:{html:!1,color:{background:!1},typography:{fontSize:!0}},example:{...m.a,attributes:{...m.a.attributes,showProductName:!0}},attributes:{...w.a,showProductName:{type:"boolean",default:!0}},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:r}=e;return"woocommerce_recent_reviews"===t&&!(null==r||!r.raw)},transform:e=>{let{instance:t}=e;return Object(c.createBlock)("woocommerce/all-reviews",{reviewsOnPageLoad:t.raw.number,imageType:"product",showLoadMore:!1,showOrderby:!1,showReviewDate:!1,showReviewContent:!1})}}]},edit:e=>{let{attributes:t,setAttributes:r}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(s.InspectorControls,{key:"inspector"},Object(o.createElement)(l.PanelBody,{title:Object(n.__)("Content","woocommerce")},Object(o.createElement)(l.ToggleControl,{label:Object(n.__)("Product name","woocommerce"),checked:t.showProductName,onChange:()=>r({showProductName:!t.showProductName})}),Object(b.b)(t,r)),Object(o.createElement)(l.PanelBody,{title:Object(n.__)("List Settings","woocommerce")},Object(b.c)(t,r))),Object(o.createElement)(d.a,{attributes:t,icon:Object(o.createElement)(a.a,{icon:i.a,className:"block-editor-block-icon"}),name:Object(n.__)("All Reviews","woocommerce"),noReviewsPlaceholder:u}))},save:p.a})},57: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 d})),r.d(t,"b",(function(){return u}));var o=r(14),n=r.n(o),c=r(4),a=r.n(c),i=r(2);const s=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=e=>n()({path:"/wc/store/v1/products/reviews?"+Object.entries(e).map(e=>e.join("=")).join("&"),parse:!1}).then(e=>e.json().then(t=>({reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}))),d=e=>{const{className:t,categoryIds:r,productId:o,showReviewDate:n,showReviewerName:c,showReviewContent:i,showProductName:s,showReviewImage:l,showReviewRating:d}=e;let u="wc-block-all-reviews";return o&&(u="wc-block-reviews-by-product"),Array.isArray(r)&&(u="wc-block-reviews-by-category"),a()(u,t,{"has-image":l,"has-name":c,"has-date":n,"has-rating":d,"has-content":i,"has-product-name":s})},u=e=>{const{categoryIds:t,imageType:r,orderby:o,productId:n,reviewsOnPageLoad:c,reviewsOnLoadMore:a,showLoadMore:i,showOrderby:s}=e,l={"data-image-type":r,"data-orderby":o,"data-reviews-on-page-load":c,"data-reviews-on-load-more":a,"data-show-load-more":i,"data-show-orderby":s};return n&&(l["data-product-id"]=n),Array.isArray(t)&&(l["data-category-ids"]=t.join(",")),l}},75:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(118),a=r(184),i=r(4),s=r.n(i),l=r(3),d=r(33);r(119),t.a=e=>{let{className:t,error:r,isLoading:i=!1,onRetry:u}=e;return Object(o.createElement)(l.Placeholder,{icon:Object(o.createElement)(c.a,{icon:a.a}),label:Object(n.__)("Sorry, an error occurred","woocommerce"),className:s()("wc-block-api-error",t)},Object(o.createElement)(d.a,{error:r}),u&&Object(o.createElement)(o.Fragment,null,i?Object(o.createElement)(l.Spinner,null):Object(o.createElement)(l.Button,{isSecondary:!0,onClick:u},Object(n.__)("Retry","woocommerce"))))}},8:function(e,t){e.exports=window.lodash}});
|
packages/woocommerce-blocks/build/attribute-filter-frontend.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning'), 'version' => '464d783b295444504af1bb84dce10fb4');
|
packages/woocommerce-blocks/build/attribute-filter-frontend.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=243)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t){e.exports=window.wp.data},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var s=typeof r;if("string"===s||"number"===s)e.push(r);else if(Array.isArray(r)){if(r.length){var i=o.apply(null,r);i&&e.push(i)}}else if("object"===s)if(r.toString===Object.prototype.toString)for(var c in r)n.call(r,c)&&r[c]&&e.push(c);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.React},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=window.wc.blocksCheckout},function(e,t){e.exports=window.wp.compose},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.__esModule=!0,e.exports.default=e.exports,n.apply(this,arguments)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t){e.exports=window.wp.url},function(e,t){e.exports=window.wp.primitives},function(e,t,n){"use strict";var r=n(16),o=n.n(r),s=n(0),i=n(7),c=n(1),a=n(44),l=e=>{let{imageUrl:t=a.l+"/block-error.svg",header:n=Object(c.__)("Oops!","woocommerce"),text:r=Object(c.__)("There was an error loading the content.","woocommerce"),errorMessage:o,errorMessagePrefix:i=Object(c.__)("Error:","woocommerce"),button:l,showErrorBlock:u=!0}=e;return u?Object(s.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(s.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(s.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},n&&Object(s.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},n),r&&Object(s.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},r),o&&Object(s.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},i?i+" ":"",o),l&&Object(s.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};n(33);class u extends i.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(s.createElement)(s.Fragment,null,Object(s.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:n=!0,showErrorBlock:r=!0,text:o,errorMessagePrefix:i,renderError:c,button:a}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof c?c({errorMessage:u}):Object(s.createElement)(l,{showErrorBlock:r,errorMessage:n?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:i,button:a}):this.props.children}}t.a=u},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.__esModule=!0,e.exports.default=e.exports},,function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return r(e)&&t in e}},,function(e,t){e.exports=window.wp.deprecated},function(e,t){e.exports=window.wp.htmlEntities},function(e,t,n){"use strict";var r=n(0),o=n(5),s=n.n(o);t.a=e=>{let t,{label:n,screenReaderLabel:o,wrapperElement:i,wrapperProps:c={}}=e;const a=null!=n,l=null!=o;return!a&&l?(t=i||"span",c={...c,className:s()(c.className,"screen-reader-text")},Object(r.createElement)(t,c,o)):(t=i||r.Fragment,a&&l&&n!==o?Object(r.createElement)(t,c,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,c,n))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(0);const o=Object(r.createContext)("page"),s=()=>Object(r.useContext)(o);o.Provider},function(e,t){e.exports=window.wp.a11y},,function(e,t,n){"use strict";(function(e){var r=n(0);n(37);const o=Object(r.createContext)({slots:{},fills:{},registerSlot:()=>{void 0!==e&&e.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});t.a=o}).call(this,n(65))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(12),s=n.n(o);function i(e){const t=Object(r.useRef)(e);return s()(e,t.current)||(t.current=e),t.current}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"string"==typeof e},,function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return f}));var r=n(3),o=n(4),s=n(0),i=n(12),c=n.n(i),a=n(27),l=n(61),u=n(23);const d=e=>{const t=Object(u.a)();e=e||t;const n=Object(o.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:i}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[n,Object(s.useCallback)(t=>{i(e,t)},[e,i])]},p=(e,t,n)=>{const i=Object(u.a)();n=n||i;const c=Object(o.useSelect)(o=>o(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t),[n,e]),{setQueryValue:a}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[c,Object(s.useCallback)(t=>{a(n,e,t)},[n,e,a])]},f=(e,t)=>{const n=Object(u.a)();t=t||n;const[r,o]=d(t),i=Object(a.a)(r),p=Object(a.a)(e),f=Object(l.a)(p),b=Object(s.useRef)(!1);return Object(s.useEffect)(()=>{c()(f,p)||(o(Object.assign({},i,p)),b.current=!0)},[i,p,f,o]),b.current?[r,o]:[e,o]}},,,function(e,t){},,function(e,t,n){"use strict";var r=n(5),o=n.n(r),s=n(0);t.a=Object(s.forwardRef)((function({as:e="div",className:t,...n},r){return function({as:e="div",...t}){return"function"==typeof t.children?t.children(t):Object(s.createElement)(e,t)}({as:e,className:o()("components-visually-hidden",t),...n,ref:r})}))},,function(e,t){e.exports=window.wp.warning},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(11),o=n.n(r),s=n(0),i=n(15);const c=[".wp-block-woocommerce-cart"],a=e=>{let{Block:t,containers:n,getProps:r=(()=>({})),getErrorBoundaryProps:c=(()=>({}))}=e;0!==n.length&&Array.prototype.forEach.call(n,(e,n)=>{const a=r(e,n),l=c(e,n),u={...e.dataset,...a.attributes||{}};(e=>{let{Block:t,container:n,attributes:r={},props:c={},errorBoundaryProps:a={}}=e;Object(s.render)(Object(s.createElement)(i.a,a,Object(s.createElement)(s.Suspense,{fallback:Object(s.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(s.createElement)(t,o()({},c,{attributes:r})))),n,()=>{n.classList&&n.classList.remove("is-loading")})})({Block:t,container:e,props:a,attributes:u,errorBoundaryProps:l})})},l=e=>{const t=document.body.querySelectorAll(c.join(",")),{Block:n,getProps:r,getErrorBoundaryProps:o,selector:s}=e;(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrappers:s}=e;const i=document.body.querySelectorAll(o);s&&s.length>0&&Array.prototype.filter.call(i,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,s)),a({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})})({Block:n,getProps:r,getErrorBoundaryProps:o,selector:s,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrapper:s}=e;const i=s.querySelectorAll(o);a({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})})({...e,wrapper:t})})})}},,function(e,t,n){"use strict";var r=n(8),o=n(0),s=n(14),i=function({icon:e,className:t,...n}){const s=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return Object(o.createElement)("span",Object(r.a)({className:s},n))};t.a=function({icon:e=null,size:t=24,...n}){if("string"==typeof e)return Object(o.createElement)(i,Object(r.a)({icon:e},n));if(Object(o.isValidElement)(e)&&i===e.type)return Object(o.cloneElement)(e,{...n});if("function"==typeof e)return e.prototype instanceof o.Component?Object(o.createElement)(e,{size:t,...n}):e({size:t,...n});if(e&&("svg"===e.type||e.type===s.SVG)){const r={width:t,height:t,...e.props,...n};return Object(o.createElement)(s.SVG,r)}return Object(o.isValidElement)(e)?Object(o.cloneElement)(e,{size:t,...n}):e}},,,function(e,t,n){"use strict";var r=n(8),o=n(0),s=n(5),i=n.n(s),c=n(6),a=n(20),l=n.n(a),u=n(10),d=n(45),p=n(90),f=n(1);function b(e,t,n){const{defaultView:r}=t,{frameElement:o}=r;if(!o||t===n.ownerDocument)return e;const s=o.getBoundingClientRect();return new r.DOMRect(e.left+s.left,e.top+s.top,e.width,e.height)}let m=0;function h(e){const t=document.scrollingElement||document.body;e&&(m=t.scrollTop);const n=e?"add":"remove";t.classList[n]("lockscroll"),document.documentElement.classList[n]("lockscroll"),e||(t.scrollTop=m)}let g=0;function O(){return Object(o.useEffect)(()=>(0===g&&h(!0),++g,()=>{1===g&&h(!1),--g}),[]),null}var v=n(26);function j(e){const t=Object(o.useContext)(v.a),n=t.slots[e]||{},r=t.fills[e],s=Object(o.useMemo)(()=>r||[],[r]);return{...n,updateSlot:Object(o.useCallback)(n=>{t.updateSlot(e,n)},[e,t.updateSlot]),unregisterSlot:Object(o.useCallback)(n=>{t.unregisterSlot(e,n)},[e,t.unregisterSlot]),fills:s,registerFill:Object(o.useCallback)(n=>{t.registerFill(e,n)},[e,t.registerFill]),unregisterFill:Object(o.useCallback)(n=>{t.unregisterFill(e,n)},[e,t.unregisterFill])}}var w=Object(o.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});function y({name:e,children:t,registerFill:n,unregisterFill:r}){const s=(e=>{const{getSlot:t,subscribe:n}=Object(o.useContext)(w),[r,s]=Object(o.useState)(t(e));return Object(o.useEffect)(()=>(s(t(e)),n(()=>{s(t(e))})),[e]),r})(e),i=Object(o.useRef)({name:e,children:t});return Object(o.useLayoutEffect)(()=>(n(e,i.current),()=>r(e,i.current)),[]),Object(o.useLayoutEffect)(()=>{i.current.children=t,s&&s.forceUpdate()},[t]),Object(o.useLayoutEffect)(()=>{e!==i.current.name&&(r(i.current.name,i.current),i.current.name=e,n(e,i.current))},[e]),s&&s.node?(Object(c.isFunction)(t)&&(t=t(s.props.fillProps)),Object(o.createPortal)(t,s.node)):null}var E=e=>Object(o.createElement)(w.Consumer,null,({registerFill:t,unregisterFill:n})=>Object(o.createElement)(y,Object(r.a)({},e,{registerFill:t,unregisterFill:n})));class k extends o.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:n,registerSlot:r}=this.props;e.name!==t&&(n(e.name),r(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:n={},getFills:r}=this.props,s=Object(c.map)(r(t,this),e=>{const t=Object(c.isFunction)(e.children)?e.children(n):e.children;return o.Children.map(t,(e,t)=>{if(!e||Object(c.isString)(e))return e;const n=e.key||t;return Object(o.cloneElement)(e,{key:n})})}).filter(Object(c.negate)(o.isEmptyElement));return Object(o.createElement)(o.Fragment,null,Object(c.isFunction)(e)?e(s):s)}}var _=e=>Object(o.createElement)(w.Consumer,null,({registerSlot:t,unregisterSlot:n,getFills:s})=>Object(o.createElement)(k,Object(r.a)({},e,{registerSlot:t,unregisterSlot:n,getFills:s})));function S(){const[,e]=Object(o.useState)({}),t=Object(o.useRef)(!0);return Object(o.useEffect)(()=>()=>{t.current=!1},[]),()=>{t.current&&e({})}}function x({name:e,children:t}){const n=j(e),r=Object(o.useRef)({rerender:S()});return Object(o.useEffect)(()=>(n.registerFill(r),()=>{n.unregisterFill(r)}),[n.registerFill,n.unregisterFill]),n.ref&&n.ref.current?("function"==typeof t&&(t=t(n.fillProps)),Object(o.createPortal)(t,n.ref.current)):null}var T=Object(o.forwardRef)((function({name:e,fillProps:t={},as:n="div",...s},i){const c=Object(o.useContext)(v.a),a=Object(o.useRef)();return Object(o.useLayoutEffect)(()=>(c.registerSlot(e,a,t),()=>{c.unregisterSlot(e,a)}),[c.registerSlot,c.unregisterSlot,e]),Object(o.useLayoutEffect)(()=>{c.updateSlot(e,t)}),Object(o.createElement)(n,Object(r.a)({ref:Object(u.useMergeRefs)([i,a])},s))}));function C(e){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(E,e),Object(o.createElement)(x,e))}n(12),o.Component;const L=Object(o.forwardRef)(({bubblesVirtually:e,...t},n)=>e?Object(o.createElement)(T,Object(r.a)({},t,{ref:n})):Object(o.createElement)(_,t));function I(e){return"appear"===e?"top":"left"}function A(e,t){const{paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:s}=(i=t).ownerDocument.defaultView.getComputedStyle(i);var i;const c=n?parseInt(n,10):0,a=r?parseInt(r,10):0,l=o?parseInt(o,10):0,u=s?parseInt(s,10):0;return{x:e.left+l,y:e.top+c,width:e.width-l-u,height:e.height-c-a,left:e.left+l,right:e.right-u,top:e.top+c,bottom:e.bottom-a}}function R(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function F(e,t,n=""){e.style[t]!==n&&(e.style[t]=n)}function P(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const N=Object(o.forwardRef)(({headerTitle:e,onClose:t,children:n,className:s,noArrow:c=!0,isAlternate:a,position:m="bottom right",range:h,focusOnMount:g="firstElement",anchorRef:v,shouldAnchorIncludePadding:w,anchorRect:y,getAnchorRect:E,expandOnMobile:k,animate:_=!0,onClickOutside:S,onFocusOutside:x,__unstableStickyBoundaryElement:T,__unstableSlotName:L="Popover",__unstableObserveElement:N,__unstableBoundaryParent:M,__unstableForcePosition:B,__unstableForceXAlignment:D,...V},W)=>{const H=Object(o.useRef)(null),q=Object(o.useRef)(null),z=Object(o.useRef)(),K=Object(u.useViewportMatch)("medium","<"),[U,$]=Object(o.useState)(),Q=j(L),Y=k&&K,[J,X]=Object(u.useResizeObserver)();c=Y||c,Object(o.useLayoutEffect)(()=>{if(Y)return P(z.current,"is-without-arrow",c),P(z.current,"is-alternate",a),R(z.current,"data-x-axis"),R(z.current,"data-y-axis"),F(z.current,"top"),F(z.current,"left"),F(q.current,"maxHeight"),void F(q.current,"maxWidth");const e=()=>{if(!z.current||!q.current)return;let e=function(e,t,n,r=!1,o,s){if(t)return t;if(n){if(!e.current)return;const t=n(e.current);return b(t,t.ownerDocument||e.current.ownerDocument,s)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==r?void 0:r.cloneRange))return b(Object(d.getRectangleFromRange)(r),r.endContainer.ownerDocument,s);if("function"==typeof(null==r?void 0:r.getBoundingClientRect)){const e=b(r.getBoundingClientRect(),r.ownerDocument,s);return o?e:A(e,r)}const{top:e,bottom:t}=r,n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),c=b(new window.DOMRect(n.left,n.top,n.width,i.bottom-n.top),e.ownerDocument,s);return o?c:A(c,r)}if(!e.current)return;const{parentNode:i}=e.current,c=i.getBoundingClientRect();return o?c:A(c,i)}(H,y,E,v,w,z.current);if(!e)return;const{offsetParent:t,ownerDocument:n}=z.current;let r,o=0;if(t&&t!==n.body){const n=t.getBoundingClientRect();o=n.top,e=new window.DOMRect(e.left-n.left,e.top-n.top,e.width,e.height)}var s;M&&(r=null===(s=z.current.closest(".popover-slot"))||void 0===s?void 0:s.parentNode);const i=X.height?X:q.current.getBoundingClientRect(),{popoverTop:l,popoverLeft:u,xAxis:p,yAxis:h,contentHeight:g,contentWidth:O}=function(e,t,n="top",r,o,s,i,c,a){const[l,u="center",d]=n.split(" "),p=function(e,t,n,r,o,s,i,c){const{height:a}=t;if(o){const t=o.getBoundingClientRect().top+a-i;if(e.top<=t)return{yAxis:n,popoverTop:Math.min(e.bottom,t)}}let l=e.top+e.height/2;"bottom"===r?l=e.bottom:"top"===r&&(l=e.top);const u={popoverTop:l,contentHeight:(l-a/2>0?a/2:l)+(l+a/2>window.innerHeight?window.innerHeight-l:a/2)},d={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};let f,b=n,m=null;if(!o&&!c)if("middle"===n&&u.contentHeight===a)b="middle";else if("top"===n&&d.contentHeight===a)b="top";else if("bottom"===n&&p.contentHeight===a)b="bottom";else{b=d.contentHeight>p.contentHeight?"top":"bottom";const e="top"===b?d.contentHeight:p.contentHeight;m=e!==a?e:null}return f="middle"===b?u.popoverTop:"top"===b?d.popoverTop:p.popoverTop,{yAxis:b,popoverTop:f,contentHeight:m}}(e,t,l,d,r,0,s,c);return{...function(e,t,n,r,o,s,i,c,a){const{width:l}=t;"left"===n&&Object(f.isRTL)()?n="right":"right"===n&&Object(f.isRTL)()&&(n="left"),"left"===r&&Object(f.isRTL)()?r="right":"right"===r&&Object(f.isRTL)()&&(r="left");const u=Math.round(e.left+e.width/2),d={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)};let p=e.left;"right"===r?p=e.right:"middle"===s||a||(p=u);let b=e.right;"left"===r?b=e.left:"middle"===s||a||(b=u);const m={popoverLeft:p,contentWidth:p-l>0?l:p},h={popoverLeft:b,contentWidth:b+l>window.innerWidth?window.innerWidth-b:l};let g,O=n,v=null;if(!o&&!c)if("center"===n&&d.contentWidth===l)O="center";else if("left"===n&&m.contentWidth===l)O="left";else if("right"===n&&h.contentWidth===l)O="right";else{O=m.contentWidth>h.contentWidth?"left":"right";const e="left"===O?m.contentWidth:h.contentWidth;l>window.innerWidth&&(v=window.innerWidth),e!==l&&(O="center",d.popoverLeft=window.innerWidth/2)}if(g="center"===O?d.popoverLeft:"left"===O?m.popoverLeft:h.popoverLeft,i){const e=i.getBoundingClientRect();g=Math.min(g,e.right-l),Object(f.isRTL)()||(g=Math.max(g,0))}return{xAxis:O,popoverLeft:g,contentWidth:v}}(e,t,u,d,r,p.yAxis,i,c,a),...p}}(e,i,m,T,z.current,o,r,B,D);"number"==typeof l&&"number"==typeof u&&(F(z.current,"top",l+"px"),F(z.current,"left",u+"px")),P(z.current,"is-without-arrow",c||"center"===p&&"middle"===h),P(z.current,"is-alternate",a),R(z.current,"data-x-axis",p),R(z.current,"data-y-axis",h),F(q.current,"maxHeight","number"==typeof g?g+"px":""),F(q.current,"maxWidth","number"==typeof O?O+"px":""),$(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[h]||"middle"))};e();const{ownerDocument:t}=z.current,{defaultView:n}=t,r=n.setInterval(e,500);let o;const s=()=>{n.cancelAnimationFrame(o),o=n.requestAnimationFrame(e)};n.addEventListener("click",s),n.addEventListener("resize",e),n.addEventListener("scroll",e,!0);const i=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(v);let l;return i&&i!==t&&(i.defaultView.addEventListener("resize",e),i.defaultView.addEventListener("scroll",e,!0)),N&&(l=new n.MutationObserver(e),l.observe(N,{attributes:!0})),()=>{n.clearInterval(r),n.removeEventListener("resize",e),n.removeEventListener("scroll",e,!0),n.removeEventListener("click",s),n.cancelAnimationFrame(o),i&&i!==t&&(i.defaultView.removeEventListener("resize",e),i.defaultView.removeEventListener("scroll",e,!0)),l&&l.disconnect()}},[Y,y,E,v,w,m,X,T,N,M]);const Z=(e,n)=>{if("focus-outside"===e&&x)x(n);else if("focus-outside"===e&&S){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>n.relatedTarget}),l()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),S(e)}else t&&t()},[ee,te]=Object(u.__experimentalUseDialog)({focusOnMount:g,__unstableOnClose:Z,onClose:Z}),ne=Object(u.useMergeRefs)([z,ee,W]),re=Boolean(_&&U)&&function(e){if("loading"===e.type)return i()("components-animate__loading");const{type:t,origin:n=I(t)}=e;if("appear"===t){const[e,t="center"]=n.split(" ");return i()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?i()("components-animate__slide-in","is-from-"+n):void 0}({type:"appear",origin:U});let oe=Object(o.createElement)("div",Object(r.a)({className:i()("components-popover",s,re,{"is-expanded":Y,"is-without-arrow":c,"is-alternate":a})},V,{ref:ne},te,{tabIndex:"-1"}),Y&&Object(o.createElement)(O,null),Y&&Object(o.createElement)("div",{className:"components-popover__header"},Object(o.createElement)("span",{className:"components-popover__header-title"},e),Object(o.createElement)(G,{className:"components-popover__close",icon:p.a,onClick:t})),Object(o.createElement)("div",{ref:q,className:"components-popover__content"},Object(o.createElement)("div",{style:{position:"relative"}},J,n)));return Q.ref&&(oe=Object(o.createElement)(C,{name:L},oe)),v||y?oe:Object(o.createElement)("span",{ref:H},oe)});N.Slot=Object(o.forwardRef)((function({name:e="Popover"},t){return Object(o.createElement)(L,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));var M=N,B=function({shortcut:e,className:t}){if(!e)return null;let n,r;return Object(c.isString)(e)&&(n=e),Object(c.isObject)(e)&&(n=e.display,r=e.ariaLabel),Object(o.createElement)("span",{className:t,"aria-label":r},n)};const D=Object(o.createElement)("div",{className:"event-catcher"}),V=({eventHandlers:e,child:t,childrenWithPopover:n})=>Object(o.cloneElement)(Object(o.createElement)("span",{className:"disabled-element-wrapper"},Object(o.cloneElement)(D,e),Object(o.cloneElement)(t,{children:n}),","),e),W=({child:e,eventHandlers:t,childrenWithPopover:n})=>Object(o.cloneElement)(e,{...t,children:n}),H=(e,t,n)=>{if(1!==o.Children.count(e))return;const r=o.Children.only(e);"function"==typeof r.props[t]&&r.props[t](n)};var q=function({children:e,position:t,text:n,shortcut:r}){const[s,i]=Object(o.useState)(!1),[a,l]=Object(o.useState)(!1),d=Object(u.useDebounce)(l,700),p=t=>{H(e,"onMouseDown",t),document.addEventListener("mouseup",m),i(!0)},f=t=>{H(e,"onMouseUp",t),document.removeEventListener("mouseup",m),i(!1)},b=e=>"mouseUp"===e?f:"mouseDown"===e?p:void 0,m=b("mouseUp"),h=(t,n)=>r=>{if(H(e,t,r),r.currentTarget.disabled)return;if("focus"===r.type&&s)return;d.cancel();const o=Object(c.includes)(["focus","mouseenter"],r.type);o!==a&&(n?d(o):l(o))},g=()=>{d.cancel(),document.removeEventListener("mouseup",m)};if(Object(o.useEffect)(()=>g,[]),1!==o.Children.count(e))return e;const O={onMouseEnter:h("onMouseEnter",!0),onMouseLeave:h("onMouseLeave"),onClick:h("onClick"),onFocus:h("onFocus"),onBlur:h("onBlur"),onMouseDown:b("mouseDown")},v=o.Children.only(e),{children:j,disabled:w}=v.props;return(w?V:W)({child:v,eventHandlers:O,childrenWithPopover:(({grandchildren:e,isOver:t,position:n,text:r,shortcut:s})=>Object(o.concatChildren)(e,t&&Object(o.createElement)(M,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(o.createElement)(B,{className:"components-tooltip__shortcut",shortcut:s}))))({grandchildren:j,isOver:a,position:t,text:n,shortcut:r})})},z=n(40),K=n(35);const U=["onMouseDown","onClick"];var G=t.a=Object(o.forwardRef)((function(e,t){const{href:n,target:s,isSmall:a,isPressed:u,isBusy:d,isDestructive:p,className:f,disabled:b,icon:m,iconPosition:h="left",iconSize:g,showTooltip:O,tooltipPosition:v,shortcut:j,label:w,children:y,text:E,variant:k,__experimentalIsFocusable:_,describedBy:S,...x}=function({isDefault:e,isPrimary:t,isSecondary:n,isTertiary:r,isLink:o,variant:s,...i}){let c=s;var a,u,d,p,f;return t&&(null!==(a=c)&&void 0!==a||(c="primary")),r&&(null!==(u=c)&&void 0!==u||(c="tertiary")),n&&(null!==(d=c)&&void 0!==d||(c="secondary")),e&&(l()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(p=c)&&void 0!==p||(c="secondary")),o&&(null!==(f=c)&&void 0!==f||(c="link")),{...i,variant:c}}(e),T=i()("components-button",f,{"is-secondary":"secondary"===k,"is-primary":"primary"===k,"is-small":a,"is-tertiary":"tertiary"===k,"is-pressed":u,"is-busy":d,"is-link":"link"===k,"is-destructive":p,"has-text":!!m&&!!y,"has-icon":!!m}),C=b&&!_,L=void 0===n||C?"button":"a",I="a"===L?{href:n,target:s}:{type:"button",disabled:C,"aria-pressed":u};if(b&&_){I["aria-disabled"]=!0;for(const e of U)x[e]=e=>{e.stopPropagation(),e.preventDefault()}}const A=!C&&(O&&w||j||!!w&&(!y||Object(c.isArray)(y)&&!y.length)&&!1!==O),R=S?Object(c.uniqueId)():null,F=x["aria-describedby"]||R,P=Object(o.createElement)(L,Object(r.a)({},I,x,{className:T,"aria-label":x["aria-label"]||w,"aria-describedby":F,ref:t}),m&&"left"===h&&Object(o.createElement)(z.a,{icon:m,size:g}),E&&Object(o.createElement)(o.Fragment,null,E),m&&"right"===h&&Object(o.createElement)(z.a,{icon:m,size:g}),y);return A?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(q,{text:S||w,shortcut:j,position:v},P),S&&Object(o.createElement)(K.a,null,Object(o.createElement)("span",{id:R},S))):Object(o.createElement)(o.Fragment,null,P,S&&Object(o.createElement)(K.a,null,Object(o.createElement)("span",{id:R},S)))}))},function(e,t,n){"use strict";n.d(t,"n",(function(){return s})),n.d(t,"l",(function(){return i})),n.d(t,"k",(function(){return c})),n.d(t,"m",(function(){return a})),n.d(t,"i",(function(){return l})),n.d(t,"d",(function(){return u})),n.d(t,"f",(function(){return d})),n.d(t,"j",(function(){return p})),n.d(t,"c",(function(){return f})),n.d(t,"e",(function(){return b})),n.d(t,"g",(function(){return m})),n.d(t,"a",(function(){return h})),n.d(t,"h",(function(){return g})),n.d(t,"b",(function(){return O}));var r,o=n(2);const s=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=s.pluginUrl+"images/",c=s.pluginUrl+"build/",a=s.buildPhase,l=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),f=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),b=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),m=Object(o.getSetting)("shippingCountries",{}),h=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),O=Object(o.getSetting)("allowedStates",{})},function(e,t){e.exports=window.wp.dom},,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(7);function o(e,t,n){var o=this,s=Object(r.useRef)(null),i=Object(r.useRef)(0),c=Object(r.useRef)(null),a=Object(r.useRef)([]),l=Object(r.useRef)(),u=Object(r.useRef)(),d=Object(r.useRef)(e),p=Object(r.useRef)(!0);d.current=e;var f=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var b=!!(n=n||{}).leading,m=!("trailing"in n)||!!n.trailing,h="maxWait"in n,g=h?Math.max(+n.maxWait||0,t):null;return Object(r.useEffect)((function(){return p.current=!0,function(){p.current=!1}}),[]),Object(r.useMemo)((function(){var e=function(e){var t=a.current,n=l.current;return a.current=l.current=null,i.current=e,u.current=d.current.apply(n,t)},n=function(e,t){f&&cancelAnimationFrame(c.current),c.current=f?requestAnimationFrame(e):setTimeout(e,t)},r=function(e){if(!p.current)return!1;var n=e-s.current,r=e-i.current;return!s.current||n>=t||n<0||h&&r>=g},O=function(t){return c.current=null,m&&a.current?e(t):(a.current=l.current=null,u.current)},v=function(){var e=Date.now();if(r(e))return O(e);if(p.current){var o=e-s.current,c=e-i.current,a=t-o,l=h?Math.min(a,g-c):a;n(v,l)}},j=function(){for(var d=[],f=0;f<arguments.length;f++)d[f]=arguments[f];var m=Date.now(),g=r(m);if(a.current=d,l.current=o,s.current=m,g){if(!c.current&&p.current)return i.current=s.current,n(v,t),b?e(s.current):u.current;if(h)return n(v,t),e(s.current)}return c.current||n(v,t),u.current};return j.cancel=function(){c.current&&(f?cancelAnimationFrame(c.current):clearTimeout(c.current)),i.current=0,a.current=s.current=l.current=c.current=null},j.isPending=function(){return!!c.current},j.flush=function(){return c.current?O(Date.now()):u.current},j}),[b,h,t,g,m,f])}},function(e,t,n){"use strict";var r=n(0);n(71),t.a=e=>{let{children:t}=e;return Object(r.createElement)("div",{className:"wc-block-filter-title-placeholder"},t)}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return s}));var r=n(0);const o=Object(r.createContext)({}),s=()=>{const{wrapper:e}=Object(r.useContext)(o);return t=>{e&&e.current&&(e.current.hidden=!t)}}},,,function(e,t){e.exports=window.wp.keycodes},function(e,t,n){"use strict";n.d(t,"d",(function(){return c})),n.d(t,"h",(function(){return a})),n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return u})),n.d(t,"e",(function(){return d})),n.d(t,"f",(function(){return p})),n.d(t,"c",(function(){return f})),n.d(t,"g",(function(){return b}));var r=n(13),o=n(70),s=n(28),i=n(124);function c(){return Math.floor(Math.random()*Date.now())}const a=e=>e.replace("pa_",""),l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n={};t.forEach(e=>{const{attribute:t,slug:r,operator:s}=e,i=a(t),c=r.join(","),l=`${o.b}${i}`,u="in"===s?"or":"and";n[`${o.a}${i}`]=c,n[l]=u});const s=Object(r.removeQueryArgs)(e,...Object.keys(n));return Object(r.addQueryArgs)(s,n)},u=e=>{let{currentCheckedFilters:t,hasSetFilterDefaultsFromUrl:n}=e;return n&&0===t.length},d=e=>{if(e){const t=Object(o.d)("filter_"+e.name);return"string"==typeof t?t.split(","):[]}return[]},p=(e,t)=>{const n=Object.entries(t).reduce((e,t)=>{let[n,r]=t;return n.includes("query_type")?e:{...e,[n]:r}},{});return Object.entries(n).reduce((t,n)=>{let[r,o]=n;return e[r]===o&&t},!0)},f=e=>e.trim().replace(/\s/g,"-").replace(/_/g,"-").replace(/-+/g,"-").replace(/[^a-zA-Z0-9-]/g,""),b=e=>({className:Object(s.a)(null==e?void 0:e.className)?e.className:"",attributeId:parseInt(Object(s.a)(null==e?void 0:e.attributeId)?e.attributeId:"0",10),showCounts:"false"!==(null==e?void 0:e.showCounts),queryType:Object(s.a)(null==e?void 0:e.queryType)&&e.queryType||i.attributes.queryType.default,heading:Object(s.a)(null==e?void 0:e.heading)?e.heading:"",headingLevel:Object(s.a)(null==e?void 0:e.headingLevel)&&parseInt(e.headingLevel,10)||i.attributes.headingLevel.default,displayStyle:Object(s.a)(null==e?void 0:e.displayStyle)&&e.displayStyle||i.attributes.displayStyle.default,showFilterButton:"true"===(null==e?void 0:e.showFilterButton),selectType:Object(s.a)(null==e?void 0:e.selectType)&&e.selectType||i.attributes.selectType.default,isPreview:!1})},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),o=n(4),s=n(0),i=n(27),c=n(73);const a=e=>{const{namespace:t,resourceName:n,resourceValues:a=[],query:l={},shouldSelect:u=!0}=e;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");const d=Object(s.useRef)({results:[],isLoading:!0}),p=Object(i.a)(l),f=Object(i.a)(a),b=Object(c.a)(),m=Object(o.useSelect)(e=>{if(!u)return null;const o=e(r.COLLECTIONS_STORE_KEY),s=[t,n,p,f],i=o.getCollectionError(...s);if(i){if(!(i instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");b(i)}return{results:o.getCollection(...s),isLoading:!o.hasFinishedResolution("getCollection",s)}},[t,n,f,p,u]);return null!==m&&(d.current=m),d.current}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(7);function o(e,t){const n=Object(r.useRef)();return Object(r.useEffect)(()=>{n.current===e||t&&!t(e,n.current)||(n.current=e)},[e,t]),n.current}},function(e,t,n){"use strict";var r=n(0),o=n(1),s=n(22);n(134),t.a=e=>{let{name:t,count:n}=e;return Object(r.createElement)(r.Fragment,null,t,null!==n&&Number.isFinite(n)&&Object(r.createElement)(s.a,{label:n.toString(),screenReaderLabel:Object(o.sprintf)(
|
2 |
/* translators: %s number of products. */
|
3 |
Object(o._n)("%s product","%s products",n,"woocommerce"),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},,,function(e,t){var n,r,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!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:s}catch(e){n=s}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var a,l=[],u=!1,d=-1;function p(){u&&a&&(u=!1,a.length?l=a.concat(l):d=-1,l.length&&f())}function f(){if(!u){var e=c(p);u=!0;for(var t=l.length;t;){for(a=l,l=[];++d<t;)a&&a[d].run();d=-1,t=l.length}a=null,u=!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];l.push(new b(e,t)),1!==l.length||u||c(f)},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";n.d(t,"a",(function(){return r}));const r=e=>"boolean"==typeof e},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return a})),n.d(t,"d",(function(){return l})),n.d(t,"c",(function(){return u}));var r=n(13),o=n(2),s=n(69);const i=Object(o.getSettingWithCoercion)("is_rendering_php_template",!1,s.a),c="query_type_",a="filter_";function l(e){return window?Object(r.getQueryArg)(window.location.href,e):null}function u(e){i?window.location.href=e:window.history.replaceState({},"",e)}},function(e,t){},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);const o=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(0),o=n(14);const s=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=s},,,,function(e,t,n){"use strict";var r=n(0),o=n(1),s=n(5),i=n.n(s),c=n(22);n(115),t.a=e=>{let{className:t,label:
|
4 |
/* translators: Reset button text for filters. */
|
@@ -8,7 +8,7 @@ a=Object(o.__)("Apply","woocommerce"),onClick:l,screenReaderLabel:u=Object(o.__)
|
|
8 |
/* translators: %s is referring the remaining count of options */
|
9 |
Object(o._n)("Show %s more option","Show %s more options",e,"woocommerce"),e)},Object(o.sprintf)(
|
10 |
/* translators: %s number of options to reveal. */
|
11 |
-
Object(o._n)("Show %s more","Show %s more",e,"woocommerce"),e)))},[s,d,p]),h=Object(r.useMemo)(()=>p&&Object(r.createElement)("li",{key:"show-less",className:"show-less"},Object(r.createElement)("button",{onClick:()=>{f(!1)},"aria-expanded":!0,"aria-label":Object(o.__)("Show less options","woocommerce")},Object(o.__)("Show less","woocommerce"))),[p]),g=Object(r.useMemo)(()=>{const e=s.length>d+5;return Object(r.createElement)(r.Fragment,null,s.map((t,o)=>Object(r.createElement)(r.Fragment,{key:t.value},Object(r.createElement)("li",e&&!p&&o>=d&&{hidden:!0},Object(r.createElement)(c.CheckboxControl,{id:t.value,className:"wc-block-checkbox-list__checkbox",label:t.label,checked:a.includes(t.value),onChange:()=>{n(t.value)}})),e&&o===d-1&&m)),e&&h)},[s,n,a,p,d,h,m,u]),O=i()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":l},t);return Object(r.createElement)("ul",{className:O},l?b:g)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(7),o=n(50);function s(e,t){return e===t}function i(e){return"function"==typeof e?function(){return e}:e}function c(e,t,n){var c=n&&n.equalityFn||s,a=function(e){var t=Object(r.useState)(i(e)),n=t[0],o=t[1];return[n,Object(r.useCallback)((function(e){return o(i(e))}),[])]}(e),l=a[0],u=a[1],d=Object(o.a)(Object(r.useCallback)((function(e){return u(e)}),[u]),t,n),p=Object(r.useRef)(e);return c(p.current,e)||(d(e),p.current=e),[l,d]}},function(e,t,n){"use strict";var r=n(0),o=n(6),s=n(5),i=n.n(s),c=n(1),a=n(24),l=n(90),u=n(43);function d(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}t.a=function({className:e,status:t="info",children:n,spokenMessage:s=n,onRemove:p=o.noop,isDismissible:f=!0,actions:b=[],politeness:m=d(t),__unstableHTML:h,onDismiss:g=o.noop}){!function(e,t){const n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)(()=>{n&&Object(a.speak)(n,t)},[n,t])}(s,m);const O=i()(e,"components-notice","is-"+t,{"is-dismissible":f});return h&&(n=Object(r.createElement)(r.RawHTML,null,n)),Object(r.createElement)("div",{className:O},Object(r.createElement)("div",{className:"components-notice__content"},n,Object(r.createElement)("div",{className:"components-notice__actions"},b.map(({className:e,label:t,isPrimary:n,variant:o,noDefaultClasses:s=!1,onClick:c,url:a},l)=>{let d=o;return"primary"===o||s||(d=a?"link":"secondary"),void 0===d&&n&&(d="primary"),Object(r.createElement)(u.a,{key:l,href:a,variant:d,onClick:a?void 0:c,className:i()("components-notice__action",e)},t)}))),f&&Object(r.createElement)(u.a,{className:"components-notice__dismiss",icon:l.a,label:Object(c.__)("Dismiss this notice"),onClick:e=>{var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),g(),p()},showTooltip:!1}))}},,function(e,t){e.exports=window.wp.blocks},,,,,,,,function(e,t){e.exports=window.wp.blockEditor},,,function(e,t,n){"use strict";var r=n(0);t.a=function(e){let{icon:t,size:n=24,...o}=e;return Object(r.cloneElement)(t,{width:n,height:n,...o})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return s}));var r=n(6);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const s=e.filter(e=>e.attribute===n.taxonomy),i=s.length?s[0]:null;if(!(i&&i.slug&&Array.isArray(i.slug)&&i.slug.includes(o)))return;const c=i.slug.filter(e=>e!==o),a=e.filter(e=>e.attribute!==n.taxonomy);c.length>0&&(i.slug=c.sort(),a.push(i)),t(Object(r.sortBy)(a,"attribute"))},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";if(!n||!n.taxonomy)return[];const i=e.filter(e=>e.attribute!==n.taxonomy);return 0===o.length?t(i):(i.push({attribute:n.taxonomy,operator:s,slug:o.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(r.sortBy)(i,"attribute"))),i}},,,function(e,t){},function(e,t){},function(e,t){},,function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return i}));var r=n(2);const o=Object(r.getSetting)("attributes",[]).reduce((e,t)=>{const 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;var r;return n&&n.id&&e.push(n),e},[]),s=e=>{if(e)return o.find(t=>t.id===e)},i=e=>{if(e)return o.find(t=>t.taxonomy===e)}},,,,,function(e){e.exports=JSON.parse('{"name":"woocommerce/attribute-filter","version":"1.0.0","title":"Filter by Attribute Controls","description":"Enable customers to filter the product grid by selecting one or more attributes, such as color.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"color":{"text":true,"background":false},"inserter":false,"lock":false},"example":{"attributes":{"isPreview":true}},"attributes":{"className":{"type":"string","default":""},"attributeId":{"type":"number","default":0},"showCounts":{"type":"boolean","default":true},"queryType":{"type":"string","default":"or"},"headingLevel":{"type":"number","default":3},"displayStyle":{"type":"string","default":"list"},"showFilterButton":{"type":"boolean","default":false},"selectType":{"type":"string","default":"multiple"},"isPreview":{"type":"boolean","default":false}},"textdomain":"woocommerce","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(28),o=n(18);const s=e=>Object(r.a)(e)?JSON.parse(e)||{}:Object(o.a)(e)?e:{}},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(0),o=n(97),s=n(6),i=n(27),c=n(18),a=n(30),l=n(60),u=n(23);const d=e=>{let{queryAttribute:t,queryPrices:n,queryStock:d,queryRating:p,queryState:f}=e,b=Object(u.a)();b+="-collection-data";const[m]=Object(a.a)(b),[h,g]=Object(a.b)("calculate_attribute_counts",[],b),[O,v]=Object(a.b)("calculate_price_range",null,b),[j,w]=Object(a.b)("calculate_stock_status_counts",null,b),[y,E]=Object(a.b)("calculate_rating_counts",null,b),k=Object(i.a)(t||{}),_=Object(i.a)(n),S=Object(i.a)(d),x=Object(i.a)(p);Object(r.useEffect)(()=>{"object"==typeof k&&Object.keys(k).length&&(h.find(e=>Object(c.b)(k,"taxonomy")&&e.taxonomy===k.taxonomy)||g([...h,k]))},[k,h,g]),Object(r.useEffect)(()=>{O!==_&&void 0!==_&&v(_)},[_,v,O]),Object(r.useEffect)(()=>{j!==S&&void 0!==S&&w(S)},[S,w,j]),Object(r.useEffect)(()=>{y!==x&&void 0!==x&&E(x)},[x,E,y]);const[T,C]=Object(r.useState)(!1),[L]=Object(o.a)(T,200);T||C(!0);const I=Object(r.useMemo)(()=>(e=>{const t=e;return Array.isArray(e.calculate_attribute_counts)&&(t.calculate_attribute_counts=Object(s.sortBy)(e.calculate_attribute_counts.map(e=>{let{taxonomy:t,queryType:n}=e;return{taxonomy:t,query_type:n}}),["taxonomy","query_type"])),t})(m),[m]);return Object(l.a)({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...f,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...I},shouldSelect:L})}},,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(8),o=n(0),s=n(5),i=n.n(s);class c extends o.Component{constructor(){super(...arguments),this.onChange=this.onChange.bind(this),this.bindInput=this.bindInput.bind(this)}focus(){this.input.focus()}hasFocus(){return this.input===this.input.ownerDocument.activeElement}bindInput(e){this.input=e}onChange(e){this.props.onChange({value:e.target.value})}render(){const{value:e,isExpanded:t,instanceId:n,selectedSuggestionIndex:s,className:c,...a}=this.props,l=e?e.length+1:0;return Object(o.createElement)("input",Object(r.a)({ref:this.bindInput,id:"components-form-token-input-"+n,type:"text"},a,{value:e||"",onChange:this.onChange,size:l,className:i()(c,"components-form-token-field__input"),autoComplete:"off",role:"combobox","aria-expanded":t,"aria-autocomplete":"list","aria-owns":t?"components-form-token-suggestions-"+n:void 0,"aria-activedescendant":-1!==s?`components-form-token-suggestions-${n}-${s}`:void 0,"aria-describedby":"components-form-token-suggestions-howto-"+n}))}}t.a=c},function(e,t,n){"use strict";var r=n(0),o=n(6),s=n(150),i=n.n(s),c=n(5),a=n.n(c),l=n(10);class u extends r.Component{constructor(){super(...arguments),this.handleMouseDown=this.handleMouseDown.bind(this),this.bindList=this.bindList.bind(this)}componentDidUpdate(){this.props.selectedIndex>-1&&this.props.scrollIntoView&&this.list.children[this.props.selectedIndex]&&(this.scrollingIntoView=!0,i()(this.list.children[this.props.selectedIndex],this.list,{onlyScrollIfNeeded:!0}),this.props.setTimeout(()=>{this.scrollingIntoView=!1},100))}bindList(e){this.list=e}handleHover(e){return()=>{this.scrollingIntoView||this.props.onHover(e)}}handleClick(e){return()=>{this.props.onSelect(e)}}handleMouseDown(e){e.preventDefault()}computeSuggestionMatch(e){const t=this.props.displayTransform(this.props.match||"").toLocaleLowerCase();if(0===t.length)return null;const n=(e=this.props.displayTransform(e)).toLocaleLowerCase().indexOf(t);return{suggestionBeforeMatch:e.substring(0,n),suggestionMatch:e.substring(n,n+t.length),suggestionAfterMatch:e.substring(n+t.length)}}render(){return Object(r.createElement)("ul",{ref:this.bindList,className:"components-form-token-field__suggestions-list",id:"components-form-token-suggestions-"+this.props.instanceId,role:"listbox"},Object(o.map)(this.props.suggestions,(e,t)=>{const n=this.computeSuggestionMatch(e),o=a()("components-form-token-field__suggestion",{"is-selected":t===this.props.selectedIndex});return Object(r.createElement)("li",{id:`components-form-token-suggestions-${this.props.instanceId}-${t}`,role:"option",className:o,key:null!=e&&e.value?e.value:this.props.displayTransform(e),onMouseDown:this.handleMouseDown,onClick:this.handleClick(e),onMouseEnter:this.handleHover(e),"aria-selected":t===this.props.selectedIndex},n?Object(r.createElement)("span",{"aria-label":this.props.displayTransform(e)},n.suggestionBeforeMatch,Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch):this.props.displayTransform(e))}))}}u.defaultProps={match:"",onHover:()=>{},onSelect:()=>{},suggestions:Object.freeze([])},t.a=Object(l.withSafeTimeout)(u)},function(e,t,n){"use strict";e.exports=n(218)},,,,,,,,,function(e,t,n){"use strict";var r=n(0),o=n(1),s=n(276),i=n(27),c=n(61),a=n(30),l=n(60),u=n(135),d=n(62),p=n(94),f=n(95),b=n(12),m=n.n(b),h=n(21),g=n(98),O=n(2),v=n(13),j=n(69),w=n(28),y=n(18),E=n(224),k=n(111),_=n(283),S=n(70),x=n(6),T=n(11),C=n.n(T),L=n(285),I=n(5),A=n.n(I);n(225);var R=e=>{let{className:t,style:n,suggestions:o,multiple:s=!0,saveTransform:i=(e=>e.trim().replace(/\s/g,"-")),messages:c={},validateInput:a=(e=>o.includes(e)),label:l="",...u}=e;return Object(r.createElement)("div",{className:A()("wc-blocks-components-form-token-field-wrapper",t,{"single-selection":!s}),style:n},Object(r.createElement)(L.a,C()({label:l,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,__experimentalValidateInput:a,saveTransform:i,maxLength:s?void 0:1,suggestions:o,messages:c},u)))},F=n(51),P=n(119),N=n(112);const M=[{value:"preview-1",formattedValue:"preview-1",name:"Blue",label:Object(r.createElement)(d.a,{name:"Blue",count:3}),textLabel:"Blue (3)"},{value:"preview-2",formattedValue:"preview-2",name:"Green",label:Object(r.createElement)(d.a,{name:"Green",count:3}),textLabel:"Green (3)"},{value:"preview-3",formattedValue:"preview-3",name:"Red",label:Object(r.createElement)(d.a,{name:"Red",count:2}),textLabel:"Red (2)"}],B={id:0,name:"preview",taxonomy:"preview",label:"Preview"};n(223);var D=n(59),V=n(96),W=e=>{let{isLoading:t=!1,options:n,checked:o,onChange:s}=e;return t?Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"is-loading"}),Object(r.createElement)("span",{className:"is-loading"})):Object(r.createElement)(V.a,{className:"wc-block-attribute-filter-list",options:n,checked:o,onChange:s,isLoading:t,isDisabled:t})},H=n(55);t.a=e=>{let{attributes:t,isEditor:n=!1}=e;const b=Object(O.getSettingWithCoercion)("has_filterable_products",!1,j.a),T=Object(O.getSettingWithCoercion)("is_rendering_php_template",!1,j.a),C=Object(O.getSettingWithCoercion)("page_url",window.location.href,w.a),[L,I]=Object(r.useState)(!1),V=t.isPreview&&!t.attributeId?B:Object(P.a)(t.attributeId),q=Object(r.useMemo)(()=>Object(D.e)(V),[V]),[z,K]=Object(r.useState)(q),[U,G]=Object(r.useState)(Object(D.d)()),[$,Q]=Object(r.useState)(t.isPreview&&!t.attributeId?M:[]),Y=Object(s.a)(t),[J]=Object(a.a)(),[X,Z]=Object(a.b)("attributes",[]),{results:ee,isLoading:te}=Object(l.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[(null==V?void 0:V.id)||0],shouldSelect:t.attributeId>0}),ne="dropdown"!==t.displayStyle&&"and"===t.queryType,{results:re,isLoading:oe}=Object(u.a)({queryAttribute:{taxonomy:(null==V?void 0:V.taxonomy)||"",queryType:t.queryType},queryState:{...J,attributes:ne?J.attributes:null}}),se=Object(r.useCallback)(e=>Object(y.b)(re,"attribute_counts")&&Array.isArray(re.attribute_counts)?re.attribute_counts.find(t=>{let{term:n}=t;return n===e}):null,[re]);Object(r.useEffect)(()=>{if(te||oe)return;if(!Array.isArray(ee))return;const e=ee.map(e=>{const n=se(e.id);if(!(n||z.includes(e.slug)||(o=e.slug,null!=J&&J.attributes&&J.attributes.some(e=>{let{attribute:t,slug:n=[]}=e;return t===(null==V?void 0:V.taxonomy)&&n.includes(o)}))))return null;var o;const s=n?n.count:0;return{formattedValue:Object(D.c)(e.slug),value:e.slug,name:Object(h.decodeEntities)(e.name),label:Object(r.createElement)(d.a,{name:Object(h.decodeEntities)(e.name),count:t.showCounts?s:null}),textLabel:t.showCounts?`${Object(h.decodeEntities)(e.name)} (${s})`:Object(h.decodeEntities)(e.name)}}).filter(e=>!!e);Q(e),G(Object(D.d)())},[null==V?void 0:V.taxonomy,ee,te,t.showCounts,oe,se,z,J.attributes]);const ie=Object(r.useCallback)(e=>Array.isArray(ee)?ee.reduce((t,n)=>(e.includes(n.slug)&&t.push(n),t),[]):[],[ee]),ce=Object(r.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){if(null==V||!V.taxonomy)return;const t=Object.keys(Object(v.getQueryArgs)(window.location.href)),n=Object(D.h)(V.taxonomy),r=t.reduce((e,t)=>t.includes(S.b+n)||t.includes(S.a+n)?Object(v.removeQueryArgs)(e,t):e,window.location.href),o=Object(D.b)(r,e);Object(S.c)(o)}else{const t=Object(D.b)(C,e),n=Object(v.getQueryArgs)(window.location.href),r=Object(v.getQueryArgs)(t);Object(D.f)(n,r)||Object(S.c)(t)}}),[C,null==V?void 0:V.taxonomy]),ae=e=>{const n=Object(N.b)(X,Z,V,ie(e),"or"===t.queryType?"in":"and");ce(n,0===e.length)},le=Object(r.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n||(K(e),!r&&t.showFilterButton||Object(N.b)(X,Z,V,ie(e),"or"===t.queryType?"in":"and"))}),[n,K,X,Z,V,ie,t.queryType,t.showFilterButton]),ue=Object(r.useMemo)(()=>Object(E.a)(X)?X.filter(e=>{let{attribute:t}=e;return t===(null==V?void 0:V.taxonomy)}).flatMap(e=>{let{slug:t}=e;return t}):[],[X,null==V?void 0:V.taxonomy]),de=Object(i.a)(ue),pe=Object(c.a)(de);Object(r.useEffect)(()=>{!pe||m()(pe,de)||m()(z,de)||le(de)},[z,de,pe,le]);const fe="single"!==t.selectType,be=Object(r.useCallback)(e=>{const t=z.includes(e);let n;fe?(n=z.filter(t=>t!==e),t||(n.push(e),n.sort())):n=t?[]:[e],le(n)},[z,fe,le]);Object(r.useEffect)(()=>{V&&!t.showFilterButton&&(Object(D.a)({currentCheckedFilters:z,hasSetFilterDefaultsFromUrl:L})?ce(X,!0):ce(X,!1))},[L,ce,X,V,z,t.showFilterButton]),Object(r.useEffect)(()=>{if(!L&&!te)return q.length>0?(I(!0),void le(q,!0)):void(T||I(!0))},[V,L,te,le,q,T]);const me=Object(H.b)();if(!b)return me(!1),null;if(!V)return n?Object(r.createElement)(g.a,{status:"warning",isDismissible:!1},Object(r.createElement)("p",null,Object(o.__)("Please select an attribute to use this filter!","woocommerce"))):(me(!1),null);if(0===$.length&&!te&&n)return Object(r.createElement)(g.a,{status:"warning",isDismissible:!1},Object(r.createElement)("p",null,Object(o.__)("There are no products with the selected attributes.","woocommerce")));const he="h"+t.headingLevel,ge=!t.isPreview&&te,Oe=!t.isPreview&&oe,ve=(ge||Oe)&&0===$.length;if(!ve&&0===$.length)return me(!1),null;const je=Object(r.createElement)(he,{className:"wc-block-attribute-filter__title"},t.heading),we=ve?Object(r.createElement)(F.a,null,je):je;return me(!0),Object(r.createElement)(r.Fragment,null,!n&&t.heading&&we,Object(r.createElement)("div",{className:A()("wc-block-attribute-filter","style-"+t.displayStyle)},"dropdown"===t.displayStyle?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(R,{key:U,className:A()(Y.className,{"single-selection":!fe,"is-loading":ve}),style:{...Y.style,borderStyle:"none"},suggestions:$.filter(e=>!z.includes(e.value)).map(e=>e.formattedValue),disabled:ve,placeholder:Object(o.sprintf)(
|
12 |
/* translators: %s attribute name. */
|
13 |
Object(o.__)("Select %s","woocommerce"),V.label),onChange:e=>{!fe&&e.length>1&&(e=[e[e.length-1]]),e=e.map(e=>{const t=$.find(t=>t.formattedValue===e);return t?t.value:e});const t=Object(x.difference)(e,z);if(1===t.length)return be(t[0]);const n=Object(x.difference)(z,e);1===n.length&&be(n[0])},value:z,displayTransform:e=>{const t=$.find(t=>[t.value,t.formattedValue].includes(e));return t?t.textLabel:e},saveTransform:D.c,messages:{added:Object(o.sprintf)(
|
14 |
/* translators: %s is the attribute label. */
|
@@ -18,8 +18,8 @@ Object(o.__)("%s filter removed.","woocommerce"),V.label),remove:Object(o.sprint
|
|
18 |
/* translators: %s is the attribute label. */
|
19 |
Object(o.__)("Remove %s filter.","woocommerce"),V.label.toLocaleLowerCase()),__experimentalInvalid:Object(o.sprintf)(
|
20 |
/* translators: %s is the attribute label. */
|
21 |
-
Object(o.__)("Invalid %s filter.","woocommerce"),V.label.toLocaleLowerCase())}}),fe&&Object(r.createElement)(k.a,{icon:_.a,size:30})):Object(r.createElement)(W,{options:$,checked:z,onChange:be,isLoading:ve,isDisabled:ve})),Object(r.createElement)("div",{className:"wc-block-attribute-filter__actions"},z.length>0&&!ve&&Object(r.createElement)(p.a,{onClick:()=>{K([]),G(Object(D.d)()),L&&ae([])},screenReaderLabel:Object(o.__)("Reset attribute filter","woocommerce")}),t.showFilterButton&&Object(r.createElement)(f.a,{className:"wc-block-attribute-filter__button",isLoading:ve,disabled:ge||Oe||0===z.length,onClick:()=>ae(z)})))}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n(100);var r=n(44);const o=()=>r.m>1},,,function(e,t,n){"use strict";var r=n(219);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=r.getWindow(t));var o=n.allowHorizontalScroll,s=n.onlyScrollIfNeeded,i=n.alignWithTop,c=n.alignWithLeft,a=n.offsetTop||0,l=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;o=void 0===o||o;var p=r.isWindow(t),f=r.offset(e),b=r.outerHeight(e),m=r.outerWidth(e),h=void 0,g=void 0,O=void 0,v=void 0,j=void 0,w=void 0,y=void 0,E=void 0,k=void 0,_=void 0;p?(y=t,_=r.height(y),k=r.width(y),E={left:r.scrollLeft(y),top:r.scrollTop(y)},j={left:f.left-E.left-l,top:f.top-E.top-a},w={left:f.left+m-(E.left+k)+d,top:f.top+b-(E.top+_)+u},v=E):(h=r.offset(t),g=t.clientHeight,O=t.clientWidth,v={left:t.scrollLeft,top:t.scrollTop},j={left:f.left-(h.left+(parseFloat(r.css(t,"borderLeftWidth"))||0))-l,top:f.top-(h.top+(parseFloat(r.css(t,"borderTopWidth"))||0))-a},w={left:f.left+m-(h.left+O+(parseFloat(r.css(t,"borderRightWidth"))||0))+d,top:f.top+b-(h.top+g+(parseFloat(r.css(t,"borderBottomWidth"))||0))+u}),j.top<0||w.top>0?!0===i?r.scrollTop(t,v.top+j.top):!1===i?r.scrollTop(t,v.top+w.top):j.top<0?r.scrollTop(t,v.top+j.top):r.scrollTop(t,v.top+w.top):s||((i=void 0===i||!!i)?r.scrollTop(t,v.top+j.top):r.scrollTop(t,v.top+w.top)),o&&(j.left<0||w.left>0?!0===c?r.scrollLeft(t,v.left+j.left):!1===c?r.scrollLeft(t,v.left+w.left):j.left<0?r.scrollLeft(t,v.left+j.left):r.scrollLeft(t,v.left+w.left):s||((c=void 0===c||!!c)?r.scrollLeft(t,v.left+j.left):r.scrollLeft(t,v.left+w.left)))}},function(e,t,n){"use strict";var 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},o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function s(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],r="scroll"+(t?"Top":"Left");if("number"!=typeof n){var o=e.document;"number"!=typeof(n=o.documentElement[r])&&(n=o.body[r])}return n}function i(e){return s(e)}function c(e){return s(e,!0)}function a(e){var t=function(e){var t,n=void 0,r=void 0,o=e.ownerDocument,s=o.body,i=o&&o.documentElement;return n=(t=e.getBoundingClientRect()).left,r=t.top,{left:n-=i.clientLeft||s.clientLeft||0,top:r-=i.clientTop||s.clientTop||0}}(e),n=e.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=i(r),t.top+=c(r),t}var l=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),u=/^(top|right|bottom|left)$/,d="left",p=void 0;function f(e,t){for(var n=0;n<e.length;n++)t(e[n])}function b(e){return"border-box"===p(e,"boxSizing")}"undefined"!=typeof window&&(p=window.getComputedStyle?function(e,t,n){var r="",o=e.ownerDocument,s=n||o.defaultView.getComputedStyle(e,null);return s&&(r=s.getPropertyValue(t)||s[t]),r}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(l.test(n)&&!u.test(t)){var r=e.style,o=r[d],s=e.runtimeStyle[d];e.runtimeStyle[d]=e.currentStyle[d],r[d]="fontSize"===t?"1em":n||0,n=r.pixelLeft+"px",r[d]=o,e.runtimeStyle[d]=s}return""===n?"auto":n});var m=["margin","border","padding"];function h(e,t,n){var r={},o=e.style,s=void 0;for(s in t)t.hasOwnProperty(s)&&(r[s]=o[s],o[s]=t[s]);for(s in n.call(e),t)t.hasOwnProperty(s)&&(o[s]=r[s])}function g(e,t,n){var r=0,o=void 0,s=void 0,i=void 0;for(s=0;s<t.length;s++)if(o=t[s])for(i=0;i<n.length;i++){var c;c="border"===o?o+n[i]+"Width":o+n[i],r+=parseFloat(p(e,c))||0}return r}function O(e){return null!=e&&e==e.window}var v={};function j(e,t,n){if(O(e))return"width"===t?v.viewportWidth(e):v.viewportHeight(e);if(9===e.nodeType)return"width"===t?v.docWidth(e):v.docHeight(e);var r="width"===t?["Left","Right"]:["Top","Bottom"],o="width"===t?e.offsetWidth:e.offsetHeight,s=(p(e),b(e)),i=0;(null==o||o<=0)&&(o=void 0,(null==(i=p(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=s?1:-1);var c=void 0!==o||s,a=o||i;if(-1===n)return c?a-g(e,["border","padding"],r):i;if(c){var l=2===n?-g(e,["border"],r):g(e,["margin"],r);return a+(1===n?0:l)}return i+g(e,m.slice(n),r)}f(["Width","Height"],(function(e){v["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],v["viewport"+e](n))},v["viewport"+e]=function(t){var n="client"+e,r=t.document,o=r.body,s=r.documentElement[n];return"CSS1Compat"===r.compatMode&&s||o&&o[n]||s}}));var w={position:"absolute",visibility:"hidden",display:"block"};function y(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=j.apply(void 0,n):h(e,w,(function(){t=j.apply(void 0,n)})),t}function E(e,t,n){var r=n;if("object"!==(void 0===t?"undefined":o(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):p(e,t);for(var s in t)t.hasOwnProperty(s)&&E(e,s,t[s])}f(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);v["outer"+t]=function(t,n){return t&&y(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];v[e]=function(t,r){return void 0===r?t&&y(t,e,-1):t?(p(t),b(t)&&(r+=g(t,["padding","border"],n)),E(t,e,r)):void 0}})),e.exports=r({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return a(e);!function(e,t){"static"===E(e,"position")&&(e.style.position="relative");var n=a(e),r={},o=void 0,s=void 0;for(s in t)t.hasOwnProperty(s)&&(o=parseFloat(E(e,s))||0,r[s]=o+t[s]-n[s]);E(e,r)}(e,t)},isWindow:O,each:f,css:E,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(O(e)){if(void 0===t)return i(e);window.scrollTo(t,c(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(O(e)){if(void 0===t)return c(e);window.scrollTo(i(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},v)},,,,function(e,t){},function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return c}));var r=n(18);const o=e=>Object(r.b)(e,"count")&&Object(r.b)(e,"description")&&Object(r.b)(e,"id")&&Object(r.b)(e,"name")&&Object(r.b)(e,"parent")&&Object(r.b)(e,"slug")&&"number"==typeof e.count&&"string"==typeof e.description&&"number"==typeof e.id&&"string"==typeof e.name&&"number"==typeof e.parent&&"string"==typeof e.slug,s=e=>Array.isArray(e)&&e.every(o),i=e=>Object(r.b)(e,"attribute")&&Object(r.b)(e,"operator")&&Object(r.b)(e,"slug")&&"string"==typeof e.attribute&&"string"==typeof e.operator&&Array.isArray(e.slug)&&e.slug.every(e=>"string"==typeof e),c=e=>Array.isArray(e)&&e.every(i)},function(e,t){},,,,,,,,,,,,,,,,,,function(e,t,n){e.exports=n(244)},function(e,t,n){"use strict";n.r(t);var r=n(38),o=n(
|
22 |
/* translators: 1: term name, 2: term position in a set of terms, 3: total term set count. */
|
23 |
-
Object(c.__)("%1$s (%2$s of %3$s)"),E,v,j);return Object(r.createElement)("span",{className:y,onMouseEnter:h,onMouseLeave:g,title:n},Object(r.createElement)("span",{className:"components-form-token-field__token-text",id:"components-form-token-field__token-text-"+w},Object(r.createElement)(b.a,{as:"span"},k),Object(r.createElement)("span",{"aria-hidden":"true"},E)),Object(r.createElement)(f.a,{className:"components-form-token-field__remove-token",icon:p.a,onClick:!u&&(()=>d({value:e})),label:O.remove,"aria-describedby":"components-form-token-field__token-text-"+w}))}var h=n(
|
24 |
/* translators: %d: number of results. */
|
25 |
Object(c._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",o.length),o.length):Object(c.__)("No results."),"assertive")}}renderTokensAndInput(){const e=Object(o.map)(this.props.value,this.renderToken);return e.splice(this.getIndexOfInput(),0,this.renderInput()),e}renderToken(e,t,n){const o=this.getTokenValue(e),s=e.status?e.status:void 0,i=t+1,c=n.length;return Object(r.createElement)(m,{key:"token-"+o,value:o,status:s,title:e.title,displayTransform:this.props.displayTransform,onClickRemove:this.onTokenClickRemove,isBorderless:e.isBorderless||this.props.isBorderless,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,disabled:"error"!==s&&this.props.disabled,messages:this.props.messages,termsCount:c,termPosition:i})}renderInput(){const{autoCapitalize:e,autoComplete:t,maxLength:n,placeholder:o,value:s,instanceId:i}=this.props;let c={instanceId:i,autoCapitalize:e,autoComplete:t,placeholder:0===s.length?o:"",ref:this.bindInput,key:"input",disabled:this.props.disabled,value:this.state.incompleteTokenValue,onBlur:this.onBlur,isExpanded:this.state.isExpanded,selectedSuggestionIndex:this.state.selectedSuggestionIndex};return n&&s.length>=n||(c={...c,onChange:this.onInputChange}),Object(r.createElement)(h.a,c)}render(){const{disabled:e,label:t=Object(c.__)("Add item"),instanceId:n,className:o,__experimentalShowHowTo:s}=this.props,{isExpanded:a}=this.state,l=i()(o,"components-form-token-field__input-container",{"is-active":this.state.isActive,"is-disabled":e});let u={className:"components-form-token-field",tabIndex:"-1"};const d=this.getMatchingSuggestions();return e||(u=Object.assign({},u,{onKeyDown:this.onKeyDown,onKeyPress:this.onKeyPress,onFocus:this.onFocus})),Object(r.createElement)("div",u,Object(r.createElement)("label",{htmlFor:"components-form-token-input-"+n,className:"components-form-token-field__label"},t),Object(r.createElement)("div",{ref:this.bindTokensAndInput,className:l,tabIndex:"-1",onMouseDown:this.onContainerTouched,onTouchStart:this.onContainerTouched},this.renderTokensAndInput(),a&&Object(r.createElement)(g.a,{instanceId:n,match:this.props.saveTransform(this.state.incompleteTokenValue),displayTransform:this.props.displayTransform,suggestions:d,selectedIndex:this.state.selectedSuggestionIndex,scrollIntoView:this.state.selectedSuggestionScroll,onHover:this.onSuggestionHovered,onSelect:this.onSuggestionSelected})),s&&Object(r.createElement)("p",{id:"components-form-token-suggestions-howto-"+n,className:"components-form-token-field__help"},this.props.tokenizeOnSpace?Object(c.__)("Separate with commas, spaces, or the Enter key."):Object(c.__)("Separate with commas or the Enter key.")))}}y.defaultProps={suggestions:Object.freeze([]),maxSuggestions:100,value:Object.freeze([]),displayTransform:o.identity,saveTransform:e=>e.trim(),onChange:()=>{},onInputChange:()=>{},isBorderless:!1,disabled:!1,tokenizeOnSpace:!1,messages:{added:Object(c.__)("Item added."),removed:Object(c.__)("Item removed."),remove:Object(c.__)("Remove item"),__experimentalInvalid:Object(c.__)("Invalid item")},__experimentalExpandOnFocus:!1,__experimentalValidateInput:()=>!0,__experimentalShowHowTo:!0},t.a=j(Object(a.withInstanceId)(y))}]);
|
1 |
+
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=243)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t){e.exports=window.wp.data},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var s=typeof r;if("string"===s||"number"===s)e.push(r);else if(Array.isArray(r)){if(r.length){var i=o.apply(null,r);i&&e.push(i)}}else if("object"===s)if(r.toString===Object.prototype.toString)for(var c in r)n.call(r,c)&&r[c]&&e.push(c);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.React},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=window.wc.blocksCheckout},function(e,t){e.exports=window.wp.compose},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.__esModule=!0,e.exports.default=e.exports,n.apply(this,arguments)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t){e.exports=window.wp.url},function(e,t){e.exports=window.wp.primitives},function(e,t,n){"use strict";var r=n(16),o=n.n(r),s=n(0),i=n(7),c=n(1),a=n(44),l=e=>{let{imageUrl:t=a.l+"/block-error.svg",header:n=Object(c.__)("Oops!","woocommerce"),text:r=Object(c.__)("There was an error loading the content.","woocommerce"),errorMessage:o,errorMessagePrefix:i=Object(c.__)("Error:","woocommerce"),button:l,showErrorBlock:u=!0}=e;return u?Object(s.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(s.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(s.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},n&&Object(s.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},n),r&&Object(s.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},r),o&&Object(s.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},i?i+" ":"",o),l&&Object(s.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};n(33);class u extends i.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(s.createElement)(s.Fragment,null,Object(s.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:n=!0,showErrorBlock:r=!0,text:o,errorMessagePrefix:i,renderError:c,button:a}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof c?c({errorMessage:u}):Object(s.createElement)(l,{showErrorBlock:r,errorMessage:n?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:i,button:a}):this.props.children}}t.a=u},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.__esModule=!0,e.exports.default=e.exports},,function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function o(e,t){return r(e)&&t in e}},function(e,t){e.exports=window.wp.deprecated},,function(e,t){e.exports=window.wp.htmlEntities},function(e,t,n){"use strict";var r=n(0),o=n(5),s=n.n(o);t.a=e=>{let t,{label:n,screenReaderLabel:o,wrapperElement:i,wrapperProps:c={}}=e;const a=null!=n,l=null!=o;return!a&&l?(t=i||"span",c={...c,className:s()(c.className,"screen-reader-text")},Object(r.createElement)(t,c,o)):(t=i||r.Fragment,a&&l&&n!==o?Object(r.createElement)(t,c,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,c,n))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(0);const o=Object(r.createContext)("page"),s=()=>Object(r.useContext)(o);o.Provider},function(e,t){e.exports=window.wp.a11y},function(e,t,n){"use strict";(function(e){var r=n(0);n(37);const o=Object(r.createContext)({slots:{},fills:{},registerSlot:()=>{void 0!==e&&e.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});t.a=o}).call(this,n(65))},,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(12),s=n.n(o);function i(e){const t=Object(r.useRef)(e);return s()(e,t.current)||(t.current=e),t.current}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"string"==typeof e},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return f}));var r=n(3),o=n(4),s=n(0),i=n(12),c=n.n(i),a=n(27),l=n(61),u=n(23);const d=e=>{const t=Object(u.a)();e=e||t;const n=Object(o.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:i}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[n,Object(s.useCallback)(t=>{i(e,t)},[e,i])]},p=(e,t,n)=>{const i=Object(u.a)();n=n||i;const c=Object(o.useSelect)(o=>o(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t),[n,e]),{setQueryValue:a}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[c,Object(s.useCallback)(t=>{a(n,e,t)},[n,e,a])]},f=(e,t)=>{const n=Object(u.a)();t=t||n;const[r,o]=d(t),i=Object(a.a)(r),p=Object(a.a)(e),f=Object(l.a)(p),b=Object(s.useRef)(!1);return Object(s.useEffect)(()=>{c()(f,p)||(o(Object.assign({},i,p)),b.current=!0)},[i,p,f,o]),b.current?[r,o]:[e,o]}},,,,function(e,t){},,function(e,t,n){"use strict";var r=n(5),o=n.n(r),s=n(0);t.a=Object(s.forwardRef)((function({as:e="div",className:t,...n},r){return function({as:e="div",...t}){return"function"==typeof t.children?t.children(t):Object(s.createElement)(e,t)}({as:e,className:o()("components-visually-hidden",t),...n,ref:r})}))},,function(e,t){e.exports=window.wp.warning},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(11),o=n.n(r),s=n(0),i=n(15);const c=[".wp-block-woocommerce-cart"],a=e=>{let{Block:t,containers:n,getProps:r=(()=>({})),getErrorBoundaryProps:c=(()=>({}))}=e;0!==n.length&&Array.prototype.forEach.call(n,(e,n)=>{const a=r(e,n),l=c(e,n),u={...e.dataset,...a.attributes||{}};(e=>{let{Block:t,container:n,attributes:r={},props:c={},errorBoundaryProps:a={}}=e;Object(s.render)(Object(s.createElement)(i.a,a,Object(s.createElement)(s.Suspense,{fallback:Object(s.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(s.createElement)(t,o()({},c,{attributes:r})))),n,()=>{n.classList&&n.classList.remove("is-loading")})})({Block:t,container:e,props:a,attributes:u,errorBoundaryProps:l})})},l=e=>{const t=document.body.querySelectorAll(c.join(",")),{Block:n,getProps:r,getErrorBoundaryProps:o,selector:s}=e;(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrappers:s}=e;const i=document.body.querySelectorAll(o);s&&s.length>0&&Array.prototype.filter.call(i,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,s)),a({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})})({Block:n,getProps:r,getErrorBoundaryProps:o,selector:s,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrapper:s}=e;const i=s.querySelectorAll(o);a({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})})({...e,wrapper:t})})})}},,function(e,t,n){"use strict";var r=n(8),o=n(0),s=n(14),i=function({icon:e,className:t,...n}){const s=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return Object(o.createElement)("span",Object(r.a)({className:s},n))};t.a=function({icon:e=null,size:t=24,...n}){if("string"==typeof e)return Object(o.createElement)(i,Object(r.a)({icon:e},n));if(Object(o.isValidElement)(e)&&i===e.type)return Object(o.cloneElement)(e,{...n});if("function"==typeof e)return e.prototype instanceof o.Component?Object(o.createElement)(e,{size:t,...n}):e({size:t,...n});if(e&&("svg"===e.type||e.type===s.SVG)){const r={width:t,height:t,...e.props,...n};return Object(o.createElement)(s.SVG,r)}return Object(o.isValidElement)(e)?Object(o.cloneElement)(e,{size:t,...n}):e}},,,function(e,t,n){"use strict";var r=n(8),o=n(0),s=n(5),i=n.n(s),c=n(6),a=n(19),l=n.n(a),u=n(10),d=n(45),p=n(90),f=n(1);function b(e,t,n){const{defaultView:r}=t,{frameElement:o}=r;if(!o||t===n.ownerDocument)return e;const s=o.getBoundingClientRect();return new r.DOMRect(e.left+s.left,e.top+s.top,e.width,e.height)}let m=0;function h(e){const t=document.scrollingElement||document.body;e&&(m=t.scrollTop);const n=e?"add":"remove";t.classList[n]("lockscroll"),document.documentElement.classList[n]("lockscroll"),e||(t.scrollTop=m)}let g=0;function O(){return Object(o.useEffect)(()=>(0===g&&h(!0),++g,()=>{1===g&&h(!1),--g}),[]),null}var v=n(25);function j(e){const t=Object(o.useContext)(v.a),n=t.slots[e]||{},r=t.fills[e],s=Object(o.useMemo)(()=>r||[],[r]);return{...n,updateSlot:Object(o.useCallback)(n=>{t.updateSlot(e,n)},[e,t.updateSlot]),unregisterSlot:Object(o.useCallback)(n=>{t.unregisterSlot(e,n)},[e,t.unregisterSlot]),fills:s,registerFill:Object(o.useCallback)(n=>{t.registerFill(e,n)},[e,t.registerFill]),unregisterFill:Object(o.useCallback)(n=>{t.unregisterFill(e,n)},[e,t.unregisterFill])}}var w=Object(o.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});function y({name:e,children:t,registerFill:n,unregisterFill:r}){const s=(e=>{const{getSlot:t,subscribe:n}=Object(o.useContext)(w),[r,s]=Object(o.useState)(t(e));return Object(o.useEffect)(()=>(s(t(e)),n(()=>{s(t(e))})),[e]),r})(e),i=Object(o.useRef)({name:e,children:t});return Object(o.useLayoutEffect)(()=>(n(e,i.current),()=>r(e,i.current)),[]),Object(o.useLayoutEffect)(()=>{i.current.children=t,s&&s.forceUpdate()},[t]),Object(o.useLayoutEffect)(()=>{e!==i.current.name&&(r(i.current.name,i.current),i.current.name=e,n(e,i.current))},[e]),s&&s.node?(Object(c.isFunction)(t)&&(t=t(s.props.fillProps)),Object(o.createPortal)(t,s.node)):null}var E=e=>Object(o.createElement)(w.Consumer,null,({registerFill:t,unregisterFill:n})=>Object(o.createElement)(y,Object(r.a)({},e,{registerFill:t,unregisterFill:n})));class k extends o.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:n,registerSlot:r}=this.props;e.name!==t&&(n(e.name),r(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:n={},getFills:r}=this.props,s=Object(c.map)(r(t,this),e=>{const t=Object(c.isFunction)(e.children)?e.children(n):e.children;return o.Children.map(t,(e,t)=>{if(!e||Object(c.isString)(e))return e;const n=e.key||t;return Object(o.cloneElement)(e,{key:n})})}).filter(Object(c.negate)(o.isEmptyElement));return Object(o.createElement)(o.Fragment,null,Object(c.isFunction)(e)?e(s):s)}}var _=e=>Object(o.createElement)(w.Consumer,null,({registerSlot:t,unregisterSlot:n,getFills:s})=>Object(o.createElement)(k,Object(r.a)({},e,{registerSlot:t,unregisterSlot:n,getFills:s})));function S(){const[,e]=Object(o.useState)({}),t=Object(o.useRef)(!0);return Object(o.useEffect)(()=>()=>{t.current=!1},[]),()=>{t.current&&e({})}}function x({name:e,children:t}){const n=j(e),r=Object(o.useRef)({rerender:S()});return Object(o.useEffect)(()=>(n.registerFill(r),()=>{n.unregisterFill(r)}),[n.registerFill,n.unregisterFill]),n.ref&&n.ref.current?("function"==typeof t&&(t=t(n.fillProps)),Object(o.createPortal)(t,n.ref.current)):null}var T=Object(o.forwardRef)((function({name:e,fillProps:t={},as:n="div",...s},i){const c=Object(o.useContext)(v.a),a=Object(o.useRef)();return Object(o.useLayoutEffect)(()=>(c.registerSlot(e,a,t),()=>{c.unregisterSlot(e,a)}),[c.registerSlot,c.unregisterSlot,e]),Object(o.useLayoutEffect)(()=>{c.updateSlot(e,t)}),Object(o.createElement)(n,Object(r.a)({ref:Object(u.useMergeRefs)([i,a])},s))}));function C(e){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(E,e),Object(o.createElement)(x,e))}n(12),o.Component;const L=Object(o.forwardRef)(({bubblesVirtually:e,...t},n)=>e?Object(o.createElement)(T,Object(r.a)({},t,{ref:n})):Object(o.createElement)(_,t));function I(e){return"appear"===e?"top":"left"}function A(e,t){const{paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:s}=(i=t).ownerDocument.defaultView.getComputedStyle(i);var i;const c=n?parseInt(n,10):0,a=r?parseInt(r,10):0,l=o?parseInt(o,10):0,u=s?parseInt(s,10):0;return{x:e.left+l,y:e.top+c,width:e.width-l-u,height:e.height-c-a,left:e.left+l,right:e.right-u,top:e.top+c,bottom:e.bottom-a}}function R(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function F(e,t,n=""){e.style[t]!==n&&(e.style[t]=n)}function P(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const N=Object(o.forwardRef)(({headerTitle:e,onClose:t,children:n,className:s,noArrow:c=!0,isAlternate:a,position:m="bottom right",range:h,focusOnMount:g="firstElement",anchorRef:v,shouldAnchorIncludePadding:w,anchorRect:y,getAnchorRect:E,expandOnMobile:k,animate:_=!0,onClickOutside:S,onFocusOutside:x,__unstableStickyBoundaryElement:T,__unstableSlotName:L="Popover",__unstableObserveElement:N,__unstableBoundaryParent:M,__unstableForcePosition:B,__unstableForceXAlignment:D,...V},W)=>{const H=Object(o.useRef)(null),q=Object(o.useRef)(null),z=Object(o.useRef)(),K=Object(u.useViewportMatch)("medium","<"),[U,$]=Object(o.useState)(),Q=j(L),Y=k&&K,[J,X]=Object(u.useResizeObserver)();c=Y||c,Object(o.useLayoutEffect)(()=>{if(Y)return P(z.current,"is-without-arrow",c),P(z.current,"is-alternate",a),R(z.current,"data-x-axis"),R(z.current,"data-y-axis"),F(z.current,"top"),F(z.current,"left"),F(q.current,"maxHeight"),void F(q.current,"maxWidth");const e=()=>{if(!z.current||!q.current)return;let e=function(e,t,n,r=!1,o,s){if(t)return t;if(n){if(!e.current)return;const t=n(e.current);return b(t,t.ownerDocument||e.current.ownerDocument,s)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==r?void 0:r.cloneRange))return b(Object(d.getRectangleFromRange)(r),r.endContainer.ownerDocument,s);if("function"==typeof(null==r?void 0:r.getBoundingClientRect)){const e=b(r.getBoundingClientRect(),r.ownerDocument,s);return o?e:A(e,r)}const{top:e,bottom:t}=r,n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),c=b(new window.DOMRect(n.left,n.top,n.width,i.bottom-n.top),e.ownerDocument,s);return o?c:A(c,r)}if(!e.current)return;const{parentNode:i}=e.current,c=i.getBoundingClientRect();return o?c:A(c,i)}(H,y,E,v,w,z.current);if(!e)return;const{offsetParent:t,ownerDocument:n}=z.current;let r,o=0;if(t&&t!==n.body){const n=t.getBoundingClientRect();o=n.top,e=new window.DOMRect(e.left-n.left,e.top-n.top,e.width,e.height)}var s;M&&(r=null===(s=z.current.closest(".popover-slot"))||void 0===s?void 0:s.parentNode);const i=X.height?X:q.current.getBoundingClientRect(),{popoverTop:l,popoverLeft:u,xAxis:p,yAxis:h,contentHeight:g,contentWidth:O}=function(e,t,n="top",r,o,s,i,c,a){const[l,u="center",d]=n.split(" "),p=function(e,t,n,r,o,s,i,c){const{height:a}=t;if(o){const t=o.getBoundingClientRect().top+a-i;if(e.top<=t)return{yAxis:n,popoverTop:Math.min(e.bottom,t)}}let l=e.top+e.height/2;"bottom"===r?l=e.bottom:"top"===r&&(l=e.top);const u={popoverTop:l,contentHeight:(l-a/2>0?a/2:l)+(l+a/2>window.innerHeight?window.innerHeight-l:a/2)},d={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};let f,b=n,m=null;if(!o&&!c)if("middle"===n&&u.contentHeight===a)b="middle";else if("top"===n&&d.contentHeight===a)b="top";else if("bottom"===n&&p.contentHeight===a)b="bottom";else{b=d.contentHeight>p.contentHeight?"top":"bottom";const e="top"===b?d.contentHeight:p.contentHeight;m=e!==a?e:null}return f="middle"===b?u.popoverTop:"top"===b?d.popoverTop:p.popoverTop,{yAxis:b,popoverTop:f,contentHeight:m}}(e,t,l,d,r,0,s,c);return{...function(e,t,n,r,o,s,i,c,a){const{width:l}=t;"left"===n&&Object(f.isRTL)()?n="right":"right"===n&&Object(f.isRTL)()&&(n="left"),"left"===r&&Object(f.isRTL)()?r="right":"right"===r&&Object(f.isRTL)()&&(r="left");const u=Math.round(e.left+e.width/2),d={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)};let p=e.left;"right"===r?p=e.right:"middle"===s||a||(p=u);let b=e.right;"left"===r?b=e.left:"middle"===s||a||(b=u);const m={popoverLeft:p,contentWidth:p-l>0?l:p},h={popoverLeft:b,contentWidth:b+l>window.innerWidth?window.innerWidth-b:l};let g,O=n,v=null;if(!o&&!c)if("center"===n&&d.contentWidth===l)O="center";else if("left"===n&&m.contentWidth===l)O="left";else if("right"===n&&h.contentWidth===l)O="right";else{O=m.contentWidth>h.contentWidth?"left":"right";const e="left"===O?m.contentWidth:h.contentWidth;l>window.innerWidth&&(v=window.innerWidth),e!==l&&(O="center",d.popoverLeft=window.innerWidth/2)}if(g="center"===O?d.popoverLeft:"left"===O?m.popoverLeft:h.popoverLeft,i){const e=i.getBoundingClientRect();g=Math.min(g,e.right-l),Object(f.isRTL)()||(g=Math.max(g,0))}return{xAxis:O,popoverLeft:g,contentWidth:v}}(e,t,u,d,r,p.yAxis,i,c,a),...p}}(e,i,m,T,z.current,o,r,B,D);"number"==typeof l&&"number"==typeof u&&(F(z.current,"top",l+"px"),F(z.current,"left",u+"px")),P(z.current,"is-without-arrow",c||"center"===p&&"middle"===h),P(z.current,"is-alternate",a),R(z.current,"data-x-axis",p),R(z.current,"data-y-axis",h),F(q.current,"maxHeight","number"==typeof g?g+"px":""),F(q.current,"maxWidth","number"==typeof O?O+"px":""),$(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[h]||"middle"))};e();const{ownerDocument:t}=z.current,{defaultView:n}=t,r=n.setInterval(e,500);let o;const s=()=>{n.cancelAnimationFrame(o),o=n.requestAnimationFrame(e)};n.addEventListener("click",s),n.addEventListener("resize",e),n.addEventListener("scroll",e,!0);const i=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(v);let l;return i&&i!==t&&(i.defaultView.addEventListener("resize",e),i.defaultView.addEventListener("scroll",e,!0)),N&&(l=new n.MutationObserver(e),l.observe(N,{attributes:!0})),()=>{n.clearInterval(r),n.removeEventListener("resize",e),n.removeEventListener("scroll",e,!0),n.removeEventListener("click",s),n.cancelAnimationFrame(o),i&&i!==t&&(i.defaultView.removeEventListener("resize",e),i.defaultView.removeEventListener("scroll",e,!0)),l&&l.disconnect()}},[Y,y,E,v,w,m,X,T,N,M]);const Z=(e,n)=>{if("focus-outside"===e&&x)x(n);else if("focus-outside"===e&&S){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>n.relatedTarget}),l()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),S(e)}else t&&t()},[ee,te]=Object(u.__experimentalUseDialog)({focusOnMount:g,__unstableOnClose:Z,onClose:Z}),ne=Object(u.useMergeRefs)([z,ee,W]),re=Boolean(_&&U)&&function(e){if("loading"===e.type)return i()("components-animate__loading");const{type:t,origin:n=I(t)}=e;if("appear"===t){const[e,t="center"]=n.split(" ");return i()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?i()("components-animate__slide-in","is-from-"+n):void 0}({type:"appear",origin:U});let oe=Object(o.createElement)("div",Object(r.a)({className:i()("components-popover",s,re,{"is-expanded":Y,"is-without-arrow":c,"is-alternate":a})},V,{ref:ne},te,{tabIndex:"-1"}),Y&&Object(o.createElement)(O,null),Y&&Object(o.createElement)("div",{className:"components-popover__header"},Object(o.createElement)("span",{className:"components-popover__header-title"},e),Object(o.createElement)(G,{className:"components-popover__close",icon:p.a,onClick:t})),Object(o.createElement)("div",{ref:q,className:"components-popover__content"},Object(o.createElement)("div",{style:{position:"relative"}},J,n)));return Q.ref&&(oe=Object(o.createElement)(C,{name:L},oe)),v||y?oe:Object(o.createElement)("span",{ref:H},oe)});N.Slot=Object(o.forwardRef)((function({name:e="Popover"},t){return Object(o.createElement)(L,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));var M=N,B=function({shortcut:e,className:t}){if(!e)return null;let n,r;return Object(c.isString)(e)&&(n=e),Object(c.isObject)(e)&&(n=e.display,r=e.ariaLabel),Object(o.createElement)("span",{className:t,"aria-label":r},n)};const D=Object(o.createElement)("div",{className:"event-catcher"}),V=({eventHandlers:e,child:t,childrenWithPopover:n})=>Object(o.cloneElement)(Object(o.createElement)("span",{className:"disabled-element-wrapper"},Object(o.cloneElement)(D,e),Object(o.cloneElement)(t,{children:n}),","),e),W=({child:e,eventHandlers:t,childrenWithPopover:n})=>Object(o.cloneElement)(e,{...t,children:n}),H=(e,t,n)=>{if(1!==o.Children.count(e))return;const r=o.Children.only(e);"function"==typeof r.props[t]&&r.props[t](n)};var q=function({children:e,position:t,text:n,shortcut:r}){const[s,i]=Object(o.useState)(!1),[a,l]=Object(o.useState)(!1),d=Object(u.useDebounce)(l,700),p=t=>{H(e,"onMouseDown",t),document.addEventListener("mouseup",m),i(!0)},f=t=>{H(e,"onMouseUp",t),document.removeEventListener("mouseup",m),i(!1)},b=e=>"mouseUp"===e?f:"mouseDown"===e?p:void 0,m=b("mouseUp"),h=(t,n)=>r=>{if(H(e,t,r),r.currentTarget.disabled)return;if("focus"===r.type&&s)return;d.cancel();const o=Object(c.includes)(["focus","mouseenter"],r.type);o!==a&&(n?d(o):l(o))},g=()=>{d.cancel(),document.removeEventListener("mouseup",m)};if(Object(o.useEffect)(()=>g,[]),1!==o.Children.count(e))return e;const O={onMouseEnter:h("onMouseEnter",!0),onMouseLeave:h("onMouseLeave"),onClick:h("onClick"),onFocus:h("onFocus"),onBlur:h("onBlur"),onMouseDown:b("mouseDown")},v=o.Children.only(e),{children:j,disabled:w}=v.props;return(w?V:W)({child:v,eventHandlers:O,childrenWithPopover:(({grandchildren:e,isOver:t,position:n,text:r,shortcut:s})=>Object(o.concatChildren)(e,t&&Object(o.createElement)(M,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(o.createElement)(B,{className:"components-tooltip__shortcut",shortcut:s}))))({grandchildren:j,isOver:a,position:t,text:n,shortcut:r})})},z=n(40),K=n(35);const U=["onMouseDown","onClick"];var G=t.a=Object(o.forwardRef)((function(e,t){const{href:n,target:s,isSmall:a,isPressed:u,isBusy:d,isDestructive:p,className:f,disabled:b,icon:m,iconPosition:h="left",iconSize:g,showTooltip:O,tooltipPosition:v,shortcut:j,label:w,children:y,text:E,variant:k,__experimentalIsFocusable:_,describedBy:S,...x}=function({isDefault:e,isPrimary:t,isSecondary:n,isTertiary:r,isLink:o,variant:s,...i}){let c=s;var a,u,d,p,f;return t&&(null!==(a=c)&&void 0!==a||(c="primary")),r&&(null!==(u=c)&&void 0!==u||(c="tertiary")),n&&(null!==(d=c)&&void 0!==d||(c="secondary")),e&&(l()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(p=c)&&void 0!==p||(c="secondary")),o&&(null!==(f=c)&&void 0!==f||(c="link")),{...i,variant:c}}(e),T=i()("components-button",f,{"is-secondary":"secondary"===k,"is-primary":"primary"===k,"is-small":a,"is-tertiary":"tertiary"===k,"is-pressed":u,"is-busy":d,"is-link":"link"===k,"is-destructive":p,"has-text":!!m&&!!y,"has-icon":!!m}),C=b&&!_,L=void 0===n||C?"button":"a",I="a"===L?{href:n,target:s}:{type:"button",disabled:C,"aria-pressed":u};if(b&&_){I["aria-disabled"]=!0;for(const e of U)x[e]=e=>{e.stopPropagation(),e.preventDefault()}}const A=!C&&(O&&w||j||!!w&&(!y||Object(c.isArray)(y)&&!y.length)&&!1!==O),R=S?Object(c.uniqueId)():null,F=x["aria-describedby"]||R,P=Object(o.createElement)(L,Object(r.a)({},I,x,{className:T,"aria-label":x["aria-label"]||w,"aria-describedby":F,ref:t}),m&&"left"===h&&Object(o.createElement)(z.a,{icon:m,size:g}),E&&Object(o.createElement)(o.Fragment,null,E),m&&"right"===h&&Object(o.createElement)(z.a,{icon:m,size:g}),y);return A?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(q,{text:S||w,shortcut:j,position:v},P),S&&Object(o.createElement)(K.a,null,Object(o.createElement)("span",{id:R},S))):Object(o.createElement)(o.Fragment,null,P,S&&Object(o.createElement)(K.a,null,Object(o.createElement)("span",{id:R},S)))}))},function(e,t,n){"use strict";n.d(t,"n",(function(){return s})),n.d(t,"l",(function(){return i})),n.d(t,"k",(function(){return c})),n.d(t,"m",(function(){return a})),n.d(t,"i",(function(){return l})),n.d(t,"d",(function(){return u})),n.d(t,"f",(function(){return d})),n.d(t,"j",(function(){return p})),n.d(t,"c",(function(){return f})),n.d(t,"e",(function(){return b})),n.d(t,"g",(function(){return m})),n.d(t,"a",(function(){return h})),n.d(t,"h",(function(){return g})),n.d(t,"b",(function(){return O}));var r,o=n(2);const s=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=s.pluginUrl+"images/",c=s.pluginUrl+"build/",a=s.buildPhase,l=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),f=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),b=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),m=Object(o.getSetting)("shippingCountries",{}),h=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),O=Object(o.getSetting)("allowedStates",{})},function(e,t){e.exports=window.wp.dom},,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(7);function o(e,t,n){var o=this,s=Object(r.useRef)(null),i=Object(r.useRef)(0),c=Object(r.useRef)(null),a=Object(r.useRef)([]),l=Object(r.useRef)(),u=Object(r.useRef)(),d=Object(r.useRef)(e),p=Object(r.useRef)(!0);d.current=e;var f=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var b=!!(n=n||{}).leading,m=!("trailing"in n)||!!n.trailing,h="maxWait"in n,g=h?Math.max(+n.maxWait||0,t):null;return Object(r.useEffect)((function(){return p.current=!0,function(){p.current=!1}}),[]),Object(r.useMemo)((function(){var e=function(e){var t=a.current,n=l.current;return a.current=l.current=null,i.current=e,u.current=d.current.apply(n,t)},n=function(e,t){f&&cancelAnimationFrame(c.current),c.current=f?requestAnimationFrame(e):setTimeout(e,t)},r=function(e){if(!p.current)return!1;var n=e-s.current,r=e-i.current;return!s.current||n>=t||n<0||h&&r>=g},O=function(t){return c.current=null,m&&a.current?e(t):(a.current=l.current=null,u.current)},v=function(){var e=Date.now();if(r(e))return O(e);if(p.current){var o=e-s.current,c=e-i.current,a=t-o,l=h?Math.min(a,g-c):a;n(v,l)}},j=function(){for(var d=[],f=0;f<arguments.length;f++)d[f]=arguments[f];var m=Date.now(),g=r(m);if(a.current=d,l.current=o,s.current=m,g){if(!c.current&&p.current)return i.current=s.current,n(v,t),b?e(s.current):u.current;if(h)return n(v,t),e(s.current)}return c.current||n(v,t),u.current};return j.cancel=function(){c.current&&(f?cancelAnimationFrame(c.current):clearTimeout(c.current)),i.current=0,a.current=s.current=l.current=c.current=null},j.isPending=function(){return!!c.current},j.flush=function(){return c.current?O(Date.now()):u.current},j}),[b,h,t,g,m,f])}},function(e,t,n){"use strict";var r=n(0);n(71),t.a=e=>{let{children:t}=e;return Object(r.createElement)("div",{className:"wc-block-filter-title-placeholder"},t)}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return s}));var r=n(0);const o=Object(r.createContext)({}),s=()=>{const{wrapper:e}=Object(r.useContext)(o);return t=>{e&&e.current&&(e.current.hidden=!t)}}},,,function(e,t){e.exports=window.wp.keycodes},function(e,t,n){"use strict";n.d(t,"d",(function(){return c})),n.d(t,"h",(function(){return a})),n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return u})),n.d(t,"e",(function(){return d})),n.d(t,"f",(function(){return p})),n.d(t,"c",(function(){return f})),n.d(t,"g",(function(){return b}));var r=n(13),o=n(70),s=n(28),i=n(124);function c(){return Math.floor(Math.random()*Date.now())}const a=e=>e.replace("pa_",""),l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n={};t.forEach(e=>{const{attribute:t,slug:r,operator:s}=e,i=a(t),c=r.join(","),l=`${o.b}${i}`,u="in"===s?"or":"and";n[`${o.a}${i}`]=c,n[l]=u});const s=Object(r.removeQueryArgs)(e,...Object.keys(n));return Object(r.addQueryArgs)(s,n)},u=e=>{let{currentCheckedFilters:t,hasSetFilterDefaultsFromUrl:n}=e;return n&&0===t.length},d=e=>{if(e){const t=Object(o.d)("filter_"+e.name);return"string"==typeof t?t.split(","):[]}return[]},p=(e,t)=>{const n=Object.entries(t).reduce((e,t)=>{let[n,r]=t;return n.includes("query_type")?e:{...e,[n]:r}},{});return Object.entries(n).reduce((t,n)=>{let[r,o]=n;return e[r]===o&&t},!0)},f=e=>e.trim().replace(/\s/g,"-").replace(/_/g,"-").replace(/-+/g,"-").replace(/[^a-zA-Z0-9-]/g,""),b=e=>({className:Object(s.a)(null==e?void 0:e.className)?e.className:"",attributeId:parseInt(Object(s.a)(null==e?void 0:e.attributeId)?e.attributeId:"0",10),showCounts:"false"!==(null==e?void 0:e.showCounts),queryType:Object(s.a)(null==e?void 0:e.queryType)&&e.queryType||i.attributes.queryType.default,heading:Object(s.a)(null==e?void 0:e.heading)?e.heading:"",headingLevel:Object(s.a)(null==e?void 0:e.headingLevel)&&parseInt(e.headingLevel,10)||i.attributes.headingLevel.default,displayStyle:Object(s.a)(null==e?void 0:e.displayStyle)&&e.displayStyle||i.attributes.displayStyle.default,showFilterButton:"true"===(null==e?void 0:e.showFilterButton),selectType:Object(s.a)(null==e?void 0:e.selectType)&&e.selectType||i.attributes.selectType.default,isPreview:!1})},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),o=n(4),s=n(0),i=n(27),c=n(73);const a=e=>{const{namespace:t,resourceName:n,resourceValues:a=[],query:l={},shouldSelect:u=!0}=e;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");const d=Object(s.useRef)({results:[],isLoading:!0}),p=Object(i.a)(l),f=Object(i.a)(a),b=Object(c.a)(),m=Object(o.useSelect)(e=>{if(!u)return null;const o=e(r.COLLECTIONS_STORE_KEY),s=[t,n,p,f],i=o.getCollectionError(...s);if(i){if(!(i instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");b(i)}return{results:o.getCollection(...s),isLoading:!o.hasFinishedResolution("getCollection",s)}},[t,n,f,p,u]);return null!==m&&(d.current=m),d.current}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(7);function o(e,t){const n=Object(r.useRef)();return Object(r.useEffect)(()=>{n.current===e||t&&!t(e,n.current)||(n.current=e)},[e,t]),n.current}},function(e,t,n){"use strict";var r=n(0),o=n(1),s=n(22);n(133),t.a=e=>{let{name:t,count:n}=e;return Object(r.createElement)(r.Fragment,null,t,null!==n&&Number.isFinite(n)&&Object(r.createElement)(s.a,{label:n.toString(),screenReaderLabel:Object(o.sprintf)(
|
2 |
/* translators: %s number of products. */
|
3 |
Object(o._n)("%s product","%s products",n,"woocommerce"),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},,,function(e,t){var n,r,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!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:s}catch(e){n=s}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var a,l=[],u=!1,d=-1;function p(){u&&a&&(u=!1,a.length?l=a.concat(l):d=-1,l.length&&f())}function f(){if(!u){var e=c(p);u=!0;for(var t=l.length;t;){for(a=l,l=[];++d<t;)a&&a[d].run();d=-1,t=l.length}a=null,u=!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];l.push(new b(e,t)),1!==l.length||u||c(f)},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";n.d(t,"a",(function(){return r}));const r=e=>"boolean"==typeof e},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return a})),n.d(t,"d",(function(){return l})),n.d(t,"c",(function(){return u}));var r=n(13),o=n(2),s=n(69);const i=Object(o.getSettingWithCoercion)("is_rendering_php_template",!1,s.a),c="query_type_",a="filter_";function l(e){return window?Object(r.getQueryArg)(window.location.href,e):null}function u(e){i?window.location.href=e:window.history.replaceState({},"",e)}},function(e,t){},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);const o=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(0),o=n(14);const s=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=s},,,,function(e,t,n){"use strict";var r=n(0),o=n(1),s=n(5),i=n.n(s),c=n(22);n(115),t.a=e=>{let{className:t,label:
|
4 |
/* translators: Reset button text for filters. */
|
8 |
/* translators: %s is referring the remaining count of options */
|
9 |
Object(o._n)("Show %s more option","Show %s more options",e,"woocommerce"),e)},Object(o.sprintf)(
|
10 |
/* translators: %s number of options to reveal. */
|
11 |
+
Object(o._n)("Show %s more","Show %s more",e,"woocommerce"),e)))},[s,d,p]),h=Object(r.useMemo)(()=>p&&Object(r.createElement)("li",{key:"show-less",className:"show-less"},Object(r.createElement)("button",{onClick:()=>{f(!1)},"aria-expanded":!0,"aria-label":Object(o.__)("Show less options","woocommerce")},Object(o.__)("Show less","woocommerce"))),[p]),g=Object(r.useMemo)(()=>{const e=s.length>d+5;return Object(r.createElement)(r.Fragment,null,s.map((t,o)=>Object(r.createElement)(r.Fragment,{key:t.value},Object(r.createElement)("li",e&&!p&&o>=d&&{hidden:!0},Object(r.createElement)(c.CheckboxControl,{id:t.value,className:"wc-block-checkbox-list__checkbox",label:t.label,checked:a.includes(t.value),onChange:()=>{n(t.value)}})),e&&o===d-1&&m)),e&&h)},[s,n,a,p,d,h,m,u]),O=i()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":l},t);return Object(r.createElement)("ul",{className:O},l?b:g)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(7),o=n(50);function s(e,t){return e===t}function i(e){return"function"==typeof e?function(){return e}:e}function c(e,t,n){var c=n&&n.equalityFn||s,a=function(e){var t=Object(r.useState)(i(e)),n=t[0],o=t[1];return[n,Object(r.useCallback)((function(e){return o(i(e))}),[])]}(e),l=a[0],u=a[1],d=Object(o.a)(Object(r.useCallback)((function(e){return u(e)}),[u]),t,n),p=Object(r.useRef)(e);return c(p.current,e)||(d(e),p.current=e),[l,d]}},function(e,t,n){"use strict";var r=n(0),o=n(6),s=n(5),i=n.n(s),c=n(1),a=n(24),l=n(90),u=n(43);function d(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}t.a=function({className:e,status:t="info",children:n,spokenMessage:s=n,onRemove:p=o.noop,isDismissible:f=!0,actions:b=[],politeness:m=d(t),__unstableHTML:h,onDismiss:g=o.noop}){!function(e,t){const n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)(()=>{n&&Object(a.speak)(n,t)},[n,t])}(s,m);const O=i()(e,"components-notice","is-"+t,{"is-dismissible":f});return h&&(n=Object(r.createElement)(r.RawHTML,null,n)),Object(r.createElement)("div",{className:O},Object(r.createElement)("div",{className:"components-notice__content"},n,Object(r.createElement)("div",{className:"components-notice__actions"},b.map(({className:e,label:t,isPrimary:n,variant:o,noDefaultClasses:s=!1,onClick:c,url:a},l)=>{let d=o;return"primary"===o||s||(d=a?"link":"secondary"),void 0===d&&n&&(d="primary"),Object(r.createElement)(u.a,{key:l,href:a,variant:d,onClick:a?void 0:c,className:i()("components-notice__action",e)},t)}))),f&&Object(r.createElement)(u.a,{className:"components-notice__dismiss",icon:l.a,label:Object(c.__)("Dismiss this notice"),onClick:e=>{var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),g(),p()},showTooltip:!1}))}},,function(e,t){e.exports=window.wp.blocks},,,,,,,,function(e,t){e.exports=window.wp.blockEditor},,,function(e,t,n){"use strict";var r=n(0);t.a=function(e){let{icon:t,size:n=24,...o}=e;return Object(r.cloneElement)(t,{width:n,height:n,...o})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return s}));var r=n(6);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const s=e.filter(e=>e.attribute===n.taxonomy),i=s.length?s[0]:null;if(!(i&&i.slug&&Array.isArray(i.slug)&&i.slug.includes(o)))return;const c=i.slug.filter(e=>e!==o),a=e.filter(e=>e.attribute!==n.taxonomy);c.length>0&&(i.slug=c.sort(),a.push(i)),t(Object(r.sortBy)(a,"attribute"))},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";if(!n||!n.taxonomy)return[];const i=e.filter(e=>e.attribute!==n.taxonomy);return 0===o.length?t(i):(i.push({attribute:n.taxonomy,operator:s,slug:o.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(r.sortBy)(i,"attribute"))),i}},,,function(e,t){},function(e,t){},function(e,t){},,function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return i}));var r=n(2);const o=Object(r.getSetting)("attributes",[]).reduce((e,t)=>{const 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;var r;return n&&n.id&&e.push(n),e},[]),s=e=>{if(e)return o.find(t=>t.id===e)},i=e=>{if(e)return o.find(t=>t.taxonomy===e)}},,,,,function(e){e.exports=JSON.parse('{"name":"woocommerce/attribute-filter","version":"1.0.0","title":"Filter by Attribute Controls","description":"Enable customers to filter the product grid by selecting one or more attributes, such as color.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"color":{"text":true,"background":false},"inserter":false,"lock":false},"example":{"attributes":{"isPreview":true}},"attributes":{"className":{"type":"string","default":""},"attributeId":{"type":"number","default":0},"showCounts":{"type":"boolean","default":true},"queryType":{"type":"string","default":"or"},"headingLevel":{"type":"number","default":3},"displayStyle":{"type":"string","default":"list"},"showFilterButton":{"type":"boolean","default":false},"selectType":{"type":"string","default":"multiple"},"isPreview":{"type":"boolean","default":false}},"textdomain":"woocommerce","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},,,,,,,,,function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(0),o=n(97),s=n(6),i=n(27),c=n(18),a=n(29),l=n(60),u=n(23);const d=e=>{let{queryAttribute:t,queryPrices:n,queryStock:d,queryRating:p,queryState:f}=e,b=Object(u.a)();b+="-collection-data";const[m]=Object(a.a)(b),[h,g]=Object(a.b)("calculate_attribute_counts",[],b),[O,v]=Object(a.b)("calculate_price_range",null,b),[j,w]=Object(a.b)("calculate_stock_status_counts",null,b),[y,E]=Object(a.b)("calculate_rating_counts",null,b),k=Object(i.a)(t||{}),_=Object(i.a)(n),S=Object(i.a)(d),x=Object(i.a)(p);Object(r.useEffect)(()=>{"object"==typeof k&&Object.keys(k).length&&(h.find(e=>Object(c.b)(k,"taxonomy")&&e.taxonomy===k.taxonomy)||g([...h,k]))},[k,h,g]),Object(r.useEffect)(()=>{O!==_&&void 0!==_&&v(_)},[_,v,O]),Object(r.useEffect)(()=>{j!==S&&void 0!==S&&w(S)},[S,w,j]),Object(r.useEffect)(()=>{y!==x&&void 0!==x&&E(x)},[x,E,y]);const[T,C]=Object(r.useState)(!1),[L]=Object(o.a)(T,200);T||C(!0);const I=Object(r.useMemo)(()=>(e=>{const t=e;return Array.isArray(e.calculate_attribute_counts)&&(t.calculate_attribute_counts=Object(s.sortBy)(e.calculate_attribute_counts.map(e=>{let{taxonomy:t,queryType:n}=e;return{taxonomy:t,query_type:n}}),["taxonomy","query_type"])),t})(m),[m]);return Object(l.a)({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...f,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...I},shouldSelect:L})}},,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(8),o=n(0),s=n(5),i=n.n(s);class c extends o.Component{constructor(){super(...arguments),this.onChange=this.onChange.bind(this),this.bindInput=this.bindInput.bind(this)}focus(){this.input.focus()}hasFocus(){return this.input===this.input.ownerDocument.activeElement}bindInput(e){this.input=e}onChange(e){this.props.onChange({value:e.target.value})}render(){const{value:e,isExpanded:t,instanceId:n,selectedSuggestionIndex:s,className:c,...a}=this.props,l=e?e.length+1:0;return Object(o.createElement)("input",Object(r.a)({ref:this.bindInput,id:"components-form-token-input-"+n,type:"text"},a,{value:e||"",onChange:this.onChange,size:l,className:i()(c,"components-form-token-field__input"),autoComplete:"off",role:"combobox","aria-expanded":t,"aria-autocomplete":"list","aria-owns":t?"components-form-token-suggestions-"+n:void 0,"aria-activedescendant":-1!==s?`components-form-token-suggestions-${n}-${s}`:void 0,"aria-describedby":"components-form-token-suggestions-howto-"+n}))}}t.a=c},function(e,t,n){"use strict";var r=n(0),o=n(6),s=n(149),i=n.n(s),c=n(5),a=n.n(c),l=n(10);class u extends r.Component{constructor(){super(...arguments),this.handleMouseDown=this.handleMouseDown.bind(this),this.bindList=this.bindList.bind(this)}componentDidUpdate(){this.props.selectedIndex>-1&&this.props.scrollIntoView&&this.list.children[this.props.selectedIndex]&&(this.scrollingIntoView=!0,i()(this.list.children[this.props.selectedIndex],this.list,{onlyScrollIfNeeded:!0}),this.props.setTimeout(()=>{this.scrollingIntoView=!1},100))}bindList(e){this.list=e}handleHover(e){return()=>{this.scrollingIntoView||this.props.onHover(e)}}handleClick(e){return()=>{this.props.onSelect(e)}}handleMouseDown(e){e.preventDefault()}computeSuggestionMatch(e){const t=this.props.displayTransform(this.props.match||"").toLocaleLowerCase();if(0===t.length)return null;const n=(e=this.props.displayTransform(e)).toLocaleLowerCase().indexOf(t);return{suggestionBeforeMatch:e.substring(0,n),suggestionMatch:e.substring(n,n+t.length),suggestionAfterMatch:e.substring(n+t.length)}}render(){return Object(r.createElement)("ul",{ref:this.bindList,className:"components-form-token-field__suggestions-list",id:"components-form-token-suggestions-"+this.props.instanceId,role:"listbox"},Object(o.map)(this.props.suggestions,(e,t)=>{const n=this.computeSuggestionMatch(e),o=a()("components-form-token-field__suggestion",{"is-selected":t===this.props.selectedIndex});return Object(r.createElement)("li",{id:`components-form-token-suggestions-${this.props.instanceId}-${t}`,role:"option",className:o,key:null!=e&&e.value?e.value:this.props.displayTransform(e),onMouseDown:this.handleMouseDown,onClick:this.handleClick(e),onMouseEnter:this.handleHover(e),"aria-selected":t===this.props.selectedIndex},n?Object(r.createElement)("span",{"aria-label":this.props.displayTransform(e)},n.suggestionBeforeMatch,Object(r.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch):this.props.displayTransform(e))}))}}u.defaultProps={match:"",onHover:()=>{},onSelect:()=>{},suggestions:Object.freeze([])},t.a=Object(l.withSafeTimeout)(u)},function(e,t,n){"use strict";e.exports=n(218)},,,,,,,,,function(e,t,n){"use strict";var r=n(0),o=n(1),s=n(275),i=n(27),c=n(61),a=n(29),l=n(60),u=n(134),d=n(62),p=n(94),f=n(95),b=n(12),m=n.n(b),h=n(21),g=n(98),O=n(2),v=n(13),j=n(69),w=n(28),y=n(18),E=n(224),k=n(111),_=n(282),S=n(70),x=n(6),T=n(11),C=n.n(T),L=n(284),I=n(5),A=n.n(I);n(225);var R=e=>{let{className:t,style:n,suggestions:o,multiple:s=!0,saveTransform:i=(e=>e.trim().replace(/\s/g,"-")),messages:c={},validateInput:a=(e=>o.includes(e)),label:l="",...u}=e;return Object(r.createElement)("div",{className:A()("wc-blocks-components-form-token-field-wrapper",t,{"single-selection":!s}),style:n},Object(r.createElement)(L.a,C()({label:l,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,__experimentalValidateInput:a,saveTransform:i,maxLength:s?void 0:1,suggestions:o,messages:c},u)))},F=n(51),P=n(119),N=n(112);const M=[{value:"preview-1",formattedValue:"preview-1",name:"Blue",label:Object(r.createElement)(d.a,{name:"Blue",count:3}),textLabel:"Blue (3)"},{value:"preview-2",formattedValue:"preview-2",name:"Green",label:Object(r.createElement)(d.a,{name:"Green",count:3}),textLabel:"Green (3)"},{value:"preview-3",formattedValue:"preview-3",name:"Red",label:Object(r.createElement)(d.a,{name:"Red",count:2}),textLabel:"Red (2)"}],B={id:0,name:"preview",taxonomy:"preview",label:"Preview"};n(223);var D=n(59),V=n(96),W=e=>{let{isLoading:t=!1,options:n,checked:o,onChange:s}=e;return t?Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"is-loading"}),Object(r.createElement)("span",{className:"is-loading"})):Object(r.createElement)(V.a,{className:"wc-block-attribute-filter-list",options:n,checked:o,onChange:s,isLoading:t,isDisabled:t})},H=n(55);t.a=e=>{let{attributes:t,isEditor:n=!1}=e;const b=Object(O.getSettingWithCoercion)("has_filterable_products",!1,j.a),T=Object(O.getSettingWithCoercion)("is_rendering_php_template",!1,j.a),C=Object(O.getSettingWithCoercion)("page_url",window.location.href,w.a),[L,I]=Object(r.useState)(!1),V=t.isPreview&&!t.attributeId?B:Object(P.a)(t.attributeId),q=Object(r.useMemo)(()=>Object(D.e)(V),[V]),[z,K]=Object(r.useState)(q),[U,G]=Object(r.useState)(Object(D.d)()),[$,Q]=Object(r.useState)(t.isPreview&&!t.attributeId?M:[]),Y=Object(s.a)(t),[J]=Object(a.a)(),[X,Z]=Object(a.b)("attributes",[]),{results:ee,isLoading:te}=Object(l.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[(null==V?void 0:V.id)||0],shouldSelect:t.attributeId>0}),ne="dropdown"!==t.displayStyle&&"and"===t.queryType,{results:re,isLoading:oe}=Object(u.a)({queryAttribute:{taxonomy:(null==V?void 0:V.taxonomy)||"",queryType:t.queryType},queryState:{...J,attributes:ne?J.attributes:null}}),se=Object(r.useCallback)(e=>Object(y.b)(re,"attribute_counts")&&Array.isArray(re.attribute_counts)?re.attribute_counts.find(t=>{let{term:n}=t;return n===e}):null,[re]);Object(r.useEffect)(()=>{if(te||oe)return;if(!Array.isArray(ee))return;const e=ee.map(e=>{const n=se(e.id);if(!(n||z.includes(e.slug)||(o=e.slug,null!=J&&J.attributes&&J.attributes.some(e=>{let{attribute:t,slug:n=[]}=e;return t===(null==V?void 0:V.taxonomy)&&n.includes(o)}))))return null;var o;const s=n?n.count:0;return{formattedValue:Object(D.c)(e.slug),value:e.slug,name:Object(h.decodeEntities)(e.name),label:Object(r.createElement)(d.a,{name:Object(h.decodeEntities)(e.name),count:t.showCounts?s:null}),textLabel:t.showCounts?`${Object(h.decodeEntities)(e.name)} (${s})`:Object(h.decodeEntities)(e.name)}}).filter(e=>!!e);Q(e),G(Object(D.d)())},[null==V?void 0:V.taxonomy,ee,te,t.showCounts,oe,se,z,J.attributes]);const ie=Object(r.useCallback)(e=>Array.isArray(ee)?ee.reduce((t,n)=>(e.includes(n.slug)&&t.push(n),t),[]):[],[ee]),ce=Object(r.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){if(null==V||!V.taxonomy)return;const t=Object.keys(Object(v.getQueryArgs)(window.location.href)),n=Object(D.h)(V.taxonomy),r=t.reduce((e,t)=>t.includes(S.b+n)||t.includes(S.a+n)?Object(v.removeQueryArgs)(e,t):e,window.location.href),o=Object(D.b)(r,e);Object(S.c)(o)}else{const t=Object(D.b)(C,e),n=Object(v.getQueryArgs)(window.location.href),r=Object(v.getQueryArgs)(t);Object(D.f)(n,r)||Object(S.c)(t)}}),[C,null==V?void 0:V.taxonomy]),ae=e=>{const n=Object(N.b)(X,Z,V,ie(e),"or"===t.queryType?"in":"and");ce(n,0===e.length)},le=Object(r.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n||(K(e),!r&&t.showFilterButton||Object(N.b)(X,Z,V,ie(e),"or"===t.queryType?"in":"and"))}),[n,K,X,Z,V,ie,t.queryType,t.showFilterButton]),ue=Object(r.useMemo)(()=>Object(E.a)(X)?X.filter(e=>{let{attribute:t}=e;return t===(null==V?void 0:V.taxonomy)}).flatMap(e=>{let{slug:t}=e;return t}):[],[X,null==V?void 0:V.taxonomy]),de=Object(i.a)(ue),pe=Object(c.a)(de);Object(r.useEffect)(()=>{!pe||m()(pe,de)||m()(z,de)||le(de)},[z,de,pe,le]);const fe="single"!==t.selectType,be=Object(r.useCallback)(e=>{const t=z.includes(e);let n;fe?(n=z.filter(t=>t!==e),t||(n.push(e),n.sort())):n=t?[]:[e],le(n)},[z,fe,le]);Object(r.useEffect)(()=>{V&&!t.showFilterButton&&(Object(D.a)({currentCheckedFilters:z,hasSetFilterDefaultsFromUrl:L})?ce(X,!0):ce(X,!1))},[L,ce,X,V,z,t.showFilterButton]),Object(r.useEffect)(()=>{if(!L&&!te)return q.length>0?(I(!0),void le(q,!0)):void(T||I(!0))},[V,L,te,le,q,T]);const me=Object(H.b)();if(!b)return me(!1),null;if(!V)return n?Object(r.createElement)(g.a,{status:"warning",isDismissible:!1},Object(r.createElement)("p",null,Object(o.__)("Please select an attribute to use this filter!","woocommerce"))):(me(!1),null);if(0===$.length&&!te&&n)return Object(r.createElement)(g.a,{status:"warning",isDismissible:!1},Object(r.createElement)("p",null,Object(o.__)("There are no products with the selected attributes.","woocommerce")));const he="h"+t.headingLevel,ge=!t.isPreview&&te,Oe=!t.isPreview&&oe,ve=(ge||Oe)&&0===$.length;if(!ve&&0===$.length)return me(!1),null;const je=Object(r.createElement)(he,{className:"wc-block-attribute-filter__title"},t.heading),we=ve?Object(r.createElement)(F.a,null,je):je;return me(!0),Object(r.createElement)(r.Fragment,null,!n&&t.heading&&we,Object(r.createElement)("div",{className:A()("wc-block-attribute-filter","style-"+t.displayStyle)},"dropdown"===t.displayStyle?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(R,{key:U,className:A()(Y.className,{"single-selection":!fe,"is-loading":ve}),style:{...Y.style,borderStyle:"none"},suggestions:$.filter(e=>!z.includes(e.value)).map(e=>e.formattedValue),disabled:ve,placeholder:Object(o.sprintf)(
|
12 |
/* translators: %s attribute name. */
|
13 |
Object(o.__)("Select %s","woocommerce"),V.label),onChange:e=>{!fe&&e.length>1&&(e=[e[e.length-1]]),e=e.map(e=>{const t=$.find(t=>t.formattedValue===e);return t?t.value:e});const t=Object(x.difference)(e,z);if(1===t.length)return be(t[0]);const n=Object(x.difference)(z,e);1===n.length&&be(n[0])},value:z,displayTransform:e=>{const t=$.find(t=>[t.value,t.formattedValue].includes(e));return t?t.textLabel:e},saveTransform:D.c,messages:{added:Object(o.sprintf)(
|
14 |
/* translators: %s is the attribute label. */
|
18 |
/* translators: %s is the attribute label. */
|
19 |
Object(o.__)("Remove %s filter.","woocommerce"),V.label.toLocaleLowerCase()),__experimentalInvalid:Object(o.sprintf)(
|
20 |
/* translators: %s is the attribute label. */
|
21 |
+
Object(o.__)("Invalid %s filter.","woocommerce"),V.label.toLocaleLowerCase())}}),fe&&Object(r.createElement)(k.a,{icon:_.a,size:30})):Object(r.createElement)(W,{options:$,checked:z,onChange:be,isLoading:ve,isDisabled:ve})),Object(r.createElement)("div",{className:"wc-block-attribute-filter__actions"},z.length>0&&!ve&&Object(r.createElement)(p.a,{onClick:()=>{K([]),G(Object(D.d)()),L&&ae([])},screenReaderLabel:Object(o.__)("Reset attribute filter","woocommerce")}),t.showFilterButton&&Object(r.createElement)(f.a,{className:"wc-block-attribute-filter__button",isLoading:ve,disabled:ge||Oe||0===z.length,onClick:()=>ae(z)})))}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n(100);var r=n(44);const o=()=>r.m>1},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(28),o=n(18);const s=e=>Object(r.a)(e)?JSON.parse(e)||{}:Object(o.a)(e)?e:{}},,,function(e,t,n){"use strict";var r=n(219);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=r.getWindow(t));var o=n.allowHorizontalScroll,s=n.onlyScrollIfNeeded,i=n.alignWithTop,c=n.alignWithLeft,a=n.offsetTop||0,l=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;o=void 0===o||o;var p=r.isWindow(t),f=r.offset(e),b=r.outerHeight(e),m=r.outerWidth(e),h=void 0,g=void 0,O=void 0,v=void 0,j=void 0,w=void 0,y=void 0,E=void 0,k=void 0,_=void 0;p?(y=t,_=r.height(y),k=r.width(y),E={left:r.scrollLeft(y),top:r.scrollTop(y)},j={left:f.left-E.left-l,top:f.top-E.top-a},w={left:f.left+m-(E.left+k)+d,top:f.top+b-(E.top+_)+u},v=E):(h=r.offset(t),g=t.clientHeight,O=t.clientWidth,v={left:t.scrollLeft,top:t.scrollTop},j={left:f.left-(h.left+(parseFloat(r.css(t,"borderLeftWidth"))||0))-l,top:f.top-(h.top+(parseFloat(r.css(t,"borderTopWidth"))||0))-a},w={left:f.left+m-(h.left+O+(parseFloat(r.css(t,"borderRightWidth"))||0))+d,top:f.top+b-(h.top+g+(parseFloat(r.css(t,"borderBottomWidth"))||0))+u}),j.top<0||w.top>0?!0===i?r.scrollTop(t,v.top+j.top):!1===i?r.scrollTop(t,v.top+w.top):j.top<0?r.scrollTop(t,v.top+j.top):r.scrollTop(t,v.top+w.top):s||((i=void 0===i||!!i)?r.scrollTop(t,v.top+j.top):r.scrollTop(t,v.top+w.top)),o&&(j.left<0||w.left>0?!0===c?r.scrollLeft(t,v.left+j.left):!1===c?r.scrollLeft(t,v.left+w.left):j.left<0?r.scrollLeft(t,v.left+j.left):r.scrollLeft(t,v.left+w.left):s||((c=void 0===c||!!c)?r.scrollLeft(t,v.left+j.left):r.scrollLeft(t,v.left+w.left)))}},function(e,t,n){"use strict";var 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},o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function s(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],r="scroll"+(t?"Top":"Left");if("number"!=typeof n){var o=e.document;"number"!=typeof(n=o.documentElement[r])&&(n=o.body[r])}return n}function i(e){return s(e)}function c(e){return s(e,!0)}function a(e){var t=function(e){var t,n=void 0,r=void 0,o=e.ownerDocument,s=o.body,i=o&&o.documentElement;return n=(t=e.getBoundingClientRect()).left,r=t.top,{left:n-=i.clientLeft||s.clientLeft||0,top:r-=i.clientTop||s.clientTop||0}}(e),n=e.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=i(r),t.top+=c(r),t}var l=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),u=/^(top|right|bottom|left)$/,d="left",p=void 0;function f(e,t){for(var n=0;n<e.length;n++)t(e[n])}function b(e){return"border-box"===p(e,"boxSizing")}"undefined"!=typeof window&&(p=window.getComputedStyle?function(e,t,n){var r="",o=e.ownerDocument,s=n||o.defaultView.getComputedStyle(e,null);return s&&(r=s.getPropertyValue(t)||s[t]),r}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(l.test(n)&&!u.test(t)){var r=e.style,o=r[d],s=e.runtimeStyle[d];e.runtimeStyle[d]=e.currentStyle[d],r[d]="fontSize"===t?"1em":n||0,n=r.pixelLeft+"px",r[d]=o,e.runtimeStyle[d]=s}return""===n?"auto":n});var m=["margin","border","padding"];function h(e,t,n){var r={},o=e.style,s=void 0;for(s in t)t.hasOwnProperty(s)&&(r[s]=o[s],o[s]=t[s]);for(s in n.call(e),t)t.hasOwnProperty(s)&&(o[s]=r[s])}function g(e,t,n){var r=0,o=void 0,s=void 0,i=void 0;for(s=0;s<t.length;s++)if(o=t[s])for(i=0;i<n.length;i++){var c;c="border"===o?o+n[i]+"Width":o+n[i],r+=parseFloat(p(e,c))||0}return r}function O(e){return null!=e&&e==e.window}var v={};function j(e,t,n){if(O(e))return"width"===t?v.viewportWidth(e):v.viewportHeight(e);if(9===e.nodeType)return"width"===t?v.docWidth(e):v.docHeight(e);var r="width"===t?["Left","Right"]:["Top","Bottom"],o="width"===t?e.offsetWidth:e.offsetHeight,s=(p(e),b(e)),i=0;(null==o||o<=0)&&(o=void 0,(null==(i=p(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=s?1:-1);var c=void 0!==o||s,a=o||i;if(-1===n)return c?a-g(e,["border","padding"],r):i;if(c){var l=2===n?-g(e,["border"],r):g(e,["margin"],r);return a+(1===n?0:l)}return i+g(e,m.slice(n),r)}f(["Width","Height"],(function(e){v["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],v["viewport"+e](n))},v["viewport"+e]=function(t){var n="client"+e,r=t.document,o=r.body,s=r.documentElement[n];return"CSS1Compat"===r.compatMode&&s||o&&o[n]||s}}));var w={position:"absolute",visibility:"hidden",display:"block"};function y(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=j.apply(void 0,n):h(e,w,(function(){t=j.apply(void 0,n)})),t}function E(e,t,n){var r=n;if("object"!==(void 0===t?"undefined":o(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):p(e,t);for(var s in t)t.hasOwnProperty(s)&&E(e,s,t[s])}f(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);v["outer"+t]=function(t,n){return t&&y(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];v[e]=function(t,r){return void 0===r?t&&y(t,e,-1):t?(p(t),b(t)&&(r+=g(t,["padding","border"],n)),E(t,e,r)):void 0}})),e.exports=r({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return a(e);!function(e,t){"static"===E(e,"position")&&(e.style.position="relative");var n=a(e),r={},o=void 0,s=void 0;for(s in t)t.hasOwnProperty(s)&&(o=parseFloat(E(e,s))||0,r[s]=o+t[s]-n[s]);E(e,r)}(e,t)},isWindow:O,each:f,css:E,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(O(e)){if(void 0===t)return i(e);window.scrollTo(t,c(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(O(e)){if(void 0===t)return c(e);window.scrollTo(i(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},v)},,,,function(e,t){},function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return c}));var r=n(18);const o=e=>Object(r.b)(e,"count")&&Object(r.b)(e,"description")&&Object(r.b)(e,"id")&&Object(r.b)(e,"name")&&Object(r.b)(e,"parent")&&Object(r.b)(e,"slug")&&"number"==typeof e.count&&"string"==typeof e.description&&"number"==typeof e.id&&"string"==typeof e.name&&"number"==typeof e.parent&&"string"==typeof e.slug,s=e=>Array.isArray(e)&&e.every(o),i=e=>Object(r.b)(e,"attribute")&&Object(r.b)(e,"operator")&&Object(r.b)(e,"slug")&&"string"==typeof e.attribute&&"string"==typeof e.operator&&Array.isArray(e.slug)&&e.slug.every(e=>"string"==typeof e),c=e=>Array.isArray(e)&&e.every(i)},function(e,t){},,,,,,,,,,,,,,,,,,function(e,t,n){e.exports=n(244)},function(e,t,n){"use strict";n.r(t);var r=n(38),o=n(158),s=n(59);Object(r.a)({selector:".wp-block-woocommerce-attribute-filter",Block:o.a,getProps:e=>({isEditor:!1,attributes:Object(s.g)(e.dataset)})})},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(108),o=n(214),s=n(18),i=n(215);const c=e=>{if(!Object(o.a)())return{className:"",style:{}};const t=Object(s.a)(e)?e:{},n=Object(i.a)(t.style);return Object(r.__experimentalUseBorderProps)({...t,style:n})}},,,,,,function(e,t,n){"use strict";var r=n(0),o=n(14);const s=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=s},function(e,t,n){"use strict";var r=n(0),o=n(14);const s=Object(r.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(o.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));t.a=s},,function(e,t,n){"use strict";var r=n(0),o=n(6),s=n(5),i=n.n(s),c=n(1),a=n(10),l=n(58),u=n(12),d=n.n(u),p=n(281),f=n(43),b=n(35);function m({value:e,status:t,title:n,displayTransform:s,isBorderless:l=!1,disabled:u=!1,onClickRemove:d=o.noop,onMouseEnter:h,onMouseLeave:g,messages:O,termPosition:v,termsCount:j}){const w=Object(a.useInstanceId)(m),y=i()("components-form-token-field__token",{"is-error":"error"===t,"is-success":"success"===t,"is-validating":"validating"===t,"is-borderless":l,"is-disabled":u}),E=s(e),k=Object(c.sprintf)(
|
22 |
/* translators: 1: term name, 2: term position in a set of terms, 3: total term set count. */
|
23 |
+
Object(c.__)("%1$s (%2$s of %3$s)"),E,v,j);return Object(r.createElement)("span",{className:y,onMouseEnter:h,onMouseLeave:g,title:n},Object(r.createElement)("span",{className:"components-form-token-field__token-text",id:"components-form-token-field__token-text-"+w},Object(r.createElement)(b.a,{as:"span"},k),Object(r.createElement)("span",{"aria-hidden":"true"},E)),Object(r.createElement)(f.a,{className:"components-form-token-field__remove-token",icon:p.a,onClick:!u&&(()=>d({value:e})),label:O.remove,"aria-describedby":"components-form-token-field__token-text-"+w}))}var h=n(147),g=n(148),O=n(8),v=n(24),j=Object(a.createHigherOrderComponent)(e=>t=>Object(r.createElement)(e,Object(O.a)({},t,{speak:v.speak,debouncedSpeak:Object(a.useDebounce)(v.speak,500)})),"withSpokenMessages");const w={incompleteTokenValue:"",inputOffsetFromEnd:0,isActive:!1,isExpanded:!1,selectedSuggestionIndex:-1,selectedSuggestionScroll:!1};class y extends r.Component{constructor(){super(...arguments),this.state=w,this.onKeyDown=this.onKeyDown.bind(this),this.onKeyPress=this.onKeyPress.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.deleteTokenBeforeInput=this.deleteTokenBeforeInput.bind(this),this.deleteTokenAfterInput=this.deleteTokenAfterInput.bind(this),this.addCurrentToken=this.addCurrentToken.bind(this),this.onContainerTouched=this.onContainerTouched.bind(this),this.renderToken=this.renderToken.bind(this),this.onTokenClickRemove=this.onTokenClickRemove.bind(this),this.onSuggestionHovered=this.onSuggestionHovered.bind(this),this.onSuggestionSelected=this.onSuggestionSelected.bind(this),this.onInputChange=this.onInputChange.bind(this),this.bindInput=this.bindInput.bind(this),this.bindTokensAndInput=this.bindTokensAndInput.bind(this),this.updateSuggestions=this.updateSuggestions.bind(this)}componentDidUpdate(e){this.state.isActive&&!this.input.hasFocus()&&this.input.focus();const{suggestions:t,value:n}=this.props,r=!d()(t,e.suggestions);(r||n!==e.value)&&this.updateSuggestions(r)}static getDerivedStateFromProps(e,t){return e.disabled&&t.isActive?{isActive:!1,incompleteTokenValue:""}:null}bindInput(e){this.input=e}bindTokensAndInput(e){this.tokensAndInput=e}onFocus(e){const{__experimentalExpandOnFocus:t}=this.props;this.input.hasFocus()||e.target===this.tokensAndInput?this.setState({isActive:!0,isExpanded:!!t||this.state.isExpanded}):this.setState({isActive:!1}),"function"==typeof this.props.onFocus&&this.props.onFocus(e)}onBlur(){this.inputHasValidValue()?this.setState({isActive:!1}):this.setState(w)}onKeyDown(e){let t=!1;switch(e.keyCode){case l.BACKSPACE:t=this.handleDeleteKey(this.deleteTokenBeforeInput);break;case l.ENTER:t=this.addCurrentToken();break;case l.LEFT:t=this.handleLeftArrowKey();break;case l.UP:t=this.handleUpArrowKey();break;case l.RIGHT:t=this.handleRightArrowKey();break;case l.DOWN:t=this.handleDownArrowKey();break;case l.DELETE:t=this.handleDeleteKey(this.deleteTokenAfterInput);break;case l.SPACE:this.props.tokenizeOnSpace&&(t=this.addCurrentToken());break;case l.ESCAPE:t=this.handleEscapeKey(e),e.stopPropagation()}t&&e.preventDefault()}onKeyPress(e){let t=!1;switch(e.charCode){case 44:t=this.handleCommaKey()}t&&e.preventDefault()}onContainerTouched(e){e.target===this.tokensAndInput&&this.state.isActive&&e.preventDefault()}onTokenClickRemove(e){this.deleteToken(e.value),this.input.focus()}onSuggestionHovered(e){const t=this.getMatchingSuggestions().indexOf(e);t>=0&&this.setState({selectedSuggestionIndex:t,selectedSuggestionScroll:!1})}onSuggestionSelected(e){this.addNewToken(e)}onInputChange(e){const t=e.value,n=this.props.tokenizeOnSpace?/[ ,\t]+/:/[,\t]+/,r=t.split(n),s=Object(o.last)(r)||"";r.length>1&&this.addNewTokens(r.slice(0,-1)),this.setState({incompleteTokenValue:s},this.updateSuggestions),this.props.onInputChange(s)}handleDeleteKey(e){let t=!1;return this.input.hasFocus()&&this.isInputEmpty()&&(e(),t=!0),t}handleLeftArrowKey(){let e=!1;return this.isInputEmpty()&&(this.moveInputBeforePreviousToken(),e=!0),e}handleRightArrowKey(){let e=!1;return this.isInputEmpty()&&(this.moveInputAfterNextToken(),e=!0),e}handleUpArrowKey(){return this.setState((e,t)=>({selectedSuggestionIndex:(0===e.selectedSuggestionIndex?this.getMatchingSuggestions(e.incompleteTokenValue,t.suggestions,t.value,t.maxSuggestions,t.saveTransform).length:e.selectedSuggestionIndex)-1,selectedSuggestionScroll:!0})),!0}handleDownArrowKey(){return this.setState((e,t)=>({selectedSuggestionIndex:(e.selectedSuggestionIndex+1)%this.getMatchingSuggestions(e.incompleteTokenValue,t.suggestions,t.value,t.maxSuggestions,t.saveTransform).length,selectedSuggestionScroll:!0})),!0}handleEscapeKey(e){return this.setState({incompleteTokenValue:e.target.value,isExpanded:!1,selectedSuggestionIndex:-1,selectedSuggestionScroll:!1}),!0}handleCommaKey(){return this.inputHasValidValue()&&this.addNewToken(this.state.incompleteTokenValue),!0}moveInputToIndex(e){this.setState((t,n)=>({inputOffsetFromEnd:n.value.length-Math.max(e,-1)-1}))}moveInputBeforePreviousToken(){this.setState((e,t)=>({inputOffsetFromEnd:Math.min(e.inputOffsetFromEnd+1,t.value.length)}))}moveInputAfterNextToken(){this.setState(e=>({inputOffsetFromEnd:Math.max(e.inputOffsetFromEnd-1,0)}))}deleteTokenBeforeInput(){const e=this.getIndexOfInput()-1;e>-1&&this.deleteToken(this.props.value[e])}deleteTokenAfterInput(){const e=this.getIndexOfInput();e<this.props.value.length&&(this.deleteToken(this.props.value[e]),this.moveInputToIndex(e))}addCurrentToken(){let e=!1;const t=this.getSelectedSuggestion();return t?(this.addNewToken(t),e=!0):this.inputHasValidValue()&&(this.addNewToken(this.state.incompleteTokenValue),e=!0),e}addNewTokens(e){const t=Object(o.uniq)(e.map(this.props.saveTransform).filter(Boolean).filter(e=>!this.valueContainsToken(e)));if(t.length>0){const e=Object(o.clone)(this.props.value);e.splice.apply(e,[this.getIndexOfInput(),0].concat(t)),this.props.onChange(e)}}addNewToken(e){const{__experimentalExpandOnFocus:t,__experimentalValidateInput:n}=this.props;n(e)?(this.addNewTokens([e]),this.props.speak(this.props.messages.added,"assertive"),this.setState({incompleteTokenValue:"",selectedSuggestionIndex:-1,selectedSuggestionScroll:!1,isExpanded:!t}),this.state.isActive&&this.input.focus()):this.props.speak(this.props.messages.__experimentalInvalid,"assertive")}deleteToken(e){const t=this.props.value.filter(t=>this.getTokenValue(t)!==this.getTokenValue(e));this.props.onChange(t),this.props.speak(this.props.messages.removed,"assertive")}getTokenValue(e){return"object"==typeof e?e.value:e}getMatchingSuggestions(e=this.state.incompleteTokenValue,t=this.props.suggestions,n=this.props.value,r=this.props.maxSuggestions,s=this.props.saveTransform){let i=s(e);const c=[],a=[];return 0===i.length?t=Object(o.difference)(t,n):(i=i.toLocaleLowerCase(),Object(o.each)(t,e=>{const t=e.toLocaleLowerCase().indexOf(i);-1===n.indexOf(e)&&(0===t?c.push(e):t>0&&a.push(e))}),t=c.concat(a)),Object(o.take)(t,r)}getSelectedSuggestion(){if(-1!==this.state.selectedSuggestionIndex)return this.getMatchingSuggestions()[this.state.selectedSuggestionIndex]}valueContainsToken(e){return Object(o.some)(this.props.value,t=>this.getTokenValue(e)===this.getTokenValue(t))}getIndexOfInput(){return this.props.value.length-this.state.inputOffsetFromEnd}isInputEmpty(){return 0===this.state.incompleteTokenValue.length}inputHasValidValue(){return this.props.saveTransform(this.state.incompleteTokenValue).length>0}updateSuggestions(e=!0){const{__experimentalExpandOnFocus:t}=this.props,{incompleteTokenValue:n}=this.state,r=n.trim().length>1,o=this.getMatchingSuggestions(n),s=o.length>0,i={isExpanded:t||r&&s};if(e&&(i.selectedSuggestionIndex=-1,i.selectedSuggestionScroll=!1),this.setState(i),r){const{debouncedSpeak:e}=this.props;e(s?Object(c.sprintf)(
|
24 |
/* translators: %d: number of results. */
|
25 |
Object(c._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",o.length),o.length):Object(c.__)("No results."),"assertive")}}renderTokensAndInput(){const e=Object(o.map)(this.props.value,this.renderToken);return e.splice(this.getIndexOfInput(),0,this.renderInput()),e}renderToken(e,t,n){const o=this.getTokenValue(e),s=e.status?e.status:void 0,i=t+1,c=n.length;return Object(r.createElement)(m,{key:"token-"+o,value:o,status:s,title:e.title,displayTransform:this.props.displayTransform,onClickRemove:this.onTokenClickRemove,isBorderless:e.isBorderless||this.props.isBorderless,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,disabled:"error"!==s&&this.props.disabled,messages:this.props.messages,termsCount:c,termPosition:i})}renderInput(){const{autoCapitalize:e,autoComplete:t,maxLength:n,placeholder:o,value:s,instanceId:i}=this.props;let c={instanceId:i,autoCapitalize:e,autoComplete:t,placeholder:0===s.length?o:"",ref:this.bindInput,key:"input",disabled:this.props.disabled,value:this.state.incompleteTokenValue,onBlur:this.onBlur,isExpanded:this.state.isExpanded,selectedSuggestionIndex:this.state.selectedSuggestionIndex};return n&&s.length>=n||(c={...c,onChange:this.onInputChange}),Object(r.createElement)(h.a,c)}render(){const{disabled:e,label:t=Object(c.__)("Add item"),instanceId:n,className:o,__experimentalShowHowTo:s}=this.props,{isExpanded:a}=this.state,l=i()(o,"components-form-token-field__input-container",{"is-active":this.state.isActive,"is-disabled":e});let u={className:"components-form-token-field",tabIndex:"-1"};const d=this.getMatchingSuggestions();return e||(u=Object.assign({},u,{onKeyDown:this.onKeyDown,onKeyPress:this.onKeyPress,onFocus:this.onFocus})),Object(r.createElement)("div",u,Object(r.createElement)("label",{htmlFor:"components-form-token-input-"+n,className:"components-form-token-field__label"},t),Object(r.createElement)("div",{ref:this.bindTokensAndInput,className:l,tabIndex:"-1",onMouseDown:this.onContainerTouched,onTouchStart:this.onContainerTouched},this.renderTokensAndInput(),a&&Object(r.createElement)(g.a,{instanceId:n,match:this.props.saveTransform(this.state.incompleteTokenValue),displayTransform:this.props.displayTransform,suggestions:d,selectedIndex:this.state.selectedSuggestionIndex,scrollIntoView:this.state.selectedSuggestionScroll,onHover:this.onSuggestionHovered,onSelect:this.onSuggestionSelected})),s&&Object(r.createElement)("p",{id:"components-form-token-suggestions-howto-"+n,className:"components-form-token-field__help"},this.props.tokenizeOnSpace?Object(c.__)("Separate with commas, spaces, or the Enter key."):Object(c.__)("Separate with commas or the Enter key.")))}}y.defaultProps={suggestions:Object.freeze([]),maxSuggestions:100,value:Object.freeze([]),displayTransform:o.identity,saveTransform:e=>e.trim(),onChange:()=>{},onInputChange:()=>{},isBorderless:!1,disabled:!1,tokenizeOnSpace:!1,messages:{added:Object(c.__)("Item added."),removed:Object(c.__)("Item removed."),remove:Object(c.__)("Remove item"),__experimentalInvalid:Object(c.__)("Invalid item")},__experimentalExpandOnFocus:!1,__experimentalValidateInput:()=>!0,__experimentalShowHowTo:!0},t.a=j(Object(a.withInstanceId)(y))}]);
|
packages/woocommerce-blocks/build/attribute-filter-wrapper-frontend.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[15],{112:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return a}));var r=n(6);const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const a=e.filter(e=>e.attribute===n.taxonomy),o=a.length?a[0]:null;if(!(o&&o.slug&&Array.isArray(o.slug)&&o.slug.includes(c)))return;const s=o.slug.filter(e=>e!==c),l=e.filter(e=>e.attribute!==n.taxonomy);s.length>0&&(o.slug=s.sort(),l.push(o)),t(Object(r.sortBy)(l,"attribute"))},a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";if(!n||!n.taxonomy)return[];const o=e.filter(e=>e.attribute!==n.taxonomy);return 0===c.length?t(o):(o.push({attribute:n.taxonomy,operator:a,slug:c.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(r.sortBy)(o,"attribute"))),o}},115:function(e,t){},116:function(e,t){},117:function(e,t){},119:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return o}));var r=n(2);const c=Object(r.getSetting)("attributes",[]).reduce((e,t)=>{const 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;var r;return n&&n.id&&e.push(n),e},[]),a=e=>{if(e)return c.find(t=>t.id===e)},o=e=>{if(e)return c.find(t=>t.taxonomy===e)}},124:function(e){e.exports=JSON.parse('{"name":"woocommerce/attribute-filter","version":"1.0.0","title":"Filter by Attribute Controls","description":"Enable customers to filter the product grid by selecting one or more attributes, such as color.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"color":{"text":true,"background":false},"inserter":false,"lock":false},"example":{"attributes":{"isPreview":true}},"attributes":{"className":{"type":"string","default":""},"attributeId":{"type":"number","default":0},"showCounts":{"type":"boolean","default":true},"queryType":{"type":"string","default":"or"},"headingLevel":{"type":"number","default":3},"displayStyle":{"type":"string","default":"list"},"showFilterButton":{"type":"boolean","default":false},"selectType":{"type":"string","default":"multiple"},"isPreview":{"type":"boolean","default":false}},"textdomain":"woocommerce","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},133:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(28),c=n(18);const a=e=>Object(r.a)(e)?JSON.parse(e)||{}:Object(c.a)(e)?e:{}},134:function(e,t){},135:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(0),c=n(97),a=n(6),o=n(27),s=n(18),l=n(30),u=n(60),i=n(23);const b=e=>{let{queryAttribute:t,queryPrices:n,queryStock:b,queryRating:d,queryState:f}=e,m=Object(i.a)();m+="-collection-data";const[O]=Object(l.a)(m),[j,p]=Object(l.b)("calculate_attribute_counts",[],m),[g,y]=Object(l.b)("calculate_price_range",null,m),[h,v]=Object(l.b)("calculate_stock_status_counts",null,m),[w,_]=Object(l.b)("calculate_rating_counts",null,m),E=Object(o.a)(t||{}),k=Object(o.a)(n),S=Object(o.a)(b),x=Object(o.a)(d);Object(r.useEffect)(()=>{"object"==typeof E&&Object.keys(E).length&&(j.find(e=>Object(s.b)(E,"taxonomy")&&e.taxonomy===E.taxonomy)||p([...j,E]))},[E,j,p]),Object(r.useEffect)(()=>{g!==k&&void 0!==k&&y(k)},[k,y,g]),Object(r.useEffect)(()=>{h!==S&&void 0!==S&&v(S)},[S,v,h]),Object(r.useEffect)(()=>{w!==x&&void 0!==x&&_(x)},[x,_,w]);const[C,N]=Object(r.useState)(!1),[T]=Object(c.a)(C,200);C||N(!0);const L=Object(r.useMemo)(()=>(e=>{const t=e;return Array.isArray(e.calculate_attribute_counts)&&(t.calculate_attribute_counts=Object(a.sortBy)(e.calculate_attribute_counts.map(e=>{let{taxonomy:t,queryType:n}=e;return{taxonomy:t,query_type:n}}),["taxonomy","query_type"])),t})(O),[O]);return Object(u.a)({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...f,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...L},shouldSelect:T})}},159:function(e,t,n){"use strict";var r=n(0),c=n(1),a=n(276),o=n(27),s=n(61),l=n(30),u=n(60),i=n(135),b=n(62),d=n(94),f=n(95),m=n(12),O=n.n(m),j=n(21),p=n(98),g=n(2),y=n(13),h=n(69),v=n(28),w=n(18),_=n(224),E=n(111),k=n(283),S=n(70),x=n(6),C=n(11),N=n.n(C),T=n(285),L=n(5),A=n.n(L);n(225);var R=e=>{let{className:t,style:n,suggestions:c,multiple:a=!0,saveTransform:o=(e=>e.trim().replace(/\s/g,"-")),messages:s={},validateInput:l=(e=>c.includes(e)),label:u="",...i}=e;return Object(r.createElement)("div",{className:A()("wc-blocks-components-form-token-field-wrapper",t,{"single-selection":!a}),style:n},Object(r.createElement)(T.a,N()({label:u,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,__experimentalValidateInput:l,saveTransform:o,maxLength:a?void 0:1,suggestions:c,messages:s},i)))},F=n(51),q=n(119),B=n(112);const I=[{value:"preview-1",formattedValue:"preview-1",name:"Blue",label:Object(r.createElement)(b.a,{name:"Blue",count:3}),textLabel:"Blue (3)"},{value:"preview-2",formattedValue:"preview-2",name:"Green",label:Object(r.createElement)(b.a,{name:"Green",count:3}),textLabel:"Green (3)"},{value:"preview-3",formattedValue:"preview-3",name:"Red",label:Object(r.createElement)(b.a,{name:"Red",count:2}),textLabel:"Red (2)"}],P={id:0,name:"preview",taxonomy:"preview",label:"Preview"};n(223);var Q=n(59),V=n(96),M=e=>{let{isLoading:t=!1,options:n,checked:c,onChange:a}=e;return t?Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"is-loading"}),Object(r.createElement)("span",{className:"is-loading"})):Object(r.createElement)(V.a,{className:"wc-block-attribute-filter-list",options:n,checked:c,onChange:a,isLoading:t,isDisabled:t})},D=n(55);t.a=e=>{let{attributes:t,isEditor:n=!1}=e;const m=Object(g.getSettingWithCoercion)("has_filterable_products",!1,h.a),C=Object(g.getSettingWithCoercion)("is_rendering_php_template",!1,h.a),N=Object(g.getSettingWithCoercion)("page_url",window.location.href,v.a),[T,L]=Object(r.useState)(!1),V=t.isPreview&&!t.attributeId?P:Object(q.a)(t.attributeId),Y=Object(r.useMemo)(()=>Object(Q.e)(V),[V]),[U,W]=Object(r.useState)(Y),[$,K]=Object(r.useState)(Object(Q.d)()),[J,G]=Object(r.useState)(t.isPreview&&!t.attributeId?I:[]),z=Object(a.a)(t),[H]=Object(l.a)(),[Z,X]=Object(l.b)("attributes",[]),{results:ee,isLoading:te}=Object(u.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[(null==V?void 0:V.id)||0],shouldSelect:t.attributeId>0}),ne="dropdown"!==t.displayStyle&&"and"===t.queryType,{results:re,isLoading:ce}=Object(i.a)({queryAttribute:{taxonomy:(null==V?void 0:V.taxonomy)||"",queryType:t.queryType},queryState:{...H,attributes:ne?H.attributes:null}}),ae=Object(r.useCallback)(e=>Object(w.b)(re,"attribute_counts")&&Array.isArray(re.attribute_counts)?re.attribute_counts.find(t=>{let{term:n}=t;return n===e}):null,[re]);Object(r.useEffect)(()=>{if(te||ce)return;if(!Array.isArray(ee))return;const e=ee.map(e=>{const n=ae(e.id);if(!(n||U.includes(e.slug)||(c=e.slug,null!=H&&H.attributes&&H.attributes.some(e=>{let{attribute:t,slug:n=[]}=e;return t===(null==V?void 0:V.taxonomy)&&n.includes(c)}))))return null;var c;const a=n?n.count:0;return{formattedValue:Object(Q.c)(e.slug),value:e.slug,name:Object(j.decodeEntities)(e.name),label:Object(r.createElement)(b.a,{name:Object(j.decodeEntities)(e.name),count:t.showCounts?a:null}),textLabel:t.showCounts?`${Object(j.decodeEntities)(e.name)} (${a})`:Object(j.decodeEntities)(e.name)}}).filter(e=>!!e);G(e),K(Object(Q.d)())},[null==V?void 0:V.taxonomy,ee,te,t.showCounts,ce,ae,U,H.attributes]);const oe=Object(r.useCallback)(e=>Array.isArray(ee)?ee.reduce((t,n)=>(e.includes(n.slug)&&t.push(n),t),[]):[],[ee]),se=Object(r.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){if(null==V||!V.taxonomy)return;const t=Object.keys(Object(y.getQueryArgs)(window.location.href)),n=Object(Q.h)(V.taxonomy),r=t.reduce((e,t)=>t.includes(S.b+n)||t.includes(S.a+n)?Object(y.removeQueryArgs)(e,t):e,window.location.href),c=Object(Q.b)(r,e);Object(S.c)(c)}else{const t=Object(Q.b)(N,e),n=Object(y.getQueryArgs)(window.location.href),r=Object(y.getQueryArgs)(t);Object(Q.f)(n,r)||Object(S.c)(t)}}),[N,null==V?void 0:V.taxonomy]),le=e=>{const n=Object(B.b)(Z,X,V,oe(e),"or"===t.queryType?"in":"and");se(n,0===e.length)},ue=Object(r.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n||(W(e),!r&&t.showFilterButton||Object(B.b)(Z,X,V,oe(e),"or"===t.queryType?"in":"and"))}),[n,W,Z,X,V,oe,t.queryType,t.showFilterButton]),ie=Object(r.useMemo)(()=>Object(_.a)(Z)?Z.filter(e=>{let{attribute:t}=e;return t===(null==V?void 0:V.taxonomy)}).flatMap(e=>{let{slug:t}=e;return t}):[],[Z,null==V?void 0:V.taxonomy]),be=Object(o.a)(ie),de=Object(s.a)(be);Object(r.useEffect)(()=>{!de||O()(de,be)||O()(U,be)||ue(be)},[U,be,de,ue]);const fe="single"!==t.selectType,me=Object(r.useCallback)(e=>{const t=U.includes(e);let n;fe?(n=U.filter(t=>t!==e),t||(n.push(e),n.sort())):n=t?[]:[e],ue(n)},[U,fe,ue]);Object(r.useEffect)(()=>{V&&!t.showFilterButton&&(Object(Q.a)({currentCheckedFilters:U,hasSetFilterDefaultsFromUrl:T})?se(Z,!0):se(Z,!1))},[T,se,Z,V,U,t.showFilterButton]),Object(r.useEffect)(()=>{if(!T&&!te)return Y.length>0?(L(!0),void ue(Y,!0)):void(C||L(!0))},[V,T,te,ue,Y,C]);const Oe=Object(D.b)();if(!m)return Oe(!1),null;if(!V)return n?Object(r.createElement)(p.a,{status:"warning",isDismissible:!1},Object(r.createElement)("p",null,Object(c.__)("Please select an attribute to use this filter!","woocommerce"))):(Oe(!1),null);if(0===J.length&&!te&&n)return Object(r.createElement)(p.a,{status:"warning",isDismissible:!1},Object(r.createElement)("p",null,Object(c.__)("There are no products with the selected attributes.","woocommerce")));const je="h"+t.headingLevel,pe=!t.isPreview&&te,ge=!t.isPreview&&ce,ye=(pe||ge)&&0===J.length;if(!ye&&0===J.length)return Oe(!1),null;const he=Object(r.createElement)(je,{className:"wc-block-attribute-filter__title"},t.heading),ve=ye?Object(r.createElement)(F.a,null,he):he;return Oe(!0),Object(r.createElement)(r.Fragment,null,!n&&t.heading&&ve,Object(r.createElement)("div",{className:A()("wc-block-attribute-filter","style-"+t.displayStyle)},"dropdown"===t.displayStyle?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(R,{key:$,className:A()(z.className,{"single-selection":!fe,"is-loading":ye}),style:{...z.style,borderStyle:"none"},suggestions:J.filter(e=>!U.includes(e.value)).map(e=>e.formattedValue),disabled:ye,placeholder:Object(c.sprintf)(
|
2 |
/* translators: %s attribute name. */
|
3 |
Object(c.__)("Select %s","woocommerce"),V.label),onChange:e=>{!fe&&e.length>1&&(e=[e[e.length-1]]),e=e.map(e=>{const t=J.find(t=>t.formattedValue===e);return t?t.value:e});const t=Object(x.difference)(e,U);if(1===t.length)return me(t[0]);const n=Object(x.difference)(U,e);1===n.length&&me(n[0])},value:U,displayTransform:e=>{const t=J.find(t=>[t.value,t.formattedValue].includes(e));return t?t.textLabel:e},saveTransform:Q.c,messages:{added:Object(c.sprintf)(
|
4 |
/* translators: %s is the attribute label. */
|
@@ -8,7 +8,7 @@ Object(c.__)("%s filter removed.","woocommerce"),V.label),remove:Object(c.sprint
|
|
8 |
/* translators: %s is the attribute label. */
|
9 |
Object(c.__)("Remove %s filter.","woocommerce"),V.label.toLocaleLowerCase()),__experimentalInvalid:Object(c.sprintf)(
|
10 |
/* translators: %s is the attribute label. */
|
11 |
-
Object(c.__)("Invalid %s filter.","woocommerce"),V.label.toLocaleLowerCase())}}),fe&&Object(r.createElement)(E.a,{icon:k.a,size:30})):Object(r.createElement)(M,{options:J,checked:U,onChange:me,isLoading:ye,isDisabled:ye})),Object(r.createElement)("div",{className:"wc-block-attribute-filter__actions"},U.length>0&&!ye&&Object(r.createElement)(d.a,{onClick:()=>{W([]),K(Object(Q.d)()),T&&le([])},screenReaderLabel:Object(c.__)("Reset attribute filter","woocommerce")}),t.showFilterButton&&Object(r.createElement)(f.a,{className:"wc-block-attribute-filter__button",isLoading:ye,disabled:pe||ge||0===U.length,onClick:()=>le(U)})))}},18:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return c}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function c(e,t){return r(e)&&t in e}},
|
12 |
/* translators: %s number of products. */
|
13 |
Object(c._n)("%s product","%s products",n,"woocommerce"),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},69:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"boolean"==typeof e},70:function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return l})),n.d(t,"d",(function(){return u})),n.d(t,"c",(function(){return i}));var r=n(13),c=n(2),a=n(69);const o=Object(c.getSettingWithCoercion)("is_rendering_php_template",!1,a.a),s="query_type_",l="filter_";function u(e){return window?Object(r.getQueryArg)(window.location.href,e):null}function i(e){o?window.location.href=e:window.history.replaceState({},"",e)}},71:function(e,t){},73:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0);const c=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},94:function(e,t,n){"use strict";var r=n(0),c=n(1),a=n(5),o=n.n(a),s=n(22);n(115),t.a=e=>{let{className:t,label:
|
14 |
/* translators: Reset button text for filters. */
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[15],{112:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return a}));var r=n(6);const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const a=e.filter(e=>e.attribute===n.taxonomy),o=a.length?a[0]:null;if(!(o&&o.slug&&Array.isArray(o.slug)&&o.slug.includes(c)))return;const s=o.slug.filter(e=>e!==c),l=e.filter(e=>e.attribute!==n.taxonomy);s.length>0&&(o.slug=s.sort(),l.push(o)),t(Object(r.sortBy)(l,"attribute"))},a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";if(!n||!n.taxonomy)return[];const o=e.filter(e=>e.attribute!==n.taxonomy);return 0===c.length?t(o):(o.push({attribute:n.taxonomy,operator:a,slug:c.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(r.sortBy)(o,"attribute"))),o}},115:function(e,t){},116:function(e,t){},117:function(e,t){},119:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return o}));var r=n(2);const c=Object(r.getSetting)("attributes",[]).reduce((e,t)=>{const 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;var r;return n&&n.id&&e.push(n),e},[]),a=e=>{if(e)return c.find(t=>t.id===e)},o=e=>{if(e)return c.find(t=>t.taxonomy===e)}},124:function(e){e.exports=JSON.parse('{"name":"woocommerce/attribute-filter","version":"1.0.0","title":"Filter by Attribute Controls","description":"Enable customers to filter the product grid by selecting one or more attributes, such as color.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"color":{"text":true,"background":false},"inserter":false,"lock":false},"example":{"attributes":{"isPreview":true}},"attributes":{"className":{"type":"string","default":""},"attributeId":{"type":"number","default":0},"showCounts":{"type":"boolean","default":true},"queryType":{"type":"string","default":"or"},"headingLevel":{"type":"number","default":3},"displayStyle":{"type":"string","default":"list"},"showFilterButton":{"type":"boolean","default":false},"selectType":{"type":"string","default":"multiple"},"isPreview":{"type":"boolean","default":false}},"textdomain":"woocommerce","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},133:function(e,t){},134:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(0),c=n(97),a=n(6),o=n(27),s=n(18),l=n(29),u=n(60),i=n(23);const b=e=>{let{queryAttribute:t,queryPrices:n,queryStock:b,queryRating:d,queryState:f}=e,m=Object(i.a)();m+="-collection-data";const[O]=Object(l.a)(m),[j,p]=Object(l.b)("calculate_attribute_counts",[],m),[g,y]=Object(l.b)("calculate_price_range",null,m),[h,v]=Object(l.b)("calculate_stock_status_counts",null,m),[w,_]=Object(l.b)("calculate_rating_counts",null,m),E=Object(o.a)(t||{}),k=Object(o.a)(n),S=Object(o.a)(b),x=Object(o.a)(d);Object(r.useEffect)(()=>{"object"==typeof E&&Object.keys(E).length&&(j.find(e=>Object(s.b)(E,"taxonomy")&&e.taxonomy===E.taxonomy)||p([...j,E]))},[E,j,p]),Object(r.useEffect)(()=>{g!==k&&void 0!==k&&y(k)},[k,y,g]),Object(r.useEffect)(()=>{h!==S&&void 0!==S&&v(S)},[S,v,h]),Object(r.useEffect)(()=>{w!==x&&void 0!==x&&_(x)},[x,_,w]);const[C,N]=Object(r.useState)(!1),[T]=Object(c.a)(C,200);C||N(!0);const L=Object(r.useMemo)(()=>(e=>{const t=e;return Array.isArray(e.calculate_attribute_counts)&&(t.calculate_attribute_counts=Object(a.sortBy)(e.calculate_attribute_counts.map(e=>{let{taxonomy:t,queryType:n}=e;return{taxonomy:t,query_type:n}}),["taxonomy","query_type"])),t})(O),[O]);return Object(u.a)({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...f,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...L},shouldSelect:T})}},158:function(e,t,n){"use strict";var r=n(0),c=n(1),a=n(275),o=n(27),s=n(61),l=n(29),u=n(60),i=n(134),b=n(62),d=n(94),f=n(95),m=n(12),O=n.n(m),j=n(21),p=n(98),g=n(2),y=n(13),h=n(69),v=n(28),w=n(18),_=n(224),E=n(111),k=n(282),S=n(70),x=n(6),C=n(11),N=n.n(C),T=n(284),L=n(5),A=n.n(L);n(225);var R=e=>{let{className:t,style:n,suggestions:c,multiple:a=!0,saveTransform:o=(e=>e.trim().replace(/\s/g,"-")),messages:s={},validateInput:l=(e=>c.includes(e)),label:u="",...i}=e;return Object(r.createElement)("div",{className:A()("wc-blocks-components-form-token-field-wrapper",t,{"single-selection":!a}),style:n},Object(r.createElement)(T.a,N()({label:u,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,__experimentalValidateInput:l,saveTransform:o,maxLength:a?void 0:1,suggestions:c,messages:s},i)))},F=n(51),q=n(119),B=n(112);const I=[{value:"preview-1",formattedValue:"preview-1",name:"Blue",label:Object(r.createElement)(b.a,{name:"Blue",count:3}),textLabel:"Blue (3)"},{value:"preview-2",formattedValue:"preview-2",name:"Green",label:Object(r.createElement)(b.a,{name:"Green",count:3}),textLabel:"Green (3)"},{value:"preview-3",formattedValue:"preview-3",name:"Red",label:Object(r.createElement)(b.a,{name:"Red",count:2}),textLabel:"Red (2)"}],P={id:0,name:"preview",taxonomy:"preview",label:"Preview"};n(223);var Q=n(59),V=n(96),M=e=>{let{isLoading:t=!1,options:n,checked:c,onChange:a}=e;return t?Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"is-loading"}),Object(r.createElement)("span",{className:"is-loading"})):Object(r.createElement)(V.a,{className:"wc-block-attribute-filter-list",options:n,checked:c,onChange:a,isLoading:t,isDisabled:t})},D=n(55);t.a=e=>{let{attributes:t,isEditor:n=!1}=e;const m=Object(g.getSettingWithCoercion)("has_filterable_products",!1,h.a),C=Object(g.getSettingWithCoercion)("is_rendering_php_template",!1,h.a),N=Object(g.getSettingWithCoercion)("page_url",window.location.href,v.a),[T,L]=Object(r.useState)(!1),V=t.isPreview&&!t.attributeId?P:Object(q.a)(t.attributeId),Y=Object(r.useMemo)(()=>Object(Q.e)(V),[V]),[U,W]=Object(r.useState)(Y),[$,K]=Object(r.useState)(Object(Q.d)()),[J,G]=Object(r.useState)(t.isPreview&&!t.attributeId?I:[]),z=Object(a.a)(t),[H]=Object(l.a)(),[Z,X]=Object(l.b)("attributes",[]),{results:ee,isLoading:te}=Object(u.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[(null==V?void 0:V.id)||0],shouldSelect:t.attributeId>0}),ne="dropdown"!==t.displayStyle&&"and"===t.queryType,{results:re,isLoading:ce}=Object(i.a)({queryAttribute:{taxonomy:(null==V?void 0:V.taxonomy)||"",queryType:t.queryType},queryState:{...H,attributes:ne?H.attributes:null}}),ae=Object(r.useCallback)(e=>Object(w.b)(re,"attribute_counts")&&Array.isArray(re.attribute_counts)?re.attribute_counts.find(t=>{let{term:n}=t;return n===e}):null,[re]);Object(r.useEffect)(()=>{if(te||ce)return;if(!Array.isArray(ee))return;const e=ee.map(e=>{const n=ae(e.id);if(!(n||U.includes(e.slug)||(c=e.slug,null!=H&&H.attributes&&H.attributes.some(e=>{let{attribute:t,slug:n=[]}=e;return t===(null==V?void 0:V.taxonomy)&&n.includes(c)}))))return null;var c;const a=n?n.count:0;return{formattedValue:Object(Q.c)(e.slug),value:e.slug,name:Object(j.decodeEntities)(e.name),label:Object(r.createElement)(b.a,{name:Object(j.decodeEntities)(e.name),count:t.showCounts?a:null}),textLabel:t.showCounts?`${Object(j.decodeEntities)(e.name)} (${a})`:Object(j.decodeEntities)(e.name)}}).filter(e=>!!e);G(e),K(Object(Q.d)())},[null==V?void 0:V.taxonomy,ee,te,t.showCounts,ce,ae,U,H.attributes]);const oe=Object(r.useCallback)(e=>Array.isArray(ee)?ee.reduce((t,n)=>(e.includes(n.slug)&&t.push(n),t),[]):[],[ee]),se=Object(r.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){if(null==V||!V.taxonomy)return;const t=Object.keys(Object(y.getQueryArgs)(window.location.href)),n=Object(Q.h)(V.taxonomy),r=t.reduce((e,t)=>t.includes(S.b+n)||t.includes(S.a+n)?Object(y.removeQueryArgs)(e,t):e,window.location.href),c=Object(Q.b)(r,e);Object(S.c)(c)}else{const t=Object(Q.b)(N,e),n=Object(y.getQueryArgs)(window.location.href),r=Object(y.getQueryArgs)(t);Object(Q.f)(n,r)||Object(S.c)(t)}}),[N,null==V?void 0:V.taxonomy]),le=e=>{const n=Object(B.b)(Z,X,V,oe(e),"or"===t.queryType?"in":"and");se(n,0===e.length)},ue=Object(r.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n||(W(e),!r&&t.showFilterButton||Object(B.b)(Z,X,V,oe(e),"or"===t.queryType?"in":"and"))}),[n,W,Z,X,V,oe,t.queryType,t.showFilterButton]),ie=Object(r.useMemo)(()=>Object(_.a)(Z)?Z.filter(e=>{let{attribute:t}=e;return t===(null==V?void 0:V.taxonomy)}).flatMap(e=>{let{slug:t}=e;return t}):[],[Z,null==V?void 0:V.taxonomy]),be=Object(o.a)(ie),de=Object(s.a)(be);Object(r.useEffect)(()=>{!de||O()(de,be)||O()(U,be)||ue(be)},[U,be,de,ue]);const fe="single"!==t.selectType,me=Object(r.useCallback)(e=>{const t=U.includes(e);let n;fe?(n=U.filter(t=>t!==e),t||(n.push(e),n.sort())):n=t?[]:[e],ue(n)},[U,fe,ue]);Object(r.useEffect)(()=>{V&&!t.showFilterButton&&(Object(Q.a)({currentCheckedFilters:U,hasSetFilterDefaultsFromUrl:T})?se(Z,!0):se(Z,!1))},[T,se,Z,V,U,t.showFilterButton]),Object(r.useEffect)(()=>{if(!T&&!te)return Y.length>0?(L(!0),void ue(Y,!0)):void(C||L(!0))},[V,T,te,ue,Y,C]);const Oe=Object(D.b)();if(!m)return Oe(!1),null;if(!V)return n?Object(r.createElement)(p.a,{status:"warning",isDismissible:!1},Object(r.createElement)("p",null,Object(c.__)("Please select an attribute to use this filter!","woocommerce"))):(Oe(!1),null);if(0===J.length&&!te&&n)return Object(r.createElement)(p.a,{status:"warning",isDismissible:!1},Object(r.createElement)("p",null,Object(c.__)("There are no products with the selected attributes.","woocommerce")));const je="h"+t.headingLevel,pe=!t.isPreview&&te,ge=!t.isPreview&&ce,ye=(pe||ge)&&0===J.length;if(!ye&&0===J.length)return Oe(!1),null;const he=Object(r.createElement)(je,{className:"wc-block-attribute-filter__title"},t.heading),ve=ye?Object(r.createElement)(F.a,null,he):he;return Oe(!0),Object(r.createElement)(r.Fragment,null,!n&&t.heading&&ve,Object(r.createElement)("div",{className:A()("wc-block-attribute-filter","style-"+t.displayStyle)},"dropdown"===t.displayStyle?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(R,{key:$,className:A()(z.className,{"single-selection":!fe,"is-loading":ye}),style:{...z.style,borderStyle:"none"},suggestions:J.filter(e=>!U.includes(e.value)).map(e=>e.formattedValue),disabled:ye,placeholder:Object(c.sprintf)(
|
2 |
/* translators: %s attribute name. */
|
3 |
Object(c.__)("Select %s","woocommerce"),V.label),onChange:e=>{!fe&&e.length>1&&(e=[e[e.length-1]]),e=e.map(e=>{const t=J.find(t=>t.formattedValue===e);return t?t.value:e});const t=Object(x.difference)(e,U);if(1===t.length)return me(t[0]);const n=Object(x.difference)(U,e);1===n.length&&me(n[0])},value:U,displayTransform:e=>{const t=J.find(t=>[t.value,t.formattedValue].includes(e));return t?t.textLabel:e},saveTransform:Q.c,messages:{added:Object(c.sprintf)(
|
4 |
/* translators: %s is the attribute label. */
|
8 |
/* translators: %s is the attribute label. */
|
9 |
Object(c.__)("Remove %s filter.","woocommerce"),V.label.toLocaleLowerCase()),__experimentalInvalid:Object(c.sprintf)(
|
10 |
/* translators: %s is the attribute label. */
|
11 |
+
Object(c.__)("Invalid %s filter.","woocommerce"),V.label.toLocaleLowerCase())}}),fe&&Object(r.createElement)(E.a,{icon:k.a,size:30})):Object(r.createElement)(M,{options:J,checked:U,onChange:me,isLoading:ye,isDisabled:ye})),Object(r.createElement)("div",{className:"wc-block-attribute-filter__actions"},U.length>0&&!ye&&Object(r.createElement)(d.a,{onClick:()=>{W([]),K(Object(Q.d)()),T&&le([])},screenReaderLabel:Object(c.__)("Reset attribute filter","woocommerce")}),t.showFilterButton&&Object(r.createElement)(f.a,{className:"wc-block-attribute-filter__button",isLoading:ye,disabled:pe||ge||0===U.length,onClick:()=>le(U)})))}},18:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return c}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function c(e,t){return r(e)&&t in e}},214:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n(100);var r=n(44);const c=()=>r.m>1},215:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(28),c=n(18);const a=e=>Object(r.a)(e)?JSON.parse(e)||{}:Object(c.a)(e)?e:{}},22:function(e,t,n){"use strict";var r=n(0),c=n(5),a=n.n(c);t.a=e=>{let t,{label:n,screenReaderLabel:c,wrapperElement:o,wrapperProps:s={}}=e;const l=null!=n,u=null!=c;return!l&&u?(t=o||"span",s={...s,className:a()(s.className,"screen-reader-text")},Object(r.createElement)(t,s,c)):(t=o||r.Fragment,l&&u&&n!==c?Object(r.createElement)(t,s,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},c)):Object(r.createElement)(t,s,n))}},223:function(e,t){},224:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var r=n(18);const c=e=>Object(r.b)(e,"count")&&Object(r.b)(e,"description")&&Object(r.b)(e,"id")&&Object(r.b)(e,"name")&&Object(r.b)(e,"parent")&&Object(r.b)(e,"slug")&&"number"==typeof e.count&&"string"==typeof e.description&&"number"==typeof e.id&&"string"==typeof e.name&&"number"==typeof e.parent&&"string"==typeof e.slug,a=e=>Array.isArray(e)&&e.every(c),o=e=>Object(r.b)(e,"attribute")&&Object(r.b)(e,"operator")&&Object(r.b)(e,"slug")&&"string"==typeof e.attribute&&"string"==typeof e.operator&&Array.isArray(e.slug)&&e.slug.every(e=>"string"==typeof e),s=e=>Array.isArray(e)&&e.every(o)},225:function(e,t){},23:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0);const c=Object(r.createContext)("page"),a=()=>Object(r.useContext)(c);c.Provider},27:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=n(12),a=n.n(c);function o(e){const t=Object(r.useRef)(e);return a()(e,t.current)||(t.current=e),t.current}},275:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(108),c=n(214),a=n(18),o=n(215);const s=e=>{if(!Object(c.a)())return{className:"",style:{}};const t=Object(a.a)(e)?e:{},n=Object(o.a)(t.style);return Object(r.__experimentalUseBorderProps)({...t,style:n})}},28:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"string"==typeof e},29:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return f}));var r=n(3),c=n(4),a=n(0),o=n(12),s=n.n(o),l=n(27),u=n(61),i=n(23);const b=e=>{const t=Object(i.a)();e=e||t;const n=Object(c.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:o}=Object(c.useDispatch)(r.QUERY_STATE_STORE_KEY);return[n,Object(a.useCallback)(t=>{o(e,t)},[e,o])]},d=(e,t,n)=>{const o=Object(i.a)();n=n||o;const s=Object(c.useSelect)(c=>c(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t),[n,e]),{setQueryValue:l}=Object(c.useDispatch)(r.QUERY_STATE_STORE_KEY);return[s,Object(a.useCallback)(t=>{l(n,e,t)},[n,e,l])]},f=(e,t)=>{const n=Object(i.a)();t=t||n;const[r,c]=b(t),o=Object(l.a)(r),d=Object(l.a)(e),f=Object(u.a)(d),m=Object(a.useRef)(!1);return Object(a.useEffect)(()=>{s()(f,d)||(c(Object.assign({},o,d)),m.current=!0)},[o,d,f,c]),m.current?[r,c]:[e,c]}},291:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(108),c=n(214),a=n(18),o=n(215);const s=e=>{if(!Object(c.a)())return{className:"",style:{}};const t=Object(a.a)(e)?e:{},n=Object(o.a)(t.style);return Object(r.__experimentalUseColorProps)({...t,style:n})}},457:function(e,t,n){"use strict";n.r(t);var r=n(0),c=n(291),a=n(28),o=n(158),s=n(59);t.default=e=>{const t=Object(c.a)(e);return Object(r.createElement)("div",{className:Object(a.a)(e.className)?e.className:"",style:{...t.style}},Object(r.createElement)(o.a,{isEditor:!1,attributes:Object(s.g)(e)}))}},51:function(e,t,n){"use strict";var r=n(0);n(71),t.a=e=>{let{children:t}=e;return Object(r.createElement)("div",{className:"wc-block-filter-title-placeholder"},t)}},59:function(e,t,n){"use strict";n.d(t,"d",(function(){return s})),n.d(t,"h",(function(){return l})),n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return i})),n.d(t,"e",(function(){return b})),n.d(t,"f",(function(){return d})),n.d(t,"c",(function(){return f})),n.d(t,"g",(function(){return m}));var r=n(13),c=n(70),a=n(28),o=n(124);function s(){return Math.floor(Math.random()*Date.now())}const l=e=>e.replace("pa_",""),u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n={};t.forEach(e=>{const{attribute:t,slug:r,operator:a}=e,o=l(t),s=r.join(","),u=`${c.b}${o}`,i="in"===a?"or":"and";n[`${c.a}${o}`]=s,n[u]=i});const a=Object(r.removeQueryArgs)(e,...Object.keys(n));return Object(r.addQueryArgs)(a,n)},i=e=>{let{currentCheckedFilters:t,hasSetFilterDefaultsFromUrl:n}=e;return n&&0===t.length},b=e=>{if(e){const t=Object(c.d)("filter_"+e.name);return"string"==typeof t?t.split(","):[]}return[]},d=(e,t)=>{const n=Object.entries(t).reduce((e,t)=>{let[n,r]=t;return n.includes("query_type")?e:{...e,[n]:r}},{});return Object.entries(n).reduce((t,n)=>{let[r,c]=n;return e[r]===c&&t},!0)},f=e=>e.trim().replace(/\s/g,"-").replace(/_/g,"-").replace(/-+/g,"-").replace(/[^a-zA-Z0-9-]/g,""),m=e=>({className:Object(a.a)(null==e?void 0:e.className)?e.className:"",attributeId:parseInt(Object(a.a)(null==e?void 0:e.attributeId)?e.attributeId:"0",10),showCounts:"false"!==(null==e?void 0:e.showCounts),queryType:Object(a.a)(null==e?void 0:e.queryType)&&e.queryType||o.attributes.queryType.default,heading:Object(a.a)(null==e?void 0:e.heading)?e.heading:"",headingLevel:Object(a.a)(null==e?void 0:e.headingLevel)&&parseInt(e.headingLevel,10)||o.attributes.headingLevel.default,displayStyle:Object(a.a)(null==e?void 0:e.displayStyle)&&e.displayStyle||o.attributes.displayStyle.default,showFilterButton:"true"===(null==e?void 0:e.showFilterButton),selectType:Object(a.a)(null==e?void 0:e.selectType)&&e.selectType||o.attributes.selectType.default,isPreview:!1})},60:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(3),c=n(4),a=n(0),o=n(27),s=n(73);const l=e=>{const{namespace:t,resourceName:n,resourceValues:l=[],query:u={},shouldSelect:i=!0}=e;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(a.useRef)({results:[],isLoading:!0}),d=Object(o.a)(u),f=Object(o.a)(l),m=Object(s.a)(),O=Object(c.useSelect)(e=>{if(!i)return null;const c=e(r.COLLECTIONS_STORE_KEY),a=[t,n,d,f],o=c.getCollectionError(...a);if(o){if(!(o instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");m(o)}return{results:c.getCollection(...a),isLoading:!c.hasFinishedResolution("getCollection",a)}},[t,n,f,d,i]);return null!==O&&(b.current=O),b.current}},61:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(7);function c(e,t){const n=Object(r.useRef)();return Object(r.useEffect)(()=>{n.current===e||t&&!t(e,n.current)||(n.current=e)},[e,t]),n.current}},62:function(e,t,n){"use strict";var r=n(0),c=n(1),a=n(22);n(133),t.a=e=>{let{name:t,count:n}=e;return Object(r.createElement)(r.Fragment,null,t,null!==n&&Number.isFinite(n)&&Object(r.createElement)(a.a,{label:n.toString(),screenReaderLabel:Object(c.sprintf)(
|
12 |
/* translators: %s number of products. */
|
13 |
Object(c._n)("%s product","%s products",n,"woocommerce"),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},69:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"boolean"==typeof e},70:function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return l})),n.d(t,"d",(function(){return u})),n.d(t,"c",(function(){return i}));var r=n(13),c=n(2),a=n(69);const o=Object(c.getSettingWithCoercion)("is_rendering_php_template",!1,a.a),s="query_type_",l="filter_";function u(e){return window?Object(r.getQueryArg)(window.location.href,e):null}function i(e){o?window.location.href=e:window.history.replaceState({},"",e)}},71:function(e,t){},73:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0);const c=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},94:function(e,t,n){"use strict";var r=n(0),c=n(1),a=n(5),o=n.n(a),s=n(22);n(115),t.a=e=>{let{className:t,label:
|
14 |
/* translators: Reset button text for filters. */
|
packages/woocommerce-blocks/build/attribute-filter.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning'), 'version' => 'd15995ea34c3d540402bdb49341404b7');
|
packages/woocommerce-blocks/build/attribute-filter.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
-
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["attribute-filter"]=function(e){function t(t){for(var r,l,a=t[0],s=t[1],i=t[2],b=0,d=[];b<a.length;b++)l=a[b],Object.prototype.hasOwnProperty.call(c,l)&&c[l]&&d.push(c[l][0]),c[l]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r]);for(u&&u(t);d.length;)d.shift()();return o.push.apply(o,i||[]),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 s=n[a];0!==c[s]&&(r=!1)}r&&(o.splice(t--,1),e=l(l.s=n[0]))}return e}var r={},c={8:0,1:0},o=[];function l(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,l),n.l=!0,n.exports}l.m=e,l.c=r,l.d=function(e,t,n){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(l.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)l.d(n,r,function(t){return e[t]}.bind(null,r));return n},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var i=0;i<a.length;i++)t(a[i]);var u=s;return o.push([407,0]),n()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.blocks},100:function(e,t,n){"use strict";n.d(t,"a",(function(){return k}));var r=n(6),c=n.n(r),o=n(0),l=n(1),a=n(3),s=n(
|
2 |
Object(l.__)("Remove %s","woocommerce"),n),"aria-describedby":h},Object(o.createElement)(s.a,{icon:g.a,size:20,className:"clear-icon"})))};var j=f;const w=e=>Object(o.createElement)(p.b,e),h=e=>{const{list:t,selected:n,renderItem:r,depth:l=0,onSelect:a,instanceId:s,isSingle:i,search:u}=e;return t?Object(o.createElement)(o.Fragment,null,t.map(t=>{const b=-1!==n.findIndex(e=>{let{id:n}=e;return n===t.id});return Object(o.createElement)(o.Fragment,{key:t.id},Object(o.createElement)("li",null,r({item:t,isSelected:b,onSelect:a,isSingle:i,search:u,depth:l,controlId:s})),Object(o.createElement)(h,c()({},e,{list:t.children,depth:l+1})))})):null},_=e=>{let{isLoading:t,isSingle:n,selected:r,messages:c,onChange:s,onRemove:i}=e;if(t||n||!r)return null;const u=r.length;return Object(o.createElement)("div",{className:"woocommerce-search-list__selected"},Object(o.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(o.createElement)("strong",null,c.selected(u)),u>0?Object(o.createElement)(a.Button,{isLink:!0,isDestructive:!0,onClick:()=>s([]),"aria-label":c.clear},Object(l.__)("Clear all","woocommerce")):null),u>0?Object(o.createElement)("ul",null,r.map((e,t)=>Object(o.createElement)("li",{key:t},Object(o.createElement)(j,{label:e.name,id:e.id,remove:i})))):null)},y=e=>{let{filteredList:t,search:n,onSelect:r,instanceId:c,...a}=e;const{messages:u,renderItem:b,selected:d,isSingle:m}=a,p=b||w;return 0===t.length?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(o.createElement)(s.a,{icon:i.a})),Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-text"},n?Object(l.sprintf)(u.noResults,n):u.noItems)):Object(o.createElement)("ul",{className:"woocommerce-search-list__list"},Object(o.createElement)(h,{list:t,selected:d,renderItem:p,onSelect:r,instanceId:c,isSingle:m,search:n}))},k=e=>{const{className:t="",isCompact:n,isHierarchical:r,isLoading:l,isSingle:s,list:i,messages:u=m.a,onChange:p,onSearch:g,selected:O,debouncedSpeak:f}=e,[j,w]=Object(o.useState)(""),h=Object(d.useInstanceId)(k),v=Object(o.useMemo)(()=>({...m.a,...u}),[u]),E=Object(o.useMemo)(()=>Object(m.c)(i,j,r),[i,j,r]);Object(o.useEffect)(()=>{f&&f(v.updated)},[f,v]),Object(o.useEffect)(()=>{"function"==typeof g&&g(j)},[j,g]);const S=Object(o.useCallback)(e=>()=>{s&&p([]);const t=O.findIndex(t=>{let{id:n}=t;return n===e});p([...O.slice(0,t),...O.slice(t+1)])},[s,O,p]),C=Object(o.useCallback)(e=>()=>{-1===O.findIndex(t=>{let{id:n}=t;return n===e.id})?p(s?[e]:[...O,e]):S(e.id)()},[s,S,p,O]);return Object(o.createElement)("div",{className:b()("woocommerce-search-list",t,{"is-compact":n})},Object(o.createElement)(_,c()({},e,{onRemove:S,messages:v})),Object(o.createElement)("div",{className:"woocommerce-search-list__search"},Object(o.createElement)(a.TextControl,{label:v.search,type:"search",value:j,onChange:e=>w(e)})),l?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(o.createElement)(a.Spinner,null)):Object(o.createElement)(y,c()({},e,{search:j,filteredList:E,messages:v,onSelect:C,instanceId:h})))};Object(a.withSpokenMessages)(k)},102:function(e,t,n){"use strict";var r=n(0),c=n(5),o=n(11),l=n(1);n(139),t.a=Object(o.withInstanceId)(e=>{let{className:t,headingLevel:n,onChange:o,heading:a,instanceId:s}=e;const i="h"+n;return Object(r.createElement)(i,{className:t},Object(r.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-"+s},Object(l.__)("Block title","woocommerce")),Object(r.createElement)(c.PlainText,{id:"block-title-"+s,className:"wc-block-editor-components-title",value:a,onChange:o}))})},103:function(e,t,n){"use strict";var r=n(0);n(140),t.a=e=>{let{children:t}=e;return Object(r.createElement)("div",{className:"wc-block-filter-title-placeholder"},t)}},104:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(12);function c(e,t){const n=Object(r.useRef)();return Object(r.useEffect)(()=>{n.current===e||t&&!t(e,n.current)||(n.current=e)},[e,t]),n.current}},107:function(e,t){e.exports=window.wp.warning},108:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),c=n(7),o=n(0),l=n(40),a=n(142);const s=e=>{const{namespace:t,resourceName:n,resourceValues:s=[],query:i={},shouldSelect:u=!0}=e;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(o.useRef)({results:[],isLoading:!0}),d=Object(l.a)(i),m=Object(l.a)(s),p=Object(a.a)(),g=Object(c.useSelect)(e=>{if(!u)return null;const c=e(r.COLLECTIONS_STORE_KEY),o=[t,n,d,m],l=c.getCollectionError(...o);if(l){if(!(l instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");p(l)}return{results:c.getCollection(...o),isLoading:!c.hasFinishedResolution("getCollection",o)}},[t,n,m,d,u]);return null!==g&&(b.current=g),b.current}},11:function(e,t){e.exports=window.wp.compose},113:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(29);n(280),t.a=e=>{let{name:t,count:n}=e;return Object(r.createElement)(r.Fragment,null,t,null!==n&&Number.isFinite(n)&&Object(r.createElement)(o.a,{label:n.toString(),screenReaderLabel:Object(c.sprintf)(
|
3 |
/* translators: %s number of products. */
|
4 |
-
Object(c._n)("%s product","%s products",n,"woocommerce"),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},
|
5 |
/* translators: Reset button text for filters. */
|
6 |
n=Object(c.__)("Reset","woocommerce"),onClick:o,screenReaderLabel:s=Object(c.__)("Reset filter","woocommerce")}=e;return Object(r.createElement)("button",{className:l()("wc-block-components-filter-reset-button",t),onClick:o},Object(r.createElement)(a.a,{label:n,screenReaderLabel:s}))}},156:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(4),l=n.n(o),a=n(29);n(198),t.a=e=>{let{className:t,isLoading:n,disabled:o,label:
|
7 |
/* translators: Submit button text for filters. */
|
@@ -13,7 +13,7 @@ Object(c._n)("Show %s more","Show %s more",e,"woocommerce"),e)))},[o,b,d]),O=Obj
|
|
13 |
/* Translators: %s search term */
|
14 |
noResults:Object(o.__)("No results for %s","woocommerce"),search:Object(o.__)("Search for items","woocommerce"),selected:e=>Object(o.sprintf)(
|
15 |
/* translators: Number of items selected from list. */
|
16 |
-
Object(o._n)("%d item selected","%d items selected",e,"woocommerce"),e),updated:Object(o.__)("Search results updated.","woocommerce")},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const n=Object(c.groupBy)(e,"parent"),r=Object(c.keyBy)(t,"id"),o=["0"],l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=l(r[e.parent]);return[...t,e.name]},a=e=>e.map(e=>{const t=n[e.id];return o.push(""+e.id),{...e,breadcrumbs:l(r[e.parent]),children:t&&t.length?a(t):[]}}),s=a(n[0]||[]);return Object.entries(n).forEach(e=>{let[t,n]=e;o.includes(t)||s.push(...a(n||[]))}),s},s=(e,t,n)=>{if(!t)return n?a(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),c=e.map(e=>!!r.test(e.name)&&e).filter(Boolean);return n?a(c,e):c},i=(e,t)=>{if(!t)return e;const n=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(n).map((e,t)=>n.test(e)?Object(r.createElement)("strong",{key:t},e):Object(r.createElement)(r.Fragment,{key:t},e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},197:function(e,t){},198:function(e,t){},199:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},22:function(e,t,n){"use strict";n.d(t,"o",(function(){return o})),n.d(t,"m",(function(){return l})),n.d(t,"l",(function(){return a})),n.d(t,"n",(function(){return s})),n.d(t,"j",(function(){return i})),n.d(t,"e",(function(){return u})),n.d(t,"f",(function(){return b})),n.d(t,"g",(function(){return d})),n.d(t,"k",(function(){return m})),n.d(t,"c",(function(){return p})),n.d(t,"d",(function(){return g})),n.d(t,"h",(function(){return O})),n.d(t,"a",(function(){return f})),n.d(t,"i",(function(){return j})),n.d(t,"b",(function(){return w}));var r,c=n(2);const o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),l=o.pluginUrl+"images/",a=o.pluginUrl+"build/",s=o.buildPhase,i=null===(r=c.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,d=c.STORE_PAGES.privacy.permalink,m=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),p=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),g=c.STORE_PAGES.cart.permalink,O=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),f=Object(c.getSetting)("allowedCountries",{}),j=Object(c.getSetting)("shippingStates",{}),w=Object(c.getSetting)("allowedStates",{})},223:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return l}));var r=n(2);const c=Object(r.getSetting)("attributes",[]).reduce((e,t)=>{const 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;var r;return n&&n.id&&e.push(n),e},[]),o=e=>{if(e)return c.find(t=>t.id===e)},l=e=>{if(e)return c.find(t=>t.taxonomy===e)}},241:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return u}));var r=n(16),c=n(2),o=n(126);const l=Object(c.getSettingWithCoercion)("is_rendering_php_template",!1,o.a),a="query_type_",s="filter_";function i(e){return window?Object(r.getQueryArg)(window.location.href,e):null}function u(e){l?window.location.href=e:window.history.replaceState({},"",e)}},25:function(e,t){e.exports=window.wp.isShallowEqual},279:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(0),c=n(259),o=n(8),l=n(40),a=n(33),s=n(53),i=n(108),u=n(44);const b=e=>{let{queryAttribute:t,queryPrices:n,queryStock:b,queryRating:d,queryState:m}=e,p=Object(u.a)();p+="-collection-data";const[g]=Object(s.a)(p),[O,f]=Object(s.b)("calculate_attribute_counts",[],p),[j,w]=Object(s.b)("calculate_price_range",null,p),[h,_]=Object(s.b)("calculate_stock_status_counts",null,p),[y,k]=Object(s.b)("calculate_rating_counts",null,p),v=Object(l.a)(t||{}),E=Object(l.a)(n),S=Object(l.a)(b),C=Object(l.a)(d);Object(r.useEffect)(()=>{"object"==typeof v&&Object.keys(v).length&&(O.find(e=>Object(a.b)(v,"taxonomy")&&e.taxonomy===v.taxonomy)||f([...O,v]))},[v,O,f]),Object(r.useEffect)(()=>{j!==E&&void 0!==E&&w(E)},[E,w,j]),Object(r.useEffect)(()=>{h!==S&&void 0!==S&&_(S)},[S,_,h]),Object(r.useEffect)(()=>{y!==C&&void 0!==C&&k(C)},[C,k,y]);const[x,N]=Object(r.useState)(!1),[T]=Object(c.a)(x,200);x||N(!0);const A=Object(r.useMemo)(()=>(e=>{const t=e;return Array.isArray(e.calculate_attribute_counts)&&(t.calculate_attribute_counts=Object(o.sortBy)(e.calculate_attribute_counts.map(e=>{let{taxonomy:t,queryType:n}=e;return{taxonomy:t,query_type:n}}),["taxonomy","query_type"])),t})(g),[g]);return Object(i.a)({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...m,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...A},shouldSelect:T})}},280:function(e,t){},29:function(e,t,n){"use strict";var r=n(0),c=n(4),o=n.n(c);t.a=e=>{let t,{label:n,screenReaderLabel:c,wrapperElement:l,wrapperProps:a={}}=e;const s=null!=n,i=null!=c;return!s&&i?(t=l||"span",a={...a,className:o()(a.className,"screen-reader-text")},Object(r.createElement)(t,a,c)):(t=l||r.Fragment,s&&i&&n!==c?Object(r.createElement)(t,a,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},c)):Object(r.createElement)(t,a,n))}},3:function(e,t){e.exports=window.wp.components},33:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return c}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function c(e,t){return r(e)&&t in e}},37:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(6),c=n.n(r),o=n(0),l=n(19);const a=e=>{let{countLabel:t,className:n,depth:r=0,controlId:a="",item:s,isSelected:i,isSingle:u,onSelect:b,search:d="",...m}=e;const p=null!=t&&void 0!==s.count&&null!==s.count,g=[n,"woocommerce-search-list__item"];g.push("depth-"+r),u&&g.push("is-radio-button"),p&&g.push("has-count");const O=s.breadcrumbs&&s.breadcrumbs.length,f=m.name||"search-list-item-"+a,j=`${f}-${s.id}`;return Object(o.createElement)("label",{htmlFor:j,className:g.join(" ")},u?Object(o.createElement)("input",c()({type:"radio",id:j,name:f,value:s.value,onChange:b(s),checked:i,className:"woocommerce-search-list__item-input"},m)):Object(o.createElement)("input",c()({type:"checkbox",id:j,name:f,value:s.value,onChange:b(s),checked:i,className:"woocommerce-search-list__item-input"},m)),Object(o.createElement)("span",{className:"woocommerce-search-list__item-label"},O?Object(o.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(l.b)(s.breadcrumbs)):null,Object(o.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(l.d)(s.name,d))),!!p&&Object(o.createElement)("span",{className:"woocommerce-search-list__item-count"},t||s.count))};t.b=a},40:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(0),c=n(25),o=n.n(c);function l(e){const t=Object(r.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},407:function(e,t,n){e.exports=n(485)},408:function(e,t){},409:function(e,t){},410:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a}));var r=n(33);const c=e=>Object(r.b)(e,"count")&&Object(r.b)(e,"description")&&Object(r.b)(e,"id")&&Object(r.b)(e,"name")&&Object(r.b)(e,"parent")&&Object(r.b)(e,"slug")&&"number"==typeof e.count&&"string"==typeof e.description&&"number"==typeof e.id&&"string"==typeof e.name&&"number"==typeof e.parent&&"string"==typeof e.slug,o=e=>Array.isArray(e)&&e.every(c),l=e=>Object(r.b)(e,"attribute")&&Object(r.b)(e,"operator")&&Object(r.b)(e,"slug")&&"string"==typeof e.attribute&&"string"==typeof e.operator&&Array.isArray(e.slug)&&e.slug.every(e=>"string"==typeof e),a=e=>Array.isArray(e)&&e.every(l)},411:function(e,t){},44:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);const c=Object(r.createContext)("page"),o=()=>Object(r.useContext)(c);c.Provider},48:function(e,t){e.exports=window.wp.a11y},485:function(e,t,n){"use strict";n.r(t);var r=n(6),c=n.n(r),o=n(0),l=n(1),a=n(10),s=n(5),i=n(61),u=n(119),b=n(533),d=n(4),m=n.n(d),p=n(258),g=n(100),O=n(8),f=n(2),j=n(102),w=n(3),h=n(154),_=n(40),y=n(104),k=n(53),v=n(108),E=n(279),S=n(113),C=n(155),x=n(156),N=n(25),T=n.n(N),A=n(15),B=n(314),P=n(16),R=n(126),L=n(86),F=n(33),I=n(410),q=n(550),G=n(241),M=n(565);n(411);var D=e=>{let{className:t,style:n,suggestions:r,multiple:l=!0,saveTransform:a=(e=>e.trim().replace(/\s/g,"-")),messages:s={},validateInput:i=(e=>r.includes(e)),label:u="",...b}=e;return Object(o.createElement)("div",{className:m()("wc-blocks-components-form-token-field-wrapper",t,{"single-selection":!l}),style:n},Object(o.createElement)(M.a,c()({label:u,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,__experimentalValidateInput:i,saveTransform:a,maxLength:l?void 0:1,suggestions:r,messages:s},b)))},Q=n(103),V=n(223),$=n(181);const U=[{value:"preview-1",formattedValue:"preview-1",name:"Blue",label:Object(o.createElement)(S.a,{name:"Blue",count:3}),textLabel:"Blue (3)"},{value:"preview-2",formattedValue:"preview-2",name:"Green",label:Object(o.createElement)(S.a,{name:"Green",count:3}),textLabel:"Green (3)"},{value:"preview-3",formattedValue:"preview-3",name:"Red",label:Object(o.createElement)(S.a,{name:"Red",count:2}),textLabel:"Red (2)"}],Y={id:0,name:"preview",taxonomy:"preview",label:"Preview"};n(409);var W=n(148);function K(){return Math.floor(Math.random()*Date.now())}const J=e=>e.replace("pa_",""),z=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n={};t.forEach(e=>{const{attribute:t,slug:r,operator:c}=e,o=J(t),l=r.join(","),a=`${G.b}${o}`,s="in"===c?"or":"and";n[`${G.a}${o}`]=l,n[a]=s});const r=Object(P.removeQueryArgs)(e,...Object.keys(n));return Object(P.addQueryArgs)(r,n)},H=(e,t)=>{const n=Object.entries(t).reduce((e,t)=>{let[n,r]=t;return n.includes("query_type")?e:{...e,[n]:r}},{});return Object.entries(n).reduce((t,n)=>{let[r,c]=n;return e[r]===c&&t},!0)},Z=e=>e.trim().replace(/\s/g,"-").replace(/_/g,"-").replace(/-+/g,"-").replace(/[^a-zA-Z0-9-]/g,"");var X=n(157),ee=e=>{let{isLoading:t=!1,options:n,checked:r,onChange:c}=e;return t?Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"is-loading"}),Object(o.createElement)("span",{className:"is-loading"})):Object(o.createElement)(X.a,{className:"wc-block-attribute-filter-list",options:n,checked:r,onChange:c,isLoading:t,isDisabled:t})},te=n(125),ne=e=>{let{attributes:t,isEditor:n=!1}=e;const r=Object(f.getSettingWithCoercion)("has_filterable_products",!1,R.a),c=Object(f.getSettingWithCoercion)("is_rendering_php_template",!1,R.a),a=Object(f.getSettingWithCoercion)("page_url",window.location.href,L.a),[s,i]=Object(o.useState)(!1),b=t.isPreview&&!t.attributeId?Y:Object(V.a)(t.attributeId),d=Object(o.useMemo)(()=>(e=>{if(e){const t=Object(G.d)("filter_"+e.name);return"string"==typeof t?t.split(","):[]}return[]})(b),[b]),[p,g]=Object(o.useState)(d),[j,w]=Object(o.useState)(K()),[N,M]=Object(o.useState)(t.isPreview&&!t.attributeId?U:[]),W=Object(h.a)(t),[X]=Object(k.a)(),[ne,re]=Object(k.b)("attributes",[]),{results:ce,isLoading:oe}=Object(v.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[(null==b?void 0:b.id)||0],shouldSelect:t.attributeId>0}),le="dropdown"!==t.displayStyle&&"and"===t.queryType,{results:ae,isLoading:se}=Object(E.a)({queryAttribute:{taxonomy:(null==b?void 0:b.taxonomy)||"",queryType:t.queryType},queryState:{...X,attributes:le?X.attributes:null}}),ie=Object(o.useCallback)(e=>Object(F.b)(ae,"attribute_counts")&&Array.isArray(ae.attribute_counts)?ae.attribute_counts.find(t=>{let{term:n}=t;return n===e}):null,[ae]);Object(o.useEffect)(()=>{if(oe||se)return;if(!Array.isArray(ce))return;const e=ce.map(e=>{const n=ie(e.id);if(!(n||p.includes(e.slug)||(r=e.slug,null!=X&&X.attributes&&X.attributes.some(e=>{let{attribute:t,slug:n=[]}=e;return t===(null==b?void 0:b.taxonomy)&&n.includes(r)}))))return null;var r;const c=n?n.count:0;return{formattedValue:Z(e.slug),value:e.slug,name:Object(A.decodeEntities)(e.name),label:Object(o.createElement)(S.a,{name:Object(A.decodeEntities)(e.name),count:t.showCounts?c:null}),textLabel:t.showCounts?`${Object(A.decodeEntities)(e.name)} (${c})`:Object(A.decodeEntities)(e.name)}}).filter(e=>!!e);M(e),w(K())},[null==b?void 0:b.taxonomy,ce,oe,t.showCounts,se,ie,p,X.attributes]);const ue=Object(o.useCallback)(e=>Array.isArray(ce)?ce.reduce((t,n)=>(e.includes(n.slug)&&t.push(n),t),[]):[],[ce]),be=Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){if(null==b||!b.taxonomy)return;const t=Object.keys(Object(P.getQueryArgs)(window.location.href)),n=J(b.taxonomy),r=t.reduce((e,t)=>t.includes(G.b+n)||t.includes(G.a+n)?Object(P.removeQueryArgs)(e,t):e,window.location.href),c=z(r,e);Object(G.c)(c)}else{const t=z(a,e),n=Object(P.getQueryArgs)(window.location.href),r=Object(P.getQueryArgs)(t);H(n,r)||Object(G.c)(t)}}),[a,null==b?void 0:b.taxonomy]),de=e=>{const n=Object($.b)(ne,re,b,ue(e),"or"===t.queryType?"in":"and");be(n,0===e.length)},me=Object(o.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n||(g(e),!r&&t.showFilterButton||Object($.b)(ne,re,b,ue(e),"or"===t.queryType?"in":"and"))}),[n,g,ne,re,b,ue,t.queryType,t.showFilterButton]),pe=Object(o.useMemo)(()=>Object(I.a)(ne)?ne.filter(e=>{let{attribute:t}=e;return t===(null==b?void 0:b.taxonomy)}).flatMap(e=>{let{slug:t}=e;return t}):[],[ne,null==b?void 0:b.taxonomy]),ge=Object(_.a)(pe),Oe=Object(y.a)(ge);Object(o.useEffect)(()=>{!Oe||T()(Oe,ge)||T()(p,ge)||me(ge)},[p,ge,Oe,me]);const fe="single"!==t.selectType,je=Object(o.useCallback)(e=>{const t=p.includes(e);let n;fe?(n=p.filter(t=>t!==e),t||(n.push(e),n.sort())):n=t?[]:[e],me(n)},[p,fe,me]);Object(o.useEffect)(()=>{b&&!t.showFilterButton&&((e=>{let{currentCheckedFilters:t,hasSetFilterDefaultsFromUrl:n}=e;return n&&0===t.length})({currentCheckedFilters:p,hasSetFilterDefaultsFromUrl:s})?be(ne,!0):be(ne,!1))},[s,be,ne,b,p,t.showFilterButton]),Object(o.useEffect)(()=>{if(!s&&!oe)return d.length>0?(i(!0),void me(d,!0)):void(c||i(!0))},[b,s,oe,me,d,c]);const we=Object(te.a)();if(!r)return we(!1),null;if(!b)return n?Object(o.createElement)(B.a,{status:"warning",isDismissible:!1},Object(o.createElement)("p",null,Object(l.__)("Please select an attribute to use this filter!","woocommerce"))):(we(!1),null);if(0===N.length&&!oe&&n)return Object(o.createElement)(B.a,{status:"warning",isDismissible:!1},Object(o.createElement)("p",null,Object(l.__)("There are no products with the selected attributes.","woocommerce")));const he="h"+t.headingLevel,_e=!t.isPreview&&oe,ye=!t.isPreview&&se,ke=(_e||ye)&&0===N.length;if(!ke&&0===N.length)return we(!1),null;const ve=Object(o.createElement)(he,{className:"wc-block-attribute-filter__title"},t.heading),Ee=ke?Object(o.createElement)(Q.a,null,ve):ve;return we(!0),Object(o.createElement)(o.Fragment,null,!n&&t.heading&&Ee,Object(o.createElement)("div",{className:m()("wc-block-attribute-filter","style-"+t.displayStyle)},"dropdown"===t.displayStyle?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(D,{key:j,className:m()(W.className,{"single-selection":!fe,"is-loading":ke}),style:{...W.style,borderStyle:"none"},suggestions:N.filter(e=>!p.includes(e.value)).map(e=>e.formattedValue),disabled:ke,placeholder:Object(l.sprintf)(
|
17 |
/* translators: %s attribute name. */
|
18 |
Object(l.__)("Select %s","woocommerce"),b.label),onChange:e=>{!fe&&e.length>1&&(e=[e[e.length-1]]),e=e.map(e=>{const t=N.find(t=>t.formattedValue===e);return t?t.value:e});const t=Object(O.difference)(e,p);if(1===t.length)return je(t[0]);const n=Object(O.difference)(p,e);1===n.length&&je(n[0])},value:p,displayTransform:e=>{const t=N.find(t=>[t.value,t.formattedValue].includes(e));return t?t.textLabel:e},saveTransform:Z,messages:{added:Object(l.sprintf)(
|
19 |
/* translators: %s is the attribute label. */
|
@@ -23,6 +23,6 @@ Object(l.__)("%s filter removed.","woocommerce"),b.label),remove:Object(l.sprint
|
|
23 |
/* translators: %s is the attribute label. */
|
24 |
Object(l.__)("Remove %s filter.","woocommerce"),b.label.toLocaleLowerCase()),__experimentalInvalid:Object(l.sprintf)(
|
25 |
/* translators: %s is the attribute label. */
|
26 |
-
Object(l.__)("Invalid %s filter.","woocommerce"),b.label.toLocaleLowerCase())}}),fe&&Object(o.createElement)(u.a,{icon:q.a,size:30})):Object(o.createElement)(ee,{options:N,checked:p,onChange:je,isLoading:ke,isDisabled:ke})),Object(o.createElement)("div",{className:"wc-block-attribute-filter__actions"},p.length>0&&!ke&&Object(o.createElement)(C.a,{onClick:()=>{g([]),w(K()),s&&de([])},screenReaderLabel:Object(l.__)("Reset attribute filter","woocommerce")}),t.showFilterButton&&Object(o.createElement)(x.a,{className:"wc-block-attribute-filter__button",isLoading:ke,disabled:_e||ye||0===p.length,onClick:()=>de(p)})))},re=(n(408),n(
|
27 |
/* translators: %d is the number of attributes selected. */
|
28 |
-
Object(l._n)("%d attribute selected","%d attributes selected",e,"woocommerce"),e),updated:Object(l.__)("Product attribute search results updated.","woocommerce")},r=Object(O.sortBy)(ce.map(e=>({id:parseInt(e.attribute_id,10),name:e.attribute_label})),"name");return Object(o.createElement)(g.a,{className:"woocommerce-product-attributes",list:r,selected:r.filter(e=>{let{id:t}=e;return t===a}),onChange:T,messages:n,isSingle:!0,isCompact:t})};return 0===Object.keys(ce).length?Object(o.createElement)(w.Placeholder,{className:"wc-block-attribute-filter",icon:Object(o.createElement)(u.a,{icon:b.a}),label:Object(l.__)("Filter by Attribute","woocommerce"),instructions:Object(l.__)("Display a list of filters based on the selected attributes.","woocommerce")},Object(o.createElement)("p",null,Object(l.__)("Attributes are needed for filtering your products. You haven't created any attributes yet.","woocommerce")),Object(o.createElement)(w.Button,{className:"wc-block-attribute-filter__add-attribute-button",isSecondary:!0,href:Object(f.getAdminLink)("edit.php?post_type=product&page=product_attributes")},Object(l.__)("Add new attribute","woocommerce")+" ",Object(o.createElement)(u.a,{icon:p.a})),Object(o.createElement)(w.Button,{className:"wc-block-attribute-filter__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-product-taxonomies/"},Object(l.__)("Learn more","woocommerce"))):Object(o.createElement)("div",N,Object(o.createElement)(s.BlockControls,null,Object(o.createElement)(w.ToolbarGroup,{controls:[{icon:"edit",title:Object(l.__)("Edit","woocommerce"),onClick:()=>x(!C),isActive:C}]})),Object(o.createElement)(s.InspectorControls,{key:"inspector"},Object(o.createElement)(w.PanelBody,{title:Object(l.__)("Display Settings","woocommerce")},Object(o.createElement)(w.ToggleControl,{label:Object(l.__)("Include product count","woocommerce"),checked:v,onChange:()=>n({showCounts:!v})}),Object(o.createElement)(w.__experimentalToggleGroupControl,{label:Object(l.__)("Allow selecting multiple options?","woocommerce"),value:S||"multiple",onChange:e=>n({selectType:e}),className:"wc-block-attribute-filter__multiple-toggle"},Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"multiple",label:Object(l.__)("Multiple","woocommerce")}),Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"single",label:Object(l.__)("Single","woocommerce")})),"multiple"===S&&Object(o.createElement)(w.__experimentalToggleGroupControl,{label:Object(l.__)("Filter Conditions","woocommerce"),help:"and"===k?Object(l.__)("Choose to return filter results for all of the attributes selected.","woocommerce"):Object(l.__)("Choose to return filter results for any of the attributes selected.","woocommerce"),value:k,onChange:e=>n({queryType:e}),className:"wc-block-attribute-filter__conditions-toggle"},Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"and",label:Object(l.__)("All","woocommerce")}),Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"or",label:Object(l.__)("Any","woocommerce")})),Object(o.createElement)(w.__experimentalToggleGroupControl,{label:Object(l.__)("Display Style","woocommerce"),value:d,onChange:e=>n({displayStyle:e}),className:"wc-block-attribute-filter__display-toggle"},Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"list",label:Object(l.__)("List","woocommerce")}),Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"dropdown",label:Object(l.__)("Dropdown","woocommerce")})),Object(o.createElement)(w.ToggleControl,{label:Object(l.__)("Show 'Apply filters' button","woocommerce"),help:E?Object(l.__)("Products will only update when the button is clicked.","woocommerce"):Object(l.__)("Products will update as soon as attributes are selected.","woocommerce"),checked:E,onChange:e=>n({showFilterButton:e})})),Object(o.createElement)(w.PanelBody,{title:Object(l.__)("Content Settings","woocommerce"),initialOpen:!1},A({isCompact:!0}))),Object(o.createElement)(re.a,{clientId:c,attributes:t,setAttributes:n,filterType:"attribute-filter"}),C?Object(o.createElement)(w.Placeholder,{className:"wc-block-attribute-filter",icon:Object(o.createElement)(u.a,{icon:b.a}),label:Object(l.__)("Filter by Attribute","woocommerce"),instructions:Object(l.__)("Display a list of filters based on the selected attributes.","woocommerce")},Object(o.createElement)("div",{className:"wc-block-attribute-filter__selection"},A({isCompact:!1}),Object(o.createElement)(w.Button,{isPrimary:!0,onClick:()=>{x(!1),r(Object(l.__)("Now displaying a preview of the Filter Products by Attribute block.","woocommerce"))}},Object(l.__)("Done","woocommerce")))):Object(o.createElement)("div",{className:m()(i,"wc-block-attribute-filter")},h&&Object(o.createElement)(j.a,{className:"wc-block-attribute-filter__title",headingLevel:_,heading:h,onChange:e=>n({heading:e})}),Object(o.createElement)(w.Disabled,null,Object(o.createElement)(ne,{attributes:t,isEditor:!0}))))});const le={heading:{type:"string",default:Object(l.__)("Filter by attribute","woocommerce")}};Object(a.registerBlockType)(W,{icon:{src:Object(o.createElement)(u.a,{icon:b.a,className:"wc-block-editor-components-block-icon"})},supports:{...W.supports,...Object(i.b)()&&{__experimentalBorder:{radius:!1,color:!0,width:!1}}},attributes:{...W.attributes,...le},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:n}=e;return"woocommerce_layered_nav"===t&&!(null==n||!n.raw)},transform:e=>{var t,n,r,c;let{instance:o}=e;return Object(a.createBlock)("woocommerce/attribute-filter",{attributeId:0,showCounts:!0,queryType:(null==o||null===(t=o.raw)||void 0===t?void 0:t.query_type)||"or",heading:(null==o||null===(n=o.raw)||void 0===n?void 0:n.title)||Object(l.__)("Filter by attribute","woocommerce"),headingLevel:3,displayStyle:(null==o||null===(r=o.raw)||void 0===r?void 0:r.display_type)||"list",showFilterButton:!1,selectType:(null==o||null===(c=o.raw)||void 0===c?void 0:c.select_type)||"multiple",isPreview:!1})}}]},edit:oe,save(e){let{attributes:t}=e;const{className:n,showCounts:r,queryType:l,attributeId:a,heading:i,headingLevel:u,displayStyle:b,showFilterButton:d,selectType:p}=t,g={"data-attribute-id":a,"data-show-counts":r,"data-query-type":l,"data-heading":i,"data-heading-level":u};return"list"!==b&&(g["data-display-style"]=b),d&&(g["data-show-filter-button"]=d),"single"===p&&(g["data-select-type"]=p),Object(o.createElement)("div",c()({},s.useBlockProps.save({className:m()("is-loading",n)}),g),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-product-attribute-filter__placeholder"}))}})},5:function(e,t){e.exports=window.wp.blockEditor},
|
1 |
+
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["attribute-filter"]=function(e){function t(t){for(var r,l,a=t[0],s=t[1],i=t[2],b=0,d=[];b<a.length;b++)l=a[b],Object.prototype.hasOwnProperty.call(c,l)&&c[l]&&d.push(c[l][0]),c[l]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r]);for(u&&u(t);d.length;)d.shift()();return o.push.apply(o,i||[]),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 s=n[a];0!==c[s]&&(r=!1)}r&&(o.splice(t--,1),e=l(l.s=n[0]))}return e}var r={},c={8:0,1:0},o=[];function l(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,l),n.l=!0,n.exports}l.m=e,l.c=r,l.d=function(e,t,n){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(l.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)l.d(n,r,function(t){return e[t]}.bind(null,r));return n},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var i=0;i<a.length;i++)t(a[i]);var u=s;return o.push([407,0]),n()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.blocks},100:function(e,t,n){"use strict";n.d(t,"a",(function(){return k}));var r=n(6),c=n.n(r),o=n(0),l=n(1),a=n(3),s=n(118),i=n(527),u=n(4),b=n.n(u),d=n(11),m=n(19),p=n(37),g=n(526),O=n(15);const f=e=>{let{id:t,label:n,popoverContents:r,remove:c,screenReaderLabel:i,className:u=""}=e;const[m,p]=Object(o.useState)(!1),j=Object(d.useInstanceId)(f);if(i=i||n,!n)return null;n=Object(O.decodeEntities)(n);const w=b()("woocommerce-tag",u,{"has-remove":!!c}),h="woocommerce-tag__label-"+j,_=Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},i),Object(o.createElement)("span",{"aria-hidden":"true"},n));return Object(o.createElement)("span",{className:w},r?Object(o.createElement)(a.Button,{className:"woocommerce-tag__text",id:h,onClick:()=>p(!0)},_):Object(o.createElement)("span",{className:"woocommerce-tag__text",id:h},_),r&&m&&Object(o.createElement)(a.Popover,{onClose:()=>p(!1)},r),c&&Object(o.createElement)(a.Button,{className:"woocommerce-tag__remove",onClick:c(t),label:Object(l.sprintf)(// Translators: %s label.
|
2 |
Object(l.__)("Remove %s","woocommerce"),n),"aria-describedby":h},Object(o.createElement)(s.a,{icon:g.a,size:20,className:"clear-icon"})))};var j=f;const w=e=>Object(o.createElement)(p.b,e),h=e=>{const{list:t,selected:n,renderItem:r,depth:l=0,onSelect:a,instanceId:s,isSingle:i,search:u}=e;return t?Object(o.createElement)(o.Fragment,null,t.map(t=>{const b=-1!==n.findIndex(e=>{let{id:n}=e;return n===t.id});return Object(o.createElement)(o.Fragment,{key:t.id},Object(o.createElement)("li",null,r({item:t,isSelected:b,onSelect:a,isSingle:i,search:u,depth:l,controlId:s})),Object(o.createElement)(h,c()({},e,{list:t.children,depth:l+1})))})):null},_=e=>{let{isLoading:t,isSingle:n,selected:r,messages:c,onChange:s,onRemove:i}=e;if(t||n||!r)return null;const u=r.length;return Object(o.createElement)("div",{className:"woocommerce-search-list__selected"},Object(o.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(o.createElement)("strong",null,c.selected(u)),u>0?Object(o.createElement)(a.Button,{isLink:!0,isDestructive:!0,onClick:()=>s([]),"aria-label":c.clear},Object(l.__)("Clear all","woocommerce")):null),u>0?Object(o.createElement)("ul",null,r.map((e,t)=>Object(o.createElement)("li",{key:t},Object(o.createElement)(j,{label:e.name,id:e.id,remove:i})))):null)},y=e=>{let{filteredList:t,search:n,onSelect:r,instanceId:c,...a}=e;const{messages:u,renderItem:b,selected:d,isSingle:m}=a,p=b||w;return 0===t.length?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(o.createElement)(s.a,{icon:i.a})),Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-text"},n?Object(l.sprintf)(u.noResults,n):u.noItems)):Object(o.createElement)("ul",{className:"woocommerce-search-list__list"},Object(o.createElement)(h,{list:t,selected:d,renderItem:p,onSelect:r,instanceId:c,isSingle:m,search:n}))},k=e=>{const{className:t="",isCompact:n,isHierarchical:r,isLoading:l,isSingle:s,list:i,messages:u=m.a,onChange:p,onSearch:g,selected:O,debouncedSpeak:f}=e,[j,w]=Object(o.useState)(""),h=Object(d.useInstanceId)(k),v=Object(o.useMemo)(()=>({...m.a,...u}),[u]),E=Object(o.useMemo)(()=>Object(m.c)(i,j,r),[i,j,r]);Object(o.useEffect)(()=>{f&&f(v.updated)},[f,v]),Object(o.useEffect)(()=>{"function"==typeof g&&g(j)},[j,g]);const S=Object(o.useCallback)(e=>()=>{s&&p([]);const t=O.findIndex(t=>{let{id:n}=t;return n===e});p([...O.slice(0,t),...O.slice(t+1)])},[s,O,p]),C=Object(o.useCallback)(e=>()=>{-1===O.findIndex(t=>{let{id:n}=t;return n===e.id})?p(s?[e]:[...O,e]):S(e.id)()},[s,S,p,O]);return Object(o.createElement)("div",{className:b()("woocommerce-search-list",t,{"is-compact":n})},Object(o.createElement)(_,c()({},e,{onRemove:S,messages:v})),Object(o.createElement)("div",{className:"woocommerce-search-list__search"},Object(o.createElement)(a.TextControl,{label:v.search,type:"search",value:j,onChange:e=>w(e)})),l?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(o.createElement)(a.Spinner,null)):Object(o.createElement)(y,c()({},e,{search:j,filteredList:E,messages:v,onSelect:C,instanceId:h})))};Object(a.withSpokenMessages)(k)},102:function(e,t,n){"use strict";var r=n(0),c=n(5),o=n(11),l=n(1);n(139),t.a=Object(o.withInstanceId)(e=>{let{className:t,headingLevel:n,onChange:o,heading:a,instanceId:s}=e;const i="h"+n;return Object(r.createElement)(i,{className:t},Object(r.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-"+s},Object(l.__)("Block title","woocommerce")),Object(r.createElement)(c.PlainText,{id:"block-title-"+s,className:"wc-block-editor-components-title",value:a,onChange:o}))})},103:function(e,t,n){"use strict";var r=n(0);n(140),t.a=e=>{let{children:t}=e;return Object(r.createElement)("div",{className:"wc-block-filter-title-placeholder"},t)}},104:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(12);function c(e,t){const n=Object(r.useRef)();return Object(r.useEffect)(()=>{n.current===e||t&&!t(e,n.current)||(n.current=e)},[e,t]),n.current}},107:function(e,t){e.exports=window.wp.warning},108:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),c=n(7),o=n(0),l=n(40),a=n(142);const s=e=>{const{namespace:t,resourceName:n,resourceValues:s=[],query:i={},shouldSelect:u=!0}=e;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(o.useRef)({results:[],isLoading:!0}),d=Object(l.a)(i),m=Object(l.a)(s),p=Object(a.a)(),g=Object(c.useSelect)(e=>{if(!u)return null;const c=e(r.COLLECTIONS_STORE_KEY),o=[t,n,d,m],l=c.getCollectionError(...o);if(l){if(!(l instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");p(l)}return{results:c.getCollection(...o),isLoading:!c.hasFinishedResolution("getCollection",o)}},[t,n,m,d,u]);return null!==g&&(b.current=g),b.current}},11:function(e,t){e.exports=window.wp.compose},113:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(29);n(280),t.a=e=>{let{name:t,count:n}=e;return Object(r.createElement)(r.Fragment,null,t,null!==n&&Number.isFinite(n)&&Object(r.createElement)(o.a,{label:n.toString(),screenReaderLabel:Object(c.sprintf)(
|
3 |
/* translators: %s number of products. */
|
4 |
+
Object(c._n)("%s product","%s products",n,"woocommerce"),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},12:function(e,t){e.exports=window.React},123:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),c=n(1),o=n(10),l=n(7),a=n(3),s=n(5);const i=e=>{let{clientId:t,setAttributes:n,filterType:i,attributes:u}=e;const{replaceBlock:b}=Object(l.useDispatch)("core/block-editor"),{heading:d,headingLevel:m}=u;if(Object(l.useSelect)(e=>{const{getBlockParentsByBlockName:n}=e("core/block-editor");return n(t,"woocommerce/filter-wrapper").length>0},[t])||!i)return null;const p=[Object(r.createElement)(a.Button,{key:"convert",onClick:()=>{const e=[Object(o.createBlock)("woocommerce/"+i,{...u,heading:""})];d&&""!==d&&e.unshift(Object(o.createBlock)("core/heading",{content:d,level:null!=m?m:2})),b(t,Object(o.createBlock)("woocommerce/filter-wrapper",{heading:d,filterType:i},[...e])),n({heading:"",lock:{remove:!0}})},variant:"primary"},Object(c.__)("Upgrade block","woocommerce"))];return Object(r.createElement)(s.Warning,{actions:p},Object(c.__)("Filter block: We have improved this block to make styling easier. Upgrade it using the button below.","woocommerce"))}},124:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);const c=Object(r.createContext)({}),o=()=>{const{wrapper:e}=Object(r.useContext)(c);return t=>{e&&e.current&&(e.current.hidden=!t)}}},125:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"boolean"==typeof e},129:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(96),c=n(35);const o=e=>Object(r.a)(e)?JSON.parse(e)||{}:Object(c.a)(e)?e:{}},13:function(e,t){e.exports=window.wp.primitives},139:function(e,t){},140:function(e,t){},142:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0);const c=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},148:function(e){e.exports=JSON.parse('{"name":"woocommerce/attribute-filter","version":"1.0.0","title":"Filter by Attribute Controls","description":"Enable customers to filter the product grid by selecting one or more attributes, such as color.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"color":{"text":true,"background":false},"inserter":false,"lock":false},"example":{"attributes":{"isPreview":true}},"attributes":{"className":{"type":"string","default":""},"attributeId":{"type":"number","default":0},"showCounts":{"type":"boolean","default":true},"queryType":{"type":"string","default":"or"},"headingLevel":{"type":"number","default":3},"displayStyle":{"type":"string","default":"list"},"showFilterButton":{"type":"boolean","default":false},"selectType":{"type":"string","default":"multiple"},"isPreview":{"type":"boolean","default":false}},"textdomain":"woocommerce","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},15:function(e,t){e.exports=window.wp.htmlEntities},154:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(5),c=n(61),o=n(35),l=n(129);const a=e=>{if(!Object(c.b)())return{className:"",style:{}};const t=Object(o.a)(e)?e:{},n=Object(l.a)(t.style);return Object(r.__experimentalUseBorderProps)({...t,style:n})}},155:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(4),l=n.n(o),a=n(29);n(197),t.a=e=>{let{className:t,label:
|
5 |
/* translators: Reset button text for filters. */
|
6 |
n=Object(c.__)("Reset","woocommerce"),onClick:o,screenReaderLabel:s=Object(c.__)("Reset filter","woocommerce")}=e;return Object(r.createElement)("button",{className:l()("wc-block-components-filter-reset-button",t),onClick:o},Object(r.createElement)(a.a,{label:n,screenReaderLabel:s}))}},156:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(4),l=n.n(o),a=n(29);n(198),t.a=e=>{let{className:t,isLoading:n,disabled:o,label:
|
7 |
/* translators: Submit button text for filters. */
|
13 |
/* Translators: %s search term */
|
14 |
noResults:Object(o.__)("No results for %s","woocommerce"),search:Object(o.__)("Search for items","woocommerce"),selected:e=>Object(o.sprintf)(
|
15 |
/* translators: Number of items selected from list. */
|
16 |
+
Object(o._n)("%d item selected","%d items selected",e,"woocommerce"),e),updated:Object(o.__)("Search results updated.","woocommerce")},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const n=Object(c.groupBy)(e,"parent"),r=Object(c.keyBy)(t,"id"),o=["0"],l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=l(r[e.parent]);return[...t,e.name]},a=e=>e.map(e=>{const t=n[e.id];return o.push(""+e.id),{...e,breadcrumbs:l(r[e.parent]),children:t&&t.length?a(t):[]}}),s=a(n[0]||[]);return Object.entries(n).forEach(e=>{let[t,n]=e;o.includes(t)||s.push(...a(n||[]))}),s},s=(e,t,n)=>{if(!t)return n?a(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),c=e.map(e=>!!r.test(e.name)&&e).filter(Boolean);return n?a(c,e):c},i=(e,t)=>{if(!t)return e;const n=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(n).map((e,t)=>n.test(e)?Object(r.createElement)("strong",{key:t},e):Object(r.createElement)(r.Fragment,{key:t},e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},197:function(e,t){},198:function(e,t){},199:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},22:function(e,t,n){"use strict";n.d(t,"o",(function(){return o})),n.d(t,"m",(function(){return l})),n.d(t,"l",(function(){return a})),n.d(t,"n",(function(){return s})),n.d(t,"j",(function(){return i})),n.d(t,"e",(function(){return u})),n.d(t,"f",(function(){return b})),n.d(t,"g",(function(){return d})),n.d(t,"k",(function(){return m})),n.d(t,"c",(function(){return p})),n.d(t,"d",(function(){return g})),n.d(t,"h",(function(){return O})),n.d(t,"a",(function(){return f})),n.d(t,"i",(function(){return j})),n.d(t,"b",(function(){return w}));var r,c=n(2);const o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),l=o.pluginUrl+"images/",a=o.pluginUrl+"build/",s=o.buildPhase,i=null===(r=c.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=c.STORE_PAGES.checkout.id,b=c.STORE_PAGES.checkout.permalink,d=c.STORE_PAGES.privacy.permalink,m=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),p=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),g=c.STORE_PAGES.cart.permalink,O=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),f=Object(c.getSetting)("allowedCountries",{}),j=Object(c.getSetting)("shippingStates",{}),w=Object(c.getSetting)("allowedStates",{})},223:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return l}));var r=n(2);const c=Object(r.getSetting)("attributes",[]).reduce((e,t)=>{const 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;var r;return n&&n.id&&e.push(n),e},[]),o=e=>{if(e)return c.find(t=>t.id===e)},l=e=>{if(e)return c.find(t=>t.taxonomy===e)}},241:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return u}));var r=n(16),c=n(2),o=n(125);const l=Object(c.getSettingWithCoercion)("is_rendering_php_template",!1,o.a),a="query_type_",s="filter_";function i(e){return window?Object(r.getQueryArg)(window.location.href,e):null}function u(e){l?window.location.href=e:window.history.replaceState({},"",e)}},25:function(e,t){e.exports=window.wp.isShallowEqual},279:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(0),c=n(259),o=n(8),l=n(40),a=n(35),s=n(52),i=n(108),u=n(44);const b=e=>{let{queryAttribute:t,queryPrices:n,queryStock:b,queryRating:d,queryState:m}=e,p=Object(u.a)();p+="-collection-data";const[g]=Object(s.a)(p),[O,f]=Object(s.b)("calculate_attribute_counts",[],p),[j,w]=Object(s.b)("calculate_price_range",null,p),[h,_]=Object(s.b)("calculate_stock_status_counts",null,p),[y,k]=Object(s.b)("calculate_rating_counts",null,p),v=Object(l.a)(t||{}),E=Object(l.a)(n),S=Object(l.a)(b),C=Object(l.a)(d);Object(r.useEffect)(()=>{"object"==typeof v&&Object.keys(v).length&&(O.find(e=>Object(a.b)(v,"taxonomy")&&e.taxonomy===v.taxonomy)||f([...O,v]))},[v,O,f]),Object(r.useEffect)(()=>{j!==E&&void 0!==E&&w(E)},[E,w,j]),Object(r.useEffect)(()=>{h!==S&&void 0!==S&&_(S)},[S,_,h]),Object(r.useEffect)(()=>{y!==C&&void 0!==C&&k(C)},[C,k,y]);const[x,N]=Object(r.useState)(!1),[T]=Object(c.a)(x,200);x||N(!0);const A=Object(r.useMemo)(()=>(e=>{const t=e;return Array.isArray(e.calculate_attribute_counts)&&(t.calculate_attribute_counts=Object(o.sortBy)(e.calculate_attribute_counts.map(e=>{let{taxonomy:t,queryType:n}=e;return{taxonomy:t,query_type:n}}),["taxonomy","query_type"])),t})(g),[g]);return Object(i.a)({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...m,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...A},shouldSelect:T})}},280:function(e,t){},29:function(e,t,n){"use strict";var r=n(0),c=n(4),o=n.n(c);t.a=e=>{let t,{label:n,screenReaderLabel:c,wrapperElement:l,wrapperProps:a={}}=e;const s=null!=n,i=null!=c;return!s&&i?(t=l||"span",a={...a,className:o()(a.className,"screen-reader-text")},Object(r.createElement)(t,a,c)):(t=l||r.Fragment,s&&i&&n!==c?Object(r.createElement)(t,a,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},c)):Object(r.createElement)(t,a,n))}},3:function(e,t){e.exports=window.wp.components},35:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return c}));const r=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function c(e,t){return r(e)&&t in e}},37:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(6),c=n.n(r),o=n(0),l=n(19);const a=e=>{let{countLabel:t,className:n,depth:r=0,controlId:a="",item:s,isSelected:i,isSingle:u,onSelect:b,search:d="",...m}=e;const p=null!=t&&void 0!==s.count&&null!==s.count,g=[n,"woocommerce-search-list__item"];g.push("depth-"+r),u&&g.push("is-radio-button"),p&&g.push("has-count");const O=s.breadcrumbs&&s.breadcrumbs.length,f=m.name||"search-list-item-"+a,j=`${f}-${s.id}`;return Object(o.createElement)("label",{htmlFor:j,className:g.join(" ")},u?Object(o.createElement)("input",c()({type:"radio",id:j,name:f,value:s.value,onChange:b(s),checked:i,className:"woocommerce-search-list__item-input"},m)):Object(o.createElement)("input",c()({type:"checkbox",id:j,name:f,value:s.value,onChange:b(s),checked:i,className:"woocommerce-search-list__item-input"},m)),Object(o.createElement)("span",{className:"woocommerce-search-list__item-label"},O?Object(o.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(l.b)(s.breadcrumbs)):null,Object(o.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(l.d)(s.name,d))),!!p&&Object(o.createElement)("span",{className:"woocommerce-search-list__item-count"},t||s.count))};t.b=a},40:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(0),c=n(25),o=n.n(c);function l(e){const t=Object(r.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},407:function(e,t,n){e.exports=n(485)},408:function(e,t){},409:function(e,t){},410:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a}));var r=n(35);const c=e=>Object(r.b)(e,"count")&&Object(r.b)(e,"description")&&Object(r.b)(e,"id")&&Object(r.b)(e,"name")&&Object(r.b)(e,"parent")&&Object(r.b)(e,"slug")&&"number"==typeof e.count&&"string"==typeof e.description&&"number"==typeof e.id&&"string"==typeof e.name&&"number"==typeof e.parent&&"string"==typeof e.slug,o=e=>Array.isArray(e)&&e.every(c),l=e=>Object(r.b)(e,"attribute")&&Object(r.b)(e,"operator")&&Object(r.b)(e,"slug")&&"string"==typeof e.attribute&&"string"==typeof e.operator&&Array.isArray(e.slug)&&e.slug.every(e=>"string"==typeof e),a=e=>Array.isArray(e)&&e.every(l)},411:function(e,t){},44:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);const c=Object(r.createContext)("page"),o=()=>Object(r.useContext)(c);c.Provider},48:function(e,t){e.exports=window.wp.a11y},485:function(e,t,n){"use strict";n.r(t);var r=n(6),c=n.n(r),o=n(0),l=n(1),a=n(10),s=n(5),i=n(61),u=n(118),b=n(533),d=n(4),m=n.n(d),p=n(258),g=n(100),O=n(8),f=n(2),j=n(102),w=n(3),h=n(154),_=n(40),y=n(104),k=n(52),v=n(108),E=n(279),S=n(113),C=n(155),x=n(156),N=n(25),T=n.n(N),A=n(15),B=n(314),P=n(16),R=n(125),L=n(96),F=n(35),I=n(410),q=n(550),G=n(241),M=n(565);n(411);var D=e=>{let{className:t,style:n,suggestions:r,multiple:l=!0,saveTransform:a=(e=>e.trim().replace(/\s/g,"-")),messages:s={},validateInput:i=(e=>r.includes(e)),label:u="",...b}=e;return Object(o.createElement)("div",{className:m()("wc-blocks-components-form-token-field-wrapper",t,{"single-selection":!l}),style:n},Object(o.createElement)(M.a,c()({label:u,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,__experimentalValidateInput:i,saveTransform:a,maxLength:l?void 0:1,suggestions:r,messages:s},b)))},Q=n(103),V=n(223),$=n(181);const U=[{value:"preview-1",formattedValue:"preview-1",name:"Blue",label:Object(o.createElement)(S.a,{name:"Blue",count:3}),textLabel:"Blue (3)"},{value:"preview-2",formattedValue:"preview-2",name:"Green",label:Object(o.createElement)(S.a,{name:"Green",count:3}),textLabel:"Green (3)"},{value:"preview-3",formattedValue:"preview-3",name:"Red",label:Object(o.createElement)(S.a,{name:"Red",count:2}),textLabel:"Red (2)"}],Y={id:0,name:"preview",taxonomy:"preview",label:"Preview"};n(409);var W=n(148);function K(){return Math.floor(Math.random()*Date.now())}const J=e=>e.replace("pa_",""),z=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n={};t.forEach(e=>{const{attribute:t,slug:r,operator:c}=e,o=J(t),l=r.join(","),a=`${G.b}${o}`,s="in"===c?"or":"and";n[`${G.a}${o}`]=l,n[a]=s});const r=Object(P.removeQueryArgs)(e,...Object.keys(n));return Object(P.addQueryArgs)(r,n)},H=(e,t)=>{const n=Object.entries(t).reduce((e,t)=>{let[n,r]=t;return n.includes("query_type")?e:{...e,[n]:r}},{});return Object.entries(n).reduce((t,n)=>{let[r,c]=n;return e[r]===c&&t},!0)},Z=e=>e.trim().replace(/\s/g,"-").replace(/_/g,"-").replace(/-+/g,"-").replace(/[^a-zA-Z0-9-]/g,"");var X=n(157),ee=e=>{let{isLoading:t=!1,options:n,checked:r,onChange:c}=e;return t?Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"is-loading"}),Object(o.createElement)("span",{className:"is-loading"})):Object(o.createElement)(X.a,{className:"wc-block-attribute-filter-list",options:n,checked:r,onChange:c,isLoading:t,isDisabled:t})},te=n(124),ne=e=>{let{attributes:t,isEditor:n=!1}=e;const r=Object(f.getSettingWithCoercion)("has_filterable_products",!1,R.a),c=Object(f.getSettingWithCoercion)("is_rendering_php_template",!1,R.a),a=Object(f.getSettingWithCoercion)("page_url",window.location.href,L.a),[s,i]=Object(o.useState)(!1),b=t.isPreview&&!t.attributeId?Y:Object(V.a)(t.attributeId),d=Object(o.useMemo)(()=>(e=>{if(e){const t=Object(G.d)("filter_"+e.name);return"string"==typeof t?t.split(","):[]}return[]})(b),[b]),[p,g]=Object(o.useState)(d),[j,w]=Object(o.useState)(K()),[N,M]=Object(o.useState)(t.isPreview&&!t.attributeId?U:[]),W=Object(h.a)(t),[X]=Object(k.a)(),[ne,re]=Object(k.b)("attributes",[]),{results:ce,isLoading:oe}=Object(v.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[(null==b?void 0:b.id)||0],shouldSelect:t.attributeId>0}),le="dropdown"!==t.displayStyle&&"and"===t.queryType,{results:ae,isLoading:se}=Object(E.a)({queryAttribute:{taxonomy:(null==b?void 0:b.taxonomy)||"",queryType:t.queryType},queryState:{...X,attributes:le?X.attributes:null}}),ie=Object(o.useCallback)(e=>Object(F.b)(ae,"attribute_counts")&&Array.isArray(ae.attribute_counts)?ae.attribute_counts.find(t=>{let{term:n}=t;return n===e}):null,[ae]);Object(o.useEffect)(()=>{if(oe||se)return;if(!Array.isArray(ce))return;const e=ce.map(e=>{const n=ie(e.id);if(!(n||p.includes(e.slug)||(r=e.slug,null!=X&&X.attributes&&X.attributes.some(e=>{let{attribute:t,slug:n=[]}=e;return t===(null==b?void 0:b.taxonomy)&&n.includes(r)}))))return null;var r;const c=n?n.count:0;return{formattedValue:Z(e.slug),value:e.slug,name:Object(A.decodeEntities)(e.name),label:Object(o.createElement)(S.a,{name:Object(A.decodeEntities)(e.name),count:t.showCounts?c:null}),textLabel:t.showCounts?`${Object(A.decodeEntities)(e.name)} (${c})`:Object(A.decodeEntities)(e.name)}}).filter(e=>!!e);M(e),w(K())},[null==b?void 0:b.taxonomy,ce,oe,t.showCounts,se,ie,p,X.attributes]);const ue=Object(o.useCallback)(e=>Array.isArray(ce)?ce.reduce((t,n)=>(e.includes(n.slug)&&t.push(n),t),[]):[],[ce]),be=Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){if(null==b||!b.taxonomy)return;const t=Object.keys(Object(P.getQueryArgs)(window.location.href)),n=J(b.taxonomy),r=t.reduce((e,t)=>t.includes(G.b+n)||t.includes(G.a+n)?Object(P.removeQueryArgs)(e,t):e,window.location.href),c=z(r,e);Object(G.c)(c)}else{const t=z(a,e),n=Object(P.getQueryArgs)(window.location.href),r=Object(P.getQueryArgs)(t);H(n,r)||Object(G.c)(t)}}),[a,null==b?void 0:b.taxonomy]),de=e=>{const n=Object($.b)(ne,re,b,ue(e),"or"===t.queryType?"in":"and");be(n,0===e.length)},me=Object(o.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n||(g(e),!r&&t.showFilterButton||Object($.b)(ne,re,b,ue(e),"or"===t.queryType?"in":"and"))}),[n,g,ne,re,b,ue,t.queryType,t.showFilterButton]),pe=Object(o.useMemo)(()=>Object(I.a)(ne)?ne.filter(e=>{let{attribute:t}=e;return t===(null==b?void 0:b.taxonomy)}).flatMap(e=>{let{slug:t}=e;return t}):[],[ne,null==b?void 0:b.taxonomy]),ge=Object(_.a)(pe),Oe=Object(y.a)(ge);Object(o.useEffect)(()=>{!Oe||T()(Oe,ge)||T()(p,ge)||me(ge)},[p,ge,Oe,me]);const fe="single"!==t.selectType,je=Object(o.useCallback)(e=>{const t=p.includes(e);let n;fe?(n=p.filter(t=>t!==e),t||(n.push(e),n.sort())):n=t?[]:[e],me(n)},[p,fe,me]);Object(o.useEffect)(()=>{b&&!t.showFilterButton&&((e=>{let{currentCheckedFilters:t,hasSetFilterDefaultsFromUrl:n}=e;return n&&0===t.length})({currentCheckedFilters:p,hasSetFilterDefaultsFromUrl:s})?be(ne,!0):be(ne,!1))},[s,be,ne,b,p,t.showFilterButton]),Object(o.useEffect)(()=>{if(!s&&!oe)return d.length>0?(i(!0),void me(d,!0)):void(c||i(!0))},[b,s,oe,me,d,c]);const we=Object(te.a)();if(!r)return we(!1),null;if(!b)return n?Object(o.createElement)(B.a,{status:"warning",isDismissible:!1},Object(o.createElement)("p",null,Object(l.__)("Please select an attribute to use this filter!","woocommerce"))):(we(!1),null);if(0===N.length&&!oe&&n)return Object(o.createElement)(B.a,{status:"warning",isDismissible:!1},Object(o.createElement)("p",null,Object(l.__)("There are no products with the selected attributes.","woocommerce")));const he="h"+t.headingLevel,_e=!t.isPreview&&oe,ye=!t.isPreview&&se,ke=(_e||ye)&&0===N.length;if(!ke&&0===N.length)return we(!1),null;const ve=Object(o.createElement)(he,{className:"wc-block-attribute-filter__title"},t.heading),Ee=ke?Object(o.createElement)(Q.a,null,ve):ve;return we(!0),Object(o.createElement)(o.Fragment,null,!n&&t.heading&&Ee,Object(o.createElement)("div",{className:m()("wc-block-attribute-filter","style-"+t.displayStyle)},"dropdown"===t.displayStyle?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(D,{key:j,className:m()(W.className,{"single-selection":!fe,"is-loading":ke}),style:{...W.style,borderStyle:"none"},suggestions:N.filter(e=>!p.includes(e.value)).map(e=>e.formattedValue),disabled:ke,placeholder:Object(l.sprintf)(
|
17 |
/* translators: %s attribute name. */
|
18 |
Object(l.__)("Select %s","woocommerce"),b.label),onChange:e=>{!fe&&e.length>1&&(e=[e[e.length-1]]),e=e.map(e=>{const t=N.find(t=>t.formattedValue===e);return t?t.value:e});const t=Object(O.difference)(e,p);if(1===t.length)return je(t[0]);const n=Object(O.difference)(p,e);1===n.length&&je(n[0])},value:p,displayTransform:e=>{const t=N.find(t=>[t.value,t.formattedValue].includes(e));return t?t.textLabel:e},saveTransform:Z,messages:{added:Object(l.sprintf)(
|
19 |
/* translators: %s is the attribute label. */
|
23 |
/* translators: %s is the attribute label. */
|
24 |
Object(l.__)("Remove %s filter.","woocommerce"),b.label.toLocaleLowerCase()),__experimentalInvalid:Object(l.sprintf)(
|
25 |
/* translators: %s is the attribute label. */
|
26 |
+
Object(l.__)("Invalid %s filter.","woocommerce"),b.label.toLocaleLowerCase())}}),fe&&Object(o.createElement)(u.a,{icon:q.a,size:30})):Object(o.createElement)(ee,{options:N,checked:p,onChange:je,isLoading:ke,isDisabled:ke})),Object(o.createElement)("div",{className:"wc-block-attribute-filter__actions"},p.length>0&&!ke&&Object(o.createElement)(C.a,{onClick:()=>{g([]),w(K()),s&&de([])},screenReaderLabel:Object(l.__)("Reset attribute filter","woocommerce")}),t.showFilterButton&&Object(o.createElement)(x.a,{className:"wc-block-attribute-filter__button",isLoading:ke,disabled:_e||ye||0===p.length,onClick:()=>de(p)})))},re=(n(408),n(123));const ce=Object(f.getSetting)("attributes",[]);var oe=Object(w.withSpokenMessages)(e=>{let{attributes:t,setAttributes:n,debouncedSpeak:r,clientId:c}=e;const{attributeId:a,className:i,displayStyle:d,heading:h,headingLevel:_,isPreview:y,queryType:k,showCounts:v,showFilterButton:E,selectType:S}=t,[C,x]=Object(o.useState)(!a&&!y),N=Object(s.useBlockProps)(),T=e=>{if(!e||!e.length)return;const t=e[0].id;ce.find(e=>e.attribute_id===t.toString())&&a!==t&&n({attributeId:t})},A=e=>{let{isCompact:t}=e;const n={clear:Object(l.__)("Clear selected attribute","woocommerce"),list:Object(l.__)("Product Attributes","woocommerce"),noItems:Object(l.__)("Your store doesn't have any product attributes.","woocommerce"),search:Object(l.__)("Search for a product attribute:","woocommerce"),selected:e=>Object(l.sprintf)(
|
27 |
/* translators: %d is the number of attributes selected. */
|
28 |
+
Object(l._n)("%d attribute selected","%d attributes selected",e,"woocommerce"),e),updated:Object(l.__)("Product attribute search results updated.","woocommerce")},r=Object(O.sortBy)(ce.map(e=>({id:parseInt(e.attribute_id,10),name:e.attribute_label})),"name");return Object(o.createElement)(g.a,{className:"woocommerce-product-attributes",list:r,selected:r.filter(e=>{let{id:t}=e;return t===a}),onChange:T,messages:n,isSingle:!0,isCompact:t})};return 0===Object.keys(ce).length?Object(o.createElement)(w.Placeholder,{className:"wc-block-attribute-filter",icon:Object(o.createElement)(u.a,{icon:b.a}),label:Object(l.__)("Filter by Attribute","woocommerce"),instructions:Object(l.__)("Display a list of filters based on the selected attributes.","woocommerce")},Object(o.createElement)("p",null,Object(l.__)("Attributes are needed for filtering your products. You haven't created any attributes yet.","woocommerce")),Object(o.createElement)(w.Button,{className:"wc-block-attribute-filter__add-attribute-button",isSecondary:!0,href:Object(f.getAdminLink)("edit.php?post_type=product&page=product_attributes")},Object(l.__)("Add new attribute","woocommerce")+" ",Object(o.createElement)(u.a,{icon:p.a})),Object(o.createElement)(w.Button,{className:"wc-block-attribute-filter__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-product-taxonomies/"},Object(l.__)("Learn more","woocommerce"))):Object(o.createElement)("div",N,Object(o.createElement)(s.BlockControls,null,Object(o.createElement)(w.ToolbarGroup,{controls:[{icon:"edit",title:Object(l.__)("Edit","woocommerce"),onClick:()=>x(!C),isActive:C}]})),Object(o.createElement)(s.InspectorControls,{key:"inspector"},Object(o.createElement)(w.PanelBody,{title:Object(l.__)("Display Settings","woocommerce")},Object(o.createElement)(w.ToggleControl,{label:Object(l.__)("Include product count","woocommerce"),checked:v,onChange:()=>n({showCounts:!v})}),Object(o.createElement)(w.__experimentalToggleGroupControl,{label:Object(l.__)("Allow selecting multiple options?","woocommerce"),value:S||"multiple",onChange:e=>n({selectType:e}),className:"wc-block-attribute-filter__multiple-toggle"},Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"multiple",label:Object(l.__)("Multiple","woocommerce")}),Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"single",label:Object(l.__)("Single","woocommerce")})),"multiple"===S&&Object(o.createElement)(w.__experimentalToggleGroupControl,{label:Object(l.__)("Filter Conditions","woocommerce"),help:"and"===k?Object(l.__)("Choose to return filter results for all of the attributes selected.","woocommerce"):Object(l.__)("Choose to return filter results for any of the attributes selected.","woocommerce"),value:k,onChange:e=>n({queryType:e}),className:"wc-block-attribute-filter__conditions-toggle"},Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"and",label:Object(l.__)("All","woocommerce")}),Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"or",label:Object(l.__)("Any","woocommerce")})),Object(o.createElement)(w.__experimentalToggleGroupControl,{label:Object(l.__)("Display Style","woocommerce"),value:d,onChange:e=>n({displayStyle:e}),className:"wc-block-attribute-filter__display-toggle"},Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"list",label:Object(l.__)("List","woocommerce")}),Object(o.createElement)(w.__experimentalToggleGroupControlOption,{value:"dropdown",label:Object(l.__)("Dropdown","woocommerce")})),Object(o.createElement)(w.ToggleControl,{label:Object(l.__)("Show 'Apply filters' button","woocommerce"),help:E?Object(l.__)("Products will only update when the button is clicked.","woocommerce"):Object(l.__)("Products will update as soon as attributes are selected.","woocommerce"),checked:E,onChange:e=>n({showFilterButton:e})})),Object(o.createElement)(w.PanelBody,{title:Object(l.__)("Content Settings","woocommerce"),initialOpen:!1},A({isCompact:!0}))),Object(o.createElement)(re.a,{clientId:c,attributes:t,setAttributes:n,filterType:"attribute-filter"}),C?Object(o.createElement)(w.Placeholder,{className:"wc-block-attribute-filter",icon:Object(o.createElement)(u.a,{icon:b.a}),label:Object(l.__)("Filter by Attribute","woocommerce"),instructions:Object(l.__)("Display a list of filters based on the selected attributes.","woocommerce")},Object(o.createElement)("div",{className:"wc-block-attribute-filter__selection"},A({isCompact:!1}),Object(o.createElement)(w.Button,{isPrimary:!0,onClick:()=>{x(!1),r(Object(l.__)("Now displaying a preview of the Filter Products by Attribute block.","woocommerce"))}},Object(l.__)("Done","woocommerce")))):Object(o.createElement)("div",{className:m()(i,"wc-block-attribute-filter")},h&&Object(o.createElement)(j.a,{className:"wc-block-attribute-filter__title",headingLevel:_,heading:h,onChange:e=>n({heading:e})}),Object(o.createElement)(w.Disabled,null,Object(o.createElement)(ne,{attributes:t,isEditor:!0}))))});const le={heading:{type:"string",default:Object(l.__)("Filter by attribute","woocommerce")}};Object(a.registerBlockType)(W,{icon:{src:Object(o.createElement)(u.a,{icon:b.a,className:"wc-block-editor-components-block-icon"})},supports:{...W.supports,...Object(i.b)()&&{__experimentalBorder:{radius:!1,color:!0,width:!1}}},attributes:{...W.attributes,...le},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:n}=e;return"woocommerce_layered_nav"===t&&!(null==n||!n.raw)},transform:e=>{var t,n,r,c;let{instance:o}=e;return Object(a.createBlock)("woocommerce/attribute-filter",{attributeId:0,showCounts:!0,queryType:(null==o||null===(t=o.raw)||void 0===t?void 0:t.query_type)||"or",heading:(null==o||null===(n=o.raw)||void 0===n?void 0:n.title)||Object(l.__)("Filter by attribute","woocommerce"),headingLevel:3,displayStyle:(null==o||null===(r=o.raw)||void 0===r?void 0:r.display_type)||"list",showFilterButton:!1,selectType:(null==o||null===(c=o.raw)||void 0===c?void 0:c.select_type)||"multiple",isPreview:!1})}}]},edit:oe,save(e){let{attributes:t}=e;const{className:n,showCounts:r,queryType:l,attributeId:a,heading:i,headingLevel:u,displayStyle:b,showFilterButton:d,selectType:p}=t,g={"data-attribute-id":a,"data-show-counts":r,"data-query-type":l,"data-heading":i,"data-heading-level":u};return"list"!==b&&(g["data-display-style"]=b),d&&(g["data-show-filter-button"]=d),"single"===p&&(g["data-select-type"]=p),Object(o.createElement)("div",c()({},s.useBlockProps.save({className:m()("is-loading",n)}),g),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-product-attribute-filter__placeholder"}))}})},5:function(e,t){e.exports=window.wp.blockEditor},51:function(e,t){e.exports=window.wp.deprecated},52:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return m}));var r=n(9),c=n(7),o=n(0),l=n(25),a=n.n(l),s=n(40),i=n(104),u=n(44);const b=e=>{const t=Object(u.a)();e=e||t;const n=Object(c.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:l}=Object(c.useDispatch)(r.QUERY_STATE_STORE_KEY);return[n,Object(o.useCallback)(t=>{l(e,t)},[e,l])]},d=(e,t,n)=>{const l=Object(u.a)();n=n||l;const a=Object(c.useSelect)(c=>c(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t),[n,e]),{setQueryValue:s}=Object(c.useDispatch)(r.QUERY_STATE_STORE_KEY);return[a,Object(o.useCallback)(t=>{s(n,e,t)},[n,e,s])]},m=(e,t)=>{const n=Object(u.a)();t=t||n;const[r,c]=b(t),l=Object(s.a)(r),d=Object(s.a)(e),m=Object(i.a)(d),p=Object(o.useRef)(!1);return Object(o.useEffect)(()=>{a()(m,d)||(c(Object.assign({},l,d)),p.current=!0)},[l,d,m,c]),p.current?[r,c]:[e,c]}},54:function(e,t){e.exports=window.wp.keycodes},61:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return a}));var r=n(10),c=n(22);const o=(e,t)=>{if(c.n>2)return Object(r.registerBlockType)(e,t)},l=()=>c.n>2,a=()=>c.n>1},7:function(e,t){e.exports=window.wp.data},73:function(e,t){e.exports=window.wp.dom},8:function(e,t){e.exports=window.lodash},9:function(e,t){e.exports=window.wc.wcBlocksData},96:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>"string"==typeof e}});
|
packages/woocommerce-blocks/build/cart-blocks/cart-cross-sells-products--product-add-to-cart-frontend.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[4],{156:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return o}));var s=r(4);const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;const r=Object(s.select)("core/notices").getNotices(e);return r.some(e=>e.type===t)},o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=Object(s.select)("core/notices").getNotices(),{removeNotice:c}=Object(s.dispatch)("core/notices"),o=r.filter(t=>t.status===e);o.forEach(e=>c(e.id,t))}},27:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var s=r(0),c=r(12),o=r.n(c);function a(e){const t=Object(s.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},290:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var s=r(0),c=r(4),o=r(3);r(291);const a=e=>{let{errorMessage:t="",propertyName:r="",elementId:a=""}=e;const{validationError:n,validationErrorId:i}=Object(c.useSelect)(e=>{const t=e(o.VALIDATION_STORE_KEY);return{validationError:t.getValidationError(r),validationErrorId:t.getValidationErrorId(a)}});if(!t||"string"!=typeof t){if(null==n||!n.message||null!=n&&n.hidden)return null;t=n.message}return Object(s.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(s.createElement)("p",{id:i},t))};t.b=a},291:function(e,t){},294:function(e,t,r){"use strict";var s=r(11),c=r.n(s),o=r(0),a=r(43),n=r(5),i=r.n(n),u=r(145);r(295),t.a=e=>{let{className:t,showSpinner:r=!1,children:s,variant:n="contained",...l}=e;const d=i()("wc-block-components-button",t,n,{"wc-block-components-button--loading":r});return Object(o.createElement)(a.a,c()({className:d},l),r&&Object(o.createElement)(u.a,null),Object(o.createElement)("span",{className:"wc-block-components-button__text"},s))}},295:function(e,t){},319:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var s=r(0),c=r(4),o=r(3),a=r(21),n=r(36);const i=(e,t)=>{const r=e.find(e=>{let{id:r}=e;return r===t});return r?r.quantity:0},u=e=>{const{addItemToCart:t}=Object(c.useDispatch)(o.CART_STORE_KEY),{cartItems:r,cartIsLoading:u}=Object(n.a)(),{createErrorNotice:l,removeNotice:d}=Object(c.useDispatch)("core/notices"),[b,E]=Object(s.useState)(!1),m=Object(s.useRef)(i(r,e));return Object(s.useEffect)(()=>{const t=i(r,e);t!==m.current&&(m.current=t)},[r,e]),{cartQuantity:Number.isFinite(m.current)?m.current:0,addingToCart:b,cartIsLoading:u,addToCart:function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return E(!0),t(e,r).then(()=>{d("add-to-cart")}).catch(e=>{l(Object(a.decodeEntities)(e.message),{id:"add-to-cart",context:"wc/all-products",isDismissible:!0})}).finally(()=>{E(!1)})}}}},380:function(e,t,r){"use strict";var s=r(0),c=r(5),o=r.n(c),a=r(1),n=r(27);const i=e=>e.is_purchasable||!1;var u=r(4),l=r(3);const d={PRISTINE:"pristine",IDLE:"idle",DISABLED:"disabled",PROCESSING:"processing",BEFORE_PROCESSING:"before_processing",AFTER_PROCESSING:"after_processing"},b={status:d.PRISTINE,hasError:!1,quantity:0,processingResponse:null,requestParams:{}},E={SET_PRISTINE:"set_pristine",SET_IDLE:"set_idle",SET_DISABLED:"set_disabled",SET_PROCESSING:"set_processing",SET_BEFORE_PROCESSING:"set_before_processing",SET_AFTER_PROCESSING:"set_after_processing",SET_PROCESSING_RESPONSE:"set_processing_response",SET_HAS_ERROR:"set_has_error",SET_NO_ERROR:"set_no_error",SET_QUANTITY:"set_quantity",SET_REQUEST_PARAMS:"set_request_params"},{SET_PRISTINE:m,SET_IDLE:p,SET_DISABLED:O,SET_PROCESSING:_,SET_BEFORE_PROCESSING:h,SET_AFTER_PROCESSING:j,SET_PROCESSING_RESPONSE:S,SET_HAS_ERROR:g,SET_NO_ERROR:f,SET_QUANTITY:v,SET_REQUEST_PARAMS:R}=E,T=()=>({type:p}),P=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=e?g:f;return{type:t}},{SET_PRISTINE:I,SET_IDLE:A,SET_DISABLED:N,SET_PROCESSING:y,SET_BEFORE_PROCESSING:C,SET_AFTER_PROCESSING:k,SET_PROCESSING_RESPONSE:w,SET_HAS_ERROR:D,SET_NO_ERROR:F,SET_QUANTITY:q,SET_REQUEST_PARAMS:x}=E,{PRISTINE:B,IDLE:G,DISABLED:L,PROCESSING:Q,BEFORE_PROCESSING:V,AFTER_PROCESSING:M}=d,W=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,{quantity:r,type:s,data:c}=arguments.length>1?arguments[1]:void 0;switch(s){case I:e=b;break;case A:e=t.status!==G?{...t,status:G}:t;break;case N:e=t.status!==L?{...t,status:L}:t;break;case q:e=r!==t.quantity?{...t,quantity:r}:t;break;case x:e={...t,requestParams:{...t.requestParams,...c}};break;case w:e={...t,processingResponse:c};break;case y:e=t.status!==Q?{...t,status:Q,hasError:!1}:t,e=!1===e.hasError?e:{...e,hasError:!1};break;case C:e=t.status!==V?{...t,status:V,hasError:!1}:t;break;case k:e=t.status!==M?{...t,status:M}:t;break;case D:e=t.hasError?t:{...t,hasError:!0},e=t.status===Q||t.status===V?{...e,status:G}:e;break;case F:e=t.hasError?{...t,hasError:!1}:t}return e!==t&&s!==I&&e.status===B&&(e.status=G),e};var H=r(103),Y=r(229);const K=e=>({onAddToCartAfterProcessingWithSuccess:Object(Y.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(Y.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(Y.a)("add_to_cart_before_processing",e)});var U=r(232),J=r(42),z=r(156);const X=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:e=>{},onAddToCartAfterProcessingWithError:e=>{},onAddToCartBeforeProcessing:e=>{}},dispatchActions:{resetForm:()=>{},submitForm:()=>{},setQuantity:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},setRequestParams:e=>{}}}),Z=()=>Object(s.useContext)(X),$=e=>{var t,r,c,o;let{children:E,product:p,showFormElements:g}=e;const[f,I]=Object(s.useReducer)(W,b),[A,N]=Object(s.useReducer)(H.b,{}),y=Object(n.a)(A),{createErrorNotice:C}=Object(u.useDispatch)("core/notices"),{setValidationErrors:k}=Object(u.useDispatch)(l.VALIDATION_STORE_KEY),w=Object(s.useMemo)(()=>({onAddToCartAfterProcessingWithSuccess:K(N).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:K(N).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:K(N).onAddToCartBeforeProcessing}),[N]),D=Object(s.useMemo)(()=>({resetForm:()=>{I({type:m})},submitForm:()=>{I({type:h})},setQuantity:e=>{I((e=>({type:v,quantity:e}))(e))},setHasError:e=>{I(P(e))},setRequestParams:e=>{I((e=>({type:R,data:e}))(e))},setAfterProcessing:e=>{I({type:S,data:e}),I({type:j})}}),[]);Object(s.useEffect)(()=>{const e=f.status,t=!p.id||!i(p);e!==d.DISABLED||t?e!==d.DISABLED&&t&&I({type:O}):I(T())},[f.status,p,I]),Object(s.useEffect)(()=>{f.status===d.BEFORE_PROCESSING&&(Object(z.b)("error","wc/add-to-cart"),Object(U.a)(y,"add_to_cart_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:r}=e;t&&C(t,{context:"wc/add-to-cart"}),r&&k(r)}),I(T())):I({type:_})}))},[f.status,k,C,I,y,null==p?void 0:p.id]),Object(s.useEffect)(()=>{if(f.status===d.AFTER_PROCESSING){const e={processingResponse:f.processingResponse},t=e=>{let t=!1;return e.forEach(e=>{const{message:r,messageContext:s}=e;(Object(J.b)(e)||Object(J.c)(e))&&r&&(t=!0,C(r,s?{context:s}:void 0))}),t};if(f.hasError)return void Object(U.b)(y,"add_to_cart_after_processing_with_error",e).then(r=>{if(!t(r)){var s;const t=(null===(s=e.processingResponse)||void 0===s?void 0:s.message)||Object(a.__)("Something went wrong. Please contact us for assistance.","woocommerce");C(t,{id:"add-to-cart",context:"woocommerce/single-product/"+((null==p?void 0:p.id)||0)})}I(T())});Object(U.b)(y,"add_to_cart_after_processing_with_success",e).then(e=>{t(e)?I(P(!0)):I(T())})}},[f.status,f.hasError,f.processingResponse,D,C,y,null==p?void 0:p.id]);const F=(e=>["simple","variable"].includes(e.type||"simple"))(p),q={product:p,productType:p.type||"simple",productIsPurchasable:i(p),productHasOptions:p.has_options||!1,supportsFormElements:F,showFormElements:g&&F,quantity:f.quantity||(null==p||null===(t=p.add_to_cart)||void 0===t?void 0:t.minimum)||1,minQuantity:(null==p||null===(r=p.add_to_cart)||void 0===r?void 0:r.minimum)||1,maxQuantity:(null==p||null===(c=p.add_to_cart)||void 0===c?void 0:c.maximum)||99,multipleOf:(null==p||null===(o=p.add_to_cart)||void 0===o?void 0:o.multiple_of)||1,requestParams:f.requestParams,isIdle:f.status===d.IDLE,isDisabled:f.status===d.DISABLED,isProcessing:f.status===d.PROCESSING,isBeforeProcessing:f.status===d.BEFORE_PROCESSING,isAfterProcessing:f.status===d.AFTER_PROCESSING,hasError:f.hasError,eventRegistration:w,dispatchActions:D};return Object(s.createElement)(X.Provider,{value:q},E)};var ee=r(31),te=r.n(ee),re=r(21),se=r(89),ce=r(36),oe=()=>{const{dispatchActions:e,product:t,quantity:r,eventRegistration:c,hasError:o,isProcessing:n,requestParams:i}=Z(),{showAllValidationErrors:d}=Object(u.useDispatch)(l.VALIDATION_STORE_KEY),b=Object(u.useSelect)(e=>e(l.VALIDATION_STORE_KEY).hasValidationErrors),{createErrorNotice:E,removeNotice:m}=Object(u.useDispatch)("core/notices"),{receiveCart:p}=Object(ce.a)(),[O,_]=Object(s.useState)(!1),h=!o&&n,j=Object(s.useCallback)(()=>!b()||(d(),{type:"error"}),[b,d]);Object(s.useEffect)(()=>{const e=c.onAddToCartBeforeProcessing(j,0);return()=>{e()}},[c,j]);const S=Object(s.useCallback)(()=>{_(!0),m("add-to-cart","woocommerce/single-product/"+((null==t?void 0:t.id)||0));const s={id:t.id||0,quantity:r,...i};te()({path:"/wc/store/v1/cart/add-item",method:"POST",data:s,cache:"no-store",parse:!1}).then(r=>{te.a.setNonce(r.headers),r.json().then((function(s){r.ok?p(s):(s.body&&s.body.message?E(Object(re.decodeEntities)(s.body.message),{id:"add-to-cart",context:"woocommerce/single-product/"+((null==t?void 0:t.id)||0)}):E(Object(a.__)("Something went wrong. Please contact us for assistance.","woocommerce"),{id:"add-to-cart",context:"woocommerce/single-product/"+((null==t?void 0:t.id)||0)}),e.setHasError()),Object(se.c)({preserveCartData:!0}),e.setAfterProcessing(s),_(!1)}))}).catch(t=>{t.json().then((function(t){var r;null!==(r=t.data)&&void 0!==r&&r.cart&&p(t.data.cart),e.setHasError(),e.setAfterProcessing(t),_(!1)}))})},[t,E,m,p,e,r,i]);return Object(s.useEffect)(()=>{h&&!O&&S()},[h,S,O]),null};const ae=e=>{let{children:t,product:r,showFormElements:c}=e;return Object(s.createElement)($,{product:r,showFormElements:c},t,Object(s.createElement)(oe,null))};var ne=r(47),ie=r(6),ue=r(132),le=(r(394),r(294)),de=r(111),be=r(395),Ee=r(66),me=r(319);const pe=e=>{let{className:t,href:r,text:c,onClick:o}=e;return Object(s.createElement)(le.a,{className:t,href:r,onClick:o,rel:"nofollow"},c)},Oe=e=>{let{className:t,quantityInCart:r,isProcessing:c,isDisabled:o,isDone:n,onClick:i}=e;return Object(s.createElement)(le.a,{className:t,disabled:o,showSpinner:c,onClick:i},n&&r>0?Object(a.sprintf)(
|
2 |
/* translators: %s number of products in cart. */
|
3 |
-
Object(a._n)("%d in cart","%d in cart",r,"woocommerce"),r):Object(a.__)("Add to cart","woocommerce"),!!n&&Object(s.createElement)(de.a,{icon:be.a}))};var _e=()=>{const{showFormElements:e,productIsPurchasable:t,productHasOptions:r,product:c,productType:o,isDisabled:n,isProcessing:i,eventRegistration:u,hasError:l,dispatchActions:d}=Z(),{parentName:b}=Object(ne.useInnerBlockLayoutContext)(),{dispatchStoreEvent:E}=Object(Ee.a)(),{cartQuantity:m}=Object(me.a)(c.id||0),[p,O]=Object(s.useState)(!1),_=c.add_to_cart||{url:"",text:""};return Object(s.useEffect)(()=>{const e=u.onAddToCartAfterProcessingWithSuccess(()=>(l||O(!0),!0),0);return()=>{e()}},[u,l]),(e||!r&&"simple"===o)&&t?Object(s.createElement)(Oe,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:m,isDisabled:n,isProcessing:i,isDone:p,onClick:()=>{d.submitForm("woocommerce/single-product/"+((null==c?void 0:c.id)||0)),E("cart-add-item",{product:c,listName:b})}}):Object(s.createElement)(pe,{className:"wc-block-components-product-add-to-cart-button",href:_.url,text:_.text||Object(a.__)("View Product","woocommerce"),onClick:()=>{E("product-view-link",{product:c,listName:b})}})},he=r(50),je=e=>{let{disabled:t,min:r,max:c,step:o=1,value:a,onChange:n}=e;const i=void 0!==c,u=Object(he.a)(e=>{let t=e;i&&(t=Math.min(t,Math.floor(c/o)*o)),t=Math.max(t,Math.ceil(r/o)*o),t=Math.floor(t/o)*o,t!==e&&n(t)},300);return Object(s.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:a,min:r,max:c,step:o,hidden:1===c,disabled:t,onChange:e=>{n(e.target.value),u(e.target.value)}})},Se=e=>{let{reason:t=Object(a.__)("Sorry, this product cannot be purchased.","woocommerce")}=e;return Object(s.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},t)},ge=()=>{const{product:e,quantity:t,minQuantity:r,maxQuantity:c,multipleOf:o,dispatchActions:n,isDisabled:i}=Z();return e.id&&!e.is_purchasable?Object(s.createElement)(Se,null):e.id&&!e.is_in_stock?Object(s.createElement)(Se,{reason:Object(a.__)("This product is currently out of stock and cannot be purchased.","woocommerce")}):Object(s.createElement)(s.Fragment,null,Object(s.createElement)(je,{value:t,min:r,max:c,step:o,disabled:i,onChange:n.setQuantity}),Object(s.createElement)(_e,null))},fe=(r(396),r(465)),ve=r(7),Re=r(
|
1 |
+
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[4],{155:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return o}));var s=r(4);const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;const r=Object(s.select)("core/notices").getNotices(e);return r.some(e=>e.type===t)},o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=Object(s.select)("core/notices").getNotices(),{removeNotice:c}=Object(s.dispatch)("core/notices"),o=r.filter(t=>t.status===e);o.forEach(e=>c(e.id,t))}},27:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var s=r(0),c=r(12),o=r.n(c);function a(e){const t=Object(s.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},289:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var s=r(0),c=r(4),o=r(3);r(290);const a=e=>{let{errorMessage:t="",propertyName:r="",elementId:a=""}=e;const{validationError:n,validationErrorId:i}=Object(c.useSelect)(e=>{const t=e(o.VALIDATION_STORE_KEY);return{validationError:t.getValidationError(r),validationErrorId:t.getValidationErrorId(a)}});if(!t||"string"!=typeof t){if(null==n||!n.message||null!=n&&n.hidden)return null;t=n.message}return Object(s.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(s.createElement)("p",{id:i},t))};t.b=a},290:function(e,t){},293:function(e,t,r){"use strict";var s=r(11),c=r.n(s),o=r(0),a=r(43),n=r(5),i=r.n(n),u=r(144);r(294),t.a=e=>{let{className:t,showSpinner:r=!1,children:s,variant:n="contained",...l}=e;const d=i()("wc-block-components-button",t,n,{"wc-block-components-button--loading":r});return Object(o.createElement)(a.a,c()({className:d},l),r&&Object(o.createElement)(u.a,null),Object(o.createElement)("span",{className:"wc-block-components-button__text"},s))}},294:function(e,t){},319:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var s=r(0),c=r(4),o=r(3),a=r(21),n=r(36);const i=(e,t)=>{const r=e.find(e=>{let{id:r}=e;return r===t});return r?r.quantity:0},u=e=>{const{addItemToCart:t}=Object(c.useDispatch)(o.CART_STORE_KEY),{cartItems:r,cartIsLoading:u}=Object(n.a)(),{createErrorNotice:l,removeNotice:d}=Object(c.useDispatch)("core/notices"),[b,E]=Object(s.useState)(!1),m=Object(s.useRef)(i(r,e));return Object(s.useEffect)(()=>{const t=i(r,e);t!==m.current&&(m.current=t)},[r,e]),{cartQuantity:Number.isFinite(m.current)?m.current:0,addingToCart:b,cartIsLoading:u,addToCart:function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return E(!0),t(e,r).then(()=>{d("add-to-cart")}).catch(e=>{l(Object(a.decodeEntities)(e.message),{id:"add-to-cart",context:"wc/all-products",isDismissible:!0})}).finally(()=>{E(!1)})}}}},380:function(e,t,r){"use strict";var s=r(0),c=r(5),o=r.n(c),a=r(1),n=r(27);const i=e=>e.is_purchasable||!1;var u=r(4),l=r(3);const d={PRISTINE:"pristine",IDLE:"idle",DISABLED:"disabled",PROCESSING:"processing",BEFORE_PROCESSING:"before_processing",AFTER_PROCESSING:"after_processing"},b={status:d.PRISTINE,hasError:!1,quantity:0,processingResponse:null,requestParams:{}},E={SET_PRISTINE:"set_pristine",SET_IDLE:"set_idle",SET_DISABLED:"set_disabled",SET_PROCESSING:"set_processing",SET_BEFORE_PROCESSING:"set_before_processing",SET_AFTER_PROCESSING:"set_after_processing",SET_PROCESSING_RESPONSE:"set_processing_response",SET_HAS_ERROR:"set_has_error",SET_NO_ERROR:"set_no_error",SET_QUANTITY:"set_quantity",SET_REQUEST_PARAMS:"set_request_params"},{SET_PRISTINE:m,SET_IDLE:p,SET_DISABLED:O,SET_PROCESSING:_,SET_BEFORE_PROCESSING:h,SET_AFTER_PROCESSING:j,SET_PROCESSING_RESPONSE:S,SET_HAS_ERROR:g,SET_NO_ERROR:f,SET_QUANTITY:v,SET_REQUEST_PARAMS:R}=E,T=()=>({type:p}),P=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=e?g:f;return{type:t}},{SET_PRISTINE:I,SET_IDLE:A,SET_DISABLED:N,SET_PROCESSING:y,SET_BEFORE_PROCESSING:C,SET_AFTER_PROCESSING:k,SET_PROCESSING_RESPONSE:w,SET_HAS_ERROR:D,SET_NO_ERROR:F,SET_QUANTITY:q,SET_REQUEST_PARAMS:x}=E,{PRISTINE:B,IDLE:G,DISABLED:L,PROCESSING:Q,BEFORE_PROCESSING:V,AFTER_PROCESSING:M}=d,W=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,{quantity:r,type:s,data:c}=arguments.length>1?arguments[1]:void 0;switch(s){case I:e=b;break;case A:e=t.status!==G?{...t,status:G}:t;break;case N:e=t.status!==L?{...t,status:L}:t;break;case q:e=r!==t.quantity?{...t,quantity:r}:t;break;case x:e={...t,requestParams:{...t.requestParams,...c}};break;case w:e={...t,processingResponse:c};break;case y:e=t.status!==Q?{...t,status:Q,hasError:!1}:t,e=!1===e.hasError?e:{...e,hasError:!1};break;case C:e=t.status!==V?{...t,status:V,hasError:!1}:t;break;case k:e=t.status!==M?{...t,status:M}:t;break;case D:e=t.hasError?t:{...t,hasError:!0},e=t.status===Q||t.status===V?{...e,status:G}:e;break;case F:e=t.hasError?{...t,hasError:!1}:t}return e!==t&&s!==I&&e.status===B&&(e.status=G),e};var H=r(103),Y=r(229);const K=e=>({onAddToCartAfterProcessingWithSuccess:Object(Y.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(Y.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(Y.a)("add_to_cart_before_processing",e)});var U=r(232),J=r(42),z=r(155);const X=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:e=>{},onAddToCartAfterProcessingWithError:e=>{},onAddToCartBeforeProcessing:e=>{}},dispatchActions:{resetForm:()=>{},submitForm:()=>{},setQuantity:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},setRequestParams:e=>{}}}),Z=()=>Object(s.useContext)(X),$=e=>{var t,r,c,o;let{children:E,product:p,showFormElements:g}=e;const[f,I]=Object(s.useReducer)(W,b),[A,N]=Object(s.useReducer)(H.b,{}),y=Object(n.a)(A),{createErrorNotice:C}=Object(u.useDispatch)("core/notices"),{setValidationErrors:k}=Object(u.useDispatch)(l.VALIDATION_STORE_KEY),w=Object(s.useMemo)(()=>({onAddToCartAfterProcessingWithSuccess:K(N).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:K(N).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:K(N).onAddToCartBeforeProcessing}),[N]),D=Object(s.useMemo)(()=>({resetForm:()=>{I({type:m})},submitForm:()=>{I({type:h})},setQuantity:e=>{I((e=>({type:v,quantity:e}))(e))},setHasError:e=>{I(P(e))},setRequestParams:e=>{I((e=>({type:R,data:e}))(e))},setAfterProcessing:e=>{I({type:S,data:e}),I({type:j})}}),[]);Object(s.useEffect)(()=>{const e=f.status,t=!p.id||!i(p);e!==d.DISABLED||t?e!==d.DISABLED&&t&&I({type:O}):I(T())},[f.status,p,I]),Object(s.useEffect)(()=>{f.status===d.BEFORE_PROCESSING&&(Object(z.b)("error","wc/add-to-cart"),Object(U.a)(y,"add_to_cart_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:r}=e;t&&C(t,{context:"wc/add-to-cart"}),r&&k(r)}),I(T())):I({type:_})}))},[f.status,k,C,I,y,null==p?void 0:p.id]),Object(s.useEffect)(()=>{if(f.status===d.AFTER_PROCESSING){const e={processingResponse:f.processingResponse},t=e=>{let t=!1;return e.forEach(e=>{const{message:r,messageContext:s}=e;(Object(J.b)(e)||Object(J.c)(e))&&r&&(t=!0,C(r,s?{context:s}:void 0))}),t};if(f.hasError)return void Object(U.b)(y,"add_to_cart_after_processing_with_error",e).then(r=>{if(!t(r)){var s;const t=(null===(s=e.processingResponse)||void 0===s?void 0:s.message)||Object(a.__)("Something went wrong. Please contact us for assistance.","woocommerce");C(t,{id:"add-to-cart",context:"woocommerce/single-product/"+((null==p?void 0:p.id)||0)})}I(T())});Object(U.b)(y,"add_to_cart_after_processing_with_success",e).then(e=>{t(e)?I(P(!0)):I(T())})}},[f.status,f.hasError,f.processingResponse,D,C,y,null==p?void 0:p.id]);const F=(e=>["simple","variable"].includes(e.type||"simple"))(p),q={product:p,productType:p.type||"simple",productIsPurchasable:i(p),productHasOptions:p.has_options||!1,supportsFormElements:F,showFormElements:g&&F,quantity:f.quantity||(null==p||null===(t=p.add_to_cart)||void 0===t?void 0:t.minimum)||1,minQuantity:(null==p||null===(r=p.add_to_cart)||void 0===r?void 0:r.minimum)||1,maxQuantity:(null==p||null===(c=p.add_to_cart)||void 0===c?void 0:c.maximum)||99,multipleOf:(null==p||null===(o=p.add_to_cart)||void 0===o?void 0:o.multiple_of)||1,requestParams:f.requestParams,isIdle:f.status===d.IDLE,isDisabled:f.status===d.DISABLED,isProcessing:f.status===d.PROCESSING,isBeforeProcessing:f.status===d.BEFORE_PROCESSING,isAfterProcessing:f.status===d.AFTER_PROCESSING,hasError:f.hasError,eventRegistration:w,dispatchActions:D};return Object(s.createElement)(X.Provider,{value:q},E)};var ee=r(31),te=r.n(ee),re=r(21),se=r(89),ce=r(36),oe=()=>{const{dispatchActions:e,product:t,quantity:r,eventRegistration:c,hasError:o,isProcessing:n,requestParams:i}=Z(),{showAllValidationErrors:d}=Object(u.useDispatch)(l.VALIDATION_STORE_KEY),b=Object(u.useSelect)(e=>e(l.VALIDATION_STORE_KEY).hasValidationErrors),{createErrorNotice:E,removeNotice:m}=Object(u.useDispatch)("core/notices"),{receiveCart:p}=Object(ce.a)(),[O,_]=Object(s.useState)(!1),h=!o&&n,j=Object(s.useCallback)(()=>!b()||(d(),{type:"error"}),[b,d]);Object(s.useEffect)(()=>{const e=c.onAddToCartBeforeProcessing(j,0);return()=>{e()}},[c,j]);const S=Object(s.useCallback)(()=>{_(!0),m("add-to-cart","woocommerce/single-product/"+((null==t?void 0:t.id)||0));const s={id:t.id||0,quantity:r,...i};te()({path:"/wc/store/v1/cart/add-item",method:"POST",data:s,cache:"no-store",parse:!1}).then(r=>{te.a.setNonce(r.headers),r.json().then((function(s){r.ok?p(s):(s.body&&s.body.message?E(Object(re.decodeEntities)(s.body.message),{id:"add-to-cart",context:"woocommerce/single-product/"+((null==t?void 0:t.id)||0)}):E(Object(a.__)("Something went wrong. Please contact us for assistance.","woocommerce"),{id:"add-to-cart",context:"woocommerce/single-product/"+((null==t?void 0:t.id)||0)}),e.setHasError()),Object(se.c)({preserveCartData:!0}),e.setAfterProcessing(s),_(!1)}))}).catch(t=>{t.json().then((function(t){var r;null!==(r=t.data)&&void 0!==r&&r.cart&&p(t.data.cart),e.setHasError(),e.setAfterProcessing(t),_(!1)}))})},[t,E,m,p,e,r,i]);return Object(s.useEffect)(()=>{h&&!O&&S()},[h,S,O]),null};const ae=e=>{let{children:t,product:r,showFormElements:c}=e;return Object(s.createElement)($,{product:r,showFormElements:c},t,Object(s.createElement)(oe,null))};var ne=r(47),ie=r(6),ue=r(132),le=(r(394),r(293)),de=r(111),be=r(395),Ee=r(66),me=r(319);const pe=e=>{let{className:t,href:r,text:c,onClick:o}=e;return Object(s.createElement)(le.a,{className:t,href:r,onClick:o,rel:"nofollow"},c)},Oe=e=>{let{className:t,quantityInCart:r,isProcessing:c,isDisabled:o,isDone:n,onClick:i}=e;return Object(s.createElement)(le.a,{className:t,disabled:o,showSpinner:c,onClick:i},n&&r>0?Object(a.sprintf)(
|
2 |
/* translators: %s number of products in cart. */
|
3 |
+
Object(a._n)("%d in cart","%d in cart",r,"woocommerce"),r):Object(a.__)("Add to cart","woocommerce"),!!n&&Object(s.createElement)(de.a,{icon:be.a}))};var _e=()=>{const{showFormElements:e,productIsPurchasable:t,productHasOptions:r,product:c,productType:o,isDisabled:n,isProcessing:i,eventRegistration:u,hasError:l,dispatchActions:d}=Z(),{parentName:b}=Object(ne.useInnerBlockLayoutContext)(),{dispatchStoreEvent:E}=Object(Ee.a)(),{cartQuantity:m}=Object(me.a)(c.id||0),[p,O]=Object(s.useState)(!1),_=c.add_to_cart||{url:"",text:""};return Object(s.useEffect)(()=>{const e=u.onAddToCartAfterProcessingWithSuccess(()=>(l||O(!0),!0),0);return()=>{e()}},[u,l]),(e||!r&&"simple"===o)&&t?Object(s.createElement)(Oe,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:m,isDisabled:n,isProcessing:i,isDone:p,onClick:()=>{d.submitForm("woocommerce/single-product/"+((null==c?void 0:c.id)||0)),E("cart-add-item",{product:c,listName:b})}}):Object(s.createElement)(pe,{className:"wc-block-components-product-add-to-cart-button",href:_.url,text:_.text||Object(a.__)("View Product","woocommerce"),onClick:()=>{E("product-view-link",{product:c,listName:b})}})},he=r(50),je=e=>{let{disabled:t,min:r,max:c,step:o=1,value:a,onChange:n}=e;const i=void 0!==c,u=Object(he.a)(e=>{let t=e;i&&(t=Math.min(t,Math.floor(c/o)*o)),t=Math.max(t,Math.ceil(r/o)*o),t=Math.floor(t/o)*o,t!==e&&n(t)},300);return Object(s.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:a,min:r,max:c,step:o,hidden:1===c,disabled:t,onChange:e=>{n(e.target.value),u(e.target.value)}})},Se=e=>{let{reason:t=Object(a.__)("Sorry, this product cannot be purchased.","woocommerce")}=e;return Object(s.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},t)},ge=()=>{const{product:e,quantity:t,minQuantity:r,maxQuantity:c,multipleOf:o,dispatchActions:n,isDisabled:i}=Z();return e.id&&!e.is_purchasable?Object(s.createElement)(Se,null):e.id&&!e.is_in_stock?Object(s.createElement)(Se,{reason:Object(a.__)("This product is currently out of stock and cannot be purchased.","woocommerce")}):Object(s.createElement)(s.Fragment,null,Object(s.createElement)(je,{value:t,min:r,max:c,step:o,disabled:i,onChange:n.setQuantity}),Object(s.createElement)(_e,null))},fe=(r(396),r(465)),ve=r(7),Re=r(289);const Te={value:"",label:Object(a.__)("Select an option","woocommerce")};var Pe=e=>{let{attributeName:t,options:r=[],value:c="",onChange:n=(()=>{}),errorMessage:i=Object(a.__)("Please select a value.","woocommerce")}=e;const d=t,{setValidationErrors:b,clearValidationError:E}=Object(u.useDispatch)(l.VALIDATION_STORE_KEY),{error:m}=Object(u.useSelect)(e=>({error:e(l.VALIDATION_STORE_KEY).getValidationError(d)||{}}));return Object(ve.useEffect)(()=>{c?E(d):b({[d]:{message:i,hidden:!0}})},[c,d,i,E,b]),Object(ve.useEffect)(()=>()=>{E(d)},[d,E]),Object(s.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(s.createElement)(fe.a,{label:Object(re.decodeEntities)(t),value:c||"",options:[Te,...r],onChange:n,required:!0,className:o()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":(null==m?void 0:m.message)&&!(null!=m&&m.hidden)})}),Object(s.createElement)(Re.a,{propertyName:d,elementId:d}))},Ie=r(18);const Ae=(e,t,r)=>{const s=Object.values(t).map(e=>{let{id:t}=e;return t});if(Object.values(r).every(e=>""===e))return s;const c=Object.keys(e);return s.filter(e=>c.every(s=>{const c=r[s]||"",o=t["id:"+e].attributes[s];return""===c||null===o||o===c}))};var Ne=e=>{let{attributes:t,variationAttributes:r,setRequestParams:c}=e;const o=Object(n.a)(t),a=Object(n.a)(r),[i,u]=Object(s.useState)(0),[l,d]=Object(s.useState)({}),[b,E]=Object(s.useState)(!1),m=Object(s.useMemo)(()=>((e,t,r)=>{const s={},c=Object.keys(e),o=Object.values(r).filter(Boolean).length>0;return c.forEach(c=>{const a=e[c],n={...r,[c]:null},i=o?Ae(e,t,n):null,u=null!==i?i.map(e=>t["id:"+e].attributes[c]):null;s[c]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map(e=>{let{name:r,slug:s}=e;return null===t||t.includes(null)||t.includes(s)?{value:s,label:Object(re.decodeEntities)(r)}:null}).filter(Boolean)}(a.terms,u)}),s})(o,a,l),[l,o,a]);return Object(s.useEffect)(()=>{if(!b){const e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(Ie.a)(e))return{};const t=Object.keys(e),r={};return 0===t.length||t.forEach(t=>{const s=e[t],c=s.terms.filter(e=>e.default);var o;c.length>0&&(r[s.name]=null===(o=c[0])||void 0===o?void 0:o.slug)}),r}(t);e&&d({...e}),E(!0)}},[l,t,b]),Object(s.useEffect)(()=>{Object.values(l).filter(e=>""!==e).length===Object.keys(o).length?u(((e,t,r)=>Ae(e,t,r)[0]||0)(o,a,l)):i>0&&u(0)},[l,i,o,a]),Object(s.useEffect)(()=>{c({id:i,variation:Object.keys(l).map(e=>({attribute:e,value:l[e]}))})},[c,i,l]),Object(s.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(o).map(e=>Object(s.createElement)(Pe,{key:e,attributeName:e,options:m[e],value:l[e],onChange:t=>{d({...l,[e]:t})}})))},ye=e=>{let{product:t,dispatchers:r}=e;const c=(e=>e?Object(ie.keyBy)(Object.values(e).filter(e=
|