(()=>{"use strict";vare={d:(t,n)=>{for(varrinn)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r: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,{privateApis:()=>K,store:()=>k});varn={};e.r(n),e.d(n,{convertSyncedPatternToStatic:()=>h,createPattern:()=>m,createPatternFromFile:()=>g,setEditingPattern:()=>y});varr={};e.r(r),e.d(r,{isEditingPattern:()=>f});consta=window.wp.data;consts=(0,a.combineReducers)({isEditingPattern:function(e={},t){return"SET_EDITING_PATTERN"===t?.type?{...e,[t.clientId]:t.isEditing}:e}}),o=window.wp.blocks,i=window.wp.coreData,c=window.wp.blockEditor,l={theme:"pattern",user:"wp_block"},d="all-patterns",u={full:"fully",unsynced:"unsynced"},p={"core/paragraph":["content"],"core/heading":["content"],"core/button":["text","url","linkTarget","rel"],"core/image":["id","url","title","alt"]},_="core/pattern-overrides",m=(e,t,n,r)=>async({registry:a})=>{consts={title:e,content:n,status:"publish",meta:t===u.unsynced?{wp_pattern_sync_status:t}:void0,wp_pattern_category:r};returnawaita.dispatch(i.store).saveEntityRecord("postType","wp_block",s)},g=(e,t)=>async({dispatch:n})=>{constr=awaite.text();leta;try{a=JSON.parse(r)}catch(e){thrownewError("Invalid JSON file")}if("wp_block"!==a.__file||!a.title||!a.content||"string"!=typeofa.title||"string"!=typeofa.content||a.syncStatus&&"string"!=typeofa.syncStatus)thrownewError("Invalid pattern JSON file");returnawaitn.createPattern(a.title,a.syncStatus,a.content,t)},h=e=>({registry:t})=>{constn=t.select(c.store).getBlock(e),r=n.attributes?.content;consta=t.select(c.store).getBlocks(n.clientId);t.dispatch(c.store).replaceBlocks(n.clientId,functione(t){returnt.map((t=>{letn=t.attributes.metadata;if(n&&(n={...n},deleten.id,deleten.bindings,r?.[n.name]))for(const[e,a]ofObject.entries(r[n.name]))(0,o.getBlockType)(t.name)?.attributes[e]&&(t.attributes[e]=a);return(0,o.cloneBlock)(t,{metadata:n&&Object.keys(n).length>0?n:void0},e(t.innerBlocks))}))}(a))};functiony(e,t){return{type:"SET_EDITING_PATTERN",clientId:e,isEditing:t}}functionf(e,t){returne.isEditingPattern[t]}constx=window.wp.privateApis,{lock:b,unlock:v}=(0,x.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/patterns"),w={reducer:s},k=(0,a.createReduxStore)("core/patterns",{...w});(0,a.register)(k),v(k).registerPrivateActions(n),v(k).registerPrivateSelectors(r);constS=window.wp.components,C=window.wp.element,j=window.wp.i18n;functionB(e){returnObject.keys(p).includes(e.name)&&!!e.attributes.metadata?.name&&!!e.attributes.metadata?.bindings&&Object.values(e.attributes.metadata.bindings).some((e=>"core/pattern-overrides"===e.source))}constP=window.ReactJSXRuntime,{BlockQuickNavigation:T}=v(c.privateApis);constE=window.wp.notices,D=window.wp.compose,I=window.wp.htmlEntities,N="wp_pattern_category";functionR({categoryTerms:e,onChange:t,categoryMap:n}){const[r,a]=(0,C.useState)(""),s=(0,D.useDebounce)(a,500),o=(0,C.useMemo)((()=>Array.from(n.values()).map((e=>{returnt=e.label,(0,I.decodeEntities)(t);vart})).filter((e=>""===r||e.toLowerCase().includes(r.toLowerCase()))).sort(((e,t)=>e.localeCompare(t)))),[r,n]);return(0,P.jsx)(S.FormTokenField,{className:"patterns-menu-items__convert-modal-categories",value:e,suggestions:o,onChange:function(e){constn=e.reduce(((e,t)=>(e.some((e=>e.toLowerCase()===t.toLowerCase()))||e.push(t),e)),[]);t(n)},onInputChange:s,label:(0,j.__)("Categories"),tokenizeOnBlur:!0,__experimentalExpandOnFocus:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})}functionM(){const{saveEntityRecord:e,invalidateResolution:t}=(0,a.useDispatch)(i.store),{corePatternCategories:n,userPatternCategories:r}=(0,a.useSelect)((e=>{const{getUserPatternCategories:t,getBlockPatternCategories:n}=e(i.store);return{corePatter