!function(){"use strict";vare={d:function(t,n){for(varrinn)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){returnObject.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeofSymbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ReusableBlocksMenuItems:function(){returnT},store:function(){return_}});varn={};e.r(n),e.d(n,{__experimentalConvertBlockToStatic:function(){returns},__experimentalConvertBlocksToReusable:function(){returni},__experimentalDeleteReusableBlock:function(){returnu},__experimentalSetEditingReusableBlock:function(){returnp}});varr={};e.r(r),e.d(r,{__experimentalIsEditingReusableBlock:function(){returnm}});varo=window.wp.data,l=window.wp.blockEditor,c=window.wp.blocks,a=window.wp.i18n;consts=e=>({registry:t})=>{constn=t.select(l.store).getBlock(e),r=t.select("core").getEditedEntityRecord("postType","wp_block",n.attributes.ref),o=(0,c.parse)("function"==typeofr.content?r.content(r):r.content);t.dispatch(l.store).replaceBlocks(n.clientId,o)},i=(e,t,n)=>async({registry:r,dispatch:o})=>{consts="unsynced"===n?{wp_pattern_sync_status:n}:void0,i={title:t||(0,a.__)("Untitled pattern block"),content:(0,c.serialize)(r.select(l.store).getBlocksByClientId(e)),status:"publish",meta:s},u=awaitr.dispatch("core").saveEntityRecord("postType","wp_block",i);if("unsynced"===n)return;constp=(0,c.createBlock)("core/block",{ref:u.id});r.dispatch(l.store).replaceBlocks(e,p),o.__experimentalSetEditingReusableBlock(p.clientId,!0)},u=e=>async({registry:t})=>{if(!t.select("core").getEditedEntityRecord("postType","wp_block",e))return;constn=t.select(l.store).getBlocks().filter((t=>(0,c.isReusableBlock)(t)&&t.attributes.ref===e)).map((e=>e.clientId));n.length&&t.dispatch(l.store).removeBlocks(n),awaitt.dispatch("core").deleteEntityRecord("postType","wp_block",e)};functionp(e,t){return{type:"SET_EDITING_REUSABLE_BLOCK",clientId:e,isEditing:t}}vard=(0,o.combineReducers)({isEditingReusableBlock:function(e={},t){return"SET_EDITING_REUSABLE_BLOCK"===t?.type?{...e,[t.clientId]:t.isEditing}:e}});functionm(e,t){returne.isEditingReusableBlock[t]}const_=(0,o.createReduxStore)("core/reusable-blocks",{actions:n,reducer:d,selectors:r});(0,o.register)(_);varb=window.React,k=window.wp.element,w=window.wp.components,y=window.wp.primitives;varg=(0,b.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,b.createElement)(y.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})),B=window.wp.notices,v=window.wp.coreData,E=window.wp.privateApis;const{unlock:f}=(0,E.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/reusable-blocks"),{useReusableBlocksRenameHint:h,ReusableBlocksRenameHint:C}=f(l.privateApis);functionR({clientIds:e,rootClientId:t,onClose:n}){constr=h(),[s,i]=(0,k.useState)(void0),[u,p]=(0,k.useState)(!1),[d,m]=(0,k.useState)(""),y=(0,o.useSelect)((n=>{varr;const{canUser:o}=n(v.store),{getBlocksByClientId:a,canInsertBlockType:s,getBlockRootClientId:i}=n(l.store),u=t||(e.length>0?i(e[0]):void0),p=null!==(r=a(e))&&void0!==r?r:[];return!(1===p.length&&p[0]&&(0,c.isReusableBlock)(p[0])&&!!n(v.store).getEntityRecord("postType","wp_block",p[0].attributes.ref))&&s("core/block",u)&&p.every((e=>!!e&&e.isValid&&(0,c.hasBlockSupport)(e.name,"reusable",!0)))&&!!o("create","blocks")}),[e,t]),{__experimentalConvertBlocksToReusable:E}=(0,o.useDispatch)(_),{createSuccessNotice:f,createErrorNotice:R}=(0,o.useDispatch)(B.store),I=(0,k.useCallback)((asyncfunction(t){try{awaitE(e,t,s),f(s?(0,a.sprintf)((0,a.__)("Unsyncedpatterncr