text: this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-tag"]=function(t){function e(e){for(var r,i,u=e[0],s=e[1],a=e[2],b=0,g=[];b<u.length;b++)i=u[b],Object.prototype.hasOwnProperty.call(c,i)&&c[i]&&g.push(c[i][0]),c[i]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(t[r]=s[r]);for(l&&l(e);g.length;)g.shift()();return o.push.apply(o,a||[]),n()}function n(){for(var t,e=0;e<o.length;e++){for(var n=o[e],r=!0,u=1;u<n.length;u++){var s=n[u];0!==c[s]&&(r=!1)}r&&(o.splice(e--,1),t=i(i.s=n[0]))}return t}var r={},c={32:0},o=[];function i(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=t,i.c=r,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="";var u=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=u.push.bind(u);u.push=e,u=u.slice();for(var a=0;a<u.length;a++)e(u[a]);var l=s;return o.push([853,0]),n()}({0:function(t,e){!function(){t.exports=this.wp.element}()},1:function(t,e){!function(){t.exports=this.wp.i18n}()},110:function(t,e){},111:function(t,e){},112:function(t,e){},113:function(t,e){},114:function(t,e){},115:function(t,e){},116:function(t,e){},117:function(t,e){},118:function(t,e){},119:function(t,e){},120:function(t,e){},121:function(t,e){},122:function(t,e){},129:function(t,e,n){"use strict";var r=n(0),c=n(1),o=n(4);n(2);e.a=function(t){var e=t.value,n=t.setAttributes;return Object(r.createElement)(o.SelectControl,{label:Object(c.__)("Order products by","woo-gutenberg-products-block"),value:e,options:[{label:Object(c.__)("Newness - newest first","woo-gutenberg-products-block"),value:"date"},{label:Object(c.__)("Price - low to high","woo-gutenberg-products-block"),value:"price_asc"},{label:Object(c.__)("Price - high to low","woo-gutenberg-products-block"),value:"price_desc"},{label:Object(c.__)("Rating - highest first","woo-gutenberg-products-block"),value:"rating"},{label:Object(c.__)("Sales - most first","woo-gutenberg-products-block"),value:"popularity"},{label:Object(c.__)("Title - alphabetical","woo-gutenberg-products-block"),value:"title"},{label:Object(c.__)("Menu Order","woo-gutenberg-products-block"),value:"menu_order"}],onChange:function(t){return n({orderby:t})}})}},13:function(t,e){!function(){t.exports=this.wp.apiFetch}()},15:function(t,e){!function(){t.exports=this.wp.blockEditor}()},178:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0),c=n(5),o=Object(r.createElement)("img",{src:c.T+"img/grid.svg",alt:"Grid Preview",width:"230",height:"250",style:{width:"100%"}})},19:function(t,e){!function(){t.exports=this.wp.blocks}()},20:function(t,e){!function(){t.exports=this.wp.url}()},3:function(t,e){!function(){t.exports=this.wc.wcSettings}()},32:function(t,e){!function(){t.exports=this.wp.htmlEntities}()},34:function(t,e){!function(){t.exports=this.moment}()},37:function(t,e){!function(){t.exports=this.wp.isShallowEqual}()},4:function(t,e){!function(){t.exports=this.wp.components}()},43:function(t,e,n){"use strict";n.d(e,"h",(function(){return g})),n.d(e,"e",(function(){return d})),n.d(e,"b",(function(){return p})),n.d(e,"i",(function(){return f})),n.d(e,"f",(function(){return O})),n.d(e,"c",(function(){return h})),n.d(e,"d",(function(){return j})),n.d(e,"g",(function(){return m})),n.d(e,"a",(function(){return w}));var r=n(9),c=n.n(r),o=n(20),i=n(13),u=n.n(i),s=n(7),a=n(5);function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function b(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){c()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var g=function(t){var e=t.selected,n=void 0===e?[]:e,r=t.search,c=void 0===r?"":r,i=t.queryArgs,l=function(t){var e=t.selected,n=void 0===e?[]:e,r=t.search,c=void 0===r?"":r,i=t.queryArgs,u=void 0===i?[]:i,s={per_page:a.v?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},l=[Object(o.addQueryArgs)("/wc/store/products",b(b({},s),u))];return a.v&&n.length&&l.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:n})),l}({selected:n,search:c,queryArgs:void 0===i?[]:i});return Promise.all(l.map((function(t){return u()({path:t})}))).then((function(t){return Object(s.uniqBy)(Object(s.flatten)(t),"id").map((function(t){return b(b({},t),{},{parent:0})}))})).catch((function(t){throw t}))},d=function(t){return u()({path:"/wc/store/products/".concat(t)})},p=function(){return u()({path:"wc/store/products/attributes"})},f=function(t){return u()({path:"wc/store/products/attributes/".concat(t,"/terms")})},O=function(t){var e=t.selected,n=function(t){var e=t.selected,n=void 0===e?[]:e,r=t.search,c=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:a.x?100:0,orderby:a.x?"count":"name",order:a.x?"desc":"asc",search:r})];return a.x&&n.length&&c.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:n})),c}({selected:void 0===e?[]:e,search:t.search});return Promise.all(n.map((function(t){return u()({path:t})}))).then((function(t){return Object(s.uniqBy)(Object(s.flatten)(t),"id")}))},h=function(t){return u()({path:Object(o.addQueryArgs)("wc/store/products/categories",b({per_page:0},t))})},j=function(t){return u()({path:"wc/store/products/categories/".concat(t)})},m=function(t){return u()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:t})})},w=function(t,e){if(!t.title.raw)return t.slug;var n=1===e.filter((function(e){return e.title.raw===t.title.raw})).length;return t.title.raw+(n?"":" - ".concat(t.slug))}},5:function(t,e,n){"use strict";n.d(e,"l",(function(){return c})),n.d(e,"J",(function(){return o})),n.d(e,"P",(function(){return i})),n.d(e,"z",(function(){return u})),n.d(e,"B",(function(){return s})),n.d(e,"m",(function(){return a})),n.d(e,"A",(function(){return l})),n.d(e,"D",(function(){return b})),n.d(e,"o",(function(){return g})),n.d(e,"C",(function(){return d})),n.d(e,"n",(function(){return p})),n.d(e,"F",(function(){return f})),n.d(e,"v",(function(){return O})),n.d(e,"x",(function(){return h})),n.d(e,"s",(function(){return j})),n.d(e,"t",(function(){return m})),n.d(e,"u",(function(){return w})),n.d(e,"k",(function(){return y})),n.d(e,"L",(function(){return v})),n.d(e,"Q",(function(){return k})),n.d(e,"q",(function(){return _})),n.d(e,"r",(function(){return S})),n.d(e,"p",(function(){return E})),n.d(e,"I",(function(){return P})),n.d(e,"c",(function(){return C})),n.d(e,"w",(function(){return x})),n.d(e,"T",(function(){return T})),n.d(e,"U",(function(){return D})),n.d(e,"K",(function(){return B})),n.d(e,"a",(function(){return R})),n.d(e,"N",(function(){return N})),n.d(e,"b",(function(){return M})),n.d(e,"M",(function(){return I})),n.d(e,"E",(function(){return z})),n.d(e,"i",(function(){return V})),n.d(e,"O",(function(){return q})),n.d(e,"h",(function(){return F})),n.d(e,"j",(function(){return Q})),n.d(e,"H",(function(){return U})),n.d(e,"G",(function(){return G})),n.d(e,"S",(function(){return W})),n.d(e,"R",(function(){return $})),n.d(e,"d",(function(){return J})),n.d(e,"e",(function(){return Y})),n.d(e,"f",(function(){return K})),n.d(e,"g",(function(){return X})),n.d(e,"y",(function(){return Z})),n.d(e,"X",(function(){return et})),n.d(e,"Y",(function(){return nt})),n.d(e,"V",(function(){return rt})),n.d(e,"W",(function(){return ct}));var r=n(3),c=Object(r.getSetting)("currentUserIsAdmin",!1),o=Object(r.getSetting)("reviewRatingsEnabled",!0),i=Object(r.getSetting)("showAvatars",!0),u=Object(r.getSetting)("max_columns",6),s=Object(r.getSetting)("min_columns",1),a=Object(r.getSetting)("default_columns",3),l=Object(r.getSetting)("max_rows",6),b=Object(r.getSetting)("min_rows",1),g=Object(r.getSetting)("default_rows",3),d=Object(r.getSetting)("min_height",500),p=Object(r.getSetting)("default_height",500),f=Object(r.getSetting)("placeholderImgSrc",""),O=(Object(r.getSetting)("thumbnail_size",300),Object(r.getSetting)("isLargeCatalog")),h=Object(r.getSetting)("limitTags"),j=Object(r.getSetting)("hasProducts",!0),m=Object(r.getSetting)("hasTags",!0),w=Object(r.getSetting)("homeUrl",""),y=Object(r.getSetting)("couponsEnabled",!0),v=Object(r.getSetting)("shippingEnabled",!0),k=Object(r.getSetting)("taxesEnabled",!0),_=Object(r.getSetting)("displayItemizedTaxes",!1),S=Object(r.getSetting)("hasDarkEditorStyleSupport",!1),E=(Object(r.getSetting)("displayShopPricesIncludingTax",!1),Object(r.getSetting)("displayCartPricesIncludingTax",!1)),P=Object(r.getSetting)("productCount",0),C=Object(r.getSetting)("attributes",[]),x=Object(r.getSetting)("isShippingCalculatorEnabled",!0),A=(Object(r.getSetting)("isShippingCostHidden",!1),Object(r.getSetting)("woocommerceBlocksPhase",1)),T=Object(r.getSetting)("wcBlocksAssetUrl",""),D=Object(r.getSetting)("wcBlocksBuildUrl",""),B=Object(r.getSetting)("shippingCountries",{}),R=Object(r.getSetting)("allowedCountries",{}),N=Object(r.getSetting)("shippingStates",{}),M=Object(r.getSetting)("allowedStates",{}),I=Object(r.getSetting)("shippingMethodsExist",!1),z=Object(r.getSetting)("paymentGatewaySortOrder",[]),V=Object(r.getSetting)("checkoutShowLoginReminder",!0),H={id:0,title:"",permalink:""},L=Object(r.getSetting)("storePages",{shop:H,cart:H,checkout:H,privacy:H,terms:H}),q=L.shop.permalink,F=L.checkout.id,Q=L.checkout.permalink,U=L.privacy.permalink,G=L.privacy.title,W=L.terms.permalink,$=L.terms.title,J=L.cart.id,Y=L.cart.permalink,K=Object(r.getSetting)("checkoutAllowsGuest",!1),X=Object(r.getSetting)("checkoutAllowsSignup",!1),Z=Object(r.getSetting)("loginUrl","/wp-login.php"),tt=n(19),et=function(t,e){if(A>2)return Object(tt.registerBlockType)(t,e)},nt=function(t,e){if(A>1)return Object(tt.registerBlockType)(t,e)},rt=function(){return A>2},ct=function(){return A>1}},55:function(t,e){!function(){t.exports=this.wp.keycodes}()},6:function(t,e){!function(){t.exports=this.React}()},64:function(t,e,n){"use strict";var r=n(9),c=n.n(r),o=n(31),i=n.n(o),u=n(6);n(2);function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}e.a=function(t){var e=t.srcElement,n=t.size,r=void 0===n?24:n,o=i()(t,["srcElement","size"]);return Object(u.isValidElement)(e)&&Object(u.cloneElement)(e,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){c()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({width:r,height:r},o))}},7:function(t,e){!function(){t.exports=this.lodash}()},71:function(t,e){!function(){t.exports=this.wp.editor}()},75:function(t,e){!function(){t.exports=this.wp.dom}()},77:function(t,e){!function(){t.exports=this.wp.hooks}()},80:function(t,e){!function(){t.exports=this.ReactDOM}()},81:function(t,e,n){"use strict";var r=n(9),c=n.n(r),o=n(0),i=n(1),u=(n(2),n(4));function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){c()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e.a=function(t){var e=t.onChange,n=t.settings,r=n.button,c=n.price,s=n.rating,l=n.title;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(u.ToggleControl,{label:Object(i.__)("Product title","woo-gutenberg-products-block"),help:l?Object(i.__)("Product title is visible.","woo-gutenberg-products-block"):Object(i.__)("Product title is hidden.","woo-gutenberg-products-block"),checked:l,onChange:function(){return e(a(a({},n),{},{title:!l}))}}),Object(o.createElement)(u.ToggleControl,{label:Object(i.__)("Product price","woo-gutenberg-products-block"),help:c?Object(i.__)("Product price is visible.","woo-gutenberg-products-block"):Object(i.__)("Product price is hidden.","woo-gutenberg-products-block"),checked:c,onChange:function(){return e(a(a({},n),{},{price:!c}))}}),Object(o.createElement)(u.ToggleControl,{label:Object(i.__)("Product rating","woo-gutenberg-products-block"),help:s?Object(i.__)("Product rating is visible.","woo-gutenberg-products-block"):Object(i.__)("Product rating is hidden.","woo-gutenberg-products-block"),checked:s,onChange:function(){return e(a(a({},n),{},{rating:!s}))}}),Object(o.createElement)(u.ToggleControl,{label:Object(i.__)("Add to Cart button","woo-gutenberg-products-block"),help:r?Object(i.__)("Add to Cart button is visible.","woo-gutenberg-products-block"):Object(i.__)("Add to Cart button is hidden.","woo-gutenberg-products-block"),checked:r,onChange:function(){return e(a(a({},n),{},{button:!r}))}}))}},82:function(t,e,n){"use strict";var r=n(0),c=n(1),o=n(7),i=(n(2),n(4)),u=n(5);e.a=function(t){var e=t.columns,n=t.rows,s=t.setAttributes,a=t.alignButtons;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(i.RangeControl,{label:Object(c.__)("Columns","woo-gutenberg-products-block"),value:e,onChange:function(t){var e=Object(o.clamp)(t,u.B,u.z);s({columns:Object(o.isNaN)(e)?"":e})},min:u.B,max:u.z}),Object(r.createElement)(i.RangeControl,{label:Object(c.__)("Rows","woo-gutenberg-products-block"),value:n,onChange:function(t){var e=Object(o.clamp)(t,u.D,u.A);s({rows:Object(o.isNaN)(e)?"":e})},min:u.D,max:u.A}),Object(r.createElement)(i.ToggleControl,{label:Object(c.__)("Align Last Block","woo-gutenberg-products-block"),help:a?Object(c.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(c.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:a,onChange:function(){return s({alignButtons:!a})}}))}},84:function(t,e){!function(){t.exports=this.wp.viewport}()},853:function(t,e,n){t.exports=n(935)},854:function(t,e){},855:function(t,e){},935:function(t,e,n){"use strict";n.r(e);var r=n(0),c=n(1),o=n(19),i=n(5),u=n(64),s=n(56),a=Object(r.createElement)(s.b,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M22 3H7c-.69 0-1.23.35-1.59.88L0 12l5.41 8.11c.36.53.97.89 1.66.89H22c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H7.07L2.4 12l4.66-7H22v14z"}),Object(r.createElement)("circle",{cx:"9",cy:"12",r:"1.5"}),Object(r.createElement)("circle",{cx:"14",cy:"12",r:"1.5"}),Object(r.createElement)("circle",{cx:"19",cy:"12",r:"1.5"})),l=(n(854),n(9)),b=n.n(l),g=n(22),d=n.n(g),p=n(26),f=n.n(p),O=n(21),h=n.n(O),j=n(23),m=n.n(j),w=n(24),y=n.n(w),v=n(12),k=n.n(v),_=n(15),S=n(71),E=n(4),P=(n(2),n(81)),C=n(82),x=n(10),A=n.n(x),T=n(7),D=n(50),B=n(43);n(855);function R(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var c=k()(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return y()(this,n)}}var N=function(t){m()(n,t);var e=R(n);function n(){var t;return d()(this,n),(t=e.apply(this,arguments)).state={list:[],loading:!0},t.renderItem=t.renderItem.bind(h()(t)),t.debouncedOnSearch=Object(T.debounce)(t.onSearch.bind(h()(t)),400),t}return f()(n,[{key:"componentDidMount",value:function(){var t=this,e=this.props.selected;Object(B.f)({selected:e}).then((function(e){t.setState({list:e,loading:!1})})).catch((function(){t.setState({list:[],loading:!1})}))}},{key:"onSearch",value:function(t){var e=this,n=this.props.selected;this.setState({loading:!0}),Object(B.f)({selected:n,search:t}).then((function(t){e.setState({list:t,loading:!1})})).catch((function(){e.setState({list:[],loading:!1})}))}},{key:"renderItem",value:function(t){var e=t.item,n=t.search,o=t.depth,i=void 0===o?0:o,u=["woocommerce-product-tags__item"];n.length&&u.push("is-searching"),0===i&&0!==e.parent&&u.push("is-skip-level");var s=e.breadcrumbs.length?"".concat(e.breadcrumbs.join(", "),", ").concat(e.name):e.name;return Object(r.createElement)(D.b,A()({className:u.join(" ")},t,{showCount:!0,"aria-label":Object(c.sprintf)(Object(c._n)("%1$d product tagged as %2$s","%1$d products tagged as %2$s",e.count,"woo-gutenberg-products-block"),e.count,s)}))}},{key:"render",value:function(){var t=this.state,e=t.list,n=t.loading,o=this.props,u=o.onChange,s=o.onOperatorChange,a=o.operator,l=o.selected,b={clear:Object(c.__)("Clear all product tags","woo-gutenberg-products-block"),list:Object(c.__)("Product Tags","woo-gutenberg-products-block"),noItems:Object(c.__)("Your store doesn't have any product tags.","woo-gutenberg-products-block"),search:Object(c.__)("Search for product tags","woo-gutenberg-products-block"),selected:function(t){return Object(c.sprintf)(Object(c._n)("%d tag selected","%d tags selected",t,"woo-gutenberg-products-block"),t)},updated:Object(c.__)("Tag search results updated.","woo-gutenberg-products-block")};return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(D.a,{className:"woocommerce-product-tags",list:e,isLoading:n,selected:l.map((function(t){return Object(T.find)(e,{id:t})})).filter(Boolean),onChange:u,onSearch:i.x?this.debouncedOnSearch:null,renderItem:this.renderItem,messages:b,isHierarchical:!0}),!!s&&Object(r.createElement)("div",{className:l.length<2?"screen-reader-text":""},Object(r.createElement)(E.SelectControl,{className:"woocommerce-product-tags__operator",label:Object(c.__)("Display products matching","woo-gutenberg-products-block"),help:Object(c.__)("Pick at least two tags to use this setting.","woo-gutenberg-products-block"),value:a,onChange:s,options:[{label:Object(c.__)("Any selected tags","woo-gutenberg-products-block"),value:"any"},{label:Object(c.__)("All selected tags","woo-gutenberg-products-block"),value:"all"}]})))}}]),n}(r.Component);N.defaultProps={operator:"any"};var M=N,I=n(129),z=n(178);function V(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function H(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?V(Object(n),!0).forEach((function(e){b()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function L(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var c=k()(this).constructor;n=Reflect.construct(r,arguments,c)}else n=r.apply(this,arguments);return y()(this,n)}}var q=function(t){m()(n,t);var e=L(n);function n(){var t;return d()(this,n),(t=e.apply(this,arguments)).state={changedAttributes:{},isEditing:!1},t.startEditing=t.startEditing.bind(h()(t)),t.stopEditing=t.stopEditing.bind(h()(t)),t.setChangedAttributes=t.setChangedAttributes.bind(h()(t)),t.save=t.save.bind(h()(t)),t}return f()(n,[{key:"componentDidMount",value:function(){this.props.attributes.tags.length||this.setState({isEditing:!0})}},{key:"startEditing",value:function(){this.setState({isEditing:!0,changedAttributes:{}})}},{key:"stopEditing",value:function(){this.setState({isEditing:!1,changedAttributes:{}})}},{key:"setChangedAttributes",value:function(t){this.setState((function(e){return{changedAttributes:H(H({},e.changedAttributes),t)}}))}},{key:"save",value:function(){var t=this.state.changedAttributes;(0,this.props.setAttributes)(t),this.stopEditing()}},{key:"getInspectorControls",value:function(){var t=this.props,e=t.attributes,n=t.setAttributes,o=this.state.isEditing,i=e.columns,u=e.tagOperator,s=e.contentVisibility,a=e.orderby,l=e.rows,b=e.alignButtons;return Object(r.createElement)(_.InspectorControls,{key:"inspector"},Object(r.createElement)(E.PanelBody,{title:Object(c.__)("Product Tag","woo-gutenberg-products-block"),initialOpen:!e.tags.length&&!o},Object(r.createElement)(M,{selected:e.tags,onChange:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=t.map((function(t){return t.id}));n({tags:e})},operator:u,onOperatorChange:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return n({tagOperator:t})}})),Object(r.createElement)(E.PanelBody,{title:Object(c.__)("Layout","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(C.a,{columns:i,rows:l,alignButtons:b,setAttributes:n})),Object(r.createElement)(E.PanelBody,{title:Object(c.__)("Content","woo-gutenberg-products-block"),initialOpen:!0},Object(r.createElement)(P.a,{settings:s,onChange:function(t){return n({contentVisibility:t})}})),Object(r.createElement)(E.PanelBody,{title:Object(c.__)("Order By","woo-gutenberg-products-block"),initialOpen:!1},Object(r.createElement)(I.a,{setAttributes:n,value:a})))}},{key:"renderEditMode",value:function(){var t=this,e=this.props,n=e.attributes,o=e.debouncedSpeak,i=this.state.changedAttributes,s=H(H({},n),i);return Object(r.createElement)(E.Placeholder,{icon:Object(r.createElement)(u.a,{srcElement:a,className:"block-editor-block-icon"}),label:Object(c.__)("Products by Tag","woo-gutenberg-products-block"),className:"wc-block-products-grid wc-block-product-tag"},Object(c.__)("Display a grid of products from your selected tags.","woo-gutenberg-products-block"),Object(r.createElement)("div",{className:"wc-block-product-tag__selection"},Object(r.createElement)(M,{selected:s.tags,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=e.map((function(t){return t.id}));t.setChangedAttributes({tags:n})},operator:s.tagOperator,onOperatorChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return t.setChangedAttributes({tagOperator:e})}}),Object(r.createElement)(E.Button,{isPrimary:!0,onClick:function(){t.save(),o(Object(c.__)("Showing Products by Tag block preview.","woo-gutenberg-products-block"))}},Object(c.__)("Done","woo-gutenberg-products-block")),Object(r.createElement)(E.Button,{className:"wc-block-product-tag__cancel-button",isTertiary:!0,onClick:function(){t.stopEditing(),o(Object(c.__)("Showing Products by Tag block preview.","woo-gutenberg-products-block"))}},Object(c.__)("Cancel","woo-gutenberg-products-block"))))}},{key:"renderViewMode",value:function(){var t=this.props,e=t.attributes,n=t.name,o=e.tags.length;return Object(r.createElement)(E.Disabled,null,o?Object(r.createElement)(S.ServerSideRender,{block:n,attributes:e}):Object(r.createElement)(E.Placeholder,{icon:Object(r.createElement)(u.a,{icon:a,className:"block-editor-block-icon"}),label:Object(c.__)("Products by Tag","woo-gutenberg-products-block"),className:"wc-block-products-grid wc-block-product-tag"},Object(c.__)("This block displays products from selected tags. Select at least one tag to display its products.","woo-gutenberg-products-block")))}},{key:"render",value:function(){var t=this,e=this.state.isEditing;return this.props.attributes.isPreview?z.a:Object(r.createElement)(r.Fragment,null,i.t?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(_.BlockControls,null,Object(r.createElement)(E.Toolbar,{controls:[{icon:"edit",title:Object(c.__)("Edit"),onClick:function(){return e?t.stopEditing():t.startEditing()},isActive:e}]})),this.getInspectorControls(),e?this.renderEditMode():this.renderViewMode()):Object(r.createElement)(E.Placeholder,{icon:Object(r.createElement)(u.a,{icon:a,className:"block-editor-block-icon"}),label:Object(c.__)("Products by Tag","woo-gutenberg-products-block"),className:"wc-block-products-grid wc-block-product-tag"},Object(c.__)("This block displays products from selected tags. In order to preview this you'll first need to create a product and assign it some tags.","woo-gutenberg-products-block")))}}]),n}(r.Component),F=Object(E.withSpokenMessages)(q);Object(o.registerBlockType)("woocommerce/product-tag",{title:Object(c.__)("Products by Tag","woo-gutenberg-products-block"),icon:{src:Object(r.createElement)(u.a,{srcElement:a}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(c.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(c.__)("Display a grid of products with selected tags.","woo-gutenberg-products-block"),supports:{align:["wide","full"],html:!1},example:{attributes:{isPreview:!0}},attributes:{columns:{type:"number",default:i.m},rows:{type:"number",default:i.o},alignButtons:{type:"boolean",default:!1},contentVisibility:{type:"object",default:{title:!0,price:!0,rating:!0,button:!0}},tags:{type:"array",default:[]},tagOperator:{type:"string",default:"any"},orderby:{type:"string",default:"date"},isPreview:{type:"boolean",default:!1}},edit:function(t){return Object(r.createElement)(F,t)},save:function(){return null}})},95:function(t,e){!function(){t.exports=this.wp.date}()}});