(()=>{"use strict";var e,t={771:()=>{const e=window.React,t=window.wp.i18n,o=window.wp.blocks,r=JSON.parse('{"NQ":"hakoniwa-blocks","L1":"Hakoniwa"}'),s=JSON.parse('{"UU":"hakoniwa-blocks/related-posts"}'),i=window.wp.blockEditor,n=window.wp.components,a=window.wp.hooks,l=window.wp.data,c=window.wp.element;(0,a.addFilter)("editor.BlockEdit","core/query",(o=>r=>{if("hakoniwa-blocks/related-posts"!==r.attributes.namespace)return(0,e.createElement)(o,{...r});const{attributes:s,setAttributes:a}=r,{query:p}=s,{currentPostType:d,currentPostId:u,isSiteEditor:h}=p,{getCurrentPostType:w,getCurrentPostId:y,getIsSiteEditor:k}=(0,l.useSelect)((e=>({getCurrentPostType:e("core/editor").getCurrentPostType()||"",getCurrentPostId:e("core/editor").getCurrentPostId()||"",getIsSiteEditor:e("core/edit-site")||""})));return(0,c.useEffect)((()=>{w&&a({...s,query:{...p,currentPostType:w}}),y&&a({...s,query:{...p,currentPostId:y}}),k&&a({...s,query:{...p,isSiteEditor:!0}})}),[]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o,{key:"edit",...r}),h&&(0,e.createElement)(i.InspectorControls,null,(0,e.createElement)(n.PanelBody,{title:(0,t.__)("Related Posts","hakoniwa-blocks"),initialOpen:!0},(0,e.createElement)("div",null,"サイトエディターに追加"))))}));const p=r.L1,d=(s.UU,r.NQ),u=(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-article",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},(0,e.createElement)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,e.createElement)("rect",{fill:"none",x:"3",y:"4",width:"18",height:"16",rx:"2"}),(0,e.createElement)("path",{d:"M7 8h10"}),(0,e.createElement)("path",{d:"M7 12h10"}),(0,e.createElement)("path",{d:"M7 16h10"})),h="hakoniwa-blocks/related-posts";(0,o.registerBlockVariation)("core/query",{name:h,title:(0,t.__)("Related Posts","hakoniwa-blocks"),description:(0,t.__)("Display related posts.","hakoniwa-blocks"),category:d,isActive:["namespace"],icon:u,keywords:[(0,t.__)(p),(0,t.__)("Related Posts")],attributes:{namespace:h,query:{perPage:3,postType:"post",pages:0,offset:0,author:"",search:"",exclude:[],sticky:"",inherit:!1,isRelatedPosts:!0,isSiteEditor:!1,currentPostType:"",currentPostId:""},align:"wide",className:"related-posts"},allowedControls:["postType"],innerBlocks:[["core/post-template",{align:"wide",className:"archives",layout:{type:"grid",columnCount:3}},[["core/post-featured-image",{isLink:!0,className:"aspect-ratio-16-9"}],["core/post-title",{isLink:!0,style:{typography:{lineHeight:1.4}},fontSize:"md"}],["core/post-excerpt",{style:{typography:{lineHeight:1.6}},fontSize:"2xs"}],["core/post-date",{isLink:!0,style:{typography:{lineHeight:1.6}},fontSize:"2xs"}]]],["core/query-pagination",{align:"wide",className:"pt-8 pb-8 has-xs-font-size",layout:{type:"flex",justifyContent:"center"}}],["core/query-no-results"]],scope:["inserter"]})}},o={};function r(e){var s=o[e];if(void 0!==s)return s.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.m=t,e=[],r.O=(t,o,s,i)=>{if(!o){var n=1/0;for(p=0;p<e.length;p++){for(var[o,s,i]=e[p],a=!0,l=0;l<o.length;l++)(!1&i||n>=i)&&Object.keys(r.O).every((e=>r.O[e](o[l])))?o.splice(l--,1):(a=!1,i<n&&(n=i));if(a){e.splice(p--,1);var c=s();void 0!==c&&(t=c)}}return t}i=i||0;for(var p=e.length;p>0&&e[p-1][2]>i;p--)e[p]=e[p-1];e[p]=[o,s,i]},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={3091:0,7851:0};r.O.j=t=>0===e[t];var t=(t,o)=>{var s,i,[n,a,l]=o,c=0;if(n.some((t=>0!==e[t]))){for(s in a)r.o(a,s)&&(r.m[s]=a[s]);if(l)var p=l(r)}for(t&&t(o);c<n.length;c++)i=n[c],r.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return r.O(p)},o=globalThis.webpackChunkhakoniwa_blocks=globalThis.webpackChunkhakoniwa_blocks||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var s=r.O(void 0,[7851],(()=>r(771)));s=r.O(s)})();