/*! This file is auto-generated */ (()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var i in r)e.o(r,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:r[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{initialize:()=>Nr,initializeEditor:()=>Br,reinitializeEditor:()=>Tr,store:()=>dt});var r={};e.r(r),e.d(r,{closeModal:()=>U,disableComplementaryArea:()=>O,enableComplementaryArea:()=>M,openModal:()=>H,pinItem:()=>V,setDefaultComplementaryArea:()=>P,setFeatureDefaults:()=>z,setFeatureValue:()=>G,toggleFeature:()=>F,unpinItem:()=>D});var i={};e.r(i),e.d(i,{getActiveComplementaryArea:()=>$,isComplementaryAreaLoading:()=>Y,isFeatureActive:()=>K,isItemPinned:()=>Z,isModalActive:()=>q});var s={};e.r(s),e.d(s,{closeGeneralSidebar:()=>Ve,moveBlockToWidgetArea:()=>De,persistStubPost:()=>Ce,saveEditedWidgetAreas:()=>Be,saveWidgetArea:()=>Te,saveWidgetAreas:()=>Ne,setIsInserterOpened:()=>Me,setIsListViewOpened:()=>Oe,setIsWidgetAreaOpen:()=>Pe,setWidgetAreasOpenState:()=>We,setWidgetIdForClientId:()=>Re});var o={};e.r(o),e.d(o,{getWidgetAreas:()=>Fe,getWidgets:()=>Ge});var n={};e.r(n),e.d(n,{__experimentalGetInsertionPoint:()=>et,canInsertBlockInWidgetArea:()=>tt,getEditedWidgetAreas:()=>Ke,getIsWidgetAreaOpen:()=>Qe,getParentWidgetAreaBlock:()=>Ze,getReferenceWidgetBlocks:()=>qe,getWidget:()=>Ue,getWidgetAreaForWidgetId:()=>Ye,getWidgetAreas:()=>$e,getWidgets:()=>He,isInserterOpened:()=>Xe,isListViewOpened:()=>rt,isSavingWidgetAreas:()=>Je});var a={};e.r(a),e.d(a,{getInserterSidebarToggleRef:()=>st,getListViewToggleRef:()=>it});var c={};e.r(c),e.d(c,{metadata:()=>_t,name:()=>wt,settings:()=>bt});const d=window.wp.blocks,l=window.wp.data,u=window.wp.deprecated;var g=e.n(u);const p=window.wp.element,h=window.wp.blockLibrary,m=window.wp.coreData,_=window.wp.widgets,w=window.wp.preferences,b=window.wp.apiFetch;var f=e.n(b);const x=(0,l.combineReducers)({blockInserterPanel:function(e=!1,t){switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},inserterSidebarToggleRef:function(e={current:null}){return e},listViewPanel:function(e=!1,t){switch(t.type){case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e},listViewToggleRef:function(e={current:null}){return e},widgetAreasOpenState:function(e={},t){const{type:r}=t;switch(r){case"SET_WIDGET_AREAS_OPEN_STATE":return t.widgetAreasOpenState;case"SET_IS_WIDGET_AREA_OPEN":{const{clientId:r,isOpen:i}=t;return{...e,[r]:i}}default:return e}}}),y=window.wp.i18n,v=window.wp.notices;function k(e){var t,r,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var s=e.length;for(t=0;t({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e=R(e),area:t=W(e,t)}),M=(e,t)=>({registry:r,dispatch:i})=>{if(!t)return;e=R(e),t=W(e,t);r.select(w.store).get(e,"isComplementaryAreaVisible")||r.dispatch(w.store).set(e,"isComplementaryAreaVisible",!0),i({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},O=e=>({registry:t})=>{e=R(e);t.select(w.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(w.store).set(e,"isComplementaryAreaVisible",!1)},V=(e,t)=>({registry:r})=>{if(!t)return;e=R(e),t=W(e,t);const i=r.select(w.store).get(e,"pinnedItems");!0!==i?.[t]&&r.dispatch(w.store).set(e,"pinnedItems",{...i,[t]:!0})},D=(e,t)=>({registry:r})=>{if(!t)return;e=R(e),t=W(e,t);const i=r.select(w.store).get(e,"pinnedItems");r.dispatch(w.store).set(e,"pinnedItems",{...i,[t]:!1})};function F(e,t){return function({registry:r}){g()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),r.dispatch(w.store).toggle(e,t)}}function G(e,t,r){return function({registry:i}){g()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),i.dispatch(w.store).set(e,t,!!r)}}function z(e,t){return function({registry:r}){g()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),r.dispatch(w.store).setDefaults(e,t)}}function H(e){return{type:"OPEN_MODAL",name:e}}function U(){return{type:"CLOSE_MODAL"}}const $=(0,l.createRegistrySelector)((e=>(t,r)=>{r=R(r);const i=e(w.store).get(r,"isComplementaryAreaVisible");if(void 0!==i)return!1===i?null:t?.complementaryAreas?.[r]})),Y=(0,l.createRegistrySelector)((e=>(t,r)=>{r=R(r);const i=e(w.store).get(r,"isComplementaryAreaVisible"),s=t?.complementaryAreas?.[r];return i&&void 0===s})),Z=(0,l.createRegistrySelector)((e=>(t,r,i)=>{var s;i=W(r=R(r),i);const o=e(w.store).get(r,"pinnedItems");return null===(s=o?.[i])||void 0===s||s})),K=(0,l.createRegistrySelector)((e=>(t,r,i)=>(g()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(w.store).get(r,i))));function q(e,t){return e.activeModal===t}const J=(0,l.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:r,area:i}=t;return e[r]?e:{...e,[r]:i}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:r,area:i}=t;return{...e,[r]:i}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}}),Q=(0,l.createReduxStore)("core/interface",{reducer:J,actions:r,selectors:i});(0,l.register)(Q);const X=window.wp.plugins,ee=(0,X.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));const te=ee((function({as:e=S.Button,scope:t,identifier:r,icon:i,selectedIcon:s,name:o,shortcut:n,...a}){const c=e,d=(0,l.useSelect)((e=>e(Q).getActiveComplementaryArea(t)===r),[r,t]),{enableComplementaryArea:u,disableComplementaryArea:g}=(0,l.useDispatch)(Q);return(0,E.jsx)(c,{icon:s&&d?s:i,"aria-controls":r.replace("/",":"),onClick:()=>{d?g(t):u(t,r)},shortcut:n,...a})})),re=({smallScreenTitle:e,children:t,className:r,toggleButtonProps:i})=>{const s=(0,E.jsx)(te,{icon:L,...i});return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:"components-panel__header interface-complementary-area-header__small",children:[e&&(0,E.jsx)("h2",{className:"interface-complementary-area-header__small-title",children:e}),s]}),(0,E.jsxs)("div",{className:j("components-panel__header","interface-complementary-area-header",r),tabIndex:-1,children:[t,s]})]})},ie=()=>{};function se({name:e,as:t=S.Button,onClick:r,...i}){return(0,E.jsx)(S.Fill,{name:e,children:({onClick:e})=>(0,E.jsx)(t,{onClick:r||e?(...t)=>{(r||ie)(...t),(e||ie)(...t)}:void 0,...i})})}se.Slot=function({name:e,as:t=S.ButtonGroup,fillProps:r={},bubblesVirtually:i,...s}){return(0,E.jsx)(S.Slot,{name:e,bubblesVirtually:i,fillProps:r,children:e=>{if(!p.Children.toArray(e).length)return null;const r=[];p.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&r.push(t)}));const i=p.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&r.includes(e.props.__unstableTarget)?null:e));return(0,E.jsx)(t,{...s,children:i})}})};const oe=se,ne=({__unstableExplicitMenuItem:e,__unstableTarget:t,...r})=>(0,E.jsx)(S.MenuItem,{...r});function ae({scope:e,target:t,__unstableExplicitMenuItem:r,...i}){return(0,E.jsx)(te,{as:i=>(0,E.jsx)(oe,{__unstableExplicitMenuItem:r,__unstableTarget:`${e}/${t}`,as:ne,name:`${e}/plugin-more-menu`,...i}),role:"menuitemcheckbox",selectedIcon:I,name:t,scope:e,...i})}function ce({scope:e,...t}){return(0,E.jsx)(S.Fill,{name:`PinnedItems/${e}`,...t})}ce.Slot=function({scope:e,className:t,...r}){return(0,E.jsx)(S.Slot,{name:`PinnedItems/${e}`,...r,children:e=>e?.length>0&&(0,E.jsx)("div",{className:j(t,"interface-pinned-items"),children:e})})};const de=ce,le=.3;const ue=280,ge={open:{width:ue},closed:{width:0},mobileOpen:{width:"100vw"}};function pe({activeArea:e,isActive:t,scope:r,children:i,className:s,id:o}){const n=(0,T.useReducedMotion)(),a=(0,T.useViewportMatch)("medium","<"),c=(0,T.usePrevious)(e),d=(0,T.usePrevious)(t),[,l]=(0,p.useState)({});(0,p.useEffect)((()=>{l({})}),[t]);const u={type:"tween",duration:n||a||c&&e&&e!==c?0:le,ease:[.6,0,.4,1]};return(0,E.jsx)(S.Fill,{name:`ComplementaryArea/${r}`,children:(0,E.jsx)(S.__unstableAnimatePresence,{initial:!1,children:(d||t)&&(0,E.jsx)(S.__unstableMotion.div,{variants:ge,initial:"closed",animate:a?"mobileOpen":"open",exit:"closed",transition:u,className:"interface-complementary-area__fill",children:(0,E.jsx)("div",{id:o,className:s,style:{width:a?"100vw":ue},children:i})})})})}const he=ee((function({children:e,className:t,closeLabel:r=(0,y.__)("Close plugin"),identifier:i,header:s,headerClassName:o,icon:n,isPinnable:a=!0,panelClassName:c,scope:d,name:u,smallScreenTitle:g,title:h,toggleShortcut:m,isActiveByDefault:_}){const[b,f]=(0,p.useState)(!1),{isLoading:x,isActive:v,isPinned:k,activeArea:A,isSmall:T,isLarge:L,showIconLabels:R}=(0,l.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:r,isItemPinned:s}=e(Q),{get:o}=e(w.store),n=t(d);return{isLoading:r(d),isActive:n===i,isPinned:s(d,i),activeArea:n,isSmall:e(N.store).isViewportMatch("< medium"),isLarge:e(N.store).isViewportMatch("large"),showIconLabels:o("core","showIconLabels")}}),[i,d]);!function(e,t,r,i,s){const o=(0,p.useRef)(!1),n=(0,p.useRef)(!1),{enableComplementaryArea:a,disableComplementaryArea:c}=(0,l.useDispatch)(Q);(0,p.useEffect)((()=>{i&&s&&!o.current?(c(e),n.current=!0):n.current&&!s&&o.current?(n.current=!1,a(e,t)):n.current&&r&&r!==t&&(n.current=!1),s!==o.current&&(o.current=s)}),[i,s,e,t,r,c,a])}(d,i,A,v,T);const{enableComplementaryArea:W,disableComplementaryArea:P,pinItem:M,unpinItem:O}=(0,l.useDispatch)(Q);if((0,p.useEffect)((()=>{_&&void 0===A&&!T?W(d,i):void 0===A&&T&&P(d,i),f(!0)}),[A,_,d,i,T,W,P]),b)return(0,E.jsxs)(E.Fragment,{children:[a&&(0,E.jsx)(de,{scope:d,children:k&&(0,E.jsx)(te,{scope:d,identifier:i,isPressed:v&&(!R||L),"aria-expanded":v,"aria-disabled":x,label:h,icon:R?I:n,showTooltip:!R,variant:R?"tertiary":void 0,size:"compact",shortcut:m})}),u&&a&&(0,E.jsx)(ae,{target:u,scope:d,icon:n,children:h}),(0,E.jsxs)(pe,{activeArea:A,isActive:v,className:j("interface-complementary-area",t),scope:d,id:i.replace("/",":"),children:[(0,E.jsx)(re,{className:o,closeLabel:r,onClose:()=>P(d),smallScreenTitle:g,toggleButtonProps:{label:r,size:"small",shortcut:m,scope:d,identifier:i},children:s||(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("h2",{className:"interface-complementary-area-header__title",children:h}),a&&(0,E.jsx)(S.Button,{className:"interface-complementary-area__pin-unpin-item",icon:k?C:B,label:k?(0,y.__)("Unpin from toolbar"):(0,y.__)("Pin to toolbar"),onClick:()=>(k?O:M)(d,i),isPressed:k,"aria-expanded":k,size:"compact"})]})}),(0,E.jsx)(S.Panel,{className:c,children:e})]})]})}));he.Slot=function({scope:e,...t}){return(0,E.jsx)(S.Slot,{name:`ComplementaryArea/${e}`,...t})};const me=he;function _e({children:e,className:t,ariaLabel:r,as:i="div",...s}){return(0,E.jsx)(i,{className:j("interface-navigable-region",t),"aria-label":r,role:"region",tabIndex:"-1",...s,children:e})}const we={type:"tween",duration:.25,ease:[.6,0,.4,1]};const be={hidden:{opacity:1,marginTop:-60},visible:{opacity:1,marginTop:0},distractionFreeHover:{opacity:1,marginTop:0,transition:{...we,delay:.2,delayChildren:.2}},distractionFreeHidden:{opacity:0,marginTop:-60},distractionFreeDisabled:{opacity:0,marginTop:0,transition:{...we,delay:.8,delayChildren:.8}}};const fe=(0,p.forwardRef)((function({isDistractionFree:e,footer:t,header:r,editorNotices:i,sidebar:s,secondarySidebar:o,content:n,actions:a,labels:c,className:d,enableRegionNavigation:l=!0,shortcuts:u},g){const[h,m]=(0,T.useResizeObserver)(),_=(0,T.useViewportMatch)("medium","<"),w={type:"tween",duration:(0,T.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]},b=(0,S.__unstableUseNavigateRegions)(u);!function(e){(0,p.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const f={...{header:(0,y._x)("Header","header landmark area"),body:(0,y.__)("Content"),secondarySidebar:(0,y.__)("Block Library"),sidebar:(0,y.__)("Settings"),actions:(0,y.__)("Publish"),footer:(0,y.__)("Footer")},...c};return(0,E.jsxs)("div",{...l?b:{},ref:(0,T.useMergeRefs)([g,l?b.ref:void 0]),className:j(d,"interface-interface-skeleton",b.className,!!t&&"has-footer"),children:[(0,E.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,E.jsx)(S.__unstableAnimatePresence,{initial:!1,children:!!r&&(0,E.jsx)(_e,{as:S.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":f.header,initial:e&&!_?"distractionFreeHidden":"hidden",whileHover:e&&!_?"distractionFreeHover":"visible",animate:e&&!_?"distractionFreeDisabled":"visible",exit:e&&!_?"distractionFreeHidden":"hidden",variants:be,transition:w,children:r})}),e&&(0,E.jsx)("div",{className:"interface-interface-skeleton__header",children:i}),(0,E.jsxs)("div",{className:"interface-interface-skeleton__body",children:[(0,E.jsx)(S.__unstableAnimatePresence,{initial:!1,children:!!o&&(0,E.jsx)(_e,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:f.secondarySidebar,as:S.__unstableMotion.div,initial:"closed",animate:"open",exit:"closed",variants:{open:{width:m.width},closed:{width:0}},transition:w,children:(0,E.jsxs)(S.__unstableMotion.div,{style:{position:"absolute",width:_?"100vw":"fit-content",height:"100%",left:0},variants:{open:{x:0},closed:{x:"-100%"}},transition:w,children:[h,o]})})}),(0,E.jsx)(_e,{className:"interface-interface-skeleton__content",ariaLabel:f.body,children:n}),!!s&&(0,E.jsx)(_e,{className:"interface-interface-skeleton__sidebar",ariaLabel:f.sidebar,children:s}),!!a&&(0,E.jsx)(_e,{className:"interface-interface-skeleton__actions",ariaLabel:f.actions,children:a})]})]}),!!t&&(0,E.jsx)(_e,{className:"interface-interface-skeleton__footer",ariaLabel:f.footer,children:t})]})})),xe=window.wp.blockEditor;function ye(e){if("block"===e.id_base){const t=(0,d.parse)(e.instance.raw.content,{__unstableSkipAutop:!0});return t.length?(0,_.addWidgetIdToBlock)(t[0],e.id):(0,_.addWidgetIdToBlock)((0,d.createBlock)("core/paragraph",{},[]),e.id)}let t;return t=e._embedded.about[0].is_multi?{idBase:e.id_base,instance:e.instance}:{id:e.id},(0,_.addWidgetIdToBlock)((0,d.createBlock)("core/legacy-widget",t,[]),e.id)}function ve(e,t={}){let r;var i,s,o;"core/legacy-widget"===e.name&&(e.attributes.id||e.attributes.instance)?r={...t,id:null!==(i=e.attributes.id)&&void 0!==i?i:t.id,id_base:null!==(s=e.attributes.idBase)&&void 0!==s?s:t.id_base,instance:null!==(o=e.attributes.instance)&&void 0!==o?o:t.instance}:r={...t,id_base:"block",instance:{raw:{content:(0,d.serialize)(e)}}};return delete r.rendered,delete r.rendered_form,r}const ke="root",je="sidebar",Se="postType",Ae=e=>`widget-area-${e}`,Ee=()=>"widget-areas";const Ie="core/edit-widgets",Ce=(e,t)=>({registry:r})=>{const i=((e,t)=>({id:e,slug:e,status:"draft",type:"page",blocks:t,meta:{widgetAreaId:e}}))(e,t);return r.dispatch(m.store).receiveEntityRecords(ke,Se,i,{id:i.id},!1),i},Be=()=>async({select:e,dispatch:t,registry:r})=>{const i=e.getEditedWidgetAreas();if(i?.length)try{await t.saveWidgetAreas(i),r.dispatch(v.store).createSuccessNotice((0,y.__)("Widgets saved."),{type:"snackbar"})}catch(e){r.dispatch(v.store).createErrorNotice((0,y.sprintf)((0,y.__)("There was an error. %s"),e.message),{type:"snackbar"})}},Ne=e=>async({dispatch:t,registry:r})=>{try{for(const r of e)await t.saveWidgetArea(r.id)}finally{await r.dispatch(m.store).finishResolution("getEntityRecord",ke,je,{per_page:-1})}},Te=e=>async({dispatch:t,select:r,registry:i})=>{const s=r.getWidgets(),o=i.select(m.store).getEditedEntityRecord(ke,Se,Ae(e)),n=Object.values(s).filter((({sidebar:t})=>t===e)),a=[],c=o.blocks.filter((e=>{const{id:t}=e.attributes;if("core/legacy-widget"===e.name&&t){if(a.includes(t))return!1;a.push(t)}return!0})),d=[];for(const e of n){r.getWidgetAreaForWidgetId(e.id)||d.push(e)}const l=[],u=[],g=[];for(let t=0;te("root","widget",o)))}else u.push((({saveEntityRecord:t})=>t("root","widget",{...a,sidebar:e})));l.push({block:r,position:t,clientId:r.clientId})}for(const e of d)u.push((({deleteEntityRecord:t})=>t("root","widget",e.id,{force:!0})));const p=(await i.dispatch(m.store).__experimentalBatch(u)).filter((e=>!e.hasOwnProperty("deleted"))),h=[];for(let e=0;e({registry:t})=>{t.dispatch(m.store).saveEditedEntityRecord(ke,je,e,{throwOnError:!0})};function Re(e,t){return{type:"SET_WIDGET_ID_FOR_CLIENT_ID",clientId:e,widgetId:t}}function We(e){return{type:"SET_WIDGET_AREAS_OPEN_STATE",widgetAreasOpenState:e}}function Pe(e,t){return{type:"SET_IS_WIDGET_AREA_OPEN",clientId:e,isOpen:t}}function Me(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function Oe(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const Ve=()=>({registry:e})=>{e.dispatch(Q).disableComplementaryArea(Ie)},De=(e,t)=>async({dispatch:r,select:i,registry:s})=>{const o=s.select(xe.store).getBlockRootClientId(e),n=s.select(xe.store).getBlocks().find((({attributes:e})=>e.id===t)).clientId,a=s.select(xe.store).getBlockOrder(n).length;i.getIsWidgetAreaOpen(n)||r.setIsWidgetAreaOpen(n,!0),s.dispatch(xe.store).moveBlocksToPosition([e],o,n,a)},Fe=()=>async({dispatch:e,registry:t})=>{const r={per_page:-1},i=[],s=(await t.resolveSelect(m.store).getEntityRecords(ke,je,r)).sort(((e,t)=>"wp_inactive_widgets"===e.id?1:"wp_inactive_widgets"===t.id?-1:0));for(const t of s)i.push((0,d.createBlock)("core/widget-area",{id:t.id,name:t.name})),t.widgets.length||e(Ce(Ae(t.id),[]));const o={};i.forEach(((e,t)=>{o[e.clientId]=0===t})),e(We(o)),e(Ce(Ee(),i))},Ge=()=>async({dispatch:e,registry:t})=>{const r={per_page:-1,_embed:"about"},i=await t.resolveSelect(m.store).getEntityRecords("root","widget",r),s={};for(const e of i){const t=ye(e);s[e.sidebar]=s[e.sidebar]||[],s[e.sidebar].push(t)}for(const t in s)s.hasOwnProperty(t)&&e(Ce(Ae(t),s[t]))},ze={rootClientId:void 0,insertionIndex:void 0},He=(0,l.createRegistrySelector)((e=>(0,l.createSelector)((()=>{var t;const r=e(m.store).getEntityRecords("root","widget",{per_page:-1,_embed:"about"});return null!==(t=r?.reduce(((e,t)=>({...e,[t.id]:t})),{}))&&void 0!==t?t:{}}),(()=>[e(m.store).getEntityRecords("root","widget",{per_page:-1,_embed:"about"})])))),Ue=(0,l.createRegistrySelector)((e=>(t,r)=>e(Ie).getWidgets()[r])),$e=(0,l.createRegistrySelector)((e=>()=>{const t={per_page:-1};return e(m.store).getEntityRecords(ke,je,t)})),Ye=(0,l.createRegistrySelector)((e=>(t,r)=>e(Ie).getWidgetAreas().find((t=>e(m.store).getEditedEntityRecord(ke,Se,Ae(t.id)).blocks.map((e=>(0,_.getWidgetIdFromBlock)(e))).includes(r))))),Ze=(0,l.createRegistrySelector)((e=>(t,r)=>{const{getBlock:i,getBlockName:s,getBlockParents:o}=e(xe.store);return i(o(r).find((e=>"core/widget-area"===s(e))))})),Ke=(0,l.createRegistrySelector)((e=>(t,r)=>{let i=e(Ie).getWidgetAreas();return i?(r&&(i=i.filter((({id:e})=>r.includes(e)))),i.filter((({id:t})=>e(m.store).hasEditsForEntityRecord(ke,Se,Ae(t)))).map((({id:t})=>e(m.store).getEditedEntityRecord(ke,je,t)))):[]})),qe=(0,l.createRegistrySelector)((e=>(t,r=null)=>{const i=[],s=e(Ie).getWidgetAreas();for(const t of s){const s=e(m.store).getEditedEntityRecord(ke,Se,Ae(t.id));for(const e of s.blocks)"core/legacy-widget"!==e.name||r&&e.attributes?.referenceWidgetName!==r||i.push(e)}return i})),Je=(0,l.createRegistrySelector)((e=>()=>{const t=e(Ie).getWidgetAreas()?.map((({id:e})=>e));if(!t)return!1;for(const r of t){if(e(m.store).isSavingEntityRecord(ke,je,r))return!0}const r=[...Object.keys(e(Ie).getWidgets()),void 0];for(const t of r){if(e(m.store).isSavingEntityRecord("root","widget",t))return!0}return!1})),Qe=(e,t)=>{const{widgetAreasOpenState:r}=e;return!!r[t]};function Xe(e){return!!e.blockInserterPanel}function et(e){return"boolean"==typeof e.blockInserterPanel?ze:e.blockInserterPanel}const tt=(0,l.createRegistrySelector)((e=>(t,r)=>{const i=e(xe.store).getBlocks(),[s]=i;return e(xe.store).canInsertBlockType(r,s.clientId)}));function rt(e){return e.listViewPanel}function it(e){return e.listViewToggleRef}function st(e){return e.inserterSidebarToggleRef}const ot=window.wp.privateApis,{lock:nt,unlock:at}=(0,ot.__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/edit-widgets"),ct={reducer:x,selectors:n,resolvers:o,actions:s},dt=(0,l.createReduxStore)(Ie,ct);(0,l.register)(dt),f().use((function(e,t){return 0===e.path?.indexOf("/wp/v2/types/widget-area")?Promise.resolve({}):t(e)})),at(dt).registerPrivateSelectors(a);const lt=window.wp.hooks,ut=(0,T.createHigherOrderComponent)((e=>t=>{const{clientId:r,name:i}=t,{widgetAreas:s,currentWidgetAreaId:o,canInsertBlockInWidgetArea:n}=(0,l.useSelect)((e=>{if("core/widget-area"===i)return{};const t=e(dt),s=t.getParentWidgetAreaBlock(r);return{widgetAreas:t.getWidgetAreas(),currentWidgetAreaId:s?.attributes?.id,canInsertBlockInWidgetArea:t.canInsertBlockInWidgetArea(i)}}),[r,i]),{moveBlockToWidgetArea:a}=(0,l.useDispatch)(dt),c="core/widget-area"!==i&&s?.length>1&&n;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(e,{...t},"edit"),c&&(0,E.jsx)(xe.BlockControls,{children:(0,E.jsx)(_.MoveToWidgetArea,{widgetAreas:s,currentWidgetAreaId:o,onSelect:e=>{a(t.clientId,e)}})})]})}),"withMoveToWidgetAreaToolbarItem");(0,lt.addFilter)("editor.BlockEdit","core/edit-widgets/block-edit",ut);const gt=window.wp.mediaUtils;(0,lt.addFilter)("editor.MediaUpload","core/edit-widgets/replace-media-upload",(()=>gt.MediaUpload));const pt=e=>{const[t,r]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{const{ownerDocument:t}=e.current;function i(e){o(e)}function s(){r(!1)}function o(t){e.current.contains(t.target)?r(!0):r(!1)}return t.addEventListener("dragstart",i),t.addEventListener("dragend",s),t.addEventListener("dragenter",o),()=>{t.removeEventListener("dragstart",i),t.removeEventListener("dragend",s),t.removeEventListener("dragenter",o)}}),[]),t};function ht({id:e}){const[t,r,i]=(0,m.useEntityBlockEditor)("root","postType"),s=(0,p.useRef)(),o=pt(s),n=(0,xe.useInnerBlocksProps)({ref:s},{value:t,onInput:r,onChange:i,templateLock:!1,renderAppender:xe.InnerBlocks.ButtonBlockAppender});return(0,E.jsx)("div",{"data-widget-area-id":e,className:j("wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper",{"wp-block-widget-area__highlight-drop-zone":o}),children:(0,E.jsx)("div",{...n})})}const mt=e=>{const[t,r]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{const{ownerDocument:t}=e.current;function i(){r(!0)}function s(){r(!1)}return t.addEventListener("dragstart",i),t.addEventListener("dragend",s),()=>{t.removeEventListener("dragstart",i),t.removeEventListener("dragend",s)}}),[]),t},_t={$schema:"https://schemas.wp.org/trunk/block.json",name:"core/widget-area",title:"Widget Area",category:"widgets",attributes:{id:{type:"string"},name:{type:"string"}},supports:{html:!1,inserter:!1,customClassName:!1,reusable:!1,__experimentalToolbar:!1,__experimentalParentSelector:!1,__experimentalDisableBlockOverlay:!0},editorStyle:"wp-block-widget-area-editor",style:"wp-block-widget-area"},{name:wt}=_t,bt={title:(0,y.__)("Widget Area"),description:(0,y.__)("A widget area container."),__experimentalLabel:({name:e})=>e,edit:function({clientId:e,className:t,attributes:{id:r,name:i}}){const s=(0,l.useSelect)((t=>t(dt).getIsWidgetAreaOpen(e)),[e]),{setIsWidgetAreaOpen:o}=(0,l.useDispatch)(dt),n=(0,p.useRef)(),a=(0,p.useCallback)((t=>o(e,t)),[e]),c=mt(n),d=pt(n),[u,g]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{c?d&&!s?(a(!0),g(!0)):!d&&s&&u&&a(!1):g(!1)}),[s,c,d,u]),(0,E.jsx)(S.Panel,{className:t,ref:n,children:(0,E.jsx)(S.PanelBody,{title:i,opened:s,onToggle:()=>{o(e,!s)},scrollAfterOpen:!c,children:({opened:e})=>(0,E.jsx)(S.__unstableDisclosureContent,{className:"wp-block-widget-area__panel-body-content",visible:e,children:(0,E.jsx)(m.EntityProvider,{kind:"root",type:"postType",id:`widget-area-${r}`,children:(0,E.jsx)(ht,{id:r})})})})})}};function ft({text:e,children:t}){const r=(0,T.useCopyToClipboard)(e);return(0,E.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"secondary",ref:r,children:t})}function xt({message:e,error:t}){const r=[(0,E.jsx)(ft,{text:t.stack,children:(0,y.__)("Copy Error")},"copy-error")];return(0,E.jsx)(xe.Warning,{className:"edit-widgets-error-boundary",actions:r,children:e})}class yt extends p.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,lt.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){return this.state.error?(0,E.jsx)(xt,{message:(0,y.__)("The editor has encountered an unexpected error."),error:this.state.error}):this.props.children}}const vt=window.wp.patterns,kt=window.wp.keyboardShortcuts,jt=window.wp.keycodes;function St(){const{redo:e,undo:t}=(0,l.useDispatch)(m.store),{saveEditedWidgetAreas:r}=(0,l.useDispatch)(dt);return(0,kt.useShortcut)("core/edit-widgets/undo",(e=>{t(),e.preventDefault()})),(0,kt.useShortcut)("core/edit-widgets/redo",(t=>{e(),t.preventDefault()})),(0,kt.useShortcut)("core/edit-widgets/save",(e=>{e.preventDefault(),r()})),null}St.Register=function(){const{registerShortcut:e}=(0,l.useDispatch)(kt.store);return(0,p.useEffect)((()=>{e({name:"core/edit-widgets/undo",category:"global",description:(0,y.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/edit-widgets/redo",category:"global",description:(0,y.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,jt.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/edit-widgets/save",category:"global",description:(0,y.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/edit-widgets/keyboard-shortcuts",category:"main",description:(0,y.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/edit-widgets/next-region",category:"global",description:(0,y.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-widgets/previous-region",category:"global",description:(0,y.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})}),[e]),null};const At=St,Et=()=>(0,l.useSelect)((e=>{const{getBlockSelectionEnd:t,getBlockName:r}=e(xe.store),i=t();if("core/widget-area"===r(i))return i;const{getParentWidgetAreaBlock:s}=e(dt),o=s(i),n=o?.clientId;if(n)return n;const{getEntityRecord:a}=e(m.store),c=a(ke,Se,Ee());return c?.blocks[0]?.clientId}),[]),It=!1,{ExperimentalBlockEditorProvider:Ct}=at(xe.privateApis),{PatternsMenuItems:Bt}=at(vt.privateApis),{BlockKeyboardShortcuts:Nt}=at(h.privateApis),Tt=[];function Lt({blockEditorSettings:e,children:t,...r}){const i=(0,T.useViewportMatch)("medium"),{hasUploadPermissions:s,reusableBlocks:o,isFixedToolbarActive:n,keepCaretInsideBlock:a,pageOnFront:c,pageForPosts:d}=(0,l.useSelect)((e=>{var t;const{canUser:r,getEntityRecord:i,getEntityRecords:s}=e(m.store),o=r("read",{kind:"root",name:"site"})?i("root","site"):void 0;return{hasUploadPermissions:null===(t=r("create",{kind:"root",name:"media"}))||void 0===t||t,reusableBlocks:It?s("postType","wp_block"):Tt,isFixedToolbarActive:!!e(w.store).get("core/edit-widgets","fixedToolbar"),keepCaretInsideBlock:!!e(w.store).get("core/edit-widgets","keepCaretInsideBlock"),pageOnFront:o?.page_on_front,pageForPosts:o?.page_for_posts}}),[]),{setIsInserterOpened:u}=(0,l.useDispatch)(dt),g=(0,p.useMemo)((()=>{let t;return s&&(t=({onError:t,...r})=>{(0,gt.uploadMedia)({wpAllowedMimeTypes:e.allowedMimeTypes,onError:({message:e})=>t(e),...r})}),{...e,__experimentalReusableBlocks:o,hasFixedToolbar:n||!i,keepCaretInsideBlock:a,mediaUpload:t,templateLock:"all",__experimentalSetIsInserterOpened:u,pageOnFront:c,pageForPosts:d}}),[s,e,n,i,a,o,u,c,d]),h=Et(),[_,b,f]=(0,m.useEntityBlockEditor)(ke,Se,{id:Ee()});return(0,E.jsxs)(S.SlotFillProvider,{children:[(0,E.jsx)(At.Register,{}),(0,E.jsx)(Nt,{}),(0,E.jsxs)(Ct,{value:_,onInput:b,onChange:f,settings:g,useSubRegistry:!1,...r,children:[t,(0,E.jsx)(Bt,{rootClientId:h})]})]})}const Rt=(0,E.jsx)(A.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,E.jsx)(A.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"})}),Wt=(0,E.jsx)(A.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,E.jsx)(A.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"})}),Pt=(0,E.jsx)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,E.jsx)(A.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})}),Mt=window.wp.url,Ot=window.wp.dom;function Vt({selectedWidgetAreaId:e}){const t=(0,l.useSelect)((e=>e(dt).getWidgetAreas()),[]),r=(0,p.useMemo)((()=>e&&t?.find((t=>t.id===e))),[e,t]);let i;return i=r?"wp_inactive_widgets"===e?(0,y.__)("Blocks in this Widget Area will not be displayed in your site."):r.description:(0,y.__)("Widget Areas are global parts in your site’s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer."),(0,E.jsx)("div",{className:"edit-widgets-widget-areas",children:(0,E.jsxs)("div",{className:"edit-widgets-widget-areas__top-container",children:[(0,E.jsx)(xe.BlockIcon,{icon:Pt}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{dangerouslySetInnerHTML:{__html:(0,Ot.safeHTML)(i)}}),0===t?.length&&(0,E.jsx)("p",{children:(0,y.__)("Your theme does not contain any Widget Areas.")}),!r&&(0,E.jsx)(S.Button,{__next40pxDefaultSize:!0,href:(0,Mt.addQueryArgs)("customize.php",{"autofocus[panel]":"widgets",return:window.location.pathname}),variant:"tertiary",children:(0,y.__)("Manage with live preview")})]})]})})}const Dt=p.Platform.select({web:!0,native:!1}),Ft="edit-widgets/block-inspector",Gt="edit-widgets/block-areas",{Tabs:zt}=at(S.privateApis);function Ht({selectedWidgetAreaBlock:e}){return(0,E.jsxs)(zt.TabList,{children:[(0,E.jsx)(zt.Tab,{tabId:Gt,children:e?e.attributes.name:(0,y.__)("Widget Areas")}),(0,E.jsx)(zt.Tab,{tabId:Ft,children:(0,y.__)("Block")})]})}function Ut({hasSelectedNonAreaBlock:e,currentArea:t,isGeneralSidebarOpen:r,selectedWidgetAreaBlock:i}){const{enableComplementaryArea:s}=(0,l.useDispatch)(Q);(0,p.useEffect)((()=>{e&&t===Gt&&r&&s("core/edit-widgets",Ft),!e&&t===Ft&&r&&s("core/edit-widgets",Gt)}),[e,s]);const o=(0,p.useContext)(zt.Context);return(0,E.jsx)(me,{className:"edit-widgets-sidebar",header:(0,E.jsx)(zt.Context.Provider,{value:o,children:(0,E.jsx)(Ht,{selectedWidgetAreaBlock:i})}),headerClassName:"edit-widgets-sidebar__panel-tabs",title:(0,y.__)("Settings"),closeLabel:(0,y.__)("Close Settings"),scope:"core/edit-widgets",identifier:t,icon:(0,y.isRTL)()?Rt:Wt,isActiveByDefault:Dt,children:(0,E.jsxs)(zt.Context.Provider,{value:o,children:[(0,E.jsx)(zt.TabPanel,{tabId:Gt,focusable:!1,children:(0,E.jsx)(Vt,{selectedWidgetAreaId:i?.attributes.id})}),(0,E.jsx)(zt.TabPanel,{tabId:Ft,focusable:!1,children:e?(0,E.jsx)(xe.BlockInspector,{}):(0,E.jsx)("span",{className:"block-editor-block-inspector__no-blocks",children:(0,y.__)("No block selected.")})})]})})}function $t(){const{currentArea:e,hasSelectedNonAreaBlock:t,isGeneralSidebarOpen:r,selectedWidgetAreaBlock:i}=(0,l.useSelect)((e=>{const{getSelectedBlock:t,getBlock:r,getBlockParentsByBlockName:i}=e(xe.store),{getActiveComplementaryArea:s}=e(Q),o=t(),n=s(dt.name);let a,c=n;return c||(c=o?Ft:Gt),o&&(a="core/widget-area"===o.name?o:r(i(o.clientId,"core/widget-area")[0])),{currentArea:c,hasSelectedNonAreaBlock:!(!o||"core/widget-area"===o.name),isGeneralSidebarOpen:!!n,selectedWidgetAreaBlock:a}}),[]),{enableComplementaryArea:s}=(0,l.useDispatch)(Q),o=(0,p.useCallback)((e=>{e&&s(dt.name,e)}),[s]);return(0,E.jsx)(zt,{selectedTabId:r?e:null,onSelect:o,selectOnMove:!1,children:(0,E.jsx)(Ut,{hasSelectedNonAreaBlock:t,currentArea:e,isGeneralSidebarOpen:r,selectedWidgetAreaBlock:i})})}const Yt=(0,E.jsx)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,E.jsx)(A.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),Zt=(0,E.jsx)(A.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,E.jsx)(A.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})}),Kt=(0,E.jsx)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,E.jsx)(A.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})}),qt=(0,E.jsx)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,E.jsx)(A.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"})});const Jt=(0,p.forwardRef)((function(e,t){const r=(0,l.useSelect)((e=>e(m.store).hasUndo()),[]),{undo:i}=(0,l.useDispatch)(m.store);return(0,E.jsx)(S.Button,{...e,ref:t,icon:(0,y.isRTL)()?qt:Kt,label:(0,y.__)("Undo"),shortcut:jt.displayShortcut.primary("z"),"aria-disabled":!r,onClick:r?i:void 0,size:"compact"})}));const Qt=(0,p.forwardRef)((function(e,t){const r=(0,jt.isAppleOS)()?jt.displayShortcut.primaryShift("z"):jt.displayShortcut.primary("y"),i=(0,l.useSelect)((e=>e(m.store).hasRedo()),[]),{redo:s}=(0,l.useDispatch)(m.store);return(0,E.jsx)(S.Button,{...e,ref:t,icon:(0,y.isRTL)()?Kt:qt,label:(0,y.__)("Redo"),shortcut:r,"aria-disabled":!i,onClick:i?s:void 0,size:"compact"})}));const Xt=function(){const e=(0,T.useViewportMatch)("medium"),{isInserterOpen:t,isListViewOpen:r,inserterSidebarToggleRef:i,listViewToggleRef:s}=(0,l.useSelect)((e=>{const{isInserterOpened:t,getInserterSidebarToggleRef:r,isListViewOpened:i,getListViewToggleRef:s}=at(e(dt));return{isInserterOpen:t(),isListViewOpen:i(),inserterSidebarToggleRef:r(),listViewToggleRef:s()}}),[]),{setIsInserterOpened:o,setIsListViewOpened:n}=(0,l.useDispatch)(dt),a=(0,p.useCallback)((()=>n(!r)),[n,r]),c=(0,p.useCallback)((()=>o(!t)),[o,t]);return(0,E.jsxs)(xe.NavigableToolbar,{className:"edit-widgets-header-toolbar","aria-label":(0,y.__)("Document tools"),variant:"unstyled",children:[(0,E.jsx)(S.ToolbarItem,{ref:i,as:S.Button,className:"edit-widgets-header-toolbar__inserter-toggle",variant:"primary",isPressed:t,onMouseDown:e=>{e.preventDefault()},onClick:c,icon:Yt,label:(0,y._x)("Toggle block inserter","Generic label for block inserter button"),size:"compact"}),e&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(S.ToolbarItem,{as:Jt}),(0,E.jsx)(S.ToolbarItem,{as:Qt}),(0,E.jsx)(S.ToolbarItem,{as:S.Button,className:"edit-widgets-header-toolbar__list-view-toggle",icon:Zt,isPressed:r,label:(0,y.__)("List View"),onClick:a,ref:s,size:"compact"})]})]})};const er=function(){const{hasEditedWidgetAreaIds:e,isSaving:t}=(0,l.useSelect)((e=>{const{getEditedWidgetAreas:t,isSavingWidgetAreas:r}=e(dt);return{hasEditedWidgetAreaIds:t()?.length>0,isSaving:r()}}),[]),{saveEditedWidgetAreas:r}=(0,l.useDispatch)(dt),i=t||!e;return(0,E.jsx)(S.Button,{variant:"primary",isBusy:t,"aria-disabled":i,onClick:i?void 0:r,size:"compact",children:t?(0,y.__)("Saving…"):(0,y.__)("Update")})},tr=(0,E.jsx)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,E.jsx)(A.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})}),rr=(0,E.jsx)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,E.jsx)(A.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})}),ir=[{keyCombination:{modifier:"primary",character:"b"},description:(0,y.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,y.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,y.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,y.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,y.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,y.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,y.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,y.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,y.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,y.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,y.__)("Add non breaking space.")}];function sr({keyCombination:e,forceAriaLabel:t}){const r=e.modifier?jt.displayShortcutList[e.modifier](e.character):e.character,i=e.modifier?jt.shortcutAriaLabel[e.modifier](e.character):e.character,s=Array.isArray(r)?r:[r];return(0,E.jsx)("kbd",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||i,children:s.map(((e,t)=>"+"===e?(0,E.jsx)(p.Fragment,{children:e},t):(0,E.jsx)("kbd",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-key",children:e},t)))})}const or=function({description:e,keyCombination:t,aliases:r=[],ariaLabel:i}){return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,E.jsxs)("div",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-term",children:[(0,E.jsx)(sr,{keyCombination:t,forceAriaLabel:i}),r.map(((e,t)=>(0,E.jsx)(sr,{keyCombination:e,forceAriaLabel:i},t)))]})]})};const nr=function({name:e}){const{keyCombination:t,description:r,aliases:i}=(0,l.useSelect)((t=>{const{getShortcutKeyCombination:r,getShortcutDescription:i,getShortcutAliases:s}=t(kt.store);return{keyCombination:r(e),aliases:s(e),description:i(e)}}),[e]);return t?(0,E.jsx)(or,{keyCombination:t,description:r,aliases:i}):null},ar=({shortcuts:e})=>(0,E.jsx)("ul",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map(((e,t)=>(0,E.jsx)("li",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut",children:"string"==typeof e?(0,E.jsx)(nr,{name:e}):(0,E.jsx)(or,{...e})},t)))}),cr=({title:e,shortcuts:t,className:r})=>(0,E.jsxs)("section",{className:j("edit-widgets-keyboard-shortcut-help-modal__section",r),children:[!!e&&(0,E.jsx)("h2",{className:"edit-widgets-keyboard-shortcut-help-modal__section-title",children:e}),(0,E.jsx)(ar,{shortcuts:t})]}),dr=({title:e,categoryName:t,additionalShortcuts:r=[]})=>{const i=(0,l.useSelect)((e=>e(kt.store).getCategoryShortcuts(t)),[t]);return(0,E.jsx)(cr,{title:e,shortcuts:i.concat(r)})};function lr({isModalActive:e,toggleModal:t}){return(0,kt.useShortcut)("core/edit-widgets/keyboard-shortcuts",t,{bindGlobal:!0}),e?(0,E.jsxs)(S.Modal,{className:"edit-widgets-keyboard-shortcut-help-modal",title:(0,y.__)("Keyboard shortcuts"),onRequestClose:t,children:[(0,E.jsx)(cr,{className:"edit-widgets-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-widgets/keyboard-shortcuts"]}),(0,E.jsx)(dr,{title:(0,y.__)("Global shortcuts"),categoryName:"global"}),(0,E.jsx)(dr,{title:(0,y.__)("Selection shortcuts"),categoryName:"selection"}),(0,E.jsx)(dr,{title:(0,y.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,y.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,y.__)("Forward-slash")}]}),(0,E.jsx)(cr,{title:(0,y.__)("Text formatting"),shortcuts:ir}),(0,E.jsx)(dr,{title:(0,y.__)("List View shortcuts"),categoryName:"list-view"})]}):null}const{Fill:ur,Slot:gr}=(0,S.createSlotFill)("EditWidgetsToolsMoreMenuGroup");ur.Slot=({fillProps:e})=>(0,E.jsx)(gr,{fillProps:e,children:e=>e.length>0&&e});const pr=ur;function hr(){const[e,t]=(0,p.useState)(!1),r=()=>t(!e);(0,kt.useShortcut)("core/edit-widgets/keyboard-shortcuts",r);const i=(0,T.useViewportMatch)("medium");return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(S.DropdownMenu,{icon:tr,label:(0,y.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{tooltipPosition:"bottom",size:"compact"},children:e=>(0,E.jsxs)(E.Fragment,{children:[i&&(0,E.jsx)(S.MenuGroup,{label:(0,y._x)("View","noun"),children:(0,E.jsx)(w.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"fixedToolbar",label:(0,y.__)("Top toolbar"),info:(0,y.__)("Access all block and document tools in a single place"),messageActivated:(0,y.__)("Top toolbar activated"),messageDeactivated:(0,y.__)("Top toolbar deactivated")})}),(0,E.jsxs)(S.MenuGroup,{label:(0,y.__)("Tools"),children:[(0,E.jsx)(S.MenuItem,{onClick:()=>{t(!0)},shortcut:jt.displayShortcut.access("h"),children:(0,y.__)("Keyboard shortcuts")}),(0,E.jsx)(w.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"welcomeGuide",label:(0,y.__)("Welcome Guide")}),(0,E.jsxs)(S.MenuItem,{role:"menuitem",icon:rr,href:(0,y.__)("https://wordpress.org/documentation/article/block-based-widgets-editor/"),target:"_blank",rel:"noopener noreferrer",children:[(0,y.__)("Help"),(0,E.jsx)(S.VisuallyHidden,{as:"span",children:(0,y.__)("(opens in a new tab)")})]}),(0,E.jsx)(pr.Slot,{fillProps:{onClose:e}})]}),(0,E.jsxs)(S.MenuGroup,{label:(0,y.__)("Preferences"),children:[(0,E.jsx)(w.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"keepCaretInsideBlock",label:(0,y.__)("Contain text cursor inside block"),info:(0,y.__)("Aids screen readers by stopping text caret from leaving blocks."),messageActivated:(0,y.__)("Contain text cursor inside block activated"),messageDeactivated:(0,y.__)("Contain text cursor inside block deactivated")}),(0,E.jsx)(w.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"themeStyles",info:(0,y.__)("Make the editor look like your theme."),label:(0,y.__)("Use theme styles")}),i&&(0,E.jsx)(w.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"showBlockBreadcrumbs",label:(0,y.__)("Display block breadcrumbs"),info:(0,y.__)("Shows block breadcrumbs at the bottom of the editor."),messageActivated:(0,y.__)("Display block breadcrumbs activated"),messageDeactivated:(0,y.__)("Display block breadcrumbs deactivated")})]})]})}),(0,E.jsx)(lr,{isModalActive:e,toggleModal:r})]})}const mr=function(){const e=(0,T.useViewportMatch)("medium"),t=(0,p.useRef)(),{hasFixedToolbar:r}=(0,l.useSelect)((e=>({hasFixedToolbar:!!e(w.store).get("core/edit-widgets","fixedToolbar")})),[]);return(0,E.jsx)(E.Fragment,{children:(0,E.jsxs)("div",{className:"edit-widgets-header",children:[(0,E.jsxs)("div",{className:"edit-widgets-header__navigable-toolbar-wrapper",children:[e&&(0,E.jsx)("h1",{className:"edit-widgets-header__title",children:(0,y.__)("Widgets")}),!e&&(0,E.jsx)(S.VisuallyHidden,{as:"h1",className:"edit-widgets-header__title",children:(0,y.__)("Widgets")}),(0,E.jsx)(Xt,{}),r&&e&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{className:"selected-block-tools-wrapper",children:(0,E.jsx)(xe.BlockToolbar,{hideDragHandle:!0})}),(0,E.jsx)(S.Popover.Slot,{ref:t,name:"block-toolbar"})]})]}),(0,E.jsxs)("div",{className:"edit-widgets-header__actions",children:[(0,E.jsx)(de.Slot,{scope:"core/edit-widgets"}),(0,E.jsx)(er,{}),(0,E.jsx)(hr,{})]})]})})};const _r=function(){const{removeNotice:e}=(0,l.useDispatch)(v.store),{notices:t}=(0,l.useSelect)((e=>({notices:e(v.store).getNotices()})),[]),r=t.filter((({isDismissible:e,type:t})=>e&&"default"===t)),i=t.filter((({isDismissible:e,type:t})=>!e&&"default"===t)),s=t.filter((({type:e})=>"snackbar"===e)).slice(-3);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(S.NoticeList,{notices:i,className:"edit-widgets-notices__pinned"}),(0,E.jsx)(S.NoticeList,{notices:r,className:"edit-widgets-notices__dismissible",onRemove:e}),(0,E.jsx)(S.SnackbarList,{notices:s,className:"edit-widgets-notices__snackbar",onRemove:e})]})};function wr({blockEditorSettings:e}){const t=(0,l.useSelect)((e=>!!e(w.store).get("core/edit-widgets","themeStyles")),[]),r=(0,T.useViewportMatch)("medium"),i=(0,p.useMemo)((()=>t?e.styles:[]),[e,t]);return(0,E.jsxs)("div",{className:"edit-widgets-block-editor",children:[(0,E.jsx)(_r,{}),!r&&(0,E.jsx)(xe.BlockToolbar,{hideDragHandle:!0}),(0,E.jsxs)(xe.BlockTools,{children:[(0,E.jsx)(At,{}),(0,E.jsx)(xe.__unstableEditorStyles,{styles:i,scope:":where(.editor-styles-wrapper)"}),(0,E.jsx)(xe.BlockSelectionClearer,{children:(0,E.jsx)(xe.WritingFlow,{children:(0,E.jsx)(xe.BlockList,{className:"edit-widgets-main-block-list"})})})]})]})}const br=(0,E.jsx)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,E.jsx)(A.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})}),fr=()=>{const e=(0,l.useSelect)((e=>{const{getEntityRecord:t}=e(m.store),r=t(ke,Se,Ee());return r?.blocks[0]?.clientId}),[]);return(0,l.useSelect)((t=>{const{getBlockRootClientId:r,getBlockSelectionEnd:i,getBlockOrder:s,getBlockIndex:o}=t(xe.store),n=t(dt).__experimentalGetInsertionPoint();if(n.rootClientId)return n;const a=i()||e,c=r(a);return a&&""===c?{rootClientId:a,insertionIndex:s(a).length}:{rootClientId:c,insertionIndex:o(a)+1}}),[e])};function xr(){const e=(0,T.useViewportMatch)("medium","<"),{rootClientId:t,insertionIndex:r}=fr(),{setIsInserterOpened:i}=(0,l.useDispatch)(dt),s=(0,p.useCallback)((()=>i(!1)),[i]),o=e?"div":S.VisuallyHidden,[n,a]=(0,T.__experimentalUseDialog)({onClose:s,focusOnMount:!0}),c=(0,p.useRef)();return(0,E.jsxs)("div",{ref:n,...a,className:"edit-widgets-layout__inserter-panel",children:[(0,E.jsx)(o,{className:"edit-widgets-layout__inserter-panel-header",children:(0,E.jsx)(S.Button,{__next40pxDefaultSize:!0,icon:br,onClick:s,label:(0,y.__)("Close block inserter")})}),(0,E.jsx)("div",{className:"edit-widgets-layout__inserter-panel-content",children:(0,E.jsx)(xe.__experimentalLibrary,{showInserterHelpPanel:!0,shouldFocusBlock:e,rootClientId:t,__experimentalInsertionIndex:r,ref:c})})]})}function yr(){const{setIsListViewOpened:e}=(0,l.useDispatch)(dt),{getListViewToggleRef:t}=at((0,l.useSelect)(dt)),[r,i]=(0,p.useState)(null),s=(0,T.useFocusOnMount)("firstElement"),o=(0,p.useCallback)((()=>{e(!1),t().current?.focus()}),[t,e]),n=(0,p.useCallback)((e=>{e.keyCode!==jt.ESCAPE||e.defaultPrevented||(e.preventDefault(),o())}),[o]);return(0,E.jsxs)("div",{className:"edit-widgets-editor__list-view-panel",onKeyDown:n,children:[(0,E.jsxs)("div",{className:"edit-widgets-editor__list-view-panel-header",children:[(0,E.jsx)("strong",{children:(0,y.__)("List View")}),(0,E.jsx)(S.Button,{__next40pxDefaultSize:!0,icon:L,label:(0,y.__)("Close"),onClick:o})]}),(0,E.jsx)("div",{className:"edit-widgets-editor__list-view-panel-content",ref:(0,T.useMergeRefs)([s,i]),children:(0,E.jsx)(xe.__experimentalListView,{dropZoneElement:r})})]})}function vr(){const{isInserterOpen:e,isListViewOpen:t}=(0,l.useSelect)((e=>{const{isInserterOpened:t,isListViewOpened:r}=e(dt);return{isInserterOpen:t(),isListViewOpen:r()}}),[]);return e?(0,E.jsx)(xr,{}):t?(0,E.jsx)(yr,{}):null}const kr={header:(0,y.__)("Widgets top bar"),body:(0,y.__)("Widgets and blocks"),sidebar:(0,y.__)("Widgets settings"),footer:(0,y.__)("Widgets footer")};const jr=function({blockEditorSettings:e}){const t=(0,T.useViewportMatch)("medium","<"),r=(0,T.useViewportMatch)("huge",">="),{setIsInserterOpened:i,setIsListViewOpened:s,closeGeneralSidebar:o}=(0,l.useDispatch)(dt),{hasBlockBreadCrumbsEnabled:n,hasSidebarEnabled:a,isInserterOpened:c,isListViewOpened:d,previousShortcut:u,nextShortcut:g}=(0,l.useSelect)((e=>({hasSidebarEnabled:!!e(Q).getActiveComplementaryArea(dt.name),isInserterOpened:!!e(dt).isInserterOpened(),isListViewOpened:!!e(dt).isListViewOpened(),hasBlockBreadCrumbsEnabled:!!e(w.store).get("core/edit-widgets","showBlockBreadcrumbs"),previousShortcut:e(kt.store).getAllShortcutKeyCombinations("core/edit-widgets/previous-region"),nextShortcut:e(kt.store).getAllShortcutKeyCombinations("core/edit-widgets/next-region")})),[]);(0,p.useEffect)((()=>{a&&!r&&(i(!1),s(!1))}),[a,r]),(0,p.useEffect)((()=>{!c&&!d||r||o()}),[c,d,r]);const h=d?(0,y.__)("List View"):(0,y.__)("Block Library"),m=d||c;return(0,E.jsx)(fe,{labels:{...kr,secondarySidebar:h},header:(0,E.jsx)(mr,{}),secondarySidebar:m&&(0,E.jsx)(vr,{}),sidebar:(0,E.jsx)(me.Slot,{scope:"core/edit-widgets"}),content:(0,E.jsx)(E.Fragment,{children:(0,E.jsx)(wr,{blockEditorSettings:e})}),footer:n&&!t&&(0,E.jsx)("div",{className:"edit-widgets-layout__footer",children:(0,E.jsx)(xe.BlockBreadcrumb,{rootLabelText:(0,y.__)("Widgets")})}),shortcuts:{previous:u,next:g}})};function Sr(){const e=(0,l.useSelect)((e=>{const{getEditedWidgetAreas:t}=e(dt),r=t();return r?.length>0}),[]);return(0,p.useEffect)((()=>{const t=t=>{if(e)return t.returnValue=(0,y.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}}),[e]),null}function Ar(){var e;const t=(0,l.useSelect)((e=>!!e(w.store).get("core/edit-widgets","welcomeGuide")),[]),{toggle:r}=(0,l.useDispatch)(w.store),i=(0,l.useSelect)((e=>e(dt).getWidgetAreas({per_page:-1})),[]);if(!t)return null;const s=i?.every((e=>"wp_inactive_widgets"===e.id||e.widgets.every((e=>e.startsWith("block-"))))),o=null!==(e=i?.filter((e=>"wp_inactive_widgets"!==e.id)).length)&&void 0!==e?e:0;return(0,E.jsx)(S.Guide,{className:"edit-widgets-welcome-guide",contentLabel:(0,y.__)("Welcome to block Widgets"),finishButtonText:(0,y.__)("Get started"),onFinish:()=>r("core/edit-widgets","welcomeGuide"),pages:[{image:(0,E.jsx)(Er,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,y.__)("Welcome to block Widgets")}),s?(0,E.jsx)(E.Fragment,{children:(0,E.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,y.sprintf)((0,y._n)("Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.","Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.",o),o)})}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,y.__)("You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.")}),(0,E.jsxs)("p",{className:"edit-widgets-welcome-guide__text",children:[(0,E.jsx)("strong",{children:(0,y.__)("Want to stick with the old widgets?")})," ",(0,E.jsx)(S.ExternalLink,{href:(0,y.__)("https://wordpress.org/plugins/classic-widgets/"),children:(0,y.__)("Get the Classic Widgets plugin.")})]})]})]})},{image:(0,E.jsx)(Er,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,y.__)("Make each block your own")}),(0,E.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,y.__)("Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.")})]})},{image:(0,E.jsx)(Er,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,y.__)("Get to know the block library")}),(0,E.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,p.createInterpolateElement)((0,y.__)("All of the blocks available to you live in the block library. You’ll find it wherever you see the icon."),{InserterIconImage:(0,E.jsx)("img",{className:"edit-widgets-welcome-guide__inserter-icon",alt:(0,y.__)("inserter"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"})})})]})},{image:(0,E.jsx)(Er,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,y.__)("Learn how to use the block editor")}),(0,E.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,p.createInterpolateElement)((0,y.__)("New to the block editor? Want to learn more about using it? Here's a detailed guide."),{a:(0,E.jsx)(S.ExternalLink,{href:(0,y.__)("https://wordpress.org/documentation/article/wordpress-block-editor/")})})})]})}]})}function Er({nonAnimatedSrc:e,animatedSrc:t}){return(0,E.jsxs)("picture",{className:"edit-widgets-welcome-guide__image",children:[(0,E.jsx)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,E.jsx)("img",{src:t,width:"312",height:"240",alt:""})]})}const Ir=function({blockEditorSettings:e}){const{createErrorNotice:t}=(0,l.useDispatch)(v.store);return(0,E.jsx)(yt,{children:(0,E.jsxs)(Lt,{blockEditorSettings:e,children:[(0,E.jsx)(jr,{blockEditorSettings:e}),(0,E.jsx)($t,{}),(0,E.jsx)(X.PluginArea,{onError:function(e){t((0,y.sprintf)((0,y.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}),(0,E.jsx)(Sr,{}),(0,E.jsx)(Ar,{})]})})},Cr=["core/more","core/freeform","core/template-part",...It?[]:["core/block"]];function Br(e,t){const r=document.getElementById(e),i=(0,p.createRoot)(r),s=(0,h.__experimentalGetCoreBlocks)().filter((e=>!(Cr.includes(e.name)||e.name.startsWith("core/post")||e.name.startsWith("core/query")||e.name.startsWith("core/site")||e.name.startsWith("core/navigation"))));return(0,l.dispatch)(w.store).setDefaults("core/edit-widgets",{fixedToolbar:!1,welcomeGuide:!0,showBlockBreadcrumbs:!0,themeStyles:!0}),(0,l.dispatch)(d.store).reapplyBlockTypeFilters(),(0,h.registerCoreBlocks)(s),(0,_.registerLegacyWidgetBlock)(),(0,_.registerLegacyWidgetVariations)(t),Lr(c),(0,_.registerWidgetGroupBlock)(),t.__experimentalFetchLinkSuggestions=(e,r)=>(0,m.__experimentalFetchLinkSuggestions)(e,r,t),(0,d.setFreeformContentHandlerName)("core/html"),i.render((0,E.jsx)(p.StrictMode,{children:(0,E.jsx)(Ir,{blockEditorSettings:t})})),i}const Nr=Br;function Tr(){g()("wp.editWidgets.reinitializeEditor",{since:"6.2",version:"6.3"})}const Lr=e=>{if(!e)return;const{metadata:t,settings:r,name:i}=e;t&&(0,d.unstable__bootstrapServerSideBlockDefinitions)({[i]:t}),(0,d.registerBlockType)(i,r)};(window.wp=window.wp||{}).editWidgets=t})();