this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["handpicked-products"]=function(e){function t(t){for(var r,l,i=t[0],s=t[1],a=t[2],d=0,b=[];d<i.length;d++)l=i[d],Object.prototype.hasOwnProperty.call(n,l)&&n[l]&&b.push(n[l][0]),n[l]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r]);for(u&&u(t);b.length;)b.shift()();return o.push.apply(o,a||[]),c()}function c(){for(var e,t=0;t<o.length;t++){for(var c=o[t],r=!0,i=1;i<c.length;i++){var s=c[i];0!==n[s]&&(r=!1)}r&&(o.splice(t--,1),e=l(l.s=c[0]))}return e}var r={},n={23:0},o=[];function l(t){if(r[t])return r[t].exports;var c=r[t]={i:t,l:!1,exports:{}};return e[t].call(c.exports,c,c.exports,l),c.l=!0,c.exports}l.m=e,l.c=r,l.d=function(e,t,c){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(l.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)l.d(c,r,function(t){return e[t]}.bind(null,r));return c},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var a=0;a<i.length;a++)t(i[a]);var u=s;return o.push([317,0]),c()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},11:function(e,t){e.exports=window.wp.apiFetch},12:function(e,t){e.exports=window.wp.blocks},126:function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var r=c(0);const n=Object(r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(r.createElement)("title",null,"Grid Block Preview"),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},14:function(e,t){e.exports=window.wp.htmlEntities},15:function(e,t){e.exports=window.wp.url},17:function(e,t,c){"use strict";c.d(t,"a",(function(){return l})),c.d(t,"c",(function(){return s})),c.d(t,"d",(function(){return a})),c.d(t,"b",(function(){return u}));var r=c(0),n=c(6),o=c(1);const l={clear:Object(o.__)("Clear all selected items",'woocommerce'),noItems:Object(o.__)("No items found.",'woocommerce'),
/* Translators: %s search term */
noResults:Object(o.__)("No results for %s",'woocommerce'),search:Object(o.__)("Search for items",'woocommerce'),selected:e=>Object(o.sprintf)(
/* translators: Number of items selected from list. */
Object(o._n)("%d item selected","%d items selected",e,'woocommerce'),e),updated:Object(o.__)("Search results updated.",'woocommerce')},i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const c=Object(n.groupBy)(e,"parent"),r=Object(n.keyBy)(t,"id"),o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=o(r[e.parent]);return[...t,e.name]},l=e=>e.map(e=>{const t=c[e.id];return delete c[e.id],{...e,breadcrumbs:o(r[e.parent]),children:t&&t.length?l(t):[]}}),i=l(c[0]||[]);return delete c[0],Object(n.forEach)(c,e=>{i.push(...l(e||[]))}),i},s=(e,t,c)=>{if(!t)return c?i(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),n=e.map(e=>!!r.test(e.name)&&e).filter(Boolean);return c?i(n,e):n},a=(e,t)=>{if(!t)return e;const c=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"ig");return e.split(c).map((e,c)=>0===c?e:Object(r.createElement)(r.Fragment,{key:c},Object(r.createElement)("strong",null,t),e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},18:function(e,t){e.exports=window.wp.primitives},191:function(e,t,c){"use strict";var r=c(5),n=c.n(r),o=c(0),l=c(25),i=c(27),s=c(116),a=c(28);t.a=e=>t=>{let{selected:c,...r}=t;const[u,d]=Object(o.useState)(!0),[b,g]=Object(o.useState)(null),[m,p]=Object(o.useState)([]),h=l.o.productCount>100,E=async e=>{const t=await Object(a.a)(e);g(t),d(!1)},O=Object(o.useRef)(c);Object(o.useEffect)(()=>{Object(i.h)({selected:O.current}).then(e=>{p(e),d(!1)}).catch(E)},[O]);const j=Object(s.a)(e=>{Object(i.h)({selected:c,search:e}).then(e=>{p(e),d(!1)}).catch(E)},400),w=Object(o.useCallback)(e=>{d(!0),j(e)},[d,j]);return Object(o.createElement)(e,n()({},r,{selected:c,error:b,products:m,isLoading:u,onSearch:h?w:null}))}},2:function(e,t){e.exports=window.wc.wcSettings},25:function(e,t,c){"use strict";c.d(t,"o",(function(){return o})),c.d(t,"m",(function(){return l})),c.d(t,"l",(function(){return i})),c.d(t,"n",(function(){return s})),c.d(t,"j",(function(){return a})),c.d(t,"e",(function(){return u})),c.d(t,"f",(function(){return d})),c.d(t,"g",(function(){return b})),c.d(t,"k",(function(){return g})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return p})),c.d(t,"h",(function(){return h})),c.d(t,"a",(function(){return E})),c.d(t,"i",(function(){return O})),c.d(t,"b",(function(){return j}));var r,n=c(2);const o=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),l=o.pluginUrl+"images/",i=o.pluginUrl+"build/",s=o.buildPhase,a=null===(r=n.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=n.STORE_PAGES.checkout.id,d=n.STORE_PAGES.checkout.permalink,b=n.STORE_PAGES.privacy.permalink,g=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),m=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),p=n.STORE_PAGES.cart.permalink,h=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),E=Object(n.getSetting)("allowedCountries",{}),O=Object(n.getSetting)("shippingStates",{}),j=Object(n.getSetting)("allowedStates",{})},27:function(e,t,c){"use strict";c.d(t,"h",(function(){return a})),c.d(t,"e",(function(){return u})),c.d(t,"b",(function(){return d})),c.d(t,"i",(function(){return b})),c.d(t,"f",(function(){return g})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return p})),c.d(t,"g",(function(){return h})),c.d(t,"a",(function(){return E}));var r=c(15),n=c(11),o=c.n(n),l=c(6),i=c(2),s=c(25);const a=e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const i=(e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const o=s.o.productCount>100,l={per_page:o?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},i=[Object(r.addQueryArgs)("/wc/store/products",{...l,...n})];return o&&t.length&&i.push(Object(r.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:t,per_page:0})),i})({selected:t,search:c,queryArgs:n});return Promise.all(i.map(e=>o()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>o()({path:"/wc/store/products/"+e}),d=()=>o()({path:"wc/store/products/attributes"}),b=e=>o()({path:`wc/store/products/attributes/${e}/terms`}),g=e=>{let{selected:t=[],search:c}=e;const n=(e=>{let{selected:t=[],search:c}=e;const n=Object(i.getSetting)("limitTags",!1),o=[Object(r.addQueryArgs)("wc/store/products/tags",{per_page:n?100:0,orderby:n?"count":"name",order:n?"desc":"asc",search:c})];return n&&t.length&&o.push(Object(r.addQueryArgs)("wc/store/products/tags",{include:t})),o})({selected:t,search:c});return Promise.all(n.map(e=>o()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id"))},m=e=>o()({path:Object(r.addQueryArgs)("wc/store/products/categories",{per_page:0,...e})}),p=e=>o()({path:"wc/store/products/categories/"+e}),h=e=>o()({path:Object(r.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})}),E=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},28:function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return o}));var r=c(1);const n=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},o=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(r.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},3:function(e,t){e.exports=window.wp.components},31:function(e,t){e.exports=window.wp.escapeHtml},317:function(e,t,c){e.exports=c(446)},318:function(e,t){},32:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(31);t.a=e=>{let{error:t}=e;return Object(r.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:c}=e;return t?"general"===c?Object(r.createElement)("span",null,Object(n.__)("The following error was returned",'woocommerce'),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(o.escapeHTML)(t))):"api"===c?Object(r.createElement)("span",null,Object(n.__)("The following error was returned from the API",'woocommerce'),Object(r.createElement)("br",null),Object(r.createElement)("code",null,Object(o.escapeHTML)(t))):t:Object(n.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')})(t))}},34:function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var r=c(5),n=c.n(r),o=c(0),l=c(17);const i=e=>{let{countLabel:t,className:c,depth:r=0,controlId:i="",item:s,isSelected:a,isSingle:u,onSelect:d,search:b="",...g}=e;const m=null!=t&&void 0!==s.count&&null!==s.count,p=[c,"woocommerce-search-list__item"];p.push("depth-"+r),u&&p.push("is-radio-button"),m&&p.push("has-count");const h=s.breadcrumbs&&s.breadcrumbs.length,E=g.name||"search-list-item-"+i,O=`${E}-${s.id}`;return Object(o.createElement)("label",{htmlFor:O,className:p.join(" ")},u?Object(o.createElement)("input",n()({type:"radio",id:O,name:E,value:s.value,onChange:d(s),checked:a,className:"woocommerce-search-list__item-input"},g)):Object(o.createElement)("input",n()({type:"checkbox",id:O,name:E,value:s.value,onChange:d(s),checked:a,className:"woocommerce-search-list__item-input"},g)),Object(o.createElement)("span",{className:"woocommerce-search-list__item-label"},h?Object(o.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(l.b)(s.breadcrumbs)):null,Object(o.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(l.d)(s.name,b))),!!m&&Object(o.createElement)("span",{className:"woocommerce-search-list__item-count"},t||s.count))};t.b=i},43:function(e,t,c){"use strict";var r=c(0);t.a=function(e){let{srcElement:t,size:c=24,...n}=e;return Object(r.isValidElement)(t)?Object(r.cloneElement)(t,{width:c,height:c,...n}):null}},446:function(e,t,c){"use strict";c.r(t);var r=c(0),n=c(1),o=c(12),l=c(2),i=c(43),s=c(18),a=Object(r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M16.66 4.52l2.83 2.83-2.83 2.83-2.83-2.83 2.83-2.83M9 5v4H5V5h4m10 10v4h-4v-4h4M9 15v4H5v-4h4m7.66-13.31L11 7.34 16.66 13l5.66-5.66-5.66-5.65zM11 3H3v8h8V3zm10 10h-8v8h8v-8zm-10 0H3v8h8v-8z"})),u=(c(318),c(7)),d=c(51),b=c.n(d),g=c(3),m=(c(10),c(58)),p=c(86),h=c(191),E=c(32);const O=e=>{let{error:t,onChange:c,onSearch:o,selected:l,products:i,isLoading:s,isCompact:a}=e;const u={clear:Object(n.__)("Clear all products",'woocommerce'),list:Object(n.__)("Products",'woocommerce'),noItems:Object(n.__)("Your store doesn't have any products.",'woocommerce'),search:Object(n.__)("Search for products to display",'woocommerce'),selected:e=>Object(n.sprintf)(
/* translators: %d is the number of selected products. */
Object(n._n)("%d product selected","%d products selected",e,'woocommerce'),e),updated:Object(n.__)("Product search results updated.",'woocommerce')};return t?Object(r.createElement)(E.a,{error:t}):Object(r.createElement)(p.a,{className:"woocommerce-products",list:i.map(e=>{const t=e.sku?" ("+e.sku+")":"";return{...e,name:`${e.name}${t}`}}),isCompact:a,isLoading:s,selected:i.filter(e=>{let{id:t}=e;return l.includes(t)}),onSearch:o,onChange:c,messages:u})};O.defaultProps={selected:[],products:[],isCompact:!1,isLoading:!0};var j=Object(h.a)(O),w=c(87),f=c(126);class _ extends r.Component{getInspectorControls(){const{attributes:e,setAttributes:t}=this.props,{columns:c,contentVisibility:o,orderby:i,alignButtons:s}=e;return Object(r.createElement)(u.InspectorControls,{key:"inspector"},Object(r.createElement)(g.PanelBody,{title:Object(n.__)("Layout",'woocommerce'),initialOpen:!0},Object(r.createElement)(g.RangeControl,{label:Object(n.__)("Columns",'woocommerce'),value:c,onChange:e=>t({columns:e}),min:Object(l.getSetting)("min_columns",1),max:Object(l.getSetting)("max_columns",6)}),Object(r.createElement)(g.ToggleControl,{label:Object(n.__)("Align Buttons",'woocommerce'),help:s?Object(n.__)("Buttons are aligned vertically.",'woocommerce'):Object(n.__)("Buttons follow content.",'woocommerce'),checked:s,onChange:()=>t({alignButtons:!s})})),Object(r.createElement)(g.PanelBody,{title:Object(n.__)("Content",'woocommerce'),initialOpen:!0},Object(r.createElement)(m.a,{settings:o,onChange:e=>t({contentVisibility:e})})),Object(r.createElement)(g.PanelBody,{title:Object(n.__)("Order By",'woocommerce'),initialOpen:!1},Object(r.createElement)(w.a,{setAttributes:t,value:i})),Object(r.createElement)(g.PanelBody,{title:Object(n.__)("Products",'woocommerce'),initialOpen:!1},Object(r.createElement)(j,{selected:e.products,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const c=e.map(e=>{let{id:t}=e;return t});t({products:c})},isCompact:!0})))}renderEditMode(){const{attributes:e,debouncedSpeak:t,setAttributes:c}=this.props;return Object(r.createElement)(g.Placeholder,{icon:Object(r.createElement)(i.a,{srcElement:a}),label:Object(n.__)("Hand-picked Products",'woocommerce'),className:"wc-block-products-grid wc-block-handpicked-products"},Object(n.__)("Display a selection of hand-picked products in a grid.",'woocommerce'),Object(r.createElement)("div",{className:"wc-block-handpicked-products__selection"},Object(r.createElement)(j,{selected:e.products,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=e.map(e=>{let{id:t}=e;return t});c({products:t})}}),Object(r.createElement)(g.Button,{isPrimary:!0,onClick:()=>{c({editMode:!1}),t(Object(n.__)("Showing Hand-picked Products block preview.",'woocommerce'))}},Object(n.__)("Done",'woocommerce'))))}render(){const{attributes:e,name:t,setAttributes:c}=this.props,{editMode:o}=e;return e.isPreview?f.a:Object(r.createElement)(r.Fragment,null,Object(r.createElement)(u.BlockControls,null,Object(r.createElement)(g.ToolbarGroup,{controls:[{icon:"edit",title:Object(n.__)("Edit selected products",'woocommerce'),onClick:()=>c({editMode:!o}),isActive:o}]})),this.getInspectorControls(),o?this.renderEditMode():Object(r.createElement)(g.Disabled,null,Object(r.createElement)(b.a,{block:t,attributes:e})))}}var y=Object(g.withSpokenMessages)(_);Object(o.registerBlockType)("woocommerce/handpicked-products",{title:Object(n.__)("Hand-picked Products",'woocommerce'),icon:{src:Object(r.createElement)(i.a,{srcElement:a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(n.__)("Handpicked Products",'woocommerce'),Object(n.__)("WooCommerce",'woocommerce')],description:Object(n.__)("Display a selection of hand-picked products in a grid.",'woocommerce'),supports:{align:["wide","full"],html:!1},example:{attributes:{isPreview:!0}},attributes:{align:{type:"string"},columns:{type:"number",default:Object(l.getSetting)("default_columns",3)},editMode:{type:"boolean",default:!0},contentVisibility:{type:"object",default:{title:!0,price:!0,rating:!0,button:!0}},orderby:{type:"string",default:"date"},products:{type:"array",default:[]},alignButtons:{type:"boolean",default:!1},isPreview:{type:"boolean",default:!1}},edit:e=>Object(r.createElement)(y,e),save:()=>null})},51:function(e,t){e.exports=window.wp.serverSideRender},58:function(e,t,c){"use strict";var r=c(0),n=c(1),o=(c(10),c(3));t.a=e=>{let{onChange:t,settings:c}=e;const{button:l,price:i,rating:s,title:a}=c;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product title",'woocommerce'),help:a?Object(n.__)("Product title is visible.",'woocommerce'):Object(n.__)("Product title is hidden.",'woocommerce'),checked:a,onChange:()=>t({...c,title:!a})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product price",'woocommerce'),help:i?Object(n.__)("Product price is visible.",'woocommerce'):Object(n.__)("Product price is hidden.",'woocommerce'),checked:i,onChange:()=>t({...c,price:!i})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Product rating",'woocommerce'),help:s?Object(n.__)("Product rating is visible.",'woocommerce'):Object(n.__)("Product rating is hidden.",'woocommerce'),checked:s,onChange:()=>t({...c,rating:!s})}),Object(r.createElement)(o.ToggleControl,{label:Object(n.__)("Add to Cart button",'woocommerce'),help:l?Object(n.__)("Add to Cart button is visible.",'woocommerce'):Object(n.__)("Add to Cart button is hidden.",'woocommerce'),checked:l,onChange:()=>t({...c,button:!l})}))}},6:function(e,t){e.exports=window.lodash},7:function(e,t){e.exports=window.wp.blockEditor},8:function(e,t){e.exports=window.React},86:function(e,t,c){"use strict";c.d(t,"a",(function(){return y}));var r=c(5),n=c.n(r),o=c(0),l=c(1),i=c(3),s=c(478),a=c(480),u=c(4),d=c.n(u),b=c(9),g=c(17),m=c(34),p=c(479),h=c(14);const E=e=>{let{id:t,label:c,popoverContents:r,remove:n,screenReaderLabel:a,className:u=""}=e;const[g,m]=Object(o.useState)(!1),O=Object(b.useInstanceId)(E);if(a=a||c,!c)return null;c=Object(h.decodeEntities)(c);const j=d()("woocommerce-tag",u,{"has-remove":!!n}),w="woocommerce-tag__label-"+O,f=Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},a),Object(o.createElement)("span",{"aria-hidden":"true"},c));return Object(o.createElement)("span",{className:j},r?Object(o.createElement)(i.Button,{className:"woocommerce-tag__text",id:w,onClick:()=>m(!0)},f):Object(o.createElement)("span",{className:"woocommerce-tag__text",id:w},f),r&&g&&Object(o.createElement)(i.Popover,{onClose:()=>m(!1)},r),n&&Object(o.createElement)(i.Button,{className:"woocommerce-tag__remove",onClick:n(t),label:Object(l.sprintf)(// Translators: %s label.
Object(l.__)("Remove %s",'woocommerce'),c),"aria-describedby":w},Object(o.createElement)(s.a,{icon:p.a,size:20,className:"clear-icon"})))};var O=E;const j=e=>Object(o.createElement)(m.b,e),w=e=>{const{list:t,selected:c,renderItem:r,depth:l=0,onSelect:i,instanceId:s,isSingle:a,search:u}=e;return t?Object(o.createElement)(o.Fragment,null,t.map(t=>{const d=-1!==c.findIndex(e=>{let{id:c}=e;return c===t.id});return Object(o.createElement)(o.Fragment,{key:t.id},Object(o.createElement)("li",null,r({item:t,isSelected:d,onSelect:i,isSingle:a,search:u,depth:l,controlId:s})),Object(o.createElement)(w,n()({},e,{list:t.children,depth:l+1})))})):null},f=e=>{let{isLoading:t,isSingle:c,selected:r,messages:n,onChange:s,onRemove:a}=e;if(t||c||!r)return null;const u=r.length;return Object(o.createElement)("div",{className:"woocommerce-search-list__selected"},Object(o.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(o.createElement)("strong",null,n.selected(u)),u>0?Object(o.createElement)(i.Button,{isLink:!0,isDestructive:!0,onClick:()=>s([]),"aria-label":n.clear},Object(l.__)("Clear all",'woocommerce')):null),u>0?Object(o.createElement)("ul",null,r.map((e,t)=>Object(o.createElement)("li",{key:t},Object(o.createElement)(O,{label:e.name,id:e.id,remove:a})))):null)},_=e=>{let{filteredList:t,search:c,onSelect:r,instanceId:n,...i}=e;const{messages:u,renderItem:d,selected:b,isSingle:g}=i,m=d||j;return 0===t.length?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(o.createElement)(s.a,{icon:a.a})),Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-text"},c?Object(l.sprintf)(u.noResults,c):u.noItems)):Object(o.createElement)("ul",{className:"woocommerce-search-list__list"},Object(o.createElement)(w,{list:t,selected:b,renderItem:m,onSelect:r,instanceId:n,isSingle:g,search:c}))},y=e=>{const{className:t="",isCompact:c,isHierarchical:r,isLoading:l,isSingle:s,list:a,messages:u=g.a,onChange:m,onSearch:p,selected:h,debouncedSpeak:E}=e,[O,j]=Object(o.useState)(""),w=Object(b.useInstanceId)(y),x=Object(o.useMemo)(()=>({...g.a,...u}),[u]),k=Object(o.useMemo)(()=>Object(g.c)(a,O,r),[a,O,r]);Object(o.useEffect)(()=>{E&&E(x.updated)},[E,x]),Object(o.useEffect)(()=>{"function"==typeof p&&p(O)},[O,p]);const v=Object(o.useCallback)(e=>()=>{s&&m([]);const t=h.findIndex(t=>{let{id:c}=t;return c===e});m([...h.slice(0,t),...h.slice(t+1)])},[s,h,m]),S=Object(o.useCallback)(e=>()=>{-1===h.findIndex(t=>{let{id:c}=t;return c===e.id})?m(s?[e]:[...h,e]):v(e.id)()},[s,v,m,h]);return Object(o.createElement)("div",{className:d()("woocommerce-search-list",t,{"is-compact":c})},Object(o.createElement)(f,n()({},e,{onRemove:v,messages:x})),Object(o.createElement)("div",{className:"woocommerce-search-list__search"},Object(o.createElement)(i.TextControl,{label:x.search,type:"search",value:O,onChange:e=>j(e)})),l?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(o.createElement)(i.Spinner,null)):Object(o.createElement)(_,n()({},e,{search:O,filteredList:k,messages:x,onSelect:S,instanceId:w})))};Object(i.withSpokenMessages)(y)},87:function(e,t,c){"use strict";var r=c(0),n=c(1),o=c(3);c(10),t.a=e=>{let{value:t,setAttributes:c}=e;return Object(r.createElement)(o.SelectControl,{label:Object(n.__)("Order products by",'woocommerce'),value:t,options:[{label:Object(n.__)("Newness - newest first",'woocommerce'),value:"date"},{label:Object(n.__)("Price - low to high",'woocommerce'),value:"price_asc"},{label:Object(n.__)("Price - high to low",'woocommerce'),value:"price_desc"},{label:Object(n.__)("Rating - highest first",'woocommerce'),value:"rating"},{label:Object(n.__)("Sales - most first",'woocommerce'),value:"popularity"},{label:Object(n.__)("Title - alphabetical",'woocommerce'),value:"title"},{label:Object(n.__)("Menu Order",'woocommerce'),value:"menu_order"}],onChange:e=>c({orderby:e})})}},9:function(e,t){e.exports=window.wp.compose}});