WooCommerce Gutenberg Products Block - Version 2.4.2

Version Description

  • 2019-09-23 =

  • Fix product grids overflowing in some themes

  • Fix regression that prevented selecting product variations in the Featured Product block.

Download this release

Release Info

Developer aljullu
Plugin Icon 128x128 WooCommerce Gutenberg Products Block
Version 2.4.2
Comparing to
See all releases

Code changes from version 2.4.1 to 2.4.2

assets/css/style.scss CHANGED
@@ -7,6 +7,7 @@
7
  }
8
 
9
  .wc-block-grid__product {
 
10
  padding: 0 $gap 0 0;
11
  margin: 0 0 $gap-large 0;
12
  float: none;
7
  }
8
 
9
  .wc-block-grid__product {
10
+ box-sizing: border-box;
11
  padding: 0 $gap 0 0;
12
  margin: 0 0 $gap-large 0;
13
  float: none;
assets/js/components/product-control/index.js CHANGED
@@ -272,7 +272,7 @@ class ProductControl extends Component {
272
  isSingle
273
  selected={ selectedListItems }
274
  onChange={ onChange }
275
- renderItem={ renderItem }
276
  onSearch={ IS_LARGE_CATALOG ? this.debouncedOnSearch : null }
277
  messages={ messages }
278
  isHierarchical
272
  isSingle
273
  selected={ selectedListItems }
274
  onChange={ onChange }
275
+ renderItem={ renderItem || this.renderItem }
276
  onSearch={ IS_LARGE_CATALOG ? this.debouncedOnSearch : null }
277
  messages={ messages }
278
  isHierarchical
build/featured-product.js CHANGED
@@ -1 +1 @@
1
- this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["featured-product"]=function(e){function t(t){for(var c,a,i=t[0],l=t[1],s=t[2],d=0,p=[];d<i.length;d++)a=i[d],Object.prototype.hasOwnProperty.call(r,a)&&r[a]&&p.push(r[a][0]),r[a]=0;for(c in l)Object.prototype.hasOwnProperty.call(l,c)&&(e[c]=l[c]);for(u&&u(t);p.length;)p.shift()();return o.push.apply(o,s||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],c=!0,i=1;i<n.length;i++){var l=n[i];0!==r[l]&&(c=!1)}c&&(o.splice(t--,1),e=a(a.s=n[0]))}return e}var c={},r={6:0},o=[];function a(t){if(c[t])return c[t].exports;var n=c[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=c,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},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 n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)a.d(n,c,function(t){return e[t]}.bind(null,c));return n},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||[],l=i.push.bind(i);i.push=t,i=i.slice();for(var s=0;s<i.length;s++)t(i[s]);var u=l;return o.push([546,2,1,0]),n()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},13:function(e,t){!function(){e.exports=this.React}()},14:function(e,t){!function(){e.exports=this.moment}()},17:function(e,t){!function(){e.exports=this.wp.apiFetch}()},18:function(e,t){!function(){e.exports=this.wp.editor}()},19:function(e,t){!function(){e.exports=this.wp.url}()},2:function(e,t){!function(){e.exports=this.wp.components}()},21:function(e,t){!function(){e.exports=this.wp.compose}()},23:function(e,t){!function(){e.exports=this.wp.blocks}()},24:function(e,t,n){"use strict";var c=n(0),r=n(2),o=function(e){var t=e.className,n=e.fillColor;return Object(c.createElement)(r.Icon,{className:t,icon:Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 22.41"},Object(c.createElement)("g",null,Object(c.createElement)("g",null,Object(c.createElement)("path",{fill:n,d:"M16.55 0H1.75C.56 0 0 .52 0 1.68v9.24c0 1.15.56 1.92 1.75 1.92H2V4.76a2.51 2.51 0 0 1 2.74-2.68H18v-.4A1.51 1.51 0 0 0 16.55 0z"}),Object(c.createElement)("path",{fill:n,d:"M19.54 3.11H4.74C3.55 3.11 3 3.64 3 4.79V14c0 1.19.55 2 1.74 2H5V7.88A2.51 2.51 0 0 1 7.73 5.2H21v-.41a1.51 1.51 0 0 0-1.46-1.68z"}),Object(c.createElement)("path",{fill:n,d:"M22.53 6.23H7.73C6.54 6.23 6 6.75 6 7.91v9.24c0 1.15.56 1.92 1.75 1.92h7a.59.59 0 0 1 .32.11l1.61 1.15 2.83 2a.31.31 0 0 0 .18.05.3.3 0 0 0 .31-.3v-2.73a.3.3 0 0 1 .28-.28h2.31A1.47 1.47 0 0 0 24 17.6V7.91a1.52 1.52 0 0 0-1.47-1.68z"}),Object(c.createElement)("path",{fill:"#ffffff",d:"M10.2 10.92l1.06-2.14 1.05 2.14 2.37.35-1.71 1.66.4 2.36-2.11-1.11-.17.09-.52.27-.51.26-.92.49.18-1.02.09-.57.1-.56.03-.21-1.71-1.66 2.37-.35zM21.46 14.25h-4.4a.69.69 0 0 1-.69-.69.68.68 0 0 1 .69-.68h4.4a.68.68 0 0 1 .69.68.69.69 0 0 1-.69.69zM21.46 11.19h-4.4a.69.69 0 1 1 0-1.37h4.4a.69.69 0 1 1 0 1.37z"}))))})},a=function(){return Object(c.createElement)(r.Icon,{icon:Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fillRule:"nonzero",d:"M21.913 7.0946H2.0254c-1.1708 0-2.0984.9908-2.0205 2.16l.741 11.0724c.0714 1.0638.9552 1.8892 2.0206 1.8892h18.4054c1.0654 0 1.9492-.8254 2.0205-1.8892l.7411-11.0724c.0779-1.1692-.8497-2.16-2.0205-2.16zm-8.8006-4.6573h5.987c1.119 0 2.0255.9065 2.0255 2.0254v.934H2.8103V2.0255C2.8103.9064 3.7168 0 4.8357 0h6.2513c1.119 0 2.0254.9065 2.0254 2.0254v.4119zm-7.0589 11.619a.926.926 0 1 1 0-1.852h11.8297a.926.926 0 1 1 0 1.852H6.0535z"}))})},i=function(){return Object(c.createElement)(r.Icon,{icon:Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(c.createElement)("path",{d:"M22 7.5H2c-1.2 0-2.1 1-2 2.2l.7 11.1c.1 1.1 1 1.9 2 1.9h18.5c1.1 0 2-.8 2-1.9L24 9.6c.1-1.1-.9-2.1-2-2.1zM13.1 2.8v-.4c0-1.1-.9-2-2-2H4.8c-1.1 0-2 .9-2 2v3.4h18.4v-1c0-1.1-.9-2-2-2h-6.1z"}),Object(c.createElement)("path",{fill:"#fff",d:"M14.4 18.7L12 17.4l-2.4 1.3.5-2.6-1.9-1.9 2.6-.4 1.2-2.4 1.2 2.4 2.6.4-1.9 1.9z"}))})},l=function(){return Object(c.createElement)(r.Icon,{className:"material-icon",icon:Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(c.createElement)("path",{d:"M0 0h24v24H0z",fill:"none"}),Object(c.createElement)("path",{d:"M23 12l-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-3.68L23 12zm-10 5h-2v-2h2v2zm0-4h-2V7h2v6z"}))})},s=function(){return Object(c.createElement)(r.Icon,{icon:Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"#1E8CBE",d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))})},u=function(){return Object(c.createElement)(r.Icon,{icon:Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"#6C7781",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))})},d=function(e){var t=e.className,n=e.fillColor;return Object(c.createElement)(r.Icon,{className:t,icon:Object(c.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(c.createElement)("path",{fill:n,d:"M2.3,17.3h9.3c0.1,0,0.3,0,0.4,0.1l5.9,4.2c0.3,0.2,0.7,0,0.7-0.3v-3.7c0-0.2,0.2-0.4,0.4-0.4H22 c1.1,0,2-0.9,2-2V2.5c0-1.2-0.7-2.2-2-2.2H2.3C0.7,0.2,0,0.9,0,2.5v12.3C0,16.3,0.7,17.3,2.3,17.3z"}),Object(c.createElement)("polygon",{fill:"#ffffff",points:"8.8,12.1 6.5,10.9 4.1,12.1 4.5,9.5 2.6,7.6 5.3,7.2 6.5,4.8 7.6,7.2 10.3,7.6 8.4,9.5"}),Object(c.createElement)("path",{fill:"#ffffff",d:"M20.7,7.9h-7c-0.5,0-0.9-0.4-0.9-0.9S13.2,6,13.7,6h7c0.5,0,0.9,0.4,0.9,0.9S21.2,7.9,20.7,7.9z"}),Object(c.createElement)("path",{fill:"#ffffff",d:"M20.7,11.5h-7c-0.5,0-0.9-0.4-0.9-0.9s0.4-0.9,0.9-0.9h7c0.5,0,0.9,0.4,0.9,0.9S21.2,11.5,20.7,11.5z"}))})},p=function(e){var t=e.className,n=e.fillColor;return Object(c.createElement)(r.Icon,{className:t,icon:Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 23"},Object(c.createElement)("path",{fill:n,d:"M21.9943 7.0957H2.00638C0.807102 7.0957 -0.0923543 8.0951 0.0075853 9.29437L0.707162 20.3877C0.807102 21.487 1.70656 22.2865 2.70595 22.2865H21.1948C22.2941 22.2865 23.1936 21.487 23.1936 20.3877L23.9931 9.29437C24.093 8.0951 23.0936 7.0957 21.9943 7.0957Z"}),Object(c.createElement)("path",{fill:n,d:"M13.0921 2.39855V1.99879C13.0921 0.899456 12.1926 0 11.0933 0H4.7971C3.69777 0 2.79831 0.899456 2.79831 1.99879V5.39674H21.1872V4.49728C21.1872 3.39795 20.2877 2.49849 19.1884 2.49849H13.0921V2.39855Z"}),Object(c.createElement)("path",{fill:"white",d:"M8.63115 17.126L6.5415 15.9449L4.361 17.126L4.72442 14.6729L2.99819 13.0376L5.45125 12.6742L6.5415 10.4937L7.5409 12.6742L9.99396 13.0376L8.26773 14.6729L8.63115 17.126Z"}),Object(c.createElement)("path",{fill:"white",d:"M19.1907 13.5918H12.9899C12.547 13.5918 12.1926 13.1921 12.1926 12.6924C12.1926 12.1927 12.547 11.7929 12.9899 11.7929H19.1907C19.6336 11.7929 19.9879 12.1927 19.9879 12.6924C19.9879 13.1921 19.6336 13.5918 19.1907 13.5918Z"}),Object(c.createElement)("path",{fill:"white",d:"M19.1907 17.1897H12.9899C12.547 17.1897 12.1926 16.7899 12.1926 16.2902C12.1926 15.7905 12.547 15.3907 12.9899 15.3907H19.1907C19.6336 15.3907 19.9879 15.7905 19.9879 16.2902C19.9879 16.7899 19.6336 17.1897 19.1907 17.1897Z"}))})},b=function(){return Object(c.createElement)(r.Icon,{className:"material-icon",icon:Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(c.createElement)("path",{d:"M13 13v8h8v-8h-8zM3 21h8v-8H3v8zM3 3v8h8V3H3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66-5.66-5.65z"}),Object(c.createElement)("path",{d:"M0 0h24v24H0z",fill:"none"}))})},h=n(6),f=n.n(h),m=(n(7),function(e){var t=e.size,n=void 0===t?20:t,o=e.className;return Object(c.createElement)(r.Icon,{className:f()("woo-icon",o),icon:Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",height:n,width:Math.floor(1.67*n),viewBox:"0 0 245 145"},Object(c.createElement)("path",{fill:"#96588A",d:"M22.76 0h199.1a22.77 22.77 0 0 1 22.8 22.76v75.92a22.77 22.77 0 0 1-22.78 22.78h-71.41l9.77 24-43.13-24H22.76C10.1946 121.449.011 111.2654 0 98.7V22.76C.011 10.1946 10.1946.011 22.76 0z"}),Object(c.createElement)("path",{fill:"#FFF",fillRule:"nonzero",d:"M12.32 20.63a8.16 8.16 0 0 1 6.25-3.09c5.0733-.36 7.9867 2.0333 8.74 7.18 3.14 20.86 6.4933 38.5633 10.06 53.11l21.92-41.69c2-3.76 4.49-5.76 7.52-6 4.3867-.3067 7.13 2.49 8.23 8.39a186 186 0 0 0 9.47 34.23c2.62-25.38 7.0133-43.7133 13.18-55a7.73 7.73 0 0 1 6.6-4.43 8.8 8.8 0 0 1 6.32 2 7.75 7.75 0 0 1 3.05 5.74 8.52 8.52 0 0 1-1 4.77c-3.9 7.24-7.12 19.28-9.66 36.12-2.48 16.2533-3.3967 28.9633-2.75 38.13a12.25 12.25 0 0 1-1.16 6.56 6.32 6.32 0 0 1-5.33 3.53c-2.6667.18-5.3033-1.0567-7.91-3.71-9.2933-9.54-16.6567-23.7267-22.09-42.56C57.3 76.7167 52.48 86.3333 49.3 92.76c-5.86 11.3333-10.89 17.13-15.09 17.39-2.7333.1933-5.0667-2.0933-7-6.86-5.1-13.0933-10.5833-38.4033-16.45-75.93a8.56 8.56 0 0 1 1.56-6.73zM227.23 36.34a23.17 23.17 0 0 0-16-11.59 26.25 26.25 0 0 0-5.42-.58c-9.5867 0-17.41 5-23.47 15a53 53 0 0 0-7.78 28.16c0 7.7333 1.6167 14.3333 4.85 19.8a23.15 23.15 0 0 0 16 11.59 26.28 26.28 0 0 0 5.42.59c9.68 0 17.5033-5 23.47-15A53.89 53.89 0 0 0 232.08 56c0-7.7333-1.6167-14.2867-4.85-19.66zm-12.61 27.72c-1.3733 6.56-3.9167 11.5-7.63 14.82-2.9267 2.6667-5.6133 3.7433-8.06 3.23-2.4467-.5133-4.4033-2.6667-5.87-6.46a25.68 25.68 0 0 1-1.76-9.09 35.9 35.9 0 0 1 .73-7.34 33 33 0 0 1 5.28-11.88c3.3333-4.8933 6.8067-6.9467 10.42-6.16 2.44.4867 4.3933 2.64 5.86 6.46a25.68 25.68 0 0 1 1.76 9.12 35.73 35.73 0 0 1-.73 7.33v-.03zM164.57 36.34a23.2 23.2 0 0 0-16-11.59 26.42 26.42 0 0 0-5.43-.58c-9.5933 0-17.4167 5-23.47 15a53 53 0 0 0-7.78 28.16c0 7.7333 1.6133 14.3333 4.84 19.8a23.19 23.19 0 0 0 16 11.59 26.44 26.44 0 0 0 5.43.59c9.68 0 17.5033-5 23.47-15A53.88 53.88 0 0 0 169.4 56c0-7.7333-1.6133-14.2867-4.84-19.66h.01zm-12.61 27.72c-1.3667 6.56-3.91 11.5-7.63 14.82-2.93 2.64-5.63 3.72-8.07 3.23-2.44-.49-4.4-2.64-5.86-6.46a25.7 25.7 0 0 1-1.77-9.09 35.9 35.9 0 0 1 .74-7.34 33 33 0 0 1 5.28-11.88c3.3333-4.8933 6.8067-6.9467 10.42-6.16 2.44.4867 4.3933 2.64 5.86 6.46a25.91 25.91 0 0 1 1.76 9.12 35.73 35.73 0 0 1-.73 7.33v-.03z"}))})});n.d(t,"a",function(){return o}),n.d(t,"b",function(){return a}),n.d(t,"c",function(){return i}),n.d(t,"d",function(){return l}),n.d(t,"e",function(){return s}),n.d(t,"f",function(){return u}),n.d(t,"h",function(){return d}),n.d(t,"g",function(){return p}),n.d(t,"i",function(){return b}),n.d(t,"j",function(){return m})},25:function(e,t,n){"use strict";n.d(t,"d",function(){return p}),n.d(t,"b",function(){return b}),n.d(t,"c",function(){return h}),n.d(t,"a",function(){return f});var c=n(20),r=n.n(c),o=n(19),a=n(17),i=n.n(a),l=n(4),s=n(5);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,c)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(n,!0).forEach(function(t){r()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var p=function(e){var t=e.selected,n=void 0===t?[]:t,c=e.search,r=void 0===c?"":c,a=e.queryArgs,u=function(e){var t=e.selected,n=void 0===t?[]:t,c=e.search,r=void 0===c?"":c,a=e.queryArgs,i=void 0===a?[]:a,l={per_page:s.IS_LARGE_CATALOG?100:-1,catalog_visibility:"any",status:"publish",search:r,orderby:"title",order:"asc"},u=[Object(o.addQueryArgs)(s.ENDPOINTS.products,d({},l,{},i))];return s.IS_LARGE_CATALOG&&n.length&&u.push(Object(o.addQueryArgs)(s.ENDPOINTS.products,{catalog_visibility:"any",status:"publish",include:n})),u}({selected:n,search:r,queryArgs:void 0===a?[]:a});return Promise.all(u.map(function(e){return i()({path:e})})).then(function(e){return Object(l.uniqBy)(Object(l.flatten)(e),"id")})},b=function(e){return i()({path:"".concat(s.ENDPOINTS.products,"/").concat(e)})},h=function(e){var t=e.selected,n=function(e){var t=e.selected,n=void 0===t?[]:t,c=e.search,r=[Object(o.addQueryArgs)("".concat(s.ENDPOINTS.products,"/tags"),{per_page:s.LIMIT_TAGS?100:-1,orderby:s.LIMIT_TAGS?"count":"name",order:s.LIMIT_TAGS?"desc":"asc",search:c})];return s.LIMIT_TAGS&&n.length&&r.push(Object(o.addQueryArgs)("".concat(s.ENDPOINTS.products,"/tags"),{include:n})),r}({selected:void 0===t?[]:t,search:e.search});return Promise.all(n.map(function(e){return i()({path:e})})).then(function(e){return Object(l.uniqBy)(Object(l.flatten)(e),"id")})},f=function(e){return i()({path:"".concat(s.ENDPOINTS.categories,"/").concat(e)})}},33:function(e,t){!function(){e.exports=this.wp.keycodes}()},39:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},4:function(e,t){!function(){e.exports=this.lodash}()},44:function(e,t){!function(){e.exports=this.ReactDOM}()},47:function(e,t){!function(){e.exports=this.wp.viewport}()},5:function(e,t){!function(){e.exports=this.wc["wc-block-settings"]}()},51:function(e,t){!function(){e.exports=this.wp.hooks}()},52:function(e,t,n){"use strict";var c=n(0),r=n(1),o=(n(7),n(29)),a=n.n(o),i=n(6),l=n.n(i),s=n(39),u=n(2);t.a=function(e){var t,n,o=e.className,i=e.error,d=e.isLoading,p=e.onRetry;return Object(c.createElement)(u.Placeholder,{icon:Object(c.createElement)(a.a,{icon:"notice"}),label:Object(r.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:l()("wc-block-api-error",o)},Object(c.createElement)("div",{className:"wc-block-error__message"},(n=(t=i).apiMessage,t.message||(n?Object(c.createElement)("span",null,Object(r.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(c.createElement)("br",null),Object(c.createElement)("code",null,Object(s.escapeHTML)(n))):Object(r.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))),p&&Object(c.createElement)(c.Fragment,null,d?Object(c.createElement)(u.Spinner,null):Object(c.createElement)(u.Button,{isDefault:!0,onClick:p},Object(r.__)("Retry","woo-gutenberg-products-block"))))}},525:function(e,t,n){var c=n(526);"string"==typeof c&&(c=[[e.i,c,""]]);var r={insert:"head",singleton:!1};n(35)(c,r);c.locals&&(e.exports=c.locals)},526:function(e,t,n){},53:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},54:function(e,t){!function(){e.exports=this.wp.date}()},546:function(e,t,n){"use strict";n.r(t);var c=n(0),r=n(1),o=n(18),a=n(23),i=n(5),l=(n(523),n(525),n(2)),s=n(6),u=n.n(s),d=n(21),p=n(4),b=(n(7),n(99)),h=n(52);function f(e){return e&&e.images&&e.images.length&&e.images[0].src||""}var m=n(71),g=Object(d.compose)([m.b,Object(o.withColors)({overlayColor:"background-color"}),l.withSpokenMessages])(function(e){var t,n,a,s,d=e.attributes,m=e.debouncedSpeak,g=e.error,O=e.getProduct,v=e.isLoading,j=e.isSelected,w=e.overlayColor,y=e.product,E=e.setAttributes,_=e.setOverlayColor,k=function(){var e=d.contentAlign,t=d.editMode,n=d.mediaId||function(e){return e&&e.images&&e.images.length&&e.images[0].id||0}(y);return Object(c.createElement)(o.BlockControls,null,Object(c.createElement)(o.AlignmentToolbar,{value:e,onChange:function(e){E({contentAlign:e})}}),Object(c.createElement)(o.MediaUploadCheck,null,Object(c.createElement)(l.Toolbar,null,Object(c.createElement)(o.MediaUpload,{onSelect:function(e){E({mediaId:e.id,mediaSrc:e.url})},allowedTypes:["image"],value:n,render:function(e){var t=e.open;return Object(c.createElement)(l.IconButton,{className:"components-toolbar__control",label:Object(r.__)("Edit media"),icon:"format-image",onClick:t,disabled:!y})}}))),Object(c.createElement)(l.Toolbar,{controls:[{icon:"edit",title:Object(r.__)("Edit"),onClick:function(){return E({editMode:!t})},isActive:t}]}))},S=d.editMode;return g?Object(c.createElement)(h.a,{className:"wc-block-featured-product-error",error:g,isLoading:v,onRetry:O}):S?Object(c.createElement)(c.Fragment,null,k(),Object(c.createElement)(l.Placeholder,{icon:"star-filled",label:Object(r.__)("Featured Product","woo-gutenberg-products-block"),className:"wc-block-featured-product"},Object(r.__)("Visually highlight a product or variation and encourage prompt action","woo-gutenberg-products-block"),Object(c.createElement)("div",{className:"wc-block-featured-product__selection"},Object(c.createElement)(b.a,{selected:d.productId||0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e[0]?e[0].id:0;E({productId:t,mediaId:0,mediaSrc:""})}}),Object(c.createElement)(l.Button,{isDefault:!0,onClick:function(){E({editMode:!1}),m(Object(r.__)("Showing Featured Product block preview.","woo-gutenberg-products-block"))}},Object(r.__)("Done","woo-gutenberg-products-block"))))):Object(c.createElement)(c.Fragment,null,k(),(t=d.mediaSrc||f(y),n=d.focalPoint,a=void 0===n?{x:.5,y:.5}:n,s="function"==typeof l.FocalPointPicker,Object(c.createElement)(o.InspectorControls,{key:"inspector"},Object(c.createElement)(l.PanelBody,{title:Object(r.__)("Content","woo-gutenberg-products-block")},Object(c.createElement)(l.ToggleControl,{label:Object(r.__)("Show description","woo-gutenberg-products-block"),checked:d.showDesc,onChange:function(){return E({showDesc:!d.showDesc})}}),Object(c.createElement)(l.ToggleControl,{label:Object(r.__)("Show price","woo-gutenberg-products-block"),checked:d.showPrice,onChange:function(){return E({showPrice:!d.showPrice})}})),Object(c.createElement)(o.PanelColorSettings,{title:Object(r.__)("Overlay","woo-gutenberg-products-block"),colorSettings:[{value:w.color,onChange:_,label:Object(r.__)("Overlay Color","woo-gutenberg-products-block")}]},!!t&&Object(c.createElement)(c.Fragment,null,Object(c.createElement)(l.RangeControl,{label:Object(r.__)("Background Opacity","woo-gutenberg-products-block"),value:d.dimRatio,onChange:function(e){return E({dimRatio:e})},min:0,max:100,step:10}),s&&Object(c.createElement)(l.FocalPointPicker,{label:Object(r.__)("Focal Point Picker"),url:t,value:a,onChange:function(e){return E({focalPoint:e})}}))))),y?function(){var e,t,n=d.className,a=d.contentAlign,s=d.dimRatio,b=d.focalPoint,h=d.height,m=d.showDesc,g=d.showPrice,O=u()("wc-block-featured-product",{"is-selected":j,"is-loading":!y&&v,"is-not-found":!y&&!v,"has-background-dim":0!==s},0===(e=s)||50===e?null:"has-background-dim-".concat(10*Math.round(e/10)),"center"!==a&&"has-".concat(a,"-content"),n),_=(t=d.mediaSrc||y,Object(p.isObject)(t)&&(t=f(t)),t?{backgroundImage:"url(".concat(t,")")}:{});w.color&&(_.backgroundColor=w.color),b&&(_.backgroundPosition="".concat(100*b.x,"% ").concat(100*b.y,"%"));return Object(c.createElement)(l.ResizableBox,{className:O,size:{height:h},minHeight:i.MIN_HEIGHT,enable:{bottom:!0},onResizeStop:function(e,t,n){E({height:parseInt(n.style.height)})},style:_},Object(c.createElement)("div",{className:"wc-block-featured-product__wrapper"},Object(c.createElement)("h2",{className:"wc-block-featured-product__title",dangerouslySetInnerHTML:{__html:y.name}}),!Object(p.isEmpty)(y.variation)&&Object(c.createElement)("h3",{className:"wc-block-featured-product__variation",dangerouslySetInnerHTML:{__html:y.variation}}),m&&Object(c.createElement)("div",{className:"wc-block-featured-product__description",dangerouslySetInnerHTML:{__html:y.description}}),g&&Object(c.createElement)("div",{className:"wc-block-featured-product__price",dangerouslySetInnerHTML:{__html:y.price_html}}),Object(c.createElement)("div",{className:"wc-block-featured-product__link"},Object(c.createElement)(o.InnerBlocks,{template:[["core/button",{text:Object(r.__)("Shop now","woo-gutenberg-products-block"),url:y.permalink,align:"center"}]],templateLock:"all"}))))}():Object(c.createElement)(l.Placeholder,{className:"wc-block-featured-product",icon:"star-filled",label:Object(r.__)("Featured Product","woo-gutenberg-products-block")},v?Object(c.createElement)(l.Spinner,null):Object(r.__)("No product is selected.","woo-gutenberg-products-block")))});Object(a.registerBlockType)("woocommerce/featured-product",{title:Object(r.__)("Featured Product","woo-gutenberg-products-block"),icon:{src:"star-filled",foreground:"#96588a"},category:"woocommerce",keywords:[Object(r.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(r.__)("Visually highlight a product or variation and encourage prompt action.","woo-gutenberg-products-block"),supports:{align:["wide","full"],html:!1},attributes:{contentAlign:{type:"string",default:"center"},dimRatio:{type:"number",default:50},editMode:{type:"boolean",default:!0},focalPoint:{type:"object"},height:{type:"number",default:i.DEFAULT_HEIGHT},mediaId:{type:"number",default:0},mediaSrc:{type:"string",default:""},overlayColor:{type:"string"},customOverlayColor:{type:"string"},linkText:{type:"string",default:Object(r.__)("Shop now","woo-gutenberg-products-block")},productId:{type:"number"},showDesc:{type:"boolean",default:!0},showPrice:{type:"boolean",default:!0}},edit:function(e){return Object(c.createElement)(g,e)},save:function(){return Object(c.createElement)(o.InnerBlocks.Content,null)}})},61:function(e,t){!function(){e.exports=this.wp.dom}()},64:function(e,t){},65:function(e,t){},67:function(e,t){},68:function(e,t){},71:function(e,t,n){"use strict";var c=n(16),r=n.n(c),o=n(38),a=n.n(o),i=n(8),l=n.n(i),s=n(9),u=n.n(s),d=n(10),p=n.n(d),b=n(11),h=n.n(b),f=n(15),m=n.n(f),g=n(12),O=n.n(g),v=n(0),j=n(21),w=n(25),y=Object(j.createHigherOrderComponent)(function(e){return function(t){function n(){var e;return l()(this,n),(e=p()(this,h()(n).apply(this,arguments))).state={error:null,loading:!1,product:null},e.loadProduct=e.loadProduct.bind(m()(e)),e}return O()(n,t),u()(n,[{key:"componentDidMount",value:function(){this.loadProduct()}},{key:"componentDidUpdate",value:function(e){e.attributes.productId!==this.props.attributes.productId&&this.loadProduct()}},{key:"loadProduct",value:function(){var e=this,t=this.props.attributes.productId;t?(this.setState({loading:!0}),Object(w.b)(t).then(function(t){e.setState({product:t,loading:!1,error:null})}).catch(function(t){var n="object"===a()(t)&&t.hasOwnProperty("message")?{apiMessage:t.message}:{apiMessage:null};e.setState({product:null,loading:!1,error:n})})):this.setState({product:null,loading:!1,error:null})}},{key:"render",value:function(){var t=this.state,n=t.error,c=t.loading,o=t.product;return Object(v.createElement)(e,r()({},this.props,{error:n,getProduct:this.loadProduct,isLoading:c,product:o}))}}]),n}(v.Component)},"withProduct"),E=Object(j.createHigherOrderComponent)(function(e){return function(t){function n(){var e;return l()(this,n),(e=p()(this,h()(n).apply(this,arguments))).state={error:null,loading:!1,category:null},e.loadCategory=e.loadCategory.bind(m()(e)),e}return O()(n,t),u()(n,[{key:"componentDidMount",value:function(){this.loadCategory()}},{key:"componentDidUpdate",value:function(e){e.attributes.categoryId!==this.props.attributes.categoryId&&this.loadCategory()}},{key:"loadCategory",value:function(){var e=this,t=this.props.attributes.categoryId;t?(this.setState({loading:!0}),Object(w.a)(t).then(function(t){e.setState({category:t,loading:!1,error:null})}).catch(function(t){var n="object"===a()(t)&&t.hasOwnProperty("message")?{apiMessage:t.message}:{apiMessage:null};e.setState({category:null,loading:!1,error:n})})):this.setState({category:null,loading:!1,error:null})}},{key:"render",value:function(){var t=this.state,n=t.error,c=t.loading,o=t.category;return Object(v.createElement)(e,r()({},this.props,{error:n,getCategory:this.loadCategory,isLoading:c,category:o}))}}]),n}(v.Component)},"withCategory"),_=n(4),k=(n(7),n(5)),S=Object(j.createHigherOrderComponent)(function(e){var t=function(t){function n(){var e;return l()(this,n),(e=p()(this,h()(n).apply(this,arguments))).state={list:[],loading:!0},e.debouncedOnSearch=Object(_.debounce)(e.onSearch.bind(m()(e)),400),e}return O()(n,t),u()(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.selected;Object(w.d)({selected:t}).then(function(t){e.setState({list:t,loading:!1})}).catch(function(){e.setState({list:[],loading:!1})})}},{key:"componentWillUnmount",value:function(){this.debouncedOnSearch.cancel()}},{key:"onSearch",value:function(e){var t=this,n=this.props.selected;Object(w.d)({selected:n,search:e}).then(function(e){t.setState({list:e,loading:!1})}).catch(function(){t.setState({list:[],loading:!1})})}},{key:"render",value:function(){var t=this.state,n=t.list,c=t.loading,o=this.props.selected;return Object(v.createElement)(e,r()({},this.props,{products:n,isLoading:c,selected:n.filter(function(e){var t=e.id;return o.includes(t)}),onSearch:k.IS_LARGE_CATALOG?this.debouncedOnSearch:null}))}}]),n}(v.Component);return t.defaultProps={selected:[]},t},"withSearchedProducts");n.d(t,"b",function(){return y}),n.d(t,"a",function(){return E}),n.d(t,"c",function(){return S})},99:function(e,t,n){"use strict";var c=n(62),r=n.n(c),o=n(16),a=n.n(o),i=n(20),l=n.n(i),s=n(8),u=n.n(s),d=n(9),p=n.n(d),b=n(10),h=n.n(b),f=n(11),m=n.n(f),g=n(15),O=n.n(g),v=n(12),j=n.n(v),w=n(0),y=n(1),E=n(19),_=n(17),k=n.n(_),S=n(4),C=(n(7),n(26)),P=n(2),M=n(6),I=n.n(M),L=n(5),x=n(25),N=n(24);n(280);function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,c)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(n,!0).forEach(function(t){l()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function z(e,t){if(!t)return e;var n=new RegExp(Object(S.escapeRegExp)(t),"ig");return e.replace(n,"<strong>$&</strong>")}var T=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?Object(w.createElement)(N.e,null):Object(w.createElement)(N.f,null)},D=function(e){function t(){var e;return u()(this,t),(e=h()(this,m()(t).apply(this,arguments))).state={products:[],product:0,variationsList:{},variationsLoading:!1,loading:!0},e.debouncedOnSearch=Object(S.debounce)(e.onSearch.bind(O()(e)),400),e.debouncedGetVariations=Object(S.debounce)(e.getVariations.bind(O()(e)),200),e.renderItem=e.renderItem.bind(O()(e)),e.onProductSelect=e.onProductSelect.bind(O()(e)),e}return j()(t,e),p()(t,[{key:"componentWillUnmount",value:function(){this.debouncedOnSearch.cancel(),this.debouncedGetVariations.cancel()}},{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.selected,c=t.queryArgs;Object(x.d)({selected:n,queryArgs:c}).then(function(t){t=t.map(function(e){return H({},e,{parent:0,count:e.variations?e.variations.length:0})}),e.setState({products:t,loading:!1})}).catch(function(){e.setState({products:[],loading:!1})})}},{key:"componentDidUpdate",value:function(e,t){t.product!==this.state.product&&this.debouncedGetVariations()}},{key:"getVariations",value:function(){var e=this,t=this.state,n=t.product,c=t.products,r=t.variationsList;if(n){var o=c.find(function(e){return e.id===n});o.variations&&0!==o.variations.length&&(r[n]||this.setState({variationsLoading:!0}),k()({path:Object(E.addQueryArgs)("".concat(L.ENDPOINTS.products,"/").concat(n,"/variations"),{per_page:-1})}).then(function(t){t=t.map(function(e){return H({},e,{parent:n})}),e.setState(function(e){return{variationsList:H({},e.variationsList,l()({},n,t)),variationsLoading:!1}})}).catch(function(){e.setState({termsLoading:!1})}))}else this.setState({variationsList:{},variationsLoading:!1})}},{key:"onSearch",value:function(e){var t=this,n=this.props,c=n.selected,r=n.queryArgs;Object(x.d)({selected:c,search:e,queryArgs:r}).then(function(e){t.setState({products:e,loading:!1})}).catch(function(){t.setState({products:[],loading:!1})})}},{key:"onProductSelect",value:function(e,t){var n=this;return function(){n.setState({product:t?0:e.id})}}},{key:"renderItem",value:function(e){var t=this,n=e.item,c=e.search,r=e.depth,o=void 0===r?0:r,i=e.isSelected,l=e.onSelect,s=this.state,u=s.product,d=s.variationsLoading,p=I()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(o),{"is-searching":c.length>0,"is-skip-level":0===o&&0!==n.parent,"is-variable":n.count>0}),b=Object.assign({},e);delete b.isSingle;var h={role:"menuitemradio"};return n.breadcrumbs.length&&(h["aria-label"]="".concat(n.breadcrumbs[0],": ").concat(n.name)),n.count&&(h["aria-expanded"]=n.id===u),n.breadcrumbs.length?(Object(S.isEmpty)(n.variation)||(n.name=n.variation),Object(w.createElement)(C.b,a()({className:p},e,h))):[Object(w.createElement)(P.MenuItem,a()({key:"product-".concat(n.id),isSelected:i},b,h,{className:p,onClick:function(){l(n)(),t.onProductSelect(n,i)()}}),Object(w.createElement)("span",{className:"woocommerce-search-list__item-state"},T(i)),Object(w.createElement)("span",{className:"woocommerce-search-list__item-label"},Object(w.createElement)("span",{className:"woocommerce-search-list__item-name",dangerouslySetInnerHTML:{__html:z(n.name,c)}})),n.count?Object(w.createElement)("span",{className:"woocommerce-search-list__item-variation-count"},Object(y.sprintf)(Object(y._n)("%d variation","%d variations",n.count,"woo-gutenberg-products-block"),n.count)):null),u===n.id&&n.count>0&&d&&Object(w.createElement)("div",{key:"loading",className:"woocommerce-search-list__item woocommerce-search-product__itemdepth-1 is-loading is-not-active"},Object(w.createElement)(P.Spinner,null))]}},{key:"render",value:function(){var e=this.state,t=e.products,n=e.loading,c=e.product,o=e.variationsList,a=this.props,i=a.onChange,l=a.renderItem,s=a.selected,u=o[c]||[],d=[].concat(r()(t),r()(u)),p={list:Object(y.__)("Products","woo-gutenberg-products-block"),noItems:Object(y.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(y.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(y.__)("Product search results updated.","woo-gutenberg-products-block")},b=s?[Object(S.find)(d,{id:s})]:[];return Object(w.createElement)(w.Fragment,null,Object(w.createElement)(C.a,{className:"woocommerce-products",list:d,isLoading:n,isSingle:!0,selected:b,onChange:i,renderItem:l,onSearch:L.IS_LARGE_CATALOG?this.debouncedOnSearch:null,messages:p,isHierarchical:!0}))}}]),t}(w.Component);t.a=D}});
1
+ this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["featured-product"]=function(e){function t(t){for(var c,a,i=t[0],l=t[1],s=t[2],d=0,p=[];d<i.length;d++)a=i[d],Object.prototype.hasOwnProperty.call(r,a)&&r[a]&&p.push(r[a][0]),r[a]=0;for(c in l)Object.prototype.hasOwnProperty.call(l,c)&&(e[c]=l[c]);for(u&&u(t);p.length;)p.shift()();return o.push.apply(o,s||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],c=!0,i=1;i<n.length;i++){var l=n[i];0!==r[l]&&(c=!1)}c&&(o.splice(t--,1),e=a(a.s=n[0]))}return e}var c={},r={6:0},o=[];function a(t){if(c[t])return c[t].exports;var n=c[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=c,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},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 n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)a.d(n,c,function(t){return e[t]}.bind(null,c));return n},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||[],l=i.push.bind(i);i.push=t,i=i.slice();for(var s=0;s<i.length;s++)t(i[s]);var u=l;return o.push([546,2,1,0]),n()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},13:function(e,t){!function(){e.exports=this.React}()},14:function(e,t){!function(){e.exports=this.moment}()},17:function(e,t){!function(){e.exports=this.wp.apiFetch}()},18:function(e,t){!function(){e.exports=this.wp.editor}()},19:function(e,t){!function(){e.exports=this.wp.url}()},2:function(e,t){!function(){e.exports=this.wp.components}()},21:function(e,t){!function(){e.exports=this.wp.compose}()},23:function(e,t){!function(){e.exports=this.wp.blocks}()},24:function(e,t,n){"use strict";var c=n(0),r=n(2),o=function(e){var t=e.className,n=e.fillColor;return Object(c.createElement)(r.Icon,{className:t,icon:Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 22.41"},Object(c.createElement)("g",null,Object(c.createElement)("g",null,Object(c.createElement)("path",{fill:n,d:"M16.55 0H1.75C.56 0 0 .52 0 1.68v9.24c0 1.15.56 1.92 1.75 1.92H2V4.76a2.51 2.51 0 0 1 2.74-2.68H18v-.4A1.51 1.51 0 0 0 16.55 0z"}),Object(c.createElement)("path",{fill:n,d:"M19.54 3.11H4.74C3.55 3.11 3 3.64 3 4.79V14c0 1.19.55 2 1.74 2H5V7.88A2.51 2.51 0 0 1 7.73 5.2H21v-.41a1.51 1.51 0 0 0-1.46-1.68z"}),Object(c.createElement)("path",{fill:n,d:"M22.53 6.23H7.73C6.54 6.23 6 6.75 6 7.91v9.24c0 1.15.56 1.92 1.75 1.92h7a.59.59 0 0 1 .32.11l1.61 1.15 2.83 2a.31.31 0 0 0 .18.05.3.3 0 0 0 .31-.3v-2.73a.3.3 0 0 1 .28-.28h2.31A1.47 1.47 0 0 0 24 17.6V7.91a1.52 1.52 0 0 0-1.47-1.68z"}),Object(c.createElement)("path",{fill:"#ffffff",d:"M10.2 10.92l1.06-2.14 1.05 2.14 2.37.35-1.71 1.66.4 2.36-2.11-1.11-.17.09-.52.27-.51.26-.92.49.18-1.02.09-.57.1-.56.03-.21-1.71-1.66 2.37-.35zM21.46 14.25h-4.4a.69.69 0 0 1-.69-.69.68.68 0 0 1 .69-.68h4.4a.68.68 0 0 1 .69.68.69.69 0 0 1-.69.69zM21.46 11.19h-4.4a.69.69 0 1 1 0-1.37h4.4a.69.69 0 1 1 0 1.37z"}))))})},a=function(){return Object(c.createElement)(r.Icon,{icon:Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fillRule:"nonzero",d:"M21.913 7.0946H2.0254c-1.1708 0-2.0984.9908-2.0205 2.16l.741 11.0724c.0714 1.0638.9552 1.8892 2.0206 1.8892h18.4054c1.0654 0 1.9492-.8254 2.0205-1.8892l.7411-11.0724c.0779-1.1692-.8497-2.16-2.0205-2.16zm-8.8006-4.6573h5.987c1.119 0 2.0255.9065 2.0255 2.0254v.934H2.8103V2.0255C2.8103.9064 3.7168 0 4.8357 0h6.2513c1.119 0 2.0254.9065 2.0254 2.0254v.4119zm-7.0589 11.619a.926.926 0 1 1 0-1.852h11.8297a.926.926 0 1 1 0 1.852H6.0535z"}))})},i=function(){return Object(c.createElement)(r.Icon,{icon:Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(c.createElement)("path",{d:"M22 7.5H2c-1.2 0-2.1 1-2 2.2l.7 11.1c.1 1.1 1 1.9 2 1.9h18.5c1.1 0 2-.8 2-1.9L24 9.6c.1-1.1-.9-2.1-2-2.1zM13.1 2.8v-.4c0-1.1-.9-2-2-2H4.8c-1.1 0-2 .9-2 2v3.4h18.4v-1c0-1.1-.9-2-2-2h-6.1z"}),Object(c.createElement)("path",{fill:"#fff",d:"M14.4 18.7L12 17.4l-2.4 1.3.5-2.6-1.9-1.9 2.6-.4 1.2-2.4 1.2 2.4 2.6.4-1.9 1.9z"}))})},l=function(){return Object(c.createElement)(r.Icon,{className:"material-icon",icon:Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(c.createElement)("path",{d:"M0 0h24v24H0z",fill:"none"}),Object(c.createElement)("path",{d:"M23 12l-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-3.68L23 12zm-10 5h-2v-2h2v2zm0-4h-2V7h2v6z"}))})},s=function(){return Object(c.createElement)(r.Icon,{icon:Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"#1E8CBE",d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))})},u=function(){return Object(c.createElement)(r.Icon,{icon:Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"#6C7781",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))})},d=function(e){var t=e.className,n=e.fillColor;return Object(c.createElement)(r.Icon,{className:t,icon:Object(c.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(c.createElement)("path",{fill:n,d:"M2.3,17.3h9.3c0.1,0,0.3,0,0.4,0.1l5.9,4.2c0.3,0.2,0.7,0,0.7-0.3v-3.7c0-0.2,0.2-0.4,0.4-0.4H22 c1.1,0,2-0.9,2-2V2.5c0-1.2-0.7-2.2-2-2.2H2.3C0.7,0.2,0,0.9,0,2.5v12.3C0,16.3,0.7,17.3,2.3,17.3z"}),Object(c.createElement)("polygon",{fill:"#ffffff",points:"8.8,12.1 6.5,10.9 4.1,12.1 4.5,9.5 2.6,7.6 5.3,7.2 6.5,4.8 7.6,7.2 10.3,7.6 8.4,9.5"}),Object(c.createElement)("path",{fill:"#ffffff",d:"M20.7,7.9h-7c-0.5,0-0.9-0.4-0.9-0.9S13.2,6,13.7,6h7c0.5,0,0.9,0.4,0.9,0.9S21.2,7.9,20.7,7.9z"}),Object(c.createElement)("path",{fill:"#ffffff",d:"M20.7,11.5h-7c-0.5,0-0.9-0.4-0.9-0.9s0.4-0.9,0.9-0.9h7c0.5,0,0.9,0.4,0.9,0.9S21.2,11.5,20.7,11.5z"}))})},p=function(e){var t=e.className,n=e.fillColor;return Object(c.createElement)(r.Icon,{className:t,icon:Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 23"},Object(c.createElement)("path",{fill:n,d:"M21.9943 7.0957H2.00638C0.807102 7.0957 -0.0923543 8.0951 0.0075853 9.29437L0.707162 20.3877C0.807102 21.487 1.70656 22.2865 2.70595 22.2865H21.1948C22.2941 22.2865 23.1936 21.487 23.1936 20.3877L23.9931 9.29437C24.093 8.0951 23.0936 7.0957 21.9943 7.0957Z"}),Object(c.createElement)("path",{fill:n,d:"M13.0921 2.39855V1.99879C13.0921 0.899456 12.1926 0 11.0933 0H4.7971C3.69777 0 2.79831 0.899456 2.79831 1.99879V5.39674H21.1872V4.49728C21.1872 3.39795 20.2877 2.49849 19.1884 2.49849H13.0921V2.39855Z"}),Object(c.createElement)("path",{fill:"white",d:"M8.63115 17.126L6.5415 15.9449L4.361 17.126L4.72442 14.6729L2.99819 13.0376L5.45125 12.6742L6.5415 10.4937L7.5409 12.6742L9.99396 13.0376L8.26773 14.6729L8.63115 17.126Z"}),Object(c.createElement)("path",{fill:"white",d:"M19.1907 13.5918H12.9899C12.547 13.5918 12.1926 13.1921 12.1926 12.6924C12.1926 12.1927 12.547 11.7929 12.9899 11.7929H19.1907C19.6336 11.7929 19.9879 12.1927 19.9879 12.6924C19.9879 13.1921 19.6336 13.5918 19.1907 13.5918Z"}),Object(c.createElement)("path",{fill:"white",d:"M19.1907 17.1897H12.9899C12.547 17.1897 12.1926 16.7899 12.1926 16.2902C12.1926 15.7905 12.547 15.3907 12.9899 15.3907H19.1907C19.6336 15.3907 19.9879 15.7905 19.9879 16.2902C19.9879 16.7899 19.6336 17.1897 19.1907 17.1897Z"}))})},b=function(){return Object(c.createElement)(r.Icon,{className:"material-icon",icon:Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(c.createElement)("path",{d:"M13 13v8h8v-8h-8zM3 21h8v-8H3v8zM3 3v8h8V3H3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66-5.66-5.65z"}),Object(c.createElement)("path",{d:"M0 0h24v24H0z",fill:"none"}))})},h=n(6),f=n.n(h),m=(n(7),function(e){var t=e.size,n=void 0===t?20:t,o=e.className;return Object(c.createElement)(r.Icon,{className:f()("woo-icon",o),icon:Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",height:n,width:Math.floor(1.67*n),viewBox:"0 0 245 145"},Object(c.createElement)("path",{fill:"#96588A",d:"M22.76 0h199.1a22.77 22.77 0 0 1 22.8 22.76v75.92a22.77 22.77 0 0 1-22.78 22.78h-71.41l9.77 24-43.13-24H22.76C10.1946 121.449.011 111.2654 0 98.7V22.76C.011 10.1946 10.1946.011 22.76 0z"}),Object(c.createElement)("path",{fill:"#FFF",fillRule:"nonzero",d:"M12.32 20.63a8.16 8.16 0 0 1 6.25-3.09c5.0733-.36 7.9867 2.0333 8.74 7.18 3.14 20.86 6.4933 38.5633 10.06 53.11l21.92-41.69c2-3.76 4.49-5.76 7.52-6 4.3867-.3067 7.13 2.49 8.23 8.39a186 186 0 0 0 9.47 34.23c2.62-25.38 7.0133-43.7133 13.18-55a7.73 7.73 0 0 1 6.6-4.43 8.8 8.8 0 0 1 6.32 2 7.75 7.75 0 0 1 3.05 5.74 8.52 8.52 0 0 1-1 4.77c-3.9 7.24-7.12 19.28-9.66 36.12-2.48 16.2533-3.3967 28.9633-2.75 38.13a12.25 12.25 0 0 1-1.16 6.56 6.32 6.32 0 0 1-5.33 3.53c-2.6667.18-5.3033-1.0567-7.91-3.71-9.2933-9.54-16.6567-23.7267-22.09-42.56C57.3 76.7167 52.48 86.3333 49.3 92.76c-5.86 11.3333-10.89 17.13-15.09 17.39-2.7333.1933-5.0667-2.0933-7-6.86-5.1-13.0933-10.5833-38.4033-16.45-75.93a8.56 8.56 0 0 1 1.56-6.73zM227.23 36.34a23.17 23.17 0 0 0-16-11.59 26.25 26.25 0 0 0-5.42-.58c-9.5867 0-17.41 5-23.47 15a53 53 0 0 0-7.78 28.16c0 7.7333 1.6167 14.3333 4.85 19.8a23.15 23.15 0 0 0 16 11.59 26.28 26.28 0 0 0 5.42.59c9.68 0 17.5033-5 23.47-15A53.89 53.89 0 0 0 232.08 56c0-7.7333-1.6167-14.2867-4.85-19.66zm-12.61 27.72c-1.3733 6.56-3.9167 11.5-7.63 14.82-2.9267 2.6667-5.6133 3.7433-8.06 3.23-2.4467-.5133-4.4033-2.6667-5.87-6.46a25.68 25.68 0 0 1-1.76-9.09 35.9 35.9 0 0 1 .73-7.34 33 33 0 0 1 5.28-11.88c3.3333-4.8933 6.8067-6.9467 10.42-6.16 2.44.4867 4.3933 2.64 5.86 6.46a25.68 25.68 0 0 1 1.76 9.12 35.73 35.73 0 0 1-.73 7.33v-.03zM164.57 36.34a23.2 23.2 0 0 0-16-11.59 26.42 26.42 0 0 0-5.43-.58c-9.5933 0-17.4167 5-23.47 15a53 53 0 0 0-7.78 28.16c0 7.7333 1.6133 14.3333 4.84 19.8a23.19 23.19 0 0 0 16 11.59 26.44 26.44 0 0 0 5.43.59c9.68 0 17.5033-5 23.47-15A53.88 53.88 0 0 0 169.4 56c0-7.7333-1.6133-14.2867-4.84-19.66h.01zm-12.61 27.72c-1.3667 6.56-3.91 11.5-7.63 14.82-2.93 2.64-5.63 3.72-8.07 3.23-2.44-.49-4.4-2.64-5.86-6.46a25.7 25.7 0 0 1-1.77-9.09 35.9 35.9 0 0 1 .74-7.34 33 33 0 0 1 5.28-11.88c3.3333-4.8933 6.8067-6.9467 10.42-6.16 2.44.4867 4.3933 2.64 5.86 6.46a25.91 25.91 0 0 1 1.76 9.12 35.73 35.73 0 0 1-.73 7.33v-.03z"}))})});n.d(t,"a",function(){return o}),n.d(t,"b",function(){return a}),n.d(t,"c",function(){return i}),n.d(t,"d",function(){return l}),n.d(t,"e",function(){return s}),n.d(t,"f",function(){return u}),n.d(t,"h",function(){return d}),n.d(t,"g",function(){return p}),n.d(t,"i",function(){return b}),n.d(t,"j",function(){return m})},25:function(e,t,n){"use strict";n.d(t,"d",function(){return p}),n.d(t,"b",function(){return b}),n.d(t,"c",function(){return h}),n.d(t,"a",function(){return f});var c=n(20),r=n.n(c),o=n(19),a=n(17),i=n.n(a),l=n(4),s=n(5);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,c)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(n,!0).forEach(function(t){r()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var p=function(e){var t=e.selected,n=void 0===t?[]:t,c=e.search,r=void 0===c?"":c,a=e.queryArgs,u=function(e){var t=e.selected,n=void 0===t?[]:t,c=e.search,r=void 0===c?"":c,a=e.queryArgs,i=void 0===a?[]:a,l={per_page:s.IS_LARGE_CATALOG?100:-1,catalog_visibility:"any",status:"publish",search:r,orderby:"title",order:"asc"},u=[Object(o.addQueryArgs)(s.ENDPOINTS.products,d({},l,{},i))];return s.IS_LARGE_CATALOG&&n.length&&u.push(Object(o.addQueryArgs)(s.ENDPOINTS.products,{catalog_visibility:"any",status:"publish",include:n})),u}({selected:n,search:r,queryArgs:void 0===a?[]:a});return Promise.all(u.map(function(e){return i()({path:e})})).then(function(e){return Object(l.uniqBy)(Object(l.flatten)(e),"id")})},b=function(e){return i()({path:"".concat(s.ENDPOINTS.products,"/").concat(e)})},h=function(e){var t=e.selected,n=function(e){var t=e.selected,n=void 0===t?[]:t,c=e.search,r=[Object(o.addQueryArgs)("".concat(s.ENDPOINTS.products,"/tags"),{per_page:s.LIMIT_TAGS?100:-1,orderby:s.LIMIT_TAGS?"count":"name",order:s.LIMIT_TAGS?"desc":"asc",search:c})];return s.LIMIT_TAGS&&n.length&&r.push(Object(o.addQueryArgs)("".concat(s.ENDPOINTS.products,"/tags"),{include:n})),r}({selected:void 0===t?[]:t,search:e.search});return Promise.all(n.map(function(e){return i()({path:e})})).then(function(e){return Object(l.uniqBy)(Object(l.flatten)(e),"id")})},f=function(e){return i()({path:"".concat(s.ENDPOINTS.categories,"/").concat(e)})}},33:function(e,t){!function(){e.exports=this.wp.keycodes}()},39:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},4:function(e,t){!function(){e.exports=this.lodash}()},44:function(e,t){!function(){e.exports=this.ReactDOM}()},47:function(e,t){!function(){e.exports=this.wp.viewport}()},5:function(e,t){!function(){e.exports=this.wc["wc-block-settings"]}()},51:function(e,t){!function(){e.exports=this.wp.hooks}()},52:function(e,t,n){"use strict";var c=n(0),r=n(1),o=(n(7),n(29)),a=n.n(o),i=n(6),l=n.n(i),s=n(39),u=n(2);t.a=function(e){var t,n,o=e.className,i=e.error,d=e.isLoading,p=e.onRetry;return Object(c.createElement)(u.Placeholder,{icon:Object(c.createElement)(a.a,{icon:"notice"}),label:Object(r.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:l()("wc-block-api-error",o)},Object(c.createElement)("div",{className:"wc-block-error__message"},(n=(t=i).apiMessage,t.message||(n?Object(c.createElement)("span",null,Object(r.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(c.createElement)("br",null),Object(c.createElement)("code",null,Object(s.escapeHTML)(n))):Object(r.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))),p&&Object(c.createElement)(c.Fragment,null,d?Object(c.createElement)(u.Spinner,null):Object(c.createElement)(u.Button,{isDefault:!0,onClick:p},Object(r.__)("Retry","woo-gutenberg-products-block"))))}},525:function(e,t,n){var c=n(526);"string"==typeof c&&(c=[[e.i,c,""]]);var r={insert:"head",singleton:!1};n(35)(c,r);c.locals&&(e.exports=c.locals)},526:function(e,t,n){},53:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},54:function(e,t){!function(){e.exports=this.wp.date}()},546:function(e,t,n){"use strict";n.r(t);var c=n(0),r=n(1),o=n(18),a=n(23),i=n(5),l=(n(523),n(525),n(2)),s=n(6),u=n.n(s),d=n(21),p=n(4),b=(n(7),n(99)),h=n(52);function f(e){return e&&e.images&&e.images.length&&e.images[0].src||""}var m=n(71),g=Object(d.compose)([m.b,Object(o.withColors)({overlayColor:"background-color"}),l.withSpokenMessages])(function(e){var t,n,a,s,d=e.attributes,m=e.debouncedSpeak,g=e.error,O=e.getProduct,v=e.isLoading,j=e.isSelected,w=e.overlayColor,y=e.product,E=e.setAttributes,_=e.setOverlayColor,k=function(){var e=d.contentAlign,t=d.editMode,n=d.mediaId||function(e){return e&&e.images&&e.images.length&&e.images[0].id||0}(y);return Object(c.createElement)(o.BlockControls,null,Object(c.createElement)(o.AlignmentToolbar,{value:e,onChange:function(e){E({contentAlign:e})}}),Object(c.createElement)(o.MediaUploadCheck,null,Object(c.createElement)(l.Toolbar,null,Object(c.createElement)(o.MediaUpload,{onSelect:function(e){E({mediaId:e.id,mediaSrc:e.url})},allowedTypes:["image"],value:n,render:function(e){var t=e.open;return Object(c.createElement)(l.IconButton,{className:"components-toolbar__control",label:Object(r.__)("Edit media"),icon:"format-image",onClick:t,disabled:!y})}}))),Object(c.createElement)(l.Toolbar,{controls:[{icon:"edit",title:Object(r.__)("Edit"),onClick:function(){return E({editMode:!t})},isActive:t}]}))},S=d.editMode;return g?Object(c.createElement)(h.a,{className:"wc-block-featured-product-error",error:g,isLoading:v,onRetry:O}):S?Object(c.createElement)(c.Fragment,null,k(),Object(c.createElement)(l.Placeholder,{icon:"star-filled",label:Object(r.__)("Featured Product","woo-gutenberg-products-block"),className:"wc-block-featured-product"},Object(r.__)("Visually highlight a product or variation and encourage prompt action","woo-gutenberg-products-block"),Object(c.createElement)("div",{className:"wc-block-featured-product__selection"},Object(c.createElement)(b.a,{selected:d.productId||0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e[0]?e[0].id:0;E({productId:t,mediaId:0,mediaSrc:""})}}),Object(c.createElement)(l.Button,{isDefault:!0,onClick:function(){E({editMode:!1}),m(Object(r.__)("Showing Featured Product block preview.","woo-gutenberg-products-block"))}},Object(r.__)("Done","woo-gutenberg-products-block"))))):Object(c.createElement)(c.Fragment,null,k(),(t=d.mediaSrc||f(y),n=d.focalPoint,a=void 0===n?{x:.5,y:.5}:n,s="function"==typeof l.FocalPointPicker,Object(c.createElement)(o.InspectorControls,{key:"inspector"},Object(c.createElement)(l.PanelBody,{title:Object(r.__)("Content","woo-gutenberg-products-block")},Object(c.createElement)(l.ToggleControl,{label:Object(r.__)("Show description","woo-gutenberg-products-block"),checked:d.showDesc,onChange:function(){return E({showDesc:!d.showDesc})}}),Object(c.createElement)(l.ToggleControl,{label:Object(r.__)("Show price","woo-gutenberg-products-block"),checked:d.showPrice,onChange:function(){return E({showPrice:!d.showPrice})}})),Object(c.createElement)(o.PanelColorSettings,{title:Object(r.__)("Overlay","woo-gutenberg-products-block"),colorSettings:[{value:w.color,onChange:_,label:Object(r.__)("Overlay Color","woo-gutenberg-products-block")}]},!!t&&Object(c.createElement)(c.Fragment,null,Object(c.createElement)(l.RangeControl,{label:Object(r.__)("Background Opacity","woo-gutenberg-products-block"),value:d.dimRatio,onChange:function(e){return E({dimRatio:e})},min:0,max:100,step:10}),s&&Object(c.createElement)(l.FocalPointPicker,{label:Object(r.__)("Focal Point Picker"),url:t,value:a,onChange:function(e){return E({focalPoint:e})}}))))),y?function(){var e,t,n=d.className,a=d.contentAlign,s=d.dimRatio,b=d.focalPoint,h=d.height,m=d.showDesc,g=d.showPrice,O=u()("wc-block-featured-product",{"is-selected":j,"is-loading":!y&&v,"is-not-found":!y&&!v,"has-background-dim":0!==s},0===(e=s)||50===e?null:"has-background-dim-".concat(10*Math.round(e/10)),"center"!==a&&"has-".concat(a,"-content"),n),_=(t=d.mediaSrc||y,Object(p.isObject)(t)&&(t=f(t)),t?{backgroundImage:"url(".concat(t,")")}:{});w.color&&(_.backgroundColor=w.color),b&&(_.backgroundPosition="".concat(100*b.x,"% ").concat(100*b.y,"%"));return Object(c.createElement)(l.ResizableBox,{className:O,size:{height:h},minHeight:i.MIN_HEIGHT,enable:{bottom:!0},onResizeStop:function(e,t,n){E({height:parseInt(n.style.height)})},style:_},Object(c.createElement)("div",{className:"wc-block-featured-product__wrapper"},Object(c.createElement)("h2",{className:"wc-block-featured-product__title",dangerouslySetInnerHTML:{__html:y.name}}),!Object(p.isEmpty)(y.variation)&&Object(c.createElement)("h3",{className:"wc-block-featured-product__variation",dangerouslySetInnerHTML:{__html:y.variation}}),m&&Object(c.createElement)("div",{className:"wc-block-featured-product__description",dangerouslySetInnerHTML:{__html:y.description}}),g&&Object(c.createElement)("div",{className:"wc-block-featured-product__price",dangerouslySetInnerHTML:{__html:y.price_html}}),Object(c.createElement)("div",{className:"wc-block-featured-product__link"},Object(c.createElement)(o.InnerBlocks,{template:[["core/button",{text:Object(r.__)("Shop now","woo-gutenberg-products-block"),url:y.permalink,align:"center"}]],templateLock:"all"}))))}():Object(c.createElement)(l.Placeholder,{className:"wc-block-featured-product",icon:"star-filled",label:Object(r.__)("Featured Product","woo-gutenberg-products-block")},v?Object(c.createElement)(l.Spinner,null):Object(r.__)("No product is selected.","woo-gutenberg-products-block")))});Object(a.registerBlockType)("woocommerce/featured-product",{title:Object(r.__)("Featured Product","woo-gutenberg-products-block"),icon:{src:"star-filled",foreground:"#96588a"},category:"woocommerce",keywords:[Object(r.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(r.__)("Visually highlight a product or variation and encourage prompt action.","woo-gutenberg-products-block"),supports:{align:["wide","full"],html:!1},attributes:{contentAlign:{type:"string",default:"center"},dimRatio:{type:"number",default:50},editMode:{type:"boolean",default:!0},focalPoint:{type:"object"},height:{type:"number",default:i.DEFAULT_HEIGHT},mediaId:{type:"number",default:0},mediaSrc:{type:"string",default:""},overlayColor:{type:"string"},customOverlayColor:{type:"string"},linkText:{type:"string",default:Object(r.__)("Shop now","woo-gutenberg-products-block")},productId:{type:"number"},showDesc:{type:"boolean",default:!0},showPrice:{type:"boolean",default:!0}},edit:function(e){return Object(c.createElement)(g,e)},save:function(){return Object(c.createElement)(o.InnerBlocks.Content,null)}})},61:function(e,t){!function(){e.exports=this.wp.dom}()},64:function(e,t){},65:function(e,t){},67:function(e,t){},68:function(e,t){},71:function(e,t,n){"use strict";var c=n(16),r=n.n(c),o=n(38),a=n.n(o),i=n(8),l=n.n(i),s=n(9),u=n.n(s),d=n(10),p=n.n(d),b=n(11),h=n.n(b),f=n(15),m=n.n(f),g=n(12),O=n.n(g),v=n(0),j=n(21),w=n(25),y=Object(j.createHigherOrderComponent)(function(e){return function(t){function n(){var e;return l()(this,n),(e=p()(this,h()(n).apply(this,arguments))).state={error:null,loading:!1,product:null},e.loadProduct=e.loadProduct.bind(m()(e)),e}return O()(n,t),u()(n,[{key:"componentDidMount",value:function(){this.loadProduct()}},{key:"componentDidUpdate",value:function(e){e.attributes.productId!==this.props.attributes.productId&&this.loadProduct()}},{key:"loadProduct",value:function(){var e=this,t=this.props.attributes.productId;t?(this.setState({loading:!0}),Object(w.b)(t).then(function(t){e.setState({product:t,loading:!1,error:null})}).catch(function(t){var n="object"===a()(t)&&t.hasOwnProperty("message")?{apiMessage:t.message}:{apiMessage:null};e.setState({product:null,loading:!1,error:n})})):this.setState({product:null,loading:!1,error:null})}},{key:"render",value:function(){var t=this.state,n=t.error,c=t.loading,o=t.product;return Object(v.createElement)(e,r()({},this.props,{error:n,getProduct:this.loadProduct,isLoading:c,product:o}))}}]),n}(v.Component)},"withProduct"),E=Object(j.createHigherOrderComponent)(function(e){return function(t){function n(){var e;return l()(this,n),(e=p()(this,h()(n).apply(this,arguments))).state={error:null,loading:!1,category:null},e.loadCategory=e.loadCategory.bind(m()(e)),e}return O()(n,t),u()(n,[{key:"componentDidMount",value:function(){this.loadCategory()}},{key:"componentDidUpdate",value:function(e){e.attributes.categoryId!==this.props.attributes.categoryId&&this.loadCategory()}},{key:"loadCategory",value:function(){var e=this,t=this.props.attributes.categoryId;t?(this.setState({loading:!0}),Object(w.a)(t).then(function(t){e.setState({category:t,loading:!1,error:null})}).catch(function(t){var n="object"===a()(t)&&t.hasOwnProperty("message")?{apiMessage:t.message}:{apiMessage:null};e.setState({category:null,loading:!1,error:n})})):this.setState({category:null,loading:!1,error:null})}},{key:"render",value:function(){var t=this.state,n=t.error,c=t.loading,o=t.category;return Object(v.createElement)(e,r()({},this.props,{error:n,getCategory:this.loadCategory,isLoading:c,category:o}))}}]),n}(v.Component)},"withCategory"),_=n(4),k=(n(7),n(5)),S=Object(j.createHigherOrderComponent)(function(e){var t=function(t){function n(){var e;return l()(this,n),(e=p()(this,h()(n).apply(this,arguments))).state={list:[],loading:!0},e.debouncedOnSearch=Object(_.debounce)(e.onSearch.bind(m()(e)),400),e}return O()(n,t),u()(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.selected;Object(w.d)({selected:t}).then(function(t){e.setState({list:t,loading:!1})}).catch(function(){e.setState({list:[],loading:!1})})}},{key:"componentWillUnmount",value:function(){this.debouncedOnSearch.cancel()}},{key:"onSearch",value:function(e){var t=this,n=this.props.selected;Object(w.d)({selected:n,search:e}).then(function(e){t.setState({list:e,loading:!1})}).catch(function(){t.setState({list:[],loading:!1})})}},{key:"render",value:function(){var t=this.state,n=t.list,c=t.loading,o=this.props.selected;return Object(v.createElement)(e,r()({},this.props,{products:n,isLoading:c,selected:n.filter(function(e){var t=e.id;return o.includes(t)}),onSearch:k.IS_LARGE_CATALOG?this.debouncedOnSearch:null}))}}]),n}(v.Component);return t.defaultProps={selected:[]},t},"withSearchedProducts");n.d(t,"b",function(){return y}),n.d(t,"a",function(){return E}),n.d(t,"c",function(){return S})},99:function(e,t,n){"use strict";var c=n(62),r=n.n(c),o=n(16),a=n.n(o),i=n(20),l=n.n(i),s=n(8),u=n.n(s),d=n(9),p=n.n(d),b=n(10),h=n.n(b),f=n(11),m=n.n(f),g=n(15),O=n.n(g),v=n(12),j=n.n(v),w=n(0),y=n(1),E=n(19),_=n(17),k=n.n(_),S=n(4),C=(n(7),n(26)),P=n(2),M=n(6),I=n.n(M),L=n(5),x=n(25),N=n(24);n(280);function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,c)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(n,!0).forEach(function(t){l()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function z(e,t){if(!t)return e;var n=new RegExp(Object(S.escapeRegExp)(t),"ig");return e.replace(n,"<strong>$&</strong>")}var T=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?Object(w.createElement)(N.e,null):Object(w.createElement)(N.f,null)},D=function(e){function t(){var e;return u()(this,t),(e=h()(this,m()(t).apply(this,arguments))).state={products:[],product:0,variationsList:{},variationsLoading:!1,loading:!0},e.debouncedOnSearch=Object(S.debounce)(e.onSearch.bind(O()(e)),400),e.debouncedGetVariations=Object(S.debounce)(e.getVariations.bind(O()(e)),200),e.renderItem=e.renderItem.bind(O()(e)),e.onProductSelect=e.onProductSelect.bind(O()(e)),e}return j()(t,e),p()(t,[{key:"componentWillUnmount",value:function(){this.debouncedOnSearch.cancel(),this.debouncedGetVariations.cancel()}},{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.selected,c=t.queryArgs;Object(x.d)({selected:n,queryArgs:c}).then(function(t){t=t.map(function(e){return H({},e,{parent:0,count:e.variations?e.variations.length:0})}),e.setState({products:t,loading:!1})}).catch(function(){e.setState({products:[],loading:!1})})}},{key:"componentDidUpdate",value:function(e,t){t.product!==this.state.product&&this.debouncedGetVariations()}},{key:"getVariations",value:function(){var e=this,t=this.state,n=t.product,c=t.products,r=t.variationsList;if(n){var o=c.find(function(e){return e.id===n});o.variations&&0!==o.variations.length&&(r[n]||this.setState({variationsLoading:!0}),k()({path:Object(E.addQueryArgs)("".concat(L.ENDPOINTS.products,"/").concat(n,"/variations"),{per_page:-1})}).then(function(t){t=t.map(function(e){return H({},e,{parent:n})}),e.setState(function(e){return{variationsList:H({},e.variationsList,l()({},n,t)),variationsLoading:!1}})}).catch(function(){e.setState({termsLoading:!1})}))}else this.setState({variationsList:{},variationsLoading:!1})}},{key:"onSearch",value:function(e){var t=this,n=this.props,c=n.selected,r=n.queryArgs;Object(x.d)({selected:c,search:e,queryArgs:r}).then(function(e){t.setState({products:e,loading:!1})}).catch(function(){t.setState({products:[],loading:!1})})}},{key:"onProductSelect",value:function(e,t){var n=this;return function(){n.setState({product:t?0:e.id})}}},{key:"renderItem",value:function(e){var t=this,n=e.item,c=e.search,r=e.depth,o=void 0===r?0:r,i=e.isSelected,l=e.onSelect,s=this.state,u=s.product,d=s.variationsLoading,p=I()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(o),{"is-searching":c.length>0,"is-skip-level":0===o&&0!==n.parent,"is-variable":n.count>0}),b=Object.assign({},e);delete b.isSingle;var h={role:"menuitemradio"};return n.breadcrumbs.length&&(h["aria-label"]="".concat(n.breadcrumbs[0],": ").concat(n.name)),n.count&&(h["aria-expanded"]=n.id===u),n.breadcrumbs.length?(Object(S.isEmpty)(n.variation)||(n.name=n.variation),Object(w.createElement)(C.b,a()({className:p},e,h))):[Object(w.createElement)(P.MenuItem,a()({key:"product-".concat(n.id),isSelected:i},b,h,{className:p,onClick:function(){l(n)(),t.onProductSelect(n,i)()}}),Object(w.createElement)("span",{className:"woocommerce-search-list__item-state"},T(i)),Object(w.createElement)("span",{className:"woocommerce-search-list__item-label"},Object(w.createElement)("span",{className:"woocommerce-search-list__item-name",dangerouslySetInnerHTML:{__html:z(n.name,c)}})),n.count?Object(w.createElement)("span",{className:"woocommerce-search-list__item-variation-count"},Object(y.sprintf)(Object(y._n)("%d variation","%d variations",n.count,"woo-gutenberg-products-block"),n.count)):null),u===n.id&&n.count>0&&d&&Object(w.createElement)("div",{key:"loading",className:"woocommerce-search-list__item woocommerce-search-product__itemdepth-1 is-loading is-not-active"},Object(w.createElement)(P.Spinner,null))]}},{key:"render",value:function(){var e=this.state,t=e.products,n=e.loading,c=e.product,o=e.variationsList,a=this.props,i=a.onChange,l=a.renderItem,s=a.selected,u=o[c]||[],d=[].concat(r()(t),r()(u)),p={list:Object(y.__)("Products","woo-gutenberg-products-block"),noItems:Object(y.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(y.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(y.__)("Product search results updated.","woo-gutenberg-products-block")},b=s?[Object(S.find)(d,{id:s})]:[];return Object(w.createElement)(w.Fragment,null,Object(w.createElement)(C.a,{className:"woocommerce-products",list:d,isLoading:n,isSingle:!0,selected:b,onChange:i,renderItem:l||this.renderItem,onSearch:L.IS_LARGE_CATALOG?this.debouncedOnSearch:null,messages:p,isHierarchical:!0}))}}]),t}(w.Component);t.a=D}});
build/reviews-by-product.js CHANGED
@@ -1 +1 @@
1
- this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["reviews-by-product"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],l=t[2],d=0,b=[];d<i.length;d++)a=i[d],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&b.push(o[a][0]),o[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);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],n=!0,i=1;i<r.length;i++){var s=r[i];0!==o[s]&&(n=!1)}n&&(c.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={18:0},c=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var u=s;return c.push([547,2,1,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},114:function(e,t,r){},13:function(e,t){!function(){e.exports=this.React}()},14:function(e,t){!function(){e.exports=this.moment}()},17:function(e,t){!function(){e.exports=this.wp.apiFetch}()},18:function(e,t){!function(){e.exports=this.wp.editor}()},19:function(e,t){!function(){e.exports=this.wp.url}()},2:function(e,t){!function(){e.exports=this.wp.components}()},21:function(e,t){!function(){e.exports=this.wp.compose}()},23:function(e,t){!function(){e.exports=this.wp.blocks}()},24:function(e,t,r){"use strict";var n=r(0),o=r(2),c=function(e){var t=e.className,r=e.fillColor;return Object(n.createElement)(o.Icon,{className:t,icon:Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 22.41"},Object(n.createElement)("g",null,Object(n.createElement)("g",null,Object(n.createElement)("path",{fill:r,d:"M16.55 0H1.75C.56 0 0 .52 0 1.68v9.24c0 1.15.56 1.92 1.75 1.92H2V4.76a2.51 2.51 0 0 1 2.74-2.68H18v-.4A1.51 1.51 0 0 0 16.55 0z"}),Object(n.createElement)("path",{fill:r,d:"M19.54 3.11H4.74C3.55 3.11 3 3.64 3 4.79V14c0 1.19.55 2 1.74 2H5V7.88A2.51 2.51 0 0 1 7.73 5.2H21v-.41a1.51 1.51 0 0 0-1.46-1.68z"}),Object(n.createElement)("path",{fill:r,d:"M22.53 6.23H7.73C6.54 6.23 6 6.75 6 7.91v9.24c0 1.15.56 1.92 1.75 1.92h7a.59.59 0 0 1 .32.11l1.61 1.15 2.83 2a.31.31 0 0 0 .18.05.3.3 0 0 0 .31-.3v-2.73a.3.3 0 0 1 .28-.28h2.31A1.47 1.47 0 0 0 24 17.6V7.91a1.52 1.52 0 0 0-1.47-1.68z"}),Object(n.createElement)("path",{fill:"#ffffff",d:"M10.2 10.92l1.06-2.14 1.05 2.14 2.37.35-1.71 1.66.4 2.36-2.11-1.11-.17.09-.52.27-.51.26-.92.49.18-1.02.09-.57.1-.56.03-.21-1.71-1.66 2.37-.35zM21.46 14.25h-4.4a.69.69 0 0 1-.69-.69.68.68 0 0 1 .69-.68h4.4a.68.68 0 0 1 .69.68.69.69 0 0 1-.69.69zM21.46 11.19h-4.4a.69.69 0 1 1 0-1.37h4.4a.69.69 0 1 1 0 1.37z"}))))})},a=function(){return Object(n.createElement)(o.Icon,{icon:Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fillRule:"nonzero",d:"M21.913 7.0946H2.0254c-1.1708 0-2.0984.9908-2.0205 2.16l.741 11.0724c.0714 1.0638.9552 1.8892 2.0206 1.8892h18.4054c1.0654 0 1.9492-.8254 2.0205-1.8892l.7411-11.0724c.0779-1.1692-.8497-2.16-2.0205-2.16zm-8.8006-4.6573h5.987c1.119 0 2.0255.9065 2.0255 2.0254v.934H2.8103V2.0255C2.8103.9064 3.7168 0 4.8357 0h6.2513c1.119 0 2.0254.9065 2.0254 2.0254v.4119zm-7.0589 11.619a.926.926 0 1 1 0-1.852h11.8297a.926.926 0 1 1 0 1.852H6.0535z"}))})},i=function(){return Object(n.createElement)(o.Icon,{icon:Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M22 7.5H2c-1.2 0-2.1 1-2 2.2l.7 11.1c.1 1.1 1 1.9 2 1.9h18.5c1.1 0 2-.8 2-1.9L24 9.6c.1-1.1-.9-2.1-2-2.1zM13.1 2.8v-.4c0-1.1-.9-2-2-2H4.8c-1.1 0-2 .9-2 2v3.4h18.4v-1c0-1.1-.9-2-2-2h-6.1z"}),Object(n.createElement)("path",{fill:"#fff",d:"M14.4 18.7L12 17.4l-2.4 1.3.5-2.6-1.9-1.9 2.6-.4 1.2-2.4 1.2 2.4 2.6.4-1.9 1.9z"}))})},s=function(){return Object(n.createElement)(o.Icon,{className:"material-icon",icon:Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M0 0h24v24H0z",fill:"none"}),Object(n.createElement)("path",{d:"M23 12l-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-3.68L23 12zm-10 5h-2v-2h2v2zm0-4h-2V7h2v6z"}))})},l=function(){return Object(n.createElement)(o.Icon,{icon:Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"#1E8CBE",d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))})},u=function(){return Object(n.createElement)(o.Icon,{icon:Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"#6C7781",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))})},d=function(e){var t=e.className,r=e.fillColor;return Object(n.createElement)(o.Icon,{className:t,icon:Object(n.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)("path",{fill:r,d:"M2.3,17.3h9.3c0.1,0,0.3,0,0.4,0.1l5.9,4.2c0.3,0.2,0.7,0,0.7-0.3v-3.7c0-0.2,0.2-0.4,0.4-0.4H22 c1.1,0,2-0.9,2-2V2.5c0-1.2-0.7-2.2-2-2.2H2.3C0.7,0.2,0,0.9,0,2.5v12.3C0,16.3,0.7,17.3,2.3,17.3z"}),Object(n.createElement)("polygon",{fill:"#ffffff",points:"8.8,12.1 6.5,10.9 4.1,12.1 4.5,9.5 2.6,7.6 5.3,7.2 6.5,4.8 7.6,7.2 10.3,7.6 8.4,9.5"}),Object(n.createElement)("path",{fill:"#ffffff",d:"M20.7,7.9h-7c-0.5,0-0.9-0.4-0.9-0.9S13.2,6,13.7,6h7c0.5,0,0.9,0.4,0.9,0.9S21.2,7.9,20.7,7.9z"}),Object(n.createElement)("path",{fill:"#ffffff",d:"M20.7,11.5h-7c-0.5,0-0.9-0.4-0.9-0.9s0.4-0.9,0.9-0.9h7c0.5,0,0.9,0.4,0.9,0.9S21.2,11.5,20.7,11.5z"}))})},b=function(e){var t=e.className,r=e.fillColor;return Object(n.createElement)(o.Icon,{className:t,icon:Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 23"},Object(n.createElement)("path",{fill:r,d:"M21.9943 7.0957H2.00638C0.807102 7.0957 -0.0923543 8.0951 0.0075853 9.29437L0.707162 20.3877C0.807102 21.487 1.70656 22.2865 2.70595 22.2865H21.1948C22.2941 22.2865 23.1936 21.487 23.1936 20.3877L23.9931 9.29437C24.093 8.0951 23.0936 7.0957 21.9943 7.0957Z"}),Object(n.createElement)("path",{fill:r,d:"M13.0921 2.39855V1.99879C13.0921 0.899456 12.1926 0 11.0933 0H4.7971C3.69777 0 2.79831 0.899456 2.79831 1.99879V5.39674H21.1872V4.49728C21.1872 3.39795 20.2877 2.49849 19.1884 2.49849H13.0921V2.39855Z"}),Object(n.createElement)("path",{fill:"white",d:"M8.63115 17.126L6.5415 15.9449L4.361 17.126L4.72442 14.6729L2.99819 13.0376L5.45125 12.6742L6.5415 10.4937L7.5409 12.6742L9.99396 13.0376L8.26773 14.6729L8.63115 17.126Z"}),Object(n.createElement)("path",{fill:"white",d:"M19.1907 13.5918H12.9899C12.547 13.5918 12.1926 13.1921 12.1926 12.6924C12.1926 12.1927 12.547 11.7929 12.9899 11.7929H19.1907C19.6336 11.7929 19.9879 12.1927 19.9879 12.6924C19.9879 13.1921 19.6336 13.5918 19.1907 13.5918Z"}),Object(n.createElement)("path",{fill:"white",d:"M19.1907 17.1897H12.9899C12.547 17.1897 12.1926 16.7899 12.1926 16.2902C12.1926 15.7905 12.547 15.3907 12.9899 15.3907H19.1907C19.6336 15.3907 19.9879 15.7905 19.9879 16.2902C19.9879 16.7899 19.6336 17.1897 19.1907 17.1897Z"}))})},p=function(){return Object(n.createElement)(o.Icon,{className:"material-icon",icon:Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M13 13v8h8v-8h-8zM3 21h8v-8H3v8zM3 3v8h8V3H3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66-5.66-5.65z"}),Object(n.createElement)("path",{d:"M0 0h24v24H0z",fill:"none"}))})},h=r(6),m=r.n(h),v=(r(7),function(e){var t=e.size,r=void 0===t?20:t,c=e.className;return Object(n.createElement)(o.Icon,{className:m()("woo-icon",c),icon:Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",height:r,width:Math.floor(1.67*r),viewBox:"0 0 245 145"},Object(n.createElement)("path",{fill:"#96588A",d:"M22.76 0h199.1a22.77 22.77 0 0 1 22.8 22.76v75.92a22.77 22.77 0 0 1-22.78 22.78h-71.41l9.77 24-43.13-24H22.76C10.1946 121.449.011 111.2654 0 98.7V22.76C.011 10.1946 10.1946.011 22.76 0z"}),Object(n.createElement)("path",{fill:"#FFF",fillRule:"nonzero",d:"M12.32 20.63a8.16 8.16 0 0 1 6.25-3.09c5.0733-.36 7.9867 2.0333 8.74 7.18 3.14 20.86 6.4933 38.5633 10.06 53.11l21.92-41.69c2-3.76 4.49-5.76 7.52-6 4.3867-.3067 7.13 2.49 8.23 8.39a186 186 0 0 0 9.47 34.23c2.62-25.38 7.0133-43.7133 13.18-55a7.73 7.73 0 0 1 6.6-4.43 8.8 8.8 0 0 1 6.32 2 7.75 7.75 0 0 1 3.05 5.74 8.52 8.52 0 0 1-1 4.77c-3.9 7.24-7.12 19.28-9.66 36.12-2.48 16.2533-3.3967 28.9633-2.75 38.13a12.25 12.25 0 0 1-1.16 6.56 6.32 6.32 0 0 1-5.33 3.53c-2.6667.18-5.3033-1.0567-7.91-3.71-9.2933-9.54-16.6567-23.7267-22.09-42.56C57.3 76.7167 52.48 86.3333 49.3 92.76c-5.86 11.3333-10.89 17.13-15.09 17.39-2.7333.1933-5.0667-2.0933-7-6.86-5.1-13.0933-10.5833-38.4033-16.45-75.93a8.56 8.56 0 0 1 1.56-6.73zM227.23 36.34a23.17 23.17 0 0 0-16-11.59 26.25 26.25 0 0 0-5.42-.58c-9.5867 0-17.41 5-23.47 15a53 53 0 0 0-7.78 28.16c0 7.7333 1.6167 14.3333 4.85 19.8a23.15 23.15 0 0 0 16 11.59 26.28 26.28 0 0 0 5.42.59c9.68 0 17.5033-5 23.47-15A53.89 53.89 0 0 0 232.08 56c0-7.7333-1.6167-14.2867-4.85-19.66zm-12.61 27.72c-1.3733 6.56-3.9167 11.5-7.63 14.82-2.9267 2.6667-5.6133 3.7433-8.06 3.23-2.4467-.5133-4.4033-2.6667-5.87-6.46a25.68 25.68 0 0 1-1.76-9.09 35.9 35.9 0 0 1 .73-7.34 33 33 0 0 1 5.28-11.88c3.3333-4.8933 6.8067-6.9467 10.42-6.16 2.44.4867 4.3933 2.64 5.86 6.46a25.68 25.68 0 0 1 1.76 9.12 35.73 35.73 0 0 1-.73 7.33v-.03zM164.57 36.34a23.2 23.2 0 0 0-16-11.59 26.42 26.42 0 0 0-5.43-.58c-9.5933 0-17.4167 5-23.47 15a53 53 0 0 0-7.78 28.16c0 7.7333 1.6133 14.3333 4.84 19.8a23.19 23.19 0 0 0 16 11.59 26.44 26.44 0 0 0 5.43.59c9.68 0 17.5033-5 23.47-15A53.88 53.88 0 0 0 169.4 56c0-7.7333-1.6133-14.2867-4.84-19.66h.01zm-12.61 27.72c-1.3667 6.56-3.91 11.5-7.63 14.82-2.93 2.64-5.63 3.72-8.07 3.23-2.44-.49-4.4-2.64-5.86-6.46a25.7 25.7 0 0 1-1.77-9.09 35.9 35.9 0 0 1 .74-7.34 33 33 0 0 1 5.28-11.88c3.3333-4.8933 6.8067-6.9467 10.42-6.16 2.44.4867 4.3933 2.64 5.86 6.46a25.91 25.91 0 0 1 1.76 9.12 35.73 35.73 0 0 1-.73 7.33v-.03z"}))})});r.d(t,"a",function(){return c}),r.d(t,"b",function(){return a}),r.d(t,"c",function(){return i}),r.d(t,"d",function(){return s}),r.d(t,"e",function(){return l}),r.d(t,"f",function(){return u}),r.d(t,"h",function(){return d}),r.d(t,"g",function(){return b}),r.d(t,"i",function(){return p}),r.d(t,"j",function(){return v})},25:function(e,t,r){"use strict";r.d(t,"d",function(){return b}),r.d(t,"b",function(){return p}),r.d(t,"c",function(){return h}),r.d(t,"a",function(){return m});var n=r(20),o=r.n(n),c=r(19),a=r(17),i=r.n(a),s=r(4),l=r(5);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(r,!0).forEach(function(t){o()(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var b=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=void 0===n?"":n,a=e.queryArgs,u=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=void 0===n?"":n,a=e.queryArgs,i=void 0===a?[]:a,s={per_page:l.IS_LARGE_CATALOG?100:-1,catalog_visibility:"any",status:"publish",search:o,orderby:"title",order:"asc"},u=[Object(c.addQueryArgs)(l.ENDPOINTS.products,d({},s,{},i))];return l.IS_LARGE_CATALOG&&r.length&&u.push(Object(c.addQueryArgs)(l.ENDPOINTS.products,{catalog_visibility:"any",status:"publish",include:r})),u}({selected:r,search:o,queryArgs:void 0===a?[]:a});return Promise.all(u.map(function(e){return i()({path:e})})).then(function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")})},p=function(e){return i()({path:"".concat(l.ENDPOINTS.products,"/").concat(e)})},h=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=[Object(c.addQueryArgs)("".concat(l.ENDPOINTS.products,"/tags"),{per_page:l.LIMIT_TAGS?100:-1,orderby:l.LIMIT_TAGS?"count":"name",order:l.LIMIT_TAGS?"desc":"asc",search:n})];return l.LIMIT_TAGS&&r.length&&o.push(Object(c.addQueryArgs)("".concat(l.ENDPOINTS.products,"/tags"),{include:r})),o}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map(function(e){return i()({path:e})})).then(function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")})},m=function(e){return i()({path:"".concat(l.ENDPOINTS.categories,"/").concat(e)})}},33:function(e,t){!function(){e.exports=this.wp.keycodes}()},39:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},4:function(e,t){!function(){e.exports=this.lodash}()},40:function(e,t,r){"use strict";r.d(t,"b",function(){return s}),r.d(t,"c",function(){return l}),r.d(t,"a",function(){return u});var n=r(17),o=r.n(n),c=r(6),a=r.n(c),i=r(5),s=function(e){if(i.ENABLE_REVIEW_RATING){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=function(e){return o()({path:"/wc/blocks/products/reviews?"+Object.entries(e).map(function(e){return e.join("=")}).join("&"),parse:!1}).then(function(e){return e.json().then(function(t){return{reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}})})},u=function(e,t){var r=t.className,n=t.showReviewDate,o=t.showReviewerName,c=t.showReviewContent,i=t.showProductName,s=t.showReviewImage,l=t.showReviewRating;return a()(e,r,{"has-image":s,"has-name":o,"has-date":n,"has-rating":l,"has-content":c,"has-product-name":i})}},44:function(e,t){!function(){e.exports=this.ReactDOM}()},47:function(e,t){!function(){e.exports=this.wp.viewport}()},5:function(e,t){!function(){e.exports=this.wc["wc-block-settings"]}()},51:function(e,t){!function(){e.exports=this.wp.hooks}()},52:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(7),r(29)),a=r.n(c),i=r(6),s=r.n(i),l=r(39),u=r(2);t.a=function(e){var t,r,c=e.className,i=e.error,d=e.isLoading,b=e.onRetry;return Object(n.createElement)(u.Placeholder,{icon:Object(n.createElement)(a.a,{icon:"notice"}),label:Object(o.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:s()("wc-block-api-error",c)},Object(n.createElement)("div",{className:"wc-block-error__message"},(r=(t=i).apiMessage,t.message||(r?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(l.escapeHTML)(r))):Object(o.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))),b&&Object(n.createElement)(n.Fragment,null,d?Object(n.createElement)(u.Spinner,null):Object(n.createElement)(u.Button,{isDefault:!0,onClick:b},Object(o.__)("Retry","woo-gutenberg-products-block"))))}},53:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},54:function(e,t){!function(){e.exports=this.wp.date}()},547:function(e,t,r){"use strict";r.r(t);var n=r(20),o=r.n(n),c=r(0),a=r(1),i=r(23),s=(r(77),r(16)),l=r.n(s),u=r(18),d=r(2),b=r(26),p=(r(7),r(99)),h=r(24),m=r(81),v=r(52),g=r(71),w=Object(g.b)(function(e){var t=e.error,r=e.getProduct,n=e.isLoading,o=e.product;if(t)return Object(c.createElement)(v.a,{className:"wc-block-featured-product-error",error:t,isLoading:n,onRetry:r});var i=!o||n?Object(c.createElement)(d.Spinner,null):Object(a.sprintf)(Object(a.__)("This block lists reviews for a selected product. %s doesn't have any reviews yet, but they will show up here when it does.","woo-gutenberg-products-block"),o.name);return Object(c.createElement)(d.Placeholder,{className:"wc-block-reviews-by-product",icon:Object(c.createElement)(h.h,{className:"block-editor-block-icon"}),label:Object(a.__)("Reviews by Product","woo-gutenberg-products-block")},i)}),f=r(63),O=Object(d.withSpokenMessages)(function(e){var t=e.attributes,r=e.debouncedSpeak,n=e.setAttributes,o=t.editMode,i=t.productId,s=function(e){var t=e.item,r=void 0===t?0:t;return Object(c.createElement)(b.b,l()({},e,{countLabel:Object(a.sprintf)(Object(a._n)("%d Review","%d Reviews",r.review_count,"woo-gutenberg-products-block"),r.review_count),showCount:!0,"aria-label":Object(a.sprintf)(Object(a._n)("%s, has %d review","%s, has %d reviews",r.review_count,"woo-gutenberg-products-block"),r.name,r.review_count)}))};return!i||o?Object(c.createElement)(d.Placeholder,{icon:Object(c.createElement)(h.h,{className:"block-editor-block-icon"}),label:Object(a.__)("Reviews by Product","woo-gutenberg-products-block")},Object(a.__)("Show reviews of your product to build trust","woo-gutenberg-products-block"),Object(c.createElement)("div",{className:"wc-block-reviews__selection"},Object(c.createElement)(p.a,{selected:t.productId||0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e[0]?e[0].id:0;n({productId:t})},queryArgs:{orderby:"comment_count",order:"desc"},renderItem:s}),Object(c.createElement)(d.Button,{isDefault:!0,onClick:function(){n({editMode:!1}),r(Object(a.__)("Showing Reviews by Product block preview.","woo-gutenberg-products-block"))}},Object(a.__)("Done","woo-gutenberg-products-block")))):Object(c.createElement)(c.Fragment,null,Object(f.a)(o,n),Object(c.createElement)(u.InspectorControls,{key:"inspector"},Object(c.createElement)(d.PanelBody,{title:Object(a.__)("Product","woo-gutenberg-products-block"),initialOpen:!1},Object(c.createElement)(p.a,{selected:t.productId||0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e[0]?e[0].id:0;n({productId:t})},renderItem:s})),Object(c.createElement)(d.PanelBody,{title:Object(a.__)("Content","woo-gutenberg-products-block")},Object(f.b)(t,n)),Object(c.createElement)(d.PanelBody,{title:Object(a.__)("List Settings","woo-gutenberg-products-block")},Object(f.c)(t,n))),Object(c.createElement)(m.a,{attributes:t,className:"wc-block-all-reviews",icon:Object(c.createElement)(h.h,{className:"block-editor-block-icon"}),name:Object(a.__)("Reviews by Product","woo-gutenberg-products-block"),noReviewsPlaceholder:w}))}),j=r(79),y=r(80);function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}Object(i.registerBlockType)("woocommerce/reviews-by-product",{title:Object(a.__)("Reviews by Product","woo-gutenberg-products-block"),icon:Object(c.createElement)(h.h,{fillColor:"#96588a"}),category:"woocommerce",keywords:[Object(a.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(a.__)("Show reviews of your product to build trust.","woo-gutenberg-products-block"),attributes:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(r,!0).forEach(function(t){o()(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},j.a,{productId:{type:"number"}}),edit:function(e){return Object(c.createElement)(O,e)},save:y.a})},61:function(e,t){!function(){e.exports=this.wp.dom}()},63:function(e,t,r){"use strict";r.d(t,"a",function(){return d}),r.d(t,"b",function(){return b}),r.d(t,"c",function(){return p});var n=r(0),o=r(1),c=r(39),a=r(2),i=r(18),s=r(74),l=r(5),u=r(70),d=function(e,t){return Object(n.createElement)(i.BlockControls,null,Object(n.createElement)(a.Toolbar,{controls:[{icon:"edit",title:Object(o.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return t({editMode:!e})},isActive:e}]}))},b=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:function(){return t({showReviewRating:!e.showReviewRating})}}),e.showReviewRating&&!l.ENABLE_REVIEW_RATING&&Object(n.createElement)(a.Notice,{className:"wc-block-reviews__notice",isDismissible:!1},Object(n.createElement)(n.RawHTML,null,Object(o.sprintf)(Object(c.escapeHTML)(Object(o.__)("Product rating is disabled in your %sstore settings%s.","woo-gutenberg-products-block")),'<a href="'.concat(Object(s.a)("admin.php?page=wc-settings&tab=products"),'" target="_blank">'),"</a>"))),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:function(){return t({showReviewerName:!e.showReviewerName})}}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:function(){return t({showReviewImage:!e.showReviewImage})}}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:function(){return t({showReviewDate:!e.showReviewDate})}}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:function(){return t({showReviewContent:!e.showReviewContent})}}),e.showReviewImage&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(u.a,{label:Object(o.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,options:[{label:Object(o.__)("Reviewer photo","woo-gutenberg-products-block"),value:"reviewer"},{label:Object(o.__)("Product","woo-gutenberg-products-block"),value:"product"}],onChange:function(e){return t({imageType:e})}}),"reviewer"===e.imageType&&!l.SHOW_AVATARS&&Object(n.createElement)(a.Notice,{className:"wc-block-reviews__notice",isDismissible:!1},Object(n.createElement)(n.RawHTML,null,Object(o.sprintf)(Object(c.escapeHTML)(Object(o.__)("Reviewer photo is disabled in your %ssite settings%s.","woo-gutenberg-products-block")),'<a href="'.concat(Object(s.a)("options-discussion.php"),'" target="_blank">'),"</a>")))))},p=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:function(){return t({showOrderby:!e.showOrderby})}}),Object(n.createElement)(a.SelectControl,{label:Object(o.__)("Order Product Reviews by","woo-gutenberg-products-block"),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:function(e){return t({orderby:e})}}),Object(n.createElement)(a.RangeControl,{label:Object(o.__)("Starting Number of Reviews","woo-gutenberg-products-block"),value:e.reviewsOnPageLoad,onChange:function(e){return t({reviewsOnPageLoad:e})},max:20,min:1}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Load more","woo-gutenberg-products-block"),checked:e.showLoadMore,onChange:function(){return t({showLoadMore:!e.showLoadMore})}}),e.showLoadMore&&Object(n.createElement)(a.RangeControl,{label:Object(o.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:function(e){return t({reviewsOnLoadMore:e})},max:20,min:1}))}},64:function(e,t){},65:function(e,t){},67:function(e,t){},68:function(e,t){},69:function(e,t,r){"use strict";var n=r(16),o=r.n(n),c=r(8),a=r.n(c),i=r(9),s=r.n(i),l=r(10),u=r.n(l),d=r(11),b=r.n(d),p=r(12),h=r.n(p),m=r(0),v=r(13),g=[];t.a=function(e){return function(t){function r(){return a()(this,r),u()(this,b()(r).apply(this,arguments))}return h()(r,t),s()(r,[{key:"generateUniqueID",value:function(){var e=r.name;return g[e]||(g[e]=0),g[e]++,g[e]}},{key:"render",value:function(){var t=this.generateUniqueID();return Object(m.createElement)(e,o()({},this.props,{componentId:t}))}}]),r}(v.Component)}},70:function(e,t,r){"use strict";var n=r(16),o=r.n(n),c=r(8),a=r.n(c),i=r(9),s=r.n(i),l=r(10),u=r.n(l),d=r(11),b=r.n(d),p=r(15),h=r.n(p),m=r(12),v=r.n(m),g=r(0),w=r(4),f=r(6),O=r.n(f),j=r(2),y=r(21),_=(r(132),function(e){function t(){var e;return a()(this,t),(e=u()(this,b()(t).apply(this,arguments))).onClick=e.onClick.bind(h()(e)),e}return v()(t,e),s()(t,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,c=r.checked,a=r.instanceId,i=r.className,s=r.help,l=r.options,u=r.value,d="inspector-toggle-button-control-".concat(a);return s&&(e=Object(w.isFunction)(s)?s(c):s),Object(g.createElement)(j.BaseControl,{id:d,help:e,className:O()("components-toggle-button-control",i)},Object(g.createElement)("label",{id:d+"__label",htmlFor:d,className:"components-toggle-button-control__label"},n),Object(g.createElement)(j.ButtonGroup,{"aria-labelledby":d+"__label"},l.map(function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isDefault=!0,c["aria-pressed"]=!1),Object(g.createElement)(j.Button,o()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},c),e.label)})))}}]),t}(g.Component));t.a=Object(y.withInstanceId)(_)},71:function(e,t,r){"use strict";var n=r(16),o=r.n(n),c=r(38),a=r.n(c),i=r(8),s=r.n(i),l=r(9),u=r.n(l),d=r(10),b=r.n(d),p=r(11),h=r.n(p),m=r(15),v=r.n(m),g=r(12),w=r.n(g),f=r(0),O=r(21),j=r(25),y=Object(O.createHigherOrderComponent)(function(e){return function(t){function r(){var e;return s()(this,r),(e=b()(this,h()(r).apply(this,arguments))).state={error:null,loading:!1,product:null},e.loadProduct=e.loadProduct.bind(v()(e)),e}return w()(r,t),u()(r,[{key:"componentDidMount",value:function(){this.loadProduct()}},{key:"componentDidUpdate",value:function(e){e.attributes.productId!==this.props.attributes.productId&&this.loadProduct()}},{key:"loadProduct",value:function(){var e=this,t=this.props.attributes.productId;t?(this.setState({loading:!0}),Object(j.b)(t).then(function(t){e.setState({product:t,loading:!1,error:null})}).catch(function(t){var r="object"===a()(t)&&t.hasOwnProperty("message")?{apiMessage:t.message}:{apiMessage:null};e.setState({product:null,loading:!1,error:r})})):this.setState({product:null,loading:!1,error:null})}},{key:"render",value:function(){var t=this.state,r=t.error,n=t.loading,c=t.product;return Object(f.createElement)(e,o()({},this.props,{error:r,getProduct:this.loadProduct,isLoading:n,product:c}))}}]),r}(f.Component)},"withProduct"),_=Object(O.createHigherOrderComponent)(function(e){return function(t){function r(){var e;return s()(this,r),(e=b()(this,h()(r).apply(this,arguments))).state={error:null,loading:!1,category:null},e.loadCategory=e.loadCategory.bind(v()(e)),e}return w()(r,t),u()(r,[{key:"componentDidMount",value:function(){this.loadCategory()}},{key:"componentDidUpdate",value:function(e){e.attributes.categoryId!==this.props.attributes.categoryId&&this.loadCategory()}},{key:"loadCategory",value:function(){var e=this,t=this.props.attributes.categoryId;t?(this.setState({loading:!0}),Object(j.a)(t).then(function(t){e.setState({category:t,loading:!1,error:null})}).catch(function(t){var r="object"===a()(t)&&t.hasOwnProperty("message")?{apiMessage:t.message}:{apiMessage:null};e.setState({category:null,loading:!1,error:r})})):this.setState({category:null,loading:!1,error:null})}},{key:"render",value:function(){var t=this.state,r=t.error,n=t.loading,c=t.category;return Object(f.createElement)(e,o()({},this.props,{error:r,getCategory:this.loadCategory,isLoading:n,category:c}))}}]),r}(f.Component)},"withCategory"),E=r(4),k=(r(7),r(5)),R=Object(O.createHigherOrderComponent)(function(e){var t=function(t){function r(){var e;return s()(this,r),(e=b()(this,h()(r).apply(this,arguments))).state={list:[],loading:!0},e.debouncedOnSearch=Object(E.debounce)(e.onSearch.bind(v()(e)),400),e}return w()(r,t),u()(r,[{key:"componentDidMount",value:function(){var e=this,t=this.props.selected;Object(j.d)({selected:t}).then(function(t){e.setState({list:t,loading:!1})}).catch(function(){e.setState({list:[],loading:!1})})}},{key:"componentWillUnmount",value:function(){this.debouncedOnSearch.cancel()}},{key:"onSearch",value:function(e){var t=this,r=this.props.selected;Object(j.d)({selected:r,search:e}).then(function(e){t.setState({list:e,loading:!1})}).catch(function(){t.setState({list:[],loading:!1})})}},{key:"render",value:function(){var t=this.state,r=t.list,n=t.loading,c=this.props.selected;return Object(f.createElement)(e,o()({},this.props,{products:r,isLoading:n,selected:r.filter(function(e){var t=e.id;return c.includes(t)}),onSearch:k.IS_LARGE_CATALOG?this.debouncedOnSearch:null}))}}]),r}(f.Component);return t.defaultProps={selected:[]},t},"withSearchedProducts");r.d(t,"b",function(){return y}),r.d(t,"a",function(){return _}),r.d(t,"c",function(){return R})},77:function(e,t,r){var n=r(114);"string"==typeof n&&(n=[[e.i,n,""]]);var o={insert:"head",singleton:!1};r(35)(n,o);n.locals&&(e.exports=n.locals)},78:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},79: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}}},80:function(e,t,r){"use strict";var n=r(16),o=r.n(n),c=r(0),a=(r(77),r(40));t.a=function(e){var t=e.attributes,r=t.categoryIds,n=t.imageType,i=t.orderby,s=t.productId,l={"data-image-type":n,"data-orderby":i,"data-reviews-on-page-load":t.reviewsOnPageLoad,"data-reviews-on-load-more":t.reviewsOnLoadMore,"data-show-load-more":t.showLoadMore,"data-show-orderby":t.showOrderby},u="wc-block-all-reviews";return s&&(l["data-product-id"]=s,u="wc-block-reviews-by-product"),Array.isArray(r)&&(l["data-category-ids"]=r.join(","),u="wc-block-reviews-by-category"),Object(c.createElement)("div",o()({className:Object(a.a)(u,t)},l))}},81:function(e,t,r){"use strict";var n=r(8),o=r.n(n),c=r(9),a=r.n(c),i=r(10),s=r.n(i),l=r(11),u=r.n(l),d=r(12),b=r.n(d),p=r(0),h=r(1),m=r(13),v=(r(7),r(4)),g=r(2),w=r(5),f=r(52),O=r(20),j=r.n(O),y=r(6),_=r.n(y);function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var k=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,c=e.wrapperProps;return!r&&n?(t=o||"span",c=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(r,!0).forEach(function(t){j()(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},c,{className:_()(c.className,"screen-reader-text")}),Object(p.createElement)(t,c,n)):(t=o||m.Fragment,r&&n&&r!==n?Object(p.createElement)(t,c,Object(p.createElement)("span",{"aria-hidden":!0},r),Object(p.createElement)("span",{className:"screen-reader-text"},n)):Object(p.createElement)(t,c,r))};k.defaultProps={wrapperProps:{}};var R=k,C=(r(170),function(e){var t=e.onClick,r=e.label,n=e.screenReaderLabel;return Object(p.createElement)("div",{className:"wp-block-button wc-block-load-more"},Object(p.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(p.createElement)(R,{label:r,screenReaderLabel:n})))});C.defaultProps={label:Object(h.__)("Load more","woo-gutenberg-products-block")};var P=C,S=r(15),N=r.n(S),L=r(100),I=r.n(L),M=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=I()(e,{suffix:r,limit:t});return n.html},x=function(e,t,r,n){var o=T(e,t,r);return M(e,o-n.length,n)},T=function(e,t,r){for(var n={start:0,middle:0,end:e.length};n.start<=n.end;)n.middle=Math.floor((n.start+n.end)/2),t.innerHTML=M(e,n.middle),n=A(n,t.clientHeight,r);return n.middle},A=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e},D=function(e){function t(e){var r;return o()(this,t),(r=s()(this,u()(t).apply(this,arguments))).state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},r.reviewSummary=Object(m.createRef)(),r.reviewContent=Object(m.createRef)(),r.getButton=r.getButton.bind(N()(r)),r.onClick=r.onClick.bind(N()(r)),r}return b()(t,e),a()(t,[{key:"componentDidMount",value:function(){if(this.props.children){var e=this.props,t=e.maxLines,r=e.ellipsis,n=(this.reviewSummary.current.clientHeight+1)*t+1,o=this.reviewContent.current.clientHeight+1>n;this.setState({clampEnabled:o}),o&&this.setState({summary:x(this.reviewContent.current.innerHTML,this.reviewSummary.current,n,r)})}}},{key:"getButton",value:function(){var e=this.state.isExpanded,t=this.props,r=t.className,n=t.lessText,o=t.moreText,c=e?n:o;if(c)return Object(p.createElement)("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}},{key:"onClick",value:function(e){e.preventDefault();var t=this.state.isExpanded;this.setState({isExpanded:!t})}},{key:"render",value:function(){var e=this.props.className,t=this.state,r=t.content,n=t.summary,o=t.clampEnabled,c=t.isExpanded;return r?!1===o?Object(p.createElement)("div",{className:e},Object(p.createElement)("div",{ref:this.reviewContent},r)):Object(p.createElement)("div",{className:e},(!c||null===o)&&Object(p.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:n}}),(c||null===o)&&Object(p.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},r),this.getButton()):null}}]),t}(m.Component);D.defaultProps={maxLines:3,ellipsis:"&hellip;",moreText:Object(h.__)("Read more","woo-gutenberg-products-block"),lessText:Object(h.__)("Read less","woo-gutenberg-products-block"),className:"read-more-content"};var H=D;r(171);var z=function(e){var t=e.attributes,r=e.review,n=void 0===r?{}:r,o=t.imageType,c=t.showReviewDate,a=t.showReviewerName,i=t.showReviewImage,s=t.showReviewRating,l=t.showReviewContent,u=t.showProductName,d=n.rating,b=!Object.keys(n).length>0,m=Number.isFinite(d)&&s;return Object(p.createElement)("li",{className:_()("wc-block-review-list-item__item",{"is-loading":b}),"aria-hidden":b},(u||c||a||i||m)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__info"},i&&function(e,t,r){return r||!e?Object(p.createElement)("div",{className:"wc-block-review-list-item__image",width:"48",height:"48"}):Object(p.createElement)("div",{className:"wc-block-review-list-item__image"},"product"===t?Object(p.createElement)("img",{"aria-hidden":"true",alt:"",src:e.product_picture||"",className:"wc-block-review-list-item__image",width:"48",height:"48"}):Object(p.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[48]||"",srcSet:e.reviewer_avatar_urls[96]+" 2x",className:"wc-block-review-list-item__image",width:"48",height:"48"}),e.verified&&Object(p.createElement)("div",{className:"wc-block-review-list-item__verified",title:Object(h.__)("Verified buyer","woo-gutenberg-products-block")},Object(h.__)("Verified buyer","woo-gutenberg-products-block")))}(n,o,b),(u||a||m||c)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__meta"},m&&function(e){var t=e.rating,r={width:t/5*100+"%"};return Object(p.createElement)("div",{className:"wc-block-review-list-item__rating"},Object(p.createElement)("div",{className:"wc-block-review-list-item__rating__stars",role:"img"},Object(p.createElement)("span",{style:r},Object(h.sprintf)(Object(h.__)("Rated %d out of 5","woo-gutenberg-products-block"),t))))}(n),u&&function(e){return Object(p.createElement)("div",{className:"wc-block-review-list-item__product"},Object(p.createElement)("a",{href:e.product_permalink},e.product_name))}(n),a&&function(e){var t=e.reviewer,r=void 0===t?"":t;return Object(p.createElement)("div",{className:"wc-block-review-list-item__author"},r)}(n),c&&function(e){var t=e.date_created,r=e.formatted_date_created;return Object(p.createElement)("time",{className:"wc-block-review-list-item__published-date",dateTime:t},r)}(n))),l&&function(e){return Object(p.createElement)(H,{maxLines:10,moreText:Object(h.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(h.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text"},Object(p.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(n))};r(172);function B(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var V=function(e){var t=e.attributes,r=e.reviews,n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?B(r,!0).forEach(function(t){j()(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},t,{showReviewImage:(w.SHOW_AVATARS||"product"===t.imageType)&&t.showReviewImage,showReviewRating:w.ENABLE_REVIEW_RATING&&t.showReviewRating});return Object(p.createElement)("ul",{className:"wc-block-review-list"},0===r.length?Object(p.createElement)(z,{attributes:n}):r.map(function(e,t){return Object(p.createElement)(z,{key:e.id||t,attributes:n,review:e})}))},G=r(69),F=(r(173),Object(G.a)(function(e){var t=e.className,r=e.componentId,n=e.defaultValue,o=e.label,c=e.onChange,a=e.options,i=e.screenReaderLabel,s=e.readOnly,l=e.value,u="wc-block-order-select__select-".concat(r);return Object(p.createElement)("p",{className:_()("wc-block-order-select",t)},Object(p.createElement)(R,{label:o,screenReaderLabel:i,wrapperElement:"label",wrapperProps:{className:"wc-block-order-select__label",htmlFor:u}}),Object(p.createElement)("select",{id:u,className:"wc-block-order-select__select",defaultValue:n,onChange:c,readOnly:s,value:l},a.map(function(e){return Object(p.createElement)("option",{key:e.key,value:e.key},e.label)})))})),q=(r(174),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,o=e.value;return Object(p.createElement)(F,{className:"wc-block-review-order-select",defaultValue:t,label:Object(h.__)("Order by","woo-gutenberg-products-block"),onChange:r,options:[{key:"most-recent",label:Object(h.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(h.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(h.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(h.__)("Order reviews by","woo-gutenberg-products-block"),value:o})}),W=r(16),U=r.n(W),Q=r(38),Z=r.n(Q),J=r(78),Y=r.n(J),$=r(40),K=function(e){var t=function(t){function r(){var e;return o()(this,r),(e=s()(this,u()(r).apply(this,arguments))).state={error:null,loading:!0,reviews:[],totalReviews:0},e.setError=e.setError.bind(N()(e)),e.delayedAppendReviews=e.props.delayFunction(e.appendReviews),e}return b()(r,t),a()(r,[{key:"componentDidMount",value:function(){this.replaceReviews()}},{key:"componentDidUpdate",value:function(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}},{key:"shouldReplaceReviews",value:function(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!Y()(e.categoryIds,t.categoryIds)}},{key:"componentWillUnMount",value:function(){this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}},{key:"getArgs",value:function(e){var t=this.props,r=t.categoryIds,n=t.order,o=t.orderby,c=t.productId,a={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(a.category_id=Array.isArray(r)?r.join(","):r),c&&(a.product_id=c),a}},{key:"replaceReviews",value:function(){var e=this.props.onReviewsReplaced;this.updateListOfReviews().then(e)}},{key:"appendReviews",value:function(){var e=this.props,t=e.onReviewsAppended,r=e.reviewsToDisplay,n=this.state.reviews;r<=n.length||this.updateListOfReviews(n).then(t)}},{key:"updateListOfReviews",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.props.reviewsToDisplay,n=this.state.totalReviews,o=Math.min(n,r)-t.length;return this.setState({loading:!0,reviews:t.concat(Array(o).fill({}))}),Object($.c)(this.getArgs(t.length)).then(function(r){var n=r.reviews,o=r.totalReviews;return e.setState({reviews:t.filter(function(e){return Object.keys(e).length}).concat(n),totalReviews:o,loading:!1,error:null}),{newReviews:n}}).catch(this.setError)}},{key:"setError",value:function(e){var t=this;e.json().then(function(e){var r=t.props.onReviewsLoadError,n="object"===Z()(e)&&e.hasOwnProperty("message")?{apiMessage:e.message}:{apiMessage:null};t.setState({reviews:[],loading:!1,error:n}),r()})}},{key:"render",value:function(){var t=this.props.reviewsToDisplay,r=this.state,n=r.error,o=r.loading,c=r.reviews,a=r.totalReviews;return Object(p.createElement)(e,U()({},this.props,{error:n,isLoading:o,reviews:c.slice(0,t),totalReviews:a}))}}]),r}(m.Component);t.defaultProps={delayFunction:function(e){return e},onReviewsAppended:function(){},onReviewsLoadError:function(){},onReviewsReplaced:function(){}};var r=e.displayName,n=void 0===r?e.name||"Component":r;return t.displayName="WithReviews( ".concat(n," )"),t}(function(e){function t(){return o()(this,t),s()(this,u()(t).apply(this,arguments))}return b()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.error,n=e.isLoading,o=e.noReviewsPlaceholder,c=e.reviews,a=e.totalReviews;return r?Object(p.createElement)(f.a,{className:"wc-block-featured-product-error",error:r,isLoading:n}):0!==c.length||n?Object(p.createElement)(g.Disabled,null,t.showOrderby&&w.ENABLE_REVIEW_RATING&&Object(p.createElement)(q,{readOnly:!0,value:t.orderby}),Object(p.createElement)(V,{attributes:t,reviews:c}),t.showLoadMore&&a>c.length&&Object(p.createElement)(P,{screenReaderLabel:Object(h.__)("Load more reviews","woo-gutenberg-products-block")})):Object(p.createElement)(o,{attributes:t})}}]),t}(m.Component)),X=function(e){function t(){return o()(this,t),s()(this,u()(t).apply(this,arguments))}return b()(t,e),a()(t,[{key:"renderHiddenContentPlaceholder",value:function(){var e=this.props,t=e.icon,r=e.name;return Object(p.createElement)(g.Placeholder,{icon:t,label:r},Object(h.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))}},{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.className,n=e.noReviewsPlaceholder,o=t.categoryIds,c=t.productId,a=t.reviewsOnPageLoad,i=t.showProductName,s=t.showReviewDate,l=t.showReviewerName,u=t.showReviewContent,d=t.showReviewImage,b=t.showReviewRating,h=Object($.b)(t.orderby),m=h.order,g=h.orderby;return!(u||b||s||l||d||i)?this.renderHiddenContentPlaceholder():Object(p.createElement)("div",{className:Object($.a)(r,t)},Object(p.createElement)(K,{attributes:t,categoryIds:o,delayFunction:function(e){return Object(v.debounce)(e,400)},noReviewsPlaceholder:n,orderby:g,order:m,productId:c,reviewsToDisplay:a}))}}]),t}(m.Component);t.a=X},99:function(e,t,r){"use strict";var n=r(62),o=r.n(n),c=r(16),a=r.n(c),i=r(20),s=r.n(i),l=r(8),u=r.n(l),d=r(9),b=r.n(d),p=r(10),h=r.n(p),m=r(11),v=r.n(m),g=r(15),w=r.n(g),f=r(12),O=r.n(f),j=r(0),y=r(1),_=r(19),E=r(17),k=r.n(E),R=r(4),C=(r(7),r(26)),P=r(2),S=r(6),N=r.n(S),L=r(5),I=r(25),M=r(24);r(280);function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(r,!0).forEach(function(t){s()(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function A(e,t){if(!t)return e;var r=new RegExp(Object(R.escapeRegExp)(t),"ig");return e.replace(r,"<strong>$&</strong>")}var D=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?Object(j.createElement)(M.e,null):Object(j.createElement)(M.f,null)},H=function(e){function t(){var e;return u()(this,t),(e=h()(this,v()(t).apply(this,arguments))).state={products:[],product:0,variationsList:{},variationsLoading:!1,loading:!0},e.debouncedOnSearch=Object(R.debounce)(e.onSearch.bind(w()(e)),400),e.debouncedGetVariations=Object(R.debounce)(e.getVariations.bind(w()(e)),200),e.renderItem=e.renderItem.bind(w()(e)),e.onProductSelect=e.onProductSelect.bind(w()(e)),e}return O()(t,e),b()(t,[{key:"componentWillUnmount",value:function(){this.debouncedOnSearch.cancel(),this.debouncedGetVariations.cancel()}},{key:"componentDidMount",value:function(){var e=this,t=this.props,r=t.selected,n=t.queryArgs;Object(I.d)({selected:r,queryArgs:n}).then(function(t){t=t.map(function(e){return T({},e,{parent:0,count:e.variations?e.variations.length:0})}),e.setState({products:t,loading:!1})}).catch(function(){e.setState({products:[],loading:!1})})}},{key:"componentDidUpdate",value:function(e,t){t.product!==this.state.product&&this.debouncedGetVariations()}},{key:"getVariations",value:function(){var e=this,t=this.state,r=t.product,n=t.products,o=t.variationsList;if(r){var c=n.find(function(e){return e.id===r});c.variations&&0!==c.variations.length&&(o[r]||this.setState({variationsLoading:!0}),k()({path:Object(_.addQueryArgs)("".concat(L.ENDPOINTS.products,"/").concat(r,"/variations"),{per_page:-1})}).then(function(t){t=t.map(function(e){return T({},e,{parent:r})}),e.setState(function(e){return{variationsList:T({},e.variationsList,s()({},r,t)),variationsLoading:!1}})}).catch(function(){e.setState({termsLoading:!1})}))}else this.setState({variationsList:{},variationsLoading:!1})}},{key:"onSearch",value:function(e){var t=this,r=this.props,n=r.selected,o=r.queryArgs;Object(I.d)({selected:n,search:e,queryArgs:o}).then(function(e){t.setState({products:e,loading:!1})}).catch(function(){t.setState({products:[],loading:!1})})}},{key:"onProductSelect",value:function(e,t){var r=this;return function(){r.setState({product:t?0:e.id})}}},{key:"renderItem",value:function(e){var t=this,r=e.item,n=e.search,o=e.depth,c=void 0===o?0:o,i=e.isSelected,s=e.onSelect,l=this.state,u=l.product,d=l.variationsLoading,b=N()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(c),{"is-searching":n.length>0,"is-skip-level":0===c&&0!==r.parent,"is-variable":r.count>0}),p=Object.assign({},e);delete p.isSingle;var h={role:"menuitemradio"};return r.breadcrumbs.length&&(h["aria-label"]="".concat(r.breadcrumbs[0],": ").concat(r.name)),r.count&&(h["aria-expanded"]=r.id===u),r.breadcrumbs.length?(Object(R.isEmpty)(r.variation)||(r.name=r.variation),Object(j.createElement)(C.b,a()({className:b},e,h))):[Object(j.createElement)(P.MenuItem,a()({key:"product-".concat(r.id),isSelected:i},p,h,{className:b,onClick:function(){s(r)(),t.onProductSelect(r,i)()}}),Object(j.createElement)("span",{className:"woocommerce-search-list__item-state"},D(i)),Object(j.createElement)("span",{className:"woocommerce-search-list__item-label"},Object(j.createElement)("span",{className:"woocommerce-search-list__item-name",dangerouslySetInnerHTML:{__html:A(r.name,n)}})),r.count?Object(j.createElement)("span",{className:"woocommerce-search-list__item-variation-count"},Object(y.sprintf)(Object(y._n)("%d variation","%d variations",r.count,"woo-gutenberg-products-block"),r.count)):null),u===r.id&&r.count>0&&d&&Object(j.createElement)("div",{key:"loading",className:"woocommerce-search-list__item woocommerce-search-product__itemdepth-1 is-loading is-not-active"},Object(j.createElement)(P.Spinner,null))]}},{key:"render",value:function(){var e=this.state,t=e.products,r=e.loading,n=e.product,c=e.variationsList,a=this.props,i=a.onChange,s=a.renderItem,l=a.selected,u=c[n]||[],d=[].concat(o()(t),o()(u)),b={list:Object(y.__)("Products","woo-gutenberg-products-block"),noItems:Object(y.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(y.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(y.__)("Product search results updated.","woo-gutenberg-products-block")},p=l?[Object(R.find)(d,{id:l})]:[];return Object(j.createElement)(j.Fragment,null,Object(j.createElement)(C.a,{className:"woocommerce-products",list:d,isLoading:r,isSingle:!0,selected:p,onChange:i,renderItem:s,onSearch:L.IS_LARGE_CATALOG?this.debouncedOnSearch:null,messages:b,isHierarchical:!0}))}}]),t}(j.Component);t.a=H}});
1
+ this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["reviews-by-product"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],l=t[2],d=0,b=[];d<i.length;d++)a=i[d],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&b.push(o[a][0]),o[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);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],n=!0,i=1;i<r.length;i++){var s=r[i];0!==o[s]&&(n=!1)}n&&(c.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={18:0},c=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var u=s;return c.push([547,2,1,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},114:function(e,t,r){},13:function(e,t){!function(){e.exports=this.React}()},14:function(e,t){!function(){e.exports=this.moment}()},17:function(e,t){!function(){e.exports=this.wp.apiFetch}()},18:function(e,t){!function(){e.exports=this.wp.editor}()},19:function(e,t){!function(){e.exports=this.wp.url}()},2:function(e,t){!function(){e.exports=this.wp.components}()},21:function(e,t){!function(){e.exports=this.wp.compose}()},23:function(e,t){!function(){e.exports=this.wp.blocks}()},24:function(e,t,r){"use strict";var n=r(0),o=r(2),c=function(e){var t=e.className,r=e.fillColor;return Object(n.createElement)(o.Icon,{className:t,icon:Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 22.41"},Object(n.createElement)("g",null,Object(n.createElement)("g",null,Object(n.createElement)("path",{fill:r,d:"M16.55 0H1.75C.56 0 0 .52 0 1.68v9.24c0 1.15.56 1.92 1.75 1.92H2V4.76a2.51 2.51 0 0 1 2.74-2.68H18v-.4A1.51 1.51 0 0 0 16.55 0z"}),Object(n.createElement)("path",{fill:r,d:"M19.54 3.11H4.74C3.55 3.11 3 3.64 3 4.79V14c0 1.19.55 2 1.74 2H5V7.88A2.51 2.51 0 0 1 7.73 5.2H21v-.41a1.51 1.51 0 0 0-1.46-1.68z"}),Object(n.createElement)("path",{fill:r,d:"M22.53 6.23H7.73C6.54 6.23 6 6.75 6 7.91v9.24c0 1.15.56 1.92 1.75 1.92h7a.59.59 0 0 1 .32.11l1.61 1.15 2.83 2a.31.31 0 0 0 .18.05.3.3 0 0 0 .31-.3v-2.73a.3.3 0 0 1 .28-.28h2.31A1.47 1.47 0 0 0 24 17.6V7.91a1.52 1.52 0 0 0-1.47-1.68z"}),Object(n.createElement)("path",{fill:"#ffffff",d:"M10.2 10.92l1.06-2.14 1.05 2.14 2.37.35-1.71 1.66.4 2.36-2.11-1.11-.17.09-.52.27-.51.26-.92.49.18-1.02.09-.57.1-.56.03-.21-1.71-1.66 2.37-.35zM21.46 14.25h-4.4a.69.69 0 0 1-.69-.69.68.68 0 0 1 .69-.68h4.4a.68.68 0 0 1 .69.68.69.69 0 0 1-.69.69zM21.46 11.19h-4.4a.69.69 0 1 1 0-1.37h4.4a.69.69 0 1 1 0 1.37z"}))))})},a=function(){return Object(n.createElement)(o.Icon,{icon:Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fillRule:"nonzero",d:"M21.913 7.0946H2.0254c-1.1708 0-2.0984.9908-2.0205 2.16l.741 11.0724c.0714 1.0638.9552 1.8892 2.0206 1.8892h18.4054c1.0654 0 1.9492-.8254 2.0205-1.8892l.7411-11.0724c.0779-1.1692-.8497-2.16-2.0205-2.16zm-8.8006-4.6573h5.987c1.119 0 2.0255.9065 2.0255 2.0254v.934H2.8103V2.0255C2.8103.9064 3.7168 0 4.8357 0h6.2513c1.119 0 2.0254.9065 2.0254 2.0254v.4119zm-7.0589 11.619a.926.926 0 1 1 0-1.852h11.8297a.926.926 0 1 1 0 1.852H6.0535z"}))})},i=function(){return Object(n.createElement)(o.Icon,{icon:Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M22 7.5H2c-1.2 0-2.1 1-2 2.2l.7 11.1c.1 1.1 1 1.9 2 1.9h18.5c1.1 0 2-.8 2-1.9L24 9.6c.1-1.1-.9-2.1-2-2.1zM13.1 2.8v-.4c0-1.1-.9-2-2-2H4.8c-1.1 0-2 .9-2 2v3.4h18.4v-1c0-1.1-.9-2-2-2h-6.1z"}),Object(n.createElement)("path",{fill:"#fff",d:"M14.4 18.7L12 17.4l-2.4 1.3.5-2.6-1.9-1.9 2.6-.4 1.2-2.4 1.2 2.4 2.6.4-1.9 1.9z"}))})},s=function(){return Object(n.createElement)(o.Icon,{className:"material-icon",icon:Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M0 0h24v24H0z",fill:"none"}),Object(n.createElement)("path",{d:"M23 12l-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-3.68L23 12zm-10 5h-2v-2h2v2zm0-4h-2V7h2v6z"}))})},l=function(){return Object(n.createElement)(o.Icon,{icon:Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"#1E8CBE",d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))})},u=function(){return Object(n.createElement)(o.Icon,{icon:Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"#6C7781",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))})},d=function(e){var t=e.className,r=e.fillColor;return Object(n.createElement)(o.Icon,{className:t,icon:Object(n.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)("path",{fill:r,d:"M2.3,17.3h9.3c0.1,0,0.3,0,0.4,0.1l5.9,4.2c0.3,0.2,0.7,0,0.7-0.3v-3.7c0-0.2,0.2-0.4,0.4-0.4H22 c1.1,0,2-0.9,2-2V2.5c0-1.2-0.7-2.2-2-2.2H2.3C0.7,0.2,0,0.9,0,2.5v12.3C0,16.3,0.7,17.3,2.3,17.3z"}),Object(n.createElement)("polygon",{fill:"#ffffff",points:"8.8,12.1 6.5,10.9 4.1,12.1 4.5,9.5 2.6,7.6 5.3,7.2 6.5,4.8 7.6,7.2 10.3,7.6 8.4,9.5"}),Object(n.createElement)("path",{fill:"#ffffff",d:"M20.7,7.9h-7c-0.5,0-0.9-0.4-0.9-0.9S13.2,6,13.7,6h7c0.5,0,0.9,0.4,0.9,0.9S21.2,7.9,20.7,7.9z"}),Object(n.createElement)("path",{fill:"#ffffff",d:"M20.7,11.5h-7c-0.5,0-0.9-0.4-0.9-0.9s0.4-0.9,0.9-0.9h7c0.5,0,0.9,0.4,0.9,0.9S21.2,11.5,20.7,11.5z"}))})},b=function(e){var t=e.className,r=e.fillColor;return Object(n.createElement)(o.Icon,{className:t,icon:Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 23"},Object(n.createElement)("path",{fill:r,d:"M21.9943 7.0957H2.00638C0.807102 7.0957 -0.0923543 8.0951 0.0075853 9.29437L0.707162 20.3877C0.807102 21.487 1.70656 22.2865 2.70595 22.2865H21.1948C22.2941 22.2865 23.1936 21.487 23.1936 20.3877L23.9931 9.29437C24.093 8.0951 23.0936 7.0957 21.9943 7.0957Z"}),Object(n.createElement)("path",{fill:r,d:"M13.0921 2.39855V1.99879C13.0921 0.899456 12.1926 0 11.0933 0H4.7971C3.69777 0 2.79831 0.899456 2.79831 1.99879V5.39674H21.1872V4.49728C21.1872 3.39795 20.2877 2.49849 19.1884 2.49849H13.0921V2.39855Z"}),Object(n.createElement)("path",{fill:"white",d:"M8.63115 17.126L6.5415 15.9449L4.361 17.126L4.72442 14.6729L2.99819 13.0376L5.45125 12.6742L6.5415 10.4937L7.5409 12.6742L9.99396 13.0376L8.26773 14.6729L8.63115 17.126Z"}),Object(n.createElement)("path",{fill:"white",d:"M19.1907 13.5918H12.9899C12.547 13.5918 12.1926 13.1921 12.1926 12.6924C12.1926 12.1927 12.547 11.7929 12.9899 11.7929H19.1907C19.6336 11.7929 19.9879 12.1927 19.9879 12.6924C19.9879 13.1921 19.6336 13.5918 19.1907 13.5918Z"}),Object(n.createElement)("path",{fill:"white",d:"M19.1907 17.1897H12.9899C12.547 17.1897 12.1926 16.7899 12.1926 16.2902C12.1926 15.7905 12.547 15.3907 12.9899 15.3907H19.1907C19.6336 15.3907 19.9879 15.7905 19.9879 16.2902C19.9879 16.7899 19.6336 17.1897 19.1907 17.1897Z"}))})},p=function(){return Object(n.createElement)(o.Icon,{className:"material-icon",icon:Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M13 13v8h8v-8h-8zM3 21h8v-8H3v8zM3 3v8h8V3H3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66-5.66-5.65z"}),Object(n.createElement)("path",{d:"M0 0h24v24H0z",fill:"none"}))})},h=r(6),m=r.n(h),v=(r(7),function(e){var t=e.size,r=void 0===t?20:t,c=e.className;return Object(n.createElement)(o.Icon,{className:m()("woo-icon",c),icon:Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",height:r,width:Math.floor(1.67*r),viewBox:"0 0 245 145"},Object(n.createElement)("path",{fill:"#96588A",d:"M22.76 0h199.1a22.77 22.77 0 0 1 22.8 22.76v75.92a22.77 22.77 0 0 1-22.78 22.78h-71.41l9.77 24-43.13-24H22.76C10.1946 121.449.011 111.2654 0 98.7V22.76C.011 10.1946 10.1946.011 22.76 0z"}),Object(n.createElement)("path",{fill:"#FFF",fillRule:"nonzero",d:"M12.32 20.63a8.16 8.16 0 0 1 6.25-3.09c5.0733-.36 7.9867 2.0333 8.74 7.18 3.14 20.86 6.4933 38.5633 10.06 53.11l21.92-41.69c2-3.76 4.49-5.76 7.52-6 4.3867-.3067 7.13 2.49 8.23 8.39a186 186 0 0 0 9.47 34.23c2.62-25.38 7.0133-43.7133 13.18-55a7.73 7.73 0 0 1 6.6-4.43 8.8 8.8 0 0 1 6.32 2 7.75 7.75 0 0 1 3.05 5.74 8.52 8.52 0 0 1-1 4.77c-3.9 7.24-7.12 19.28-9.66 36.12-2.48 16.2533-3.3967 28.9633-2.75 38.13a12.25 12.25 0 0 1-1.16 6.56 6.32 6.32 0 0 1-5.33 3.53c-2.6667.18-5.3033-1.0567-7.91-3.71-9.2933-9.54-16.6567-23.7267-22.09-42.56C57.3 76.7167 52.48 86.3333 49.3 92.76c-5.86 11.3333-10.89 17.13-15.09 17.39-2.7333.1933-5.0667-2.0933-7-6.86-5.1-13.0933-10.5833-38.4033-16.45-75.93a8.56 8.56 0 0 1 1.56-6.73zM227.23 36.34a23.17 23.17 0 0 0-16-11.59 26.25 26.25 0 0 0-5.42-.58c-9.5867 0-17.41 5-23.47 15a53 53 0 0 0-7.78 28.16c0 7.7333 1.6167 14.3333 4.85 19.8a23.15 23.15 0 0 0 16 11.59 26.28 26.28 0 0 0 5.42.59c9.68 0 17.5033-5 23.47-15A53.89 53.89 0 0 0 232.08 56c0-7.7333-1.6167-14.2867-4.85-19.66zm-12.61 27.72c-1.3733 6.56-3.9167 11.5-7.63 14.82-2.9267 2.6667-5.6133 3.7433-8.06 3.23-2.4467-.5133-4.4033-2.6667-5.87-6.46a25.68 25.68 0 0 1-1.76-9.09 35.9 35.9 0 0 1 .73-7.34 33 33 0 0 1 5.28-11.88c3.3333-4.8933 6.8067-6.9467 10.42-6.16 2.44.4867 4.3933 2.64 5.86 6.46a25.68 25.68 0 0 1 1.76 9.12 35.73 35.73 0 0 1-.73 7.33v-.03zM164.57 36.34a23.2 23.2 0 0 0-16-11.59 26.42 26.42 0 0 0-5.43-.58c-9.5933 0-17.4167 5-23.47 15a53 53 0 0 0-7.78 28.16c0 7.7333 1.6133 14.3333 4.84 19.8a23.19 23.19 0 0 0 16 11.59 26.44 26.44 0 0 0 5.43.59c9.68 0 17.5033-5 23.47-15A53.88 53.88 0 0 0 169.4 56c0-7.7333-1.6133-14.2867-4.84-19.66h.01zm-12.61 27.72c-1.3667 6.56-3.91 11.5-7.63 14.82-2.93 2.64-5.63 3.72-8.07 3.23-2.44-.49-4.4-2.64-5.86-6.46a25.7 25.7 0 0 1-1.77-9.09 35.9 35.9 0 0 1 .74-7.34 33 33 0 0 1 5.28-11.88c3.3333-4.8933 6.8067-6.9467 10.42-6.16 2.44.4867 4.3933 2.64 5.86 6.46a25.91 25.91 0 0 1 1.76 9.12 35.73 35.73 0 0 1-.73 7.33v-.03z"}))})});r.d(t,"a",function(){return c}),r.d(t,"b",function(){return a}),r.d(t,"c",function(){return i}),r.d(t,"d",function(){return s}),r.d(t,"e",function(){return l}),r.d(t,"f",function(){return u}),r.d(t,"h",function(){return d}),r.d(t,"g",function(){return b}),r.d(t,"i",function(){return p}),r.d(t,"j",function(){return v})},25:function(e,t,r){"use strict";r.d(t,"d",function(){return b}),r.d(t,"b",function(){return p}),r.d(t,"c",function(){return h}),r.d(t,"a",function(){return m});var n=r(20),o=r.n(n),c=r(19),a=r(17),i=r.n(a),s=r(4),l=r(5);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(r,!0).forEach(function(t){o()(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var b=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=void 0===n?"":n,a=e.queryArgs,u=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=void 0===n?"":n,a=e.queryArgs,i=void 0===a?[]:a,s={per_page:l.IS_LARGE_CATALOG?100:-1,catalog_visibility:"any",status:"publish",search:o,orderby:"title",order:"asc"},u=[Object(c.addQueryArgs)(l.ENDPOINTS.products,d({},s,{},i))];return l.IS_LARGE_CATALOG&&r.length&&u.push(Object(c.addQueryArgs)(l.ENDPOINTS.products,{catalog_visibility:"any",status:"publish",include:r})),u}({selected:r,search:o,queryArgs:void 0===a?[]:a});return Promise.all(u.map(function(e){return i()({path:e})})).then(function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")})},p=function(e){return i()({path:"".concat(l.ENDPOINTS.products,"/").concat(e)})},h=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=[Object(c.addQueryArgs)("".concat(l.ENDPOINTS.products,"/tags"),{per_page:l.LIMIT_TAGS?100:-1,orderby:l.LIMIT_TAGS?"count":"name",order:l.LIMIT_TAGS?"desc":"asc",search:n})];return l.LIMIT_TAGS&&r.length&&o.push(Object(c.addQueryArgs)("".concat(l.ENDPOINTS.products,"/tags"),{include:r})),o}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map(function(e){return i()({path:e})})).then(function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")})},m=function(e){return i()({path:"".concat(l.ENDPOINTS.categories,"/").concat(e)})}},33:function(e,t){!function(){e.exports=this.wp.keycodes}()},39:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},4:function(e,t){!function(){e.exports=this.lodash}()},40:function(e,t,r){"use strict";r.d(t,"b",function(){return s}),r.d(t,"c",function(){return l}),r.d(t,"a",function(){return u});var n=r(17),o=r.n(n),c=r(6),a=r.n(c),i=r(5),s=function(e){if(i.ENABLE_REVIEW_RATING){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=function(e){return o()({path:"/wc/blocks/products/reviews?"+Object.entries(e).map(function(e){return e.join("=")}).join("&"),parse:!1}).then(function(e){return e.json().then(function(t){return{reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}})})},u=function(e,t){var r=t.className,n=t.showReviewDate,o=t.showReviewerName,c=t.showReviewContent,i=t.showProductName,s=t.showReviewImage,l=t.showReviewRating;return a()(e,r,{"has-image":s,"has-name":o,"has-date":n,"has-rating":l,"has-content":c,"has-product-name":i})}},44:function(e,t){!function(){e.exports=this.ReactDOM}()},47:function(e,t){!function(){e.exports=this.wp.viewport}()},5:function(e,t){!function(){e.exports=this.wc["wc-block-settings"]}()},51:function(e,t){!function(){e.exports=this.wp.hooks}()},52:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(7),r(29)),a=r.n(c),i=r(6),s=r.n(i),l=r(39),u=r(2);t.a=function(e){var t,r,c=e.className,i=e.error,d=e.isLoading,b=e.onRetry;return Object(n.createElement)(u.Placeholder,{icon:Object(n.createElement)(a.a,{icon:"notice"}),label:Object(o.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:s()("wc-block-api-error",c)},Object(n.createElement)("div",{className:"wc-block-error__message"},(r=(t=i).apiMessage,t.message||(r?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(l.escapeHTML)(r))):Object(o.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")))),b&&Object(n.createElement)(n.Fragment,null,d?Object(n.createElement)(u.Spinner,null):Object(n.createElement)(u.Button,{isDefault:!0,onClick:b},Object(o.__)("Retry","woo-gutenberg-products-block"))))}},53:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},54:function(e,t){!function(){e.exports=this.wp.date}()},547:function(e,t,r){"use strict";r.r(t);var n=r(20),o=r.n(n),c=r(0),a=r(1),i=r(23),s=(r(77),r(16)),l=r.n(s),u=r(18),d=r(2),b=r(26),p=(r(7),r(99)),h=r(24),m=r(81),v=r(52),g=r(71),w=Object(g.b)(function(e){var t=e.error,r=e.getProduct,n=e.isLoading,o=e.product;if(t)return Object(c.createElement)(v.a,{className:"wc-block-featured-product-error",error:t,isLoading:n,onRetry:r});var i=!o||n?Object(c.createElement)(d.Spinner,null):Object(a.sprintf)(Object(a.__)("This block lists reviews for a selected product. %s doesn't have any reviews yet, but they will show up here when it does.","woo-gutenberg-products-block"),o.name);return Object(c.createElement)(d.Placeholder,{className:"wc-block-reviews-by-product",icon:Object(c.createElement)(h.h,{className:"block-editor-block-icon"}),label:Object(a.__)("Reviews by Product","woo-gutenberg-products-block")},i)}),f=r(63),O=Object(d.withSpokenMessages)(function(e){var t=e.attributes,r=e.debouncedSpeak,n=e.setAttributes,o=t.editMode,i=t.productId,s=function(e){var t=e.item,r=void 0===t?0:t;return Object(c.createElement)(b.b,l()({},e,{countLabel:Object(a.sprintf)(Object(a._n)("%d Review","%d Reviews",r.review_count,"woo-gutenberg-products-block"),r.review_count),showCount:!0,"aria-label":Object(a.sprintf)(Object(a._n)("%s, has %d review","%s, has %d reviews",r.review_count,"woo-gutenberg-products-block"),r.name,r.review_count)}))};return!i||o?Object(c.createElement)(d.Placeholder,{icon:Object(c.createElement)(h.h,{className:"block-editor-block-icon"}),label:Object(a.__)("Reviews by Product","woo-gutenberg-products-block")},Object(a.__)("Show reviews of your product to build trust","woo-gutenberg-products-block"),Object(c.createElement)("div",{className:"wc-block-reviews__selection"},Object(c.createElement)(p.a,{selected:t.productId||0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e[0]?e[0].id:0;n({productId:t})},queryArgs:{orderby:"comment_count",order:"desc"},renderItem:s}),Object(c.createElement)(d.Button,{isDefault:!0,onClick:function(){n({editMode:!1}),r(Object(a.__)("Showing Reviews by Product block preview.","woo-gutenberg-products-block"))}},Object(a.__)("Done","woo-gutenberg-products-block")))):Object(c.createElement)(c.Fragment,null,Object(f.a)(o,n),Object(c.createElement)(u.InspectorControls,{key:"inspector"},Object(c.createElement)(d.PanelBody,{title:Object(a.__)("Product","woo-gutenberg-products-block"),initialOpen:!1},Object(c.createElement)(p.a,{selected:t.productId||0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e[0]?e[0].id:0;n({productId:t})},renderItem:s})),Object(c.createElement)(d.PanelBody,{title:Object(a.__)("Content","woo-gutenberg-products-block")},Object(f.b)(t,n)),Object(c.createElement)(d.PanelBody,{title:Object(a.__)("List Settings","woo-gutenberg-products-block")},Object(f.c)(t,n))),Object(c.createElement)(m.a,{attributes:t,className:"wc-block-all-reviews",icon:Object(c.createElement)(h.h,{className:"block-editor-block-icon"}),name:Object(a.__)("Reviews by Product","woo-gutenberg-products-block"),noReviewsPlaceholder:w}))}),j=r(79),y=r(80);function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}Object(i.registerBlockType)("woocommerce/reviews-by-product",{title:Object(a.__)("Reviews by Product","woo-gutenberg-products-block"),icon:Object(c.createElement)(h.h,{fillColor:"#96588a"}),category:"woocommerce",keywords:[Object(a.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(a.__)("Show reviews of your product to build trust.","woo-gutenberg-products-block"),attributes:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(r,!0).forEach(function(t){o()(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},j.a,{productId:{type:"number"}}),edit:function(e){return Object(c.createElement)(O,e)},save:y.a})},61:function(e,t){!function(){e.exports=this.wp.dom}()},63:function(e,t,r){"use strict";r.d(t,"a",function(){return d}),r.d(t,"b",function(){return b}),r.d(t,"c",function(){return p});var n=r(0),o=r(1),c=r(39),a=r(2),i=r(18),s=r(74),l=r(5),u=r(70),d=function(e,t){return Object(n.createElement)(i.BlockControls,null,Object(n.createElement)(a.Toolbar,{controls:[{icon:"edit",title:Object(o.__)("Edit","woo-gutenberg-products-block"),onClick:function(){return t({editMode:!e})},isActive:e}]}))},b=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:function(){return t({showReviewRating:!e.showReviewRating})}}),e.showReviewRating&&!l.ENABLE_REVIEW_RATING&&Object(n.createElement)(a.Notice,{className:"wc-block-reviews__notice",isDismissible:!1},Object(n.createElement)(n.RawHTML,null,Object(o.sprintf)(Object(c.escapeHTML)(Object(o.__)("Product rating is disabled in your %sstore settings%s.","woo-gutenberg-products-block")),'<a href="'.concat(Object(s.a)("admin.php?page=wc-settings&tab=products"),'" target="_blank">'),"</a>"))),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:function(){return t({showReviewerName:!e.showReviewerName})}}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:function(){return t({showReviewImage:!e.showReviewImage})}}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:function(){return t({showReviewDate:!e.showReviewDate})}}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:function(){return t({showReviewContent:!e.showReviewContent})}}),e.showReviewImage&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(u.a,{label:Object(o.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,options:[{label:Object(o.__)("Reviewer photo","woo-gutenberg-products-block"),value:"reviewer"},{label:Object(o.__)("Product","woo-gutenberg-products-block"),value:"product"}],onChange:function(e){return t({imageType:e})}}),"reviewer"===e.imageType&&!l.SHOW_AVATARS&&Object(n.createElement)(a.Notice,{className:"wc-block-reviews__notice",isDismissible:!1},Object(n.createElement)(n.RawHTML,null,Object(o.sprintf)(Object(c.escapeHTML)(Object(o.__)("Reviewer photo is disabled in your %ssite settings%s.","woo-gutenberg-products-block")),'<a href="'.concat(Object(s.a)("options-discussion.php"),'" target="_blank">'),"</a>")))))},p=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:function(){return t({showOrderby:!e.showOrderby})}}),Object(n.createElement)(a.SelectControl,{label:Object(o.__)("Order Product Reviews by","woo-gutenberg-products-block"),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:function(e){return t({orderby:e})}}),Object(n.createElement)(a.RangeControl,{label:Object(o.__)("Starting Number of Reviews","woo-gutenberg-products-block"),value:e.reviewsOnPageLoad,onChange:function(e){return t({reviewsOnPageLoad:e})},max:20,min:1}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Load more","woo-gutenberg-products-block"),checked:e.showLoadMore,onChange:function(){return t({showLoadMore:!e.showLoadMore})}}),e.showLoadMore&&Object(n.createElement)(a.RangeControl,{label:Object(o.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:function(e){return t({reviewsOnLoadMore:e})},max:20,min:1}))}},64:function(e,t){},65:function(e,t){},67:function(e,t){},68:function(e,t){},69:function(e,t,r){"use strict";var n=r(16),o=r.n(n),c=r(8),a=r.n(c),i=r(9),s=r.n(i),l=r(10),u=r.n(l),d=r(11),b=r.n(d),p=r(12),h=r.n(p),m=r(0),v=r(13),g=[];t.a=function(e){return function(t){function r(){return a()(this,r),u()(this,b()(r).apply(this,arguments))}return h()(r,t),s()(r,[{key:"generateUniqueID",value:function(){var e=r.name;return g[e]||(g[e]=0),g[e]++,g[e]}},{key:"render",value:function(){var t=this.generateUniqueID();return Object(m.createElement)(e,o()({},this.props,{componentId:t}))}}]),r}(v.Component)}},70:function(e,t,r){"use strict";var n=r(16),o=r.n(n),c=r(8),a=r.n(c),i=r(9),s=r.n(i),l=r(10),u=r.n(l),d=r(11),b=r.n(d),p=r(15),h=r.n(p),m=r(12),v=r.n(m),g=r(0),w=r(4),f=r(6),O=r.n(f),j=r(2),y=r(21),_=(r(132),function(e){function t(){var e;return a()(this,t),(e=u()(this,b()(t).apply(this,arguments))).onClick=e.onClick.bind(h()(e)),e}return v()(t,e),s()(t,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,c=r.checked,a=r.instanceId,i=r.className,s=r.help,l=r.options,u=r.value,d="inspector-toggle-button-control-".concat(a);return s&&(e=Object(w.isFunction)(s)?s(c):s),Object(g.createElement)(j.BaseControl,{id:d,help:e,className:O()("components-toggle-button-control",i)},Object(g.createElement)("label",{id:d+"__label",htmlFor:d,className:"components-toggle-button-control__label"},n),Object(g.createElement)(j.ButtonGroup,{"aria-labelledby":d+"__label"},l.map(function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isDefault=!0,c["aria-pressed"]=!1),Object(g.createElement)(j.Button,o()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},c),e.label)})))}}]),t}(g.Component));t.a=Object(y.withInstanceId)(_)},71:function(e,t,r){"use strict";var n=r(16),o=r.n(n),c=r(38),a=r.n(c),i=r(8),s=r.n(i),l=r(9),u=r.n(l),d=r(10),b=r.n(d),p=r(11),h=r.n(p),m=r(15),v=r.n(m),g=r(12),w=r.n(g),f=r(0),O=r(21),j=r(25),y=Object(O.createHigherOrderComponent)(function(e){return function(t){function r(){var e;return s()(this,r),(e=b()(this,h()(r).apply(this,arguments))).state={error:null,loading:!1,product:null},e.loadProduct=e.loadProduct.bind(v()(e)),e}return w()(r,t),u()(r,[{key:"componentDidMount",value:function(){this.loadProduct()}},{key:"componentDidUpdate",value:function(e){e.attributes.productId!==this.props.attributes.productId&&this.loadProduct()}},{key:"loadProduct",value:function(){var e=this,t=this.props.attributes.productId;t?(this.setState({loading:!0}),Object(j.b)(t).then(function(t){e.setState({product:t,loading:!1,error:null})}).catch(function(t){var r="object"===a()(t)&&t.hasOwnProperty("message")?{apiMessage:t.message}:{apiMessage:null};e.setState({product:null,loading:!1,error:r})})):this.setState({product:null,loading:!1,error:null})}},{key:"render",value:function(){var t=this.state,r=t.error,n=t.loading,c=t.product;return Object(f.createElement)(e,o()({},this.props,{error:r,getProduct:this.loadProduct,isLoading:n,product:c}))}}]),r}(f.Component)},"withProduct"),_=Object(O.createHigherOrderComponent)(function(e){return function(t){function r(){var e;return s()(this,r),(e=b()(this,h()(r).apply(this,arguments))).state={error:null,loading:!1,category:null},e.loadCategory=e.loadCategory.bind(v()(e)),e}return w()(r,t),u()(r,[{key:"componentDidMount",value:function(){this.loadCategory()}},{key:"componentDidUpdate",value:function(e){e.attributes.categoryId!==this.props.attributes.categoryId&&this.loadCategory()}},{key:"loadCategory",value:function(){var e=this,t=this.props.attributes.categoryId;t?(this.setState({loading:!0}),Object(j.a)(t).then(function(t){e.setState({category:t,loading:!1,error:null})}).catch(function(t){var r="object"===a()(t)&&t.hasOwnProperty("message")?{apiMessage:t.message}:{apiMessage:null};e.setState({category:null,loading:!1,error:r})})):this.setState({category:null,loading:!1,error:null})}},{key:"render",value:function(){var t=this.state,r=t.error,n=t.loading,c=t.category;return Object(f.createElement)(e,o()({},this.props,{error:r,getCategory:this.loadCategory,isLoading:n,category:c}))}}]),r}(f.Component)},"withCategory"),E=r(4),k=(r(7),r(5)),R=Object(O.createHigherOrderComponent)(function(e){var t=function(t){function r(){var e;return s()(this,r),(e=b()(this,h()(r).apply(this,arguments))).state={list:[],loading:!0},e.debouncedOnSearch=Object(E.debounce)(e.onSearch.bind(v()(e)),400),e}return w()(r,t),u()(r,[{key:"componentDidMount",value:function(){var e=this,t=this.props.selected;Object(j.d)({selected:t}).then(function(t){e.setState({list:t,loading:!1})}).catch(function(){e.setState({list:[],loading:!1})})}},{key:"componentWillUnmount",value:function(){this.debouncedOnSearch.cancel()}},{key:"onSearch",value:function(e){var t=this,r=this.props.selected;Object(j.d)({selected:r,search:e}).then(function(e){t.setState({list:e,loading:!1})}).catch(function(){t.setState({list:[],loading:!1})})}},{key:"render",value:function(){var t=this.state,r=t.list,n=t.loading,c=this.props.selected;return Object(f.createElement)(e,o()({},this.props,{products:r,isLoading:n,selected:r.filter(function(e){var t=e.id;return c.includes(t)}),onSearch:k.IS_LARGE_CATALOG?this.debouncedOnSearch:null}))}}]),r}(f.Component);return t.defaultProps={selected:[]},t},"withSearchedProducts");r.d(t,"b",function(){return y}),r.d(t,"a",function(){return _}),r.d(t,"c",function(){return R})},77:function(e,t,r){var n=r(114);"string"==typeof n&&(n=[[e.i,n,""]]);var o={insert:"head",singleton:!1};r(35)(n,o);n.locals&&(e.exports=n.locals)},78:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},79: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}}},80:function(e,t,r){"use strict";var n=r(16),o=r.n(n),c=r(0),a=(r(77),r(40));t.a=function(e){var t=e.attributes,r=t.categoryIds,n=t.imageType,i=t.orderby,s=t.productId,l={"data-image-type":n,"data-orderby":i,"data-reviews-on-page-load":t.reviewsOnPageLoad,"data-reviews-on-load-more":t.reviewsOnLoadMore,"data-show-load-more":t.showLoadMore,"data-show-orderby":t.showOrderby},u="wc-block-all-reviews";return s&&(l["data-product-id"]=s,u="wc-block-reviews-by-product"),Array.isArray(r)&&(l["data-category-ids"]=r.join(","),u="wc-block-reviews-by-category"),Object(c.createElement)("div",o()({className:Object(a.a)(u,t)},l))}},81:function(e,t,r){"use strict";var n=r(8),o=r.n(n),c=r(9),a=r.n(c),i=r(10),s=r.n(i),l=r(11),u=r.n(l),d=r(12),b=r.n(d),p=r(0),h=r(1),m=r(13),v=(r(7),r(4)),g=r(2),w=r(5),f=r(52),O=r(20),j=r.n(O),y=r(6),_=r.n(y);function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var k=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,c=e.wrapperProps;return!r&&n?(t=o||"span",c=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(r,!0).forEach(function(t){j()(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},c,{className:_()(c.className,"screen-reader-text")}),Object(p.createElement)(t,c,n)):(t=o||m.Fragment,r&&n&&r!==n?Object(p.createElement)(t,c,Object(p.createElement)("span",{"aria-hidden":!0},r),Object(p.createElement)("span",{className:"screen-reader-text"},n)):Object(p.createElement)(t,c,r))};k.defaultProps={wrapperProps:{}};var R=k,C=(r(170),function(e){var t=e.onClick,r=e.label,n=e.screenReaderLabel;return Object(p.createElement)("div",{className:"wp-block-button wc-block-load-more"},Object(p.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(p.createElement)(R,{label:r,screenReaderLabel:n})))});C.defaultProps={label:Object(h.__)("Load more","woo-gutenberg-products-block")};var P=C,S=r(15),N=r.n(S),L=r(100),I=r.n(L),M=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=I()(e,{suffix:r,limit:t});return n.html},x=function(e,t,r,n){var o=T(e,t,r);return M(e,o-n.length,n)},T=function(e,t,r){for(var n={start:0,middle:0,end:e.length};n.start<=n.end;)n.middle=Math.floor((n.start+n.end)/2),t.innerHTML=M(e,n.middle),n=A(n,t.clientHeight,r);return n.middle},A=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e},D=function(e){function t(e){var r;return o()(this,t),(r=s()(this,u()(t).apply(this,arguments))).state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},r.reviewSummary=Object(m.createRef)(),r.reviewContent=Object(m.createRef)(),r.getButton=r.getButton.bind(N()(r)),r.onClick=r.onClick.bind(N()(r)),r}return b()(t,e),a()(t,[{key:"componentDidMount",value:function(){if(this.props.children){var e=this.props,t=e.maxLines,r=e.ellipsis,n=(this.reviewSummary.current.clientHeight+1)*t+1,o=this.reviewContent.current.clientHeight+1>n;this.setState({clampEnabled:o}),o&&this.setState({summary:x(this.reviewContent.current.innerHTML,this.reviewSummary.current,n,r)})}}},{key:"getButton",value:function(){var e=this.state.isExpanded,t=this.props,r=t.className,n=t.lessText,o=t.moreText,c=e?n:o;if(c)return Object(p.createElement)("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}},{key:"onClick",value:function(e){e.preventDefault();var t=this.state.isExpanded;this.setState({isExpanded:!t})}},{key:"render",value:function(){var e=this.props.className,t=this.state,r=t.content,n=t.summary,o=t.clampEnabled,c=t.isExpanded;return r?!1===o?Object(p.createElement)("div",{className:e},Object(p.createElement)("div",{ref:this.reviewContent},r)):Object(p.createElement)("div",{className:e},(!c||null===o)&&Object(p.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:n}}),(c||null===o)&&Object(p.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},r),this.getButton()):null}}]),t}(m.Component);D.defaultProps={maxLines:3,ellipsis:"&hellip;",moreText:Object(h.__)("Read more","woo-gutenberg-products-block"),lessText:Object(h.__)("Read less","woo-gutenberg-products-block"),className:"read-more-content"};var H=D;r(171);var z=function(e){var t=e.attributes,r=e.review,n=void 0===r?{}:r,o=t.imageType,c=t.showReviewDate,a=t.showReviewerName,i=t.showReviewImage,s=t.showReviewRating,l=t.showReviewContent,u=t.showProductName,d=n.rating,b=!Object.keys(n).length>0,m=Number.isFinite(d)&&s;return Object(p.createElement)("li",{className:_()("wc-block-review-list-item__item",{"is-loading":b}),"aria-hidden":b},(u||c||a||i||m)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__info"},i&&function(e,t,r){return r||!e?Object(p.createElement)("div",{className:"wc-block-review-list-item__image",width:"48",height:"48"}):Object(p.createElement)("div",{className:"wc-block-review-list-item__image"},"product"===t?Object(p.createElement)("img",{"aria-hidden":"true",alt:"",src:e.product_picture||"",className:"wc-block-review-list-item__image",width:"48",height:"48"}):Object(p.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[48]||"",srcSet:e.reviewer_avatar_urls[96]+" 2x",className:"wc-block-review-list-item__image",width:"48",height:"48"}),e.verified&&Object(p.createElement)("div",{className:"wc-block-review-list-item__verified",title:Object(h.__)("Verified buyer","woo-gutenberg-products-block")},Object(h.__)("Verified buyer","woo-gutenberg-products-block")))}(n,o,b),(u||a||m||c)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__meta"},m&&function(e){var t=e.rating,r={width:t/5*100+"%"};return Object(p.createElement)("div",{className:"wc-block-review-list-item__rating"},Object(p.createElement)("div",{className:"wc-block-review-list-item__rating__stars",role:"img"},Object(p.createElement)("span",{style:r},Object(h.sprintf)(Object(h.__)("Rated %d out of 5","woo-gutenberg-products-block"),t))))}(n),u&&function(e){return Object(p.createElement)("div",{className:"wc-block-review-list-item__product"},Object(p.createElement)("a",{href:e.product_permalink},e.product_name))}(n),a&&function(e){var t=e.reviewer,r=void 0===t?"":t;return Object(p.createElement)("div",{className:"wc-block-review-list-item__author"},r)}(n),c&&function(e){var t=e.date_created,r=e.formatted_date_created;return Object(p.createElement)("time",{className:"wc-block-review-list-item__published-date",dateTime:t},r)}(n))),l&&function(e){return Object(p.createElement)(H,{maxLines:10,moreText:Object(h.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(h.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text"},Object(p.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(n))};r(172);function B(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var V=function(e){var t=e.attributes,r=e.reviews,n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?B(r,!0).forEach(function(t){j()(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},t,{showReviewImage:(w.SHOW_AVATARS||"product"===t.imageType)&&t.showReviewImage,showReviewRating:w.ENABLE_REVIEW_RATING&&t.showReviewRating});return Object(p.createElement)("ul",{className:"wc-block-review-list"},0===r.length?Object(p.createElement)(z,{attributes:n}):r.map(function(e,t){return Object(p.createElement)(z,{key:e.id||t,attributes:n,review:e})}))},G=r(69),F=(r(173),Object(G.a)(function(e){var t=e.className,r=e.componentId,n=e.defaultValue,o=e.label,c=e.onChange,a=e.options,i=e.screenReaderLabel,s=e.readOnly,l=e.value,u="wc-block-order-select__select-".concat(r);return Object(p.createElement)("p",{className:_()("wc-block-order-select",t)},Object(p.createElement)(R,{label:o,screenReaderLabel:i,wrapperElement:"label",wrapperProps:{className:"wc-block-order-select__label",htmlFor:u}}),Object(p.createElement)("select",{id:u,className:"wc-block-order-select__select",defaultValue:n,onChange:c,readOnly:s,value:l},a.map(function(e){return Object(p.createElement)("option",{key:e.key,value:e.key},e.label)})))})),q=(r(174),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,o=e.value;return Object(p.createElement)(F,{className:"wc-block-review-order-select",defaultValue:t,label:Object(h.__)("Order by","woo-gutenberg-products-block"),onChange:r,options:[{key:"most-recent",label:Object(h.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(h.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(h.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(h.__)("Order reviews by","woo-gutenberg-products-block"),value:o})}),W=r(16),U=r.n(W),Q=r(38),Z=r.n(Q),J=r(78),Y=r.n(J),$=r(40),K=function(e){var t=function(t){function r(){var e;return o()(this,r),(e=s()(this,u()(r).apply(this,arguments))).state={error:null,loading:!0,reviews:[],totalReviews:0},e.setError=e.setError.bind(N()(e)),e.delayedAppendReviews=e.props.delayFunction(e.appendReviews),e}return b()(r,t),a()(r,[{key:"componentDidMount",value:function(){this.replaceReviews()}},{key:"componentDidUpdate",value:function(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}},{key:"shouldReplaceReviews",value:function(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!Y()(e.categoryIds,t.categoryIds)}},{key:"componentWillUnMount",value:function(){this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}},{key:"getArgs",value:function(e){var t=this.props,r=t.categoryIds,n=t.order,o=t.orderby,c=t.productId,a={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(a.category_id=Array.isArray(r)?r.join(","):r),c&&(a.product_id=c),a}},{key:"replaceReviews",value:function(){var e=this.props.onReviewsReplaced;this.updateListOfReviews().then(e)}},{key:"appendReviews",value:function(){var e=this.props,t=e.onReviewsAppended,r=e.reviewsToDisplay,n=this.state.reviews;r<=n.length||this.updateListOfReviews(n).then(t)}},{key:"updateListOfReviews",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.props.reviewsToDisplay,n=this.state.totalReviews,o=Math.min(n,r)-t.length;return this.setState({loading:!0,reviews:t.concat(Array(o).fill({}))}),Object($.c)(this.getArgs(t.length)).then(function(r){var n=r.reviews,o=r.totalReviews;return e.setState({reviews:t.filter(function(e){return Object.keys(e).length}).concat(n),totalReviews:o,loading:!1,error:null}),{newReviews:n}}).catch(this.setError)}},{key:"setError",value:function(e){var t=this;e.json().then(function(e){var r=t.props.onReviewsLoadError,n="object"===Z()(e)&&e.hasOwnProperty("message")?{apiMessage:e.message}:{apiMessage:null};t.setState({reviews:[],loading:!1,error:n}),r()})}},{key:"render",value:function(){var t=this.props.reviewsToDisplay,r=this.state,n=r.error,o=r.loading,c=r.reviews,a=r.totalReviews;return Object(p.createElement)(e,U()({},this.props,{error:n,isLoading:o,reviews:c.slice(0,t),totalReviews:a}))}}]),r}(m.Component);t.defaultProps={delayFunction:function(e){return e},onReviewsAppended:function(){},onReviewsLoadError:function(){},onReviewsReplaced:function(){}};var r=e.displayName,n=void 0===r?e.name||"Component":r;return t.displayName="WithReviews( ".concat(n," )"),t}(function(e){function t(){return o()(this,t),s()(this,u()(t).apply(this,arguments))}return b()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.error,n=e.isLoading,o=e.noReviewsPlaceholder,c=e.reviews,a=e.totalReviews;return r?Object(p.createElement)(f.a,{className:"wc-block-featured-product-error",error:r,isLoading:n}):0!==c.length||n?Object(p.createElement)(g.Disabled,null,t.showOrderby&&w.ENABLE_REVIEW_RATING&&Object(p.createElement)(q,{readOnly:!0,value:t.orderby}),Object(p.createElement)(V,{attributes:t,reviews:c}),t.showLoadMore&&a>c.length&&Object(p.createElement)(P,{screenReaderLabel:Object(h.__)("Load more reviews","woo-gutenberg-products-block")})):Object(p.createElement)(o,{attributes:t})}}]),t}(m.Component)),X=function(e){function t(){return o()(this,t),s()(this,u()(t).apply(this,arguments))}return b()(t,e),a()(t,[{key:"renderHiddenContentPlaceholder",value:function(){var e=this.props,t=e.icon,r=e.name;return Object(p.createElement)(g.Placeholder,{icon:t,label:r},Object(h.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block"))}},{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.className,n=e.noReviewsPlaceholder,o=t.categoryIds,c=t.productId,a=t.reviewsOnPageLoad,i=t.showProductName,s=t.showReviewDate,l=t.showReviewerName,u=t.showReviewContent,d=t.showReviewImage,b=t.showReviewRating,h=Object($.b)(t.orderby),m=h.order,g=h.orderby;return!(u||b||s||l||d||i)?this.renderHiddenContentPlaceholder():Object(p.createElement)("div",{className:Object($.a)(r,t)},Object(p.createElement)(K,{attributes:t,categoryIds:o,delayFunction:function(e){return Object(v.debounce)(e,400)},noReviewsPlaceholder:n,orderby:g,order:m,productId:c,reviewsToDisplay:a}))}}]),t}(m.Component);t.a=X},99:function(e,t,r){"use strict";var n=r(62),o=r.n(n),c=r(16),a=r.n(c),i=r(20),s=r.n(i),l=r(8),u=r.n(l),d=r(9),b=r.n(d),p=r(10),h=r.n(p),m=r(11),v=r.n(m),g=r(15),w=r.n(g),f=r(12),O=r.n(f),j=r(0),y=r(1),_=r(19),E=r(17),k=r.n(E),R=r(4),C=(r(7),r(26)),P=r(2),S=r(6),N=r.n(S),L=r(5),I=r(25),M=r(24);r(280);function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(r,!0).forEach(function(t){s()(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function A(e,t){if(!t)return e;var r=new RegExp(Object(R.escapeRegExp)(t),"ig");return e.replace(r,"<strong>$&</strong>")}var D=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?Object(j.createElement)(M.e,null):Object(j.createElement)(M.f,null)},H=function(e){function t(){var e;return u()(this,t),(e=h()(this,v()(t).apply(this,arguments))).state={products:[],product:0,variationsList:{},variationsLoading:!1,loading:!0},e.debouncedOnSearch=Object(R.debounce)(e.onSearch.bind(w()(e)),400),e.debouncedGetVariations=Object(R.debounce)(e.getVariations.bind(w()(e)),200),e.renderItem=e.renderItem.bind(w()(e)),e.onProductSelect=e.onProductSelect.bind(w()(e)),e}return O()(t,e),b()(t,[{key:"componentWillUnmount",value:function(){this.debouncedOnSearch.cancel(),this.debouncedGetVariations.cancel()}},{key:"componentDidMount",value:function(){var e=this,t=this.props,r=t.selected,n=t.queryArgs;Object(I.d)({selected:r,queryArgs:n}).then(function(t){t=t.map(function(e){return T({},e,{parent:0,count:e.variations?e.variations.length:0})}),e.setState({products:t,loading:!1})}).catch(function(){e.setState({products:[],loading:!1})})}},{key:"componentDidUpdate",value:function(e,t){t.product!==this.state.product&&this.debouncedGetVariations()}},{key:"getVariations",value:function(){var e=this,t=this.state,r=t.product,n=t.products,o=t.variationsList;if(r){var c=n.find(function(e){return e.id===r});c.variations&&0!==c.variations.length&&(o[r]||this.setState({variationsLoading:!0}),k()({path:Object(_.addQueryArgs)("".concat(L.ENDPOINTS.products,"/").concat(r,"/variations"),{per_page:-1})}).then(function(t){t=t.map(function(e){return T({},e,{parent:r})}),e.setState(function(e){return{variationsList:T({},e.variationsList,s()({},r,t)),variationsLoading:!1}})}).catch(function(){e.setState({termsLoading:!1})}))}else this.setState({variationsList:{},variationsLoading:!1})}},{key:"onSearch",value:function(e){var t=this,r=this.props,n=r.selected,o=r.queryArgs;Object(I.d)({selected:n,search:e,queryArgs:o}).then(function(e){t.setState({products:e,loading:!1})}).catch(function(){t.setState({products:[],loading:!1})})}},{key:"onProductSelect",value:function(e,t){var r=this;return function(){r.setState({product:t?0:e.id})}}},{key:"renderItem",value:function(e){var t=this,r=e.item,n=e.search,o=e.depth,c=void 0===o?0:o,i=e.isSelected,s=e.onSelect,l=this.state,u=l.product,d=l.variationsLoading,b=N()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(c),{"is-searching":n.length>0,"is-skip-level":0===c&&0!==r.parent,"is-variable":r.count>0}),p=Object.assign({},e);delete p.isSingle;var h={role:"menuitemradio"};return r.breadcrumbs.length&&(h["aria-label"]="".concat(r.breadcrumbs[0],": ").concat(r.name)),r.count&&(h["aria-expanded"]=r.id===u),r.breadcrumbs.length?(Object(R.isEmpty)(r.variation)||(r.name=r.variation),Object(j.createElement)(C.b,a()({className:b},e,h))):[Object(j.createElement)(P.MenuItem,a()({key:"product-".concat(r.id),isSelected:i},p,h,{className:b,onClick:function(){s(r)(),t.onProductSelect(r,i)()}}),Object(j.createElement)("span",{className:"woocommerce-search-list__item-state"},D(i)),Object(j.createElement)("span",{className:"woocommerce-search-list__item-label"},Object(j.createElement)("span",{className:"woocommerce-search-list__item-name",dangerouslySetInnerHTML:{__html:A(r.name,n)}})),r.count?Object(j.createElement)("span",{className:"woocommerce-search-list__item-variation-count"},Object(y.sprintf)(Object(y._n)("%d variation","%d variations",r.count,"woo-gutenberg-products-block"),r.count)):null),u===r.id&&r.count>0&&d&&Object(j.createElement)("div",{key:"loading",className:"woocommerce-search-list__item woocommerce-search-product__itemdepth-1 is-loading is-not-active"},Object(j.createElement)(P.Spinner,null))]}},{key:"render",value:function(){var e=this.state,t=e.products,r=e.loading,n=e.product,c=e.variationsList,a=this.props,i=a.onChange,s=a.renderItem,l=a.selected,u=c[n]||[],d=[].concat(o()(t),o()(u)),b={list:Object(y.__)("Products","woo-gutenberg-products-block"),noItems:Object(y.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(y.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(y.__)("Product search results updated.","woo-gutenberg-products-block")},p=l?[Object(R.find)(d,{id:l})]:[];return Object(j.createElement)(j.Fragment,null,Object(j.createElement)(C.a,{className:"woocommerce-products",list:d,isLoading:r,isSingle:!0,selected:p,onChange:i,renderItem:s||this.renderItem,onSearch:L.IS_LARGE_CATALOG?this.debouncedOnSearch:null,messages:b,isHierarchical:!0}))}}]),t}(j.Component);t.a=H}});
build/style.css CHANGED
@@ -1,4 +1,4 @@
1
- @-webkit-keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}@keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}.wc-block-grid__products{display:-webkit-box;display:flex;flex-wrap:wrap;list-style:none;padding:0;margin:0 0 24px}.wc-block-grid__product{padding:0 16px 0 0;margin:0 0 24px;float:none;width:auto;position:relative;text-align:center}.wc-block-grid__product-link{text-decoration:none;border:0}.wc-block-grid__product-image{text-decoration:none;margin-bottom:16px;display:block}.wc-block-grid__product-image img{vertical-align:middle;margin-left:auto;margin-right:auto}.wc-block-grid__product-title{line-height:1.2;font-weight:700}.wc-block-grid__product-price,.wc-block-grid__product-rating,.wc-block-grid__product-title{margin-bottom:12px;display:block}.wc-block-grid__product-add-to-cart,.wc-block-grid__product-add-to-cart a{margin:0;word-break:break-word;white-space:normal}.wc-block-grid__product-add-to-cart a.loading{opacity:.25;padding-right:2.618em}.wc-block-grid__product-add-to-cart a.loading:after{font-family:WooCommerce;content:"\e01c";vertical-align:top;font-weight:400;position:absolute;top:.618em;right:1em;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite}.wc-block-grid__product-add-to-cart a.added:after{font-family:WooCommerce;content:"\e017";margin-left:.53em;vertical-align:bottom}.wc-block-grid__product-add-to-cart .added_to_cart{text-align:center}.wc-block-grid__product-onsale{font-weight:700;position:absolute;text-align:center;top:0;left:0;margin:0;background-color:#000;color:#fff;display:inline-block;font-size:.75em;padding:.5em;z-index:9;text-transform:uppercase}.wc-block-grid__product-rating .star-rating{overflow:hidden;position:relative;width:5.3em;height:1.618em;line-height:1.618;font-size:1em;font-family:star;font-weight:400;display:inline-block;margin:0 auto;text-align:left}.wc-block-grid__product-rating .star-rating:before{content:"\53\53\53\53\53";top:0;left:0;right:0;position:absolute;opacity:.5;color:#aaa}.wc-block-grid__product-rating .star-rating span{overflow:hidden;top:0;left:0;right:0;position:absolute;padding-top:1.5em}.wc-block-grid__product-rating .star-rating span:before{content:"\53\53\53\53\53";top:0;left:0;right:0;position:absolute;color:#000}.wc-block-grid.has-aligned-buttons .wc-block-grid__product{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.wc-block-grid.has-aligned-buttons .wc-block-grid__product-add-to-cart{margin-top:auto!important}.wc-block-grid.has-1-columns .wc-block-grid__products{display:block}.wc-block-grid.has-1-columns .wc-block-grid__product{margin-left:auto;margin-right:auto}.wc-block-grid.has-2-columns .wc-block-grid__product{-webkit-box-flex:1;flex:1 0 50%;max-width:50%}.wc-block-grid.has-3-columns .wc-block-grid__product{-webkit-box-flex:1;flex:1 0 33.33333%;max-width:33.33333%}.wc-block-grid.has-4-columns .wc-block-grid__product{-webkit-box-flex:1;flex:1 0 25%;max-width:25%}.wc-block-grid.has-5-columns .wc-block-grid__product{-webkit-box-flex:1;flex:1 0 20%;max-width:20%}.wc-block-grid.has-6-columns .wc-block-grid__product{-webkit-box-flex:1;flex:1 0 16.66667%;max-width:16.66667%}.wc-block-grid.has-7-columns .wc-block-grid__product{-webkit-box-flex:1;flex:1 0 14.28571%;max-width:14.28571%}.wc-block-grid.has-8-columns .wc-block-grid__product{-webkit-box-flex:1;flex:1 0 12.5%;max-width:12.5%}.wc-block-grid.has-4-columns:not(.alignwide):not(.alignfull) .wc-block-grid__product,.wc-block-grid.has-5-columns:not(.alignfull) .wc-block-grid__product,.wc-block-grid.has-6-columns:not(.alignfull) .wc-block-grid__product,.wc-block-grid.has-7-columns .wc-block-grid__product,.wc-block-grid.has-8-columns .wc-block-grid__product{font-size:.8em}.theme-twentysixteen .wc-block-grid .price ins{color:#77a464}.theme-twentynineteen .wc-block-grid__product{font-size:.88889em}.theme-twentynineteen .wc-block-grid__product-onsale,.theme-twentynineteen .wc-block-grid__product-title{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.theme-twentynineteen .wc-block-grid__product-onsale{line-height:1}
2
  @-webkit-keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}@keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}.wc-block-featured-category{position:relative;background-color:#24292d;background-size:cover;background-position:50%;width:100%;margin:0 0 1.5em}.wc-block-featured-category,.wc-block-featured-category .wc-block-featured-category__wrapper{display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;flex-wrap:wrap;align-content:center}.wc-block-featured-category .wc-block-featured-category__wrapper{overflow:hidden;height:100%}.wc-block-featured-category.has-left-content{-webkit-box-pack:start;justify-content:flex-start}.wc-block-featured-category.has-left-content .wc-block-featured-category__description,.wc-block-featured-category.has-left-content .wc-block-featured-category__price,.wc-block-featured-category.has-left-content .wc-block-featured-category__title{margin-left:0;text-align:left}.wc-block-featured-category.has-right-content{-webkit-box-pack:end;justify-content:flex-end}.wc-block-featured-category.has-right-content .wc-block-featured-category__description,.wc-block-featured-category.has-right-content .wc-block-featured-category__price,.wc-block-featured-category.has-right-content .wc-block-featured-category__title{margin-right:0;text-align:right}.wc-block-featured-category .wc-block-featured-category__description,.wc-block-featured-category .wc-block-featured-category__price,.wc-block-featured-category .wc-block-featured-category__title{color:#fff;line-height:1.25;margin-bottom:0;text-align:center}.wc-block-featured-category .wc-block-featured-category__description a,.wc-block-featured-category .wc-block-featured-category__description a:active,.wc-block-featured-category .wc-block-featured-category__description a:focus,.wc-block-featured-category .wc-block-featured-category__description a:hover,.wc-block-featured-category .wc-block-featured-category__price a,.wc-block-featured-category .wc-block-featured-category__price a:active,.wc-block-featured-category .wc-block-featured-category__price a:focus,.wc-block-featured-category .wc-block-featured-category__price a:hover,.wc-block-featured-category .wc-block-featured-category__title a,.wc-block-featured-category .wc-block-featured-category__title a:active,.wc-block-featured-category .wc-block-featured-category__title a:focus,.wc-block-featured-category .wc-block-featured-category__title a:hover{color:#fff}.wc-block-featured-category .wc-block-featured-category__description,.wc-block-featured-category .wc-block-featured-category__link,.wc-block-featured-category .wc-block-featured-category__price,.wc-block-featured-category .wc-block-featured-category__title{width:100%;padding:0 48px 16px;z-index:1}.wc-block-featured-category .wc-block-featured-category__title{margin-top:0}.wc-block-featured-category .wc-block-featured-category__title:before{display:none}.wc-block-featured-category .wc-block-featured-category__description p{margin:0}.wc-block-featured-category.has-background-dim:before{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background-color:inherit;opacity:.5;z-index:1}.wc-block-featured-category.has-background-dim.has-background-dim-10:before{opacity:.1}.wc-block-featured-category.has-background-dim.has-background-dim-20:before{opacity:.2}.wc-block-featured-category.has-background-dim.has-background-dim-30:before{opacity:.3}.wc-block-featured-category.has-background-dim.has-background-dim-40:before{opacity:.4}.wc-block-featured-category.has-background-dim.has-background-dim-50:before{opacity:.5}.wc-block-featured-category.has-background-dim.has-background-dim-60:before{opacity:.6}.wc-block-featured-category.has-background-dim.has-background-dim-70:before{opacity:.7}.wc-block-featured-category.has-background-dim.has-background-dim-80:before{opacity:.8}.wc-block-featured-category.has-background-dim.has-background-dim-90:before{opacity:.9}.wc-block-featured-category.has-background-dim.has-background-dim-100:before{opacity:1}.wc-block-featured-category.alignleft,.wc-block-featured-category.alignright{max-width:305px;width:100%}.wc-block-featured-category:after{display:block;content:"";font-size:0;min-height:inherit}@supports ((position:-webkit-sticky) or (position:sticky)){.wc-block-featured-category:after{content:none}}.wc-block-featured-category.aligncenter,.wc-block-featured-category.alignleft,.wc-block-featured-category.alignright{display:-webkit-box;display:flex}
3
  @-webkit-keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}@keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}.woocommerce-product-categories__operator .components-base-control__help{clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;width:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;word-wrap:normal!important}.components-panel .woocommerce-product-categories__operator.components-base-control{margin-top:16px}.components-panel .woocommerce-product-categories__operator.components-base-control .components-select-control__input{margin-left:0;min-width:100%}
4
  @-webkit-keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}@keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}.wc-block-product-categories{margin-bottom:1em}.wc-block-product-categories.is-dropdown{display:-webkit-box;display:flex}.wc-block-product-categories select{margin-right:.5em}.wp-block-woocommerce-product-categories.is-loading .wc-block-product-categories__placeholder{display:inline-block;height:1em;width:50%;min-width:200px;background:currentColor;opacity:.2}.wc-block-product-categories__button{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;text-decoration:none;font-size:13px;margin:0;border:none;cursor:pointer;background:none;padding:8px;color:#555d66;position:relative;overflow:hidden;border-radius:4px}.wc-block-product-categories__button svg{fill:currentColor;outline:none}.wc-block-product-categories__button:active{color:currentColor}.wc-block-product-categories__button:disabled,.wc-block-product-categories__button[aria-disabled=true]{cursor:default;opacity:.3}.wc-block-product-categories__button:focus:enabled{background-color:#fff;color:#191e23;box-shadow:inset 0 0 0 1px #6c7781,inset 0 0 0 2px #fff;outline:2px solid transparent;outline-offset:-2px}.wc-block-product-categories__button:not(:disabled):not([aria-disabled=true]):hover{background-color:#fff;color:#191e23;box-shadow:inset 0 0 0 1px #e2e4e7,inset 0 0 0 2px #fff,0 1px 1px rgba(25,30,35,.2)}.wc-block-product-categories__button:not(:disabled):not([aria-disabled=true]):active{outline:none;background-color:#fff;color:#191e23;box-shadow:inset 0 0 0 1px #ccd0d4,inset 0 0 0 2px #fff}.wc-block-product-categories__button:disabled:focus,.wc-block-product-categories__button[aria-disabled=true]:focus{box-shadow:none}
1
+ @-webkit-keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}@keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}.wc-block-grid__products{display:-webkit-box;display:flex;flex-wrap:wrap;list-style:none;padding:0;margin:0 0 24px}.wc-block-grid__product{box-sizing:border-box;padding:0 16px 0 0;margin:0 0 24px;float:none;width:auto;position:relative;text-align:center}.wc-block-grid__product-link{text-decoration:none;border:0}.wc-block-grid__product-image{text-decoration:none;margin-bottom:16px;display:block}.wc-block-grid__product-image img{vertical-align:middle;margin-left:auto;margin-right:auto}.wc-block-grid__product-title{line-height:1.2;font-weight:700}.wc-block-grid__product-price,.wc-block-grid__product-rating,.wc-block-grid__product-title{margin-bottom:12px;display:block}.wc-block-grid__product-add-to-cart,.wc-block-grid__product-add-to-cart a{margin:0;word-break:break-word;white-space:normal}.wc-block-grid__product-add-to-cart a.loading{opacity:.25;padding-right:2.618em}.wc-block-grid__product-add-to-cart a.loading:after{font-family:WooCommerce;content:"\e01c";vertical-align:top;font-weight:400;position:absolute;top:.618em;right:1em;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite}.wc-block-grid__product-add-to-cart a.added:after{font-family:WooCommerce;content:"\e017";margin-left:.53em;vertical-align:bottom}.wc-block-grid__product-add-to-cart .added_to_cart{text-align:center}.wc-block-grid__product-onsale{font-weight:700;position:absolute;text-align:center;top:0;left:0;margin:0;background-color:#000;color:#fff;display:inline-block;font-size:.75em;padding:.5em;z-index:9;text-transform:uppercase}.wc-block-grid__product-rating .star-rating{overflow:hidden;position:relative;width:5.3em;height:1.618em;line-height:1.618;font-size:1em;font-family:star;font-weight:400;display:inline-block;margin:0 auto;text-align:left}.wc-block-grid__product-rating .star-rating:before{content:"\53\53\53\53\53";top:0;left:0;right:0;position:absolute;opacity:.5;color:#aaa}.wc-block-grid__product-rating .star-rating span{overflow:hidden;top:0;left:0;right:0;position:absolute;padding-top:1.5em}.wc-block-grid__product-rating .star-rating span:before{content:"\53\53\53\53\53";top:0;left:0;right:0;position:absolute;color:#000}.wc-block-grid.has-aligned-buttons .wc-block-grid__product{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.wc-block-grid.has-aligned-buttons .wc-block-grid__product-add-to-cart{margin-top:auto!important}.wc-block-grid.has-1-columns .wc-block-grid__products{display:block}.wc-block-grid.has-1-columns .wc-block-grid__product{margin-left:auto;margin-right:auto}.wc-block-grid.has-2-columns .wc-block-grid__product{-webkit-box-flex:1;flex:1 0 50%;max-width:50%}.wc-block-grid.has-3-columns .wc-block-grid__product{-webkit-box-flex:1;flex:1 0 33.33333%;max-width:33.33333%}.wc-block-grid.has-4-columns .wc-block-grid__product{-webkit-box-flex:1;flex:1 0 25%;max-width:25%}.wc-block-grid.has-5-columns .wc-block-grid__product{-webkit-box-flex:1;flex:1 0 20%;max-width:20%}.wc-block-grid.has-6-columns .wc-block-grid__product{-webkit-box-flex:1;flex:1 0 16.66667%;max-width:16.66667%}.wc-block-grid.has-7-columns .wc-block-grid__product{-webkit-box-flex:1;flex:1 0 14.28571%;max-width:14.28571%}.wc-block-grid.has-8-columns .wc-block-grid__product{-webkit-box-flex:1;flex:1 0 12.5%;max-width:12.5%}.wc-block-grid.has-4-columns:not(.alignwide):not(.alignfull) .wc-block-grid__product,.wc-block-grid.has-5-columns:not(.alignfull) .wc-block-grid__product,.wc-block-grid.has-6-columns:not(.alignfull) .wc-block-grid__product,.wc-block-grid.has-7-columns .wc-block-grid__product,.wc-block-grid.has-8-columns .wc-block-grid__product{font-size:.8em}.theme-twentysixteen .wc-block-grid .price ins{color:#77a464}.theme-twentynineteen .wc-block-grid__product{font-size:.88889em}.theme-twentynineteen .wc-block-grid__product-onsale,.theme-twentynineteen .wc-block-grid__product-title{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.theme-twentynineteen .wc-block-grid__product-onsale{line-height:1}
2
  @-webkit-keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}@keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}.wc-block-featured-category{position:relative;background-color:#24292d;background-size:cover;background-position:50%;width:100%;margin:0 0 1.5em}.wc-block-featured-category,.wc-block-featured-category .wc-block-featured-category__wrapper{display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;flex-wrap:wrap;align-content:center}.wc-block-featured-category .wc-block-featured-category__wrapper{overflow:hidden;height:100%}.wc-block-featured-category.has-left-content{-webkit-box-pack:start;justify-content:flex-start}.wc-block-featured-category.has-left-content .wc-block-featured-category__description,.wc-block-featured-category.has-left-content .wc-block-featured-category__price,.wc-block-featured-category.has-left-content .wc-block-featured-category__title{margin-left:0;text-align:left}.wc-block-featured-category.has-right-content{-webkit-box-pack:end;justify-content:flex-end}.wc-block-featured-category.has-right-content .wc-block-featured-category__description,.wc-block-featured-category.has-right-content .wc-block-featured-category__price,.wc-block-featured-category.has-right-content .wc-block-featured-category__title{margin-right:0;text-align:right}.wc-block-featured-category .wc-block-featured-category__description,.wc-block-featured-category .wc-block-featured-category__price,.wc-block-featured-category .wc-block-featured-category__title{color:#fff;line-height:1.25;margin-bottom:0;text-align:center}.wc-block-featured-category .wc-block-featured-category__description a,.wc-block-featured-category .wc-block-featured-category__description a:active,.wc-block-featured-category .wc-block-featured-category__description a:focus,.wc-block-featured-category .wc-block-featured-category__description a:hover,.wc-block-featured-category .wc-block-featured-category__price a,.wc-block-featured-category .wc-block-featured-category__price a:active,.wc-block-featured-category .wc-block-featured-category__price a:focus,.wc-block-featured-category .wc-block-featured-category__price a:hover,.wc-block-featured-category .wc-block-featured-category__title a,.wc-block-featured-category .wc-block-featured-category__title a:active,.wc-block-featured-category .wc-block-featured-category__title a:focus,.wc-block-featured-category .wc-block-featured-category__title a:hover{color:#fff}.wc-block-featured-category .wc-block-featured-category__description,.wc-block-featured-category .wc-block-featured-category__link,.wc-block-featured-category .wc-block-featured-category__price,.wc-block-featured-category .wc-block-featured-category__title{width:100%;padding:0 48px 16px;z-index:1}.wc-block-featured-category .wc-block-featured-category__title{margin-top:0}.wc-block-featured-category .wc-block-featured-category__title:before{display:none}.wc-block-featured-category .wc-block-featured-category__description p{margin:0}.wc-block-featured-category.has-background-dim:before{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background-color:inherit;opacity:.5;z-index:1}.wc-block-featured-category.has-background-dim.has-background-dim-10:before{opacity:.1}.wc-block-featured-category.has-background-dim.has-background-dim-20:before{opacity:.2}.wc-block-featured-category.has-background-dim.has-background-dim-30:before{opacity:.3}.wc-block-featured-category.has-background-dim.has-background-dim-40:before{opacity:.4}.wc-block-featured-category.has-background-dim.has-background-dim-50:before{opacity:.5}.wc-block-featured-category.has-background-dim.has-background-dim-60:before{opacity:.6}.wc-block-featured-category.has-background-dim.has-background-dim-70:before{opacity:.7}.wc-block-featured-category.has-background-dim.has-background-dim-80:before{opacity:.8}.wc-block-featured-category.has-background-dim.has-background-dim-90:before{opacity:.9}.wc-block-featured-category.has-background-dim.has-background-dim-100:before{opacity:1}.wc-block-featured-category.alignleft,.wc-block-featured-category.alignright{max-width:305px;width:100%}.wc-block-featured-category:after{display:block;content:"";font-size:0;min-height:inherit}@supports ((position:-webkit-sticky) or (position:sticky)){.wc-block-featured-category:after{content:none}}.wc-block-featured-category.aligncenter,.wc-block-featured-category.alignleft,.wc-block-featured-category.alignright{display:-webkit-box;display:flex}
3
  @-webkit-keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}@keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}.woocommerce-product-categories__operator .components-base-control__help{clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;width:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;word-wrap:normal!important}.components-panel .woocommerce-product-categories__operator.components-base-control{margin-top:16px}.components-panel .woocommerce-product-categories__operator.components-base-control .components-select-control__input{margin-left:0;min-width:100%}
4
  @-webkit-keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}@keyframes loading-fade{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}.wc-block-product-categories{margin-bottom:1em}.wc-block-product-categories.is-dropdown{display:-webkit-box;display:flex}.wc-block-product-categories select{margin-right:.5em}.wp-block-woocommerce-product-categories.is-loading .wc-block-product-categories__placeholder{display:inline-block;height:1em;width:50%;min-width:200px;background:currentColor;opacity:.2}.wc-block-product-categories__button{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;text-decoration:none;font-size:13px;margin:0;border:none;cursor:pointer;background:none;padding:8px;color:#555d66;position:relative;overflow:hidden;border-radius:4px}.wc-block-product-categories__button svg{fill:currentColor;outline:none}.wc-block-product-categories__button:active{color:currentColor}.wc-block-product-categories__button:disabled,.wc-block-product-categories__button[aria-disabled=true]{cursor:default;opacity:.3}.wc-block-product-categories__button:focus:enabled{background-color:#fff;color:#191e23;box-shadow:inset 0 0 0 1px #6c7781,inset 0 0 0 2px #fff;outline:2px solid transparent;outline-offset:-2px}.wc-block-product-categories__button:not(:disabled):not([aria-disabled=true]):hover{background-color:#fff;color:#191e23;box-shadow:inset 0 0 0 1px #e2e4e7,inset 0 0 0 2px #fff,0 1px 1px rgba(25,30,35,.2)}.wc-block-product-categories__button:not(:disabled):not([aria-disabled=true]):active{outline:none;background-color:#fff;color:#191e23;box-shadow:inset 0 0 0 1px #ccd0d4,inset 0 0 0 2px #fff}.wc-block-product-categories__button:disabled:focus,.wc-block-product-categories__button[aria-disabled=true]:focus{box-shadow:none}
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks
4
  Requires at least: 5.0
5
  Tested up to: 5.2
6
  Requires PHP: 5.6
7
- Stable tag: 2.4.1
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -104,6 +104,11 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/
104
 
105
  == Changelog ==
106
 
 
 
 
 
 
107
  = 2.4.1 - 2019-08-30 =
108
 
109
  - Fix conflict with WooCommerce Admin.
4
  Requires at least: 5.0
5
  Tested up to: 5.2
6
  Requires PHP: 5.6
7
+ Stable tag: 2.4.2
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
104
 
105
  == Changelog ==
106
 
107
+ = 2.4.2 - 2019-09-23 =
108
+
109
+ - Fix product grids overflowing in some themes
110
+ - Fix regression that prevented selecting product variations in the Featured Product block.
111
+
112
  = 2.4.1 - 2019-08-30 =
113
 
114
  - Fix conflict with WooCommerce Admin.
src/Package.php CHANGED
@@ -19,7 +19,7 @@ class Package {
19
  *
20
  * @var string
21
  */
22
- const VERSION = '2.4.1';
23
 
24
  /**
25
  * Stores if init has ran yet.
19
  *
20
  * @var string
21
  */
22
+ const VERSION = '2.4.2';
23
 
24
  /**
25
  * Stores if init has ran yet.
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitd45de5c87f4ea6630715612039d2ec6e::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit509bb11fe2ac5e75c122df8f8e7590b6::getLoader();
vendor/autoload_packages.php CHANGED
@@ -120,10 +120,10 @@ if ( ! function_exists( __NAMESPACE__ . '\autoloader' ) ) {
120
  /**
121
  * Prepare all the classes for autoloading.
122
  */
123
- function enqueue_packages_a449bf5d7e8e09cb45b8e82bdaf38de5() {
124
  $class_map = require_once dirname( __FILE__ ) . '/composer/autoload_classmap_package.php';
125
  foreach ( $class_map as $class_name => $class_info ) {
126
  enqueue_package_class( $class_name, $class_info['version'], $class_info['path'] );
127
  }
128
  }
129
- enqueue_packages_a449bf5d7e8e09cb45b8e82bdaf38de5();
120
  /**
121
  * Prepare all the classes for autoloading.
122
  */
123
+ function enqueue_packages_108604f329bb99b0fa03b5df7c9f4d3b() {
124
  $class_map = require_once dirname( __FILE__ ) . '/composer/autoload_classmap_package.php';
125
  foreach ( $class_map as $class_name => $class_info ) {
126
  enqueue_package_class( $class_name, $class_info['version'], $class_info['path'] );
127
  }
128
  }
129
+ enqueue_packages_108604f329bb99b0fa03b5df7c9f4d3b();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitd45de5c87f4ea6630715612039d2ec6e
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInitd45de5c87f4ea6630715612039d2ec6e
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitd45de5c87f4ea6630715612039d2ec6e', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitd45de5c87f4ea6630715612039d2ec6e', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInitd45de5c87f4ea6630715612039d2ec6e::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit509bb11fe2ac5e75c122df8f8e7590b6
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit509bb11fe2ac5e75c122df8f8e7590b6', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit509bb11fe2ac5e75c122df8f8e7590b6', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit509bb11fe2ac5e75c122df8f8e7590b6::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitd45de5c87f4ea6630715612039d2ec6e
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
@@ -36,8 +36,8 @@ class ComposerStaticInitd45de5c87f4ea6630715612039d2ec6e
36
  public static function getInitializer(ClassLoader $loader)
37
  {
38
  return \Closure::bind(function () use ($loader) {
39
- $loader->prefixLengthsPsr4 = ComposerStaticInitd45de5c87f4ea6630715612039d2ec6e::$prefixLengthsPsr4;
40
- $loader->prefixDirsPsr4 = ComposerStaticInitd45de5c87f4ea6630715612039d2ec6e::$prefixDirsPsr4;
41
 
42
  }, null, ClassLoader::class);
43
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit509bb11fe2ac5e75c122df8f8e7590b6
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
36
  public static function getInitializer(ClassLoader $loader)
37
  {
38
  return \Closure::bind(function () use ($loader) {
39
+ $loader->prefixLengthsPsr4 = ComposerStaticInit509bb11fe2ac5e75c122df8f8e7590b6::$prefixLengthsPsr4;
40
+ $loader->prefixDirsPsr4 = ComposerStaticInit509bb11fe2ac5e75c122df8f8e7590b6::$prefixDirsPsr4;
41
 
42
  }, null, ClassLoader::class);
43
  }
woocommerce-gutenberg-products-block.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce Blocks
4
  * Plugin URI: https://github.com/woocommerce/woocommerce-gutenberg-products-block
5
  * Description: WooCommerce blocks for the Gutenberg editor.
6
- * Version: 2.4.1
7
  * Author: Automattic
8
  * Author URI: https://woocommerce.com
9
  * Text Domain: woo-gutenberg-products-block
3
  * Plugin Name: WooCommerce Blocks
4
  * Plugin URI: https://github.com/woocommerce/woocommerce-gutenberg-products-block
5
  * Description: WooCommerce blocks for the Gutenberg editor.
6
+ * Version: 2.4.2
7
  * Author: Automattic
8
  * Author URI: https://woocommerce.com
9
  * Text Domain: woo-gutenberg-products-block