this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["legacy-template"]=function(e){function t(t){for(var r,l,i=t[0],u=t[1],a=t[2],p=0,d=[];p{var t,o,p,b;let{clientId:f,attributes:g,setAttributes:w}=e;const{replaceBlock:O}=Object(d.useDispatch)("core/block-editor"),h=Object(i.useBlockProps)(),k=null!==(t=null===(o=m[g.template])||void 0===o?void 0:o.title)&&void 0!==t?t:g.template,v=null!==(p=null===(b=m[g.template])||void 0===b?void 0:b.placeholder)&&void 0!==p?p:"fallback";return Object(r.useEffect)(()=>{var e;return w({template:g.template,align:null!==(e=g.align)&&void 0!==e?e:"wide"})},[g.align,g.template,w]),Object(r.createElement)("div",h,Object(r.createElement)(u.Placeholder,{icon:s.a,label:k,className:"wp-block-woocommerce-classic-template__placeholder"},Object(r.createElement)("div",{className:"wp-block-woocommerce-classic-template__placeholder-copy"},Object(r.createElement)("p",{className:"wp-block-woocommerce-classic-template__placeholder-warning"},Object(r.createElement)("strong",null,Object(a.__)("Attention: Do not remove this block!","woocommerce"))," ",Object(a.__)("Removal will cause unintended effects on your store.","woocommerce")),Object(r.createElement)("p",null,Object(a.sprintf)( /* translators: %s is the template title */ Object(a.__)("This is an editor placeholder for the %s. On your store this will be replaced by the template and display with your product image(s), title, price, etc. You can move this placeholder around and add further blocks around it to extend the template.","woocommerce"),k))),Object(r.createElement)("div",{className:"wp-block-woocommerce-classic-template__placeholder-wireframe"},Object(n.a)()&&Object(r.createElement)("div",{className:"wp-block-woocommerce-classic-template__placeholder-migration-button-container"},Object(r.createElement)(u.Button,{isPrimary:!0,onClick:()=>{O(f,Object(c.createBlock)("core/paragraph",{content:"Instead of this block, the new Product Grid Block will be rendered"}))},text:Object(a.__)("Use the blockified Product Grid Block","woocommerce")})),Object(r.createElement)("img",{className:"wp-block-woocommerce-classic-template__placeholder-image",src:`${l.m}template-placeholders/${v}.svg`,alt:k}))))},g=Object.keys(m),w=e=>{let{template:t,inserter:o}=e;Object(c.registerBlockType)(b,{title:t?m[t].title:Object(a.__)("WooCommerce Classic Template","woocommerce"),icon:Object(r.createElement)(p.a,{icon:s.a,className:"wc-block-editor-components-block-icon"}),category:"woocommerce",apiVersion:2,keywords:[Object(a.__)("WooCommerce","woocommerce")],description:Object(a.__)("Renders classic WooCommerce PHP templates.","woocommerce"),supports:{align:["wide","full"],html:!1,multiple:!1,reusable:!1,inserter:o},example:{attributes:{isPreview:!0}},attributes:{template:{type:"string",default:"any"},align:{type:"string",default:"wide"}},edit:e=>{let{attributes:o,clientId:c,setAttributes:n}=e;const l=null!=t?t:o.template;return Object(r.createElement)(f,{attributes:{...o,template:l},setAttributes:n,clientId:c})},save:()=>null})},O=e=>g.includes(e);let h;Object(n.a)()?Object(d.subscribe)(()=>{var e;const t=h,o=Object(d.select)("core/edit-site");if(h=null==o?void 0:o.getEditedPostId(),t===h)return;const r=null===(e=h)||void 0===e?void 0:e.split("//")[1];if(null==r)return;const n=Object(c.getBlockType)(b);if(void 0!==n&&(!O(r)||((e,t)=>(null==e?void 0:e.title)!==m[t].title)(n,r)))return Object(c.unregisterBlockType)(b),void(h=void 0);void 0===n&&O(r)&&w({template:r,inserter:!0})}):w({inserter:!1})},65:function(e,t,o){"use strict";o.d(t,"c",(function(){return n})),o.d(t,"d",(function(){return l})),o.d(t,"a",(function(){return i})),o.d(t,"b",(function(){return u}));var r=o(13),c=o(22);const n=(e,t)=>{if(c.n>2)return Object(r.registerBlockType)(e,t)},l=(e,t)=>{if(c.n>1)return Object(r.registerBlockType)(e,t)},i=()=>c.n>2,u=()=>c.n>1},9:function(e,t){e.exports=window.wp.data}});