!function(){"use strict";var e,t={8292:function(){var e=window.wp.blocks,t=window.wp.i18n,r=window.wp.blockEditor,n=window.wp.coreData;function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o.apply(null,arguments)}var a=JSON.parse('{"UU":"surecart/product-sale-badge"}');(0,e.registerBlockType)(a.UU,{edit:e=>{let{attributes:a,setAttributes:c,context:{postId:i}}=e;const{text:l}=a,{record:{meta:{product:s}={}}={}}=(0,n.useEntityRecord)("postType","sc_product",i),u=(0,r.useBlockProps)({className:"sc-tag sc-tag--primary"});return s&&!s?.is_on_sale?null:React.createElement(r.RichText,o({tagName:"div",value:l,onChange:e=>c({text:e}),"aria-label":l?(0,t.__)("Sale Label"):(0,t.__)("Empty Sale label"),"data-empty":!l,placeholder:(0,t.__)("Type in sale badge text","surecart"),allowedFormats:["core/bold","core/italic"]},u))}})}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.m=t,e=[],n.O=function(t,r,o,a){if(!r){var c=1/0;for(u=0;u<e.length;u++){r=e[u][0],o=e[u][1],a=e[u][2];for(var i=!0,l=0;l<r.length;l++)(!1&a||c>=a)&&Object.keys(n.O).every((function(e){return n.O[e](r[l])}))?r.splice(l--,1):(i=!1,a<c&&(c=a));if(i){e.splice(u--,1);var s=o();void 0!==s&&(t=s)}}return t}a=a||0;for(var u=e.length;u>0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[r,o,a]},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={8196:0,3340:0};n.O.j=function(t){return 0===e[t]};var t=function(t,r){var o,a,c=r[0],i=r[1],l=r[2],s=0;if(c.some((function(t){return 0!==e[t]}))){for(o in i)n.o(i,o)&&(n.m[o]=i[o]);if(l)var u=l(n)}for(t&&t(r);s<c.length;s++)a=c[s],n.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return n.O(u)},r=self.webpackChunk_surecart_blocks_next=self.webpackChunk_surecart_blocks_next||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var o=n.O(void 0,[3340],(function(){return n(8292)}));o=n.O(o)}();