(()=>{"use strict";var e,r={1328(){const e=window.wp.blocks;window.wp.apiFetch;const r=window.ReactJSXRuntime,{__}=wp.i18n,{Fragment:t}=wp.element,{Component:o}=wp.element,{InspectorControls:l}=wp.blockEditor,{PanelBody:a,SelectControl:s,TextControl:n,TextareaControl:i,ToggleControl:c,RadioControl:u}=wp.components;class p extends o{render(){const{attributes:e,setAttributes:t,className:o}=this.props;return(0,r.jsx)(l,{children:(0,r.jsxs)(a,{title:__("Field Properties","rsvpmaker"),children:[(0,r.jsx)(n,{label:__("Label","rsvpmaker"),value:e.label,onChange:r=>function(r){!function({label:e,attributes:r,setAttributes:t,setGuestform:o=!0}){if(r.slug&&("first"===r.slug||"last"===r.slug||"email"===r.slug||r.slug.length>25))return void t({label:e});let l=e.toLowerCase().replaceAll(/[^A-Za-z0-9]+/g,"_");l.length>20&&(l=l.substring(0,20)),l+="_"+Date.now();const a={slug:l,label:e};o&&(a.guestform=!0),t(a)}({label:r,attributes:e,setAttributes:t,setGuestform:!0})}(r)}),(0,r.jsx)(n,{label:__("Field Note (optional additional information)","rsvpmaker"),value:e.fieldnote||"",onChange:e=>t({fieldnote:e})}),(0,r.jsx)(s,{label:"Rows",value:e.rows,options:[{label:"2",value:"2"},{label:"3",value:"3"},{label:"4",value:"4"},{label:"5",value:"5"},{label:"6",value:"6"},{label:"7",value:"7"},{label:"8",value:"8"},{label:"9",value:"9"},{label:"10",value:"10"}],onChange:e=>{t({rows:e})}}),(0,r.jsx)(c,{label:__("Include on Guest Form","rsvpmaker"),checked:e.guestform,help:e.required?"Included":"Not included",onChange:e=>{t({guestform:e})}})]})},"fieldinspector")}}const d=JSON.parse('{"UU":"rsvpmaker/formtextarea"}');(0,e.registerBlockType)(d.UU,{edit:function(e){const{attributes:{label:o,fieldnote:l,slug:a,rows:s,guestform:n},setAttributes:i,isSelected:c}=e;var u="profile["+a+"]";return(0,r.jsxs)(t,{children:[(0,r.jsx)(p,{...e}),(0,r.jsxs)("div",{className:e.className,children:[(0,r.jsx)("p",{children:(0,r.jsxs)("label",{children:[o,":"]})}),l&&(0,r.jsx)("p",{children:(0,r.jsx)("em",{children:l})}),(0,r.jsx)("div",{style:{marginLeft:"1.25em"},children:(0,r.jsx)("textarea",{inert:!0,tabindex:"-1",rows:s,className:a,type:"text",name:u,id:a})}),(0,r.jsx)("div",{children:(0,r.jsx)("em",{children:__("Set properties in sidebar. Intended for use within an RSVPMaker registration form.","rsvpmaker")})})]})]})},save:function(){return null},transforms:{to:[{type:"block",blocks:["core/query"],transform:r=>{const t=r.calendar&&parseInt(r.calendar)?[["rsvpmaker/calendar",r],["core/post-template",{layout:{type:"grid",columnCount:2}},[["core/post-title",{isLink:!0}],["core/post-featured-image"],["rsvpmaker/loop-blocks"],["core/read-more",{content:"Read More >>"}]]],["core/query-pagination"],["core/query-no-results",{},[["core/paragraph",{content:"No events found."}]]]]:[["core/post-template",{layout:{type:"grid",columnCount:2}},[["core/post-title",{isLink:!0}],["core/post-featured-image"],["rsvpmaker/loop-blocks"],["core/read-more",{content:"Read More >>"}]]],["core/query-pagination"],["core/query-no-results",{},[["core/paragraph",{content:"No events found."}]]]],o=(0,e.createBlocksFromInnerBlocksTemplate)(t);return(0,e.createBlock)("core/query",{queryId:0,query:{perPage:20,pages:0,offset:0,postType:"rsvpmaker",order:"asc",author:"",search:"",exclude:[],sticky:"",inherit:!1},namespace:"rsvpmaker/rsvpmaker-loop"},o)}}]}})}},t={};function o(e){var l=t[e];if(void 0!==l)return l.exports;var a=t[e]={exports:{}};return r[e](a,a.exports,o),a.exports}o.m=r,e=[],o.O=(r,t,l,a)=>{if(!t){var s=1/0;for(u=0;u<e.length;u++){for(var[t,l,a]=e[u],n=!0,i=0;i<t.length;i++)(!1&a||s>=a)&&Object.keys(o.O).every(e=>o.O[e](t[i]))?t.splice(i--,1):(n=!1,a<s&&(s=a));if(n){e.splice(u--,1);var c=l();void 0!==c&&(r=c)}}return r}a=a||0;for(var u=e.length;u>0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[t,l,a]},o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={1042:0,118:0};o.O.j=r=>0===e[r];var r=(r,t)=>{var l,a,[s,n,i]=t,c=0;if(s.some(r=>0!==e[r])){for(l in n)o.o(n,l)&&(o.m[l]=n[l]);if(i)var u=i(o)}for(r&&r(t);c<s.length;c++)a=s[c],o.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return o.O(u)},t=globalThis.webpackChunkadmin=globalThis.webpackChunkadmin||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var l=o.O(void 0,[118],()=>o(1328));l=o.O(l)})();