(()=>{"use strict";var e,t={493:()=>{const e=window.wp.i18n,t=window.wp.blocks,n=window.wp.blockEditor,s=window.wp.components,i=window.wp.element,r=window.ReactJSXRuntime,l=window.winp_snippets?.data||{},o=l[Object.keys(l)[0]]||{id:"",tags:[]};(0,t.registerBlockType)("wp-plugin-insert-php/winp-snippet",{title:(0,e.__)("Woody Snippets","insert-php"),description:(0,e.__)("Execute PHP code and insert ads, text, and media with conditional logic. Prevents content duplication.","insert-php"),icon:(0,r.jsxs)("svg",{width:"25",height:"25",viewBox:"0 0 254 254",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",imageRendering:"optimizeQuality",fillRule:"evenodd",clipRule:"evenodd",children:[(0,r.jsx)("path",{d:"M76 187l44 48 45-49c1-1-12 5-22 5-10-1-23-15-23-15s-3 9-19 13c-11 4-25-2-25-2z"}),(0,r.jsx)("ellipse",{cx:99,cy:134,rx:11,ry:12}),(0,r.jsx)("ellipse",{cx:143,cy:135,rx:11,ry:12}),(0,r.jsx)("path",{d:"M103 103s-10-12-4-35c6-22 16-29 23-33 8-5-5 16-4 20 2 3 14-25 39-27 25-1 41 21 41 21l-13-1s13 5 18 11 11 15 10 18-5 1-5 1 19 13 20 24c1 10-11-10-39-14-29-4-50 14-45 8s17-16 29-17 27 3 27 3-21-12-19-16c2-5 16-2 16-2s-9-8-20-9c-10-2-19 3-18-1 1-5 10-13 15-12 6 1-12-6-24-2-11 5-19 11-26 25s-9 22-13 20c-3-1-4-17-4-17l-4 35zm-60 35l16-21s3-8-1-12c-5-3-9-1-9-1l-22 28s-3 3-2 6c0 2 2 5 2 5l21 28s7 3 10-2c4-5 2-9 2-9l-17-22z"}),(0,r.jsx)("path",{d:"M199 138l-17-21s-3-8 2-12c4-3 9-1 9-1l23 28s3 3 3 6c0 2-3 5-3 5l-22 28s-7 3-11-2-2-9-2-9l18-22z"})]}),category:"formatting",attributes:{id:{type:"int",default:""},attrs:{type:"array",default:o.tags||[]},attrValues:{type:"array",default:[]}},edit(t){const{id:a,attrValues:p,attrs:c}=t.attributes,d=(0,n.useBlockProps)({className:"winp-snippet-gb-container"});(0,i.useEffect)(()=>{!a&&o.id&&t.setAttributes({id:parseInt(o.id,10),attrs:o.tags||[]})},[]);let u=[],h=Object.keys(l),g=0;for(;g<h.length;g++){let e=h[g];u.push({label:l[e].title,value:e})}function w(e,n){let s=[];for(let t=0;t<c.length;t++)c[t]===e?s[t]=n:p.hasOwnProperty(t)?s[t]=p[t]:s[t]="";t.setAttributes({attrValues:s})}return[(0,r.jsxs)("div",{...d,children:[(0,r.jsx)("div",{className:"winp-snippet-gb-dropdown",children:(0,r.jsx)(s.SelectControl,{label:(0,e.__)("Select snippet shortcode:","insert-php"),value:a,options:u,onChange:function(e){t.setAttributes({id:e,attrs:l[e].tags})}})}),(0,r.jsx)("div",{className:"winp-snippet-gb-content",children:(0,r.jsx)(n.InnerBlocks,{})}),(0,r.jsx)(n.InspectorControls,{children:(0,r.jsx)("div",{id:"winp-snippet-gb-content-tags",children:function(){let t=[];if(c)for(let n=0;n<c.length;n++){const i=c[n];t.push((0,r.jsx)("div",{className:"winp-snippet-gb-content-tag",children:(0,r.jsx)(s.TextControl,{label:(0,e.__)('Attribute "',"insert-php")+c[n]+'":',className:"winp-snippet-gb-tag",value:p[n]||"",name:i,placeholder:(0,e.__)("Attribute value ","insert-php")+"(variable $"+c[n]+")",onChange:e=>w(i,e)})}))}return t}()})})]})]},save(){const e=n.useBlockProps.save();return(0,r.jsx)("div",{...e,children:(0,r.jsx)(n.InnerBlocks.Content,{})})}})}},n={};function s(e){var i=n[e];if(void 0!==i)return i.exports;var r=n[e]={exports:{}};return t[e](r,r.exports,s),r.exports}s.m=t,e=[],s.O=(t,n,i,r)=>{if(!n){var l=1/0;for(c=0;c<e.length;c++){for(var[n,i,r]=e[c],o=!0,a=0;a<n.length;a++)(!1&r||l>=r)&&Object.keys(s.O).every(e=>s.O[e](n[a]))?n.splice(a--,1):(o=!1,r<l&&(l=r));if(o){e.splice(c--,1);var p=i();void 0!==p&&(t=p)}}return t}r=r||0;for(var c=e.length;c>0&&e[c-1][2]>r;c--)e[c]=e[c-1];e[c]=[n,i,r]},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};s.O.j=t=>0===e[t];var t=(t,n)=>{var i,r,[l,o,a]=n,p=0;if(l.some(t=>0!==e[t])){for(i in o)s.o(o,i)&&(s.m[i]=o[i]);if(a)var c=a(s)}for(t&&t(n);p<l.length;p++)r=l[p],s.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return s.O(c)},n=globalThis.webpackChunkinsert_php=globalThis.webpackChunkinsert_php||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var i=s.O(void 0,[350],()=>s(493));i=s.O(i)})();