OwlCyberSecurity - MANAGER
Edit File: product-on-sale.js
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-on-sale"]=function(e){function t(t){for(var c,l,i=t[0],a=t[1],s=t[2],b=0,d=[];b<i.length;b++)l=i[b],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&d.push(o[l][0]),o[l]=0;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&(e[c]=a[c]);for(u&&u(t);d.length;)d.shift()();return n.push.apply(n,s||[]),r()}function r(){for(var e,t=0;t<n.length;t++){for(var r=n[t],c=!0,i=1;i<r.length;i++){var a=r[i];0!==o[a]&&(c=!1)}c&&(n.splice(t--,1),e=l(l.s=r[0]))}return e}var c={},o={32:0},n=[];function l(t){if(c[t])return c[t].exports;var r=c[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,l),r.l=!0,r.exports}l.m=e,l.c=c,l.d=function(e,t,r){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(l.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)l.d(r,c,function(t){return e[t]}.bind(null,c));return r},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],a=i.push.bind(i);i.push=t,i=i.slice();for(var s=0;s<i.length;s++)t(i[s]);var u=a;return n.push([751,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.data},101:function(e,t,r){"use strict";r.d(t,"b",(function(){return o}));var c=r(3);const o=["woocommerce/product-best-sellers","woocommerce/product-category","woocommerce/product-new","woocommerce/product-on-sale","woocommerce/product-top-rated"];t.a={columns:{type:"number",default:Object(c.getSetting)("default_columns",3)},rows:{type:"number",default:Object(c.getSetting)("default_rows",3)},alignButtons:{type:"boolean",default:!1},categories:{type:"array",default:[]},catOperator:{type:"string",default:"any"},contentVisibility:{type:"object",default:{title:!0,price:!0,rating:!0,button:!0}},isPreview:{type:"boolean",default:!1}}},11:function(e,t){e.exports=window.wp.apiFetch},115:function(e,t){},116:function(e,t){e.exports=window.wp.coreData},119:function(e,t,r){"use strict";var c=r(0),o=r(1),n=r(4);r(2),t.a=e=>{let{value:t,setAttributes:r}=e;return Object(c.createElement)(n.SelectControl,{label:Object(o.__)("Order products by",'woocommerce'),value:t,options:[{label:Object(o.__)("Newness - newest first",'woocommerce'),value:"date"},{label:Object(o.__)("Price - low to high",'woocommerce'),value:"price_asc"},{label:Object(o.__)("Price - high to low",'woocommerce'),value:"price_desc"},{label:Object(o.__)("Rating - highest first",'woocommerce'),value:"rating"},{label:Object(o.__)("Sales - most first",'woocommerce'),value:"popularity"},{label:Object(o.__)("Title - alphabetical",'woocommerce'),value:"title"},{label:Object(o.__)("Menu Order",'woocommerce'),value:"menu_order"}],onChange:e=>r({orderby:e})})}},12:function(e,t){e.exports=window.wp.compose},124:function(e,t){},13:function(e,t){e.exports=window.wp.url},14:function(e,t){e.exports=window.wp.blocks},172:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var c=r(0);const o=Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(c.createElement)("title",null,"Grid Block Preview"),Object(c.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(c.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(c.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(c.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(c.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(c.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(c.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(c.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(c.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(c.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(c.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(c.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},18:function(e,t){e.exports=window.wp.primitives},20:function(e,t){e.exports=window.wp.htmlEntities},21:function(e,t){e.exports=window.moment},3:function(e,t){e.exports=window.wc.wcSettings},30:function(e,t){e.exports=window.wp.dataControls},32:function(e,t,r){"use strict";r.d(t,"o",(function(){return n})),r.d(t,"m",(function(){return l})),r.d(t,"l",(function(){return i})),r.d(t,"n",(function(){return a})),r.d(t,"j",(function(){return s})),r.d(t,"e",(function(){return u})),r.d(t,"f",(function(){return b})),r.d(t,"g",(function(){return d})),r.d(t,"k",(function(){return g})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return h})),r.d(t,"h",(function(){return w})),r.d(t,"a",(function(){return E})),r.d(t,"i",(function(){return m})),r.d(t,"b",(function(){return O}));var c,o=r(3);const n=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),l=n.pluginUrl+"images/",i=n.pluginUrl+"build/",a=n.buildPhase,s=null===(c=o.STORE_PAGES.shop)||void 0===c?void 0:c.permalink,u=o.STORE_PAGES.checkout.id,b=o.STORE_PAGES.checkout.permalink,d=o.STORE_PAGES.privacy.permalink,g=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),p=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id),h=o.STORE_PAGES.cart.permalink,w=(o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),Object(o.getSetting)("shippingCountries",{})),E=Object(o.getSetting)("allowedCountries",{}),m=Object(o.getSetting)("shippingStates",{}),O=Object(o.getSetting)("allowedStates",{})},34:function(e,t,r){"use strict";r.d(t,"h",(function(){return s})),r.d(t,"e",(function(){return u})),r.d(t,"b",(function(){return b})),r.d(t,"i",(function(){return d})),r.d(t,"f",(function(){return g})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return h})),r.d(t,"g",(function(){return w})),r.d(t,"a",(function(){return E}));var c=r(13),o=r(11),n=r.n(o),l=r(6),i=r(3),a=r(32);const s=e=>{let{selected:t=[],search:r="",queryArgs:o={}}=e;const i=(e=>{let{selected:t=[],search:r="",queryArgs:o={}}=e;const n=a.o.productCount>100,l={per_page:n?100:0,catalog_visibility:"any",search:r,orderby:"title",order:"asc"},i=[Object(c.addQueryArgs)("/wc/store/products",{...l,...o})];return n&&t.length&&i.push(Object(c.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:t,per_page:0})),i})({selected:t,search:r,queryArgs:o});return Promise.all(i.map(e=>n()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>n()({path:"/wc/store/products/"+e}),b=()=>n()({path:"wc/store/products/attributes"}),d=e=>n()({path:`wc/store/products/attributes/${e}/terms`}),g=e=>{let{selected:t=[],search:r}=e;const o=(e=>{let{selected:t=[],search:r}=e;const o=Object(i.getSetting)("limitTags",!1),n=[Object(c.addQueryArgs)("wc/store/products/tags",{per_page:o?100:0,orderby:o?"count":"name",order:o?"desc":"asc",search:r})];return o&&t.length&&n.push(Object(c.addQueryArgs)("wc/store/products/tags",{include:t})),n})({selected:t,search:r});return Promise.all(o.map(e=>n()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id"))},p=e=>n()({path:Object(c.addQueryArgs)("wc/store/products/categories",{per_page:0,...e})}),h=e=>n()({path:"wc/store/products/categories/"+e}),w=e=>n()({path:Object(c.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})}),E=(e,t)=>{if(!e.title.raw)return e.slug;const r=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(r?"":" - "+e.slug)}},35:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return n}));var c=r(1);const o=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"}},n=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(c.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},38:function(e,t){e.exports=window.wp.keycodes},39:function(e,t){e.exports=window.wp.escapeHtml},4:function(e,t){e.exports=window.wp.components},41:function(e,t,r){"use strict";var c=r(0),o=r(1),n=r(39);t.a=e=>{let{error:t}=e;return Object(c.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:r}=e;return t?"general"===r?Object(c.createElement)("span",null,Object(o.__)("The following error was returned",'woocommerce'),Object(c.createElement)("br",null),Object(c.createElement)("code",null,Object(n.escapeHTML)(t))):"api"===r?Object(c.createElement)("span",null,Object(o.__)("The following error was returned from the API",'woocommerce'),Object(c.createElement)("br",null),Object(c.createElement)("code",null,Object(n.escapeHTML)(t))):t:Object(o.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')})(t))}},45:function(e,t){e.exports=window.wp.hooks},51:function(e,t){e.exports=window.wp.deprecated},55:function(e,t,r){"use strict";var c=r(0);t.a=function(e){let{srcElement:t,size:r=24,...o}=e;return Object(c.isValidElement)(t)?Object(c.cloneElement)(t,{width:r,height:r,...o}):null}},6:function(e,t){e.exports=window.lodash},61:function(e,t){e.exports=window.wp.dom},64:function(e,t){e.exports=window.regeneratorRuntime},751:function(e,t,r){e.exports=r(872)},752:function(e,t){},753:function(e,t,r){"use strict";var c=r(0),o=r(18);const n=Object(c.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.createElement)("path",{d:"M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42zM13 20.01L4 11V4h7v-.01l9 9-7 7.02z"}),Object(c.createElement)("circle",{cx:"6.5",cy:"6.5",r:"1.5"}),Object(c.createElement)("path",{d:"M8.9 12.55c0 .57.23 1.07.6 1.45l3.5 3.5 3.5-3.5c.37-.37.6-.89.6-1.45 0-1.13-.92-2.05-2.05-2.05-.57 0-1.08.23-1.45.6l-.6.6-.6-.59c-.37-.38-.89-.61-1.45-.61-1.13 0-2.05.92-2.05 2.05z"}));t.a=n},76:function(e,t){e.exports=window.wp.serverSideRender},79:function(e,t){e.exports=window.ReactDOM},8:function(e,t){e.exports=window.React},82:function(e,t){e.exports=window.wp.viewport},84:function(e,t,r){"use strict";var c=r(0),o=r(1),n=(r(2),r(4));t.a=e=>{let{onChange:t,settings:r}=e;const{button:l,price:i,rating:a,title:s}=r;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(n.ToggleControl,{label:Object(o.__)("Product title",'woocommerce'),help:s?Object(o.__)("Product title is visible.",'woocommerce'):Object(o.__)("Product title is hidden.",'woocommerce'),checked:s,onChange:()=>t({...r,title:!s})}),Object(c.createElement)(n.ToggleControl,{label:Object(o.__)("Product price",'woocommerce'),help:i?Object(o.__)("Product price is visible.",'woocommerce'):Object(o.__)("Product price is hidden.",'woocommerce'),checked:i,onChange:()=>t({...r,price:!i})}),Object(c.createElement)(n.ToggleControl,{label:Object(o.__)("Product rating",'woocommerce'),help:a?Object(o.__)("Product rating is visible.",'woocommerce'):Object(o.__)("Product rating is hidden.",'woocommerce'),checked:a,onChange:()=>t({...r,rating:!a})}),Object(c.createElement)(n.ToggleControl,{label:Object(o.__)("Add to Cart button",'woocommerce'),help:l?Object(o.__)("Add to Cart button is visible.",'woocommerce'):Object(o.__)("Add to Cart button is hidden.",'woocommerce'),checked:l,onChange:()=>t({...r,button:!l})}))}},85:function(e,t,r){"use strict";var c=r(0),o=r(1),n=r(6),l=(r(2),r(4));t.a=e=>{let{columns:t,rows:r,setAttributes:i,alignButtons:a,minColumns:s=1,maxColumns:u=6,minRows:b=1,maxRows:d=6}=e;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(l.RangeControl,{label:Object(o.__)("Columns",'woocommerce'),value:t,onChange:e=>{const t=Object(n.clamp)(e,s,u);i({columns:Number.isNaN(t)?"":t})},min:s,max:u}),Object(c.createElement)(l.RangeControl,{label:Object(o.__)("Rows",'woocommerce'),value:r,onChange:e=>{const t=Object(n.clamp)(e,b,d);i({rows:Number.isNaN(t)?"":t})},min:b,max:d}),Object(c.createElement)(l.ToggleControl,{label:Object(o.__)("Align Last Block",'woocommerce'),help:a?Object(o.__)("The last inner block will be aligned vertically.",'woocommerce'):Object(o.__)("The last inner block will follow other content.",'woocommerce'),checked:a,onChange:()=>i({alignButtons:!a})}))}},872:function(e,t,r){"use strict";r.r(t);var c=r(0),o=r(1),n=r(14),l=r(6),i=r(55),a=r(753),s=r(4),u=r(9),b=r(76),d=r.n(b),g=(r(2),r(84)),p=r(85),h=r(90),w=r(119),E=r(172),m=r(3);const O=()=>Object(c.createElement)(s.Placeholder,{icon:Object(c.createElement)(i.a,{srcElement:a.a}),label:Object(o.__)("On Sale Products",'woocommerce'),className:"wc-block-product-on-sale"},Object(o.__)("This block shows on-sale products. There are currently no discounted products in your store.",'woocommerce'));class f extends c.Component{getInspectorControls(){const{attributes:e,setAttributes:t}=this.props,{categories:r,catOperator:n,columns:l,contentVisibility:i,rows:a,orderby:b,alignButtons:d}=e;return Object(c.createElement)(u.InspectorControls,{key:"inspector"},Object(c.createElement)(s.PanelBody,{title:Object(o.__)("Layout",'woocommerce'),initialOpen:!0},Object(c.createElement)(p.a,{columns:l,rows:a,alignButtons:d,setAttributes:t,minColumns:Object(m.getSetting)("min_columns",1),maxColumns:Object(m.getSetting)("max_columns",6),minRows:Object(m.getSetting)("min_rows",1),maxRows:Object(m.getSetting)("max_rows",6)})),Object(c.createElement)(s.PanelBody,{title:Object(o.__)("Content",'woocommerce'),initialOpen:!0},Object(c.createElement)(g.a,{settings:i,onChange:e=>t({contentVisibility:e})})),Object(c.createElement)(s.PanelBody,{title:Object(o.__)("Order By",'woocommerce'),initialOpen:!1},Object(c.createElement)(w.a,{setAttributes:t,value:b})),Object(c.createElement)(s.PanelBody,{title:Object(o.__)("Filter by Product Category",'woocommerce'),initialOpen:!1},Object(c.createElement)(h.a,{selected:r,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const r=e.map(e=>{let{id:t}=e;return t});t({categories:r})},operator:n,onOperatorChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return t({catOperator:e})}})))}render(){const{attributes:e,name:t}=this.props;return e.isPreview?E.a:Object(c.createElement)(c.Fragment,null,this.getInspectorControls(),Object(c.createElement)(s.Disabled,null,Object(c.createElement)(d.a,{block:t,attributes:e,EmptyResponsePlaceholder:O})))}}var j=f,y=(r(752),r(101));Object(n.registerBlockType)("woocommerce/product-on-sale",{title:Object(o.__)("On Sale Products",'woocommerce'),icon:{src:Object(c.createElement)(i.a,{srcElement:a.a}),foreground:"#7f54b3"},category:"woocommerce",keywords:[Object(o.__)("WooCommerce",'woocommerce')],description:Object(o.__)("Display a grid of products currently on sale.",'woocommerce'),supports:{align:["wide","full"],html:!1},attributes:{...y.a,orderby:{type:"string",default:"date"}},example:{attributes:{isPreview:!0}},transforms:{from:[{type:"block",blocks:Object(l.without)(y.b,"woocommerce/product-on-sale"),transform:e=>Object(n.createBlock)("woocommerce/product-on-sale",e)}]},edit:e=>Object(c.createElement)(j,e),save:()=>null})},89:function(e,t){e.exports=window.wp.date},9:function(e,t){e.exports=window.wp.blockEditor},90:function(e,t,r){"use strict";var c=r(7),o=r.n(c),n=r(0),l=r(1),i=(r(2),r(40)),a=r(4),s=r(12),u=r(34),b=r(35),d=Object(s.createHigherOrderComponent)(e=>class extends n.Component{constructor(){super(...arguments),this.state={error:null,loading:!1,categories:[]},this.loadCategories=this.loadCategories.bind(this)}componentDidMount(){this.loadCategories()}loadCategories(){this.setState({loading:!0}),Object(u.c)().then(e=>{this.setState({categories:e,loading:!1,error:null})}).catch(async e=>{const t=await Object(b.a)(e);this.setState({categories:[],loading:!1,error:t})})}render(){const{error:t,loading:r,categories:c}=this.state;return Object(n.createElement)(e,o()({},this.props,{error:t,isLoading:r,categories:c}))}},"withCategories"),g=r(41),p=r(5),h=r.n(p);r(124);const w=e=>{let{categories:t,error:r,isLoading:c,onChange:s,onOperatorChange:u,operator:b,selected:d,isCompact:p,isSingle:w,showReviewCount:E}=e;const m={clear:Object(l.__)("Clear all product categories",'woocommerce'),list:Object(l.__)("Product Categories",'woocommerce'),noItems:Object(l.__)("Your store doesn't have any product categories.",'woocommerce'),search:Object(l.__)("Search for product categories",'woocommerce'),selected:e=>Object(l.sprintf)( /* translators: %d is the count of selected categories. */ Object(l._n)("%d category selected","%d categories selected",e,'woocommerce'),e),updated:Object(l.__)("Category search results updated.",'woocommerce')};return r?Object(n.createElement)(g.a,{error:r}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.b,{className:"woocommerce-product-categories",list:t,isLoading:c,selected:d.map(e=>t.find(t=>t.id===e)).filter(Boolean),onChange:s,renderItem:e=>{const{item:t,search:r,depth:c=0}=e,a=t.breadcrumbs.length?`${t.breadcrumbs.join(", ")}, ${t.name}`:t.name,s=E?Object(l.sprintf)( /* translators: %1$s is the item name, %2$d is the count of reviews for the item. */ Object(l._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.review_count,'woocommerce'),a,t.review_count):Object(l.sprintf)( /* translators: %1$s is the item name, %2$d is the count of products for the item. */ Object(l._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,'woocommerce'),a,t.count),u=E?Object(l.sprintf)( /* translators: %d is the count of reviews. */ Object(l._n)("%d review","%d reviews",t.review_count,'woocommerce'),t.review_count):Object(l.sprintf)( /* translators: %d is the count of products. */ Object(l._n)("%d product","%d products",t.count,'woocommerce'),t.count);return Object(n.createElement)(i.c,o()({className:h()("woocommerce-product-categories__item","has-count",{"is-searching":r.length>0,"is-skip-level":0===c&&0!==t.parent})},e,{countLabel:u,"aria-label":s}))},messages:m,isCompact:p,isHierarchical:!0,isSingle:w}),!!u&&Object(n.createElement)("div",{hidden:d.length<2},Object(n.createElement)(a.SelectControl,{className:"woocommerce-product-categories__operator",label:Object(l.__)("Display products matching",'woocommerce'),help:Object(l.__)("Pick at least two categories to use this setting.",'woocommerce'),value:b,onChange:u,options:[{label:Object(l.__)("Any selected categories",'woocommerce'),value:"any"},{label:Object(l.__)("All selected categories",'woocommerce'),value:"all"}]})))};w.defaultProps={operator:"any",isCompact:!1,isSingle:!1},t.a=d(w)}});