(()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var o in s)e.o(s,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:s[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,s=window.React,o=window.wp.blockEditor,r=window.wp.components,n=window.wp.i18n,l=window.wp.serverSideRender;var i=e.n(l);const a=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"bp/recent-posts","title":"Recent Networkwide Posts","category":"widgets","icon":"wordpress","description":"A list of recently published posts from across your network.","keywords":["BuddyPress","blogs","sites","community"],"textdomain":"buddypress","attributes":{"title":{"type":"string","default":""},"maxPosts":{"type":"number","default":10},"linkTitle":{"type":"boolean","default":false}},"supports":{"align":true},"editorScript":"file:index.js","style":"file:index.css"}');(0,t.registerBlockType)(a,{icon:{background:"#fff",foreground:"#d84800",src:"wordpress"},edit:({attributes:e,setAttributes:t})=>{const l=(0,o.useBlockProps)(),{title:a,maxPosts:d,linkTitle:c}=e,p=a||(0,n.__)("Recent Networkwide Posts","buddypress"),u={...e,title:p};return(0,s.createElement)("div",{...l},(0,s.createElement)(o.InspectorControls,null,(0,s.createElement)(r.PanelBody,{title:(0,n.__)("Settings","buddypress"),initialOpen:!0},(0,s.createElement)(r.TextControl,{label:(0,n.__)("Title","buddypress"),value:p,onChange:e=>{t({title:e})}}),(0,s.createElement)(r.RangeControl,{label:(0,n.__)("Max posts to show","buddypress"),value:d,onChange:e=>t({maxPosts:e}),min:1,max:10,required:!0}),(0,s.createElement)(r.ToggleControl,{label:(0,n.__)("Link block title to Blogs directory","buddypress"),checked:!!c,onChange:()=>{t({linkTitle:!c})}}))),(0,s.createElement)(r.Disabled,null,(0,s.createElement)(i(),{block:"bp/recent-posts",attributes:u})))}})})();