WordPress/wp-includes/js/dist/edit-post.min.js
davidbaumwald 4de88db482 Editor: Update packages for 6.1 Beta 3.
Package updates for bug and regression fixes:

* @wordpress/annotations: 2.17.3
* @wordpress/block-directory: 3.15.4
* @wordpress/block-editor: 10.0.4
* @wordpress/block-library: 7.14.4
* @wordpress/blocks: 11.16.4
* @wordpress/components: 21.0.4
* @wordpress/core-data: 5.0.4
* @wordpress/customize-widgets: 3.14.4
* @wordpress/data: 7.1.3
* @wordpress/data-controls: 2.17.3
* @wordpress/edit-post: 6.14.4
* @wordpress/edit-site: 4.14.5
* @wordpress/edit-widgets: 4.14.4
* @wordpress/editor: 12.16.4
* @wordpress/format-library: 3.15.4
* @wordpress/interface: 4.16.3
* @wordpress/keyboard-shortcuts: 3.15.3
* @wordpress/list-reusable-blocks: 3.15.4
* @wordpress/notices: 3.17.3
* @wordpress/nux: 5.15.4
* @wordpress/preferences: 2.9.4
* @wordpress/reusable-blocks: 3.15.4
* @wordpress/rich-text: 5.15.3
* @wordpress/server-side-render: 3.15.4
* @wordpress/style-engine: 1.0.3
* @wordpress/viewport: 4.15.3
* @wordpress/widgets: 2.15.4

References:
* [https://github.com/WordPress/gutenberg/pull/44634 Gutenberg PR 44634] – Quote block: stop slash inserter popup showing in citation
* [https://github.com/WordPress/gutenberg/pull/44630 Gutenberg PR 44630] – Query Loop: Fix condition for displaying 'parents' control
* [https://github.com/WordPress/gutenberg/pull/44554 Gutenberg PR 44554] – Hide the Classic block in the Site Editor
* [https://github.com/WordPress/gutenberg/pull/44594 Gutenberg PR 44594] – Fix navigation block console error
* [https://github.com/WordPress/gutenberg/pull/44555 Gutenberg PR 44555] – Theme export: Fix broken spacingScale export
* [https://github.com/WordPress/gutenberg/pull/44580 Gutenberg PR 44580] – Code Block: Add box-sizing to fix inconsistent layout
* [https://github.com/WordPress/gutenberg/pull/44556 Gutenberg PR 44556] – Remove border from Global Styles previews
* [https://github.com/WordPress/gutenberg/pull/44141 Gutenberg PR 44141] – Spacing presets: Modify the styling of the input controls when in unlinked mode in order to better differentiate sides
* [https://github.com/WordPress/gutenberg/pull/44453 Gutenberg PR 44453] – Preserve the generic signature of getEntityRecord and getEntityRecords through currying
* [https://github.com/WordPress/gutenberg/pull/44504 Gutenberg PR 44504] – Theme.json: fix some outline properties doesn't work properly on the editor
* [https://github.com/WordPress/gutenberg/pull/44516 Gutenberg PR 44516] – Add style engine to editor tsconfig references
* [https://github.com/WordPress/gutenberg/pull/44523 Gutenberg PR 44523] – Query Loop Block: Rename Query Loop variations allowControls to allowedControls
* [https://github.com/WordPress/gutenberg/pull/44520 Gutenberg PR 44520] – Post Featured Image: Fix application of default border style in editor
* [https://github.com/WordPress/gutenberg/pull/44286 Gutenberg PR 44286] – Post Featured Image: Fix borders after addition of overlay feature
* [https://github.com/WordPress/gutenberg/pull/44482 Gutenberg PR 44482] – Template Editor: Fix crashes due to undefined variables
* [https://github.com/WordPress/gutenberg/pull/44480 Gutenberg PR 44480] – Template Parts: Prevent adding block in post editor or inside post template or content blocks
* [https://github.com/WordPress/gutenberg/pull/44425 Gutenberg PR 44425] – Fix rotated image crop area aspect ratio
* [https://github.com/WordPress/gutenberg/pull/44485 Gutenberg PR 44485] – Fix padding/margin visualizer accuracy
* [https://github.com/WordPress/gutenberg/pull/44569 Gutenberg PR 44569] – Theme.json: Fix some shadow properties that do not work properly in the site editor
* [https://github.com/WordPress/gutenberg/pull/44575 Gutenberg PR 44575] – ToggleGroupControl: Fix unselected icon color
* [https://github.com/WordPress/gutenberg/pull/44526 Gutenberg PR 44526] – TokenInput Field: Try alternative approach to fix screen reader focus issue
* [https://github.com/WordPress/gutenberg/pull/44506 Gutenberg PR 44506] – Edit Post: Optimize legacy post content layout
* [https://github.com/WordPress/gutenberg/pull/44258 Gutenberg PR 44258] – Add layout styles from Post Content block to post editor

Follow-up to [54257] and [54335].

Props czapla, isabel_brison, wildworks, bernhard-reiter, hellofromTonya.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54383


git-svn-id: http://core.svn.wordpress.org/trunk@53942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-04 15:06:52 +00:00

7 lines
113 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 */
!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 l={}.hasOwnProperty;function o(){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 a=o.apply(null,n);a&&e.push(a)}}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)l.call(n,s)&&n[s]&&e.push(s)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()}},t={};function n(l){var o=t[l];if(void 0!==o)return o.exports;var r=t[l]={exports:{}};return e[l](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 l in t)n.o(t,l)&&!n.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},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 l={};!function(){"use strict";n.r(l),n.d(l,{PluginBlockSettingsMenuItem:function(){return yo},PluginDocumentSettingPanel:function(){return zl},PluginMoreMenuItem:function(){return wo},PluginPostPublishPanel:function(){return no},PluginPostStatusInfo:function(){return ml},PluginPrePublishPanel:function(){return ao},PluginSidebar:function(){return $l},PluginSidebarMoreMenuItem:function(){return So},__experimentalFullscreenModeClose:function(){return Pn},__experimentalMainDashboardButton:function(){return Gn},initializeEditor:function(){return Po},reinitializeEditor:function(){return ko},store:function(){return Rt}});var e={};n.r(e),n.d(e,{disableComplementaryArea:function(){return $},enableComplementaryArea:function(){return z},pinItem:function(){return W},setDefaultComplementaryArea:function(){return H},setFeatureDefaults:function(){return Y},setFeatureValue:function(){return K},toggleFeature:function(){return j},unpinItem:function(){return q}});var t={};n.r(t),n.d(t,{getActiveComplementaryArea:function(){return X},isFeatureActive:function(){return Z},isItemPinned:function(){return Q}});var o={};n.r(o),n.d(o,{__experimentalSetPreviewDeviceType:function(){return Ke},__unstableCreateTemplate:function(){return Je},__unstableSwitchToTemplateMode:function(){return Ze},closeGeneralSidebar:function(){return Be},closeModal:function(){return Ie},closePublishSidebar:function(){return Ae},hideBlockTypes:function(){return ze},initializeMetaBoxes:function(){return tt},metaBoxUpdatesFailure:function(){return je},metaBoxUpdatesSuccess:function(){return qe},openGeneralSidebar:function(){return xe},openModal:function(){return Me},openPublishSidebar:function(){return Ne},removeEditorPanel:function(){return Re},requestMetaBoxUpdates:function(){return We},setAvailableMetaBoxesPerLocation:function(){return $e},setIsEditingTemplate:function(){return Qe},setIsInserterOpened:function(){return Ye},setIsListViewOpened:function(){return Xe},showBlockTypes:function(){return He},switchEditorMode:function(){return Ve},toggleEditorPanelEnabled:function(){return Oe},toggleEditorPanelOpened:function(){return De},toggleFeature:function(){return Fe},togglePinnedPluginItem:function(){return Ue},togglePublishSidebar:function(){return Le},updatePreferredStyleVariations:function(){return Ge}});var r={};n.r(r),n.d(r,{__experimentalGetInsertionPoint:function(){return It},__experimentalGetPreviewDeviceType:function(){return Bt},areMetaBoxesInitialized:function(){return Lt},getActiveGeneralSidebarName:function(){return dt},getActiveMetaBoxLocations:function(){return wt},getAllMetaBoxes:function(){return Tt},getEditedPostTemplate:function(){return Ot},getEditorMode:function(){return it},getHiddenBlockTypes:function(){return gt},getMetaBoxesPerLocation:function(){return Pt},getPreference:function(){return pt},getPreferences:function(){return mt},hasMetaBoxes:function(){return Ct},isEditingTemplate:function(){return At},isEditorPanelEnabled:function(){return _t},isEditorPanelOpened:function(){return bt},isEditorPanelRemoved:function(){return Et},isEditorSidebarOpened:function(){return ct},isFeatureActive:function(){return vt},isInserterOpened:function(){return Mt},isListViewOpened:function(){return Nt},isMetaBoxLocationActive:function(){return kt},isMetaBoxLocationVisible:function(){return St},isModalActive:function(){return ft},isPluginItemPinned:function(){return yt},isPluginSidebarOpened:function(){return ut},isPublishSidebarOpened:function(){return ht},isSavingMetaBoxes:function(){return xt}});var a=window.wp.element,s=window.wp.blocks,i=window.wp.blockLibrary,c=window.wp.data,u=window.wp.hooks,d=window.wp.preferences,m=window.wp.mediaUtils;function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},p.apply(this,arguments)}(0,u.addFilter)("editor.MediaUpload","core/edit-post/replace-media-upload",(()=>m.MediaUpload));var g=window.lodash,h=window.wp.components,E=window.wp.blockEditor,_=window.wp.i18n,b=window.wp.compose;const f=(0,b.compose)((0,c.withSelect)(((e,t)=>{if((0,s.hasBlockSupport)(t.name,"multiple",!0))return{};const n=e(E.store).getBlocks(),l=(0,g.find)(n,(e=>{let{name:n}=e;return t.name===n}));return{originalBlockClientId:l&&l.clientId!==t.clientId&&l.clientId}})),(0,c.withDispatch)(((e,t)=>{let{originalBlockClientId:n}=t;return{selectFirst:()=>e(E.store).selectBlock(n)}}))),v=(0,b.createHigherOrderComponent)((e=>f((t=>{let{originalBlockClientId:n,selectFirst:l,...o}=t;if(!n)return(0,a.createElement)(e,o);const r=(0,s.getBlockType)(o.name),i=function(e){const t=(0,s.findTransform)((0,s.getBlockTransforms)("to",e),(e=>{let{type:t,blocks:n}=e;return"block"===t&&1===n.length}));if(!t)return null;return(0,s.getBlockType)(t.blocks[0])}(o.name);return[(0,a.createElement)("div",{key:"invalid-preview",style:{minHeight:"60px"}},(0,a.createElement)(e,p({key:"block-edit"},o))),(0,a.createElement)(E.Warning,{key:"multiple-use-warning",actions:[(0,a.createElement)(h.Button,{key:"find-original",variant:"secondary",onClick:l},(0,_.__)("Find original")),(0,a.createElement)(h.Button,{key:"remove",variant:"secondary",onClick:()=>o.onReplace([])},(0,_.__)("Remove")),i&&(0,a.createElement)(h.Button,{key:"transform",variant:"secondary",onClick:()=>o.onReplace((0,s.createBlock)(i.name,o.attributes))},(0,_.__)("Transform into:")," ",i.title)]},(0,a.createElement)("strong",null,null==r?void 0:r.title,": "),(0,_.__)("This block can only be used once."))]}))),"withMultipleValidation");(0,u.addFilter)("editor.BlockEdit","core/edit-post/validate-multiple-use/with-multiple-validation",v);var y=window.wp.primitives;var w=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),S=window.wp.plugins,k=window.wp.url,P=window.wp.notices,T=window.wp.editor;function C(){const{createNotice:e}=(0,c.useDispatch)(P.store),t=(0,c.useSelect)((e=>()=>e(T.store).getEditedPostAttribute("content")),[]);const n=(0,b.useCopyToClipboard)(t,(function(){e("info",(0,_.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,a.createElement)(h.MenuItem,{ref:n},(0,_.__)("Copy all blocks"))}var x=window.wp.keycodes;const B=(0,c.combineReducers)({isSaving:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;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(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_META_BOXES_PER_LOCATIONS"===t.type?t.metaBoxesPerLocation:e},initialized:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"META_BOXES_INITIALIZED"===t.type||e}});var M=(0,c.combineReducers)({activeModal:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e},metaBoxes:B,publishSidebarActive:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;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(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if("REMOVE_PANEL"===t.type)if(!(0,g.includes)(e,t.panelName))return[...e,t.panelName];return e},deviceType:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Desktop",t=arguments.length>1?arguments[1]:void 0;return"SET_PREVIEW_DEVICE_TYPE"===t.type?t.deviceType:e},blockInserterPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;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(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;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(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"SET_IS_EDITING_TEMPLATE"===t.type?t.value:e}}),I=window.wp.apiFetch,N=n.n(I),A=n(4403),L=n.n(A);var O=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));var D=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.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 R=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.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"})),F=window.wp.viewport;var V=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.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"})),U=window.wp.deprecated,G=n.n(U);const H=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),z=(e,t)=>n=>{let{registry:l,dispatch:o}=n;if(!t)return;l.select(d.store).get(e,"isComplementaryAreaVisible")||l.dispatch(d.store).set(e,"isComplementaryAreaVisible",!0),o({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},$=e=>t=>{let{registry:n}=t;n.select(d.store).get(e,"isComplementaryAreaVisible")&&n.dispatch(d.store).set(e,"isComplementaryAreaVisible",!1)},W=(e,t)=>n=>{let{registry:l}=n;if(!t)return;const o=l.select(d.store).get(e,"pinnedItems");!0!==(null==o?void 0:o[t])&&l.dispatch(d.store).set(e,"pinnedItems",{...o,[t]:!0})},q=(e,t)=>n=>{let{registry:l}=n;if(!t)return;const o=l.select(d.store).get(e,"pinnedItems");l.dispatch(d.store).set(e,"pinnedItems",{...o,[t]:!1})};function j(e,t){return function(n){let{registry:l}=n;G()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),l.dispatch(d.store).toggle(e,t)}}function K(e,t,n){return function(l){let{registry:o}=l;G()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),o.dispatch(d.store).set(e,t,!!n)}}function Y(e,t){return function(n){let{registry:l}=n;G()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),l.dispatch(d.store).setDefaults(e,t)}}const X=(0,c.createRegistrySelector)((e=>(t,n)=>{var l;const o=e(d.store).get(n,"isComplementaryAreaVisible");if(void 0!==o)return o?null==t||null===(l=t.complementaryAreas)||void 0===l?void 0:l[n]:null})),Q=(0,c.createRegistrySelector)((e=>(t,n,l)=>{var o;const r=e(d.store).get(n,"pinnedItems");return null===(o=null==r?void 0:r[l])||void 0===o||o})),Z=(0,c.createRegistrySelector)((e=>(t,n,l)=>(G()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(d.store).get(n,l))));var J=(0,c.combineReducers)({complementaryAreas:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:n,area:l}=t;return e[n]?e:{...e,[n]:l}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:n,area:l}=t;return{...e,[n]:l}}}return e}});const ee=(0,c.createReduxStore)("core/interface",{reducer:J,actions:e,selectors:t});(0,c.register)(ee);var te=(0,S.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));var ne=te((function(e){let{as:t=h.Button,scope:n,identifier:l,icon:o,selectedIcon:r,name:s,...i}=e;const u=t,d=(0,c.useSelect)((e=>e(ee).getActiveComplementaryArea(n)===l),[l]),{enableComplementaryArea:m,disableComplementaryArea:g}=(0,c.useDispatch)(ee);return(0,a.createElement)(u,p({icon:r&&d?r:o,onClick:()=>{d?g(n):m(n,l)}},i))}));var le=e=>{let{smallScreenTitle:t,children:n,className:l,toggleButtonProps:o}=e;const r=(0,a.createElement)(ne,p({icon:V},o));return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},t&&(0,a.createElement)("span",{className:"interface-complementary-area-header__small-title"},t),r),(0,a.createElement)("div",{className:L()("components-panel__header","interface-complementary-area-header",l),tabIndex:-1},n,r))};const oe=()=>{};function re(e){let{name:t,as:n=h.Button,onClick:l,...o}=e;return(0,a.createElement)(h.Fill,{name:t},(e=>{let{onClick:t}=e;return(0,a.createElement)(n,p({onClick:l||t?function(){(l||oe)(...arguments),(t||oe)(...arguments)}:void 0},o))}))}re.Slot=function(e){let{name:t,as:n=h.ButtonGroup,fillProps:l={},bubblesVirtually:o,...r}=e;return(0,a.createElement)(h.Slot,{name:t,bubblesVirtually:o,fillProps:l},(e=>{if(!a.Children.toArray(e).length)return null;const t=[];a.Children.forEach(e,(e=>{let{props:{__unstableExplicitMenuItem:n,__unstableTarget:l}}=e;l&&n&&t.push(l)}));const l=a.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&t.includes(e.props.__unstableTarget)?null:e));return(0,a.createElement)(n,r,l)}))};var ae=re;const se=e=>{let{__unstableExplicitMenuItem:t,__unstableTarget:n,...l}=e;return(0,a.createElement)(h.MenuItem,l)};function ie(e){let{scope:t,target:n,__unstableExplicitMenuItem:l,...o}=e;return(0,a.createElement)(ne,p({as:e=>(0,a.createElement)(ae,p({__unstableExplicitMenuItem:l,__unstableTarget:`${t}/${n}`,as:se,name:`${t}/plugin-more-menu`},e)),role:"menuitemcheckbox",selectedIcon:O,name:n,scope:t},o))}function ce(e){let{scope:t,...n}=e;return(0,a.createElement)(h.Fill,p({name:`PinnedItems/${t}`},n))}ce.Slot=function(e){let{scope:t,className:n,...l}=e;return(0,a.createElement)(h.Slot,p({name:`PinnedItems/${t}`},l),(e=>(null==e?void 0:e.length)>0&&(0,a.createElement)("div",{className:L()(n,"interface-pinned-items")},e)))};var ue=ce;function de(e){let{scope:t,children:n,className:l}=e;return(0,a.createElement)(h.Fill,{name:`ComplementaryArea/${t}`},(0,a.createElement)("div",{className:l},n))}const me=te((function(e){let{children:t,className:n,closeLabel:l=(0,_.__)("Close plugin"),identifier:o,header:r,headerClassName:s,icon:i,isPinnable:u=!0,panelClassName:d,scope:m,name:p,smallScreenTitle:g,title:E,toggleShortcut:b,isActiveByDefault:f,showIconLabels:v=!1}=e;const{isActive:y,isPinned:w,activeArea:S,isSmall:k,isLarge:P}=(0,c.useSelect)((e=>{const{getActiveComplementaryArea:t,isItemPinned:n}=e(ee),l=t(m);return{isActive:l===o,isPinned:n(m,o),activeArea:l,isSmall:e(F.store).isViewportMatch("< medium"),isLarge:e(F.store).isViewportMatch("large")}}),[o,m]);!function(e,t,n,l,o){const r=(0,a.useRef)(!1),s=(0,a.useRef)(!1),{enableComplementaryArea:i,disableComplementaryArea:u}=(0,c.useDispatch)(ee);(0,a.useEffect)((()=>{l&&o&&!r.current?(u(e),s.current=!0):s.current&&!o&&r.current?(s.current=!1,i(e,t)):s.current&&n&&n!==t&&(s.current=!1),o!==r.current&&(r.current=o)}),[l,o,e,t,n])}(m,o,S,y,k);const{enableComplementaryArea:T,disableComplementaryArea:C,pinItem:x,unpinItem:B}=(0,c.useDispatch)(ee);return(0,a.useEffect)((()=>{f&&void 0===S&&!k&&T(m,o)}),[S,f,m,o,k]),(0,a.createElement)(a.Fragment,null,u&&(0,a.createElement)(ue,{scope:m},w&&(0,a.createElement)(ne,{scope:m,identifier:o,isPressed:y&&(!v||P),"aria-expanded":y,label:E,icon:v?O:i,showTooltip:!v,variant:v?"tertiary":void 0})),p&&u&&(0,a.createElement)(ie,{target:p,scope:m,icon:i},E),y&&(0,a.createElement)(de,{className:L()("interface-complementary-area",n),scope:m},(0,a.createElement)(le,{className:s,closeLabel:l,onClose:()=>C(m),smallScreenTitle:g,toggleButtonProps:{label:l,shortcut:b,scope:m,identifier:o}},r||(0,a.createElement)(a.Fragment,null,(0,a.createElement)("strong",null,E),u&&(0,a.createElement)(h.Button,{className:"interface-complementary-area__pin-unpin-item",icon:w?D:R,label:w?(0,_.__)("Unpin from toolbar"):(0,_.__)("Pin to toolbar"),onClick:()=>(w?B:x)(m,o),isPressed:w,"aria-expanded":w}))),(0,a.createElement)(h.Panel,{className:d},t)))}));me.Slot=function(e){let{scope:t,...n}=e;return(0,a.createElement)(h.Slot,p({name:`ComplementaryArea/${t}`},n))};var pe=me;var ge=e=>{let{isActive:t}=e;return(0,a.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,a.useEffect)((()=>(t?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{t&&document.body.classList.remove("is-fullscreen-mode")})),[t]),null};var he=(0,a.forwardRef)((function(e,t){let{footer:n,header:l,sidebar:o,secondarySidebar:r,notices:s,content:i,drawer:c,actions:u,labels:d,className:m,shortcuts:g}=e;const E=(0,h.__unstableUseNavigateRegions)(g);!function(e){(0,a.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const f={...{drawer:(0,_.__)("Drawer"),header:(0,_.__)("Header"),body:(0,_.__)("Content"),secondarySidebar:(0,_.__)("Block Library"),sidebar:(0,_.__)("Settings"),actions:(0,_.__)("Publish"),footer:(0,_.__)("Footer")},...d};return(0,a.createElement)("div",p({},E,{ref:(0,b.useMergeRefs)([t,E.ref]),className:L()(m,"interface-interface-skeleton",E.className,!!n&&"has-footer")}),!!c&&(0,a.createElement)("div",{className:"interface-interface-skeleton__drawer",role:"region","aria-label":f.drawer,tabIndex:"-1"},c),(0,a.createElement)("div",{className:"interface-interface-skeleton__editor"},!!l&&(0,a.createElement)("div",{className:"interface-interface-skeleton__header",role:"region","aria-label":f.header,tabIndex:"-1"},l),(0,a.createElement)("div",{className:"interface-interface-skeleton__body"},!!r&&(0,a.createElement)("div",{className:"interface-interface-skeleton__secondary-sidebar",role:"region","aria-label":f.secondarySidebar,tabIndex:"-1"},r),!!s&&(0,a.createElement)("div",{className:"interface-interface-skeleton__notices"},s),(0,a.createElement)("div",{className:"interface-interface-skeleton__content",role:"region","aria-label":f.body,tabIndex:"-1"},i),!!o&&(0,a.createElement)("div",{className:"interface-interface-skeleton__sidebar",role:"region","aria-label":f.sidebar,tabIndex:"-1"},o),!!u&&(0,a.createElement)("div",{className:"interface-interface-skeleton__actions",role:"region","aria-label":f.actions,tabIndex:"-1"},u))),!!n&&(0,a.createElement)("div",{className:"interface-interface-skeleton__footer",role:"region","aria-label":f.footer,tabIndex:"-1"},n))}));var Ee=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function _e(e){let{as:t=h.DropdownMenu,className:n,label:l=(0,_.__)("Options"),popoverProps:o,toggleProps:r,children:s}=e;return(0,a.createElement)(t,{className:L()("interface-more-menu-dropdown",n),icon:Ee,label:l,popoverProps:{position:"bottom left",...o,className:L()("interface-more-menu-dropdown__content",null==o?void 0:o.className)},toggleProps:{tooltipPosition:"bottom",...r}},(e=>s(e)))}function be(e){let{closeModal:t,children:n}=e;return(0,a.createElement)(h.Modal,{className:"interface-preferences-modal",title:(0,_.__)("Preferences"),closeLabel:(0,_.__)("Close"),onRequestClose:t},n)}var fe=function(e){let{icon:t,size:n=24,...l}=e;return(0,a.cloneElement)(t,{width:n,height:n,...l})};var ve=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var ye=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));const we="preferences-menu";function Se(e){let{sections:t}=e;const n=(0,b.useViewportMatch)("medium"),[l,o]=(0,a.useState)(we),{tabs:r,sectionsContentMap:s}=(0,a.useMemo)((()=>{let e={tabs:[],sectionsContentMap:{}};return t.length&&(e=t.reduce(((e,t)=>{let{name:n,tabLabel:l,content:o}=t;return e.tabs.push({name:n,title:l}),e.sectionsContentMap[n]=o,e}),{tabs:[],sectionsContentMap:{}})),e}),[t]),i=(0,a.useCallback)((e=>s[e.name]||null),[s]);let c;return c=n?(0,a.createElement)(h.TabPanel,{className:"interface-preferences__tabs",tabs:r,initialTabName:l!==we?l:void 0,onSelect:o,orientation:"vertical"},i):(0,a.createElement)(h.__experimentalNavigatorProvider,{initialPath:"/",className:"interface-preferences__provider"},(0,a.createElement)(h.__experimentalNavigatorScreen,{path:"/"},(0,a.createElement)(h.Card,{isBorderless:!0,size:"small"},(0,a.createElement)(h.CardBody,null,(0,a.createElement)(h.__experimentalItemGroup,null,r.map((e=>(0,a.createElement)(h.__experimentalNavigatorButton,{key:e.name,path:e.name,as:h.__experimentalItem,isAction:!0},(0,a.createElement)(h.__experimentalHStack,{justify:"space-between"},(0,a.createElement)(h.FlexItem,null,(0,a.createElement)(h.__experimentalTruncate,null,e.title)),(0,a.createElement)(h.FlexItem,null,(0,a.createElement)(fe,{icon:(0,_.isRTL)()?ve:ye})))))))))),t.length&&t.map((e=>(0,a.createElement)(h.__experimentalNavigatorScreen,{key:`${e.name}-menu`,path:e.name},(0,a.createElement)(h.Card,{isBorderless:!0,size:"large"},(0,a.createElement)(h.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6"},(0,a.createElement)(h.__experimentalNavigatorBackButton,{icon:(0,_.isRTL)()?ye:ve,"aria-label":(0,_.__)("Navigate to the previous view")}),(0,a.createElement)(h.__experimentalText,{size:"16"},e.tabLabel)),(0,a.createElement)(h.CardBody,null,e.content)))))),c}var ke=e=>{let{description:t,title:n,children:l}=e;return(0,a.createElement)("fieldset",{className:"interface-preferences-modal__section"},(0,a.createElement)("legend",{className:"interface-preferences-modal__section-legend"},(0,a.createElement)("h2",{className:"interface-preferences-modal__section-title"},n),t&&(0,a.createElement)("p",{className:"interface-preferences-modal__section-description"},t)),l)};var Pe=function(e){let{help:t,label:n,isChecked:l,onChange:o,children:r}=e;return(0,a.createElement)("div",{className:"interface-preferences-modal__option"},(0,a.createElement)(h.ToggleControl,{__nextHasNoMarginBottom:!0,help:t,label:n,checked:l,onChange:o}),r)},Te=window.wp.a11y,Ce=window.wp.coreData;const xe=e=>t=>{let{registry:n}=t;return n.dispatch(ee).enableComplementaryArea(Rt.name,e)},Be=()=>e=>{let{registry:t}=e;return t.dispatch(ee).disableComplementaryArea(Rt.name)};function Me(e){return{type:"OPEN_MODAL",name:e}}function Ie(){return{type:"CLOSE_MODAL"}}function Ne(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function Ae(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function Le(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const Oe=e=>t=>{var n;let{registry:l}=t;const o=null!==(n=l.select(d.store).get("core/edit-post","inactivePanels"))&&void 0!==n?n:[];let r;r=!(null==o||!o.includes(e))?o.filter((t=>t!==e)):[...o,e],l.dispatch(d.store).set("core/edit-post","inactivePanels",r)},De=e=>t=>{var n;let{registry:l}=t;const o=null!==(n=l.select(d.store).get("core/edit-post","openPanels"))&&void 0!==n?n:[];let r;r=!(null==o||!o.includes(e))?o.filter((t=>t!==e)):[...o,e],l.dispatch(d.store).set("core/edit-post","openPanels",r)};function Re(e){return{type:"REMOVE_PANEL",panelName:e}}const Fe=e=>t=>{let{registry:n}=t;return n.dispatch(d.store).toggle("core/edit-post",e)},Ve=e=>t=>{let{registry:n}=t;n.dispatch(d.store).set("core/edit-post","editorMode",e),"visual"!==e&&n.dispatch(E.store).clearSelectedBlock();const l="visual"===e?(0,_.__)("Visual editor selected"):(0,_.__)("Code editor selected");(0,Te.speak)(l,"assertive")},Ue=e=>t=>{let{registry:n}=t;const l=n.select(ee).isItemPinned("core/edit-post",e);n.dispatch(ee)[l?"unpinItem":"pinItem"]("core/edit-post",e)},Ge=(e,t)=>n=>{var l;let{registry:o}=n;if(!e)return;const r=null!==(l=o.select(d.store).get("core/edit-post","preferredStyleVariations"))&&void 0!==l?l:{};if(t)o.dispatch(d.store).set("core/edit-post","preferredStyleVariations",{...r,[e]:t});else{const t={...r};delete t[e],o.dispatch(d.store).set("core/edit-post","preferredStyleVariations",t)}},He=e=>t=>{var n;let{registry:l}=t;const o=null!==(n=l.select(d.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==n?n:[],r=(0,g.without)(o,...(0,g.castArray)(e));l.dispatch(d.store).set("core/edit-post","hiddenBlockTypes",r)},ze=e=>t=>{var n;let{registry:l}=t;const o=null!==(n=l.select(d.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==n?n:[],r=new Set([...o,...(0,g.castArray)(e)]);l.dispatch(d.store).set("core/edit-post","hiddenBlockTypes",[...r])},$e=e=>t=>{let{dispatch:n}=t;return n({type:"SET_META_BOXES_PER_LOCATIONS",metaBoxesPerLocation:e})},We=()=>async e=>{let{registry:t,select:n,dispatch:l}=e;l({type:"REQUEST_META_BOX_UPDATES"}),window.tinyMCE&&window.tinyMCE.triggerSave();const o=t.select(T.store).getCurrentPost(),r=[!!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),a=[new window.FormData(document.querySelector(".metabox-base-form")),...n.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))))],s=(0,g.reduce)(a,((e,t)=>{for(const[n,l]of t)e.append(n,l);return e}),new window.FormData);r.forEach((e=>{let[t,n]=e;return s.append(t,n)}));try{await N()({url:window._wpMetaBoxUrl,method:"POST",body:s,parse:!1}),l.metaBoxUpdatesSuccess()}catch{l.metaBoxUpdatesFailure()}};function qe(){return{type:"META_BOX_UPDATES_SUCCESS"}}function je(){return{type:"META_BOX_UPDATES_FAILURE"}}function Ke(e){return{type:"SET_PREVIEW_DEVICE_TYPE",deviceType:e}}function Ye(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function Xe(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}function Qe(e){return{type:"SET_IS_EDITING_TEMPLATE",value:e}}const Ze=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t=>{let{registry:n,select:l,dispatch:o}=t;o(Qe(!0));if(!l.isFeatureActive("welcomeGuideTemplate")){const t=e?(0,_.__)("Custom template created. You're in template mode now."):(0,_.__)("Editing template. Changes made here affect all posts and pages that use the template.");n.dispatch(P.store).createSuccessNotice(t,{type:"snackbar"})}}},Je=e=>async t=>{let{registry:n}=t;const l=await n.dispatch(Ce.store).saveEntityRecord("postType","wp_template",e),o=n.select(T.store).getCurrentPost();n.dispatch(Ce.store).editEntityRecord("postType",o.type,o.id,{template:l.slug})};let et=!1;const tt=()=>e=>{let{registry:t,select:n,dispatch:l}=e;if(!t.select(T.store).__unstableIsEditorReady())return;if(et)return;const o=t.select(T.store).getCurrentPostType();window.postboxes.page!==o&&window.postboxes.add_postbox_toggles(o),et=!0;let r=t.select(T.store).isSavingPost(),a=t.select(T.store).isAutosavingPost();const s=n.hasMetaBoxes();t.subscribe((async()=>{const e=t.select(T.store).isSavingPost(),n=t.select(T.store).isAutosavingPost(),o=s&&r&&!e&&!a;r=e,a=n,o&&await l.requestMetaBoxUpdates()})),l({type:"META_BOXES_INITIALIZED"})};var nt={};function lt(e){return[e]}function ot(e,t,n){var l;if(e.length!==t.length)return!1;for(l=n;l<e.length;l++)if(e[l]!==t[l])return!1;return!0}function rt(e,t){var n,l=t||lt;function o(e){var t,l,o,r,a,s=n,i=!0;for(t=0;t<e.length;t++){if(l=e[t],!(a=l)||"object"!=typeof a){i=!1;break}s.has(l)?s=s.get(l):(o=new WeakMap,s.set(l,o),s=o)}return s.has(nt)||((r=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=i,s.set(nt,r)),s.get(nt)}function r(){n=new WeakMap}function a(){var t,n,r,a,s,i=arguments.length;for(a=new Array(i),r=0;r<i;r++)a[r]=arguments[r];for((t=o(s=l.apply(null,a))).isUniqueByDependants||(t.lastDependants&&!ot(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),n=t.head;n;){if(ot(n.args,a,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,a)},a[0]=null,n.args=a,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return a.getDependants=l,a.clear=r,r(),a}const at=[],st={},it=(0,c.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(d.store).get("core/edit-post","editorMode"))&&void 0!==t?t:"visual"})),ct=(0,c.createRegistrySelector)((e=>()=>{const t=e(ee).getActiveComplementaryArea("core/edit-post");return["edit-post/document","edit-post/block"].includes(t)})),ut=(0,c.createRegistrySelector)((e=>()=>{const t=e(ee).getActiveComplementaryArea("core/edit-post");return!!t&&!["edit-post/document","edit-post/block"].includes(t)})),dt=(0,c.createRegistrySelector)((e=>()=>e(ee).getActiveComplementaryArea("core/edit-post")));const mt=(0,c.createRegistrySelector)((e=>()=>{G()("select( 'core/edit-post' ).getPreferences",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const t=["hiddenBlockTypes","editorMode","preferredStyleVariations"].reduce(((t,n)=>({...t,[n]:e(d.store).get("core/edit-post",n)})),{}),n=function(e,t){var n;const l=null==e?void 0:e.reduce(((e,t)=>({...e,[t]:{enabled:!1}})),{}),o=null==t?void 0:t.reduce(((e,t)=>{const n=null==e?void 0:e[t];return{...e,[t]:{...n,opened:!0}}}),null!=l?l:{});return null!==(n=null!=o?o:l)&&void 0!==n?n:st}(e(d.store).get("core/edit-post","inactivePanels"),e(d.store).get("core/edit-post","openPanels"));return{...t,panels:n}}));function pt(e,t,n){G()("select( 'core/edit-post' ).getPreference",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const l=mt(e)[t];return void 0===l?n:l}const gt=(0,c.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(d.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==t?t:at}));function ht(e){return e.publishSidebarActive}function Et(e,t){return e.removedPanels.includes(t)}const _t=(0,c.createRegistrySelector)((e=>(t,n)=>{const l=e(d.store).get("core/edit-post","inactivePanels");return!(Et(t,n)||null!=l&&l.includes(n))})),bt=(0,c.createRegistrySelector)((e=>(t,n)=>{const l=e(d.store).get("core/edit-post","openPanels");return!(null==l||!l.includes(n))}));function ft(e,t){return e.activeModal===t}const vt=(0,c.createRegistrySelector)((e=>(t,n)=>!!e(d.store).get("core/edit-post",n))),yt=(0,c.createRegistrySelector)((e=>(t,n)=>e(ee).isItemPinned("core/edit-post",n))),wt=rt((e=>Object.keys(e.metaBoxes.locations).filter((t=>kt(e,t)))),(e=>[e.metaBoxes.locations]));function St(e,t){var n;return kt(e,t)&&(null===(n=Pt(e,t))||void 0===n?void 0:n.some((t=>{let{id:n}=t;return _t(e,`meta-box-${n}`)})))}function kt(e,t){const n=Pt(e,t);return!!n&&0!==n.length}function Pt(e,t){return e.metaBoxes.locations[t]}const Tt=rt((e=>Object.values(e.metaBoxes.locations).flat()),(e=>[e.metaBoxes.locations]));function Ct(e){return wt(e).length>0}function xt(e){return e.metaBoxes.isSaving}function Bt(e){return e.deviceType}function Mt(e){return!!e.blockInserterPanel}function It(e){const{rootClientId:t,insertionIndex:n,filterValue:l}=e.blockInserterPanel;return{rootClientId:t,insertionIndex:n,filterValue:l}}function Nt(e){return e.listViewPanel}function At(e){return e.isEditingTemplate}function Lt(e){return e.metaBoxes.initialized}const Ot=(0,c.createRegistrySelector)((e=>()=>{const t=e(T.store).getEditedPostAttribute("template");if(t){var n;const l=null===(n=e(Ce.store).getEntityRecords("postType","wp_template",{per_page:-1}))||void 0===n?void 0:n.find((e=>e.slug===t));return l?e(Ce.store).getEditedEntityRecord("postType","wp_template",l.id):l}const l=e(T.store).getCurrentPost();return l.link?e(Ce.store).__experimentalGetTemplateForLink(l.link):null})),Dt="core/edit-post",Rt=(0,c.createReduxStore)(Dt,{reducer:M,actions:o,selectors:r});(0,c.register)(Rt);var Ft=(0,c.withDispatch)((e=>{const{openModal:t}=e(Rt);return{openModal:t}}))((function(e){let{openModal:t}=e;return(0,a.createElement)(h.MenuItem,{onClick:()=>{t("edit-post/keyboard-shortcut-help")},shortcut:x.displayShortcut.access("h")},(0,_.__)("Keyboard shortcuts"))}));const{Fill:Vt,Slot:Ut}=(0,h.createSlotFill)("ToolsMoreMenuGroup");Vt.Slot=e=>{let{fillProps:t}=e;return(0,a.createElement)(Ut,{fillProps:t},(e=>!(0,g.isEmpty)(e)&&(0,a.createElement)(h.MenuGroup,{label:(0,_.__)("Tools")},e)))};var Gt=Vt;function Ht(){const e=(0,c.useSelect)((e=>e(Rt).isEditingTemplate()),[]);return(0,a.createElement)(d.PreferenceToggleMenuItem,{scope:"core/edit-post",name:e?"welcomeGuideTemplate":"welcomeGuide",label:(0,_.__)("Welcome Guide")})}(0,S.registerPlugin)("edit-post",{render(){return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Gt,null,(e=>{let{onClose:t}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(h.MenuItem,{role:"menuitem",href:(0,k.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,_.__)("Manage Reusable blocks")),(0,a.createElement)(Ft,{onSelect:t}),(0,a.createElement)(Ht,null),(0,a.createElement)(C,null),(0,a.createElement)(h.MenuItem,{role:"menuitem",icon:w,href:(0,_.__)("https://wordpress.org/support/article/wordpress-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,_.__)("Help"),(0,a.createElement)(h.VisuallyHidden,{as:"span"},(0,_.__)("(opens in a new tab)"))))})))}});var zt=window.wp.keyboardShortcuts;function $t(){const e=(0,c.useSelect)((e=>e(T.store).getEditorSettings().richEditingEnabled),[]),{switchEditorMode:t}=(0,c.useDispatch)(Rt);return(0,a.createElement)("div",{className:"edit-post-text-editor"},(0,a.createElement)(T.TextEditorGlobalKeyboardShortcuts,null),e&&(0,a.createElement)("div",{className:"edit-post-text-editor__toolbar"},(0,a.createElement)("h2",null,(0,_.__)("Editing code")),(0,a.createElement)(h.Button,{variant:"tertiary",onClick:()=>t("visual"),shortcut:x.displayShortcut.secondary("m")},(0,_.__)("Exit code editor"))),(0,a.createElement)("div",{className:"edit-post-text-editor__body"},(0,a.createElement)(T.PostTitle,null),(0,a.createElement)(T.PostTextEditor,null)))}var Wt=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));const qt=()=>{};var jt=function(e){let{onClick:t=qt,small:n=!1}=e;const{shortcut:l,areAdvancedSettingsOpened:o}=(0,c.useSelect)((e=>({shortcut:e(zt.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),areAdvancedSettingsOpened:"edit-post/block"===e(Rt).getActiveGeneralSidebarName()})),[]),{openGeneralSidebar:r,closeGeneralSidebar:s}=(0,c.useDispatch)(Rt),i=o?(0,_.__)("Hide more settings"):(0,_.__)("Show more settings");return(0,a.createElement)(h.MenuItem,{onClick:()=>{o?(s(),(0,Te.speak)((0,_.__)("Block settings closed"))):(r("edit-post/block"),(0,Te.speak)((0,_.__)("Additional settings are now available in the Editor block settings sidebar"))),t()},shortcut:l},!n&&i)};function Kt(e){let{children:t,contentRef:n,shouldIframe:l,styles:o,assets:r,style:s}=e;const i=(0,E.__unstableUseMouseMoveTypingReset)();return l?(0,a.createElement)(E.__unstableIframe,{head:(0,a.createElement)(E.__unstableEditorStyles,{styles:o}),assets:r,ref:i,contentRef:n,style:{width:"100%",height:"100%",display:"block"},name:"editor-canvas"},t):(0,a.createElement)(a.Fragment,null,(0,a.createElement)(E.__unstableEditorStyles,{styles:o}),(0,a.createElement)(E.WritingFlow,{ref:n,className:"editor-styles-wrapper",style:{flex:"1",...s},tabIndex:-1},t))}function Yt(e){for(let t=0;t<e.length;t++){if("core/post-content"===e[t].name)return e[t];if(e[t].innerBlocks.length){const n=Yt(e[t].innerBlocks);if(n)return n}}}function Xt(e){var t;let{styles:n}=e;const{deviceType:l,isWelcomeGuideVisible:o,isTemplateMode:r,editedPostTemplate:i={},wrapperBlockName:u,wrapperUniqueId:d}=(0,c.useSelect)((e=>{const{isFeatureActive:t,isEditingTemplate:n,__experimentalGetPreviewDeviceType:l,getEditedPostTemplate:o}=e(Rt),{getCurrentPostId:r,getCurrentPostType:a,getEditorSettings:s}=e(T.store),i=n();let c;"wp_block"===a()?c="core/block":i||(c="core/post-content");const u=s().supportsTemplateMode;return{deviceType:l(),isWelcomeGuideVisible:t("welcomeGuide"),isTemplateMode:i,editedPostTemplate:u?o():{},wrapperBlockName:c,wrapperUniqueId:r()}}),[]),{isCleanNewPost:m}=(0,c.useSelect)(T.store),p=(0,c.useSelect)((e=>e(Rt).hasMetaBoxes()),[]),{themeHasDisabledLayoutStyles:g,themeSupportsLayout:f,assets:v}=(0,c.useSelect)((e=>{const t=e(E.store).getSettings();return{themeHasDisabledLayoutStyles:t.disableLayoutStyles,themeSupportsLayout:t.supportsLayout,assets:t.__unstableResolvedAssets}}),[]),{clearSelectedBlock:y}=(0,c.useDispatch)(E.store),{setIsEditingTemplate:w}=(0,c.useDispatch)(Rt),S={height:"100%",width:"100%",margin:0,display:"flex",flexFlow:"column",background:"white"},k={...S,borderRadius:"2px 2px 0 0",border:"1px solid #ddd",borderBottom:0},P=(0,E.__experimentalUseResizeCanvas)(l,r),C=(0,E.useSetting)("layout"),x="is-"+l.toLowerCase()+"-preview";let B,M=r?k:S;P&&(M=P),p||P||r||(B="40vh");const I=(0,a.useRef)(),N=(0,b.useMergeRefs)([I,(0,E.__unstableUseClipboardHandler)(),(0,E.__unstableUseTypewriter)(),(0,E.__unstableUseTypingObserver)(),(0,E.__unstableUseBlockSelectionClearer)()]),A=(0,E.__unstableUseBlockSelectionClearer)(),O=(0,a.useMemo)((()=>r?{type:"default"}:f?{...C,type:"constrained"}:{type:"default"}),[r,f,C]),D=(0,a.useMemo)((()=>{if(null!=i&&i.blocks)return Yt(null==i?void 0:i.blocks);const e="string"==typeof(null==i?void 0:i.content)?null==i?void 0:i.content:"";return Yt((0,s.parse)(e))||{}}),[null==i?void 0:i.content,null==i?void 0:i.blocks]),R=(0,E.__experimentaluseLayoutClasses)(D),F=L()({"is-layout-flow":!f},f&&R),V=(0,E.__experimentaluseLayoutStyles)(D,".block-editor-block-list__layout.is-root-container"),U=(null==D||null===(t=D.attributes)||void 0===t?void 0:t.layout)||{},G=(0,a.useMemo)((()=>U&&("constrained"===(null==U?void 0:U.type)||null!=U&&U.inherit||null!=U&&U.contentSize||null!=U&&U.wideSize)?{...C,...U,type:"constrained"}:{...C,...U,type:"default"}),[null==U?void 0:U.type,null==U?void 0:U.inherit,null==U?void 0:U.contentSize,null==U?void 0:U.wideSize,C]),H=D?G:O,z=(0,a.useRef)();return(0,a.useEffect)((()=>{var e;!o&&m()&&(null==z||null===(e=z.current)||void 0===e||e.focus())}),[o,m]),(0,a.createElement)(E.BlockTools,{__unstableContentRef:I,className:L()("edit-post-visual-editor",{"is-template-mode":r})},(0,a.createElement)(T.VisualEditorGlobalKeyboardShortcuts,null),(0,a.createElement)(h.__unstableMotion.div,{className:"edit-post-visual-editor__content-area",animate:{padding:r?"48px 48px 0":"0"},ref:A},r&&(0,a.createElement)(h.Button,{className:"edit-post-visual-editor__exit-template-mode",icon:Wt,onClick:()=>{y(),w(!1)}},(0,_.__)("Back")),(0,a.createElement)(h.__unstableMotion.div,{animate:M,initial:S,className:x},(0,a.createElement)(Kt,{shouldIframe:r||"Tablet"===l||"Mobile"===l,contentRef:N,styles:n,assets:v,style:{paddingBottom:B}},f&&!g&&!r&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(E.__experimentalLayoutStyle,{selector:".edit-post-visual-editor__post-title-wrapper, .block-editor-block-list__layout.is-root-container",layout:O,layoutDefinitions:null==C?void 0:C.definitions}),V&&(0,a.createElement)(E.__experimentalLayoutStyle,{layout:G,css:V,layoutDefinitions:null==C?void 0:C.definitions})),!r&&(0,a.createElement)("div",{className:"edit-post-visual-editor__post-title-wrapper",contentEditable:!1},(0,a.createElement)(T.PostTitle,{ref:z})),(0,a.createElement)(E.__experimentalRecursionProvider,{blockName:u,uniqueId:d},(0,a.createElement)(E.BlockList,{className:r?"wp-site-blocks":`${F} wp-block-post-content`,__experimentalLayout:H}))))),(0,a.createElement)(E.__unstableBlockSettingsMenuFirstItem,null,(e=>{let{onClose:t}=e;return(0,a.createElement)(jt,{onClick:t})})))}var Qt=function(){const{getBlockSelectionStart:e}=(0,c.useSelect)(E.store),{getEditorMode:t,isEditorSidebarOpened:n,isListViewOpened:l}=(0,c.useSelect)(Rt),o=(0,c.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:n}=e(T.store).getEditorSettings();return!t||!n}),[]),{switchEditorMode:r,openGeneralSidebar:s,closeGeneralSidebar:i,toggleFeature:u,setIsListViewOpened:d}=(0,c.useDispatch)(Rt),{registerShortcut:m}=(0,c.useDispatch)(zt.store);return(0,a.useEffect)((()=>{m({name:"core/edit-post/toggle-mode",category:"global",description:(0,_.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),m({name:"core/edit-post/toggle-fullscreen",category:"global",description:(0,_.__)("Toggle fullscreen mode."),keyCombination:{modifier:"secondary",character:"f"}}),m({name:"core/edit-post/toggle-list-view",category:"global",description:(0,_.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}}),m({name:"core/edit-post/toggle-sidebar",category:"global",description:(0,_.__)("Show or hide the settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),m({name:"core/edit-post/next-region",category:"global",description:(0,_.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),m({name:"core/edit-post/previous-region",category:"global",description:(0,_.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"}]}),m({name:"core/edit-post/keyboard-shortcuts",category:"main",description:(0,_.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}})}),[]),(0,zt.useShortcut)("core/edit-post/toggle-mode",(()=>{r("visual"===t()?"text":"visual")}),{isDisabled:o}),(0,zt.useShortcut)("core/edit-post/toggle-fullscreen",(()=>{u("fullscreenMode")})),(0,zt.useShortcut)("core/edit-post/toggle-sidebar",(t=>{if(t.preventDefault(),n())i();else{const t=e()?"edit-post/block":"edit-post/document";s(t)}})),(0,zt.useShortcut)("core/edit-post/toggle-list-view",(()=>d(!l()))),null};const Zt=[{keyCombination:{modifier:"primary",character:"b"},description:(0,_.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,_.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,_.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,_.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,_.__)("Insert a link to a post or page")},{keyCombination:{modifier:"primary",character:"u"},description:(0,_.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,_.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,_.__)("Make the selected text inline code.")}];function Jt(e){let{keyCombination:t,forceAriaLabel:n}=e;const l=t.modifier?x.displayShortcutList[t.modifier](t.character):t.character,o=t.modifier?x.shortcutAriaLabel[t.modifier](t.character):t.character;return(0,a.createElement)("kbd",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":n||o},(0,g.castArray)(l).map(((e,t)=>"+"===e?(0,a.createElement)(a.Fragment,{key:t},e):(0,a.createElement)("kbd",{key:t,className:"edit-post-keyboard-shortcut-help-modal__shortcut-key"},e))))}var en=function(e){let{description:t,keyCombination:n,aliases:l=[],ariaLabel:o}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-description"},t),(0,a.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-term"},(0,a.createElement)(Jt,{keyCombination:n,forceAriaLabel:o}),l.map(((e,t)=>(0,a.createElement)(Jt,{keyCombination:e,forceAriaLabel:o,key:t})))))};var tn=function(e){let{name:t}=e;const{keyCombination:n,description:l,aliases:o}=(0,c.useSelect)((e=>{const{getShortcutKeyCombination:n,getShortcutDescription:l,getShortcutAliases:o}=e(zt.store);return{keyCombination:n(t),aliases:o(t),description:l(t)}}),[t]);return n?(0,a.createElement)(en,{keyCombination:n,description:l,aliases:o}):null};const nn="edit-post/keyboard-shortcut-help",ln=e=>{let{shortcuts:t}=e;return(0,a.createElement)("ul",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-list",role:"list"},t.map(((e,t)=>(0,a.createElement)("li",{className:"edit-post-keyboard-shortcut-help-modal__shortcut",key:t},"string"==typeof e?(0,a.createElement)(tn,{name:e}):(0,a.createElement)(en,e)))))},on=e=>{let{title:t,shortcuts:n,className:l}=e;return(0,a.createElement)("section",{className:L()("edit-post-keyboard-shortcut-help-modal__section",l)},!!t&&(0,a.createElement)("h2",{className:"edit-post-keyboard-shortcut-help-modal__section-title"},t),(0,a.createElement)(ln,{shortcuts:n}))},rn=e=>{let{title:t,categoryName:n,additionalShortcuts:l=[]}=e;const o=(0,c.useSelect)((e=>e(zt.store).getCategoryShortcuts(n)),[n]);return(0,a.createElement)(on,{title:t,shortcuts:o.concat(l)})};var an=(0,b.compose)([(0,c.withSelect)((e=>({isModalActive:e(Rt).isModalActive(nn)}))),(0,c.withDispatch)(((e,t)=>{let{isModalActive:n}=t;const{openModal:l,closeModal:o}=e(Rt);return{toggleModal:()=>n?o():l(nn)}}))])((function(e){let{isModalActive:t,toggleModal:n}=e;return(0,zt.useShortcut)("core/edit-post/keyboard-shortcuts",n),t?(0,a.createElement)(h.Modal,{className:"edit-post-keyboard-shortcut-help-modal",title:(0,_.__)("Keyboard shortcuts"),closeLabel:(0,_.__)("Close"),onRequestClose:n},(0,a.createElement)(on,{className:"edit-post-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-post/keyboard-shortcuts"]}),(0,a.createElement)(rn,{title:(0,_.__)("Global shortcuts"),categoryName:"global"}),(0,a.createElement)(rn,{title:(0,_.__)("Selection shortcuts"),categoryName:"selection"}),(0,a.createElement)(rn,{title:(0,_.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,_.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,_.__)("Forward-slash")}]}),(0,a.createElement)(on,{title:(0,_.__)("Text formatting"),shortcuts:Zt})):null}));function sn(e){let{willEnable:t}=e;const[n,l]=(0,a.useState)(!1);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",{className:"edit-post-preferences-modal__custom-fields-confirmation-message"},(0,_.__)("A page reload is required for this change. Make sure your content is saved before reloading.")),(0,a.createElement)(h.Button,{className:"edit-post-preferences-modal__custom-fields-confirmation-button",variant:"secondary",isBusy:n,disabled:n,onClick:()=>{l(!0),document.getElementById("toggle-custom-fields-form").submit()}},t?(0,_.__)("Enable & Reload"):(0,_.__)("Disable & Reload")))}var cn=(0,c.withSelect)((e=>({areCustomFieldsEnabled:!!e(T.store).getEditorSettings().enableCustomFields})))((function(e){let{label:t,areCustomFieldsEnabled:n}=e;const[l,o]=(0,a.useState)(n);return(0,a.createElement)(Pe,{label:t,isChecked:l,onChange:o},l!==n&&(0,a.createElement)(sn,{willEnable:l}))})),un=(0,b.compose)((0,c.withSelect)(((e,t)=>{let{panelName:n}=t;const{isEditorPanelEnabled:l,isEditorPanelRemoved:o}=e(Rt);return{isRemoved:o(n),isChecked:l(n)}})),(0,b.ifCondition)((e=>{let{isRemoved:t}=e;return!t})),(0,c.withDispatch)(((e,t)=>{let{panelName:n}=t;return{onChange:()=>e(Rt).toggleEditorPanelEnabled(n)}})))(Pe);const{Fill:dn,Slot:mn}=(0,h.createSlotFill)("EnablePluginDocumentSettingPanelOption"),pn=e=>{let{label:t,panelName:n}=e;return(0,a.createElement)(dn,null,(0,a.createElement)(un,{label:t,panelName:n}))};pn.Slot=mn;var gn=pn,hn=(0,b.compose)((0,c.withSelect)((e=>({isChecked:e(T.store).isPublishSidebarEnabled()}))),(0,c.withDispatch)((e=>{const{enablePublishSidebar:t,disablePublishSidebar:n}=e(T.store);return{onChange:e=>e?t():n()}})),(0,F.ifViewportMatches)("medium"))(Pe),En=(0,b.compose)((0,c.withSelect)(((e,t)=>{let{featureName:n}=t;const{isFeatureActive:l}=e(Rt);return{isChecked:l(n)}})),(0,c.withDispatch)(((e,t)=>{let{featureName:n}=t;return{onChange:()=>e(Rt).toggleFeature(n)}})))(Pe);var _n=(0,c.withSelect)((e=>{const{getEditorSettings:t}=e(T.store),{getAllMetaBoxes:n}=e(Rt);return{areCustomFieldsRegistered:void 0!==t().enableCustomFields,metaBoxes:n()}}))((function(e){let{areCustomFieldsRegistered:t,metaBoxes:n,...l}=e;const o=(0,g.filter)(n,(e=>{let{id:t}=e;return"postcustom"!==t}));return t||0!==o.length?(0,a.createElement)(ke,l,t&&(0,a.createElement)(cn,{label:(0,_.__)("Custom fields")}),(0,g.map)(o,(e=>{let{id:t,title:n}=e;return(0,a.createElement)(un,{key:t,label:n,panelName:`meta-box-${t}`})}))):null}));var bn=function(e){let{blockTypes:t,value:n,onItemChange:l}=e;return(0,a.createElement)("ul",{className:"edit-post-block-manager__checklist"},t.map((e=>(0,a.createElement)("li",{key:e.name,className:"edit-post-block-manager__checklist-item"},(0,a.createElement)(h.CheckboxControl,{label:(0,a.createElement)(a.Fragment,null,e.title,(0,a.createElement)(E.BlockIcon,{icon:e.icon})),checked:n.includes(e.name),onChange:function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return l(e.name,...n)}})))))};var fn=function e(t){let{title:n,blockTypes:l}=t;const o=(0,b.useInstanceId)(e),{defaultAllowedBlockTypes:r,hiddenBlockTypes:s}=(0,c.useSelect)((e=>{const{getEditorSettings:t}=e(T.store),{getHiddenBlockTypes:n}=e(Rt);return{defaultAllowedBlockTypes:t().defaultAllowedBlockTypes,hiddenBlockTypes:n()}}),[]),i=(0,a.useMemo)((()=>!0===r?l:l.filter((e=>{let{name:t}=e;return(0,g.includes)(r||[],t)}))),[r,l]),{showBlockTypes:u,hideBlockTypes:d}=(0,c.useDispatch)(Rt),m=(0,a.useCallback)(((e,t)=>{t?u(e):d(e)}),[]),p=(0,a.useCallback)((e=>{const t=(0,g.map)(l,"name");e?u(t):d(t)}),[l]);if(!i.length)return null;const E=(0,g.without)((0,g.map)(i,"name"),...s),_="edit-post-block-manager__category-title-"+o,f=E.length===i.length;let v;return v=f?"true":E.length>0?"mixed":"false",(0,a.createElement)("div",{role:"group","aria-labelledby":_,className:"edit-post-block-manager__category"},(0,a.createElement)(h.CheckboxControl,{checked:f,onChange:p,className:"edit-post-block-manager__category-title","aria-checked":v,label:(0,a.createElement)("span",{id:_},n)}),(0,a.createElement)(bn,{blockTypes:i,value:E,onItemChange:m}))};var vn=(0,c.withSelect)((e=>{const{getBlockTypes:t,getCategories:n,hasBlockSupport:l,isMatchingSearchTerm:o}=e(s.store),{getHiddenBlockTypes:r}=e(Rt),a=t(),i=r().filter((e=>a.some((t=>t.name===e)))),c=Array.isArray(i)&&i.length;return{blockTypes:a,categories:n(),hasBlockSupport:l,isMatchingSearchTerm:o,numberOfHiddenBlocks:c}}))((function(e){let{blockTypes:t,categories:n,hasBlockSupport:l,isMatchingSearchTerm:o,numberOfHiddenBlocks:r}=e;const s=(0,b.useDebounce)(Te.speak,500),[i,c]=(0,a.useState)("");return t=t.filter((e=>l(e,"inserter",!0)&&(!i||o(e,i))&&(!e.parent||(0,g.includes)(e.parent,"core/post-content")))),(0,a.useEffect)((()=>{if(!i)return;const e=t.length,n=(0,_.sprintf)((0,_._n)("%d result found.","%d results found.",e),e);s(n)}),[t.length,i,s]),(0,a.createElement)("div",{className:"edit-post-block-manager__content"},!!r&&(0,a.createElement)("div",{className:"edit-post-block-manager__disabled-blocks-count"},(0,_.sprintf)((0,_._n)("%d block is hidden.","%d blocks are hidden.",r),r)),(0,a.createElement)(h.SearchControl,{label:(0,_.__)("Search for a block"),placeholder:(0,_.__)("Search for a block"),value:i,onChange:e=>c(e),className:"edit-post-block-manager__search"}),(0,a.createElement)("div",{tabIndex:"0",role:"region","aria-label":(0,_.__)("Available block types"),className:"edit-post-block-manager__results"},0===t.length&&(0,a.createElement)("p",{className:"edit-post-block-manager__no-results"},(0,_.__)("No blocks found.")),n.map((e=>(0,a.createElement)(fn,{key:e.slug,title:e.title,blockTypes:(0,g.filter)(t,{category:e.slug})}))),(0,a.createElement)(fn,{title:(0,_.__)("Uncategorized"),blockTypes:(0,g.filter)(t,(e=>{let{category:t}=e;return!t}))})))}));function yn(){const e=(0,b.useViewportMatch)("medium"),{closeModal:t}=(0,c.useDispatch)(Rt),n=(0,c.useSelect)((e=>e(Rt).isModalActive("edit-post/preferences")),[]),l=(0,c.useSelect)((t=>{const{getEditorSettings:n}=t(T.store),{getEditorMode:l,isFeatureActive:o}=t(Rt),r=l(),a=n().richEditingEnabled;return!o("reducedUI")&&e&&a&&"visual"===r}),[e]),o=(0,a.useMemo)((()=>[{name:"general",tabLabel:(0,_.__)("General"),content:(0,a.createElement)(a.Fragment,null,e&&(0,a.createElement)(ke,{title:(0,_.__)("Publishing"),description:(0,_.__)("Change options related to publishing.")},(0,a.createElement)(hn,{help:(0,_.__)("Review settings, such as visibility and tags."),label:(0,_.__)("Include pre-publish checklist")})),(0,a.createElement)(ke,{title:(0,_.__)("Appearance"),description:(0,_.__)("Customize options related to the block editor interface and editing flow.")},(0,a.createElement)(En,{featureName:"focusMode",help:(0,_.__)("Highlights the current block and fades other content."),label:(0,_.__)("Spotlight mode")}),(0,a.createElement)(En,{featureName:"showIconLabels",label:(0,_.__)("Show button text labels"),help:(0,_.__)("Show text instead of icons on buttons.")}),(0,a.createElement)(En,{featureName:"showListViewByDefault",help:(0,_.__)("Opens the block list view sidebar by default."),label:(0,_.__)("Always open list view")}),(0,a.createElement)(En,{featureName:"reducedUI",help:(0,_.__)("Compacts options and outlines in the toolbar."),label:(0,_.__)("Reduce the interface")}),(0,a.createElement)(En,{featureName:"themeStyles",help:(0,_.__)("Make the editor look like your theme."),label:(0,_.__)("Use theme styles")}),l&&(0,a.createElement)(En,{featureName:"showBlockBreadcrumbs",help:(0,_.__)("Shows block breadcrumbs at the bottom of the editor."),label:(0,_.__)("Display block breadcrumbs")})))},{name:"blocks",tabLabel:(0,_.__)("Blocks"),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ke,{title:(0,_.__)("Block interactions"),description:(0,_.__)("Customize how you interact with blocks in the block library and editing canvas.")},(0,a.createElement)(En,{featureName:"mostUsedBlocks",help:(0,_.__)("Places the most frequent blocks in the block library."),label:(0,_.__)("Show most used blocks")}),(0,a.createElement)(En,{featureName:"keepCaretInsideBlock",help:(0,_.__)("Aids screen readers by stopping text caret from leaving blocks."),label:(0,_.__)("Contain text cursor inside block")})),(0,a.createElement)(ke,{title:(0,_.__)("Visible blocks"),description:(0,_.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")},(0,a.createElement)(vn,null)))},{name:"panels",tabLabel:(0,_.__)("Panels"),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ke,{title:(0,_.__)("Document settings"),description:(0,_.__)("Choose what displays in the panel.")},(0,a.createElement)(gn.Slot,null),(0,a.createElement)(T.PostTaxonomies,{taxonomyWrapper:(e,t)=>(0,a.createElement)(un,{label:(0,g.get)(t,["labels","menu_name"]),panelName:`taxonomy-panel-${t.slug}`})}),(0,a.createElement)(T.PostFeaturedImageCheck,null,(0,a.createElement)(un,{label:(0,_.__)("Featured image"),panelName:"featured-image"})),(0,a.createElement)(T.PostExcerptCheck,null,(0,a.createElement)(un,{label:(0,_.__)("Excerpt"),panelName:"post-excerpt"})),(0,a.createElement)(T.PostTypeSupportCheck,{supportKeys:["comments","trackbacks"]},(0,a.createElement)(un,{label:(0,_.__)("Discussion"),panelName:"discussion-panel"})),(0,a.createElement)(T.PageAttributesCheck,null,(0,a.createElement)(un,{label:(0,_.__)("Page attributes"),panelName:"page-attributes"}))),(0,a.createElement)(_n,{title:(0,_.__)("Additional"),description:(0,_.__)("Add extra areas to the editor.")}))}]),[e,l]);return n?(0,a.createElement)(be,{closeModal:t},(0,a.createElement)(Se,{sections:o})):null}class wn extends a.Component{constructor(){super(...arguments),this.state={historyId:null}}componentDidUpdate(e){const{postId:t,postStatus:n,postType:l,isSavingPost:o}=this.props,{historyId:r}=this.state;"trash"!==n||o?t===e.postId&&t===r||"auto-draft"===n||!t||this.setBrowserURL(t):this.setTrashURL(t,l)}setTrashURL(e,t){window.location.href=function(e,t){return(0,k.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,k.addQueryArgs)("post.php",{post:e,action:"edit"})}(e)),this.setState((()=>({historyId:e})))}render(){return null}}var Sn=(0,c.withSelect)((e=>{const{getCurrentPost:t,isSavingPost:n}=e(T.store),l=t();let{id:o,status:r,type:a}=l;return["wp_template","wp_template_part"].includes(a)&&(o=l.wp_id),{postId:o,postStatus:r,postType:a,isSavingPost:n()}}))(wn);var kn=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,a.createElement)(y.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 Pn=function(e){let{showTooltip:t,icon:n,href:l}=e;const{isActive:o,isRequestingSiteIcon:r,postType:s,siteIconUrl:i}=(0,c.useSelect)((e=>{const{getCurrentPostType:t}=e(T.store),{isFeatureActive:n}=e(Rt),{getEntityRecord:l,getPostType:o,isResolving:r}=e(Ce.store),a=l("root","__unstableBase",void 0)||{};return{isActive:n("fullscreenMode"),isRequestingSiteIcon:r("getEntityRecord",["root","__unstableBase",void 0]),postType:o(t()),siteIconUrl:a.site_icon_url}}),[]),u=(0,b.useReducedMotion)();if(!o||!s)return null;let d=(0,a.createElement)(h.Icon,{size:"36px",icon:kn});const m={expand:{scale:1.25,transition:{type:"tween",duration:"0.3"}}};i&&(d=(0,a.createElement)(h.__unstableMotion.img,{variants:!u&&m,alt:(0,_.__)("Site Icon"),className:"edit-post-fullscreen-mode-close_site-icon",src:i})),r&&(d=null),n&&(d=(0,a.createElement)(h.Icon,{size:"36px",icon:n}));const p=L()({"edit-post-fullscreen-mode-close":!0,"has-icon":i});return(0,a.createElement)(h.__unstableMotion.div,{whileHover:"expand"},(0,a.createElement)(h.Button,{className:p,href:null!=l?l:(0,k.addQueryArgs)("edit.php",{post_type:s.slug}),label:(0,g.get)(s,["labels","view_items"],(0,_.__)("Back")),showTooltip:t},d))};var Tn=(0,a.createElement)(y.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(y.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));var Cn=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const xn=e=>{e.preventDefault()};var Bn=function(){const e=(0,a.useRef)(),{setIsInserterOpened:t,setIsListViewOpened:n}=(0,c.useDispatch)(Rt),{isInserterEnabled:l,isInserterOpened:o,isTextModeEnabled:r,showIconLabels:s,isListViewOpen:i,listViewShortcut:u}=(0,c.useSelect)((e=>{const{hasInserterItems:t,getBlockRootClientId:n,getBlockSelectionEnd:l}=e(E.store),{getEditorSettings:o}=e(T.store),{getEditorMode:r,isFeatureActive:a,isListViewOpened:s}=e(Rt),{getShortcutRepresentation:i}=e(zt.store);return{isInserterEnabled:"visual"===r()&&o().richEditingEnabled&&t(n(l())),isInserterOpened:e(Rt).isInserterOpened(),isTextModeEnabled:"text"===r(),showIconLabels:a("showIconLabels"),isListViewOpen:s(),listViewShortcut:i("core/edit-post/toggle-list-view")}}),[]),d=(0,b.useViewportMatch)("medium"),m=(0,b.useViewportMatch)("wide"),p=(0,_.__)("Document tools"),g=(0,a.useCallback)((()=>n(!i)),[n,i]),f=(0,a.createElement)(a.Fragment,null,(0,a.createElement)(h.ToolbarItem,{as:T.TableOfContents,hasOutlineItemsDisabled:r,repositionDropdown:s&&!m,showTooltip:!s,variant:s?"tertiary":void 0}),(0,a.createElement)(h.ToolbarItem,{as:h.Button,className:"edit-post-header-toolbar__list-view-toggle",icon:Tn,disabled:r,isPressed:i,label:(0,_.__)("List View"),onClick:g,shortcut:u,showTooltip:!s,variant:s?"tertiary":void 0})),v=(0,a.useCallback)((()=>{o?e.current.focus():t(!0)}),[o,t]),y=(0,_._x)("Toggle block inserter","Generic label for block inserter button"),w=o?(0,_.__)("Close"):(0,_.__)("Add");return(0,a.createElement)(E.NavigableToolbar,{className:"edit-post-header-toolbar","aria-label":p},(0,a.createElement)("div",{className:"edit-post-header-toolbar__left"},(0,a.createElement)(h.ToolbarItem,{ref:e,as:h.Button,className:"edit-post-header-toolbar__inserter-toggle",variant:"primary",isPressed:o,onMouseDown:xn,onClick:v,disabled:!l,icon:Cn,label:s?w:y,showTooltip:!s}),(m||!s)&&(0,a.createElement)(a.Fragment,null,d&&(0,a.createElement)(h.ToolbarItem,{as:E.ToolSelector,showTooltip:!s,variant:s?"tertiary":void 0,disabled:r}),(0,a.createElement)(h.ToolbarItem,{as:T.EditorHistoryUndo,showTooltip:!s,variant:s?"tertiary":void 0}),(0,a.createElement)(h.ToolbarItem,{as:T.EditorHistoryRedo,showTooltip:!s,variant:s?"tertiary":void 0}),f)))};const Mn=[{value:"visual",label:(0,_.__)("Visual editor")},{value:"text",label:(0,_.__)("Code editor")}];var In=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:n,isEditingTemplate:l,mode:o}=(0,c.useSelect)((e=>({shortcut:e(zt.store).getShortcutRepresentation("core/edit-post/toggle-mode"),isRichEditingEnabled:e(T.store).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(T.store).getEditorSettings().codeEditingEnabled,isEditingTemplate:e(Rt).isEditingTemplate(),mode:e(Rt).getEditorMode()})),[]),{switchEditorMode:r}=(0,c.useDispatch)(Rt);if(l)return null;if(!t||!n)return null;const s=Mn.map((t=>t.value!==o?{...t,shortcut:e}:t));return(0,a.createElement)(h.MenuGroup,{label:(0,_.__)("Editor")},(0,a.createElement)(h.MenuItemsChoice,{choices:s,value:o,onSelect:r}))};function Nn(){const{openModal:e}=(0,c.useDispatch)(Rt);return(0,a.createElement)(h.MenuItem,{onClick:()=>{e("edit-post/preferences")}},(0,_.__)("Preferences"))}var An=function(){return(0,b.useViewportMatch)("medium")?(0,a.createElement)(h.MenuGroup,{label:(0,_._x)("View","noun")},(0,a.createElement)(d.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fixedToolbar",label:(0,_.__)("Top toolbar"),info:(0,_.__)("Access all block and document tools in a single place"),messageActivated:(0,_.__)("Top toolbar activated"),messageDeactivated:(0,_.__)("Top toolbar deactivated")}),(0,a.createElement)(d.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"focusMode",label:(0,_.__)("Spotlight mode"),info:(0,_.__)("Focus on one block at a time"),messageActivated:(0,_.__)("Spotlight mode activated"),messageDeactivated:(0,_.__)("Spotlight mode deactivated")}),(0,a.createElement)(d.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fullscreenMode",label:(0,_.__)("Fullscreen mode"),info:(0,_.__)("Work without distraction"),messageActivated:(0,_.__)("Fullscreen mode activated"),messageDeactivated:(0,_.__)("Fullscreen mode deactivated"),shortcut:x.displayShortcut.secondary("f")})):null};var Ln=e=>{let{showIconLabels:t}=e;const n=(0,b.useViewportMatch)("large");return(0,a.createElement)(_e,{toggleProps:{showTooltip:!t,...t&&{variant:"tertiary"}}},(e=>{let{onClose:l}=e;return(0,a.createElement)(a.Fragment,null,t&&!n&&(0,a.createElement)(ue.Slot,{className:t&&"show-icon-labels",scope:"core/edit-post"}),(0,a.createElement)(An,null),(0,a.createElement)(In,null),(0,a.createElement)(ae.Slot,{name:"core/edit-post/plugin-more-menu",label:(0,_.__)("Plugins"),as:h.MenuGroup,fillProps:{onClick:l}}),(0,a.createElement)(Gt.Slot,{fillProps:{onClose:l}}),(0,a.createElement)(h.MenuGroup,null,(0,a.createElement)(Nn,null)))}))};var On=(0,b.compose)((0,c.withSelect)((e=>({hasPublishAction:(0,g.get)(e(T.store).getCurrentPost(),["_links","wp:action-publish"],!1),isBeingScheduled:e(T.store).isEditedPostBeingScheduled(),isPending:e(T.store).isCurrentPostPending(),isPublished:e(T.store).isCurrentPostPublished(),isPublishSidebarEnabled:e(T.store).isPublishSidebarEnabled(),isPublishSidebarOpened:e(Rt).isPublishSidebarOpened(),isScheduled:e(T.store).isCurrentPostScheduled()}))),(0,c.withDispatch)((e=>{const{togglePublishSidebar:t}=e(Rt);return{togglePublishSidebar:t}})))((function(e){let{forceIsDirty:t,forceIsSaving:n,hasPublishAction:l,isBeingScheduled:o,isPending:r,isPublished:s,isPublishSidebarEnabled:i,isPublishSidebarOpened:c,isScheduled:u,togglePublishSidebar:d,setEntitiesSavedStatesCallback:m}=e;const p="toggle",g="button",h=(0,b.useViewportMatch)("medium","<");let E;return E=s||u&&o||r&&!l&&!h?g:h||i?p:g,(0,a.createElement)(T.PostPublishButton,{forceIsDirty:t,forceIsSaving:n,isOpen:c,isToggle:E===p,onToggle:d,setEntitiesSavedStatesCallback:m})}));function Dn(){const{hasActiveMetaboxes:e,isPostSaveable:t,isSaving:n,isViewable:l,deviceType:o}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(T.store),{getPostType:n}=e(Ce.store),l=n(t("type"));return{hasActiveMetaboxes:e(Rt).hasMetaBoxes(),isSaving:e(Rt).isSavingMetaBoxes(),isPostSaveable:e(T.store).isEditedPostSaveable(),isViewable:(0,g.get)(l,["viewable"],!1),deviceType:e(Rt).__experimentalGetPreviewDeviceType()}}),[]),{__experimentalSetPreviewDeviceType:r}=(0,c.useDispatch)(Rt);return(0,a.createElement)(E.__experimentalPreviewOptions,{isEnabled:t,className:"edit-post-post-preview-dropdown",deviceType:o,setDeviceType:r},l&&(0,a.createElement)(h.MenuGroup,null,(0,a.createElement)("div",{className:"edit-post-header-preview__grouping-external"},(0,a.createElement)(T.PostPreviewButton,{className:"edit-post-header-preview__button-external",role:"menuitem",forceIsAutosaveable:e,forcePreviewLink:n?null:void 0,textContent:(0,a.createElement)(a.Fragment,null,(0,_.__)("Preview in new tab"),(0,a.createElement)(h.Icon,{icon:w}))}))))}const Rn="__experimentalMainDashboardButton",{Fill:Fn,Slot:Vn}=(0,h.createSlotFill)(Rn),Un=Fn;Un.Slot=e=>{let{children:t}=e;const n=(0,h.__experimentalUseSlot)(Rn);return Boolean(n.fills&&n.fills.length)?(0,a.createElement)(Vn,{bubblesVirtually:!0}):t};var Gn=Un;var Hn=(0,a.createElement)(y.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(y.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function zn(){const{clearSelectedBlock:e}=(0,c.useDispatch)(E.store),{setIsEditingTemplate:t}=(0,c.useDispatch)(Rt),{getEditorSettings:n}=(0,c.useSelect)(T.store),{updateEditorSettings:l,editPost:o}=(0,c.useDispatch)(T.store),{deleteEntityRecord:r}=(0,c.useDispatch)(Ce.store),{template:s}=(0,c.useSelect)((e=>{const{isEditingTemplate:t,getEditedPostTemplate:n}=e(Rt);return{template:t()?n():null}}),[]),[i,u]=(0,a.useState)(!1);if(!s||!s.wp_id)return null;let d=s.slug;null!=s&&s.title&&(d=s.title);const m=null==s?void 0:s.has_theme_file;return(0,a.createElement)(h.MenuGroup,{className:"edit-post-template-top-area__second-menu-group"},(0,a.createElement)(a.Fragment,null,(0,a.createElement)(h.MenuItem,{className:"edit-post-template-top-area__delete-template-button",isDestructive:!m,onClick:()=>{u(!0)},info:m?(0,_.__)("Use the template as supplied by the theme."):void 0},m?(0,_.__)("Clear customizations"):(0,_.__)("Delete template")),(0,a.createElement)(h.__experimentalConfirmDialog,{isOpen:i,onConfirm:()=>{e(),t(!1),u(!1),o({template:""});const a=n(),i=(0,g.pickBy)(a.availableTemplates,((e,t)=>t!==s.slug));l({...a,availableTemplates:i}),r("postType","wp_template",s.id,{throwOnError:!0})},onCancel:()=>{u(!1)}},(0,_.sprintf)((0,_.__)("Are you sure you want to delete the %s template? It may be used by other pages or posts."),d))))}function $n(){const[e,t]=(0,a.useState)(!1),{template:n}=(0,c.useSelect)((e=>{const{getEditedPostTemplate:t}=e(Rt);return{template:t()}}),[]),{editEntityRecord:l}=(0,c.useDispatch)(Ce.store),{getEditorSettings:o}=(0,c.useSelect)(T.store),{updateEditorSettings:r}=(0,c.useDispatch)(T.store);if(!n.is_custom||n.has_theme_file)return null;let s=(0,_.__)("Default");return null!=n&&n.title?s=n.title:n&&(s=n.slug),(0,a.createElement)("div",{className:"edit-site-template-details__group"},(0,a.createElement)(h.TextControl,{label:(0,_.__)("Title"),value:e?"":s,help:(0,_.__)('Give the template a title that indicates its purpose, e.g. "Full Width".'),onChange:a=>{if(!a&&!e)return void t(!0);t(!1);const s=o(),i=(0,g.mapValues)(s.availableTemplates,((e,t)=>t!==n.slug?e:a));r({...s,availableTemplates:i}),l("postType","wp_template",n.id,{title:a})},onBlur:()=>t(!1)}))}function Wn(){const{description:e,title:t}=(0,c.useSelect)((e=>{const{getEditedPostTemplate:t}=e(Rt);return{title:t().title,description:t().description}}),[]);return e?(0,a.createElement)("div",{className:"edit-site-template-details__group"},(0,a.createElement)(h.__experimentalHeading,{level:4,weight:600},t),(0,a.createElement)(h.__experimentalText,{className:"edit-post-template-details__description",size:"body",as:"p",style:{marginTop:"12px"}},e)):null}var qn=function(){const{template:e,isEditing:t,title:n}=(0,c.useSelect)((e=>{const{isEditingTemplate:t,getEditedPostTemplate:n}=e(Rt),{getEditedPostAttribute:l}=e(T.store),o=t();return{template:o?n():null,isEditing:o,title:l("title")?l("title"):(0,_.__)("Untitled")}}),[]),{clearSelectedBlock:l}=(0,c.useDispatch)(E.store),{setIsEditingTemplate:o}=(0,c.useDispatch)(Rt);if(!t||!e)return null;let r=(0,_.__)("Default");null!=e&&e.title?r=e.title:e&&(r=e.slug);const s=!!(e.custom||e.wp_id||e.description);return(0,a.createElement)("div",{className:"edit-post-template-top-area"},(0,a.createElement)(h.Button,{className:"edit-post-template-post-title",isLink:!0,showTooltip:!0,label:(0,_.sprintf)((0,_.__)("Edit %s"),n),onClick:()=>{l(),o(!1)}},n),s?(0,a.createElement)(h.Dropdown,{position:"bottom center",contentClassName:"edit-post-template-top-area__popover",renderToggle:e=>{let{onToggle:t}=e;return(0,a.createElement)(h.Button,{className:"edit-post-template-title",isLink:!0,icon:Hn,showTooltip:!0,onClick:t,label:(0,_.__)("Template Options")},r)},renderContent:()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)($n,null),(0,a.createElement)(Wn,null),(0,a.createElement)(zn,null))}):(0,a.createElement)(h.__experimentalText,{className:"edit-post-template-title",size:"body",style:{lineHeight:"24px"}},r))};var jn=function(e){let{setEntitiesSavedStatesCallback:t}=e;const{hasActiveMetaboxes:n,isPublishSidebarOpened:l,isSaving:o,showIconLabels:r,hasReducedUI:s}=(0,c.useSelect)((e=>({hasActiveMetaboxes:e(Rt).hasMetaBoxes(),isPublishSidebarOpened:e(Rt).isPublishSidebarOpened(),isSaving:e(Rt).isSavingMetaBoxes(),showIconLabels:e(Rt).isFeatureActive("showIconLabels"),hasReducedUI:e(Rt).isFeatureActive("reducedUI")})),[]),i=(0,b.useViewportMatch)("large"),u=L()("edit-post-header",{"has-reduced-ui":s});return(0,a.createElement)("div",{className:u},(0,a.createElement)(Gn.Slot,null,(0,a.createElement)(Pn,{showTooltip:!0})),(0,a.createElement)("div",{className:"edit-post-header__toolbar"},(0,a.createElement)(Bn,null),(0,a.createElement)(qn,null)),(0,a.createElement)("div",{className:"edit-post-header__settings"},!l&&(0,a.createElement)(T.PostSavedState,{forceIsDirty:n,forceIsSaving:o,showIconLabels:r}),(0,a.createElement)(Dn,null),(0,a.createElement)(T.PostPreviewButton,{forceIsAutosaveable:n,forcePreviewLink:o?null:void 0}),(0,a.createElement)(On,{forceIsDirty:n,forceIsSaving:o,setEntitiesSavedStatesCallback:t}),(i||!r)&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ue.Slot,{scope:"core/edit-post"}),(0,a.createElement)(Ln,{showIconLabels:r})),r&&!i&&(0,a.createElement)(Ln,{showIconLabels:r})))};var Kn=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.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 Yn(){const{insertionPoint:e,showMostUsedBlocks:t}=(0,c.useSelect)((e=>{const{isFeatureActive:t,__experimentalGetInsertionPoint:n}=e(Rt);return{insertionPoint:n(),showMostUsedBlocks:t("mostUsedBlocks")}}),[]),{setIsInserterOpened:n}=(0,c.useDispatch)(Rt),l=(0,b.useViewportMatch)("medium","<"),o=l?"div":h.VisuallyHidden,[r,s]=(0,b.__experimentalUseDialog)({onClose:()=>n(!1),focusOnMount:null}),i=(0,a.useRef)();return(0,a.useEffect)((()=>{i.current.focusSearch()}),[]),(0,a.createElement)("div",p({ref:r},s,{className:"edit-post-editor__inserter-panel"}),(0,a.createElement)(o,{className:"edit-post-editor__inserter-panel-header"},(0,a.createElement)(h.Button,{icon:Kn,label:(0,_.__)("Close block inserter"),onClick:()=>n(!1)})),(0,a.createElement)("div",{className:"edit-post-editor__inserter-panel-content"},(0,a.createElement)(E.__experimentalLibrary,{showMostUsedBlocks:t,showInserterHelpPanel:!0,shouldFocusBlock:l,rootClientId:e.rootClientId,__experimentalInsertionIndex:e.insertionIndex,__experimentalFilterValue:e.filterValue,ref:i})))}function Xn(){const{setIsListViewOpened:e}=(0,c.useDispatch)(Rt),t=(0,b.useFocusOnMount)("firstElement"),n=(0,b.useFocusReturn)(),l=(0,b.useFocusReturn)();const o=`edit-post-editor__list-view-panel-label-${(0,b.useInstanceId)(Xn)}`;return(0,a.createElement)("div",{"aria-labelledby":o,className:"edit-post-editor__list-view-panel",onKeyDown:function(t){t.keyCode!==x.ESCAPE||t.defaultPrevented||(t.preventDefault(),e(!1))}},(0,a.createElement)("div",{className:"edit-post-editor__list-view-panel-header",ref:n},(0,a.createElement)("strong",{id:o},(0,_.__)("List View")),(0,a.createElement)(h.Button,{icon:V,label:(0,_.__)("Close List View Sidebar"),onClick:()=>e(!1)})),(0,a.createElement)("div",{className:"edit-post-editor__list-view-panel-content",ref:(0,b.useMergeRefs)([l,t])},(0,a.createElement)(E.__experimentalListView,null)))}var Qn=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.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 Zn=e=>{let{sidebarName:t}=e;const{openGeneralSidebar:n}=(0,c.useDispatch)(Rt),l=()=>n("edit-post/document"),{documentLabel:o,isTemplateMode:r}=(0,c.useSelect)((e=>({documentLabel:e(T.store).getPostTypeLabel()||(0,_._x)("Document","noun"),isTemplateMode:e(Rt).isEditingTemplate()})),[]),[s,i]="edit-post/document"===t?[(0,_.sprintf)((0,_.__)("%s (selected)"),o),"is-active"]:[o,""],[u,d]="edit-post/block"===t?[(0,_.__)("Block (selected)"),"is-active"]:[(0,_.__)("Block"),""],[m,p]="edit-post/document"===t?[(0,_.__)("Template (selected)"),"is-active"]:[(0,_.__)("Template"),""];return(0,a.createElement)("ul",null,!r&&(0,a.createElement)("li",null,(0,a.createElement)(h.Button,{onClick:l,className:`edit-post-sidebar__panel-tab ${i}`,"aria-label":s,"data-label":o},o)),r&&(0,a.createElement)("li",null,(0,a.createElement)(h.Button,{onClick:l,className:`edit-post-sidebar__panel-tab ${p}`,"aria-label":m,"data-label":(0,_.__)("Template")},(0,_.__)("Template"))),(0,a.createElement)("li",null,(0,a.createElement)(h.Button,{onClick:()=>n("edit-post/block"),className:`edit-post-sidebar__panel-tab ${d}`,"aria-label":u,"data-label":(0,_.__)("Block")},(0,_.__)("Block"))))};function Jn(e){let{isOpen:t,onClick:n}=e;const l=(0,T.usePostVisibilityLabel)();return(0,a.createElement)(h.Button,{className:"edit-post-post-visibility__toggle",variant:"tertiary","aria-expanded":t,"aria-label":(0,_.sprintf)((0,_.__)("Select visibility: %s"),l),onClick:n},l)}var el=function(){const[e,t]=(0,a.useState)(null),n=(0,a.useMemo)((()=>({anchor:e})),[e]);return(0,a.createElement)(T.PostVisibilityCheck,{render:e=>{let{canEdit:l}=e;return(0,a.createElement)(h.PanelRow,{ref:t,className:"edit-post-post-visibility"},(0,a.createElement)("span",null,(0,_.__)("Visibility")),!l&&(0,a.createElement)("span",null,(0,a.createElement)(T.PostVisibilityLabel,null)),l&&(0,a.createElement)(h.Dropdown,{position:"bottom left",contentClassName:"edit-post-post-visibility__dialog",popoverProps:n,focusOnMount:!0,renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(Jn,{isOpen:t,onClick:n})},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(T.PostVisibility,{onClose:t})}}))}})};function tl(){return(0,a.createElement)(T.PostTrashCheck,null,(0,a.createElement)(h.PanelRow,null,(0,a.createElement)(T.PostTrash,null)))}function nl(){const[e,t]=(0,a.useState)(null),n=(0,a.useMemo)((()=>({anchor:e})),[e]);return(0,a.createElement)(T.PostScheduleCheck,null,(0,a.createElement)(h.PanelRow,{className:"edit-post-post-schedule",ref:t},(0,a.createElement)("span",null,(0,_.__)("Publish")),(0,a.createElement)(h.Dropdown,{popoverProps:n,position:"bottom left",contentClassName:"edit-post-post-schedule__dialog",focusOnMount:!0,renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(ll,{isOpen:t,onClick:n})},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(T.PostSchedule,{onClose:t})}})))}function ll(e){let{isOpen:t,onClick:n}=e;const l=(0,T.usePostScheduleLabel)(),o=(0,T.usePostScheduleLabel)({full:!0});return(0,a.createElement)(h.Button,{className:"edit-post-post-schedule__toggle",variant:"tertiary",label:o,showTooltip:!0,"aria-expanded":t,"aria-label":(0,_.sprintf)((0,_.__)("Change date: %s"),l),onClick:n},l)}var ol=function(){return(0,a.createElement)(T.PostStickyCheck,null,(0,a.createElement)(h.PanelRow,null,(0,a.createElement)(T.PostSticky,null)))};var rl=function(){return(0,a.createElement)(T.PostAuthorCheck,null,(0,a.createElement)(h.PanelRow,{className:"edit-post-post-author"},(0,a.createElement)(T.PostAuthor,null)))};var al=function(){return(0,a.createElement)(T.PostSlugCheck,null,(0,a.createElement)(h.PanelRow,{className:"edit-post-post-slug"},(0,a.createElement)(T.PostSlug,null)))};var sl=function(){return(0,a.createElement)(T.PostFormatCheck,null,(0,a.createElement)(h.PanelRow,{className:"edit-post-post-format"},(0,a.createElement)(T.PostFormat,null)))};var il=function(){return(0,a.createElement)(T.PostPendingStatusCheck,null,(0,a.createElement)(h.PanelRow,null,(0,a.createElement)(T.PostPendingStatus,null)))};const{Fill:cl,Slot:ul}=(0,h.createSlotFill)("PluginPostStatusInfo"),dl=e=>{let{children:t,className:n}=e;return(0,a.createElement)(cl,null,(0,a.createElement)(h.PanelRow,{className:n},t))};dl.Slot=ul;var ml=dl;var pl=(0,a.createElement)(y.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(y.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 gl=(0,_.__)("Custom Template");function hl(e){let{onClose:t}=e;const n=(0,c.useSelect)((e=>e(T.store).getEditorSettings().defaultBlockTemplate),[]),{__unstableCreateTemplate:l,__unstableSwitchToTemplateMode:o}=(0,c.useDispatch)(Rt),[r,i]=(0,a.useState)(""),[u,d]=(0,a.useState)(!1),m=()=>{i(""),t()};return(0,a.createElement)(h.Modal,{title:(0,_.__)("Create custom template"),closeLabel:(0,_.__)("Close"),onRequestClose:m,className:"edit-post-post-template__create-modal"},(0,a.createElement)("form",{className:"edit-post-post-template__create-form",onSubmit:async e=>{if(e.preventDefault(),u)return;d(!0);const t=null!=n?n:(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 l({slug:(0,k.cleanForSlug)(r||gl),content:t,title:r||gl}),d(!1),m(),o(!0)}},(0,a.createElement)(h.Flex,{align:"flex-start",gap:8},(0,a.createElement)(h.FlexItem,null,(0,a.createElement)(h.TextControl,{label:(0,_.__)("Name"),value:r,onChange:i,placeholder:gl,disabled:u,help:(0,_.__)('Describe the template, e.g. "Post with sidebar". Custom templates can be applied to any post or page.')}))),(0,a.createElement)(h.Flex,{justify:"flex-end",expanded:!1},(0,a.createElement)(h.FlexItem,null,(0,a.createElement)(h.Button,{variant:"tertiary",onClick:m},(0,_.__)("Cancel"))),(0,a.createElement)(h.FlexItem,null,(0,a.createElement)(h.Button,{variant:"primary",type:"submit",isBusy:u,"aria-disabled":u},(0,_.__)("Create"))))))}function El(e){var t,n;let{onClose:l}=e;const{isPostsPage:o,availableTemplates:r,fetchedTemplates:s,selectedTemplateSlug:i,canCreate:u,canEdit:d}=(0,c.useSelect)((e=>{const{canUser:t,getEntityRecord:n,getEntityRecords:l}=e(Ce.store),o=e(T.store).getEditorSettings(),r=t("read","settings")?n("root","site"):void 0,a=e(T.store).getCurrentPostId()===(null==r?void 0:r.page_for_posts),s=t("create","templates");return{isPostsPage:a,availableTemplates:o.availableTemplates,fetchedTemplates:s?l("postType","wp_template",{post_type:e(T.store).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:e(T.store).getEditedPostAttribute("template"),canCreate:s&&!a&&o.supportsTemplateMode,canEdit:s&&o.supportsTemplateMode&&!!e(Rt).getEditedPostTemplate()}}),[]),m=(0,a.useMemo)((()=>Object.entries({...r,...Object.fromEntries((null!=s?s:[]).map((e=>{let{slug:t,title:n}=e;return[t,n.rendered]})))}).map((e=>{let[t,n]=e;return{value:t,label:n}}))),[r,s]),p=null!==(t=m.find((e=>e.value===i)))&&void 0!==t?t:m.find((e=>!e.value)),{editPost:g}=(0,c.useDispatch)(T.store),{__unstableSwitchToTemplateMode:b}=(0,c.useDispatch)(Rt),[f,v]=(0,a.useState)(!1);return(0,a.createElement)("div",{className:"edit-post-post-template__form"},(0,a.createElement)(E.__experimentalInspectorPopoverHeader,{title:(0,_.__)("Template"),help:(0,_.__)("Templates define the way content is displayed when viewing your site."),actions:u?[{icon:pl,label:(0,_.__)("Add template"),onClick:()=>v(!0)}]:[],onClose:l}),o?(0,a.createElement)(h.Notice,{className:"edit-post-post-template__notice",status:"warning",isDismissible:!1},(0,_.__)("The posts page template cannot be changed.")):(0,a.createElement)(h.SelectControl,{hideLabelFromVision:!0,label:(0,_.__)("Template"),value:null!==(n=null==p?void 0:p.value)&&void 0!==n?n:"",options:m,onChange:e=>g({template:e||""})}),d&&(0,a.createElement)("p",null,(0,a.createElement)(h.Button,{variant:"link",onClick:()=>b()},(0,_.__)("Edit template"))),f&&(0,a.createElement)(hl,{onClose:()=>v(!1)}))}function _l(){const[e,t]=(0,a.useState)(null),n=(0,a.useMemo)((()=>({anchor:e})),[e]);return(0,c.useSelect)((e=>{var t;const n=e(T.store).getCurrentPostType(),l=e(Ce.store).getPostType(n);if(null==l||!l.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(Ce.store).canUser("create","templates"))&&void 0!==t&&t}),[])?(0,a.createElement)(h.PanelRow,{className:"edit-post-post-template",ref:t},(0,a.createElement)("span",null,(0,_.__)("Template")),(0,a.createElement)(h.Dropdown,{popoverProps:n,position:"bottom left",className:"edit-post-post-template__dropdown",contentClassName:"edit-post-post-template__dialog",focusOnMount:!0,renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(bl,{isOpen:t,onClick:n})},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(El,{onClose:t})}})):null}function bl(e){let{isOpen:t,onClick:n}=e;const l=(0,c.useSelect)((e=>{var t;const n=e(T.store).getEditedPostAttribute("template"),{supportsTemplateMode:l,availableTemplates:o}=e(T.store).getEditorSettings();if(!l&&o[n])return o[n];const r=e(Rt).getEditedPostTemplate();return null!==(t=null==r?void 0:r.title)&&void 0!==t?t:null==r?void 0:r.slug}),[]);return(0,a.createElement)(h.Button,{className:"edit-post-post-template__toggle",variant:"tertiary","aria-expanded":t,"aria-label":l?(0,_.sprintf)((0,_.__)("Select template: %s"),l):(0,_.__)("Select template"),onClick:n},null!=l?l:(0,_.__)("Default template"))}function fl(){const[e,t]=(0,a.useState)(null),n=(0,a.useMemo)((()=>({anchor:e})),[e]);return(0,a.createElement)(T.PostURLCheck,null,(0,a.createElement)(h.PanelRow,{className:"edit-post-post-url",ref:t},(0,a.createElement)("span",null,(0,_.__)("URL")),(0,a.createElement)(h.Dropdown,{popoverProps:n,position:"bottom left",className:"edit-post-post-url__dropdown",contentClassName:"edit-post-post-url__dialog",focusOnMount:!0,renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(vl,{isOpen:t,onClick:n})},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(T.PostURL,{onClose:t})}})))}function vl(e){let{isOpen:t,onClick:n}=e;const l=(0,T.usePostURLLabel)();return(0,a.createElement)(h.Button,{className:"edit-post-post-url__toggle",variant:"tertiary","aria-expanded":t,"aria-label":(0,_.sprintf)((0,_.__)("Change URL: %s"),l),onClick:n},l)}const yl="post-status";var wl=(0,b.compose)([(0,c.withSelect)((e=>{const{isEditorPanelRemoved:t,isEditorPanelOpened:n}=e(Rt);return{isRemoved:t(yl),isOpened:n(yl)}})),(0,b.ifCondition)((e=>{let{isRemoved:t}=e;return!t})),(0,c.withDispatch)((e=>({onTogglePanel(){return e(Rt).toggleEditorPanelOpened(yl)}})))])((function(e){let{isOpened:t,onTogglePanel:n}=e;return(0,a.createElement)(h.PanelBody,{className:"edit-post-post-status",title:(0,_.__)("Summary"),opened:t,onToggle:n},(0,a.createElement)(ml.Slot,null,(e=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(el,null),(0,a.createElement)(nl,null),(0,a.createElement)(fl,null),(0,a.createElement)(_l,null),(0,a.createElement)(ol,null),(0,a.createElement)(il,null),(0,a.createElement)(sl,null),(0,a.createElement)(al,null),(0,a.createElement)(rl,null),e,(0,a.createElement)(tl,null)))))}));var Sl=function(){return(0,a.createElement)(T.PostLastRevisionCheck,null,(0,a.createElement)(h.PanelBody,{className:"edit-post-last-revision__panel"},(0,a.createElement)(T.PostLastRevision,null)))};var kl=(0,b.compose)((0,c.withSelect)(((e,t)=>{const n=(0,g.get)(t.taxonomy,["slug"]),l=n?`taxonomy-panel-${n}`:"";return{panelName:l,isEnabled:!!n&&e(Rt).isEditorPanelEnabled(l),isOpened:!!n&&e(Rt).isEditorPanelOpened(l)}})),(0,c.withDispatch)(((e,t)=>({onTogglePanel:()=>{e(Rt).toggleEditorPanelOpened(t.panelName)}}))))((function(e){let{isEnabled:t,taxonomy:n,isOpened:l,onTogglePanel:o,children:r}=e;if(!t)return null;const s=(0,g.get)(n,["labels","menu_name"]);return s?(0,a.createElement)(h.PanelBody,{title:s,opened:l,onToggle:o},r):null}));var Pl=function(){return(0,a.createElement)(T.PostTaxonomiesCheck,null,(0,a.createElement)(T.PostTaxonomies,{taxonomyWrapper:(e,t)=>(0,a.createElement)(kl,{taxonomy:t},e)}))};const Tl="featured-image";const Cl=(0,c.withSelect)((e=>{const{getEditedPostAttribute:t}=e(T.store),{getPostType:n}=e(Ce.store),{isEditorPanelEnabled:l,isEditorPanelOpened:o}=e(Rt);return{postType:n(t("type")),isEnabled:l(Tl),isOpened:o(Tl)}})),xl=(0,c.withDispatch)((e=>{const{toggleEditorPanelOpened:t}=e(Rt);return{onTogglePanel:function(){for(var e=arguments.length,n=new Array(e),l=0;l<e;l++)n[l]=arguments[l];return t(Tl,...n)}}}));var Bl=(0,b.compose)(Cl,xl)((function(e){let{isEnabled:t,isOpened:n,postType:l,onTogglePanel:o}=e;return t?(0,a.createElement)(T.PostFeaturedImageCheck,null,(0,a.createElement)(h.PanelBody,{title:(0,g.get)(l,["labels","featured_image"],(0,_.__)("Featured image")),opened:n,onToggle:o},(0,a.createElement)(T.PostFeaturedImage,null))):null}));const Ml="post-excerpt";var Il=(0,b.compose)([(0,c.withSelect)((e=>({isEnabled:e(Rt).isEditorPanelEnabled(Ml),isOpened:e(Rt).isEditorPanelOpened(Ml)}))),(0,c.withDispatch)((e=>({onTogglePanel(){return e(Rt).toggleEditorPanelOpened(Ml)}})))])((function(e){let{isEnabled:t,isOpened:n,onTogglePanel:l}=e;return t?(0,a.createElement)(T.PostExcerptCheck,null,(0,a.createElement)(h.PanelBody,{title:(0,_.__)("Excerpt"),opened:n,onToggle:l},(0,a.createElement)(T.PostExcerpt,null))):null}));const Nl="discussion-panel";var Al=(0,b.compose)([(0,c.withSelect)((e=>({isEnabled:e(Rt).isEditorPanelEnabled(Nl),isOpened:e(Rt).isEditorPanelOpened(Nl)}))),(0,c.withDispatch)((e=>({onTogglePanel(){return e(Rt).toggleEditorPanelOpened(Nl)}})))])((function(e){let{isEnabled:t,isOpened:n,onTogglePanel:l}=e;return t?(0,a.createElement)(T.PostTypeSupportCheck,{supportKeys:["comments","trackbacks"]},(0,a.createElement)(h.PanelBody,{title:(0,_.__)("Discussion"),opened:n,onToggle:l},(0,a.createElement)(T.PostTypeSupportCheck,{supportKeys:"comments"},(0,a.createElement)(h.PanelRow,null,(0,a.createElement)(T.PostComments,null))),(0,a.createElement)(T.PostTypeSupportCheck,{supportKeys:"trackbacks"},(0,a.createElement)(h.PanelRow,null,(0,a.createElement)(T.PostPingbacks,null))))):null}));const Ll="page-attributes";var Ol=function(){const{isEnabled:e,isOpened:t,postType:n}=(0,c.useSelect)((e=>{const{getEditedPostAttribute:t}=e(T.store),{isEditorPanelEnabled:n,isEditorPanelOpened:l}=e(Rt),{getPostType:o}=e(Ce.store);return{isEnabled:n(Ll),isOpened:l(Ll),postType:o(t("type"))}}),[]),{toggleEditorPanelOpened:l}=(0,c.useDispatch)(Rt);return e&&n?(0,a.createElement)(T.PageAttributesCheck,null,(0,a.createElement)(h.PanelBody,{title:(0,g.get)(n,["labels","attributes"],(0,_.__)("Page attributes")),opened:t,onToggle:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l(Ll,...t)}},(0,a.createElement)(T.PageAttributesParent,null),(0,a.createElement)(h.PanelRow,null,(0,a.createElement)(T.PageAttributesOrder,null)))):null};var Dl=function(e){let{location:t}=e;const n=(0,a.useRef)(null),l=(0,a.useRef)(null);(0,a.useEffect)((()=>(l.current=document.querySelector(".metabox-location-"+t),l.current&&n.current.appendChild(l.current),()=>{l.current&&document.querySelector("#metaboxes").appendChild(l.current)})),[t]);const o=(0,c.useSelect)((e=>e(Rt).isSavingMetaBoxes()),[]),r=L()("edit-post-meta-boxes-area",`is-${t}`,{"is-loading":o});return(0,a.createElement)("div",{className:r},o&&(0,a.createElement)(h.Spinner,null),(0,a.createElement)("div",{className:"edit-post-meta-boxes-area__container",ref:n}),(0,a.createElement)("div",{className:"edit-post-meta-boxes-area__clear"}))};class Rl extends a.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 Fl=(0,c.withSelect)(((e,t)=>{let{id:n}=t;return{isVisible:e(Rt).isEditorPanelEnabled(`meta-box-${n}`)}}))(Rl);function Vl(e){let{location:t}=e;const n=(0,c.useRegistry)(),{metaBoxes:l,areMetaBoxesInitialized:o,isEditorReady:r}=(0,c.useSelect)((e=>{const{__unstableIsEditorReady:n}=e(T.store),{getMetaBoxesPerLocation:l,areMetaBoxesInitialized:o}=e(Rt);return{metaBoxes:l(t),areMetaBoxesInitialized:o(),isEditorReady:n()}}),[t]);return(0,a.useEffect)((()=>{r&&!o&&n.dispatch(Rt).initializeMetaBoxes()}),[r,o]),o?(0,a.createElement)(a.Fragment,null,(0,g.map)(l,(e=>{let{id:t}=e;return(0,a.createElement)(Fl,{key:t,id:t})})),(0,a.createElement)(Dl,{location:t})):null}window.wp.warning;const{Fill:Ul,Slot:Gl}=(0,h.createSlotFill)("PluginDocumentSettingPanel"),Hl=(0,b.compose)((0,S.withPluginContext)(((e,t)=>(void 0===t.name&&"undefined"!=typeof process&&process.env,{panelName:`${e.name}/${t.name}`}))),(0,c.withSelect)(((e,t)=>{let{panelName:n}=t;return{opened:e(Rt).isEditorPanelOpened(n),isEnabled:e(Rt).isEditorPanelEnabled(n)}})),(0,c.withDispatch)(((e,t)=>{let{panelName:n}=t;return{onToggle(){return e(Rt).toggleEditorPanelOpened(n)}}})))((e=>{let{isEnabled:t,panelName:n,opened:l,onToggle:o,className:r,title:s,icon:i,children:c}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(gn,{label:s,panelName:n}),(0,a.createElement)(Ul,null,t&&(0,a.createElement)(h.PanelBody,{className:r,title:s,icon:i,opened:l,onToggle:o},c)))}));Hl.Slot=Gl;var zl=Hl;function $l(e){let{className:t,...n}=e;const{postTitle:l,shortcut:o,showIconLabels:r}=(0,c.useSelect)((e=>({postTitle:e(T.store).getEditedPostAttribute("title"),shortcut:e(zt.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),showIconLabels:e(Rt).isFeatureActive("showIconLabels")})),[]);return(0,a.createElement)(pe,p({panelClassName:t,className:"edit-post-sidebar",smallScreenTitle:l||(0,_.__)("(no title)"),scope:"core/edit-post",toggleShortcut:o,showIconLabels:r},n))}var Wl=(0,a.createElement)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(y.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 ql=function(){const e=(0,c.useSelect)((e=>{const{getEditedPostTemplate:t}=e(Rt);return t()}),[]);return e?(0,a.createElement)(h.PanelBody,null,(0,a.createElement)(h.Flex,{align:"flex-start",gap:"3"},(0,a.createElement)(h.FlexItem,null,(0,a.createElement)(fe,{icon:Wl})),(0,a.createElement)(h.FlexBlock,null,(0,a.createElement)("h2",{className:"edit-post-template-summary__title"},(null==e?void 0:e.title)||(null==e?void 0:e.slug)),(0,a.createElement)("p",null,null==e?void 0:e.description)))):null};const jl=a.Platform.select({web:!0,native:!1});var Kl=()=>{const{sidebarName:e,keyboardShortcut:t,isTemplateMode:n}=(0,c.useSelect)((e=>{let t=e(ee).getActiveComplementaryArea(Rt.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(zt.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),isTemplateMode:e(Rt).isEditingTemplate()}}),[]);return(0,a.createElement)($l,{identifier:e,header:(0,a.createElement)(Zn,{sidebarName:e}),closeLabel:(0,_.__)("Close settings"),headerClassName:"edit-post-sidebar__panel-tabs",title:(0,_.__)("Settings"),toggleShortcut:t,icon:Qn,isActiveByDefault:jl},!n&&"edit-post/document"===e&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(wl,null),(0,a.createElement)(zl.Slot,null),(0,a.createElement)(Sl,null),(0,a.createElement)(Pl,null),(0,a.createElement)(Bl,null),(0,a.createElement)(Il,null),(0,a.createElement)(Al,null),(0,a.createElement)(Ol,null),(0,a.createElement)(Vl,{location:"side"})),n&&"edit-post/document"===e&&(0,a.createElement)(ql,null),"edit-post/block"===e&&(0,a.createElement)(E.BlockInspector,null))};function Yl(e){let{nonAnimatedSrc:t,animatedSrc:n}=e;return(0,a.createElement)("picture",{className:"edit-post-welcome-guide__image"},(0,a.createElement)("source",{srcSet:t,media:"(prefers-reduced-motion: reduce)"}),(0,a.createElement)("img",{src:n,width:"312",height:"240",alt:""}))}function Xl(){const{toggleFeature:e}=(0,c.useDispatch)(Rt);return(0,a.createElement)(h.Guide,{className:"edit-post-welcome-guide",contentLabel:(0,_.__)("Welcome to the block editor"),finishButtonText:(0,_.__)("Get started"),onFinish:()=>e("welcomeGuide"),pages:[{image:(0,a.createElement)(Yl,{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,_.__)("Welcome to the block editor")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,_.__)("In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.")))},{image:(0,a.createElement)(Yl,{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,_.__)("Make each block your own")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,_.__)("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)(Yl,{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,_.__)("Get to know the block library")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,a.createInterpolateElement)((0,_.__)("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,_.__)("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)(Yl,{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,_.__)("Learn how to use the block editor")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,_.__)("New to the block editor? Want to learn more about using it? "),(0,a.createElement)(h.ExternalLink,{href:(0,_.__)("https://wordpress.org/support/article/wordpress-editor/")},(0,_.__)("Here's a detailed guide."))))}]})}function Ql(){const{toggleFeature:e}=(0,c.useDispatch)(Rt);return(0,a.createElement)(h.Guide,{className:"edit-template-welcome-guide",contentLabel:(0,_.__)("Welcome to the template editor"),finishButtonText:(0,_.__)("Get started"),onFinish:()=>e("welcomeGuideTemplate"),pages:[{image:(0,a.createElement)(Yl,{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,_.__)("Welcome to the template editor")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,_.__)("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 Zl(){const{isActive:e,isTemplateMode:t}=(0,c.useSelect)((e=>{const{isFeatureActive:t,isEditingTemplate:n}=e(Rt),l=n();return{isActive:t(l?"welcomeGuideTemplate":"welcomeGuide"),isTemplateMode:l}}),[]);return e?t?(0,a.createElement)(Ql,null):(0,a.createElement)(Xl,null):null}const{Fill:Jl,Slot:eo}=(0,h.createSlotFill)("PluginPostPublishPanel"),to=(0,b.compose)((0,S.withPluginContext)(((e,t)=>({icon:t.icon||e.icon}))))((e=>{let{children:t,className:n,title:l,initialOpen:o=!1,icon:r}=e;return(0,a.createElement)(Jl,null,(0,a.createElement)(h.PanelBody,{className:n,initialOpen:o||!l,title:l,icon:r},t))}));to.Slot=eo;var no=to;const{Fill:lo,Slot:oo}=(0,h.createSlotFill)("PluginPrePublishPanel"),ro=(0,b.compose)((0,S.withPluginContext)(((e,t)=>({icon:t.icon||e.icon}))))((e=>{let{children:t,className:n,title:l,initialOpen:o=!1,icon:r}=e;return(0,a.createElement)(lo,null,(0,a.createElement)(h.PanelBody,{className:n,initialOpen:o||!l,title:l,icon:r},t))}));ro.Slot=oo;var ao=ro;const{Fill:so,Slot:io}=(0,h.createSlotFill)("ActionsPanel");function co(e){let{setEntitiesSavedStatesCallback:t,closeEntitiesSavedStates:n,isEntitiesSavedStatesOpen:l}=e;const{closePublishSidebar:o,togglePublishSidebar:r}=(0,c.useDispatch)(Rt),{publishSidebarOpened:s,hasActiveMetaboxes:i,isSavingMetaBoxes:u,hasNonPostEntityChanges:d}=(0,c.useSelect)((e=>({publishSidebarOpened:e(Rt).isPublishSidebarOpened(),hasActiveMetaboxes:e(Rt).hasMetaBoxes(),isSavingMetaBoxes:e(Rt).isSavingMetaBoxes(),hasNonPostEntityChanges:e(T.store).hasNonPostEntityChanges()})),[]),m=(0,a.useCallback)((()=>t(!0)),[]);let p;return p=s?(0,a.createElement)(T.PostPublishPanel,{onClose:o,forceIsDirty:i,forceIsSaving:u,PrePublishExtension:ao.Slot,PostPublishExtension:no.Slot}):d?(0,a.createElement)("div",{className:"edit-post-layout__toggle-entities-saved-states-panel"},(0,a.createElement)(h.Button,{variant:"secondary",className:"edit-post-layout__toggle-entities-saved-states-panel-button",onClick:m,"aria-expanded":!1},(0,_.__)("Open save panel"))):(0,a.createElement)("div",{className:"edit-post-layout__toggle-publish-panel"},(0,a.createElement)(h.Button,{variant:"secondary",className:"edit-post-layout__toggle-publish-panel-button",onClick:r,"aria-expanded":!1},(0,_.__)("Open publish panel"))),(0,a.createElement)(a.Fragment,null,l&&(0,a.createElement)(T.EntitiesSavedStates,{close:n}),(0,a.createElement)(io,{bubblesVirtually:!0}),!l&&p)}function uo(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,c.useSelect)((e=>{const{__experimentalGetPatternsByBlockTypes:t}=e(E.store),{getCurrentPostType:n}=e(T.store);return{blockPatternsWithPostContentBlockType:t("core/post-content"),postType:n()}}),[]);return(0,a.useMemo)((()=>e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t)))),[t,e])}function mo(e){let{onChoosePattern:t}=e;const n=uo(),l=(0,b.useAsyncList)(n),{resetEditorBlocks:o}=(0,c.useDispatch)(T.store);return(0,a.createElement)(E.__experimentalBlockPatternsList,{blockPatterns:n,shownPatterns:l,onClickPattern:(e,n)=>{o(n),t()}})}const po="INITIAL",go="PATTERN",ho="CLOSED";function Eo(){const[e,t]=(0,a.useState)(po),n=uo().length>0,l=(0,c.useSelect)((t=>{if(!n||e!==po)return!1;const{getEditedPostContent:l,isEditedPostSaveable:o}=t(T.store),{isEditingTemplate:r,isFeatureActive:a}=t(Rt);return!o()&&""===l()&&!r()&&!a("welcomeGuide")}),[e,n]);return(0,a.useEffect)((()=>{l&&t(go)}),[l]),e===po||e===ho?null:(0,a.createElement)(h.Modal,{className:"edit-post-start-page-options__modal",title:(0,_.__)("Choose a pattern"),closeLabel:(0,_.__)("Cancel"),onRequestClose:()=>{t(ho)}},(0,a.createElement)("div",{className:"edit-post-start-page-options__modal-content"},e===go&&(0,a.createElement)(mo,{onChoosePattern:()=>{t(ho)}})))}const _o={header:(0,_.__)("Editor top bar"),body:(0,_.__)("Editor content"),sidebar:(0,_.__)("Editor settings"),actions:(0,_.__)("Editor publish"),footer:(0,_.__)("Editor footer")};var bo=function(e){let{styles:t}=e;const n=(0,b.useViewportMatch)("medium","<"),l=(0,b.useViewportMatch)("huge",">="),{openGeneralSidebar:o,closeGeneralSidebar:r,setIsInserterOpened:s}=(0,c.useDispatch)(Rt),{createErrorNotice:i}=(0,c.useDispatch)(P.store),{mode:u,isFullscreenActive:d,isRichEditingEnabled:m,sidebarIsOpened:p,hasActiveMetaboxes:g,hasFixedToolbar:f,previousShortcut:v,nextShortcut:y,hasBlockSelected:w,isInserterOpened:k,isListViewOpened:C,showIconLabels:x,hasReducedUI:B,showBlockBreadcrumbs:M,isTemplateMode:I,documentLabel:N}=(0,c.useSelect)((e=>{const{getEditorSettings:t,getPostTypeLabel:n}=e(T.store),l=t(),o=n();return{isTemplateMode:e(Rt).isEditingTemplate(),hasFixedToolbar:e(Rt).isFeatureActive("fixedToolbar"),sidebarIsOpened:!(!e(ee).getActiveComplementaryArea(Rt.name)&&!e(Rt).isPublishSidebarOpened()),isFullscreenActive:e(Rt).isFeatureActive("fullscreenMode"),isInserterOpened:e(Rt).isInserterOpened(),isListViewOpened:e(Rt).isListViewOpened(),mode:e(Rt).getEditorMode(),isRichEditingEnabled:l.richEditingEnabled,hasActiveMetaboxes:e(Rt).hasMetaBoxes(),previousShortcut:e(zt.store).getAllShortcutKeyCombinations("core/edit-post/previous-region"),nextShortcut:e(zt.store).getAllShortcutKeyCombinations("core/edit-post/next-region"),showIconLabels:e(Rt).isFeatureActive("showIconLabels"),hasReducedUI:e(Rt).isFeatureActive("reducedUI"),showBlockBreadcrumbs:e(Rt).isFeatureActive("showBlockBreadcrumbs"),documentLabel:o||(0,_._x)("Document","noun")}}),[]),A=L()("edit-post-layout","is-mode-"+u,{"is-sidebar-opened":p,"has-fixed-toolbar":f,"has-metaboxes":g,"show-icon-labels":x});(0,a.useEffect)((()=>{p&&!l&&s(!1)}),[p,l]),(0,a.useEffect)((()=>{k&&!l&&r()}),[k,l]);const[O,D]=(0,a.useState)(!1),R=(0,a.useCallback)((e=>{"function"==typeof O&&O(e),D(!1)}),[O]),F=C?(0,_.__)("List View"):(0,_.__)("Block Library");return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ge,{isActive:d}),(0,a.createElement)(Sn,null),(0,a.createElement)(T.UnsavedChangesWarning,null),(0,a.createElement)(T.AutosaveMonitor,null),(0,a.createElement)(T.LocalAutosaveMonitor,null),(0,a.createElement)(Qt,null),(0,a.createElement)(T.EditorKeyboardShortcutsRegister,null),(0,a.createElement)(Kl,null),(0,a.createElement)(he,{className:A,labels:{..._o,secondarySidebar:F},header:(0,a.createElement)(jn,{setEntitiesSavedStatesCallback:D}),secondarySidebar:"visual"===u&&k?(0,a.createElement)(Yn,null):"visual"===u&&C?(0,a.createElement)(Xn,null):null,sidebar:(!n||p)&&(0,a.createElement)(a.Fragment,null,!n&&!p&&(0,a.createElement)("div",{className:"edit-post-layout__toggle-sidebar-panel"},(0,a.createElement)(h.Button,{variant:"secondary",className:"edit-post-layout__toggle-sidebar-panel-button",onClick:()=>o(w?"edit-post/block":"edit-post/document"),"aria-expanded":!1},w?(0,_.__)("Open block settings"):(0,_.__)("Open document settings"))),(0,a.createElement)(pe.Slot,{scope:"core/edit-post"})),notices:(0,a.createElement)(T.EditorSnackbars,null),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(T.EditorNotices,null),("text"===u||!m)&&(0,a.createElement)($t,null),m&&"visual"===u&&(0,a.createElement)(Xt,{styles:t}),!I&&(0,a.createElement)("div",{className:"edit-post-layout__metaboxes"},(0,a.createElement)(Vl,{location:"normal"}),(0,a.createElement)(Vl,{location:"advanced"})),n&&p&&(0,a.createElement)(h.ScrollLock,null),(0,a.createElement)(E.BlockStyles.Slot,{scope:"core/block-inspector"})),footer:!B&&M&&!n&&m&&"visual"===u&&(0,a.createElement)("div",{className:"edit-post-layout__footer"},(0,a.createElement)(E.BlockBreadcrumb,{rootLabelText:N})),actions:(0,a.createElement)(co,{closeEntitiesSavedStates:R,isEntitiesSavedStatesOpen:O,setEntitiesSavedStatesCallback:D}),shortcuts:{previous:v,next:y}}),(0,a.createElement)(yn,null),(0,a.createElement)(an,null),(0,a.createElement)(Zl,null),(0,a.createElement)(Eo,null),(0,a.createElement)(h.Popover.Slot,null),(0,a.createElement)(S.PluginArea,{onError:function(e){i((0,_.sprintf)((0,_.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}))};function fo(e){let{postId:t}=e;return(e=>{const{hasBlockSelection:t,isEditorSidebarOpened:n}=(0,c.useSelect)((e=>({hasBlockSelection:!!e(E.store).getBlockSelectionStart(),isEditorSidebarOpened:e(Dt).isEditorSidebarOpened()})),[e]),{openGeneralSidebar:l}=(0,c.useDispatch)(Dt);(0,a.useEffect)((()=>{n&&l(t?"edit-post/block":"edit-post/document")}),[t,n])})(t),(e=>{const{newPermalink:t}=(0,c.useSelect)((e=>({newPermalink:e(T.store).getCurrentPost().link})),[e]),n=(0,a.useRef)();(0,a.useEffect)((()=>{n.current=document.querySelector("#wp-admin-bar-preview a")||document.querySelector("#wp-admin-bar-view a")}),[e]),(0,a.useEffect)((()=>{t&&n.current&&n.current.setAttribute("href",t)}),[t])})(t),null}var vo=function(e){let{postId:t,postType:n,settings:l,initialEdits:o,onError:r,...i}=e;const{hasFixedToolbar:u,focusMode:m,hasReducedUI:E,hasInlineToolbar:_,hasThemeStyles:b,post:f,preferredStyleVariations:v,hiddenBlockTypes:y,blockTypes:w,keepCaretInsideBlock:S,isTemplateMode:k,template:P}=(0,c.useSelect)((e=>{var l,o;const{isFeatureActive:r,__experimentalGetPreviewDeviceType:a,isEditingTemplate:i,getEditedPostTemplate:c,getHiddenBlockTypes:u}=e(Rt),{getEntityRecord:m,getPostType:p,getEntityRecords:g,canUser:h}=e(Ce.store),{getEditorSettings:E}=e(T.store),{getBlockTypes:_}=e(s.store);let b;if(["wp_template","wp_template_part"].includes(n)){const e=g("postType",n,{wp_id:t});b=null==e?void 0:e[0]}else b=m("postType",n,t);const f=E().supportsTemplateMode,v=null!==(l=null===(o=p(n))||void 0===o?void 0:o.viewable)&&void 0!==l&&l,y=h("create","templates");return{hasFixedToolbar:r("fixedToolbar")||"Desktop"!==a(),focusMode:r("focusMode"),hasReducedUI:r("reducedUI"),hasInlineToolbar:r("inlineToolbar"),hasThemeStyles:r("themeStyles"),preferredStyleVariations:e(d.store).get("core/edit-post","preferredStyleVariations"),hiddenBlockTypes:u(),blockTypes:_(),keepCaretInsideBlock:r("keepCaretInsideBlock"),isTemplateMode:i(),template:f&&v&&y?c():null,post:b}}),[n,t]),{updatePreferredStyleVariations:C,setIsInserterOpened:x}=(0,c.useDispatch)(Rt),B=(0,a.useMemo)((()=>{const e={...l,__experimentalPreferredStyleVariations:{value:v,onChange:C},hasFixedToolbar:u,focusMode:m,hasReducedUI:E,hasInlineToolbar:_,__experimentalSetIsInserterOpened:x,keepCaretInsideBlock:S,defaultAllowedBlockTypes:l.allowedBlockTypes};if(y.length>0){const t=!0===l.allowedBlockTypes?(0,g.map)(w,"name"):l.allowedBlockTypes||[];e.allowedBlockTypes=(0,g.without)(t,...y)}return e}),[l,u,m,E,y,w,v,x,C,S]),M=(0,a.useMemo)((()=>{var e;const t=[],n=[];null===(e=l.styles)||void 0===e||e.forEach((e=>{e.__unstableType&&"theme"!==e.__unstableType?n.push(e):t.push(e)}));const o=[...l.defaultEditorStyles,...n];return b&&t.length?l.styles:o}),[l,b]);return f?(0,a.createElement)(a.StrictMode,null,(0,a.createElement)(zt.ShortcutProvider,null,(0,a.createElement)(h.SlotFillProvider,null,(0,a.createElement)(T.EditorProvider,p({settings:B,post:f,initialEdits:o,useSubRegistry:!1,__unstableTemplate:k?P:void 0},i),(0,a.createElement)(T.ErrorBoundary,{onError:r},(0,a.createElement)(fo,{postId:t}),(0,a.createElement)(bo,{styles:M})),(0,a.createElement)(T.PostLockedModal,null))))):null};var yo=e=>{let{allowedBlocks:t,icon:n,label:l,onClick:o,small:r,role:s}=e;return(0,a.createElement)(E.BlockSettingsMenuControls,null,(e=>{let{selectedBlocks:i,onClose:c}=e;return((e,t)=>{return!Array.isArray(t)||(n=t,0===e.filter((e=>!n.includes(e))).length);var n})(i,t)?(0,a.createElement)(h.MenuItem,{onClick:(0,b.compose)(o,c),icon:n,label:r?l:void 0,role:s},!r&&l):null}))},wo=(0,b.compose)((0,S.withPluginContext)(((e,t)=>{var n;return{as:null!==(n=t.as)&&void 0!==n?n:h.MenuItem,icon:t.icon||e.icon,name:"core/edit-post/plugin-more-menu"}})))(ae);function So(e){return(0,a.createElement)(ie,p({__unstableExplicitMenuItem:!0,scope:"core/edit-post"},e))}function ko(e,t,n,l,o){(0,a.unmountComponentAtNode)(n);const r=ko.bind(null,e,t,n,l,o);(0,a.render)((0,a.createElement)(vo,{settings:l,onError:r,postId:t,postType:e,initialEdits:o,recovery:!0}),n)}function Po(e,t,n,l,o){const r=document.getElementById(e),m=ko.bind(null,t,n,r,l,o);(0,c.dispatch)(d.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,c.dispatch)(s.store).__experimentalReapplyBlockTypeFilters(),(0,c.select)(Rt).isFeatureActive("showListViewByDefault")&&(0,c.dispatch)(Rt).setIsListViewOpened(!0),(0,i.registerCoreBlocks)(),(0,u.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((e,t)=>!(!(0,c.select)(Rt).isEditingTemplate()&&"core/template-part"===t.name)&&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.");-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),(0,a.render)((0,a.createElement)(vo,{settings:l,onError:m,postId:n,postType:t,initialEdits:o}),r)}}(),(window.wp=window.wp||{}).editPost=l}();