(()=>{"use strict";var e,r={7044(){const e=window.wp.blocks,r=window.ReactJSXRuntime,{__}=wp.i18n,{InnerBlocks:t,InspectorControls:o,useBlockProps:n}=wp.blockEditor,{Fragment:a,useCallback:s}=wp.element,{Component:l}=wp.element,{PanelBody:i,DateTimePicker:c,SelectControl:p}=wp.components,{useDispatch:d}=wp.data;class m extends l{render(){const{attributes:e,setAttributes:t,className:n}=this.props;return(0,r.jsxs)(o,{children:[(0,r.jsxs)(i,{title:__("Start Time","rsvpmaker"),children:[(0,r.jsx)(p,{label:__("Set Start Time","rsvpmaker"),value:e.start_on,onChange:e=>t({start_on:e}),options:[{value:0,label:__("No","rsvpmaker")},{value:1,label:__("Yes","rsvpmaker")}]}),e.start_on>0&&(0,r.jsx)(c,{is12Hour:!0,currentDate:e.start,onChange:e=>t({start:e})})]}),(0,r.jsxs)(i,{title:__("End Time","rsvpmaker"),children:[(0,r.jsx)(p,{label:__("Set End Time","rsvpmaker"),value:e.end_on,onChange:e=>t({end_on:e}),options:[{value:0,label:__("No","rsvpmaker")},{value:1,label:__("Yes","rsvpmaker")}]}),e.end_on>0&&(0,r.jsx)("div",{id:"endtime",children:(0,r.jsx)(c,{is12Hour:!0,currentDate:e.end,onChange:e=>t({end:e})})}),(0,r.jsx)(p,{label:__("Delete or Hide Expired Content","rsvpmaker"),value:e.delete_expired,onChange:e=>t({delete_expired:e}),options:[{value:0,label:__("Hide","rsvpmaker")},{value:1,label:__("Delete","rsvpmaker")}]})]})]},"inspector")}}const{InnerBlocks:u}=wp.blockEditor,v=JSON.parse('{"UU":"rsvpmaker/limited"}');(0,e.registerBlockType)(v.UU,{edit:function(e){const{attributes:o,className:l,setAttributes:i,isSelected:c,clientId:p}=e,u=n({className:l}),{selectBlock:v}=d("core/block-editor"),k=s(e=>{e.preventDefault(),e.stopPropagation(),v(p)},[p,v]),b=s(e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),v(p))},[p,v]);return(0,r.jsxs)(a,{children:[(0,r.jsx)(m,{...e}),(0,r.jsxs)("div",{...u,children:[(0,r.jsx)("div",{className:"limited_label limited_border limited_label--start",role:"button",tabIndex:"0",onClick:k,onKeyDown:b,children:__("START Limited time content (click here to set start and end times)")}),(0,r.jsx)("div",{className:"limited_inner",children:(0,r.jsx)(t,{})}),(0,r.jsx)("div",{className:"limited_label limited_border limited_label--end",role:"button",tabIndex:"0",onClick:k,onKeyDown:b,children:__("END Limited time content")})]})]})},save:function({className:e}){return(0,r.jsx)("div",{className:e,children:(0,r.jsx)(u.Content,{})})},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 n=t[e];if(void 0!==n)return n.exports;var a=t[e]={exports:{}};return r[e](a,a.exports,o),a.exports}o.m=r,e=[],o.O=(r,t,n,a)=>{if(!t){var s=1/0;for(p=0;p<e.length;p++){for(var[t,n,a]=e[p],l=!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):(l=!1,a<s&&(s=a));if(l){e.splice(p--,1);var c=n();void 0!==c&&(r=c)}}return r}a=a||0;for(var p=e.length;p>0&&e[p-1][2]>a;p--)e[p]=e[p-1];e[p]=[t,n,a]},o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={9466:0,1374:0};o.O.j=r=>0===e[r];var r=(r,t)=>{var n,a,[s,l,i]=t,c=0;if(s.some(r=>0!==e[r])){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);if(i)var p=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(p)},t=globalThis.webpackChunkadmin=globalThis.webpackChunkadmin||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var n=o.O(void 0,[1374],()=>o(7044));n=o.O(n)})();