(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var n in a)e.o(a,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:a[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,a=JSON.parse('{"UU":"events-manager/locations"}'),n=window.React,l=window.wp.i18n,o=window.wp.blockEditor,r=window.wp.components,s=window.wp.serverSideRender;var m=e.n(s);const i=[{label:(0,l.__)("Ascending","events-manager"),value:"ASC"},{label:(0,l.__)("Descending","events-manager"),value:"DESC"}],_=[{label:(0,l.__)("Event start date/time, location name","events-manager"),value:"event_start_date,event_start_time,location_name"},{label:(0,l.__)("Location name","events-manager"),value:"location_name"}],c=[{label:(0,l.__)("Future","events-manager"),value:"future"},{label:(0,l.__)("Past","events-manager"),value:"past"},{label:(0,l.__)("All","events-manager"),value:"all"}];(0,t.registerBlockType)(a.UU,{edit:function({attributes:e,setAttributes:t}){const{title:a,scope:s,order:v,orderby:u,limit:g,no_locations_text:d,format_header:b,format:p,format_footer:f}=e;return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(o.InspectorControls,null,(0,n.createElement)(r.PanelBody,{title:(0,l.__)("Locations list settings","events-manager")},(0,n.createElement)(r.TextControl,{label:(0,l.__)("Title","events-manager"),value:a,onChange:e=>t({title:e})}),(0,n.createElement)(r.__experimentalNumberControl,{label:(0,l.__)("Number of locations","events-manager"),min:1,value:g,onChange:e=>t({limit:parseInt(e,10)||5})}),(0,n.createElement)(r.SelectControl,{label:(0,l.__)("Scope","events-manager"),value:s,options:c,onChange:e=>t({scope:e})}),(0,n.createElement)(r.SelectControl,{label:(0,l.__)("Order by","events-manager"),value:u,options:_,onChange:e=>t({orderby:e})}),(0,n.createElement)(r.SelectControl,{label:(0,l.__)("Order","events-manager"),value:v,options:i,onChange:e=>t({order:e})}),(0,n.createElement)(r.TextControl,{label:(0,l.__)("No locations message","events-manager"),value:d,onChange:e=>t({no_locations_text:e})})),(0,n.createElement)(r.PanelBody,{title:(0,l.__)("Output format (advanced)","events-manager"),initialOpen:!1},(0,n.createElement)(r.TextareaControl,{label:(0,l.__)("List header format","events-manager"),value:b,onChange:e=>t({format_header:e})}),(0,n.createElement)(r.TextareaControl,{label:(0,l.__)("List item format","events-manager"),help:(0,l.__)("Leave blank to use the default format from Settings.","events-manager"),value:p,onChange:e=>t({format:e})}),(0,n.createElement)(r.TextareaControl,{label:(0,l.__)("List footer format","events-manager"),value:f,onChange:e=>t({format_footer:e})}))),(0,n.createElement)("div",{...(0,o.useBlockProps)()},(0,n.createElement)(m(),{block:"events-manager/locations",attributes:e})))},save:()=>null})})();