(()=>{"use strict";const e={n:a=>{const o=a&&a.__esModule?()=>a.default:()=>a;return e.d(o,{a:o}),o},d:(a,o)=>{if(Array.isArray(o))for(var t=0;t<o.length;){var n=o[t++],l=o[t++];e.o(a,n)?0===l&&t++:0===l?Object.defineProperty(a,n,{enumerable:!0,value:o[t++]}):Object.defineProperty(a,n,{enumerable:!0,get:l})}else for(var n in o)e.o(o,n)&&!e.o(a,n)&&Object.defineProperty(a,n,{enumerable:!0,get:o[n]})},o:(e,a)=>Object.hasOwn(e,a)},a=window.wp.blocks,o=window.wp.primitives,t=window.ReactJSXRuntime;var n=(0,t.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(o.Path,{fillRule:"evenodd",d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z"})});const l=window.wp.serverSideRender;var r=e.n(l);const i=window.wp.components,s=window.wp.blockEditor,c=window.wp.element,p=window.wp.hooks,d=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"aiopod/participants","version":"1.0.0","title":"AIOPOD - Participants","category":"aio-podcast-studio","keywords":["podcast","episode","participant","aio-podcast-studio","aiopod"],"description":"Display a list of your participants.","textdomain":"aio-podcast-studio","editorScript":"file:./index.js"}');function u(e){var a="string";return"categories"==e||"tags"==e||"participants"==e?a="array":"number"==e?a="number":"checkbox"==e&&(a="boolean"),a}(0,a.registerBlockType)(d,{attributes:function(e){var a={};for(var o in e){var t=e[o].fields;for(var n in t)a[t[n].name]={type:u(t[n].type),default:t[n].value}}return a}(aiopod_blocks.participants),icon:n,edit:function({attributes:e,setAttributes:a}){const o=aiopod_blocks.participants,n=e=>o=>{a({[e]:o})},l=(0,c.useRef)();return(0,c.useEffect)(()=>{l.current?(0,p.applyFilters)("aiopod_block_init",e):l.current=!0}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.InspectorControls,{children:Object.keys(o).map((l,r)=>{return c=l,(0,p.applyFilters)("aiopod_block_toggle_panels",!0,c,e)&&(0,t.jsx)(i.PanelBody,{title:o[l].title,initialOpen:0==r,className:"aiopod-block-panel",children:Object.keys(o[l].fields).map((r,c)=>((o,l)=>{if(r=o.name,!(0,p.applyFilters)("aiopod_block_toggle_controls",!0,r,e))return"";var r;const c=o.placeholder?o.placeholder:"",d=o.description?o.description:"";switch(o.type){case"header":return(0,t.jsx)(i.PanelRow,{children:(0,t.jsx)("h3",{className:"aiopod-no-margin",children:o.label})},l);case"number":return(0,t.jsx)(i.PanelRow,{children:(0,t.jsx)(i.RangeControl,{label:o.label,help:d,placeholder:c,value:e[o.name],min:o.min,max:o.max,onChange:n(o.name),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})},l);case"textarea":return(0,t.jsx)(i.PanelRow,{children:(0,t.jsx)(i.TextareaControl,{label:o.label,help:d,placeholder:c,value:e[o.name],onChange:n(o.name),__nextHasNoMarginBottom:!0})},l);case"select":case"radio":let r=[];for(let e in o.options)r.push({label:o.options[e],value:e});return(0,t.jsx)(i.PanelRow,{children:(0,t.jsx)(i.SelectControl,{label:o.label,help:d,options:r,value:e[o.name],onChange:n(o.name),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})},l);case"checkbox":return(0,t.jsx)(i.PanelRow,{children:(0,t.jsx)(i.ToggleControl,{label:o.label,help:d,checked:e[o.name],onChange:(u=o.name,e=>{a({[u]:e})}),__nextHasNoMarginBottom:!0})},l);case"color":return(0,t.jsx)(i.PanelRow,{children:(0,t.jsx)(s.PanelColorSettings,{title:o.label,colorSettings:[{label:aiopod_blocks.i18n.select_color,value:e[o.name],onChange:n(o.name)}]})},l);default:return(0,t.jsx)(i.PanelRow,{children:(0,t.jsx)(i.TextControl,{label:o.label,help:d,placeholder:c,value:e[o.name],onChange:n(o.name),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})},l)}var u})(o[l].fields[r],"aiopod-block-control-"+c))},"aiopod-block-panel-"+r);var c})}),(0,t.jsx)("div",{...(0,s.useBlockProps)(),children:(0,t.jsx)(i.Disabled,{children:(0,t.jsx)(r(),{block:"aiopod/participants",attributes:e})})})]})}})})();