mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-13 22:26:06 +01:00
9dcce378a0
Updates the `@wordpress` npm packages to their latest patch versions, including generated PHP files. Props ramonopoly. Fixes #58654. Built from https://develop.svn.wordpress.org/trunk@56086 git-svn-id: http://core.svn.wordpress.org/trunk@55598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
7 lines
123 KiB
JavaScript
7 lines
123 KiB
JavaScript
/*! This file is auto-generated */
|
||
!function(){var e={4403:function(e,t){var n;
|
||
/*!
|
||
Copyright (c) 2018 Jed Watson.
|
||
Licensed under the MIT License (MIT), see
|
||
http://jedwatson.github.io/classnames
|
||
*/!function(){"use strict";var o={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"===r||"number"===r)e.push(n);else if(Array.isArray(n)){if(n.length){var l=a.apply(null,n);l&&e.push(l)}}else if("object"===r){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var s in n)o.call(n,s)&&n[s]&&e.push(s)}}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()}},t={};function n(o){var a=t[o];if(void 0!==a)return a.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{PluginBlockSettingsMenuItem:function(){return Wa},PluginDocumentSettingPanel:function(){return ca},PluginMoreMenuItem:function(){return qa},PluginPostPublishPanel:function(){return ya},PluginPostStatusInfo:function(){return No},PluginPrePublishPanel:function(){return Pa},PluginSidebar:function(){return da},PluginSidebarMoreMenuItem:function(){return ja},__experimentalFullscreenModeClose:function(){return On},__experimentalMainDashboardButton:function(){return to},initializeEditor:function(){return Ka},reinitializeEditor:function(){return Ya},store:function(){return on}});var e={};n.r(e),n.d(e,{closeModal:function(){return W},disableComplementaryArea:function(){return R},enableComplementaryArea:function(){return F},openModal:function(){return $},pinItem:function(){return H},setDefaultComplementaryArea:function(){return O},setFeatureDefaults:function(){return Z},setFeatureValue:function(){return z},toggleFeature:function(){return U},unpinItem:function(){return G}});var t={};n.r(t),n.d(t,{getActiveComplementaryArea:function(){return q},isComplementaryAreaLoading:function(){return j},isFeatureActive:function(){return Y},isItemPinned:function(){return K},isModalActive:function(){return X}});var a={};n.r(a),n.d(a,{__experimentalSetPreviewDeviceType:function(){return gt},__unstableCreateTemplate:function(){return ft},__unstableSwitchToTemplateMode:function(){return bt},closeGeneralSidebar:function(){return Ke},closeModal:function(){return Xe},closePublishSidebar:function(){return Je},hideBlockTypes:function(){return ct},initializeMetaBoxes:function(){return yt},metaBoxUpdatesFailure:function(){return pt},metaBoxUpdatesSuccess:function(){return mt},openGeneralSidebar:function(){return je},openModal:function(){return Ye},openPublishSidebar:function(){return Qe},removeEditorPanel:function(){return ot},requestMetaBoxUpdates:function(){return ut},setAvailableMetaBoxesPerLocation:function(){return dt},setIsEditingTemplate:function(){return Et},setIsInserterOpened:function(){return ht},setIsListViewOpened:function(){return _t},showBlockTypes:function(){return it},switchEditorMode:function(){return rt},toggleEditorPanelEnabled:function(){return tt},toggleEditorPanelOpened:function(){return nt},toggleFeature:function(){return at},togglePinnedPluginItem:function(){return lt},togglePublishSidebar:function(){return et},updatePreferredStyleVariations:function(){return st}});var r={};n.r(r),n.d(r,{__experimentalGetInsertionPoint:function(){return Xt},__experimentalGetPreviewDeviceType:function(){return Kt},areMetaBoxesInitialized:function(){return en},getActiveGeneralSidebarName:function(){return It},getActiveMetaBoxLocations:function(){return Ut},getAllMetaBoxes:function(){return Wt},getEditedPostTemplate:function(){return tn},getEditorMode:function(){return xt},getHiddenBlockTypes:function(){return At},getMetaBoxesPerLocation:function(){return $t},getPreference:function(){return Lt},getPreferences:function(){return Nt},hasMetaBoxes:function(){return qt},isEditingTemplate:function(){return Jt},isEditorPanelEnabled:function(){return Ot},isEditorPanelOpened:function(){return Ft},isEditorPanelRemoved:function(){return Vt},isEditorSidebarOpened:function(){return Mt},isFeatureActive:function(){return Ht},isInserterOpened:function(){return Yt},isListViewOpened:function(){return Qt},isMetaBoxLocationActive:function(){return Zt},isMetaBoxLocationVisible:function(){return zt},isModalActive:function(){return Rt},isPluginItemPinned:function(){return Gt},isPluginSidebarOpened:function(){return Bt},isPublishSidebarOpened:function(){return Dt},isSavingMetaBoxes:function(){return jt}});var l=window.wp.element,s=window.wp.blocks,i=window.wp.blockLibrary,c=window.wp.deprecated,d=n.n(c),u=window.wp.data,m=window.wp.hooks,p=window.wp.preferences,g=window.wp.widgets,h=window.wp.mediaUtils;(0,m.addFilter)("editor.MediaUpload","core/edit-post/replace-media-upload",(()=>h.MediaUpload));var _=window.wp.components,E=window.wp.blockEditor,b=window.wp.i18n,f=window.wp.compose;const v=(0,f.compose)((0,u.withSelect)(((e,t)=>{if((0,s.hasBlockSupport)(t.name,"multiple",!0))return{};const n=e(E.store).getBlocks().find((({name:e})=>t.name===e));return{originalBlockClientId:n&&n.clientId!==t.clientId&&n.clientId}})),(0,u.withDispatch)(((e,{originalBlockClientId:t})=>({selectFirst:()=>e(E.store).selectBlock(t)})))),y=(0,f.createHigherOrderComponent)((e=>v((({originalBlockClientId:t,selectFirst:n,...o})=>{if(!t)return(0,l.createElement)(e,{...o});const a=(0,s.getBlockType)(o.name),r=function(e){const t=(0,s.findTransform)((0,s.getBlockTransforms)("to",e),(({type:e,blocks:t})=>"block"===e&&1===t.length));if(!t)return null;return(0,s.getBlockType)(t.blocks[0])}(o.name);return[(0,l.createElement)("div",{key:"invalid-preview",style:{minHeight:"60px"}},(0,l.createElement)(e,{key:"block-edit",...o})),(0,l.createElement)(E.Warning,{key:"multiple-use-warning",actions:[(0,l.createElement)(_.Button,{key:"find-original",variant:"secondary",onClick:n},(0,b.__)("Find original")),(0,l.createElement)(_.Button,{key:"remove",variant:"secondary",onClick:()=>o.onReplace([])},(0,b.__)("Remove")),r&&(0,l.createElement)(_.Button,{key:"transform",variant:"secondary",onClick:()=>o.onReplace((0,s.createBlock)(r.name,o.attributes))},(0,b.__)("Transform into:")," ",r.title)]},(0,l.createElement)("strong",null,a?.title,": "),(0,b.__)("This block can only be used once."))]}))),"withMultipleValidation");(0,m.addFilter)("editor.BlockEdit","core/edit-post/validate-multiple-use/with-multiple-validation",y);var w=window.wp.primitives;var S=(0,l.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(w.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"})),k=window.wp.plugins,P=window.wp.url,C=window.wp.notices,T=window.wp.editor;function x(){const{createNotice:e}=(0,u.useDispatch)(C.store),t=(0,u.useSelect)((e=>()=>e(T.store).getEditedPostAttribute("content")),[]);const n=(0,f.useCopyToClipboard)(t,(function(){e("info",(0,b.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,l.createElement)(_.MenuItem,{ref:n},(0,b.__)("Copy all blocks"))}var M=window.wp.keycodes,B=n(4403),I=n.n(B);var N=(0,l.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(w.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));var L=(0,l.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(w.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"}));var A=(0,l.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(w.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})),D=window.wp.viewport;var V=(0,l.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(w.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));const O=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),F=(e,t)=>({registry:n,dispatch:o})=>{if(!t)return;n.select(p.store).get(e,"isComplementaryAreaVisible")||n.dispatch(p.store).set(e,"isComplementaryAreaVisible",!0),o({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},R=e=>({registry:t})=>{t.select(p.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(p.store).set(e,"isComplementaryAreaVisible",!1)},H=(e,t)=>({registry:n})=>{if(!t)return;const o=n.select(p.store).get(e,"pinnedItems");!0!==o?.[t]&&n.dispatch(p.store).set(e,"pinnedItems",{...o,[t]:!0})},G=(e,t)=>({registry:n})=>{if(!t)return;const o=n.select(p.store).get(e,"pinnedItems");n.dispatch(p.store).set(e,"pinnedItems",{...o,[t]:!1})};function U(e,t){return function({registry:n}){d()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),n.dispatch(p.store).toggle(e,t)}}function z(e,t,n){return function({registry:o}){d()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),o.dispatch(p.store).set(e,t,!!n)}}function Z(e,t){return function({registry:n}){d()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),n.dispatch(p.store).setDefaults(e,t)}}function $(e){return{type:"OPEN_MODAL",name:e}}function W(){return{type:"CLOSE_MODAL"}}const q=(0,u.createRegistrySelector)((e=>(t,n)=>{const o=e(p.store).get(n,"isComplementaryAreaVisible");if(void 0!==o)return!1===o?null:t?.complementaryAreas?.[n]})),j=(0,u.createRegistrySelector)((e=>(t,n)=>{const o=e(p.store).get(n,"isComplementaryAreaVisible"),a=t?.complementaryAreas?.[n];return o&&void 0===a})),K=(0,u.createRegistrySelector)((e=>(t,n,o)=>{var a;return null===(a=e(p.store).get(n,"pinnedItems")?.[o])||void 0===a||a})),Y=(0,u.createRegistrySelector)((e=>(t,n,o)=>(d()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(p.store).get(n,o))));function X(e,t){return e.activeModal===t}var Q=(0,u.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:n,area:o}=t;return e[n]?e:{...e,[n]:o}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:n,area:o}=t;return{...e,[n]:o}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}});const J=(0,u.createReduxStore)("core/interface",{reducer:Q,actions:e,selectors:t});(0,u.register)(J);var ee=(0,k.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));var te=ee((function({as:e=_.Button,scope:t,identifier:n,icon:o,selectedIcon:a,name:r,...s}){const i=e,c=(0,u.useSelect)((e=>e(J).getActiveComplementaryArea(t)===n),[n]),{enableComplementaryArea:d,disableComplementaryArea:m}=(0,u.useDispatch)(J);return(0,l.createElement)(i,{icon:a&&c?a:o,onClick:()=>{c?m(t):d(t,n)},...s})}));var ne=({smallScreenTitle:e,children:t,className:n,toggleButtonProps:o})=>{const a=(0,l.createElement)(te,{icon:V,...o});return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},e&&(0,l.createElement)("span",{className:"interface-complementary-area-header__small-title"},e),a),(0,l.createElement)("div",{className:I()("components-panel__header","interface-complementary-area-header",n),tabIndex:-1},t,a))};const oe=()=>{};function ae({name:e,as:t=_.Button,onClick:n,...o}){return(0,l.createElement)(_.Fill,{name:e},(({onClick:e})=>(0,l.createElement)(t,{onClick:n||e?(...t)=>{(n||oe)(...t),(e||oe)(...t)}:void 0,...o})))}ae.Slot=function({name:e,as:t=_.ButtonGroup,fillProps:n={},bubblesVirtually:o,...a}){return(0,l.createElement)(_.Slot,{name:e,bubblesVirtually:o,fillProps:n},(e=>{if(!l.Children.toArray(e).length)return null;const n=[];l.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&n.push(t)}));const o=l.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&n.includes(e.props.__unstableTarget)?null:e));return(0,l.createElement)(t,{...a},o)}))};var re=ae;const le=({__unstableExplicitMenuItem:e,__unstableTarget:t,...n})=>(0,l.createElement)(_.MenuItem,{...n});function se({scope:e,target:t,__unstableExplicitMenuItem:n,...o}){return(0,l.createElement)(te,{as:o=>(0,l.createElement)(re,{__unstableExplicitMenuItem:n,__unstableTarget:`${e}/${t}`,as:le,name:`${e}/plugin-more-menu`,...o}),role:"menuitemcheckbox",selectedIcon:N,name:t,scope:e,...o})}function ie({scope:e,...t}){return(0,l.createElement)(_.Fill,{name:`PinnedItems/${e}`,...t})}ie.Slot=function({scope:e,className:t,...n}){return(0,l.createElement)(_.Slot,{name:`PinnedItems/${e}`,...n},(e=>e?.length>0&&(0,l.createElement)("div",{className:I()(t,"interface-pinned-items")},e)))};var ce=ie;function de({scope:e,children:t,className:n}){return(0,l.createElement)(_.Fill,{name:`ComplementaryArea/${e}`},(0,l.createElement)("div",{className:n},t))}const ue=ee((function({children:e,className:t,closeLabel:n=(0,b.__)("Close plugin"),identifier:o,header:a,headerClassName:r,icon:s,isPinnable:i=!0,panelClassName:c,scope:d,name:m,smallScreenTitle:p,title:g,toggleShortcut:h,isActiveByDefault:E,showIconLabels:f=!1}){const{isLoading:v,isActive:y,isPinned:w,activeArea:S,isSmall:k,isLarge:P}=(0,u.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:n,isItemPinned:a}=e(J),r=t(d);return{isLoading:n(d),isActive:r===o,isPinned:a(d,o),activeArea:r,isSmall:e(D.store).isViewportMatch("< medium"),isLarge:e(D.store).isViewportMatch("large")}}),[o,d]);!function(e,t,n,o,a){const r=(0,l.useRef)(!1),s=(0,l.useRef)(!1),{enableComplementaryArea:i,disableComplementaryArea:c}=(0,u.useDispatch)(J);(0,l.useEffect)((()=>{o&&a&&!r.current?(c(e),s.current=!0):s.current&&!a&&r.current?(s.current=!1,i(e,t)):s.current&&n&&n!==t&&(s.current=!1),a!==r.current&&(r.current=a)}),[o,a,e,t,n])}(d,o,S,y,k);const{enableComplementaryArea:C,disableComplementaryArea:T,pinItem:x,unpinItem:M}=(0,u.useDispatch)(J);return(0,l.useEffect)((()=>{E&&void 0===S&&!k?C(d,o):void 0===S&&k&&T(d,o)}),[S,E,d,o,k]),(0,l.createElement)(l.Fragment,null,i&&(0,l.createElement)(ce,{scope:d},w&&(0,l.createElement)(te,{scope:d,identifier:o,isPressed:y&&(!f||P),"aria-expanded":y,"aria-disabled":v,label:g,icon:f?N:s,showTooltip:!f,variant:f?"tertiary":void 0})),m&&i&&(0,l.createElement)(se,{target:m,scope:d,icon:s},g),y&&(0,l.createElement)(de,{className:I()("interface-complementary-area",t),scope:d},(0,l.createElement)(ne,{className:r,closeLabel:n,onClose:()=>T(d),smallScreenTitle:p,toggleButtonProps:{label:n,shortcut:h,scope:d,identifier:o}},a||(0,l.createElement)(l.Fragment,null,(0,l.createElement)("strong",null,g),i&&(0,l.createElement)(_.Button,{className:"interface-complementary-area__pin-unpin-item",icon:w?L:A,label:w?(0,b.__)("Unpin from toolbar"):(0,b.__)("Pin to toolbar"),onClick:()=>(w?M:x)(d,o),isPressed:w,"aria-expanded":w}))),(0,l.createElement)(_.Panel,{className:c},e)))}));ue.Slot=function({scope:e,...t}){return(0,l.createElement)(_.Slot,{name:`ComplementaryArea/${e}`,...t})};var me=ue;var pe=({isActive:e})=>((0,l.useEffect)((()=>{let e=!1;return document.body.classList.contains("sticky-menu")&&(e=!0,document.body.classList.remove("sticky-menu")),()=>{e&&document.body.classList.add("sticky-menu")}}),[]),(0,l.useEffect)((()=>(e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{e&&document.body.classList.remove("is-fullscreen-mode")})),[e]),null);function ge({children:e,className:t,ariaLabel:n,as:o="div",...a}){return(0,l.createElement)(o,{className:I()("interface-navigable-region",t),"aria-label":n,role:"region",tabIndex:"-1",...a},e)}const he={hidden:{opacity:0},hover:{opacity:1,transition:{type:"tween",delay:.2,delayChildren:.2}},distractionFreeInactive:{opacity:1,transition:{delay:0}}};var _e=(0,l.forwardRef)((function({isDistractionFree:e,footer:t,header:n,editorNotices:o,sidebar:a,secondarySidebar:r,notices:s,content:i,actions:c,labels:d,className:u,enableRegionNavigation:m=!0,shortcuts:p},g){const h=(0,_.__unstableUseNavigateRegions)(p);!function(e){(0,l.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 E={...{header:(0,b.__)("Header"),body:(0,b.__)("Content"),secondarySidebar:(0,b.__)("Block Library"),sidebar:(0,b.__)("Settings"),actions:(0,b.__)("Publish"),footer:(0,b.__)("Footer")},...d};return(0,l.createElement)("div",{...m?h:{},ref:(0,f.useMergeRefs)([g,m?h.ref:void 0]),className:I()(u,"interface-interface-skeleton",h.className,!!t&&"has-footer")},(0,l.createElement)("div",{className:"interface-interface-skeleton__editor"},!!n&&(0,l.createElement)(ge,{as:_.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":E.header,initial:e?"hidden":"distractionFreeInactive",whileHover:e?"hover":"distractionFreeInactive",animate:e?"hidden":"distractionFreeInactive",variants:he,transition:e?{type:"tween",delay:.8}:void 0},n),e&&(0,l.createElement)("div",{className:"interface-interface-skeleton__header"},o),(0,l.createElement)("div",{className:"interface-interface-skeleton__body"},!!r&&(0,l.createElement)(ge,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:E.secondarySidebar},r),!!s&&(0,l.createElement)("div",{className:"interface-interface-skeleton__notices"},s),(0,l.createElement)(ge,{className:"interface-interface-skeleton__content",ariaLabel:E.body},i),!!a&&(0,l.createElement)(ge,{className:"interface-interface-skeleton__sidebar",ariaLabel:E.sidebar},a),!!c&&(0,l.createElement)(ge,{className:"interface-interface-skeleton__actions",ariaLabel:E.actions},c))),!!t&&(0,l.createElement)(ge,{className:"interface-interface-skeleton__footer",ariaLabel:E.footer},t))}));var Ee=(0,l.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(w.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function be({as:e=_.DropdownMenu,className:t,label:n=(0,b.__)("Options"),popoverProps:o,toggleProps:a,children:r}){return(0,l.createElement)(e,{className:I()("interface-more-menu-dropdown",t),icon:Ee,label:n,popoverProps:{placement:"bottom-end",...o,className:I()("interface-more-menu-dropdown__content",o?.className)},toggleProps:{tooltipPosition:"bottom",...a}},(e=>r(e)))}function fe({closeModal:e,children:t}){return(0,l.createElement)(_.Modal,{className:"interface-preferences-modal",title:(0,b.__)("Preferences"),onRequestClose:e},t)}var ve=function({icon:e,size:t=24,...n}){return(0,l.cloneElement)(e,{width:t,height:t,...n})};var ye=(0,l.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(w.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var we=(0,l.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(w.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));const Se="preferences-menu";function ke({sections:e}){const t=(0,f.useViewportMatch)("medium"),[n,o]=(0,l.useState)(Se),{tabs:a,sectionsContentMap:r}=(0,l.useMemo)((()=>{let t={tabs:[],sectionsContentMap:{}};return e.length&&(t=e.reduce(((e,{name:t,tabLabel:n,content:o})=>(e.tabs.push({name:t,title:n}),e.sectionsContentMap[t]=o,e)),{tabs:[],sectionsContentMap:{}})),t}),[e]),s=(0,l.useCallback)((e=>r[e.name]||null),[r]);let i;return i=t?(0,l.createElement)(_.TabPanel,{className:"interface-preferences__tabs",tabs:a,initialTabName:n!==Se?n:void 0,onSelect:o,orientation:"vertical"},s):(0,l.createElement)(_.__experimentalNavigatorProvider,{initialPath:"/",className:"interface-preferences__provider"},(0,l.createElement)(_.__experimentalNavigatorScreen,{path:"/"},(0,l.createElement)(_.Card,{isBorderless:!0,size:"small"},(0,l.createElement)(_.CardBody,null,(0,l.createElement)(_.__experimentalItemGroup,null,a.map((e=>(0,l.createElement)(_.__experimentalNavigatorButton,{key:e.name,path:e.name,as:_.__experimentalItem,isAction:!0},(0,l.createElement)(_.__experimentalHStack,{justify:"space-between"},(0,l.createElement)(_.FlexItem,null,(0,l.createElement)(_.__experimentalTruncate,null,e.title)),(0,l.createElement)(_.FlexItem,null,(0,l.createElement)(ve,{icon:(0,b.isRTL)()?ye:we})))))))))),e.length&&e.map((e=>(0,l.createElement)(_.__experimentalNavigatorScreen,{key:`${e.name}-menu`,path:e.name},(0,l.createElement)(_.Card,{isBorderless:!0,size:"large"},(0,l.createElement)(_.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6"},(0,l.createElement)(_.__experimentalNavigatorBackButton,{icon:(0,b.isRTL)()?we:ye,"aria-label":(0,b.__)("Navigate to the previous view")}),(0,l.createElement)(_.__experimentalText,{size:"16"},e.tabLabel)),(0,l.createElement)(_.CardBody,null,e.content)))))),i}var Pe=({description:e,title:t,children:n})=>(0,l.createElement)("fieldset",{className:"interface-preferences-modal__section"},(0,l.createElement)("legend",{className:"interface-preferences-modal__section-legend"},(0,l.createElement)("h2",{className:"interface-preferences-modal__section-title"},t),e&&(0,l.createElement)("p",{className:"interface-preferences-modal__section-description"},e)),n);var Ce=function({help:e,label:t,isChecked:n,onChange:o,children:a}){return(0,l.createElement)("div",{className:"interface-preferences-modal__option"},(0,l.createElement)(_.ToggleControl,{__nextHasNoMarginBottom:!0,help:e,label:t,checked:n,onChange:o}),a)},Te=window.wp.keyboardShortcuts;const xe=[{keyCombination:{modifier:"primary",character:"b"},description:(0,b.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,b.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,b.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,b.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,b.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,b.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,b.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,b.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},description:(0,b.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,b.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")}];function Me({keyCombination:e,forceAriaLabel:t}){const n=e.modifier?M.displayShortcutList[e.modifier](e.character):e.character,o=e.modifier?M.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,l.createElement)("kbd",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||o},(Array.isArray(n)?n:[n]).map(((e,t)=>"+"===e?(0,l.createElement)(l.Fragment,{key:t},e):(0,l.createElement)("kbd",{key:t,className:"edit-post-keyboard-shortcut-help-modal__shortcut-key"},e))))}var Be=function({description:e,keyCombination:t,aliases:n=[],ariaLabel:o}){return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-description"},e),(0,l.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-term"},(0,l.createElement)(Me,{keyCombination:t,forceAriaLabel:o}),n.map(((e,t)=>(0,l.createElement)(Me,{keyCombination:e,forceAriaLabel:o,key:t})))))};var Ie=function({name:e}){const{keyCombination:t,description:n,aliases:o}=(0,u.useSelect)((t=>{const{getShortcutKeyCombination:n,getShortcutDescription:o,getShortcutAliases:a}=t(Te.store);return{keyCombination:n(e),aliases:a(e),description:o(e)}}),[e]);return t?(0,l.createElement)(Be,{keyCombination:t,description:n,aliases:o}):null};const Ne="edit-post/keyboard-shortcut-help",Le=({shortcuts:e})=>(0,l.createElement)("ul",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-list",role:"list"},e.map(((e,t)=>(0,l.createElement)("li",{className:"edit-post-keyboard-shortcut-help-modal__shortcut",key:t},"string"==typeof e?(0,l.createElement)(Ie,{name:e}):(0,l.createElement)(Be,{...e}))))),Ae=({title:e,shortcuts:t,className:n})=>(0,l.createElement)("section",{className:I()("edit-post-keyboard-shortcut-help-modal__section",n)},!!e&&(0,l.createElement)("h2",{className:"edit-post-keyboard-shortcut-help-modal__section-title"},e),(0,l.createElement)(Le,{shortcuts:t})),De=({title:e,categoryName:t,additionalShortcuts:n=[]})=>{const o=(0,u.useSelect)((e=>e(Te.store).getCategoryShortcuts(t)),[t]);return(0,l.createElement)(Ae,{title:e,shortcuts:o.concat(n)})};var Ve=(0,f.compose)([(0,u.withSelect)((e=>({isModalActive:e(J).isModalActive(Ne)}))),(0,u.withDispatch)(((e,{isModalActive:t})=>{const{openModal:n,closeModal:o}=e(J);return{toggleModal:()=>t?o():n(Ne)}}))])((function({isModalActive:e,toggleModal:t}){return(0,Te.useShortcut)("core/edit-post/keyboard-shortcuts",t),e?(0,l.createElement)(_.Modal,{className:"edit-post-keyboard-shortcut-help-modal",title:(0,b.__)("Keyboard shortcuts"),closeButtonLabel:(0,b.__)("Close"),onRequestClose:t},(0,l.createElement)(Ae,{className:"edit-post-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-post/keyboard-shortcuts"]}),(0,l.createElement)(De,{title:(0,b.__)("Global shortcuts"),categoryName:"global"}),(0,l.createElement)(De,{title:(0,b.__)("Selection shortcuts"),categoryName:"selection"}),(0,l.createElement)(De,{title:(0,b.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,b.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,b.__)("Forward-slash")}]}),(0,l.createElement)(Ae,{title:(0,b.__)("Text formatting"),shortcuts:xe})):null}));var Oe=(0,u.withDispatch)((e=>{const{openModal:t}=e(J);return{openModal:t}}))((function({openModal:e}){return(0,l.createElement)(_.MenuItem,{onClick:()=>{e(Ne)},shortcut:M.displayShortcut.access("h")},(0,b.__)("Keyboard shortcuts"))}));const{Fill:Fe,Slot:Re}=(0,_.createSlotFill)("ToolsMoreMenuGroup");Fe.Slot=({fillProps:e})=>(0,l.createElement)(Re,{fillProps:e},(e=>e.length>0&&(0,l.createElement)(_.MenuGroup,{label:(0,b.__)("Tools")},e)));var He=Fe;function Ge(e=[],t){const n=[...e];for(const e of t){const t=n.findIndex((t=>t.id===e.id));-1!==t?n[t]=e:n.push(e)}return n}const Ue=(0,u.combineReducers)({isSaving:function(e=!1,t){switch(t.type){case"REQUEST_META_BOX_UPDATES":return!0;case"META_BOX_UPDATES_SUCCESS":case"META_BOX_UPDATES_FAILURE":return!1;default:return e}},locations:function(e={},t){if("SET_META_BOXES_PER_LOCATIONS"===t.type){const n={...e};for(const[e,o]of Object.entries(t.metaBoxesPerLocation))n[e]=Ge(n[e],o);return n}return e},initialized:function(e=!1,t){return"META_BOXES_INITIALIZED"===t.type||e}});var ze=(0,u.combineReducers)({metaBoxes:Ue,publishSidebarActive:function(e=!1,t){switch(t.type){case"OPEN_PUBLISH_SIDEBAR":return!0;case"CLOSE_PUBLISH_SIDEBAR":return!1;case"TOGGLE_PUBLISH_SIDEBAR":return!e}return e},removedPanels:function(e=[],t){if("REMOVE_PANEL"===t.type)if(!e.includes(t.panelName))return[...e,t.panelName];return e},deviceType:function(e="Desktop",t){return"SET_PREVIEW_DEVICE_TYPE"===t.type?t.deviceType:e},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},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},isEditingTemplate:function(e=!1,t){return"SET_IS_EDITING_TEMPLATE"===t.type?t.value:e}}),Ze=window.wp.apiFetch,$e=n.n(Ze),We=window.wp.a11y,qe=window.wp.coreData;const je=e=>({registry:t})=>t.dispatch(J).enableComplementaryArea(on.name,e),Ke=()=>({registry:e})=>e.dispatch(J).disableComplementaryArea(on.name),Ye=e=>({registry:t})=>(d()("select( 'core/edit-post' ).openModal( name )",{since:"6.3",alternative:"select( 'core/interface').openModal( name )"}),t.dispatch(J).openModal(e)),Xe=()=>({registry:e})=>(d()("select( 'core/edit-post' ).closeModal()",{since:"6.3",alternative:"select( 'core/interface').closeModal()"}),e.dispatch(J).closeModal());function Qe(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function Je(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function et(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const tt=e=>({registry:t})=>{var n;const o=null!==(n=t.select(p.store).get("core/edit-post","inactivePanels"))&&void 0!==n?n:[];let a;a=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(p.store).set("core/edit-post","inactivePanels",a)},nt=e=>({registry:t})=>{var n;const o=null!==(n=t.select(p.store).get("core/edit-post","openPanels"))&&void 0!==n?n:[];let a;a=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(p.store).set("core/edit-post","openPanels",a)};function ot(e){return{type:"REMOVE_PANEL",panelName:e}}const at=e=>({registry:t})=>t.dispatch(p.store).toggle("core/edit-post",e),rt=e=>({registry:t})=>{t.dispatch(p.store).set("core/edit-post","editorMode",e),"visual"!==e&&t.dispatch(E.store).clearSelectedBlock();const n="visual"===e?(0,b.__)("Visual editor selected"):(0,b.__)("Code editor selected");(0,We.speak)(n,"assertive")},lt=e=>({registry:t})=>{const n=t.select(J).isItemPinned("core/edit-post",e);t.dispatch(J)[n?"unpinItem":"pinItem"]("core/edit-post",e)},st=(e,t)=>({registry:n})=>{var o;if(!e)return;const a=null!==(o=n.select(p.store).get("core/edit-post","preferredStyleVariations"))&&void 0!==o?o:{};if(t)n.dispatch(p.store).set("core/edit-post","preferredStyleVariations",{...a,[e]:t});else{const t={...a};delete t[e],n.dispatch(p.store).set("core/edit-post","preferredStyleVariations",t)}},it=e=>({registry:t})=>{var n;const o=(null!==(n=t.select(p.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==n?n:[]).filter((t=>!(Array.isArray(e)?e:[e]).includes(t)));t.dispatch(p.store).set("core/edit-post","hiddenBlockTypes",o)},ct=e=>({registry:t})=>{var n;const o=null!==(n=t.select(p.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==n?n:[],a=new Set([...o,...Array.isArray(e)?e:[e]]);t.dispatch(p.store).set("core/edit-post","hiddenBlockTypes",[...a])};function dt(e){return{type:"SET_META_BOXES_PER_LOCATIONS",metaBoxesPerLocation:e}}const ut=()=>async({registry:e,select:t,dispatch:n})=>{n({type:"REQUEST_META_BOX_UPDATES"}),window.tinyMCE&&window.tinyMCE.triggerSave();const o=e.select(T.store).getCurrentPost(),a=[!!o.comment_status&&["comment_status",o.comment_status],!!o.ping_status&&["ping_status",o.ping_status],!!o.sticky&&["sticky",o.sticky],!!o.author&&["post_author",o.author]].filter(Boolean),r=[new window.FormData(document.querySelector(".metabox-base-form")),...t.getActiveMetaBoxLocations().map((e=>new window.FormData((e=>document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`)||document.querySelector("#metaboxes .metabox-location-"+e))(e))))].reduce(((e,t)=>{for(const[n,o]of t)e.append(n,o);return e}),new window.FormData);a.forEach((([e,t])=>r.append(e,t)));try{await $e()({url:window._wpMetaBoxUrl,method:"POST",body:r,parse:!1}),n.metaBoxUpdatesSuccess()}catch{n.metaBoxUpdatesFailure()}};function mt(){return{type:"META_BOX_UPDATES_SUCCESS"}}function pt(){return{type:"META_BOX_UPDATES_FAILURE"}}function gt(e){return{type:"SET_PREVIEW_DEVICE_TYPE",deviceType:e}}function ht(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function _t(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}function Et(e){return{type:"SET_IS_EDITING_TEMPLATE",value:e}}const bt=(e=!1)=>({registry:t,select:n,dispatch:o})=>{o(Et(!0));if(!n.isFeatureActive("welcomeGuideTemplate")){const n=e?(0,b.__)("Custom template created. You're in template mode now."):(0,b.__)("Editing template. Changes made here affect all posts and pages that use the template.");t.dispatch(C.store).createSuccessNotice(n,{type:"snackbar"})}},ft=e=>async({registry:t})=>{const n=await t.dispatch(qe.store).saveEntityRecord("postType","wp_template",e),o=t.select(T.store).getCurrentPost();t.dispatch(qe.store).editEntityRecord("postType",o.type,o.id,{template:n.slug})};let vt=!1;const yt=()=>({registry:e,select:t,dispatch:n})=>{if(!e.select(T.store).__unstableIsEditorReady())return;if(vt)return;const o=e.select(T.store).getCurrentPostType();window.postboxes.page!==o&&window.postboxes.add_postbox_toggles(o),vt=!0;let a=e.select(T.store).isSavingPost(),r=e.select(T.store).isAutosavingPost();e.subscribe((async()=>{const o=e.select(T.store).isSavingPost(),l=e.select(T.store).isAutosavingPost(),s=a&&!r&&!o&&t.hasMetaBoxes();a=o,r=l,s&&await n.requestMetaBoxUpdates()})),n({type:"META_BOXES_INITIALIZED"})};var wt={};function St(e){return[e]}function kt(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function Pt(e,t){var n,o=t||St;function a(e){var t,o,a,r,l,s=n,i=!0;for(t=0;t<e.length;t++){if(o=e[t],!(l=o)||"object"!=typeof l){i=!1;break}s.has(o)?s=s.get(o):(a=new WeakMap,s.set(o,a),s=a)}return s.has(wt)||((r=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=i,s.set(wt,r)),s.get(wt)}function r(){n=new WeakMap}function l(){var t,n,r,l,s,i=arguments.length;for(l=new Array(i),r=0;r<i;r++)l[r]=arguments[r];for((t=a(s=o.apply(null,l))).isUniqueByDependants||(t.lastDependants&&!kt(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),n=t.head;n;){if(kt(n.args,l,1))return n!==t.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=t.head,n.prev=null,t.head.prev=n,t.head=n),n.val;n=n.next}return n={val:e.apply(null,l)},l[0]=null,n.args=l,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return l.getDependants=o,l.clear=r,r(),l}const Ct=[],Tt={},xt=(0,u.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(p.store).get("core/edit-post","editorMode"))&&void 0!==t?t:"visual"})),Mt=(0,u.createRegistrySelector)((e=>()=>{const t=e(J).getActiveComplementaryArea("core/edit-post");return["edit-post/document","edit-post/block"].includes(t)})),Bt=(0,u.createRegistrySelector)((e=>()=>{const t=e(J).getActiveComplementaryArea("core/edit-post");return!!t&&!["edit-post/document","edit-post/block"].includes(t)})),It=(0,u.createRegistrySelector)((e=>()=>e(J).getActiveComplementaryArea("core/edit-post")));const Nt=(0,u.createRegistrySelector)((e=>()=>{d()("select( 'core/edit-post' ).getPreferences",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const t=["hiddenBlockTypes","editorMode","preferredStyleVariations"].reduce(((t,n)=>({...t,[n]:e(p.store).get("core/edit-post",n)})),{}),n=function(e,t){var n;const o=e?.reduce(((e,t)=>({...e,[t]:{enabled:!1}})),{}),a=t?.reduce(((e,t)=>{const n=e?.[t];return{...e,[t]:{...n,opened:!0}}}),null!=o?o:{});return null!==(n=null!=a?a:o)&&void 0!==n?n:Tt}(e(p.store).get("core/edit-post","inactivePanels"),e(p.store).get("core/edit-post","openPanels"));return{...t,panels:n}}));function Lt(e,t,n){d()("select( 'core/edit-post' ).getPreference",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const o=Nt(e)[t];return void 0===o?n:o}const At=(0,u.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(p.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==t?t:Ct}));function Dt(e){return e.publishSidebarActive}function Vt(e,t){return e.removedPanels.includes(t)}const Ot=(0,u.createRegistrySelector)((e=>(t,n)=>{const o=e(p.store).get("core/edit-post","inactivePanels");return!Vt(t,n)&&!o?.includes(n)})),Ft=(0,u.createRegistrySelector)((e=>(t,n)=>!!e(p.store).get("core/edit-post","openPanels")?.includes(n))),Rt=(0,u.createRegistrySelector)((e=>(t,n)=>(d()("select( 'core/edit-post' ).isModalActive",{since:"6.3",alternative:"select( 'core/interface' ).isModalActive"}),!!e(J).isModalActive(n)))),Ht=(0,u.createRegistrySelector)((e=>(t,n)=>!!e(p.store).get("core/edit-post",n))),Gt=(0,u.createRegistrySelector)((e=>(t,n)=>e(J).isItemPinned("core/edit-post",n))),Ut=Pt((e=>Object.keys(e.metaBoxes.locations).filter((t=>Zt(e,t)))),(e=>[e.metaBoxes.locations]));function zt(e,t){return Zt(e,t)&&$t(e,t)?.some((({id:t})=>Ot(e,`meta-box-${t}`)))}function Zt(e,t){const n=$t(e,t);return!!n&&0!==n.length}function $t(e,t){return e.metaBoxes.locations[t]}const Wt=Pt((e=>Object.values(e.metaBoxes.locations).flat()),(e=>[e.metaBoxes.locations]));function qt(e){return Ut(e).length>0}function jt(e){return e.metaBoxes.isSaving}function Kt(e){return e.deviceType}function Yt(e){return!!e.blockInserterPanel}function Xt(e){const{rootClientId:t,insertionIndex:n,filterValue:o}=e.blockInserterPanel;return{rootClientId:t,insertionIndex:n,filterValue:o}}function Qt(e){return e.listViewPanel}function Jt(e){return e.isEditingTemplate}function en(e){return e.metaBoxes.initialized}const tn=(0,u.createRegistrySelector)((e=>()=>{const t=e(T.store).getEditedPostAttribute("template");if(t){const n=e(qe.store).getEntityRecords("postType","wp_template",{per_page:-1})?.find((e=>e.slug===t));return n?e(qe.store).getEditedEntityRecord("postType","wp_template",n.id):n}const n=e(T.store).getCurrentPost();return n.link?e(qe.store).__experimentalGetTemplateForLink(n.link):null})),nn="core/edit-post",on=(0,u.createReduxStore)(nn,{reducer:ze,actions:a,selectors:r});function an(){const e=(0,u.useSelect)((e=>e(on).isEditingTemplate()),[]);return(0,l.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:e?"welcomeGuideTemplate":"welcomeGuide",label:(0,b.__)("Welcome Guide")})}(0,u.register)(on),(0,k.registerPlugin)("edit-post",{render(){return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(He,null,(({onClose:e})=>(0,l.createElement)(l.Fragment,null,(0,l.createElement)(_.MenuItem,{role:"menuitem",href:(0,P.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,b.__)("Manage Patterns")),(0,l.createElement)(Oe,{onSelect:e}),(0,l.createElement)(an,null),(0,l.createElement)(x,null),(0,l.createElement)(_.MenuItem,{role:"menuitem",icon:S,href:(0,b.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,b.__)("Help"),(0,l.createElement)(_.VisuallyHidden,{as:"span"},(0,b.__)("(opens in a new tab)")))))))}});var rn=window.wp.commands,ln=window.wp.coreCommands;function sn(){const e=(0,u.useSelect)((e=>e(T.store).getEditorSettings().richEditingEnabled),[]),{switchEditorMode:t}=(0,u.useDispatch)(on);return(0,l.createElement)("div",{className:"edit-post-text-editor"},(0,l.createElement)(T.TextEditorGlobalKeyboardShortcuts,null),e&&(0,l.createElement)("div",{className:"edit-post-text-editor__toolbar"},(0,l.createElement)("h2",null,(0,b.__)("Editing code")),(0,l.createElement)(_.Button,{variant:"tertiary",onClick:()=>t("visual"),shortcut:M.displayShortcut.secondary("m")},(0,b.__)("Exit code editor"))),(0,l.createElement)("div",{className:"edit-post-text-editor__body"},(0,l.createElement)(T.PostTitle,null),(0,l.createElement)(T.PostTextEditor,null)))}var cn=window.wp.privateApis;const{lock:dn,unlock:un}=(0,cn.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/edit-post"),{LayoutStyle:mn,useLayoutClasses:pn,useLayoutStyles:gn}=un(E.privateApis);function hn({children:e,contentRef:t,shouldIframe:n,styles:o,style:a}){const r=(0,E.__unstableUseMouseMoveTypingReset)();return n?(0,l.createElement)(E.__unstableIframe,{ref:r,contentRef:t,style:{width:"100%",height:"100%",display:"block"},name:"editor-canvas"},(0,l.createElement)(E.__unstableEditorStyles,{styles:o}),e):(0,l.createElement)(l.Fragment,null,(0,l.createElement)(E.__unstableEditorStyles,{styles:o}),(0,l.createElement)(E.WritingFlow,{ref:t,className:"editor-styles-wrapper",style:{flex:"1",...a},tabIndex:-1},e))}function _n(e){for(let t=0;t<e.length;t++){if("core/post-content"===e[t].name)return e[t].attributes;if(e[t].innerBlocks.length){const n=_n(e[t].innerBlocks);if(n)return n}}}function En({styles:e}){const{deviceType:t,isWelcomeGuideVisible:n,isTemplateMode:o,postContentAttributes:a,editedPostTemplate:r={},wrapperBlockName:i,wrapperUniqueId:c,isBlockBasedTheme:d,hasV3BlocksOnly:m}=(0,u.useSelect)((e=>{const{isFeatureActive:t,isEditingTemplate:n,getEditedPostTemplate:o,__experimentalGetPreviewDeviceType:a}=e(on),{getCurrentPostId:r,getCurrentPostType:l,getEditorSettings:i}=e(T.store),{getBlockTypes:c}=e(s.store),d=n();let u;"wp_block"===l()?u="core/block":d||(u="core/post-content");const m=i(),p=m.supportsTemplateMode,g=e(qe.store).canUser("create","templates");return{deviceType:a(),isWelcomeGuideVisible:t("welcomeGuide"),isTemplateMode:d,postContentAttributes:i().postContentAttributes,editedPostTemplate:p&&g?o():void 0,wrapperBlockName:u,wrapperUniqueId:r(),isBlockBasedTheme:m.__unstableIsBlockBasedTheme,hasV3BlocksOnly:c().every((e=>e.apiVersion>=3))}}),[]),{isCleanNewPost:p}=(0,u.useSelect)(T.store),g=(0,u.useSelect)((e=>e(on).hasMetaBoxes()),[]),{hasRootPaddingAwareAlignments:h,isFocusMode:b,themeHasDisabledLayoutStyles:v,themeSupportsLayout:y}=(0,u.useSelect)((e=>{const t=e(E.store).getSettings();return{themeHasDisabledLayoutStyles:t.disableLayoutStyles,themeSupportsLayout:t.supportsLayout,isFocusMode:t.focusMode,hasRootPaddingAwareAlignments:t.__experimentalFeatures?.useRootPaddingAwareAlignments}}),[]),w={height:"100%",width:"100%",margin:0,display:"flex",flexFlow:"column",background:"white"},S={...w,borderRadius:"2px 2px 0 0",border:"1px solid #ddd",borderBottom:0},k=(0,E.__experimentalUseResizeCanvas)(t,o),P=(0,E.useSetting)("layout"),C="is-"+t.toLowerCase()+"-preview";let x,M=o?S:w;k&&(M=k),g||k||o||(x="40vh");const B=(0,l.useRef)(),N=(0,f.useMergeRefs)([B,(0,E.__unstableUseClipboardHandler)(),(0,E.__unstableUseTypewriter)(),(0,E.__unstableUseTypingObserver)(),(0,E.__unstableUseBlockSelectionClearer)()]),L=(0,E.__unstableUseBlockSelectionClearer)(),A=(0,l.useMemo)((()=>o?{type:"default"}:y?{...P,type:"constrained"}:{type:"default"}),[o,y,P]),D=(0,l.useMemo)((()=>{if(!r?.content&&!r?.blocks)return a;if(r?.blocks)return _n(r?.blocks);const e="string"==typeof r?.content?r?.content:"";return _n((0,s.parse)(e))||{}}),[r?.content,r?.blocks,a]),{layout:V={},align:O=""}=D||{},F=pn(D,"core/post-content"),R=I()({"is-layout-flow":!y},y&&F,O&&`align${O}`),H=gn(D,"core/post-content",".block-editor-block-list__layout.is-root-container"),G=(0,l.useMemo)((()=>V&&("constrained"===V?.type||V?.inherit||V?.contentSize||V?.wideSize)?{...P,...V,type:"constrained"}:{...P,...V,type:"default"}),[V?.type,V?.inherit,V?.contentSize,V?.wideSize,P]),U=a?G:A,z=(0,l.useRef)();(0,l.useEffect)((()=>{!n&&p()&&z?.current?.focus()}),[n,p]),e=(0,l.useMemo)((()=>[...e,{css:".edit-post-visual-editor__post-title-wrapper{margin-top:4rem}"+(x?`body{padding-bottom:${x}}`:"")}]),[e]);return(0,l.createElement)(E.BlockTools,{__unstableContentRef:B,className:I()("edit-post-visual-editor",{"is-template-mode":o})},(0,l.createElement)(T.VisualEditorGlobalKeyboardShortcuts,null),(0,l.createElement)(_.__unstableMotion.div,{className:"edit-post-visual-editor__content-area",animate:{padding:o?"48px 48px 0":0},ref:L},(0,l.createElement)(_.__unstableMotion.div,{animate:M,initial:w,className:C},(0,l.createElement)(hn,{shouldIframe:!!m&&!g||o||"Tablet"===t||"Mobile"===t,contentRef:N,styles:e},y&&!v&&!o&&(0,l.createElement)(l.Fragment,null,(0,l.createElement)(mn,{selector:".edit-post-visual-editor__post-title-wrapper",layout:A}),(0,l.createElement)(mn,{selector:".block-editor-block-list__layout.is-root-container",layout:U}),O&&(0,l.createElement)(mn,{css:".is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}"}),H&&(0,l.createElement)(mn,{layout:G,css:H})),!o&&(0,l.createElement)("div",{className:I()("edit-post-visual-editor__post-title-wrapper",{"is-focus-mode":b,"has-global-padding":h}),contentEditable:!1},(0,l.createElement)(T.PostTitle,{ref:z})),(0,l.createElement)(E.__experimentalRecursionProvider,{blockName:i,uniqueId:c},(0,l.createElement)(E.BlockList,{className:o?"wp-site-blocks":`${R} wp-block-post-content`,layout:U}))))))}var bn=function(){const{getBlockSelectionStart:e}=(0,u.useSelect)(E.store),{getEditorMode:t,isEditorSidebarOpened:n,isListViewOpened:o,isFeatureActive:a}=(0,u.useSelect)(on),r=(0,u.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:n}=e(T.store).getEditorSettings();return!t||!n}),[]),{createInfoNotice:i}=(0,u.useDispatch)(C.store),{switchEditorMode:c,openGeneralSidebar:d,closeGeneralSidebar:m,toggleFeature:g,setIsListViewOpened:h,setIsInserterOpened:_}=(0,u.useDispatch)(on),{registerShortcut:f}=(0,u.useDispatch)(Te.store),{set:v}=(0,u.useDispatch)(p.store),{replaceBlocks:y}=(0,u.useDispatch)(E.store),{getBlockName:w,getSelectedBlockClientId:S,getBlockAttributes:k}=(0,u.useSelect)(E.store),P=(e,t)=>{e.preventDefault();const n=0===t?"core/paragraph":"core/heading",o=S();if(null===o)return;const a=w(o);if("core/paragraph"!==a&&"core/heading"!==a)return;const r=k(o),l="core/paragraph"===a?"align":"textAlign",i="core/paragraph"===n?"align":"textAlign";y(o,(0,s.createBlock)(n,{level:t,content:r.content,[i]:r[l]}))};return(0,l.useEffect)((()=>{f({name:"core/edit-post/toggle-mode",category:"global",description:(0,b.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),f({name:"core/edit-post/toggle-distraction-free",category:"global",description:(0,b.__)("Toggle distraction free mode."),keyCombination:{modifier:"primaryShift",character:"\\"}}),f({name:"core/edit-post/toggle-fullscreen",category:"global",description:(0,b.__)("Toggle fullscreen mode."),keyCombination:{modifier:"secondary",character:"f"}}),f({name:"core/edit-post/toggle-list-view",category:"global",description:(0,b.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}}),f({name:"core/edit-post/toggle-sidebar",category:"global",description:(0,b.__)("Show or hide the Settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),f({name:"core/edit-post/next-region",category:"global",description:(0,b.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),f({name:"core/edit-post/previous-region",category:"global",description:(0,b.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]}),f({name:"core/edit-post/keyboard-shortcuts",category:"main",description:(0,b.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),f({name:"core/edit-post/transform-heading-to-paragraph",category:"block-library",description:(0,b.__)("Transform heading to paragraph."),keyCombination:{modifier:"access",character:"0"}}),[1,2,3,4,5,6].forEach((e=>{f({name:`core/edit-post/transform-paragraph-to-heading-${e}`,category:"block-library",description:(0,b.__)("Transform paragraph to heading."),keyCombination:{modifier:"access",character:`${e}`}})}))}),[]),(0,Te.useShortcut)("core/edit-post/toggle-mode",(()=>{c("visual"===t()?"text":"visual")}),{isDisabled:r}),(0,Te.useShortcut)("core/edit-post/toggle-fullscreen",(()=>{g("fullscreenMode")})),(0,Te.useShortcut)("core/edit-post/toggle-distraction-free",(()=>{v("core/edit-post","fixedToolbar",!1),_(!1),h(!1),m(),g("distractionFree"),i(a("distractionFree")?(0,b.__)("Distraction free mode turned on."):(0,b.__)("Distraction free mode turned off."),{id:"core/edit-post/distraction-free-mode/notice",type:"snackbar"})})),(0,Te.useShortcut)("core/edit-post/toggle-sidebar",(t=>{if(t.preventDefault(),n())m();else{const t=e()?"edit-post/block":"edit-post/document";d(t)}})),(0,Te.useShortcut)("core/edit-post/toggle-list-view",(()=>{o()||h(!0)})),(0,Te.useShortcut)("core/edit-post/transform-heading-to-paragraph",(e=>P(e,0))),[1,2,3,4,5,6].forEach((e=>{(0,Te.useShortcut)(`core/edit-post/transform-paragraph-to-heading-${e}`,(t=>P(t,e)))})),null};function fn({willEnable:e}){const[t,n]=(0,l.useState)(!1);return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("p",{className:"edit-post-preferences-modal__custom-fields-confirmation-message"},(0,b.__)("A page reload is required for this change. Make sure your content is saved before reloading.")),(0,l.createElement)(_.Button,{className:"edit-post-preferences-modal__custom-fields-confirmation-button",variant:"secondary",isBusy:t,disabled:t,onClick:()=>{n(!0),document.getElementById("toggle-custom-fields-form").submit()}},e?(0,b.__)("Show & Reload Page"):(0,b.__)("Hide & Reload Page")))}var vn=(0,u.withSelect)((e=>({areCustomFieldsEnabled:!!e(T.store).getEditorSettings().enableCustomFields})))((function({label:e,areCustomFieldsEnabled:t}){const[n,o]=(0,l.useState)(t);return(0,l.createElement)(Ce,{label:e,isChecked:n,onChange:o},n!==t&&(0,l.createElement)(fn,{willEnable:n}))})),yn=(0,f.compose)((0,u.withSelect)(((e,{panelName:t})=>{const{isEditorPanelEnabled:n,isEditorPanelRemoved:o}=e(on);return{isRemoved:o(t),isChecked:n(t)}})),(0,f.ifCondition)((({isRemoved:e})=>!e)),(0,u.withDispatch)(((e,{panelName:t})=>({onChange:()=>e(on).toggleEditorPanelEnabled(t)}))))(Ce);const{Fill:wn,Slot:Sn}=(0,_.createSlotFill)("EnablePluginDocumentSettingPanelOption"),kn=({label:e,panelName:t})=>(0,l.createElement)(wn,null,(0,l.createElement)(yn,{label:e,panelName:t}));kn.Slot=Sn;var Pn=kn,Cn=(0,f.compose)((0,u.withSelect)((e=>({isChecked:e(T.store).isPublishSidebarEnabled()}))),(0,u.withDispatch)((e=>{const{enablePublishSidebar:t,disablePublishSidebar:n}=e(T.store);return{onChange:e=>e?t():n()}})),(0,D.ifViewportMatches)("medium"))(Ce),Tn=(0,f.compose)((0,u.withSelect)(((e,{featureName:t})=>{const{isFeatureActive:n}=e(on);return{isChecked:n(t)}})),(0,u.withDispatch)(((e,{featureName:t,onToggle:n=(()=>{})})=>({onChange:()=>{n(),e(on).toggleFeature(t)}}))))(Ce);var xn=(0,u.withSelect)((e=>{const{getEditorSettings:t}=e(T.store),{getAllMetaBoxes:n}=e(on);return{areCustomFieldsRegistered:void 0!==t().enableCustomFields,metaBoxes:n()}}))((function({areCustomFieldsRegistered:e,metaBoxes:t,...n}){const o=t.filter((({id:e})=>"postcustom"!==e));return e||0!==o.length?(0,l.createElement)(Pe,{...n},e&&(0,l.createElement)(vn,{label:(0,b.__)("Custom fields")}),o.map((({id:e,title:t})=>(0,l.createElement)(yn,{key:e,label:t,panelName:`meta-box-${e}`})))):null}));var Mn=function({blockTypes:e,value:t,onItemChange:n}){return(0,l.createElement)("ul",{className:"edit-post-block-manager__checklist"},e.map((e=>(0,l.createElement)("li",{key:e.name,className:"edit-post-block-manager__checklist-item"},(0,l.createElement)(_.CheckboxControl,{__nextHasNoMarginBottom:!0,label:e.title,checked:t.includes(e.name),onChange:(...t)=>n(e.name,...t)}),(0,l.createElement)(E.BlockIcon,{icon:e.icon})))))};var Bn=function e({title:t,blockTypes:n}){const o=(0,f.useInstanceId)(e),{defaultAllowedBlockTypes:a,hiddenBlockTypes:r}=(0,u.useSelect)((e=>{const{getEditorSettings:t}=e(T.store),{getHiddenBlockTypes:n}=e(on);return{defaultAllowedBlockTypes:t().defaultAllowedBlockTypes,hiddenBlockTypes:n()}}),[]),s=(0,l.useMemo)((()=>!0===a?n:n.filter((({name:e})=>a?.includes(e)))),[a,n]),{showBlockTypes:i,hideBlockTypes:c}=(0,u.useDispatch)(on),d=(0,l.useCallback)(((e,t)=>{t?i(e):c(e)}),[]),m=(0,l.useCallback)((e=>{const t=n.map((({name:e})=>e));e?i(t):c(t)}),[n]);if(!s.length)return null;const p=s.map((({name:e})=>e)).filter((e=>!r.includes(e))),g="edit-post-block-manager__category-title-"+o,h=p.length===s.length,E=!h&&p.length>0;return(0,l.createElement)("div",{role:"group","aria-labelledby":g,className:"edit-post-block-manager__category"},(0,l.createElement)(_.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:h,onChange:m,className:"edit-post-block-manager__category-title",indeterminate:E,label:(0,l.createElement)("span",{id:g},t)}),(0,l.createElement)(Mn,{blockTypes:s,value:p,onItemChange:d}))};var In=(0,f.compose)([(0,u.withSelect)((e=>{const{getBlockTypes:t,getCategories:n,hasBlockSupport:o,isMatchingSearchTerm:a}=e(s.store),{getHiddenBlockTypes:r}=e(on),l=t(),i=r().filter((e=>l.some((t=>t.name===e)))),c=Array.isArray(i)&&i.length;return{blockTypes:l,categories:n(),hasBlockSupport:o,isMatchingSearchTerm:a,numberOfHiddenBlocks:c}})),(0,u.withDispatch)((e=>{const{showBlockTypes:t}=e(on);return{enableAllBlockTypes:e=>{const n=e.map((({name:e})=>e));t(n)}}}))])((function({blockTypes:e,categories:t,hasBlockSupport:n,isMatchingSearchTerm:o,numberOfHiddenBlocks:a,enableAllBlockTypes:r}){const s=(0,f.useDebounce)(We.speak,500),[i,c]=(0,l.useState)("");return e=e.filter((e=>n(e,"inserter",!0)&&(!i||o(e,i))&&(!e.parent||e.parent.includes("core/post-content")))),(0,l.useEffect)((()=>{if(!i)return;const t=e.length,n=(0,b.sprintf)((0,b._n)("%d result found.","%d results found.",t),t);s(n)}),[e.length,i,s]),(0,l.createElement)("div",{className:"edit-post-block-manager__content"},!!a&&(0,l.createElement)("div",{className:"edit-post-block-manager__disabled-blocks-count"},(0,b.sprintf)((0,b._n)("%d block is hidden.","%d blocks are hidden.",a),a),(0,l.createElement)(_.Button,{variant:"link",onClick:()=>r(e)},(0,b.__)("Reset"))),(0,l.createElement)(_.SearchControl,{__nextHasNoMarginBottom:!0,label:(0,b.__)("Search for a block"),placeholder:(0,b.__)("Search for a block"),value:i,onChange:e=>c(e),className:"edit-post-block-manager__search"}),(0,l.createElement)("div",{tabIndex:"0",role:"region","aria-label":(0,b.__)("Available block types"),className:"edit-post-block-manager__results"},0===e.length&&(0,l.createElement)("p",{className:"edit-post-block-manager__no-results"},(0,b.__)("No blocks found.")),t.map((t=>(0,l.createElement)(Bn,{key:t.slug,title:t.title,blockTypes:e.filter((e=>e.category===t.slug))}))),(0,l.createElement)(Bn,{title:(0,b.__)("Uncategorized"),blockTypes:e.filter((({category:e})=>!e))})))}));const Nn="edit-post/preferences";function Ln(){const e=(0,f.useViewportMatch)("medium"),{closeModal:t}=(0,u.useDispatch)(J),[n,o]=(0,u.useSelect)((t=>{const{getEditorSettings:n}=t(T.store),{getEditorMode:o,isFeatureActive:a}=t(on),r=t(J).isModalActive(Nn),l=o(),s=n().richEditingEnabled,i=a("distractionFree");return[r,!i&&e&&s&&"visual"===l,i]}),[e]),{closeGeneralSidebar:a,setIsListViewOpened:r,setIsInserterOpened:s}=(0,u.useDispatch)(on),{set:i}=(0,u.useDispatch)(p.store),c=()=>{i("core/edit-post","fixedToolbar",!1),s(!1),r(!1),a()},d=(0,l.useMemo)((()=>[{name:"general",tabLabel:(0,b.__)("General"),content:(0,l.createElement)(l.Fragment,null,e&&(0,l.createElement)(Pe,{title:(0,b.__)("Publishing"),description:(0,b.__)("Change options related to publishing.")},(0,l.createElement)(Cn,{help:(0,b.__)("Review settings, such as visibility and tags."),label:(0,b.__)("Include pre-publish checklist")})),(0,l.createElement)(Pe,{title:(0,b.__)("Appearance"),description:(0,b.__)("Customize options related to the block editor interface and editing flow.")},(0,l.createElement)(Tn,{featureName:"distractionFree",onToggle:c,help:(0,b.__)("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:(0,b.__)("Distraction free")}),(0,l.createElement)(Tn,{featureName:"focusMode",help:(0,b.__)("Highlights the current block and fades other content."),label:(0,b.__)("Spotlight mode")}),(0,l.createElement)(Tn,{featureName:"showIconLabels",label:(0,b.__)("Show button text labels"),help:(0,b.__)("Show text instead of icons on buttons.")}),(0,l.createElement)(Tn,{featureName:"showListViewByDefault",help:(0,b.__)("Opens the block list view sidebar by default."),label:(0,b.__)("Always open list view")}),(0,l.createElement)(Tn,{featureName:"themeStyles",help:(0,b.__)("Make the editor look like your theme."),label:(0,b.__)("Use theme styles")}),o&&(0,l.createElement)(Tn,{featureName:"showBlockBreadcrumbs",help:(0,b.__)("Shows block breadcrumbs at the bottom of the editor."),label:(0,b.__)("Display block breadcrumbs")})))},{name:"blocks",tabLabel:(0,b.__)("Blocks"),content:(0,l.createElement)(l.Fragment,null,(0,l.createElement)(Pe,{title:(0,b.__)("Block interactions"),description:(0,b.__)("Customize how you interact with blocks in the block library and editing canvas.")},(0,l.createElement)(Tn,{featureName:"mostUsedBlocks",help:(0,b.__)("Places the most frequent blocks in the block library."),label:(0,b.__)("Show most used blocks")}),(0,l.createElement)(Tn,{featureName:"keepCaretInsideBlock",help:(0,b.__)("Aids screen readers by stopping text caret from leaving blocks."),label:(0,b.__)("Contain text cursor inside block")})),(0,l.createElement)(Pe,{title:(0,b.__)("Visible blocks"),description:(0,b.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")},(0,l.createElement)(In,null)))},{name:"panels",tabLabel:(0,b.__)("Panels"),content:(0,l.createElement)(l.Fragment,null,(0,l.createElement)(Pe,{title:(0,b.__)("Document settings"),description:(0,b.__)("Choose what displays in the panel.")},(0,l.createElement)(Pn.Slot,null),(0,l.createElement)(T.PostTaxonomies,{taxonomyWrapper:(e,t)=>(0,l.createElement)(yn,{label:t.labels.menu_name,panelName:`taxonomy-panel-${t.slug}`})}),(0,l.createElement)(T.PostFeaturedImageCheck,null,(0,l.createElement)(yn,{label:(0,b.__)("Featured image"),panelName:"featured-image"})),(0,l.createElement)(T.PostExcerptCheck,null,(0,l.createElement)(yn,{label:(0,b.__)("Excerpt"),panelName:"post-excerpt"})),(0,l.createElement)(T.PostTypeSupportCheck,{supportKeys:["comments","trackbacks"]},(0,l.createElement)(yn,{label:(0,b.__)("Discussion"),panelName:"discussion-panel"})),(0,l.createElement)(T.PageAttributesCheck,null,(0,l.createElement)(yn,{label:(0,b.__)("Page attributes"),panelName:"page-attributes"}))),(0,l.createElement)(xn,{title:(0,b.__)("Additional"),description:(0,b.__)("Add extra areas to the editor.")}))}]),[e,o]);return n?(0,l.createElement)(fe,{closeModal:t},(0,l.createElement)(ke,{sections:d})):null}class An extends l.Component{constructor(){super(...arguments),this.state={historyId:null}}componentDidUpdate(e){const{postId:t,postStatus:n,postType:o,isSavingPost:a}=this.props,{historyId:r}=this.state;"trash"!==n||a?t===e.postId&&t===r||"auto-draft"===n||!t||this.setBrowserURL(t):this.setTrashURL(t,o)}setTrashURL(e,t){window.location.href=function(e,t){return(0,P.addQueryArgs)("edit.php",{trashed:1,post_type:t,ids:e})}(e,t)}setBrowserURL(e){window.history.replaceState({id:e},"Post "+e,function(e){return(0,P.addQueryArgs)("post.php",{post:e,action:"edit"})}(e)),this.setState((()=>({historyId:e})))}render(){return null}}var Dn=(0,u.withSelect)((e=>{const{getCurrentPost:t,isSavingPost:n}=e(T.store),o=t();let{id:a,status:r,type:l}=o;return["wp_template","wp_template_part"].includes(l)&&(a=o.wp_id),{postId:a,postStatus:r,postType:l,isSavingPost:n()}}))(An);var Vn=(0,l.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,l.createElement)(w.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"}));var On=function({showTooltip:e,icon:t,href:n}){var o;const{isActive:a,isRequestingSiteIcon:r,postType:s,siteIconUrl:i}=(0,u.useSelect)((e=>{const{getCurrentPostType:t}=e(T.store),{isFeatureActive:n}=e(on),{getEntityRecord:o,getPostType:a,isResolving:r}=e(qe.store),l=o("root","__unstableBase",void 0)||{};return{isActive:n("fullscreenMode"),isRequestingSiteIcon:r("getEntityRecord",["root","__unstableBase",void 0]),postType:a(t()),siteIconUrl:l.site_icon_url}}),[]),c=(0,f.useReducedMotion)();if(!a||!s)return null;let d=(0,l.createElement)(_.Icon,{size:"36px",icon:Vn});const m={expand:{scale:1.25,transition:{type:"tween",duration:"0.3"}}};i&&(d=(0,l.createElement)(_.__unstableMotion.img,{variants:!c&&m,alt:(0,b.__)("Site Icon"),className:"edit-post-fullscreen-mode-close_site-icon",src:i})),r&&(d=null),t&&(d=(0,l.createElement)(_.Icon,{size:"36px",icon:t}));const p=I()({"edit-post-fullscreen-mode-close":!0,"has-icon":i});return(0,l.createElement)(_.__unstableMotion.div,{whileHover:"expand"},(0,l.createElement)(_.Button,{className:p,href:null!=n?n:(0,P.addQueryArgs)("edit.php",{post_type:s.slug}),label:null!==(o=s?.labels?.view_items)&&void 0!==o?o:(0,b.__)("Back"),showTooltip:e},d))};var Fn=(0,l.createElement)(w.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,l.createElement)(w.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"}));var Rn=(0,l.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(w.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const{useShouldContextualToolbarShow:Hn}=un(E.privateApis),Gn=e=>{e.preventDefault()};var Un=function(){const e=(0,l.useRef)(),{setIsInserterOpened:t,setIsListViewOpened:n}=(0,u.useDispatch)(on),{isInserterEnabled:o,isInserterOpened:a,isTextModeEnabled:r,showIconLabels:s,isListViewOpen:i,listViewShortcut:c}=(0,u.useSelect)((e=>{const{hasInserterItems:t,getBlockRootClientId:n,getBlockSelectionEnd:o}=e(E.store),{getEditorSettings:a}=e(T.store),{getEditorMode:r,isFeatureActive:l,isListViewOpened:s}=e(on),{getShortcutRepresentation:i}=e(Te.store);return{isInserterEnabled:"visual"===r()&&a().richEditingEnabled&&t(n(o())),isInserterOpened:e(on).isInserterOpened(),isTextModeEnabled:"text"===r(),showIconLabels:l("showIconLabels"),isListViewOpen:s(),listViewShortcut:i("core/edit-post/toggle-list-view")}}),[]),d=(0,f.useViewportMatch)("medium"),m=(0,f.useViewportMatch)("wide"),{shouldShowContextualToolbar:p,canFocusHiddenToolbar:g,fixedToolbarCanBeFocused:h}=Hn(),v=p||g||h,y=(0,b.__)("Document tools"),w=(0,l.useCallback)((()=>n(!i)),[n,i]),S=(0,l.createElement)(l.Fragment,null,(0,l.createElement)(_.ToolbarItem,{as:_.Button,className:"edit-post-header-toolbar__document-overview-toggle",icon:Fn,disabled:r,isPressed:i,label:(0,b.__)("Document Overview"),onClick:w,shortcut:c,showTooltip:!s,variant:s?"tertiary":void 0})),k=(0,l.useCallback)((()=>{a?(e.current.focus(),t(!1)):t(!0)}),[a,t]),P=(0,b._x)("Toggle block inserter","Generic label for block inserter button"),C=a?(0,b.__)("Close"):(0,b.__)("Add");return(0,l.createElement)(E.NavigableToolbar,{className:"edit-post-header-toolbar","aria-label":y,shouldUseKeyboardFocusShortcut:!v},(0,l.createElement)("div",{className:"edit-post-header-toolbar__left"},(0,l.createElement)(_.ToolbarItem,{ref:e,as:_.Button,className:"edit-post-header-toolbar__inserter-toggle",variant:"primary",isPressed:a,onMouseDown:Gn,onClick:k,disabled:!o,icon:Rn,label:s?C:P,showTooltip:!s}),(m||!s)&&(0,l.createElement)(l.Fragment,null,d&&(0,l.createElement)(_.ToolbarItem,{as:E.ToolSelector,showTooltip:!s,variant:s?"tertiary":void 0,disabled:r}),(0,l.createElement)(_.ToolbarItem,{as:T.EditorHistoryUndo,showTooltip:!s,variant:s?"tertiary":void 0}),(0,l.createElement)(_.ToolbarItem,{as:T.EditorHistoryRedo,showTooltip:!s,variant:s?"tertiary":void 0}),S)))};const zn=[{value:"visual",label:(0,b.__)("Visual editor")},{value:"text",label:(0,b.__)("Code editor")}];var Zn=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:n,isEditingTemplate:o,mode:a}=(0,u.useSelect)((e=>({shortcut:e(Te.store).getShortcutRepresentation("core/edit-post/toggle-mode"),isRichEditingEnabled:e(T.store).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(T.store).getEditorSettings().codeEditingEnabled,isEditingTemplate:e(on).isEditingTemplate(),mode:e(on).getEditorMode()})),[]),{switchEditorMode:r}=(0,u.useDispatch)(on);if(o)return null;if(!t||!n)return null;const s=zn.map((t=>t.value!==a?{...t,shortcut:e}:t));return(0,l.createElement)(_.MenuGroup,{label:(0,b.__)("Editor")},(0,l.createElement)(_.MenuItemsChoice,{choices:s,value:a,onSelect:r}))};function $n(){const{openModal:e}=(0,u.useDispatch)(J);return(0,l.createElement)(_.MenuItem,{onClick:()=>{e(Nn)}},(0,b.__)("Preferences"))}var Wn=function(){const e=(0,u.useRegistry)(),t=(0,u.useSelect)((e=>e(E.store).getSettings().isDistractionFree),[]),{setIsInserterOpened:n,setIsListViewOpened:o,closeGeneralSidebar:a}=(0,u.useDispatch)(on),{set:r}=(0,u.useDispatch)(p.store);return(0,f.useViewportMatch)("medium")?(0,l.createElement)(_.MenuGroup,{label:(0,b._x)("View","noun")},(0,l.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",disabled:t,name:"fixedToolbar",label:(0,b.__)("Top toolbar"),info:(0,b.__)("Access all block and document tools in a single place"),messageActivated:(0,b.__)("Top toolbar activated"),messageDeactivated:(0,b.__)("Top toolbar deactivated")}),(0,l.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"focusMode",label:(0,b.__)("Spotlight mode"),info:(0,b.__)("Focus on one block at a time"),messageActivated:(0,b.__)("Spotlight mode activated"),messageDeactivated:(0,b.__)("Spotlight mode deactivated")}),(0,l.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fullscreenMode",label:(0,b.__)("Fullscreen mode"),info:(0,b.__)("Show and hide admin UI"),messageActivated:(0,b.__)("Fullscreen mode activated"),messageDeactivated:(0,b.__)("Fullscreen mode deactivated"),shortcut:M.displayShortcut.secondary("f")}),(0,l.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"distractionFree",onToggle:()=>{e.batch((()=>{r("core/edit-post","fixedToolbar",!1),n(!1),o(!1),a()}))},label:(0,b.__)("Distraction free"),info:(0,b.__)("Write with calmness"),messageActivated:(0,b.__)("Distraction free mode activated"),messageDeactivated:(0,b.__)("Distraction free mode deactivated"),shortcut:M.displayShortcut.primaryShift("\\")})):null};var qn=({showIconLabels:e})=>{const t=(0,f.useViewportMatch)("large");return(0,l.createElement)(be,{toggleProps:{showTooltip:!e,...e&&{variant:"tertiary"}}},(({onClose:n})=>(0,l.createElement)(l.Fragment,null,e&&!t&&(0,l.createElement)(ce.Slot,{className:e&&"show-icon-labels",scope:"core/edit-post"}),(0,l.createElement)(Wn,null),(0,l.createElement)(Zn,null),(0,l.createElement)(re.Slot,{name:"core/edit-post/plugin-more-menu",label:(0,b.__)("Plugins"),as:_.MenuGroup,fillProps:{onClick:n}}),(0,l.createElement)(He.Slot,{fillProps:{onClose:n}}),(0,l.createElement)(_.MenuGroup,null,(0,l.createElement)($n,null)))))};var jn=(0,f.compose)((0,u.withSelect)((e=>{var t;return{hasPublishAction:null!==(t=e(T.store).getCurrentPost()?._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:e(T.store).isEditedPostBeingScheduled(),isPending:e(T.store).isCurrentPostPending(),isPublished:e(T.store).isCurrentPostPublished(),isPublishSidebarEnabled:e(T.store).isPublishSidebarEnabled(),isPublishSidebarOpened:e(on).isPublishSidebarOpened(),isScheduled:e(T.store).isCurrentPostScheduled()}})),(0,u.withDispatch)((e=>{const{togglePublishSidebar:t}=e(on);return{togglePublishSidebar:t}})))((function({forceIsDirty:e,forceIsSaving:t,hasPublishAction:n,isBeingScheduled:o,isPending:a,isPublished:r,isPublishSidebarEnabled:s,isPublishSidebarOpened:i,isScheduled:c,togglePublishSidebar:d,setEntitiesSavedStatesCallback:u}){const m="toggle",p="button",g=(0,f.useViewportMatch)("medium","<");let h;return h=r||c&&o||a&&!n&&!g?p:g||s?m:p,(0,l.createElement)(T.PostPublishButton,{forceIsDirty:e,forceIsSaving:t,isOpen:i,isToggle:h===m,onToggle:d,setEntitiesSavedStatesCallback:u})}));function Kn(){const{hasActiveMetaboxes:e,isPostSaveable:t,isSaving:n,isViewable:o,deviceType:a}=(0,u.useSelect)((e=>{var t;const{getEditedPostAttribute:n}=e(T.store),{getPostType:o}=e(qe.store),a=o(n("type"));return{hasActiveMetaboxes:e(on).hasMetaBoxes(),isSaving:e(on).isSavingMetaBoxes(),isPostSaveable:e(T.store).isEditedPostSaveable(),isViewable:null!==(t=a?.viewable)&&void 0!==t&&t,deviceType:e(on).__experimentalGetPreviewDeviceType()}}),[]),{__experimentalSetPreviewDeviceType:r}=(0,u.useDispatch)(on);return(0,l.createElement)(E.__experimentalPreviewOptions,{isEnabled:t,className:"edit-post-post-preview-dropdown",deviceType:a,setDeviceType:r,label:(0,b.__)("Preview")},o&&(0,l.createElement)(_.MenuGroup,null,(0,l.createElement)("div",{className:"edit-post-header-preview__grouping-external"},(0,l.createElement)(T.PostPreviewButton,{className:"edit-post-header-preview__button-external",role:"menuitem",forceIsAutosaveable:e,forcePreviewLink:n?null:void 0,textContent:(0,l.createElement)(l.Fragment,null,(0,b.__)("Preview in new tab"),(0,l.createElement)(_.Icon,{icon:S}))}))))}function Yn(){const{permalink:e,isPublished:t,label:n}=(0,u.useSelect)((e=>{const t=e(T.store).getCurrentPostType(),n=e(qe.store).getPostType(t);return{permalink:e(T.store).getPermalink(),isPublished:e(T.store).isCurrentPostPublished(),label:n?.labels.view_item}}),[]);return t&&e?(0,l.createElement)(_.Button,{icon:S,label:n||(0,b.__)("View post"),href:e,target:"_blank"}):null}const Xn="__experimentalMainDashboardButton",{Fill:Qn,Slot:Jn}=(0,_.createSlotFill)(Xn),eo=Qn;eo.Slot=({children:e})=>{const t=(0,_.__experimentalUseSlotFills)(Xn);return Boolean(t&&t.length)?(0,l.createElement)(Jn,{bubblesVirtually:!0}):e};var to=eo;var no=(0,l.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(w.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"}));var oo=(0,l.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(w.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"}));var ao=(0,l.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(w.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));var ro=function(){const{template:e,isEditing:t}=(0,u.useSelect)((e=>{const{isEditingTemplate:t,getEditedPostTemplate:n}=e(on),o=t();return{template:o?n():null,isEditing:o}}),[]),{clearSelectedBlock:n}=(0,u.useDispatch)(E.store),{setIsEditingTemplate:o}=(0,u.useDispatch)(on),{open:a}=(0,u.useDispatch)(rn.store);if(!t||!e)return null;let r=(0,b.__)("Default");return e?.title?r=e.title:e&&(r=e.slug),(0,l.createElement)("div",{className:"edit-post-document-title"},(0,l.createElement)("span",{className:"edit-post-document-title__left"},(0,l.createElement)(_.Button,{onClick:()=>{n(),o(!1)},icon:(0,b.isRTL)()?no:oo},(0,b.__)("Back"))),(0,l.createElement)(_.Button,{className:"edit-post-document-title__title",onClick:()=>a()},(0,l.createElement)(_.__experimentalHStack,{spacing:1,justify:"center"},(0,l.createElement)(E.BlockIcon,{icon:ao}),(0,l.createElement)(_.__experimentalText,{size:"body",as:"h1"},(0,l.createElement)(_.VisuallyHidden,{as:"span"},(0,b.__)("Editing template: ")),r))),(0,l.createElement)(_.Button,{className:"edit-post-document-title__shortcut",onClick:()=>a()},M.displayShortcut.primary("k")))};const lo={hidden:{y:"-50px"},hover:{y:0,transition:{type:"tween",delay:.2}}},so={hidden:{x:"-100%"},hover:{x:0,transition:{type:"tween",delay:.2}}};var io=function({setEntitiesSavedStatesCallback:e}){const t=(0,f.useViewportMatch)("large"),{hasActiveMetaboxes:n,isPublishSidebarOpened:o,isSaving:a,showIconLabels:r}=(0,u.useSelect)((e=>({hasActiveMetaboxes:e(on).hasMetaBoxes(),isPublishSidebarOpened:e(on).isPublishSidebarOpened(),isSaving:e(on).isSavingMetaBoxes(),showIconLabels:e(on).isFeatureActive("showIconLabels")})),[]);return(0,l.createElement)("div",{className:"edit-post-header"},(0,l.createElement)(to.Slot,null,(0,l.createElement)(_.__unstableMotion.div,{variants:so,transition:{type:"tween",delay:.8}},(0,l.createElement)(On,{showTooltip:!0}))),(0,l.createElement)(_.__unstableMotion.div,{variants:lo,transition:{type:"tween",delay:.8},className:"edit-post-header__toolbar"},(0,l.createElement)(Un,null),(0,l.createElement)("div",{className:"edit-post-header__document-title"},(0,l.createElement)(ro,null))),(0,l.createElement)(_.__unstableMotion.div,{variants:lo,transition:{type:"tween",delay:.8},className:"edit-post-header__settings"},!o&&(0,l.createElement)(T.PostSavedState,{forceIsDirty:n,forceIsSaving:a,showIconLabels:r}),(0,l.createElement)(Kn,null),(0,l.createElement)(T.PostPreviewButton,{forceIsAutosaveable:n,forcePreviewLink:a?null:void 0}),(0,l.createElement)(Yn,null),(0,l.createElement)(jn,{forceIsDirty:n,forceIsSaving:a,setEntitiesSavedStatesCallback:e}),(t||!r)&&(0,l.createElement)(l.Fragment,null,(0,l.createElement)(ce.Slot,{scope:"core/edit-post"}),(0,l.createElement)(qn,{showIconLabels:r})),r&&!t&&(0,l.createElement)(qn,{showIconLabels:r})))};var co=(0,l.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(w.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function uo(){const{insertionPoint:e,showMostUsedBlocks:t}=(0,u.useSelect)((e=>{const{isFeatureActive:t,__experimentalGetInsertionPoint:n}=e(on);return{insertionPoint:n(),showMostUsedBlocks:t("mostUsedBlocks")}}),[]),{setIsInserterOpened:n}=(0,u.useDispatch)(on),o=(0,f.useViewportMatch)("medium","<"),a=o?"div":_.VisuallyHidden,[r,s]=(0,f.__experimentalUseDialog)({onClose:()=>n(!1),focusOnMount:null}),i=(0,l.useRef)();return(0,l.useEffect)((()=>{i.current.focusSearch()}),[]),(0,l.createElement)("div",{ref:r,...s,className:"edit-post-editor__inserter-panel"},(0,l.createElement)(a,{className:"edit-post-editor__inserter-panel-header"},(0,l.createElement)(_.Button,{icon:co,label:(0,b.__)("Close block inserter"),onClick:()=>n(!1)})),(0,l.createElement)("div",{className:"edit-post-editor__inserter-panel-content"},(0,l.createElement)(E.__experimentalLibrary,{showMostUsedBlocks:t,showInserterHelpPanel:!0,shouldFocusBlock:o,rootClientId:e.rootClientId,__experimentalInsertionIndex:e.insertionIndex,__experimentalFilterValue:e.filterValue,ref:i})))}var mo=window.wp.dom;function po(){return(0,l.createElement)(_.SVG,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,l.createElement)(_.Rect,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),(0,l.createElement)(_.Line,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),(0,l.createElement)(_.Rect,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),(0,l.createElement)(_.Path,{d:"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z",fill:"black"}),(0,l.createElement)(_.Line,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),(0,l.createElement)(_.Rect,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,l.createElement)(_.Path,{d:"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z",fill:"black"}),(0,l.createElement)(_.Line,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),(0,l.createElement)(_.Rect,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),(0,l.createElement)(_.Path,{d:"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z",fill:"black"}),(0,l.createElement)(_.Line,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),(0,l.createElement)(_.Rect,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,l.createElement)(_.Path,{d:"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z",fill:"black"}))}function go(){const{headingCount:e}=(0,u.useSelect)((e=>{const{getGlobalBlockCount:t}=e(E.store);return{headingCount:t("core/heading")}}),[]);return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",{className:"edit-post-editor__list-view-overview"},(0,l.createElement)("div",null,(0,l.createElement)(_.__experimentalText,null,(0,b.__)("Characters:")),(0,l.createElement)(_.__experimentalText,null,(0,l.createElement)(T.CharacterCount,null))),(0,l.createElement)("div",null,(0,l.createElement)(_.__experimentalText,null,(0,b.__)("Words:")),(0,l.createElement)(T.WordCount,null)),(0,l.createElement)("div",null,(0,l.createElement)(_.__experimentalText,null,(0,b.__)("Time to read:")),(0,l.createElement)(T.TimeToRead,null))),e>0?(0,l.createElement)(T.DocumentOutline,null):(0,l.createElement)("div",{className:"edit-post-editor__list-view-empty-headings"},(0,l.createElement)(po,null),(0,l.createElement)("p",null,(0,b.__)("Navigate the structure of your document and address issues like empty or incorrect heading levels."))))}function ho(){const{setIsListViewOpened:e}=(0,u.useDispatch)(on),t=(0,f.useFocusOnMount)("firstElement"),n=(0,f.useFocusReturn)(),o=(0,f.useFocusReturn)();const[a,r]=(0,l.useState)(null),[s,i]=(0,l.useState)("list-view"),c=(0,l.useRef)(),d=(0,l.useRef)(),m=(0,l.useRef)(),p=(0,f.useMergeRefs)([o,t,m,r]);return(0,Te.useShortcut)("core/edit-post/toggle-list-view",(()=>{c.current.contains(c.current.ownerDocument.activeElement)?e(!1):function(e){const t=mo.focus.tabbable.find(d.current)[0];if("list-view"===e){const e=mo.focus.tabbable.find(m.current)[0];(c.current.contains(e)?e:t).focus()}else t.focus()}(s)})),(0,l.createElement)("div",{className:"edit-post-editor__document-overview-panel",onKeyDown:function(t){t.keyCode!==M.ESCAPE||t.defaultPrevented||(t.preventDefault(),e(!1))},ref:c},(0,l.createElement)(_.Button,{className:"edit-post-editor__document-overview-panel__close-button",ref:n,icon:V,label:(0,b.__)("Close"),onClick:()=>e(!1)}),(0,l.createElement)(_.TabPanel,{className:"edit-post-editor__document-overview-panel__tab-panel",ref:d,onSelect:e=>i(e),selectOnMove:!1,tabs:[{name:"list-view",title:"List View",className:"edit-post-sidebar__panel-tab"},{name:"outline",title:"Outline",className:"edit-post-sidebar__panel-tab"}]},(e=>(0,l.createElement)("div",{className:"edit-post-editor__list-view-container",ref:p},"list-view"===e.name?(0,l.createElement)("div",{className:"edit-post-editor__list-view-panel-content"},(0,l.createElement)(E.__experimentalListView,{dropZoneElement:a})):(0,l.createElement)(go,null)))))}var _o=(0,l.createElement)(w.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(w.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"}));var Eo=(0,l.createElement)(w.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(w.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"}));var bo=({sidebarName:e})=>{const{openGeneralSidebar:t}=(0,u.useDispatch)(on),n=()=>t("edit-post/document"),{documentLabel:o,isTemplateMode:a}=(0,u.useSelect)((e=>({documentLabel:e(T.store).getPostTypeLabel()||(0,b._x)("Document","noun"),isTemplateMode:e(on).isEditingTemplate()})),[]),[r,s]="edit-post/document"===e?[(0,b.sprintf)((0,b.__)("%s (selected)"),o),"is-active"]:[o,""],[i,c]="edit-post/block"===e?[(0,b.__)("Block (selected)"),"is-active"]:[(0,b.__)("Block"),""],[d,m]="edit-post/document"===e?[(0,b.__)("Template (selected)"),"is-active"]:[(0,b.__)("Template"),""];return(0,l.createElement)("ul",null,!a&&(0,l.createElement)("li",null,(0,l.createElement)(_.Button,{onClick:n,className:`edit-post-sidebar__panel-tab ${s}`,"aria-label":r,"data-label":o},o)),a&&(0,l.createElement)("li",null,(0,l.createElement)(_.Button,{onClick:n,className:`edit-post-sidebar__panel-tab ${m}`,"aria-label":d,"data-label":(0,b.__)("Template")},(0,b.__)("Template"))),(0,l.createElement)("li",null,(0,l.createElement)(_.Button,{onClick:()=>t("edit-post/block"),className:`edit-post-sidebar__panel-tab ${c}`,"aria-label":i,"data-label":(0,b.__)("Block")},(0,b.__)("Block"))))};function fo({isOpen:e,onClick:t}){const n=(0,T.usePostVisibilityLabel)();return(0,l.createElement)(_.Button,{className:"edit-post-post-visibility__toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,b.sprintf)((0,b.__)("Select visibility: %s"),n),onClick:t},n)}var vo=function(){const[e,t]=(0,l.useState)(null),n=(0,l.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,l.createElement)(T.PostVisibilityCheck,{render:({canEdit:e})=>(0,l.createElement)(_.PanelRow,{ref:t,className:"edit-post-post-visibility"},(0,l.createElement)("span",null,(0,b.__)("Visibility")),!e&&(0,l.createElement)("span",null,(0,l.createElement)(T.PostVisibilityLabel,null)),e&&(0,l.createElement)(_.Dropdown,{contentClassName:"edit-post-post-visibility__dialog",popoverProps:n,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,l.createElement)(fo,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,l.createElement)(T.PostVisibility,{onClose:e})}))})};function yo(){return(0,l.createElement)(T.PostTrashCheck,null,(0,l.createElement)(_.FlexItem,{isBlock:!0},(0,l.createElement)(T.PostTrash,null)))}function wo(){const[e,t]=(0,l.useState)(null),n=(0,l.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,l.createElement)(T.PostScheduleCheck,null,(0,l.createElement)(_.PanelRow,{className:"edit-post-post-schedule",ref:t},(0,l.createElement)("span",null,(0,b.__)("Publish")),(0,l.createElement)(_.Dropdown,{popoverProps:n,contentClassName:"edit-post-post-schedule__dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,l.createElement)(So,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,l.createElement)(T.PostSchedule,{onClose:e})})))}function So({isOpen:e,onClick:t}){const n=(0,T.usePostScheduleLabel)(),o=(0,T.usePostScheduleLabel)({full:!0});return(0,l.createElement)(_.Button,{className:"edit-post-post-schedule__toggle",variant:"tertiary",label:o,showTooltip:!0,"aria-expanded":e,"aria-label":(0,b.sprintf)((0,b.__)("Change date: %s"),n),onClick:t},n)}var ko=function(){return(0,l.createElement)(T.PostStickyCheck,null,(0,l.createElement)(_.PanelRow,null,(0,l.createElement)(T.PostSticky,null)))};var Po=function(){return(0,l.createElement)(T.PostAuthorCheck,null,(0,l.createElement)(_.PanelRow,{className:"edit-post-post-author"},(0,l.createElement)(T.PostAuthor,null)))};var Co=function(){return(0,l.createElement)(T.PostSlugCheck,null,(0,l.createElement)(_.PanelRow,{className:"edit-post-post-slug"},(0,l.createElement)(T.PostSlug,null)))};var To=function(){return(0,l.createElement)(T.PostFormatCheck,null,(0,l.createElement)(_.PanelRow,{className:"edit-post-post-format"},(0,l.createElement)(T.PostFormat,null)))};var xo=function(){return(0,l.createElement)(T.PostPendingStatusCheck,null,(0,l.createElement)(_.PanelRow,null,(0,l.createElement)(T.PostPendingStatus,null)))};const{Fill:Mo,Slot:Bo}=(0,_.createSlotFill)("PluginPostStatusInfo"),Io=({children:e,className:t})=>(0,l.createElement)(Mo,null,(0,l.createElement)(_.PanelRow,{className:t},e));Io.Slot=Bo;var No=Io;var Lo=(0,l.createElement)(w.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,l.createElement)(w.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18.5 5.5V8H20V5.5H22.5V4H20V1.5H18.5V4H16V5.5H18.5ZM13.9624 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V10.0391H18.5V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 10.4917L16.4589 10.5139L16.4641 9.01389L5.5 8.97618V6C5.5 5.72386 5.72386 5.5 6 5.5H13.9624V4ZM5.5 10.4762V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 10.4865L5.5 10.4762Z"}));const Ao=(0,b.__)("Custom Template");function Do({onClose:e}){const t=(0,u.useSelect)((e=>e(T.store).getEditorSettings().defaultBlockTemplate),[]),{__unstableCreateTemplate:n,__unstableSwitchToTemplateMode:o}=(0,u.useDispatch)(on),[a,r]=(0,l.useState)(""),[i,c]=(0,l.useState)(!1),d=()=>{r(""),e()};return(0,l.createElement)(_.Modal,{title:(0,b.__)("Create custom template"),onRequestClose:d,className:"edit-post-post-template__create-modal"},(0,l.createElement)("form",{className:"edit-post-post-template__create-form",onSubmit:async e=>{if(e.preventDefault(),i)return;c(!0);const r=null!=t?t:(0,s.serialize)([(0,s.createBlock)("core/group",{tagName:"header",layout:{inherit:!0}},[(0,s.createBlock)("core/site-title"),(0,s.createBlock)("core/site-tagline")]),(0,s.createBlock)("core/separator"),(0,s.createBlock)("core/group",{tagName:"main"},[(0,s.createBlock)("core/group",{layout:{inherit:!0}},[(0,s.createBlock)("core/post-title")]),(0,s.createBlock)("core/post-content",{layout:{inherit:!0}})])]);await n({slug:(0,P.cleanForSlug)(a||Ao),content:r,title:a||Ao}),c(!1),d(),o(!0)}},(0,l.createElement)(_.__experimentalVStack,{spacing:"3"},(0,l.createElement)(_.TextControl,{__nextHasNoMarginBottom:!0,label:(0,b.__)("Name"),value:a,onChange:r,placeholder:Ao,disabled:i,help:(0,b.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),(0,l.createElement)(_.__experimentalHStack,{justify:"right"},(0,l.createElement)(_.Button,{variant:"tertiary",onClick:d},(0,b.__)("Cancel")),(0,l.createElement)(_.Button,{variant:"primary",type:"submit",isBusy:i,"aria-disabled":i},(0,b.__)("Create"))))))}function Vo({onClose:e}){var t,n;const{isPostsPage:o,availableTemplates:a,fetchedTemplates:r,selectedTemplateSlug:s,canCreate:i,canEdit:c}=(0,u.useSelect)((e=>{const{canUser:t,getEntityRecord:n,getEntityRecords:o}=e(qe.store),a=e(T.store).getEditorSettings(),r=t("read","settings")?n("root","site"):void 0,l=e(T.store).getCurrentPostId()===r?.page_for_posts,s=t("create","templates");return{isPostsPage:l,availableTemplates:a.availableTemplates,fetchedTemplates:s?o("postType","wp_template",{post_type:e(T.store).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:e(T.store).getEditedPostAttribute("template"),canCreate:s&&!l&&a.supportsTemplateMode,canEdit:s&&a.supportsTemplateMode&&!!e(on).getEditedPostTemplate()}}),[]),d=(0,l.useMemo)((()=>Object.entries({...a,...Object.fromEntries((null!=r?r:[]).map((({slug:e,title:t})=>[e,t.rendered])))}).map((([e,t])=>({value:e,label:t})))),[a,r]),m=null!==(t=d.find((e=>e.value===s)))&&void 0!==t?t:d.find((e=>!e.value)),{editPost:p}=(0,u.useDispatch)(T.store),{__unstableSwitchToTemplateMode:g}=(0,u.useDispatch)(on),[h,f]=(0,l.useState)(!1);return(0,l.createElement)("div",{className:"edit-post-post-template__form"},(0,l.createElement)(E.__experimentalInspectorPopoverHeader,{title:(0,b.__)("Template"),help:(0,b.__)("Templates define the way content is displayed when viewing your site."),actions:i?[{icon:Lo,label:(0,b.__)("Add template"),onClick:()=>f(!0)}]:[],onClose:e}),o?(0,l.createElement)(_.Notice,{className:"edit-post-post-template__notice",status:"warning",isDismissible:!1},(0,b.__)("The posts page template cannot be changed.")):(0,l.createElement)(_.SelectControl,{__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:(0,b.__)("Template"),value:null!==(n=m?.value)&&void 0!==n?n:"",options:d,onChange:e=>p({template:e||""})}),c&&(0,l.createElement)("p",null,(0,l.createElement)(_.Button,{variant:"link",onClick:()=>g()},(0,b.__)("Edit template"))),h&&(0,l.createElement)(Do,{onClose:()=>f(!1)}))}function Oo(){const[e,t]=(0,l.useState)(null),n=(0,l.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,u.useSelect)((e=>{var t;const n=e(T.store).getCurrentPostType();if(!e(qe.store).getPostType(n)?.viewable)return!1;const o=e(T.store).getEditorSettings();if(!!o.availableTemplates&&Object.keys(o.availableTemplates).length>0)return!0;if(!o.supportsTemplateMode)return!1;return null!==(t=e(qe.store).canUser("create","templates"))&&void 0!==t&&t}),[])?(0,l.createElement)(_.PanelRow,{className:"edit-post-post-template",ref:t},(0,l.createElement)("span",null,(0,b.__)("Template")),(0,l.createElement)(_.Dropdown,{popoverProps:n,className:"edit-post-post-template__dropdown",contentClassName:"edit-post-post-template__dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,l.createElement)(Fo,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,l.createElement)(Vo,{onClose:e})})):null}function Fo({isOpen:e,onClick:t}){const n=(0,u.useSelect)((e=>{const t=e(T.store).getEditedPostAttribute("template"),{supportsTemplateMode:n,availableTemplates:o}=e(T.store).getEditorSettings();if(!n&&o[t])return o[t];const a=e(qe.store).canUser("create","templates")&&e(on).getEditedPostTemplate();return a?.title||a?.slug||o?.[t]}),[]);return(0,l.createElement)(_.Button,{className:"edit-post-post-template__toggle",variant:"tertiary","aria-expanded":e,"aria-label":n?(0,b.sprintf)((0,b.__)("Select template: %s"),n):(0,b.__)("Select template"),onClick:t},null!=n?n:(0,b.__)("Default template"))}function Ro(){const[e,t]=(0,l.useState)(null),n=(0,l.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,l.createElement)(T.PostURLCheck,null,(0,l.createElement)(_.PanelRow,{className:"edit-post-post-url",ref:t},(0,l.createElement)("span",null,(0,b.__)("URL")),(0,l.createElement)(_.Dropdown,{popoverProps:n,className:"edit-post-post-url__dropdown",contentClassName:"edit-post-post-url__dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,l.createElement)(Ho,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,l.createElement)(T.PostURL,{onClose:e})})))}function Ho({isOpen:e,onClick:t}){const n=(0,T.usePostURLLabel)();return(0,l.createElement)(_.Button,{className:"edit-post-post-url__toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,b.sprintf)((0,b.__)("Change URL: %s"),n),onClick:t},n)}const Go="post-status";var Uo=(0,f.compose)([(0,u.withSelect)((e=>{const{isEditorPanelRemoved:t,isEditorPanelOpened:n}=e(on);return{isRemoved:t(Go),isOpened:n(Go)}})),(0,f.ifCondition)((({isRemoved:e})=>!e)),(0,u.withDispatch)((e=>({onTogglePanel(){return e(on).toggleEditorPanelOpened(Go)}})))])((function({isOpened:e,onTogglePanel:t}){return(0,l.createElement)(_.PanelBody,{className:"edit-post-post-status",title:(0,b.__)("Summary"),opened:e,onToggle:t},(0,l.createElement)(No.Slot,null,(e=>(0,l.createElement)(l.Fragment,null,(0,l.createElement)(vo,null),(0,l.createElement)(wo,null),(0,l.createElement)(Oo,null),(0,l.createElement)(Ro,null),(0,l.createElement)(ko,null),(0,l.createElement)(xo,null),(0,l.createElement)(To,null),(0,l.createElement)(Co,null),(0,l.createElement)(Po,null),(0,l.createElement)(T.PostSyncStatus,null),e,(0,l.createElement)(_.__experimentalHStack,{style:{marginTop:"16px"},spacing:4},(0,l.createElement)(T.PostSwitchToDraftButton,null),(0,l.createElement)(yo,null))))))}));var zo=function(){return(0,l.createElement)(T.PostLastRevisionCheck,null,(0,l.createElement)(_.PanelBody,{className:"edit-post-last-revision__panel"},(0,l.createElement)(T.PostLastRevision,null)))};var Zo=(0,f.compose)((0,u.withSelect)(((e,t)=>{const n=t.taxonomy?.slug,o=n?`taxonomy-panel-${n}`:"";return{panelName:o,isEnabled:!!n&&e(on).isEditorPanelEnabled(o),isOpened:!!n&&e(on).isEditorPanelOpened(o)}})),(0,u.withDispatch)(((e,t)=>({onTogglePanel:()=>{e(on).toggleEditorPanelOpened(t.panelName)}}))))((function({isEnabled:e,taxonomy:t,isOpened:n,onTogglePanel:o,children:a}){if(!e)return null;const r=t?.labels?.menu_name;return r?(0,l.createElement)(_.PanelBody,{title:r,opened:n,onToggle:o},a):null}));var $o=function(){return(0,l.createElement)(T.PostTaxonomiesCheck,null,(0,l.createElement)(T.PostTaxonomies,{taxonomyWrapper:(e,t)=>(0,l.createElement)(Zo,{taxonomy:t},e)}))};const Wo="featured-image";const qo=(0,u.withSelect)((e=>{const{getEditedPostAttribute:t}=e(T.store),{getPostType:n}=e(qe.store),{isEditorPanelEnabled:o,isEditorPanelOpened:a}=e(on);return{postType:n(t("type")),isEnabled:o(Wo),isOpened:a(Wo)}})),jo=(0,u.withDispatch)((e=>{const{toggleEditorPanelOpened:t}=e(on);return{onTogglePanel:(...e)=>t(Wo,...e)}}));var Ko=(0,f.compose)(qo,jo)((function({isEnabled:e,isOpened:t,postType:n,onTogglePanel:o}){var a;return e?(0,l.createElement)(T.PostFeaturedImageCheck,null,(0,l.createElement)(_.PanelBody,{title:null!==(a=n?.labels?.featured_image)&&void 0!==a?a:(0,b.__)("Featured image"),opened:t,onToggle:o},(0,l.createElement)(T.PostFeaturedImage,null))):null}));const Yo="post-excerpt";var Xo=(0,f.compose)([(0,u.withSelect)((e=>({isEnabled:e(on).isEditorPanelEnabled(Yo),isOpened:e(on).isEditorPanelOpened(Yo)}))),(0,u.withDispatch)((e=>({onTogglePanel(){return e(on).toggleEditorPanelOpened(Yo)}})))])((function({isEnabled:e,isOpened:t,onTogglePanel:n}){return e?(0,l.createElement)(T.PostExcerptCheck,null,(0,l.createElement)(_.PanelBody,{title:(0,b.__)("Excerpt"),opened:t,onToggle:n},(0,l.createElement)(T.PostExcerpt,null))):null}));const Qo="discussion-panel";var Jo=(0,f.compose)([(0,u.withSelect)((e=>({isEnabled:e(on).isEditorPanelEnabled(Qo),isOpened:e(on).isEditorPanelOpened(Qo)}))),(0,u.withDispatch)((e=>({onTogglePanel(){return e(on).toggleEditorPanelOpened(Qo)}})))])((function({isEnabled:e,isOpened:t,onTogglePanel:n}){return e?(0,l.createElement)(T.PostTypeSupportCheck,{supportKeys:["comments","trackbacks"]},(0,l.createElement)(_.PanelBody,{title:(0,b.__)("Discussion"),opened:t,onToggle:n},(0,l.createElement)(T.PostTypeSupportCheck,{supportKeys:"comments"},(0,l.createElement)(_.PanelRow,null,(0,l.createElement)(T.PostComments,null))),(0,l.createElement)(T.PostTypeSupportCheck,{supportKeys:"trackbacks"},(0,l.createElement)(_.PanelRow,null,(0,l.createElement)(T.PostPingbacks,null))))):null}));const ea="page-attributes";var ta=function(){var e;const{isEnabled:t,isOpened:n,postType:o}=(0,u.useSelect)((e=>{const{getEditedPostAttribute:t}=e(T.store),{isEditorPanelEnabled:n,isEditorPanelOpened:o}=e(on),{getPostType:a}=e(qe.store);return{isEnabled:n(ea),isOpened:o(ea),postType:a(t("type"))}}),[]),{toggleEditorPanelOpened:a}=(0,u.useDispatch)(on);return t&&o?(0,l.createElement)(T.PageAttributesCheck,null,(0,l.createElement)(_.PanelBody,{title:null!==(e=o?.labels?.attributes)&&void 0!==e?e:(0,b.__)("Page attributes"),opened:n,onToggle:(...e)=>a(ea,...e)},(0,l.createElement)(T.PageAttributesParent,null),(0,l.createElement)(_.PanelRow,null,(0,l.createElement)(T.PageAttributesOrder,null)))):null};var na=function({location:e}){const t=(0,l.useRef)(null),n=(0,l.useRef)(null);(0,l.useEffect)((()=>(n.current=document.querySelector(".metabox-location-"+e),n.current&&t.current.appendChild(n.current),()=>{n.current&&document.querySelector("#metaboxes").appendChild(n.current)})),[e]);const o=(0,u.useSelect)((e=>e(on).isSavingMetaBoxes()),[]),a=I()("edit-post-meta-boxes-area",`is-${e}`,{"is-loading":o});return(0,l.createElement)("div",{className:a},o&&(0,l.createElement)(_.Spinner,null),(0,l.createElement)("div",{className:"edit-post-meta-boxes-area__container",ref:t}),(0,l.createElement)("div",{className:"edit-post-meta-boxes-area__clear"}))};class oa extends l.Component{componentDidMount(){this.updateDOM()}componentDidUpdate(e){this.props.isVisible!==e.isVisible&&this.updateDOM()}updateDOM(){const{id:e,isVisible:t}=this.props,n=document.getElementById(e);n&&(t?n.classList.remove("is-hidden"):n.classList.add("is-hidden"))}render(){return null}}var aa=(0,u.withSelect)(((e,{id:t})=>({isVisible:e(on).isEditorPanelEnabled(`meta-box-${t}`)})))(oa);function ra({location:e}){const t=(0,u.useRegistry)(),{metaBoxes:n,areMetaBoxesInitialized:o,isEditorReady:a}=(0,u.useSelect)((t=>{const{__unstableIsEditorReady:n}=t(T.store),{getMetaBoxesPerLocation:o,areMetaBoxesInitialized:a}=t(on);return{metaBoxes:o(e),areMetaBoxesInitialized:a(),isEditorReady:n()}}),[e]);return(0,l.useEffect)((()=>{a&&!o&&t.dispatch(on).initializeMetaBoxes()}),[a,o]),o?(0,l.createElement)(l.Fragment,null,(null!=n?n:[]).map((({id:e})=>(0,l.createElement)(aa,{key:e,id:e}))),(0,l.createElement)(na,{location:e})):null}window.wp.warning;const{Fill:la,Slot:sa}=(0,_.createSlotFill)("PluginDocumentSettingPanel"),ia=(0,f.compose)((0,k.withPluginContext)(((e,t)=>(void 0===t.name&&"undefined"!=typeof process&&process.env,{panelName:`${e.name}/${t.name}`}))),(0,u.withSelect)(((e,{panelName:t})=>({opened:e(on).isEditorPanelOpened(t),isEnabled:e(on).isEditorPanelEnabled(t)}))),(0,u.withDispatch)(((e,{panelName:t})=>({onToggle(){return e(on).toggleEditorPanelOpened(t)}}))))((({isEnabled:e,panelName:t,opened:n,onToggle:o,className:a,title:r,icon:s,children:i})=>(0,l.createElement)(l.Fragment,null,(0,l.createElement)(Pn,{label:r,panelName:t}),(0,l.createElement)(la,null,e&&(0,l.createElement)(_.PanelBody,{className:a,title:r,icon:s,opened:n,onToggle:o},i)))));ia.Slot=sa;var ca=ia;function da({className:e,...t}){const{postTitle:n,shortcut:o,showIconLabels:a}=(0,u.useSelect)((e=>({postTitle:e(T.store).getEditedPostAttribute("title"),shortcut:e(Te.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),showIconLabels:e(on).isFeatureActive("showIconLabels")})),[]);return(0,l.createElement)(me,{panelClassName:e,className:"edit-post-sidebar",smallScreenTitle:n||(0,b.__)("(no title)"),scope:"core/edit-post",toggleShortcut:o,showIconLabels:a,...t})}var ua=function(){const e=(0,u.useSelect)((e=>{const{getEditedPostTemplate:t}=e(on);return t()}),[]);return e?(0,l.createElement)(_.PanelBody,null,(0,l.createElement)(_.Flex,{align:"flex-start",gap:"3"},(0,l.createElement)(_.FlexItem,null,(0,l.createElement)(ve,{icon:ao})),(0,l.createElement)(_.FlexBlock,null,(0,l.createElement)("h2",{className:"edit-post-template-summary__title"},e?.title||e?.slug),(0,l.createElement)("p",null,e?.description)))):null};const ma=l.Platform.select({web:!0,native:!1});var pa=()=>{const{sidebarName:e,keyboardShortcut:t,isTemplateMode:n}=(0,u.useSelect)((e=>{let t=e(J).getActiveComplementaryArea(on.name);["edit-post/document","edit-post/block"].includes(t)||(e(E.store).getBlockSelectionStart()&&(t="edit-post/block"),t="edit-post/document");return{sidebarName:t,keyboardShortcut:e(Te.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),isTemplateMode:e(on).isEditingTemplate()}}),[]);return(0,l.createElement)(da,{identifier:e,header:(0,l.createElement)(bo,{sidebarName:e}),closeLabel:(0,b.__)("Close Settings"),headerClassName:"edit-post-sidebar__panel-tabs",title:(0,b.__)("Settings"),toggleShortcut:t,icon:(0,b.isRTL)()?_o:Eo,isActiveByDefault:ma},!n&&"edit-post/document"===e&&(0,l.createElement)(l.Fragment,null,(0,l.createElement)(Uo,null),(0,l.createElement)(ca.Slot,null),(0,l.createElement)(zo,null),(0,l.createElement)($o,null),(0,l.createElement)(Ko,null),(0,l.createElement)(Xo,null),(0,l.createElement)(Jo,null),(0,l.createElement)(ta,null),(0,l.createElement)(ra,{location:"side"})),n&&"edit-post/document"===e&&(0,l.createElement)(ua,null),"edit-post/block"===e&&(0,l.createElement)(E.BlockInspector,null))};function ga({nonAnimatedSrc:e,animatedSrc:t}){return(0,l.createElement)("picture",{className:"edit-post-welcome-guide__image"},(0,l.createElement)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,l.createElement)("img",{src:t,width:"312",height:"240",alt:""}))}function ha(){const{toggleFeature:e}=(0,u.useDispatch)(on);return(0,l.createElement)(_.Guide,{className:"edit-post-welcome-guide",contentLabel:(0,b.__)("Welcome to the block editor"),finishButtonText:(0,b.__)("Get started"),onFinish:()=>e("welcomeGuide"),pages:[{image:(0,l.createElement)(ga,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,l.createElement)(l.Fragment,null,(0,l.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,b.__)("Welcome to the block editor")),(0,l.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,b.__)("In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.")))},{image:(0,l.createElement)(ga,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,l.createElement)(l.Fragment,null,(0,l.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,b.__)("Make each block your own")),(0,l.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,b.__)("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,l.createElement)(ga,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,l.createElement)(l.Fragment,null,(0,l.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,b.__)("Get to know the block library")),(0,l.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,l.createInterpolateElement)((0,b.__)("All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon."),{InserterIconImage:(0,l.createElement)("img",{alt:(0,b.__)("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,l.createElement)(ga,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,l.createElement)(l.Fragment,null,(0,l.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,b.__)("Learn how to use the block editor")),(0,l.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,b.__)("New to the block editor? Want to learn more about using it? "),(0,l.createElement)(_.ExternalLink,{href:(0,b.__)("https://wordpress.org/documentation/article/wordpress-block-editor/")},(0,b.__)("Here's a detailed guide."))))}]})}function _a(){const{toggleFeature:e}=(0,u.useDispatch)(on);return(0,l.createElement)(_.Guide,{className:"edit-template-welcome-guide",contentLabel:(0,b.__)("Welcome to the template editor"),finishButtonText:(0,b.__)("Get started"),onFinish:()=>e("welcomeGuideTemplate"),pages:[{image:(0,l.createElement)(ga,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.gif"}),content:(0,l.createElement)(l.Fragment,null,(0,l.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,b.__)("Welcome to the template editor")),(0,l.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,b.__)("Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.")))}]})}function Ea(){const{isActive:e,isTemplateMode:t}=(0,u.useSelect)((e=>{const{isFeatureActive:t,isEditingTemplate:n}=e(on),o=n();return{isActive:t(o?"welcomeGuideTemplate":"welcomeGuide"),isTemplateMode:o}}),[]);return e?t?(0,l.createElement)(_a,null):(0,l.createElement)(ha,null):null}const{Fill:ba,Slot:fa}=(0,_.createSlotFill)("PluginPostPublishPanel"),va=(0,f.compose)((0,k.withPluginContext)(((e,t)=>({icon:t.icon||e.icon}))))((({children:e,className:t,title:n,initialOpen:o=!1,icon:a})=>(0,l.createElement)(ba,null,(0,l.createElement)(_.PanelBody,{className:t,initialOpen:o||!n,title:n,icon:a},e))));va.Slot=fa;var ya=va;const{Fill:wa,Slot:Sa}=(0,_.createSlotFill)("PluginPrePublishPanel"),ka=(0,f.compose)((0,k.withPluginContext)(((e,t)=>({icon:t.icon||e.icon}))))((({children:e,className:t,title:n,initialOpen:o=!1,icon:a})=>(0,l.createElement)(wa,null,(0,l.createElement)(_.PanelBody,{className:t,initialOpen:o||!n,title:n,icon:a},e))));ka.Slot=Sa;var Pa=ka;const{Fill:Ca,Slot:Ta}=(0,_.createSlotFill)("ActionsPanel");function xa({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n}){const{closePublishSidebar:o,togglePublishSidebar:a}=(0,u.useDispatch)(on),{publishSidebarOpened:r,hasActiveMetaboxes:s,isSavingMetaBoxes:i,hasNonPostEntityChanges:c}=(0,u.useSelect)((e=>({publishSidebarOpened:e(on).isPublishSidebarOpened(),hasActiveMetaboxes:e(on).hasMetaBoxes(),isSavingMetaBoxes:e(on).isSavingMetaBoxes(),hasNonPostEntityChanges:e(T.store).hasNonPostEntityChanges()})),[]),d=(0,l.useCallback)((()=>e(!0)),[]);let m;return m=r?(0,l.createElement)(T.PostPublishPanel,{onClose:o,forceIsDirty:s,forceIsSaving:i,PrePublishExtension:Pa.Slot,PostPublishExtension:ya.Slot}):c?(0,l.createElement)("div",{className:"edit-post-layout__toggle-entities-saved-states-panel"},(0,l.createElement)(_.Button,{variant:"secondary",className:"edit-post-layout__toggle-entities-saved-states-panel-button",onClick:d,"aria-expanded":!1},(0,b.__)("Open save panel"))):(0,l.createElement)("div",{className:"edit-post-layout__toggle-publish-panel"},(0,l.createElement)(_.Button,{variant:"secondary",className:"edit-post-layout__toggle-publish-panel-button",onClick:a,"aria-expanded":!1},(0,b.__)("Open publish panel"))),(0,l.createElement)(l.Fragment,null,n&&(0,l.createElement)(T.EntitiesSavedStates,{close:t}),(0,l.createElement)(Ta,{bubblesVirtually:!0}),!n&&m)}function Ma(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,u.useSelect)((e=>{const{getPatternsByBlockTypes:t}=e(E.store),{getCurrentPostType:n}=e(T.store);return{blockPatternsWithPostContentBlockType:t("core/post-content"),postType:n()}}),[]);return(0,l.useMemo)((()=>e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t)))),[t,e])}function Ba({onChoosePattern:e}){const t=Ma(),n=(0,f.useAsyncList)(t),{resetEditorBlocks:o}=(0,u.useDispatch)(T.store);return(0,l.createElement)(E.__experimentalBlockPatternsList,{blockPatterns:t,shownPatterns:n,onClickPattern:(t,n)=>{o(n),e()}})}const Ia="INITIAL",Na="PATTERN",La="CLOSED";function Aa(){const[e,t]=(0,l.useState)(Ia),n=Ma().length>0,o=(0,u.useSelect)((t=>{if(!n||e!==Ia)return!1;const{getEditedPostContent:o,isEditedPostSaveable:a}=t(T.store),{isEditingTemplate:r,isFeatureActive:l}=t(on);return!a()&&""===o()&&!r()&&!l("welcomeGuide")}),[e,n]);return(0,l.useEffect)((()=>{o&&t(Na)}),[o]),e===Ia||e===La?null:(0,l.createElement)(_.Modal,{className:"edit-post-start-page-options__modal",title:(0,b.__)("Choose a pattern"),isFullScreen:!0,onRequestClose:()=>{t(La)}},(0,l.createElement)("div",{className:"edit-post-start-page-options__modal-content"},e===Na&&(0,l.createElement)(Ba,{onChoosePattern:()=>{t(La)}})))}const Da={header:(0,b.__)("Editor top bar"),body:(0,b.__)("Editor content"),sidebar:(0,b.__)("Editor settings"),actions:(0,b.__)("Editor publish"),footer:(0,b.__)("Editor footer")};var Va=function({styles:e}){const t=(0,f.useViewportMatch)("medium","<"),n=(0,f.useViewportMatch)("huge",">="),o=(0,f.useViewportMatch)("large"),{openGeneralSidebar:a,closeGeneralSidebar:r,setIsInserterOpened:s}=(0,u.useDispatch)(on),{createErrorNotice:i}=(0,u.useDispatch)(C.store),{mode:c,isFullscreenActive:d,isRichEditingEnabled:m,sidebarIsOpened:p,hasActiveMetaboxes:g,hasFixedToolbar:h,previousShortcut:v,nextShortcut:y,hasBlockSelected:w,isInserterOpened:S,isListViewOpened:P,showIconLabels:x,isDistractionFree:M,showBlockBreadcrumbs:B,isTemplateMode:N,documentLabel:L}=(0,u.useSelect)((e=>{const{getEditorSettings:t,getPostTypeLabel:n}=e(T.store),o=t(),a=n();return{isTemplateMode:e(on).isEditingTemplate(),hasFixedToolbar:e(on).isFeatureActive("fixedToolbar"),sidebarIsOpened:!(!e(J).getActiveComplementaryArea(on.name)&&!e(on).isPublishSidebarOpened()),isFullscreenActive:e(on).isFeatureActive("fullscreenMode"),isInserterOpened:e(on).isInserterOpened(),isListViewOpened:e(on).isListViewOpened(),mode:e(on).getEditorMode(),isRichEditingEnabled:o.richEditingEnabled,hasActiveMetaboxes:e(on).hasMetaBoxes(),previousShortcut:e(Te.store).getAllShortcutKeyCombinations("core/edit-post/previous-region"),nextShortcut:e(Te.store).getAllShortcutKeyCombinations("core/edit-post/next-region"),showIconLabels:e(on).isFeatureActive("showIconLabels"),isDistractionFree:e(on).isFeatureActive("distractionFree"),showBlockBreadcrumbs:e(on).isFeatureActive("showBlockBreadcrumbs"),documentLabel:a||(0,b._x)("Document","noun")}}),[]);(0,l.useEffect)((()=>{p&&!n&&s(!1)}),[p,n]),(0,l.useEffect)((()=>{S&&!n&&r()}),[S,n]);const[A,D]=(0,l.useState)(!1),V=(0,l.useCallback)((e=>{"function"==typeof A&&A(e),D(!1)}),[A]),O=I()("edit-post-layout","is-mode-"+c,{"is-sidebar-opened":p,"has-fixed-toolbar":h,"has-metaboxes":g,"show-icon-labels":x,"is-distraction-free":M&&o,"is-entity-save-view-open":!!A}),F=P?(0,b.__)("Document Overview"):(0,b.__)("Block Library");return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(pe,{isActive:d}),(0,l.createElement)(Dn,null),(0,l.createElement)(T.UnsavedChangesWarning,null),(0,l.createElement)(T.AutosaveMonitor,null),(0,l.createElement)(T.LocalAutosaveMonitor,null),(0,l.createElement)(bn,null),(0,l.createElement)(T.EditorKeyboardShortcutsRegister,null),(0,l.createElement)(pa,null),(0,l.createElement)(_e,{isDistractionFree:M&&o,className:O,labels:{...Da,secondarySidebar:F},header:(0,l.createElement)(io,{setEntitiesSavedStatesCallback:D}),editorNotices:(0,l.createElement)(T.EditorNotices,null),secondarySidebar:"visual"===c&&S?(0,l.createElement)(uo,null):"visual"===c&&P?(0,l.createElement)(ho,null):null,sidebar:(!t||p)&&(0,l.createElement)(l.Fragment,null,!t&&!p&&(0,l.createElement)("div",{className:"edit-post-layout__toggle-sidebar-panel"},(0,l.createElement)(_.Button,{variant:"secondary",className:"edit-post-layout__toggle-sidebar-panel-button",onClick:()=>a(w?"edit-post/block":"edit-post/document"),"aria-expanded":!1},w?(0,b.__)("Open block settings"):(0,b.__)("Open document settings"))),(0,l.createElement)(me.Slot,{scope:"core/edit-post"})),notices:(0,l.createElement)(T.EditorSnackbars,null),content:(0,l.createElement)(l.Fragment,null,!M&&(0,l.createElement)(T.EditorNotices,null),("text"===c||!m)&&(0,l.createElement)(sn,null),m&&"visual"===c&&(0,l.createElement)(En,{styles:e}),!M&&!N&&(0,l.createElement)("div",{className:"edit-post-layout__metaboxes"},(0,l.createElement)(ra,{location:"normal"}),(0,l.createElement)(ra,{location:"advanced"})),t&&p&&(0,l.createElement)(_.ScrollLock,null)),footer:!M&&!t&&B&&m&&"visual"===c&&(0,l.createElement)("div",{className:"edit-post-layout__footer"},(0,l.createElement)(E.BlockBreadcrumb,{rootLabelText:L})),actions:(0,l.createElement)(xa,{closeEntitiesSavedStates:V,isEntitiesSavedStatesOpen:A,setEntitiesSavedStatesCallback:D}),shortcuts:{previous:v,next:y}}),(0,l.createElement)(Ln,null),(0,l.createElement)(Ve,null),(0,l.createElement)(Ea,null),(0,l.createElement)(Aa,null),(0,l.createElement)(_.Popover.Slot,null),(0,l.createElement)(k.PluginArea,{onError:function(e){i((0,b.sprintf)((0,b.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}))};function Oa({postId:e}){return(e=>{const{hasBlockSelection:t,isEditorSidebarOpened:n}=(0,u.useSelect)((e=>({hasBlockSelection:!!e(E.store).getBlockSelectionStart(),isEditorSidebarOpened:e(nn).isEditorSidebarOpened()})),[e]),{openGeneralSidebar:o}=(0,u.useDispatch)(nn);(0,l.useEffect)((()=>{n&&o(t?"edit-post/block":"edit-post/document")}),[t,n])})(e),(e=>{const{newPermalink:t}=(0,u.useSelect)((e=>({newPermalink:e(T.store).getCurrentPost().link})),[e]),n=(0,l.useRef)();(0,l.useEffect)((()=>{n.current=document.querySelector("#wp-admin-bar-preview a")||document.querySelector("#wp-admin-bar-view a")}),[e]),(0,l.useEffect)((()=>{t&&n.current&&n.current.setAttribute("href",t)}),[t])})(e),null}var Fa=(0,l.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(w.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"}));var Ra=(0,l.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(w.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"}));var Ha=(0,l.createElement)(w.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,l.createElement)(w.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"}));var Ga=(0,l.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,l.createElement)(w.Path,{d:"M18,0 L2,0 C0.9,0 0.01,0.9 0.01,2 L0,12 C0,13.1 0.9,14 2,14 L18,14 C19.1,14 20,13.1 20,12 L20,2 C20,0.9 19.1,0 18,0 Z M18,12 L2,12 L2,2 L18,2 L18,12 Z M9,3 L11,3 L11,5 L9,5 L9,3 Z M9,6 L11,6 L11,8 L9,8 L9,6 Z M6,3 L8,3 L8,5 L6,5 L6,3 Z M6,6 L8,6 L8,8 L6,8 L6,6 Z M3,6 L5,6 L5,8 L3,8 L3,6 Z M3,3 L5,3 L5,5 L3,5 L3,3 Z M6,9 L14,9 L14,11 L6,11 L6,9 Z M12,6 L14,6 L14,8 L12,8 L12,6 Z M12,3 L14,3 L14,5 L12,5 L12,3 Z M15,6 L17,6 L17,8 L15,8 L15,6 Z M15,3 L17,3 L17,5 L15,5 L15,3 Z M10,20 L14,16 L6,16 L10,20 Z"}));const{ExperimentalEditorProvider:Ua}=un(T.privateApis),{getLayoutStyles:za}=un(E.privateApis),{useCommands:Za}=un(ln.privateApis);var $a=function({postId:e,postType:t,settings:n,initialEdits:o,...a}){Za(),function(){const{openGeneralSidebar:e,closeGeneralSidebar:t,switchEditorMode:n}=(0,u.useDispatch)(on),{openModal:o}=(0,u.useDispatch)(J),{editorMode:a,activeSidebar:r}=(0,u.useSelect)((e=>({activeSidebar:e(J).getActiveComplementaryArea(on.name),editorMode:e(on).getEditorMode()})),[]),{toggle:l}=(0,u.useDispatch)(p.store);(0,rn.useCommand)({name:"core/open-settings-sidebar",label:(0,b.__)("Toggle settings sidebar"),icon:(0,b.isRTL)()?_o:Eo,callback:({close:n})=>{n(),"edit-post/document"===r?t():e("edit-post/document")}}),(0,rn.useCommand)({name:"core/open-block-inspector",label:(0,b.__)("Toggle block inspector"),icon:Fa,callback:({close:n})=>{n(),"edit-post/block"===r?t():e("edit-post/block")}}),(0,rn.useCommand)({name:"core/toggle-distraction-free",label:(0,b.__)("Toggle distraction free"),icon:Ra,callback:({close:e})=>{l("core/edit-post","distractionFree"),e()}}),(0,rn.useCommand)({name:"core/toggle-spotlight-mode",label:(0,b.__)("Toggle spotlight mode"),icon:Ra,callback:({close:e})=>{l("core/edit-post","focusMode"),e()}}),(0,rn.useCommand)({name:"core/toggle-top-toolbar",label:(0,b.__)("Toggle top toolbar"),icon:Ra,callback:({close:e})=>{l("core/edit-post","fixedToolbar"),e()}}),(0,rn.useCommand)({name:"core/toggle-code-editor",label:(0,b.__)("Toggle code editor"),icon:Ha,callback:({close:e})=>{n("visual"===a?"text":"visual"),e()}}),(0,rn.useCommand)({name:"core/open-preferences",label:(0,b.__)("Open editor preferences"),icon:Ra,callback:()=>{o(Nn)}}),(0,rn.useCommand)({name:"core/open-shortcut-help",label:(0,b.__)("Open keyboard shortcuts"),icon:Ga,callback:()=>{o(Ne)}})}();const{hasFixedToolbar:r,focusMode:i,isDistractionFree:c,hasInlineToolbar:d,hasThemeStyles:m,post:g,preferredStyleVariations:h,hiddenBlockTypes:E,blockTypes:f,keepCaretInsideBlock:v,isTemplateMode:y,template:w}=(0,u.useSelect)((n=>{var o;const{isFeatureActive:a,__experimentalGetPreviewDeviceType:r,isEditingTemplate:l,getEditedPostTemplate:i,getHiddenBlockTypes:c}=n(on),{getEntityRecord:d,getPostType:u,getEntityRecords:m,canUser:g}=n(qe.store),{getEditorSettings:h}=n(T.store),{getBlockTypes:_}=n(s.store);let E;if(["wp_template","wp_template_part"].includes(t)){E=m("postType",t,{wp_id:e})?.[0]}else E=d("postType",t,e);const b=h().supportsTemplateMode,f=null!==(o=u(t)?.viewable)&&void 0!==o&&o,v=g("create","templates");return{hasFixedToolbar:a("fixedToolbar")||"Desktop"!==r(),focusMode:a("focusMode"),isDistractionFree:a("distractionFree"),hasInlineToolbar:a("inlineToolbar"),hasThemeStyles:a("themeStyles"),preferredStyleVariations:n(p.store).get("core/edit-post","preferredStyleVariations"),hiddenBlockTypes:c(),blockTypes:_(),keepCaretInsideBlock:a("keepCaretInsideBlock"),isTemplateMode:l(),template:b&&f&&v?i():null,post:E}}),[t,e]),{updatePreferredStyleVariations:S,setIsInserterOpened:k}=(0,u.useDispatch)(on),P=(0,l.useMemo)((()=>{const e={...n,__experimentalPreferredStyleVariations:{value:h,onChange:S},hasFixedToolbar:r,focusMode:i,isDistractionFree:c,hasInlineToolbar:d,__experimentalSetIsInserterOpened:k,keepCaretInsideBlock:v,defaultAllowedBlockTypes:n.allowedBlockTypes};if(E.length>0){const t=!0===n.allowedBlockTypes?f.map((({name:e})=>e)):n.allowedBlockTypes||[];e.allowedBlockTypes=t.filter((e=>!E.includes(e)))}return e}),[n,r,d,i,c,E,f,h,k,S,v]),C=(0,l.useMemo)((()=>{const e=[],t=[];n.styles?.forEach((n=>{n.__unstableType&&"theme"!==n.__unstableType?t.push(n):e.push(n)}));const o=[...n.defaultEditorStyles,...t];return n.disableLayoutStyles||m&&e.length||o.push({css:za({style:{},selector:"body",hasBlockGapSupport:!1,hasFallbackGapSupport:!0,fallbackGapValue:"0.5em"})}),m&&e.length?n.styles:o}),[n,m]);return g?(0,l.createElement)(Te.ShortcutProvider,null,(0,l.createElement)(_.SlotFillProvider,null,(0,l.createElement)(Ua,{settings:P,post:g,initialEdits:o,useSubRegistry:!1,__unstableTemplate:y?w:void 0,...a},(0,l.createElement)(T.ErrorBoundary,null,(0,l.createElement)(rn.CommandMenu,null),(0,l.createElement)(Oa,{postId:e}),(0,l.createElement)(Va,{styles:C})),(0,l.createElement)(T.PostLockedModal,null)))):null};var Wa=({allowedBlocks:e,icon:t,label:n,onClick:o,small:a,role:r})=>(0,l.createElement)(E.BlockSettingsMenuControls,null,(({selectedBlocks:s,onClose:i})=>((e,t)=>{return!Array.isArray(t)||(n=t,0===e.filter((e=>!n.includes(e))).length);var n})(s,e)?(0,l.createElement)(_.MenuItem,{onClick:(0,f.compose)(o,i),icon:t,label:a?n:void 0,role:r},!a&&n):null)),qa=(0,f.compose)((0,k.withPluginContext)(((e,t)=>{var n;return{as:null!==(n=t.as)&&void 0!==n?n:_.MenuItem,icon:t.icon||e.icon,name:"core/edit-post/plugin-more-menu"}})))(re);function ja(e){return(0,l.createElement)(se,{__unstableExplicitMenuItem:!0,scope:"core/edit-post",...e})}function Ka(e,t,n,o,a){const r=document.getElementById(e),c=(0,l.createRoot)(r);(0,u.dispatch)(p.store).setDefaults("core/edit-post",{editorMode:"visual",fixedToolbar:!1,fullscreenMode:!0,hiddenBlockTypes:[],inactivePanels:[],isPublishSidebarEnabled:!0,openPanels:["post-status"],preferredStyleVariations:{},showBlockBreadcrumbs:!0,showIconLabels:!1,showListViewByDefault:!1,themeStyles:!0,welcomeGuide:!0,welcomeGuideTemplate:!0}),(0,u.dispatch)(s.store).__experimentalReapplyBlockTypeFilters(),(0,u.select)(on).isFeatureActive("showListViewByDefault")&&(0,u.dispatch)(on).setIsListViewOpened(!0),(0,i.registerCoreBlocks)(),(0,g.registerLegacyWidgetBlock)({inserter:!1}),(0,g.registerWidgetGroupBlock)({inserter:!1}),(0,m.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((e,t)=>!(!(0,u.select)(on).isEditingTemplate()&&"core/template-part"===t.name)&&e)),(0,m.addFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",((e,t,n,{getBlockParentsByBlockName:o})=>(0,u.select)(on).isEditingTemplate()||"core/post-content"!==t.name?e:o(n,"core/query").length>0));"Standards"!==("CSS1Compat"===document.compatMode?"Standards":"Quirks")&&console.warn("Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.");return-1!==window.navigator.userAgent.indexOf("iPhone")&&window.addEventListener("scroll",(e=>{const t=document.getElementsByClassName("interface-interface-skeleton__body")[0];e.target===document&&(window.scrollY>100&&(t.scrollTop=t.scrollTop+window.scrollY),document.getElementsByClassName("is-mode-visual")[0]&&window.scrollTo(0,0))})),window.addEventListener("dragover",(e=>e.preventDefault()),!1),window.addEventListener("drop",(e=>e.preventDefault()),!1),c.render((0,l.createElement)($a,{settings:o,postId:n,postType:t,initialEdits:a})),c}function Ya(){d()("wp.editPost.reinitializeEditor",{since:"6.2",version:"6.3"})}}(),(window.wp=window.wp||{}).editPost=o}(); |