WordPress/wp-includes/js/dist/edit-post.min.js
youknowriad 9aaa49f5a7 Editor: Update WordPress packages to Gutenberg 16.7 RC3.
It brings with a set of iterations and follow-ups to the initial package update.
It also fixes a regression that happened for interactive blocks.

Props gziolo, luisherranz, cbravobernal.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57499


git-svn-id: http://core.svn.wordpress.org/trunk@57000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-31 12:59:56 +00:00

7 lines
89 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! This file is auto-generated */
(()=>{var e={4403:(e,t)=>{var o;
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var s=typeof o;if("string"===s||"number"===s)e.push(o);else if(Array.isArray(o)){if(o.length){var a=r.apply(null,o);a&&e.push(a)}}else if("object"===s){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){e.push(o.toString());continue}for(var i in o)n.call(o,i)&&o[i]&&e.push(i)}}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(o=function(){return r}.apply(t,[]))||(e.exports=o)}()}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,o),s.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";o.r(n),o.d(n,{PluginBlockSettingsMenuItem:()=>gr,PluginDocumentSettingPanel:()=>wn,PluginMoreMenuItem:()=>hr,PluginPostPublishPanel:()=>Vn,PluginPostStatusInfo:()=>un,PluginPrePublishPanel:()=>Un,PluginSidebar:()=>Sn,PluginSidebarMoreMenuItem:()=>br,__experimentalFullscreenModeClose:()=>Bo,__experimentalMainDashboardButton:()=>Go,__experimentalPluginPostExcerpt:()=>Er,initializeEditor:()=>_r,reinitializeEditor:()=>yr,store:()=>no});var e={};o.r(e),o.d(e,{closeModal:()=>j,disableComplementaryArea:()=>z,enableComplementaryArea:()=>G,openModal:()=>Q,pinItem:()=>H,setDefaultComplementaryArea:()=>V,setFeatureDefaults:()=>q,setFeatureValue:()=>W,toggleFeature:()=>$,unpinItem:()=>U});var t={};o.r(t),o.d(t,{getActiveComplementaryArea:()=>Y,isComplementaryAreaLoading:()=>Z,isFeatureActive:()=>K,isItemPinned:()=>X,isModalActive:()=>J});var r={};o.r(r),o.d(r,{__experimentalSetPreviewDeviceType:()=>gt,__unstableCreateTemplate:()=>_t,closeGeneralSidebar:()=>Ye,closeModal:()=>Xe,closePublishSidebar:()=>Je,hideBlockTypes:()=>ct,initializeMetaBoxes:()=>vt,metaBoxUpdatesFailure:()=>pt,metaBoxUpdatesSuccess:()=>mt,openGeneralSidebar:()=>je,openModal:()=>Ze,openPublishSidebar:()=>Ke,removeEditorPanel:()=>nt,requestMetaBoxUpdates:()=>ut,setAvailableMetaBoxesPerLocation:()=>dt,setIsEditingTemplate:()=>Et,setIsInserterOpened:()=>ht,setIsListViewOpened:()=>bt,showBlockTypes:()=>lt,switchEditorMode:()=>st,toggleDistractionFree:()=>ft,toggleEditorPanelEnabled:()=>tt,toggleEditorPanelOpened:()=>ot,toggleFeature:()=>rt,togglePinnedPluginItem:()=>at,togglePublishSidebar:()=>et,updatePreferredStyleVariations:()=>it});var s={};o.r(s),o.d(s,{__experimentalGetInsertionPoint:()=>Xt,__experimentalGetPreviewDeviceType:()=>Yt,areMetaBoxesInitialized:()=>eo,getActiveGeneralSidebarName:()=>At,getActiveMetaBoxLocations:()=>Ht,getAllMetaBoxes:()=>qt,getEditedPostTemplate:()=>to,getEditorMode:()=>xt,getHiddenBlockTypes:()=>Nt,getMetaBoxesPerLocation:()=>Wt,getPreference:()=>Lt,getPreferences:()=>It,hasMetaBoxes:()=>Qt,isEditingTemplate:()=>Jt,isEditorPanelEnabled:()=>Ot,isEditorPanelOpened:()=>Rt,isEditorPanelRemoved:()=>Dt,isEditorSidebarOpened:()=>Bt,isFeatureActive:()=>Gt,isInserterOpened:()=>Zt,isListViewOpened:()=>Kt,isMetaBoxLocationActive:()=>$t,isMetaBoxLocationVisible:()=>Ut,isModalActive:()=>Vt,isPluginItemPinned:()=>zt,isPluginSidebarOpened:()=>Tt,isPublishSidebarOpened:()=>Ft,isSavingMetaBoxes:()=>jt});const a=window.React,i=window.wp.blocks,l=window.wp.blockLibrary,c=window.wp.deprecated;var d=o.n(c);const u=window.wp.element,m=window.wp.data,p=window.wp.hooks,g=window.wp.preferences,h=window.wp.widgets,b=window.wp.editor,E=window.wp.mediaUtils;(0,p.addFilter)("editor.MediaUpload","core/edit-post/replace-media-upload",(()=>E.MediaUpload));const _=window.wp.components,y=window.wp.blockEditor,v=window.wp.i18n,f=window.wp.compose,w=(0,f.compose)((0,m.withSelect)(((e,t)=>{if((0,i.hasBlockSupport)(t.name,"multiple",!0))return{};const o=e(y.store).getBlocks().find((({name:e})=>t.name===e));return{originalBlockClientId:o&&o.clientId!==t.clientId&&o.clientId}})),(0,m.withDispatch)(((e,{originalBlockClientId:t})=>({selectFirst:()=>e(y.store).selectBlock(t)})))),S=(0,f.createHigherOrderComponent)((e=>w((({originalBlockClientId:t,selectFirst:o,...n})=>{if(!t)return(0,a.createElement)(e,{...n});const r=(0,i.getBlockType)(n.name),s=function(e){const t=(0,i.findTransform)((0,i.getBlockTransforms)("to",e),(({type:e,blocks:t})=>"block"===e&&1===t.length));if(!t)return null;return(0,i.getBlockType)(t.blocks[0])}(n.name);return[(0,a.createElement)("div",{key:"invalid-preview",style:{minHeight:"60px"}},(0,a.createElement)(e,{key:"block-edit",...n})),(0,a.createElement)(y.Warning,{key:"multiple-use-warning",actions:[(0,a.createElement)(_.Button,{key:"find-original",variant:"secondary",onClick:o},(0,v.__)("Find original")),(0,a.createElement)(_.Button,{key:"remove",variant:"secondary",onClick:()=>n.onReplace([])},(0,v.__)("Remove")),s&&(0,a.createElement)(_.Button,{key:"transform",variant:"secondary",onClick:()=>n.onReplace((0,i.createBlock)(s.name,n.attributes))},(0,v.__)("Transform into:")," ",s.title)]},(0,a.createElement)("strong",null,r?.title,": "),(0,v.__)("This block can only be used once."))]}))),"withMultipleValidation");(0,p.addFilter)("editor.BlockEdit","core/edit-post/validate-multiple-use/with-multiple-validation",S);const P=window.wp.coreData,k=window.wp.primitives,C=(0,a.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(k.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"})),M=window.wp.plugins,x=window.wp.url,B=window.wp.notices;function T(){const{createNotice:e}=(0,m.useDispatch)(B.store),{getEditedPostAttribute:t}=(0,m.useSelect)(b.store);const o=(0,f.useCopyToClipboard)((function(){return t("content")}),(function(){e("info",(0,v.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,a.createElement)(_.MenuItem,{ref:o},(0,v.__)("Copy all blocks"))}const A=window.wp.keycodes;var I=o(4403),L=o.n(I);const N=(0,a.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(k.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),F=(0,a.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(k.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"})),D=(0,a.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(k.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"})),O=window.wp.viewport,R=(0,a.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(k.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"})),V=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),G=(e,t)=>({registry:o,dispatch:n})=>{if(!t)return;o.select(g.store).get(e,"isComplementaryAreaVisible")||o.dispatch(g.store).set(e,"isComplementaryAreaVisible",!0),n({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},z=e=>({registry:t})=>{t.select(g.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(g.store).set(e,"isComplementaryAreaVisible",!1)},H=(e,t)=>({registry:o})=>{if(!t)return;const n=o.select(g.store).get(e,"pinnedItems");!0!==n?.[t]&&o.dispatch(g.store).set(e,"pinnedItems",{...n,[t]:!0})},U=(e,t)=>({registry:o})=>{if(!t)return;const n=o.select(g.store).get(e,"pinnedItems");o.dispatch(g.store).set(e,"pinnedItems",{...n,[t]:!1})};function $(e,t){return function({registry:o}){d()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),o.dispatch(g.store).toggle(e,t)}}function W(e,t,o){return function({registry:n}){d()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),n.dispatch(g.store).set(e,t,!!o)}}function q(e,t){return function({registry:o}){d()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),o.dispatch(g.store).setDefaults(e,t)}}function Q(e){return{type:"OPEN_MODAL",name:e}}function j(){return{type:"CLOSE_MODAL"}}const Y=(0,m.createRegistrySelector)((e=>(t,o)=>{const n=e(g.store).get(o,"isComplementaryAreaVisible");if(void 0!==n)return!1===n?null:t?.complementaryAreas?.[o]})),Z=(0,m.createRegistrySelector)((e=>(t,o)=>{const n=e(g.store).get(o,"isComplementaryAreaVisible"),r=t?.complementaryAreas?.[o];return n&&void 0===r})),X=(0,m.createRegistrySelector)((e=>(t,o,n)=>{var r;const s=e(g.store).get(o,"pinnedItems");return null===(r=s?.[n])||void 0===r||r})),K=(0,m.createRegistrySelector)((e=>(t,o,n)=>(d()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(g.store).get(o,n))));function J(e,t){return e.activeModal===t}const ee=(0,m.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:o,area:n}=t;return e[o]?e:{...e,[o]:n}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:o,area:n}=t;return{...e,[o]:n}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}}),te=(0,m.createReduxStore)("core/interface",{reducer:ee,actions:e,selectors:t});(0,m.register)(te);const oe=(0,M.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));const ne=oe((function({as:e=_.Button,scope:t,identifier:o,icon:n,selectedIcon:r,name:s,...i}){const l=e,c=(0,m.useSelect)((e=>e(te).getActiveComplementaryArea(t)===o),[o,t]),{enableComplementaryArea:d,disableComplementaryArea:u}=(0,m.useDispatch)(te);return(0,a.createElement)(l,{icon:r&&c?r:n,"aria-controls":o.replace("/",":"),onClick:()=>{c?u(t):d(t,o)},...i})})),re=({smallScreenTitle:e,children:t,className:o,toggleButtonProps:n})=>{const r=(0,a.createElement)(ne,{icon:R,...n});return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},e&&(0,a.createElement)("span",{className:"interface-complementary-area-header__small-title"},e),r),(0,a.createElement)("div",{className:L()("components-panel__header","interface-complementary-area-header",o),tabIndex:-1},t,r))},se=()=>{};function ae({name:e,as:t=_.Button,onClick:o,...n}){return(0,a.createElement)(_.Fill,{name:e},(({onClick:e})=>(0,a.createElement)(t,{onClick:o||e?(...t)=>{(o||se)(...t),(e||se)(...t)}:void 0,...n})))}ae.Slot=function({name:e,as:t=_.ButtonGroup,fillProps:o={},bubblesVirtually:n,...r}){return(0,a.createElement)(_.Slot,{name:e,bubblesVirtually:n,fillProps:o},(e=>{if(!u.Children.toArray(e).length)return null;const o=[];u.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&o.push(t)}));const n=u.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&o.includes(e.props.__unstableTarget)?null:e));return(0,a.createElement)(t,{...r},n)}))};const ie=ae,le=({__unstableExplicitMenuItem:e,__unstableTarget:t,...o})=>(0,a.createElement)(_.MenuItem,{...o});function ce({scope:e,target:t,__unstableExplicitMenuItem:o,...n}){return(0,a.createElement)(ne,{as:n=>(0,a.createElement)(ie,{__unstableExplicitMenuItem:o,__unstableTarget:`${e}/${t}`,as:le,name:`${e}/plugin-more-menu`,...n}),role:"menuitemcheckbox",selectedIcon:N,name:t,scope:e,...n})}function de({scope:e,...t}){return(0,a.createElement)(_.Fill,{name:`PinnedItems/${e}`,...t})}de.Slot=function({scope:e,className:t,...o}){return(0,a.createElement)(_.Slot,{name:`PinnedItems/${e}`,...o},(e=>e?.length>0&&(0,a.createElement)("div",{className:L()(t,"interface-pinned-items")},e)))};const ue=de;function me({scope:e,children:t,className:o,id:n}){return(0,a.createElement)(_.Fill,{name:`ComplementaryArea/${e}`},(0,a.createElement)("div",{id:n,className:o},t))}const pe=oe((function({children:e,className:t,closeLabel:o=(0,v.__)("Close plugin"),identifier:n,header:r,headerClassName:s,icon:i,isPinnable:l=!0,panelClassName:c,scope:d,name:p,smallScreenTitle:h,title:b,toggleShortcut:E,isActiveByDefault:y}){const{isLoading:f,isActive:w,isPinned:S,activeArea:P,isSmall:k,isLarge:C,showIconLabels:M}=(0,m.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:o,isItemPinned:r}=e(te),{get:s}=e(g.store),a=t(d);return{isLoading:o(d),isActive:a===n,isPinned:r(d,n),activeArea:a,isSmall:e(O.store).isViewportMatch("< medium"),isLarge:e(O.store).isViewportMatch("large"),showIconLabels:s("core","showIconLabels")}}),[n,d]);!function(e,t,o,n,r){const s=(0,u.useRef)(!1),a=(0,u.useRef)(!1),{enableComplementaryArea:i,disableComplementaryArea:l}=(0,m.useDispatch)(te);(0,u.useEffect)((()=>{n&&r&&!s.current?(l(e),a.current=!0):a.current&&!r&&s.current?(a.current=!1,i(e,t)):a.current&&o&&o!==t&&(a.current=!1),r!==s.current&&(s.current=r)}),[n,r,e,t,o,l,i])}(d,n,P,w,k);const{enableComplementaryArea:x,disableComplementaryArea:B,pinItem:T,unpinItem:A}=(0,m.useDispatch)(te);return(0,u.useEffect)((()=>{y&&void 0===P&&!k?x(d,n):void 0===P&&k&&B(d,n)}),[P,y,d,n,k,x,B]),(0,a.createElement)(a.Fragment,null,l&&(0,a.createElement)(ue,{scope:d},S&&(0,a.createElement)(ne,{scope:d,identifier:n,isPressed:w&&(!M||C),"aria-expanded":w,"aria-disabled":f,label:b,icon:M?N:i,showTooltip:!M,variant:M?"tertiary":void 0,size:"compact"})),p&&l&&(0,a.createElement)(ce,{target:p,scope:d,icon:i},b),w&&(0,a.createElement)(me,{className:L()("interface-complementary-area",t),scope:d,id:n.replace("/",":")},(0,a.createElement)(re,{className:s,closeLabel:o,onClose:()=>B(d),smallScreenTitle:h,toggleButtonProps:{label:o,shortcut:E,scope:d,identifier:n}},r||(0,a.createElement)(a.Fragment,null,(0,a.createElement)("strong",null,b),l&&(0,a.createElement)(_.Button,{className:"interface-complementary-area__pin-unpin-item",icon:S?F:D,label:S?(0,v.__)("Unpin from toolbar"):(0,v.__)("Pin to toolbar"),onClick:()=>(S?A:T)(d,n),isPressed:S,"aria-expanded":S}))),(0,a.createElement)(_.Panel,{className:c},e)))}));pe.Slot=function({scope:e,...t}){return(0,a.createElement)(_.Slot,{name:`ComplementaryArea/${e}`,...t})};const ge=pe,he=({isActive:e})=>((0,u.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,u.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 be({children:e,className:t,ariaLabel:o,as:n="div",...r}){return(0,a.createElement)(n,{className:L()("interface-navigable-region",t),"aria-label":o,role:"region",tabIndex:"-1",...r},e)}const Ee={hidden:{opacity:0},hover:{opacity:1,transition:{type:"tween",delay:.2,delayChildren:.2}},distractionFreeInactive:{opacity:1,transition:{delay:0}}};const _e=(0,u.forwardRef)((function({isDistractionFree:e,footer:t,header:o,editorNotices:n,sidebar:r,secondarySidebar:s,notices:i,content:l,actions:c,labels:d,className:m,enableRegionNavigation:p=!0,shortcuts:g},h){const b=(0,_.__unstableUseNavigateRegions)(g);!function(e){(0,u.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,v._x)("Header","header landmark area"),body:(0,v.__)("Content"),secondarySidebar:(0,v.__)("Block Library"),sidebar:(0,v.__)("Settings"),actions:(0,v.__)("Publish"),footer:(0,v.__)("Footer")},...d};return(0,a.createElement)("div",{...p?b:{},ref:(0,f.useMergeRefs)([h,p?b.ref:void 0]),className:L()(m,"interface-interface-skeleton",b.className,!!t&&"has-footer")},(0,a.createElement)("div",{className:"interface-interface-skeleton__editor"},!!o&&(0,a.createElement)(be,{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:Ee,transition:e?{type:"tween",delay:.8}:void 0},o),e&&(0,a.createElement)("div",{className:"interface-interface-skeleton__header"},n),(0,a.createElement)("div",{className:"interface-interface-skeleton__body"},!!s&&(0,a.createElement)(be,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:E.secondarySidebar},s),!!i&&(0,a.createElement)("div",{className:"interface-interface-skeleton__notices"},i),(0,a.createElement)(be,{className:"interface-interface-skeleton__content",ariaLabel:E.body},l),!!r&&(0,a.createElement)(be,{className:"interface-interface-skeleton__sidebar",ariaLabel:E.sidebar},r),!!c&&(0,a.createElement)(be,{className:"interface-interface-skeleton__actions",ariaLabel:E.actions},c))),!!t&&(0,a.createElement)(be,{className:"interface-interface-skeleton__footer",ariaLabel:E.footer},t))})),ye=(0,a.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(k.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function ve({as:e=_.DropdownMenu,className:t,label:o=(0,v.__)("Options"),popoverProps:n,toggleProps:r,children:s}){return(0,a.createElement)(e,{className:L()("interface-more-menu-dropdown",t),icon:ye,label:o,popoverProps:{placement:"bottom-end",...n,className:L()("interface-more-menu-dropdown__content",n?.className)},toggleProps:{tooltipPosition:"bottom",...r,size:"compact"}},(e=>s(e)))}const fe=window.wp.keyboardShortcuts,we=[{keyCombination:{modifier:"primary",character:"b"},description:(0,v.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,v.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,v.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,v.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,v.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,v.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,v.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,v.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},description:(0,v.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,v.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")}];function Se({keyCombination:e,forceAriaLabel:t}){const o=e.modifier?A.displayShortcutList[e.modifier](e.character):e.character,n=e.modifier?A.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,a.createElement)("kbd",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||n},(Array.isArray(o)?o:[o]).map(((e,t)=>"+"===e?(0,a.createElement)(u.Fragment,{key:t},e):(0,a.createElement)("kbd",{key:t,className:"edit-post-keyboard-shortcut-help-modal__shortcut-key"},e))))}const Pe=function({description:e,keyCombination:t,aliases:o=[],ariaLabel:n}){return(0,a.createElement)(u.Fragment,null,(0,a.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-description"},e),(0,a.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-term"},(0,a.createElement)(Se,{keyCombination:t,forceAriaLabel:n}),o.map(((e,t)=>(0,a.createElement)(Se,{keyCombination:e,forceAriaLabel:n,key:t})))))};const ke=function({name:e}){const{keyCombination:t,description:o,aliases:n}=(0,m.useSelect)((t=>{const{getShortcutKeyCombination:o,getShortcutDescription:n,getShortcutAliases:r}=t(fe.store);return{keyCombination:o(e),aliases:r(e),description:n(e)}}),[e]);return t?(0,a.createElement)(Pe,{keyCombination:t,description:o,aliases:n}):null},Ce="edit-post/keyboard-shortcut-help",Me=({shortcuts:e})=>(0,a.createElement)("ul",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-list",role:"list"},e.map(((e,t)=>(0,a.createElement)("li",{className:"edit-post-keyboard-shortcut-help-modal__shortcut",key:t},"string"==typeof e?(0,a.createElement)(ke,{name:e}):(0,a.createElement)(Pe,{...e}))))),xe=({title:e,shortcuts:t,className:o})=>(0,a.createElement)("section",{className:L()("edit-post-keyboard-shortcut-help-modal__section",o)},!!e&&(0,a.createElement)("h2",{className:"edit-post-keyboard-shortcut-help-modal__section-title"},e),(0,a.createElement)(Me,{shortcuts:t})),Be=({title:e,categoryName:t,additionalShortcuts:o=[]})=>{const n=(0,m.useSelect)((e=>e(fe.store).getCategoryShortcuts(t)),[t]);return(0,a.createElement)(xe,{title:e,shortcuts:n.concat(o)})};const Te=(0,f.compose)([(0,m.withSelect)((e=>({isModalActive:e(te).isModalActive(Ce)}))),(0,m.withDispatch)(((e,{isModalActive:t})=>{const{openModal:o,closeModal:n}=e(te);return{toggleModal:()=>t?n():o(Ce)}}))])((function({isModalActive:e,toggleModal:t}){return(0,fe.useShortcut)("core/edit-post/keyboard-shortcuts",t),e?(0,a.createElement)(_.Modal,{className:"edit-post-keyboard-shortcut-help-modal",title:(0,v.__)("Keyboard shortcuts"),closeButtonLabel:(0,v.__)("Close"),onRequestClose:t},(0,a.createElement)(xe,{className:"edit-post-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-post/keyboard-shortcuts"]}),(0,a.createElement)(Be,{title:(0,v.__)("Global shortcuts"),categoryName:"global"}),(0,a.createElement)(Be,{title:(0,v.__)("Selection shortcuts"),categoryName:"selection"}),(0,a.createElement)(Be,{title:(0,v.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,v.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,v.__)("Forward-slash")}]}),(0,a.createElement)(xe,{title:(0,v.__)("Text formatting"),shortcuts:we})):null}));const Ae=(0,m.withDispatch)((e=>{const{openModal:t}=e(te);return{openModal:t}}))((function({openModal:e}){return(0,a.createElement)(_.MenuItem,{onClick:()=>{e(Ce)},shortcut:A.displayShortcut.access("h")},(0,v.__)("Keyboard shortcuts"))})),{Fill:Ie,Slot:Le}=(0,_.createSlotFill)("ToolsMoreMenuGroup");Ie.Slot=({fillProps:e})=>(0,a.createElement)(Le,{fillProps:e},(e=>e.length>0&&(0,a.createElement)(_.MenuGroup,{label:(0,v.__)("Tools")},e)));const Ne=Ie;function Fe(){const e=(0,m.useSelect)((e=>"wp_template"===e(b.store).getCurrentPostType()),[]);return(0,a.createElement)(g.PreferenceToggleMenuItem,{scope:"core/edit-post",name:e?"welcomeGuideTemplate":"welcomeGuide",label:(0,v.__)("Welcome Guide")})}function De(){const e=(0,m.useSelect)((e=>{const{canUser:t}=e(P.store),{getEditorSettings:o}=e(b.store),n=o().__unstableIsBlockBasedTheme,r=(0,x.addQueryArgs)("edit.php",{post_type:"wp_block"}),s=(0,x.addQueryArgs)("site-editor.php",{path:"/patterns"});return t("read","templates")&&n?s:r}),[]);return(0,a.createElement)(_.MenuItem,{role:"menuitem",href:e},(0,v.__)("Manage patterns"))}(0,M.registerPlugin)("edit-post",{render:()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Ne,null,(({onClose:e})=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(De,null),(0,a.createElement)(Ae,{onSelect:e}),(0,a.createElement)(Fe,null),(0,a.createElement)(T,null),(0,a.createElement)(_.MenuItem,{role:"menuitem",icon:C,href:(0,v.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,v.__)("Help"),(0,a.createElement)(_.VisuallyHidden,{as:"span"},(0,v.__)("(opens in a new tab)")))))))});const Oe=window.wp.commands,Re=window.wp.coreCommands;function Ve(e=[],t){const o=[...e];for(const e of t){const t=o.findIndex((t=>t.id===e.id));-1!==t?o[t]=e:o.push(e)}return o}const Ge=(0,m.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 o={...e};for(const[e,n]of Object.entries(t.metaBoxesPerLocation))o[e]=Ve(o[e],n);return o}return e},initialized:function(e=!1,t){return"META_BOXES_INITIALIZED"===t.type||e}}),ze=(0,m.combineReducers)({metaBoxes:Ge,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}}),He=window.wp.apiFetch;var Ue=o.n(He);const $e=window.wp.a11y,We=window.wp.privateApis,{lock:qe,unlock:Qe}=(0,We.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/edit-post"),je=e=>({dispatch:t,registry:o})=>{o.select(g.store).get("core","distractionFree")&&t.toggleDistractionFree(),o.dispatch(te).enableComplementaryArea(no.name,e)},Ye=()=>({registry:e})=>e.dispatch(te).disableComplementaryArea(no.name),Ze=e=>({registry:t})=>(d()("select( 'core/edit-post' ).openModal( name )",{since:"6.3",alternative:"select( 'core/interface').openModal( name )"}),t.dispatch(te).openModal(e)),Xe=()=>({registry:e})=>(d()("select( 'core/edit-post' ).closeModal()",{since:"6.3",alternative:"select( 'core/interface').closeModal()"}),e.dispatch(te).closeModal());function Ke(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function Je(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function et(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const tt=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).toggleEditorPanelEnabled",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelEnabled"}),t.dispatch(b.store).toggleEditorPanelEnabled(e)},ot=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).toggleEditorPanelOpened",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelOpened"}),t.dispatch(b.store).toggleEditorPanelOpened(e)},nt=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).removeEditorPanel",{since:"6.5",alternative:"dispatch( 'core/editor').removeEditorPanel"}),t.dispatch(b.store).removeEditorPanel(e)},rt=e=>({registry:t})=>t.dispatch(g.store).toggle("core/edit-post",e),st=e=>({dispatch:t,registry:o})=>{o.dispatch(g.store).set("core","editorMode",e),"visual"!==e&&o.dispatch(y.store).clearSelectedBlock(),"text"===e&&o.select(g.store).get("core","distractionFree")&&t.toggleDistractionFree();const n="visual"===e?(0,v.__)("Visual editor selected"):(0,v.__)("Code editor selected");(0,$e.speak)(n,"assertive")},at=e=>({registry:t})=>{const o=t.select(te).isItemPinned("core/edit-post",e);t.dispatch(te)[o?"unpinItem":"pinItem"]("core/edit-post",e)},it=(e,t)=>({registry:o})=>{var n;if(!e)return;const r=null!==(n=o.select(g.store).get("core/edit-post","preferredStyleVariations"))&&void 0!==n?n:{};if(t)o.dispatch(g.store).set("core/edit-post","preferredStyleVariations",{...r,[e]:t});else{const t={...r};delete t[e],o.dispatch(g.store).set("core/edit-post","preferredStyleVariations",t)}},lt=e=>({registry:t})=>{Qe(t.dispatch(b.store)).showBlockTypes(e)},ct=e=>({registry:t})=>{Qe(t.dispatch(b.store)).hideBlockTypes(e)};function dt(e){return{type:"SET_META_BOXES_PER_LOCATIONS",metaBoxesPerLocation:e}}const ut=()=>async({registry:e,select:t,dispatch:o})=>{o({type:"REQUEST_META_BOX_UPDATES"}),window.tinyMCE&&window.tinyMCE.triggerSave();const n=e.select(b.store).getCurrentPost(),r=[!!n.comment_status&&["comment_status",n.comment_status],!!n.ping_status&&["ping_status",n.ping_status],!!n.sticky&&["sticky",n.sticky],!!n.author&&["post_author",n.author]].filter(Boolean),s=[new window.FormData(document.querySelector(".metabox-base-form")),...t.getActiveMetaBoxLocations().map((e=>new window.FormData((e=>{const t=document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`);return t||document.querySelector("#metaboxes .metabox-location-"+e)})(e))))].reduce(((e,t)=>{for(const[o,n]of t)e.append(o,n);return e}),new window.FormData);r.forEach((([e,t])=>s.append(e,t)));try{await Ue()({url:window._wpMetaBoxUrl,method:"POST",body:s,parse:!1}),o.metaBoxUpdatesSuccess()}catch{o.metaBoxUpdatesFailure()}};function mt(){return{type:"META_BOX_UPDATES_SUCCESS"}}function pt(){return{type:"META_BOX_UPDATES_FAILURE"}}const gt=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType",{since:"6.5",version:"6.7",hint:"registry.dispatch( editorStore ).setDeviceType"}),t.dispatch(b.store).setDeviceType(e)},ht=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).setIsInserterOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsInserterOpened"}),t.dispatch(b.store).setIsInserterOpened(e)},bt=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).setIsListViewOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsListViewOpened"}),t.dispatch(b.store).setIsListViewOpened(e)};function Et(){return d()("dispatch( 'core/edit-post' ).setIsEditingTemplate",{since:"6.5",alternative:"dispatch( 'core/editor').setRenderingMode"}),{type:"NOTHING"}}function _t(){return d()("dispatch( 'core/edit-post' ).__unstableCreateTemplate",{since:"6.5"}),{type:"NOTHING"}}let yt=!1;const vt=()=>({registry:e,select:t,dispatch:o})=>{if(!e.select(b.store).__unstableIsEditorReady())return;if(yt)return;const n=e.select(b.store).getCurrentPostType();window.postboxes.page!==n&&window.postboxes.add_postbox_toggles(n),yt=!0,(0,p.addFilter)("editor.__unstableSavePost","core/edit-post/save-metaboxes",((e,n)=>e.then((()=>{if(!n.isAutosave&&t.hasMetaBoxes())return o.requestMetaBoxUpdates()})))),o({type:"META_BOXES_INITIALIZED"})},ft=()=>({dispatch:e,registry:t})=>{const o=t.select(g.store).get("core","distractionFree");o||t.batch((()=>{t.dispatch(g.store).set("core","fixedToolbar",!0),t.dispatch(b.store).setIsInserterOpened(!1),t.dispatch(b.store).setIsListViewOpened(!1),e.closeGeneralSidebar()})),t.batch((()=>{t.dispatch(g.store).set("core","distractionFree",!o),t.dispatch(B.store).createInfoNotice(o?(0,v.__)("Distraction free off."):(0,v.__)("Distraction free on."),{id:"core/edit-post/distraction-free-mode/notice",type:"snackbar",actions:[{label:(0,v.__)("Undo"),onClick:()=>{t.dispatch(g.store).toggle("core","distractionFree")}}]})}))};var wt={};function St(e){return[e]}function Pt(e,t,o){var n;if(e.length!==t.length)return!1;for(n=o;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function kt(e,t){var o,n=t||St;function r(){o=new WeakMap}function s(){var t,r,s,a,i,l=arguments.length;for(a=new Array(l),s=0;s<l;s++)a[s]=arguments[s];for(t=function(e){var t,n,r,s,a,i=o,l=!0;for(t=0;t<e.length;t++){if(!(a=n=e[t])||"object"!=typeof a){l=!1;break}i.has(n)?i=i.get(n):(r=new WeakMap,i.set(n,r),i=r)}return i.has(wt)||((s=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=l,i.set(wt,s)),i.get(wt)}(i=n.apply(null,a)),t.isUniqueByDependants||(t.lastDependants&&!Pt(i,t.lastDependants,0)&&t.clear(),t.lastDependants=i),r=t.head;r;){if(Pt(r.args,a,1))return r!==t.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=t.head,r.prev=null,t.head.prev=r,t.head=r),r.val;r=r.next}return r={val:e.apply(null,a)},a[0]=null,r.args=a,t.head&&(t.head.prev=r,r.next=t.head),t.head=r,r.val}return s.getDependants=n,s.clear=r,r(),s}const Ct=[],Mt={},xt=(0,m.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(g.store).get("core","editorMode"))&&void 0!==t?t:"visual"})),Bt=(0,m.createRegistrySelector)((e=>()=>{const t=e(te).getActiveComplementaryArea("core/edit-post");return["edit-post/document","edit-post/block"].includes(t)})),Tt=(0,m.createRegistrySelector)((e=>()=>{const t=e(te).getActiveComplementaryArea("core/edit-post");return!!t&&!["edit-post/document","edit-post/block"].includes(t)})),At=(0,m.createRegistrySelector)((e=>()=>e(te).getActiveComplementaryArea("core/edit-post")));const It=(0,m.createRegistrySelector)((e=>()=>{d()("select( 'core/edit-post' ).getPreferences",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const t=["preferredStyleVariations"].reduce(((t,o)=>({...t,[o]:e(g.store).get("core/edit-post",o)})),{}),o=["editorMode","hiddenBlockTypes"].reduce(((t,o)=>({...t,[o]:e(g.store).get("core",o)})),{}),n=function(e,t){var o;const n=e?.reduce(((e,t)=>({...e,[t]:{enabled:!1}})),{}),r=t?.reduce(((e,t)=>{const o=e?.[t];return{...e,[t]:{...o,opened:!0}}}),null!=n?n:{});return null!==(o=null!=r?r:n)&&void 0!==o?o:Mt}(e(g.store).get("core","inactivePanels"),e(g.store).get("core","openPanels"));return{...t,...o,panels:n}}));function Lt(e,t,o){d()("select( 'core/edit-post' ).getPreference",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const n=It(e)[t];return void 0===n?o:n}const Nt=(0,m.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(g.store).get("core","hiddenBlockTypes"))&&void 0!==t?t:Ct}));function Ft(e){return e.publishSidebarActive}const Dt=(0,m.createRegistrySelector)((e=>(t,o)=>(d()("select( 'core/edit-post' ).isEditorPanelRemoved",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelRemoved"}),e(b.store).isEditorPanelRemoved(o)))),Ot=(0,m.createRegistrySelector)((e=>(t,o)=>(d()("select( 'core/edit-post' ).isEditorPanelEnabled",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelEnabled"}),e(b.store).isEditorPanelEnabled(o)))),Rt=(0,m.createRegistrySelector)((e=>(t,o)=>(d()("select( 'core/edit-post' ).isEditorPanelOpened",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelOpened"}),e(b.store).isEditorPanelOpened(o)))),Vt=(0,m.createRegistrySelector)((e=>(t,o)=>(d()("select( 'core/edit-post' ).isModalActive",{since:"6.3",alternative:"select( 'core/interface' ).isModalActive"}),!!e(te).isModalActive(o)))),Gt=(0,m.createRegistrySelector)((e=>(t,o)=>!!e(g.store).get("core/edit-post",o))),zt=(0,m.createRegistrySelector)((e=>(t,o)=>e(te).isItemPinned("core/edit-post",o))),Ht=kt((e=>Object.keys(e.metaBoxes.locations).filter((t=>$t(e,t)))),(e=>[e.metaBoxes.locations])),Ut=(0,m.createRegistrySelector)((e=>(t,o)=>$t(t,o)&&Wt(t,o)?.some((({id:o})=>e(b.store).isEditorPanelEnabled(t,`meta-box-${o}`)))));function $t(e,t){const o=Wt(e,t);return!!o&&0!==o.length}function Wt(e,t){return e.metaBoxes.locations[t]}const qt=kt((e=>Object.values(e.metaBoxes.locations).flat()),(e=>[e.metaBoxes.locations]));function Qt(e){return Ht(e).length>0}function jt(e){return e.metaBoxes.isSaving}const Yt=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-site' ).__experimentalGetPreviewDeviceType",{since:"6.5",version:"6.7",alternative:"select( 'core/editor' ).getDeviceType"}),e(b.store).getDeviceType()))),Zt=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-post' ).isInserterOpened",{since:"6.5",alternative:"select( 'core/editor' ).isInserterOpened"}),e(b.store).isInserterOpened()))),Xt=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-post' ).__experimentalGetInsertionPoint",{since:"6.5",version:"6.7"}),Qe(e(b.store)).getInsertionPoint()))),Kt=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-post' ).isListViewOpened",{since:"6.5",alternative:"select( 'core/editor' ).isListViewOpened"}),e(b.store).isListViewOpened()))),Jt=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-post' ).isEditingTemplate",{since:"6.5",alternative:"select( 'core/editor' ).getRenderingMode"}),"post-only"!==e(b.store).getRenderingMode())));function eo(e){return e.metaBoxes.initialized}const to=(0,m.createRegistrySelector)((e=>()=>{const t=e(b.store).getEditedPostAttribute("template");if(t){const o=e(P.store).getEntityRecords("postType","wp_template",{per_page:-1})?.find((e=>e.slug===t));return o?e(P.store).getEditedEntityRecord("postType","wp_template",o.id):o}const o=e(b.store).getCurrentPost();let n;n=o.slug?"page"===o.type?`${o.type}-${o.slug}`:`single-${o.type}-${o.slug}`:"page"===o.type?"page":`single-${o.type}`;const r=e(P.store).getDefaultTemplateId({slug:n});return e(P.store).getEditedEntityRecord("postType","wp_template",r)})),oo="core/edit-post",no=(0,m.createReduxStore)(oo,{reducer:ze,actions:r,selectors:s});function ro(){const e=(0,m.useSelect)((e=>e(b.store).getEditorSettings().richEditingEnabled),[]),{switchEditorMode:t}=(0,m.useDispatch)(no),{isWelcomeGuideVisible:o}=(0,m.useSelect)((e=>{const{isFeatureActive:t}=e(no);return{isWelcomeGuideVisible:t("welcomeGuide")}}),[]),n=(0,u.useRef)();return(0,u.useEffect)((()=>{o||n?.current?.focus()}),[o]),(0,a.createElement)("div",{className:"edit-post-text-editor"},e&&(0,a.createElement)("div",{className:"edit-post-text-editor__toolbar"},(0,a.createElement)("h2",null,(0,v.__)("Editing code")),(0,a.createElement)(_.Button,{variant:"tertiary",onClick:()=>t("visual"),shortcut:A.displayShortcut.secondary("m")},(0,v.__)("Exit code editor"))),(0,a.createElement)("div",{className:"edit-post-text-editor__body"},(0,a.createElement)(b.PostTitleRaw,{ref:n}),(0,a.createElement)(b.PostTextEditor,null)))}(0,m.register)(no);const{EditorCanvas:so}=Qe(b.privateApis),ao=!1;function io({styles:e}){const{isWelcomeGuideVisible:t,renderingMode:o,isBlockBasedTheme:n,hasV3BlocksOnly:r,isEditingTemplate:s}=(0,m.useSelect)((e=>{const{isFeatureActive:t}=e(no),{getEditorSettings:o,getRenderingMode:n}=e(b.store),{getBlockTypes:r}=e(i.store),s=o();return{isWelcomeGuideVisible:t("welcomeGuide"),renderingMode:n(),isBlockBasedTheme:s.__unstableIsBlockBasedTheme,hasV3BlocksOnly:r().every((e=>e.apiVersion>=3)),isEditingTemplate:"wp_template"===e(b.store).getCurrentPostType()}}),[]),l=(0,m.useSelect)((e=>e(no).hasMetaBoxes()),[]);let c;l||"post-only"!==o||(c="40vh"),e=(0,u.useMemo)((()=>[...e,{css:c?`body{padding-bottom:${c}}`:""}]),[e,c]);const d=(r||ao&&n)&&!l||s;return(0,a.createElement)("div",{className:L()("edit-post-visual-editor",{"has-inline-canvas":!d})},(0,a.createElement)(so,{disableIframe:!d,styles:e,autoFocus:!t}))}const lo=function(){const{getEditorMode:e,isEditorSidebarOpened:t}=(0,m.useSelect)(no),o=(0,m.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:o}=e(b.store).getEditorSettings();return!t||!o}),[]),{switchEditorMode:n,openGeneralSidebar:r,closeGeneralSidebar:s,toggleFeature:a,toggleDistractionFree:l}=(0,m.useDispatch)(no),{registerShortcut:c}=(0,m.useDispatch)(fe.store),{replaceBlocks:d}=(0,m.useDispatch)(y.store),{getBlockName:p,getSelectedBlockClientId:g,getBlockAttributes:h,getBlockSelectionStart:E}=(0,m.useSelect)(y.store),_=(e,t)=>{e.preventDefault();const o=0===t?"core/paragraph":"core/heading",n=g();if(null===n)return;const r=p(n);if("core/paragraph"!==r&&"core/heading"!==r)return;const s=h(n),a="core/paragraph"===r?"align":"textAlign",l="core/paragraph"===o?"align":"textAlign";d(n,(0,i.createBlock)(o,{level:t,content:s.content,[l]:s[a]}))};return(0,u.useEffect)((()=>{c({name:"core/edit-post/toggle-mode",category:"global",description:(0,v.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),c({name:"core/edit-post/toggle-distraction-free",category:"global",description:(0,v.__)("Toggle distraction free mode."),keyCombination:{modifier:"primaryShift",character:"\\"}}),c({name:"core/edit-post/toggle-fullscreen",category:"global",description:(0,v.__)("Toggle fullscreen mode."),keyCombination:{modifier:"secondary",character:"f"}}),c({name:"core/edit-post/toggle-sidebar",category:"global",description:(0,v.__)("Show or hide the Settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),c({name:"core/edit-post/next-region",category:"global",description:(0,v.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),c({name:"core/edit-post/previous-region",category:"global",description:(0,v.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]}),c({name:"core/edit-post/keyboard-shortcuts",category:"main",description:(0,v.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),c({name:"core/edit-post/transform-heading-to-paragraph",category:"block-library",description:(0,v.__)("Transform heading to paragraph."),keyCombination:{modifier:"access",character:"0"}}),[1,2,3,4,5,6].forEach((e=>{c({name:`core/edit-post/transform-paragraph-to-heading-${e}`,category:"block-library",description:(0,v.__)("Transform paragraph to heading."),keyCombination:{modifier:"access",character:`${e}`}})}))}),[]),(0,fe.useShortcut)("core/edit-post/toggle-mode",(()=>{n("visual"===e()?"text":"visual")}),{isDisabled:o}),(0,fe.useShortcut)("core/edit-post/toggle-fullscreen",(()=>{a("fullscreenMode")})),(0,fe.useShortcut)("core/edit-post/toggle-distraction-free",(()=>{l()})),(0,fe.useShortcut)("core/edit-post/toggle-sidebar",(e=>{if(e.preventDefault(),t())s();else{const e=E()?"edit-post/block":"edit-post/document";r(e)}})),(0,fe.useShortcut)("core/edit-post/transform-heading-to-paragraph",(e=>_(e,0))),[1,2,3,4,5,6].forEach((e=>{(0,fe.useShortcut)(`core/edit-post/transform-paragraph-to-heading-${e}`,(t=>_(t,e)))})),null},{PreferenceBaseOption:co}=Qe(g.privateApis);function uo({willEnable:e}){const[t,o]=(0,u.useState)(!1);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",{className:"edit-post-preferences-modal__custom-fields-confirmation-message"},(0,v.__)("A page reload is required for this change. Make sure your content is saved before reloading.")),(0,a.createElement)(_.Button,{className:"edit-post-preferences-modal__custom-fields-confirmation-button",variant:"secondary",isBusy:t,disabled:t,onClick:()=>{o(!0),function(){const e=document.getElementById("toggle-custom-fields-form");e.querySelector('[name="_wp_http_referer"]').setAttribute("value",(0,x.getPathAndQueryString)(window.location.href)),e.submit()}()}},e?(0,v.__)("Show & Reload Page"):(0,v.__)("Hide & Reload Page")))}const mo=(0,m.withSelect)((e=>({areCustomFieldsEnabled:!!e(b.store).getEditorSettings().enableCustomFields})))((function({label:e,areCustomFieldsEnabled:t}){const[o,n]=(0,u.useState)(t);return(0,a.createElement)(co,{label:e,isChecked:o,onChange:n},o!==t&&(0,a.createElement)(uo,{willEnable:o}))})),{PreferenceBaseOption:po}=Qe(g.privateApis),go=(0,f.compose)((0,m.withSelect)(((e,{panelName:t})=>{const{isEditorPanelEnabled:o,isEditorPanelRemoved:n}=e(b.store);return{isRemoved:n(t),isChecked:o(t)}})),(0,f.ifCondition)((({isRemoved:e})=>!e)),(0,m.withDispatch)(((e,{panelName:t})=>({onChange:()=>e(b.store).toggleEditorPanelEnabled(t)}))))(po),{PreferencesModalSection:ho}=Qe(g.privateApis);const bo=(0,m.withSelect)((e=>{const{getEditorSettings:t}=e(b.store),{getAllMetaBoxes:o}=e(no);return{areCustomFieldsRegistered:void 0!==t().enableCustomFields,metaBoxes:o()}}))((function({areCustomFieldsRegistered:e,metaBoxes:t,...o}){const n=t.filter((({id:e})=>"postcustom"!==e));return e||0!==n.length?(0,a.createElement)(ho,{...o},e&&(0,a.createElement)(mo,{label:(0,v.__)("Custom fields")}),n.map((({id:e,title:t})=>(0,a.createElement)(go,{key:e,label:t,panelName:`meta-box-${e}`})))):null})),{PreferenceBaseOption:Eo}=Qe(g.privateApis),_o=(0,f.compose)((0,m.withSelect)((e=>({isChecked:e(b.store).isPublishSidebarEnabled()}))),(0,m.withDispatch)((e=>{const{enablePublishSidebar:t,disablePublishSidebar:o}=e(b.store);return{onChange:e=>e?t():o()}})),(0,O.ifViewportMatches)("medium"))(Eo),{PreferencesModalSection:yo,PreferenceToggleControl:vo}=Qe(g.privateApis),{PreferencesModal:fo}=Qe(b.privateApis),wo="edit-post/preferences";function So(){const e=(0,f.useViewportMatch)("medium"),{closeModal:t}=(0,m.useDispatch)(te),{isModalActive:o}=(0,m.useSelect)((e=>({isModalActive:e(te).isModalActive(wo)})),[]),n={general:(0,a.createElement)(a.Fragment,null,e&&(0,a.createElement)(yo,{title:(0,v.__)("Publishing")},(0,a.createElement)(_o,{help:(0,v.__)("Review settings, such as visibility and tags."),label:(0,v.__)("Enable pre-publish checks")})),(0,a.createElement)(bo,{title:(0,v.__)("Advanced")})),appearance:(0,a.createElement)(vo,{scope:"core/edit-post",featureName:"themeStyles",help:(0,v.__)("Make the editor look like your theme."),label:(0,v.__)("Use theme styles")})};return o?(0,a.createElement)(fo,{extraSections:n,isActive:o,onClose:t}):null}class Po extends u.Component{constructor(){super(...arguments),this.state={historyId:null}}componentDidUpdate(e){const{postId:t,postStatus:o,postType:n,isSavingPost:r,hasHistory:s}=this.props,{historyId:a}=this.state;"trash"!==o||r?t===e.postId&&t===a||"auto-draft"===o||!t||s||this.setBrowserURL(t):this.setTrashURL(t,n)}setTrashURL(e,t){window.location.href=function(e,t){return(0,x.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,x.addQueryArgs)("post.php",{post:e,action:"edit"})}(e)),this.setState((()=>({historyId:e})))}render(){return null}}const ko=(0,m.withSelect)((e=>{const{getCurrentPost:t,isSavingPost:o}=e(b.store),n=t();let{id:r,status:s,type:a}=n;return["wp_template","wp_template_part"].includes(a)&&(r=n.wp_id),{postId:r,postStatus:s,postType:a,isSavingPost:o()}}))(Po),Co=(0,a.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(k.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})),Mo=(0,a.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(k.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})),xo=(0,a.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,a.createElement)(k.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"}));const Bo=function({showTooltip:e,icon:t,href:o}){var n;const{isActive:r,isRequestingSiteIcon:s,postType:i,siteIconUrl:l}=(0,m.useSelect)((e=>{const{getCurrentPostType:t}=e(b.store),{isFeatureActive:o}=e(no),{getEntityRecord:n,getPostType:r,isResolving:s}=e(P.store),a=n("root","__unstableBase",void 0)||{};return{isActive:o("fullscreenMode"),isRequestingSiteIcon:s("getEntityRecord",["root","__unstableBase",void 0]),postType:r(t()),siteIconUrl:a.site_icon_url}}),[]),c=(0,f.useReducedMotion)();if(!r||!i)return null;let d=(0,a.createElement)(_.Icon,{size:"36px",icon:xo});const u={expand:{scale:1.25,transition:{type:"tween",duration:"0.3"}}};l&&(d=(0,a.createElement)(_.__unstableMotion.img,{variants:!c&&u,alt:(0,v.__)("Site Icon"),className:"edit-post-fullscreen-mode-close_site-icon",src:l})),s&&(d=null),t&&(d=(0,a.createElement)(_.Icon,{size:"36px",icon:t}));const p=L()({"edit-post-fullscreen-mode-close":!0,"has-icon":l});return(0,a.createElement)(_.__unstableMotion.div,{whileHover:"expand"},(0,a.createElement)(_.Button,{className:p,href:null!=o?o:(0,x.addQueryArgs)("edit.php",{post_type:i.slug}),label:null!==(n=i?.labels?.view_items)&&void 0!==n?n:(0,v.__)("Back"),showTooltip:e},d))},To=[{value:"visual",label:(0,v.__)("Visual editor")},{value:"text",label:(0,v.__)("Code editor")}];const Ao=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:o,mode:n}=(0,m.useSelect)((e=>({shortcut:e(fe.store).getShortcutRepresentation("core/edit-post/toggle-mode"),isRichEditingEnabled:e(b.store).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(b.store).getEditorSettings().codeEditingEnabled,mode:e(no).getEditorMode()})),[]),{switchEditorMode:r}=(0,m.useDispatch)(no);let s=n;t||"visual"!==n||(s="text"),o||"text"!==n||(s="visual");const i=To.map((n=>(o||"text"!==n.value||(n={...n,disabled:!0}),t||"visual"!==n.value||(n={...n,disabled:!0,info:(0,v.__)("You can enable the visual editor in your profile settings.")}),n.value===s||n.disabled?n:{...n,shortcut:e})));return(0,a.createElement)(_.MenuGroup,{label:(0,v.__)("Editor")},(0,a.createElement)(_.MenuItemsChoice,{choices:i,value:s,onSelect:r}))};function Io(){const{openModal:e}=(0,m.useDispatch)(te);return(0,a.createElement)(_.MenuItem,{onClick:()=>{e(wo)}},(0,v.__)("Preferences"))}const Lo=function(){const e=(0,m.useRegistry)(),{closeGeneralSidebar:t}=(0,m.useDispatch)(no),{set:o}=(0,m.useDispatch)(g.store),{setIsInserterOpened:n,setIsListViewOpened:r}=(0,m.useDispatch)(b.store);return(0,f.useViewportMatch)("medium")?(0,a.createElement)(_.MenuGroup,{label:(0,v._x)("View","noun")},(0,a.createElement)(g.PreferenceToggleMenuItem,{scope:"core",name:"fixedToolbar",onToggle:()=>{o("core","distractionFree",!1)},label:(0,v.__)("Top toolbar"),info:(0,v.__)("Access all block and document tools in a single place"),messageActivated:(0,v.__)("Top toolbar activated"),messageDeactivated:(0,v.__)("Top toolbar deactivated")}),(0,a.createElement)(g.PreferenceToggleMenuItem,{scope:"core",name:"distractionFree",onToggle:()=>{e.batch((()=>{o("core","fixedToolbar",!0),n(!1),r(!1),t()}))},label:(0,v.__)("Distraction free"),info:(0,v.__)("Write with calmness"),messageActivated:(0,v.__)("Distraction free mode activated"),messageDeactivated:(0,v.__)("Distraction free mode deactivated"),shortcut:A.displayShortcut.primaryShift("\\")}),(0,a.createElement)(g.PreferenceToggleMenuItem,{scope:"core",name:"focusMode",label:(0,v.__)("Spotlight mode"),info:(0,v.__)("Focus on one block at a time"),messageActivated:(0,v.__)("Spotlight mode activated"),messageDeactivated:(0,v.__)("Spotlight mode deactivated")}),(0,a.createElement)(g.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fullscreenMode",label:(0,v.__)("Fullscreen mode"),info:(0,v.__)("Show and hide the admin user interface"),messageActivated:(0,v.__)("Fullscreen mode activated"),messageDeactivated:(0,v.__)("Fullscreen mode deactivated"),shortcut:A.displayShortcut.secondary("f")})):null},No=({showIconLabels:e})=>{const t=(0,f.useViewportMatch)("large");return(0,a.createElement)(ve,{toggleProps:{showTooltip:!e,...e&&{variant:"tertiary"},size:"compact"}},(({onClose:o})=>(0,a.createElement)(a.Fragment,null,e&&!t&&(0,a.createElement)(ue.Slot,{className:e&&"show-icon-labels",scope:"core/edit-post"}),(0,a.createElement)(Lo,null),(0,a.createElement)(Ao,null),(0,a.createElement)(ie.Slot,{name:"core/edit-post/plugin-more-menu",label:(0,v.__)("Plugins"),as:_.MenuGroup,fillProps:{onClick:o}}),(0,a.createElement)(Ne.Slot,{fillProps:{onClose:o}}),(0,a.createElement)(_.MenuGroup,null,(0,a.createElement)(Io,null)))))};const Fo=(0,f.compose)((0,m.withSelect)((e=>{var t;return{hasPublishAction:null!==(t=e(b.store).getCurrentPost()?._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:e(b.store).isEditedPostBeingScheduled(),isPending:e(b.store).isCurrentPostPending(),isPublished:e(b.store).isCurrentPostPublished(),isPublishSidebarEnabled:e(b.store).isPublishSidebarEnabled(),isPublishSidebarOpened:e(no).isPublishSidebarOpened(),isScheduled:e(b.store).isCurrentPostScheduled()}})),(0,m.withDispatch)((e=>{const{togglePublishSidebar:t}=e(no);return{togglePublishSidebar:t}})))((function({forceIsDirty:e,hasPublishAction:t,isBeingScheduled:o,isPending:n,isPublished:r,isPublishSidebarEnabled:s,isPublishSidebarOpened:i,isScheduled:l,togglePublishSidebar:c,setEntitiesSavedStatesCallback:d}){const u="toggle",m="button",p=(0,f.useViewportMatch)("medium","<");let g;return g=r||l&&o||n&&!t&&!p?m:p||s?u:m,(0,a.createElement)(b.PostPublishButton,{forceIsDirty:e,isOpen:i,isToggle:g===u,onToggle:c,setEntitiesSavedStatesCallback:d})})),Do="__experimentalMainDashboardButton",{Fill:Oo,Slot:Ro}=(0,_.createSlotFill)(Do),Vo=Oo;Vo.Slot=({children:e})=>{const t=(0,_.__experimentalUseSlotFills)(Do);return Boolean(t&&t.length)?(0,a.createElement)(Ro,{bubblesVirtually:!0}):e};const Go=Vo,{DocumentTools:zo,PostViewLink:Ho,PreviewDropdown:Uo}=Qe(b.privateApis),$o={hidden:{y:"-50px"},distractionFreeInactive:{y:0},hover:{y:0,transition:{type:"tween",delay:.2}}},Wo={hidden:{x:"-100%"},distractionFreeInactive:{x:0},hover:{x:0,transition:{type:"tween",delay:.2}}};const qo=function({setEntitiesSavedStatesCallback:e}){const t=(0,f.useViewportMatch)("large"),o=(0,f.useViewportMatch)("medium"),n=(0,u.useRef)(),{isTextEditor:r,hasBlockSelection:s,hasActiveMetaboxes:i,hasFixedToolbar:l,isPublishSidebarOpened:c,showIconLabels:d,hasHistory:p}=(0,m.useSelect)((e=>{const{get:t}=e(g.store),{getEditorMode:o}=e(no);return{isTextEditor:"text"===o(),hasBlockSelection:!!e(y.store).getBlockSelectionStart(),hasActiveMetaboxes:e(no).hasMetaBoxes(),hasHistory:!!e(b.store).getEditorSettings().goBack,isPublishSidebarOpened:e(no).isPublishSidebarOpened(),hasFixedToolbar:t("core","fixedToolbar"),showIconLabels:t("core","showIconLabels")}}),[]),[h,E]=(0,u.useState)(!0);return(0,u.useEffect)((()=>{s&&E(!1)}),[s]),(0,a.createElement)("div",{className:"edit-post-header"},(0,a.createElement)(Go.Slot,null,(0,a.createElement)(_.__unstableMotion.div,{variants:Wo,transition:{type:"tween",delay:.8}},(0,a.createElement)(Bo,{showTooltip:!0}))),(0,a.createElement)(_.__unstableMotion.div,{variants:$o,transition:{type:"tween",delay:.8},className:"edit-post-header__toolbar"},(0,a.createElement)(zo,{disableBlockTools:r}),l&&o&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:L()("selected-block-tools-wrapper",{"is-collapsed":h})},(0,a.createElement)(y.BlockToolbar,{hideDragHandle:!0})),(0,a.createElement)(_.Popover.Slot,{ref:n,name:"block-toolbar"}),s&&(0,a.createElement)(_.Button,{className:"edit-post-header__block-tools-toggle",icon:h?Co:Mo,onClick:()=>{E((e=>!e))},label:h?(0,v.__)("Show block tools"):(0,v.__)("Hide block tools")})),(0,a.createElement)("div",{className:L()("edit-post-header__center",{"is-collapsed":p&&s&&!h&&l&&o})},p&&(0,a.createElement)(b.DocumentBar,null))),(0,a.createElement)(_.__unstableMotion.div,{variants:$o,transition:{type:"tween",delay:.8},className:"edit-post-header__settings"},!c&&(0,a.createElement)(b.PostSavedState,{forceIsDirty:i}),(0,a.createElement)(Uo,{forceIsAutosaveable:i}),(0,a.createElement)(b.PostPreviewButton,{className:"edit-post-header__post-preview-button",forceIsAutosaveable:i}),(0,a.createElement)(Ho,null),(0,a.createElement)(Fo,{forceIsDirty:i,setEntitiesSavedStatesCallback:e}),(t||!d)&&(0,a.createElement)(ue.Slot,{scope:"core/edit-post"}),(0,a.createElement)(No,{showIconLabels:d})))},Qo=(0,a.createElement)(k.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(k.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"})),jo=(0,a.createElement)(k.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(k.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"})),{Tabs:Yo}=Qe(_.privateApis),Zo=()=>{const{documentLabel:e}=(0,m.useSelect)((e=>{const{getPostTypeLabel:t}=e(b.store);return{documentLabel:t()||(0,v._x)("Document","noun")}}),[]);return(0,a.createElement)(Yo.TabList,null,(0,a.createElement)(Yo.Tab,{tabId:Bn.document},e),(0,a.createElement)(Yo.Tab,{tabId:Bn.block},(0,v.__)("Block")))},{PostPanelRow:Xo}=Qe(b.privateApis);function Ko({isOpen:e,onClick:t}){const o=(0,b.usePostVisibilityLabel)();return(0,a.createElement)(_.Button,{className:"edit-post-post-visibility__toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,v.sprintf)((0,v.__)("Select visibility: %s"),o),onClick:t},o)}const Jo=function(){const[e,t]=(0,u.useState)(null),o=(0,u.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,a.createElement)(b.PostVisibilityCheck,{render:({canEdit:e})=>(0,a.createElement)(Xo,{label:(0,v.__)("Visibility"),ref:t},!e&&(0,a.createElement)("span",null,(0,a.createElement)(b.PostVisibilityLabel,null)),e&&(0,a.createElement)(_.Dropdown,{contentClassName:"edit-post-post-visibility__dialog",popoverProps:o,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,a.createElement)(Ko,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,a.createElement)(b.PostVisibility,{onClose:e})}))})};function en(){return(0,a.createElement)(b.PostTrashCheck,null,(0,a.createElement)(b.PostTrash,null))}const{PostPanelRow:tn}=Qe(b.privateApis);const on=function(){return(0,a.createElement)(b.PostStickyCheck,null,(0,a.createElement)(tn,null,(0,a.createElement)(b.PostSticky,null)))};const nn=function(){return(0,a.createElement)(b.PostSlugCheck,null,(0,a.createElement)(_.PanelRow,{className:"edit-post-post-slug"},(0,a.createElement)(b.PostSlug,null)))};const rn=function(){return(0,a.createElement)(b.PostFormatCheck,null,(0,a.createElement)(_.PanelRow,{className:"edit-post-post-format"},(0,a.createElement)(b.PostFormat,null)))},{PostPanelRow:sn}=Qe(b.privateApis);const an=function(){return(0,a.createElement)(b.PostPendingStatusCheck,null,(0,a.createElement)(sn,null,(0,a.createElement)(b.PostPendingStatus,null)))},{Fill:ln,Slot:cn}=(0,_.createSlotFill)("PluginPostStatusInfo"),dn=({children:e,className:t})=>(0,a.createElement)(ln,null,(0,a.createElement)(_.PanelRow,{className:t},e));dn.Slot=cn;const un=dn,mn="post-status";function pn(){const{isOpened:e,isRemoved:t}=(0,m.useSelect)((e=>{const{isEditorPanelRemoved:t,isEditorPanelOpened:o}=e(b.store);return{isRemoved:t(mn),isOpened:o(mn)}}),[]),{toggleEditorPanelOpened:o}=(0,m.useDispatch)(b.store);return t?null:(0,a.createElement)(_.PanelBody,{className:"edit-post-post-status",title:(0,v.__)("Summary"),opened:e,onToggle:()=>o(mn)},(0,a.createElement)(un.Slot,null,(e=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Jo,null),(0,a.createElement)(b.PostSchedulePanel,null),(0,a.createElement)(b.PostTemplatePanel,null),(0,a.createElement)(b.PostURLPanel,null),(0,a.createElement)(b.PostSyncStatus,null),(0,a.createElement)(on,null),(0,a.createElement)(an,null),(0,a.createElement)(rn,null),(0,a.createElement)(nn,null),(0,a.createElement)(b.PostAuthorPanel,null),e,(0,a.createElement)(_.__experimentalHStack,{style:{marginTop:"16px"},spacing:4,wrap:!0},(0,a.createElement)(b.PostSwitchToDraftButton,null),(0,a.createElement)(en,null))))))}const gn=function({location:e}){const t=(0,u.useRef)(null),o=(0,u.useRef)(null);(0,u.useEffect)((()=>(o.current=document.querySelector(".metabox-location-"+e),o.current&&t.current.appendChild(o.current),()=>{o.current&&document.querySelector("#metaboxes").appendChild(o.current)})),[e]);const n=(0,m.useSelect)((e=>e(no).isSavingMetaBoxes()),[]),r=L()("edit-post-meta-boxes-area",`is-${e}`,{"is-loading":n});return(0,a.createElement)("div",{className:r},n&&(0,a.createElement)(_.Spinner,null),(0,a.createElement)("div",{className:"edit-post-meta-boxes-area__container",ref:t}),(0,a.createElement)("div",{className:"edit-post-meta-boxes-area__clear"}))};class hn extends u.Component{componentDidMount(){this.updateDOM()}componentDidUpdate(e){this.props.isVisible!==e.isVisible&&this.updateDOM()}updateDOM(){const{id:e,isVisible:t}=this.props,o=document.getElementById(e);o&&(t?o.classList.remove("is-hidden"):o.classList.add("is-hidden"))}render(){return null}}const bn=(0,m.withSelect)(((e,{id:t})=>({isVisible:e(b.store).isEditorPanelEnabled(`meta-box-${t}`)})))(hn);function En({location:e}){const t=(0,m.useRegistry)(),{metaBoxes:o,areMetaBoxesInitialized:n,isEditorReady:r}=(0,m.useSelect)((t=>{const{__unstableIsEditorReady:o}=t(b.store),{getMetaBoxesPerLocation:n,areMetaBoxesInitialized:r}=t(no);return{metaBoxes:n(e),areMetaBoxesInitialized:r(),isEditorReady:o()}}),[e]),s=!!o?.length;return(0,u.useEffect)((()=>{r&&s&&!n&&t.dispatch(no).initializeMetaBoxes()}),[r,s,n]),n?(0,a.createElement)(a.Fragment,null,(null!=o?o:[]).map((({id:e})=>(0,a.createElement)(bn,{key:e,id:e}))),(0,a.createElement)(gn,{location:e})):null}window.wp.warning;const{Fill:_n,Slot:yn}=(0,_.createSlotFill)("PluginDocumentSettingPanel"),{EnablePluginDocumentSettingPanelOption:vn}=Qe(b.privateApis),fn=({name:e,className:t,title:o,icon:n,children:r})=>{const{name:s}=(0,M.usePluginContext)(),i=`${s}/${e}`,{opened:l,isEnabled:c}=(0,m.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:o}=e(b.store);return{opened:t(i),isEnabled:o(i)}}),[i]),{toggleEditorPanelOpened:d}=(0,m.useDispatch)(b.store);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(vn,{label:o,panelName:i}),(0,a.createElement)(_n,null,c&&(0,a.createElement)(_.PanelBody,{className:t,title:o,icon:n,opened:l,onToggle:()=>d(i)},r)))};fn.Slot=yn;const wn=fn;function Sn({className:e,...t}){const{postTitle:o,shortcut:n}=(0,m.useSelect)((e=>({postTitle:e(b.store).getEditedPostAttribute("title"),shortcut:e(fe.store).getShortcutRepresentation("core/edit-post/toggle-sidebar")})),[]);return(0,a.createElement)(ge,{panelClassName:e,className:"edit-post-sidebar",smallScreenTitle:o||(0,v.__)("(no title)"),scope:"core/edit-post",toggleShortcut:n,...t})}const Pn=(0,u.forwardRef)((function({icon:e,size:t=24,...o},n){return(0,u.cloneElement)(e,{width:t,height:t,...o,ref:n})})),kn=(0,a.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(k.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"}));const Cn=function(){const e=(0,m.useSelect)((e=>{const{getCurrentPost:t}=e(b.store);return t()}),[]);return e?(0,a.createElement)(_.PanelBody,null,(0,a.createElement)(_.Flex,{align:"flex-start",gap:"3"},(0,a.createElement)(_.FlexItem,null,(0,a.createElement)(Pn,{icon:kn})),(0,a.createElement)(_.FlexBlock,null,(0,a.createElement)("h2",{className:"edit-post-template-summary__title"},e?.title||e?.slug),(0,a.createElement)("p",null,e?.description)))):null},{Tabs:Mn}=Qe(_.privateApis),xn=u.Platform.select({web:!0,native:!1}),Bn={document:"edit-post/document",block:"edit-post/block"},Tn=({sidebarName:e,keyboardShortcut:t,isEditingTemplate:o})=>{const n=(0,u.useContext)(Mn.Context);return(0,a.createElement)(Sn,{identifier:e,header:(0,a.createElement)(Mn.Context.Provider,{value:n},(0,a.createElement)(Zo,null)),closeLabel:(0,v.__)("Close Settings"),className:"edit-post-sidebar__panel",headerClassName:"edit-post-sidebar__panel-tabs",title:(0,v.__)("Settings"),toggleShortcut:t,icon:(0,v.isRTL)()?Qo:jo,isActiveByDefault:xn},(0,a.createElement)(Mn.Context.Provider,{value:n},(0,a.createElement)(Mn.TabPanel,{tabId:Bn.document,focusable:!1},!o&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(pn,null),(0,a.createElement)(wn.Slot,null),(0,a.createElement)(b.PostLastRevisionPanel,null),(0,a.createElement)(b.PostTaxonomiesPanel,null),(0,a.createElement)(b.PostFeaturedImagePanel,null),(0,a.createElement)(b.PostExcerptPanel,null),(0,a.createElement)(b.PostDiscussionPanel,null),(0,a.createElement)(b.PageAttributesPanel,null),(0,a.createElement)(En,{location:"side"})),o&&(0,a.createElement)(Cn,null)),(0,a.createElement)(Mn.TabPanel,{tabId:Bn.block,focusable:!1},(0,a.createElement)(y.BlockInspector,null))))},An=()=>{const{sidebarName:e,isSettingsSidebarActive:t,keyboardShortcut:o,isEditingTemplate:n}=(0,m.useSelect)((e=>{let t=e(te).getActiveComplementaryArea(no.name),o=!0;[Bn.document,Bn.block].includes(t)||(o=!1,e(y.store).getBlockSelectionStart()&&(t=Bn.block),t=Bn.document);return{sidebarName:t,isSettingsSidebarActive:o,keyboardShortcut:e(fe.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),isEditingTemplate:"wp_template"===e(b.store).getCurrentPostType()}}),[]),{openGeneralSidebar:r}=(0,m.useDispatch)(no),s=(0,u.useCallback)((e=>{e&&r(e)}),[r]);return(0,a.createElement)(Mn,{selectedTabId:t?e:null,onSelect:s},(0,a.createElement)(Tn,{sidebarName:e,keyboardShortcut:o,isEditingTemplate:n}))};function In({nonAnimatedSrc:e,animatedSrc:t}){return(0,a.createElement)("picture",{className:"edit-post-welcome-guide__image"},(0,a.createElement)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,a.createElement)("img",{src:t,width:"312",height:"240",alt:""}))}function Ln(){const{toggleFeature:e}=(0,m.useDispatch)(no);return(0,a.createElement)(_.Guide,{className:"edit-post-welcome-guide",contentLabel:(0,v.__)("Welcome to the block editor"),finishButtonText:(0,v.__)("Get started"),onFinish:()=>e("welcomeGuide"),pages:[{image:(0,a.createElement)(In,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,v.__)("Welcome to the block editor")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,v.__)("In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.")))},{image:(0,a.createElement)(In,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,v.__)("Make each block your own")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,v.__)("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,a.createElement)(In,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,v.__)("Get to know the block library")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,u.createInterpolateElement)((0,v.__)("All of the blocks available to you live in the block library. Youll find it wherever you see the <InserterIconImage /> icon."),{InserterIconImage:(0,a.createElement)("img",{alt:(0,v.__)("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,a.createElement)(In,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,v.__)("Learn how to use the block editor")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,v.__)("New to the block editor? Want to learn more about using it? "),(0,a.createElement)(_.ExternalLink,{href:(0,v.__)("https://wordpress.org/documentation/article/wordpress-block-editor/")},(0,v.__)("Here's a detailed guide."))))}]})}function Nn(){const{toggleFeature:e}=(0,m.useDispatch)(no);return(0,a.createElement)(_.Guide,{className:"edit-template-welcome-guide",contentLabel:(0,v.__)("Welcome to the template editor"),finishButtonText:(0,v.__)("Get started"),onFinish:()=>e("welcomeGuideTemplate"),pages:[{image:(0,a.createElement)(In,{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,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,v.__)("Welcome to the template editor")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,v.__)("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 Fn(){const{isActive:e,isEditingTemplate:t}=(0,m.useSelect)((e=>{const{isFeatureActive:t}=e(no),{getCurrentPostType:o}=e(b.store),n="wp_template"===o();return{isActive:t(n?"welcomeGuideTemplate":"welcomeGuide"),isEditingTemplate:n}}),[]);return e?t?(0,a.createElement)(Nn,null):(0,a.createElement)(Ln,null):null}const{Fill:Dn,Slot:On}=(0,_.createSlotFill)("PluginPostPublishPanel"),Rn=({children:e,className:t,title:o,initialOpen:n=!1,icon:r})=>{const{icon:s}=(0,M.usePluginContext)();return(0,a.createElement)(Dn,null,(0,a.createElement)(_.PanelBody,{className:t,initialOpen:n||!o,title:o,icon:null!=r?r:s},e))};Rn.Slot=On;const Vn=Rn,{Fill:Gn,Slot:zn}=(0,_.createSlotFill)("PluginPrePublishPanel"),Hn=({children:e,className:t,title:o,initialOpen:n=!1,icon:r})=>{const{icon:s}=(0,M.usePluginContext)();return(0,a.createElement)(Gn,null,(0,a.createElement)(_.PanelBody,{className:t,initialOpen:n||!o,title:o,icon:null!=r?r:s},e))};Hn.Slot=zn;const Un=Hn,{Fill:$n,Slot:Wn}=(0,_.createSlotFill)("ActionsPanel");function qn({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:o}){const{closePublishSidebar:n,togglePublishSidebar:r}=(0,m.useDispatch)(no),{publishSidebarOpened:s,hasActiveMetaboxes:i,hasNonPostEntityChanges:l}=(0,m.useSelect)((e=>({publishSidebarOpened:e(no).isPublishSidebarOpened(),hasActiveMetaboxes:e(no).hasMetaBoxes(),hasNonPostEntityChanges:e(b.store).hasNonPostEntityChanges()})),[]),c=(0,u.useCallback)((()=>e(!0)),[]);let d;return d=s?(0,a.createElement)(b.PostPublishPanel,{onClose:n,forceIsDirty:i,PrePublishExtension:Un.Slot,PostPublishExtension:Vn.Slot}):l?(0,a.createElement)("div",{className:"edit-post-layout__toggle-entities-saved-states-panel"},(0,a.createElement)(_.Button,{variant:"secondary",className:"edit-post-layout__toggle-entities-saved-states-panel-button",onClick:c,"aria-expanded":!1},(0,v.__)("Open save panel"))):(0,a.createElement)("div",{className:"edit-post-layout__toggle-publish-panel"},(0,a.createElement)(_.Button,{variant:"secondary",className:"edit-post-layout__toggle-publish-panel-button",onClick:r,"aria-expanded":!1},(0,v.__)("Open publish panel"))),(0,a.createElement)(a.Fragment,null,o&&(0,a.createElement)(b.EntitiesSavedStates,{close:t}),(0,a.createElement)(Wn,{bubblesVirtually:!0}),!o&&d)}function Qn({blockPatterns:e,onChoosePattern:t}){const o=(0,f.useAsyncList)(e),{resetEditorBlocks:n}=(0,m.useDispatch)(b.store);return(0,a.createElement)(y.__experimentalBlockPatternsList,{blockPatterns:e,shownPatterns:o,onClickPattern:(e,o)=>{n(o),t()}})}function jn({onClose:e}){const t=function(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,m.useSelect)((e=>{const{getPatternsByBlockTypes:t}=e(y.store),{getCurrentPostType:o}=e(b.store);return{blockPatternsWithPostContentBlockType:t("core/post-content"),postType:o()}}),[]);return(0,u.useMemo)((()=>e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t)))),[t,e])}();return t.length>0?(0,a.createElement)(_.Modal,{className:"edit-post-start-page-options__modal",title:(0,v.__)("Choose a pattern"),isFullScreen:!0,onRequestClose:e},(0,a.createElement)("div",{className:"edit-post-start-page-options__modal-content"},(0,a.createElement)(Qn,{blockPatterns:t,onChoosePattern:e}))):null}function Yn(){const[e,t]=(0,u.useState)(!1),o=(0,m.useSelect)((e=>{const{isCleanNewPost:t,getRenderingMode:o}=e(b.store),{isFeatureActive:n}=e(no);return"post-only"===o()&&!n("welcomeGuide")&&t()}),[]);return!o||e?null:(0,a.createElement)(jn,{onClose:()=>t(!0)})}const Zn=(0,a.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(k.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"})),Xn=(0,a.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(k.Path,{d:"M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z"})),Kn=(0,a.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(k.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})),Jn=(0,a.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(k.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"})),er=(0,a.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(k.Path,{d:"m16 15.5h-8v-1.5h8zm-7.5-2.5h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm-9-3h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2z"}),(0,a.createElement)(k.Path,{d:"m18.5 6.5h-13a.5.5 0 0 0 -.5.5v9.5a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9.5a.5.5 0 0 0 -.5-.5zm-13-1.5h13a2 2 0 0 1 2 2v9.5a2 2 0 0 1 -2 2h-13a2 2 0 0 1 -2-2v-9.5a2 2 0 0 1 2-2z"})),tr=(0,a.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(k.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}));const{getLayoutStyles:or}=Qe(y.privateApis),{useCommands:nr}=Qe(Re.privateApis),{useCommandContext:rr}=Qe(Oe.privateApis),{InserterSidebar:sr,ListViewSidebar:ar}=Qe(b.privateApis),ir={header:(0,v.__)("Editor top bar"),body:(0,v.__)("Editor content"),sidebar:(0,v.__)("Editor settings"),actions:(0,v.__)("Editor publish"),footer:(0,v.__)("Editor footer")};const lr=function(){nr(),function(){const{openGeneralSidebar:e,closeGeneralSidebar:t,switchEditorMode:o,toggleDistractionFree:n}=(0,m.useDispatch)(no),{openModal:r}=(0,m.useDispatch)(te),{editorMode:s,activeSidebar:a,isListViewOpen:i,isFullscreen:l,isPublishSidebarEnabled:c,showBlockBreadcrumbs:d,isDistractionFree:u,isTopToolbar:p,isFocusMode:h}=(0,m.useSelect)((e=>{const{get:t}=e(g.store),{getEditorMode:o}=e(no),{isListViewOpened:n}=e(b.store);return{activeSidebar:e(te).getActiveComplementaryArea(no.name),editorMode:o(),isListViewOpen:n(),isPublishSidebarEnabled:e(b.store).isPublishSidebarEnabled(),showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),isDistractionFree:t("core","distractionFree"),isFocusMode:t("core","focusMode"),isTopToolbar:t("core","fixedToolbar"),isFullscreen:t("core/edit-post","fullscreenMode")}}),[]),{toggle:E}=(0,m.useDispatch)(g.store),{createInfoNotice:_}=(0,m.useDispatch)(B.store),{__unstableSaveForPreview:y,setIsListViewOpened:f}=(0,m.useDispatch)(b.store),{getCurrentPostId:w}=(0,m.useSelect)(b.store);(0,Oe.useCommand)({name:"core/open-settings-sidebar",label:(0,v.__)("Toggle settings sidebar"),icon:(0,v.isRTL)()?Qo:jo,callback:({close:o})=>{o(),"edit-post/document"===a?t():e("edit-post/document")}}),(0,Oe.useCommand)({name:"core/open-block-inspector",label:(0,v.__)("Toggle block inspector"),icon:Zn,callback:({close:o})=>{o(),"edit-post/block"===a?t():e("edit-post/block")}}),(0,Oe.useCommand)({name:"core/toggle-distraction-free",label:u?(0,v.__)("Exit Distraction Free"):(0,v.__)("Enter Distraction Free "),callback:({close:e})=>{n(),e()}}),(0,Oe.useCommand)({name:"core/toggle-spotlight-mode",label:(0,v.__)("Toggle spotlight"),callback:({close:e})=>{E("core","focusMode"),e(),_(h?(0,v.__)("Spotlight off."):(0,v.__)("Spotlight on."),{id:"core/edit-post/toggle-spotlight-mode/notice",type:"snackbar",actions:[{label:(0,v.__)("Undo"),onClick:()=>{E("core","focusMode")}}]})}}),(0,Oe.useCommand)({name:"core/toggle-fullscreen-mode",label:l?(0,v.__)("Exit fullscreen"):(0,v.__)("Enter fullscreen"),icon:Xn,callback:({close:e})=>{E("core/edit-post","fullscreenMode"),e(),_(l?(0,v.__)("Fullscreen off."):(0,v.__)("Fullscreen on."),{id:"core/edit-post/toggle-fullscreen-mode/notice",type:"snackbar",actions:[{label:(0,v.__)("Undo"),onClick:()=>{E("core/edit-post","fullscreenMode")}}]})}}),(0,Oe.useCommand)({name:"core/toggle-list-view",label:i?(0,v.__)("Close List View"):(0,v.__)("Open List View"),icon:Kn,callback:({close:e})=>{f(!i),e(),_(i?(0,v.__)("List View off."):(0,v.__)("List View on."),{id:"core/edit-post/toggle-list-view/notice",type:"snackbar"})}}),(0,Oe.useCommand)({name:"core/toggle-top-toolbar",label:(0,v.__)("Toggle top toolbar"),callback:({close:e})=>{E("core","fixedToolbar"),u&&n(),e(),_(p?(0,v.__)("Top toolbar off."):(0,v.__)("Top toolbar on."),{id:"core/edit-post/toggle-top-toolbar/notice",type:"snackbar",actions:[{label:(0,v.__)("Undo"),onClick:()=>{E("core","fixedToolbar")}}]})}}),(0,Oe.useCommand)({name:"core/toggle-code-editor",label:"visual"===s?(0,v.__)("Open code editor"):(0,v.__)("Exit code editor"),icon:Jn,callback:({close:e})=>{o("visual"===s?"text":"visual"),e()}}),(0,Oe.useCommand)({name:"core/open-preferences",label:(0,v.__)("Editor preferences"),callback:()=>{r(wo)}}),(0,Oe.useCommand)({name:"core/open-shortcut-help",label:(0,v.__)("Keyboard shortcuts"),icon:er,callback:()=>{r(Ce)}}),(0,Oe.useCommand)({name:"core/toggle-breadcrumbs",label:d?(0,v.__)("Hide block breadcrumbs"):(0,v.__)("Show block breadcrumbs"),callback:({close:e})=>{E("core","showBlockBreadcrumbs"),e(),_(d?(0,v.__)("Breadcrumbs hidden."):(0,v.__)("Breadcrumbs visible."),{id:"core/edit-post/toggle-breadcrumbs/notice",type:"snackbar"})}}),(0,Oe.useCommand)({name:"core/toggle-publish-sidebar",label:c?(0,v.__)("Disable pre-publish checks"):(0,v.__)("Enable pre-publish checks"),icon:tr,callback:({close:e})=>{e(),E("core/edit-post","isPublishSidebarEnabled"),_(c?(0,v.__)("Pre-publish checks disabled."):(0,v.__)("Pre-publish checks enabled."),{id:"core/edit-post/publish-sidebar/notice",type:"snackbar"})}}),(0,Oe.useCommand)({name:"core/preview-link",label:(0,v.__)("Preview in a new tab"),icon:C,callback:async({close:e})=>{e();const t=w(),o=await y();window.open(o,`wp-preview-${t}`)}})}(),(0,y.useBlockCommands)();const e=(0,f.useViewportMatch)("medium","<"),t=(0,f.useViewportMatch)("huge",">="),o=(0,f.useViewportMatch)("large"),n=(0,f.useViewportMatch)("medium"),{openGeneralSidebar:r,closeGeneralSidebar:s}=(0,m.useDispatch)(no),{createErrorNotice:i}=(0,m.useDispatch)(B.store),{setIsInserterOpened:l}=(0,m.useDispatch)(b.store),{mode:c,isFullscreenActive:d,isRichEditingEnabled:p,sidebarIsOpened:h,hasActiveMetaboxes:E,previousShortcut:w,nextShortcut:S,hasBlockSelected:P,isInserterOpened:k,isListViewOpened:x,showIconLabels:T,isDistractionFree:A,showBlockBreadcrumbs:I,showMetaBoxes:N,documentLabel:F,hasHistory:D}=(0,m.useSelect)((e=>{const{get:t}=e(g.store),{getEditorSettings:o,getPostTypeLabel:n}=e(b.store),r=o(),s=n();return{showMetaBoxes:"post-only"===e(b.store).getRenderingMode(),sidebarIsOpened:!(!e(te).getActiveComplementaryArea(no.name)&&!e(no).isPublishSidebarOpened()),isFullscreenActive:e(no).isFeatureActive("fullscreenMode"),isInserterOpened:e(b.store).isInserterOpened(),isListViewOpened:e(b.store).isListViewOpened(),mode:e(no).getEditorMode(),isRichEditingEnabled:r.richEditingEnabled,hasActiveMetaboxes:e(no).hasMetaBoxes(),previousShortcut:e(fe.store).getAllShortcutKeyCombinations("core/edit-post/previous-region"),nextShortcut:e(fe.store).getAllShortcutKeyCombinations("core/edit-post/next-region"),showIconLabels:t("core","showIconLabels"),isDistractionFree:t("core","distractionFree"),showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),documentLabel:s||(0,v._x)("Document","noun"),hasBlockSelected:!!e(y.store).getBlockSelectionStart(),hasHistory:!!o().goBack}}),[]);rr(P?"block-selection-edit":"post-editor-edit");const O=function(){const{hasThemeStyleSupport:e,editorSettings:t}=(0,m.useSelect)((e=>({hasThemeStyleSupport:e(no).isFeatureActive("themeStyles"),editorSettings:e(b.store).getEditorSettings()})),[]);return(0,u.useMemo)((()=>{var o,n;const r=null!==(o=t.styles?.filter((e=>e.__unstableType&&"theme"!==e.__unstableType)))&&void 0!==o?o:[],s=[...t.defaultEditorStyles,...r],a=e&&r.length!==(null!==(n=t.styles?.length)&&void 0!==n?n:0);return t.disableLayoutStyles||a||s.push({css:or({style:{},selector:"body",hasBlockGapSupport:!1,hasFallbackGapSupport:!0,fallbackGapValue:"0.5em"})}),a?t.styles:s}),[t.defaultEditorStyles,t.disableLayoutStyles,t.styles,e])}();(0,u.useEffect)((()=>{h&&!t&&l(!1)}),[t,l,h]),(0,u.useEffect)((()=>{k&&!t&&s()}),[s,k,t]);const[R,V]=(0,u.useState)(!1),G=(0,u.useCallback)((e=>{"function"==typeof R&&R(e),V(!1)}),[R]);T?document.body.classList.add("show-icon-labels"):document.body.classList.remove("show-icon-labels");const z=L()("edit-post-layout","is-mode-"+c,{"is-sidebar-opened":h,"has-metaboxes":E,"is-distraction-free":A&&o,"is-entity-save-view-open":!!R}),H=x?(0,v.__)("Document Overview"):(0,v.__)("Block Library");return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(he,{isActive:d}),(0,a.createElement)(ko,{hasHistory:D}),(0,a.createElement)(b.UnsavedChangesWarning,null),(0,a.createElement)(b.AutosaveMonitor,null),(0,a.createElement)(b.LocalAutosaveMonitor,null),(0,a.createElement)(lo,null),(0,a.createElement)(b.EditorKeyboardShortcutsRegister,null),(0,a.createElement)(b.EditorKeyboardShortcuts,null),(0,a.createElement)(_e,{isDistractionFree:A&&o,className:z,labels:{...ir,secondarySidebar:H},header:(0,a.createElement)(qo,{setEntitiesSavedStatesCallback:V}),editorNotices:(0,a.createElement)(b.EditorNotices,null),secondarySidebar:"visual"===c&&k?(0,a.createElement)(sr,null):"visual"===c&&x?(0,a.createElement)(ar,null):null,sidebar:(!e||h)&&(0,a.createElement)(a.Fragment,null,!e&&!h&&(0,a.createElement)("div",{className:"edit-post-layout__toggle-sidebar-panel"},(0,a.createElement)(_.Button,{variant:"secondary",className:"edit-post-layout__toggle-sidebar-panel-button",onClick:()=>r(P?"edit-post/block":"edit-post/document"),"aria-expanded":!1},P?(0,v.__)("Open block settings"):(0,v.__)("Open document settings"))),(0,a.createElement)(ge.Slot,{scope:"core/edit-post"})),notices:(0,a.createElement)(b.EditorSnackbars,null),content:(0,a.createElement)(a.Fragment,null,!A&&(0,a.createElement)(b.EditorNotices,null),("text"===c||!p)&&(0,a.createElement)(ro,null),!n&&(0,a.createElement)(y.BlockToolbar,{hideDragHandle:!0}),p&&"visual"===c&&(0,a.createElement)(io,{styles:O}),!A&&N&&(0,a.createElement)("div",{className:"edit-post-layout__metaboxes"},(0,a.createElement)(En,{location:"normal"}),(0,a.createElement)(En,{location:"advanced"})),e&&h&&(0,a.createElement)(_.ScrollLock,null)),footer:!A&&!e&&I&&p&&"visual"===c&&(0,a.createElement)("div",{className:"edit-post-layout__footer"},(0,a.createElement)(y.BlockBreadcrumb,{rootLabelText:F})),actions:(0,a.createElement)(qn,{closeEntitiesSavedStates:G,isEntitiesSavedStatesOpen:R,setEntitiesSavedStatesCallback:V}),shortcuts:{previous:w,next:S}}),(0,a.createElement)(So,null),(0,a.createElement)(Te,null),(0,a.createElement)(Fn,null),(0,a.createElement)(b.PostSyncStatusModal,null),(0,a.createElement)(Yn,null),(0,a.createElement)(M.PluginArea,{onError:function(e){i((0,v.sprintf)((0,v.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}),(0,a.createElement)(An,null))},cr=e=>{const{hasBlockSelection:t,isEditorSidebarOpened:o}=(0,m.useSelect)((e=>({hasBlockSelection:!!e(y.store).getBlockSelectionStart(),isEditorSidebarOpened:e(oo).isEditorSidebarOpened()})),[e]),{openGeneralSidebar:n}=(0,m.useDispatch)(oo);(0,u.useEffect)((()=>{o&&n(t?"edit-post/block":"edit-post/document")}),[t,o])},dr=e=>{const{newPermalink:t}=(0,m.useSelect)((e=>({newPermalink:e(b.store).getCurrentPost().link})),[e]),o=(0,u.useRef)();(0,u.useEffect)((()=>{o.current=document.querySelector("#wp-admin-bar-preview a")||document.querySelector("#wp-admin-bar-view a")}),[e]),(0,u.useEffect)((()=>{t&&o.current&&o.current.setAttribute("href",t)}),[t])};function ur({postId:e}){return cr(e),dr(e),null}const{ExperimentalEditorProvider:mr}=Qe(b.privateApis);const pr=function({postId:e,postType:t,settings:o,initialEdits:n,...r}){const{currentPost:s,getPostLinkProps:i,goBack:l}=function(e,t){const[o,n]=(0,u.useReducer)(((e,{type:t,post:o})=>"push"===t?[...e,o]:"pop"===t&&e.length>1?e.slice(0,-1):e),[{postId:e,postType:t}]),r=(0,u.useCallback)((e=>{const t=(0,x.getQueryArgs)(window.location.href),o=(0,x.removeQueryArgs)(window.location.href,...Object.keys(t));return{href:(0,x.addQueryArgs)(o,{post:e.postId,action:"edit"}),onClick:t=>{t?.preventDefault(),n({type:"push",post:{postId:e.postId,postType:e.postType}})}}}),[]),s=(0,u.useCallback)((()=>{n({type:"pop"})}),[]);return{currentPost:o[o.length-1],getPostLinkProps:r,goBack:o.length>1?s:void 0}}(e,t),{hasInlineToolbar:c,post:d,preferredStyleVariations:p,template:h}=(0,m.useSelect)((e=>{var t;const{isFeatureActive:o,getEditedPostTemplate:n}=e(no),{getEntityRecord:r,getPostType:a,canUser:i}=e(P.store),{getEditorSettings:l}=e(b.store),c=r("postType",s.postType,s.postId),d=l().supportsTemplateMode,u=null!==(t=a(s.postType)?.viewable)&&void 0!==t&&t,m=i("create","templates");return{hasInlineToolbar:o("inlineToolbar"),preferredStyleVariations:e(g.store).get("core/edit-post","preferredStyleVariations"),template:d&&u&&m&&"wp_template"!==s.postType?n():null,post:c}}),[s.postType,s.postId]),{updatePreferredStyleVariations:E}=(0,m.useDispatch)(no),y="wp_template"===s.postType?"all":"post-only",v=(0,u.useMemo)((()=>({...o,getPostLinkProps:i,goBack:l,defaultRenderingMode:y,__experimentalPreferredStyleVariations:{value:p,onChange:E},hasInlineToolbar:c})),[o,c,p,E,i,l,y]);return d?(0,a.createElement)(_.SlotFillProvider,null,(0,a.createElement)(mr,{settings:v,post:d,initialEdits:n,useSubRegistry:!1,__unstableTemplate:h,...r},(0,a.createElement)(b.ErrorBoundary,null,(0,a.createElement)(Oe.CommandMenu,null),(0,a.createElement)(ur,{postId:s.postId}),(0,a.createElement)(lr,null)),(0,a.createElement)(b.PostLockedModal,null))):null},gr=({allowedBlocks:e,icon:t,label:o,onClick:n,small:r,role:s})=>(0,a.createElement)(y.BlockSettingsMenuControls,null,(({selectedBlocks:i,onClose:l})=>((e,t)=>{return!Array.isArray(t)||(o=t,0===e.filter((e=>!o.includes(e))).length);var o})(i,e)?(0,a.createElement)(_.MenuItem,{onClick:(0,f.compose)(n,l),icon:t,label:r?o:void 0,role:s},!r&&o):null)),hr=(0,f.compose)((0,M.withPluginContext)(((e,t)=>{var o;return{as:null!==(o=t.as)&&void 0!==o?o:_.MenuItem,icon:t.icon||e.icon,name:"core/edit-post/plugin-more-menu"}})))(ie);function br(e){return(0,a.createElement)(ce,{__unstableExplicitMenuItem:!0,scope:"core/edit-post",...e})}const{PluginPostExcerpt:Er}=Qe(b.privateApis);function _r(e,t,o,n,r){const s=document.getElementById(e),c=(0,u.createRoot)(s);(0,m.dispatch)(g.store).setDefaults("core/edit-post",{fullscreenMode:!0,isPublishSidebarEnabled:!0,preferredStyleVariations:{},themeStyles:!0,welcomeGuide:!0,welcomeGuideTemplate:!0}),(0,m.dispatch)(g.store).setDefaults("core",{allowRightClickOverrides:!0,editorMode:"visual",fixedToolbar:!1,hiddenBlockTypes:[],inactivePanels:[],openPanels:["post-status"],showBlockBreadcrumbs:!0,showIconLabels:!1,showListViewByDefault:!1}),(0,m.dispatch)(i.store).reapplyBlockTypeFilters(),(0,m.select)(g.store).get("core","showListViewByDefault")&&!(0,m.select)(g.store).get("core","distractionFree")&&(0,m.dispatch)(b.store).setIsListViewOpened(!0),(0,l.registerCoreBlocks)(),(0,h.registerLegacyWidgetBlock)({inserter:!1}),(0,h.registerWidgetGroupBlock)({inserter:!1}),(0,p.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((e,t)=>("post-only"!==(0,m.select)(b.store).getRenderingMode()||"core/template-part"!==t.name)&&e)),(0,p.addFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",((e,t,o,{getBlockParentsByBlockName:n})=>"post-only"===(0,m.select)(b.store).getRenderingMode()&&"core/post-content"===t.name?n(o,"core/query").length>0:e));"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,a.createElement)(pr,{settings:n,postId:o,postType:t,initialEdits:r})),c}function yr(){d()("wp.editPost.reinitializeEditor",{since:"6.2",version:"6.3"})}})(),(window.wp=window.wp||{}).editPost=n})();