WordPress/wp-includes/js/dist/edit-post.min.js

12 lines
68 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.wp=this.wp||{},this.wp.editPost=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=288)}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",function(){return o})},11:function(e,t){!function(){e.exports=this.wp.blocks}()},12:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var o=n(29),r=n(3);function i(e,t){return!t||"object"!==Object(o.a)(t)&&"function"!=typeof t?Object(r.a)(e):t}},13:function(e,t,n){"use strict";function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",function(){return o})},14:function(e,t,n){"use strict";function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}n.d(t,"a",function(){return r})},15:function(e,t,n){"use strict";function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",function(){return o})},16:function(e,t,n){var o;
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)&&o.length){var c=r.apply(null,o);c&&e.push(c)}else if("object"===i)for(var a in o)n.call(o,a)&&o[a]&&e.push(a)}}return e.join(" ")}void 0!==e&&e.exports?(r.default=r,e.exports=r):void 0===(o=function(){return r}.apply(t,[]))||(e.exports=o)}()},17:function(e,t){!function(){e.exports=this.wp.keycodes}()},18:function(e,t,n){"use strict";function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}n.d(t,"a",function(){return o})},182:function(e,t){!function(){e.exports=this.wp.blockLibrary}()},19:function(e,t,n){"use strict";var o=n(33);function r(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}n.d(t,"a",function(){return r})},2:function(e,t){!function(){e.exports=this.lodash}()},20:function(e,t,n){"use strict";function o(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}n.d(t,"a",function(){return o})},23:function(e,t){!function(){e.exports=this.wp.hooks}()},24:function(e,t,n){"use strict";var o=n(36);var r=n(37);function i(e,t){return Object(o.a)(e)||function(e,t){var n=[],o=!0,r=!1,i=void 0;try{for(var c,a=e[Symbol.iterator]();!(o=(c=a.next()).done)&&(n.push(c.value),!t||n.length!==t);o=!0);}catch(e){r=!0,i=e}finally{try{o||null==a.return||a.return()}finally{if(r)throw i}}return n}(e,t)||Object(r.a)()}n.d(t,"a",function(){return i})},27:function(e,t){!function(){e.exports=this.wp.deprecated}()},288:function(e,t,n){"use strict";n.r(t);var o={};n.r(o),n.d(o,"openGeneralSidebar",function(){return ne}),n.d(o,"closeGeneralSidebar",function(){return oe}),n.d(o,"openModal",function(){return re}),n.d(o,"closeModal",function(){return ie}),n.d(o,"openPublishSidebar",function(){return ce}),n.d(o,"closePublishSidebar",function(){return ae}),n.d(o,"togglePublishSidebar",function(){return le}),n.d(o,"toggleEditorPanelEnabled",function(){return se}),n.d(o,"toggleEditorPanelOpened",function(){return ue}),n.d(o,"toggleGeneralSidebarEditorPanel",function(){return de}),n.d(o,"toggleFeature",function(){return be}),n.d(o,"switchEditorMode",function(){return pe}),n.d(o,"togglePinnedPluginItem",function(){return Oe}),n.d(o,"initializeMetaBoxState",function(){return me}),n.d(o,"setActiveMetaBoxLocations",function(){return fe}),n.d(o,"setAvailableMetaBoxesPerLocation",function(){return je}),n.d(o,"requestMetaBoxUpdates",function(){return he}),n.d(o,"metaBoxUpdatesSuccess",function(){return ge}),n.d(o,"setMetaBoxSavedData",function(){return Ee});var r={};n.r(r),n.d(r,"getEditorMode",function(){return _e}),n.d(r,"isEditorSidebarOpened",function(){return ye}),n.d(r,"isPluginSidebarOpened",function(){return Se}),n.d(r,"getActiveGeneralSidebarName",function(){return Pe}),n.d(r,"getPreferences",function(){return ke}),n.d(r,"getPreference",function(){return we}),n.d(r,"isPublishSidebarOpened",function(){return Ce}),n.d(r,"isEditorPanelEnabled",function(){return xe}),n.d(r,"isEditorSidebarPanelOpened",function(){return Me}),n.d(r,"isEditorPanelOpened",function(){return Te}),n.d(r,"isModalActive",function(){return Be}),n.d(r,"isFeatureActive",function(){return Ae}),n.d(r,"isPluginItemPinned",function(){return Ne}),n.d(r,"getMetaBoxes",function(){return Ie}),n.d(r,"getActiveMetaBoxLocations",function(){return De}),n.d(r,"isMetaBoxLocationVisible",function(){return Le}),n.d(r,"isMetaBoxLocationActive",function(){return Ge}),n.d(r,"getMetaBoxesPerLocation",function(){return Fe}),n.d(r,"getAllMetaBoxes",function(){return Re}),n.d(r,"getMetaBox",function(){return Ue}),n.d(r,"hasMetaBoxes",function(){return Ve}),n.d(r,"isSavingMetaBoxes",function(){return He});var i=n(0),c=(n(78),n(7)),a=n(54),l=n(39),s=n(182),u=n(5),d=n(27),b=n.n(d),p=n(23),O=n(10),m=n(9),f=n(12),j=n(13),h=n(14),g=n(3),E=n(2),v=n(1),y=function(){return wp.media.view.MediaFrame.Post.extend({createStates:function(){this.states.add([new wp.media.controller.Library({id:"gallery",title:wp.media.view.l10n.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:!1,library:wp.media.query(_.defaults({type:"image"},this.options.library))}),new wp.media.controller.GalleryEdit({library:this.options.selection,editing:this.options.editing,menu:"gallery",displaySettings:!1,multiple:!0}),new wp.media.controller.GalleryAdd])}})},S=function(e){return Object(E.pick)(e,["sizes","mime","type","subtype","id","url","alt","link","caption"])},P=function(e){return wp.media.query({order:"ASC",orderby:"post__in",post__in:e,per_page:100,query:!0,type:"image"})},k=function(e){function t(e){var n,o=e.allowedTypes,r=e.type,i=e.multiple,c=void 0!==i&&i,a=e.gallery,l=void 0!==a&&a,s=e.title,u=void 0===s?Object(v.__)("Select or Upload Media"):s,d=e.modalClass,p=e.value;Object(O.a)(this,t),(n=Object(f.a)(this,Object(j.a)(t).apply(this,arguments))).openModal=n.openModal.bind(Object(g.a)(Object(g.a)(n))),n.onOpen=n.onOpen.bind(Object(g.a)(Object(g.a)(n))),n.onSelect=n.onSelect.bind(Object(g.a)(Object(g.a)(n))),n.onUpdate=n.onUpdate.bind(Object(g.a)(Object(g.a)(n))),n.onClose=n.onClose.bind(Object(g.a)(Object(g.a)(n)));var m=o;if(!o&&r&&(b()("type property of wp.editor.MediaUpload",{version:"4.2",alternative:"allowedTypes property containing an array with the allowedTypes or do not pass any property if all types are allowed"}),m="*"===r?void 0:[r]),l){var h=p?"gallery-edit":"gallery",E=y(),_=P(p),S=new wp.media.model.Selection(_.models,{props:_.props.toJSON(),multiple:c});n.frame=new E({mimeType:m,state:h,multiple:c,selection:S,editing:!!p}),wp.media.frame=n.frame}else{var k={title:u,button:{text:Object(v.__)("Select")},multiple:c};m&&(k.library={type:m}),n.frame=wp.media(k)}return d&&n.frame.$el.addClass(d),n.frame.on("select",n.onSelect),n.frame.on("update",n.onUpdate),n.frame.on("open",n.onOpen),n.frame.on("close",n.onClose),n}return Object(h.a)(t,e),Object(m.a)(t,[{key:"componentWillUnmount",value:function(){this.frame.remove()}},{key:"onUpdate",value:function(e){var t=this.props,n=t.onSelect,o=t.multiple,r=void 0!==o&&o,i=this.frame.state(),c=e||i.get("selection");c&&c.models.length&&n(r?c.models.map(function(e){return S(e.toJSON())}):S(c.models[0].toJSON()))}},{key:"onSelect",value:function(){var e=this.props,t=e.onSelect,n=e.multiple,o=void 0!==n&&n,r=this.frame.state().get("selection").toJSON();t(o?r:r[0])}},{key:"onOpen",value:function(){if(this.props.value){if(!this.props.gallery){var e=this.frame.state().get("selection");Object(E.castArray)(this.props.value).map(function(t){e.add(wp.media.attachment(t))})}P(Object(E.castArray)(this.props.value)).more()}}},{key:"onClose",value:function(){var e=this.props.onClose;e&&e()}},{key:"openModal",value:function(){this.frame.open()}},{key:"render",value:function(){return this.props.render({open:this.openModal})}}]),t}(i.Component);Object(p.addFilter)("editor.MediaUpload","core/edit-post/components/media-upload/replace-media-upload",function(){return k});var w=n(18),C=n(20),x=n(11),M=n(4),T=n(6),B=Object(T.compose)(Object(u.withSelect)(function(e,t){var n=e("core/editor").getBlocks();if(Object(x.hasBlockSupport)(t.name,"multiple",!0))return{};var o=Object(E.find)(n,function(e){var n=e.name;return t.name===n});return{originalBlockClientId:o&&o.clientId!==t.clientId&&o.clientId}}),Object(u.withDispatch)(function(e,t){var n=t.originalBlockClientId;return{selectFirst:function(){return e("core/editor").selectBlock(n)}}})),A=Object(T.createHigherOrderComponent)(function(e){return B(function(t){var n=t.originalBlockClientId,o=t.selectFirst,r=Object(C.a)(t,["originalBlockClientId","selectFirst"]);if(!n)return Object(i.createElement)(e,r);var a=Object(x.getBlockType)(r.name),l=function(e){var t=Object(x.findTransform)(Object(x.getBlockTransforms)("to",e),function(e){var t=e.type,n=e.blocks;return"block"===t&&1===n.length});if(!t)return null;return Object(x.getBlockType)(t.blocks[0])}(r.name);return[Object(i.createElement)("div",{key:"invalid-preview",style:{minHeight:"60px"}},Object(i.createElement)(e,Object(w.a)({key:"block-edit"},r))),Object(i.createElement)(c.Warning,{key:"multiple-use-warning",actions:[Object(i.createElement)(M.Button,{key:"find-original",isLarge:!0,onClick:o},Object(v.__)("Find original")),Object(i.createElement)(M.Button,{key:"remove",isLarge:!0,onClick:function(){return r.onReplace([])}},Object(v.__)("Remove")),l&&Object(i.createElement)(M.Button,{key:"transform",isLarge:!0,onClick:function(){return r.onReplace(Object(x.createBlock)(l.name,r.attributes))}},Object(v.__)("Transform into:")," ",l.title)]},Object(i.createElement)("strong",null,a.title,": "),Object(v.__)("This block can only be used once."))]})},"withMultipleValidation");Object(p.addFilter)("editor.BlockEdit","core/edit-post/validate-multiple-use/with-multiple-validation",A);var N=n(61);var I=Object(T.compose)(Object(u.withSelect)(function(e){return{editedPostContent:e("core/editor").getEditedPostAttribute("content")}}),Object(T.withState)({hasCopied:!1}))(function(e){var t=e.editedPostContent,n=e.hasCopied,o=e.setState;return Object(i.createElement)(M.ClipboardButton,{text:t,className:"components-menu-item__button",onCopy:function(){return o({hasCopied:!0})},onFinishCopy:function(){return o({hasCopied:!1})}},n?Object(v.__)("Copied!"):Object(v.__)("Copy All Content"))}),D=n(17);var L=Object(u.withDispatch)(function(e){return{openModal:e("core/edit-post").openModal}})(function(e){var t=e.openModal,n=e.onSelect;return Object(i.createElement)(M.MenuItem,{onClick:function(){n(),t("edit-post/keyboard-shortcut-help")},shortcut:D.displayShortcut.access("h")},Object(v.__)("Keyboard Shortcuts"))}),G=Object(M.createSlotFill)("ToolsMoreMenuGroup"),F=G.Fill,R=G.Slot;F.Slot=function(e){var t=e.fillProps;return Object(i.createElement)(R,{fillProps:t},function(e){return!Object(E.isEmpty)(e)&&Object(i.createElement)(M.MenuGroup,{label:Object(v.__)("Tools")},e)})};var U=F;Object(N.registerPlugin)("edit-post",{render:function(){return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(U,null,function(e){var t=e.onClose;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(M.MenuItem,{role:"menuitem",href:"edit.php?post_type=wp_block"},Object(v.__)("Manage All Reusable Blocks")),Object(i.createElement)(L,{onSelect:t}),Object(i.createElement)(I,null))}))}});var V=n(15),H=n(8),W={editorMode:"visual",isGeneralSidebarDismissed:!1,panels:{"post-status":{opened:!0}},features:{fixedToolbar:!1},pinnedPluginItems:{}},q="edit-post/document",X=Object(u.combineReducers)({isGeneralSidebarDismissed:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_GENERAL_SIDEBAR":case"CLOSE_GENERAL_SIDEBAR":return"CLOSE_GENERAL_SIDEBAR"===t.type}return e},panels:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:W.panels,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"TOGGLE_PANEL_ENABLED":var n=t.panelName;return Object(H.a)({},e,Object(V.a)({},n,Object(H.a)({},e[n],{enabled:!Object(E.get)(e,[n,"enabled"],!0)})));case"TOGGLE_PANEL_OPENED":var o=t.panelName,r=!0===e[o]||Object(E.get)(e,[o,"opened"],!1);return Object(H.a)({},e,Object(V.a)({},o,Object(H.a)({},e[o],{opened:!r})))}return e},features:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:W.features,t=arguments.length>1?arguments[1]:void 0;return"TOGGLE_FEATURE"===t.type?Object(H.a)({},e,Object(V.a)({},t.feature,!e[t.feature])):e},editorMode:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:W.editorMode,t=arguments.length>1?arguments[1]:void 0;return"SWITCH_MODE"===t.type?t.mode:e},pinnedPluginItems:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:W.pinnedPluginItems,t=arguments.length>1?arguments[1]:void 0;return"TOGGLE_PINNED_PLUGIN_ITEM"===t.type?Object(H.a)({},e,Object(V.a)({},t.pluginName,!Object(E.get)(e,[t.pluginName],!0))):e}});var z=Object(u.combineReducers)({isSaving:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];switch((arguments.length>1?arguments[1]:void 0).type){case"REQUEST_META_BOX_UPDATES":return!0;case"META_BOX_UPDATES_SUCCESS":return!1;default:return e}},locations:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_META_BOXES_PER_LOCATIONS":return t.metaBoxesPerLocation}return e}}),K=Object(u.combineReducers)({preferences:X,activeGeneralSidebar:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:q,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_GENERAL_SIDEBAR":return t.name}return e},panel:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"document",t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_ACTIVE_PANEL":return t.panel}return e},activeModal:function(){var 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},publishSidebarActive:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];switch((arguments.length>1?arguments[1]:void 0).type){case"OPEN_PUBLISH_SIDEBAR":return!0;case"CLOSE_PUBLISH_SIDEBAR":return!1;case"TOGGLE_PUBLISH_SIDEBAR":return!e}return e},metaBoxes:z}),Q=n(19),J=n(86),Y=n.n(J),$=n(24),Z=n(50),ee=n(31),te=n.n(ee);function ne(e){return{type:"OPEN_GENERAL_SIDEBAR",name:e}}function oe(){return{type:"CLOSE_GENERAL_SIDEBAR"}}function re(e){return{type:"OPEN_MODAL",name:e}}function ie(){return{type:"CLOSE_MODAL"}}function ce(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function ae(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function le(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}function se(e){return{type:"TOGGLE_PANEL_ENABLED",panelName:e}}function ue(e){return{type:"TOGGLE_PANEL_OPENED",panelName:e}}function de(e){return b()("toggleGeneralSidebarEditorPanel",{alternative:"toggleEditorPanelOpened",plugin:"Gutenberg",version:"4.3.0"}),ue(e)}function be(e){return{type:"TOGGLE_FEATURE",feature:e}}function pe(e){return{type:"SWITCH_MODE",mode:e}}function Oe(e){return{type:"TOGGLE_PINNED_PLUGIN_ITEM",pluginName:e}}function me(){return b()("initializeMetaBoxState action (`core/edit-post`)",{plugin:"Gutenberg",version:"4.2"}),{type:"DO_NOTHING"}}function fe(){return b()("setActiveMetaBoxLocations action (`core/edit-post`)",{plugin:"Gutenberg",version:"4.2"}),{type:"DO_NOTHING"}}function je(e){return{type:"SET_META_BOXES_PER_LOCATIONS",metaBoxesPerLocation:e}}function he(){return{type:"REQUEST_META_BOX_UPDATES"}}function ge(){return{type:"META_BOX_UPDATES_SUCCESS"}}function Ee(e){return b()("setMetaBoxSavedData action (`core/edit-post`)",{plugin:"Gutenberg",version:"4.2"}),{type:"META_BOX_SET_SAVED_DATA",dataPerLocation:e}}var ve=n(34);function _e(e){return we(e,"editorMode","visual")}function ye(e){var t=Pe(e);return Object(E.includes)(["edit-post/document","edit-post/block"],t)}function Se(e){return!!Pe(e)&&!ye(e)}function Pe(e){return we(e,"isGeneralSidebarDismissed",!1)?null:e.activeGeneralSidebar}function ke(e){return e.preferences}function we(e,t,n){var o=ke(e)[t];return void 0===o?n:o}function Ce(e){return e.publishSidebarActive}function xe(e,t){var n=we(e,"panels");return Object(E.get)(n,[t,"enabled"],!0)}function Me(e,t){return b()("isEditorSidebarPanelOpened",{alternative:"isEditorPanelEnabled",plugin:"Gutenberg",version:"4.3"}),xe(e,t)}function Te(e,t){var n=we(e,"panels");return!0===n[t]||Object(E.get)(n,[t,"opened"],!1)}function Be(e,t){return e.activeModal===t}function Ae(e,t){return!!e.preferences.features[t]}function Ne(e,t){var n=we(e,"pinnedPluginItems",{});return Object(E.get)(n,[t],!0)}function Ie(e){return b()("getMetaBox selector (`core/edit-post`)",{alternative:"getActiveMetaBoxLocations selector",plugin:"Gutenberg",version:"4.2"}),["normal","side","advanced"].reduce(function(t,n){return t[n]={isActive:Ge(e,n)},t},{})}var De=Object(ve.a)(function(e){return Object.keys(e.metaBoxes.locations).filter(function(t){return Ge(e,t)})},function(e){return[e.metaBoxes.locations]});function Le(e,t){return Ge(e,t)&&Object(E.some)(Fe(e,t),function(t){var n=t.id;return xe(e,"meta-box-".concat(n))})}function Ge(e,t){var n=Fe(e,t);return!!n&&0!==n.length}function Fe(e,t){return e.metaBoxes.locations[t]}var Re=Object(ve.a)(function(e){return Object(E.flatten)(Object(E.values)(e.metaBoxes.locations))},function(e){return[e.metaBoxes.locations]});function Ue(e,t){return b()("getMetaBox selector (`core/edit-post`)",{alternative:"isMetaBoxLocationActive selector",plugin:"Gutenberg",version:"4.2"}),Ie(e)[t]}function Ve(e){return De(e).length>0}function He(e){return e.metaBoxes.isSaving}var We=function(e,t){var n=e();return function(){var o=e();o!==n&&(n=o,t(o))}},qe={SET_META_BOXES_PER_LOCATIONS:function(e,t){setTimeout(function(){var e=Object(u.select)("core/editor").getCurrentPostType();window.postboxes.page!==e&&window.postboxes.add_postbox_toggles(e)});var n=Object(u.select)("core/editor").isSavingPost(),o=Object(u.select)("core/editor").isAutosavingPost();Object(u.subscribe)(function(){var e=Object(u.select)("core/editor").isSavingPost(),r=Object(u.select)("core/editor").isAutosavingPost(),i=Object(u.select)("core/edit-post").hasMetaBoxes()&&n&&!o&&!e&&!r;n=e,o=r,i&&t.dispatch({type:"REQUEST_META_BOX_UPDATES"})})},REQUEST_META_BOX_UPDATES:function(e,t){var n=t.getState(),o=Object(u.select)("core/editor").getCurrentPost(n),r=[!!o.comment_status&&["comment_status",o.comment_status],!!o.ping_status&&["ping_status",o.ping_status],!!o.sticky&&["sticky",o.sticky],["post_author",o.author]].filter(Boolean),i=[new window.FormData(document.querySelector(".metabox-base-form"))].concat(Object(Q.a)(De(n).map(function(e){return new window.FormData(function(e){var t=document.querySelector(".edit-post-meta-boxes-area.is-".concat(e," .metabox-location-").concat(e));return t||document.querySelector("#metaboxes .metabox-location-"+e)}(e))}))),c=Object(E.reduce)(i,function(e,t){var n=!0,o=!1,r=void 0;try{for(var i,c=t[Symbol.iterator]();!(n=(i=c.next()).done);n=!0){var a=Object($.a)(i.value,2),l=a[0],s=a[1];e.append(l,s)}}catch(e){o=!0,r=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw r}}return e},new window.FormData);r.forEach(function(e){var t=Object($.a)(e,2),n=t[0],o=t[1];return c.append(n,o)}),te()({url:window._wpMetaBoxUrl,method:"POST",body:c,parse:!1}).then(function(){return t.dispatch({type:"META_BOX_UPDATES_SUCCESS"})})},SWITCH_MODE:function(e){"visual"!==e.mode&&Object(u.dispatch)("core/editor").clearSelectedBlock();var t="visual"===e.mode?Object(v.__)("Visual editor selected"):Object(v.__)("Code editor selected");Object(Z.speak)(t,"assertive")},INIT:function(e,t){Object(u.subscribe)(We(function(){return!!Object(u.select)("core/editor").getBlockSelectionStart()},function(e){Object(u.select)("core/edit-post").isEditorSidebarOpened()&&(e?t.dispatch(ne("edit-post/block")):t.dispatch(ne("edit-post/document")))}));var n=function(){return Object(u.select)("core/viewport").isViewportMatch("< medium")},o=function(){var e=null;return function(n){n?(e=Pe(t.getState()))&&t.dispatch({type:"CLOSE_GENERAL_SIDEBAR"}):e&&!Pe(t.getState())&&t.dispatch(ne(e))}}();o(n()),Object(u.subscribe)(We(n,o))}};var Xe=function(e){var t,n=[Y()(qe)],o=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},r={getState:e.getState,dispatch:function(){return o.apply(void 0,arguments)}};return t=n.map(function(e){return e(r)}),o=E.flowRight.apply(void 0,Object(Q.a)(t))(e.dispatch),e.dispatch=o,e},ze=Object(u.registerStore)("core/edit-post",{reducer:K,actions:o,selectors:r,persist:["preferences"]});Xe(ze),ze.dispatch({type:"INIT"});var Ke=ze,Qe=n(16),Je=n.n(Qe),Ye=n(30);var $e=function(e){function t(){var e;return Object(O.a)(this,t),(e=Object(f.a)(this,Object(j.a)(t).apply(this,arguments))).state={historyId:null},e}return Object(h.a)(t,e),Object(m.a)(t,[{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.postId,o=t.postStatus,r=t.postType,i=this.state.historyId;"trash"!==o?n===e.postId&&n===i||"auto-draft"===o||this.setBrowserURL(n):this.setTrashURL(n,r)}},{key:"setTrashURL",value:function(e,t){window.location.href=function(e,t){return Object(Ye.addQueryArgs)("edit.php",{trashed:1,post_type:t,ids:e})}(e,t)}},{key:"setBrowserURL",value:function(e){window.history.replaceState({id:e},"Post "+e,function(e){return Object(Ye.addQueryArgs)("post.php",{post:e,action:"edit"})}(e)),this.setState(function(){return{historyId:e}})}},{key:"render",value:function(){return null}}]),t}(i.Component),Ze=Object(u.withSelect)(function(e){var t=(0,e("core/editor").getCurrentPost)();return{postId:t.id,postStatus:t.status,postType:t.type}})($e),et={toggleEditorMode:{raw:D.rawShortcut.secondary("m"),display:D.displayShortcut.secondary("m")},toggleSidebar:{raw:D.rawShortcut.primaryShift(","),display:D.displayShortcut.primaryShift(","),ariaLabel:D.shortcutAriaLabel.primaryShift(",")}},tt=Object(T.compose)(Object(u.withSelect)(function(e){return{title:e("core/editor").getEditedPostAttribute("title")}}),Object(u.withDispatch)(function(e){return{closeSidebar:e("core/edit-post").closeGeneralSidebar}}))(function(e){var t=e.children,n=e.className,o=e.closeLabel,r=e.closeSidebar,c=e.title;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)("div",{className:"components-panel__header edit-post-sidebar-header__small"},Object(i.createElement)("span",{className:"edit-post-sidebar-header__title"},c||Object(v.__)("(no title)")),Object(i.createElement)(M.IconButton,{onClick:r,icon:"no-alt",label:o})),Object(i.createElement)("div",{className:Je()("components-panel__header edit-post-sidebar-header",n)},t,Object(i.createElement)(M.IconButton,{onClick:r,icon:"no-alt",label:o,shortcut:et.toggleSidebar})))}),nt=Object(T.compose)(Object(u.withSelect)(function(e){return{count:e("core/editor").getSelectedBlockCount()}}),Object(u.withDispatch)(function(e){var t=e("core/edit-post").openGeneralSidebar,n=e("core/editor").clearSelectedBlock;return{openDocumentSettings:function(){t("edit-post/document"),n()},openBlockSettings:function(){t("edit-post/block")}}}))(function(e){var t=e.count,n=e.openDocumentSettings,o=e.openBlockSettings,r=e.sidebarName,c=0===t?1:t,a=1===c?Object(v.__)("Block"):Object(v.sprintf)(Object(v._n)("%d Block","%d Blocks",c),c);return Object(i.createElement)(tt,{className:"edit-post-sidebar__panel-tabs",closeLabel:Object(v.__)("Close settings")},Object(i.createElement)("button",{onClick:n,className:"edit-post-sidebar__panel-tab ".concat("edit-post/document"===r?"is-active":""),"aria-label":Object(v.__)("Document settings"),"data-label":Object(v.__)("Document")},Object(v.__)("Document")),Object(i.createElement)("button",{onClick:o,className:"edit-post-sidebar__panel-tab ".concat("edit-post/block"===r?"is-active":""),"aria-label":Object(v.__)("Block settings"),"data-label":a},a))}),ot=Object(M.createSlotFill)("Sidebar"),rt=ot.Fill,it=ot.Slot,ct=Object(T.compose)(Object(u.withSelect)(function(e,t){var n=t.name;return{isActive:e("core/edit-post").getActiveGeneralSidebarName()===n}}),Object(T.ifCondition)(function(e){return e.isActive}),M.withFocusReturn)(function(e){var t=e.children,n=e.label;return Object(i.createElement)(rt,null,Object(i.createElement)("div",{className:"edit-post-sidebar",role:"region","aria-label":n,tabIndex:"-1"},t))});ct.Slot=it;var at=ct,lt=function(){return Object(i.createElement)(at,{name:"edit-post/block",label:Object(v.__)("Editor settings")},Object(i.createElement)(nt,{sidebarName:"edit-post/block"}),Object(i.createElement)(M.Panel,null,Object(i.createElement)(M.PanelBody,{className:"edit-post-block-sidebar__panel"},Object(i.createElement)(c.BlockInspector,null))))};var st=function(){return Object(i.createElement)(c.PostVisibilityCheck,{render:function(e){var t=e.canEdit;return Object(i.createElement)(M.PanelRow,{className:"edit-post-post-visibility"},Object(i.createElement)("span",null,Object(v.__)("Visibility")),!t&&Object(i.createElement)("span",null,Object(i.createElement)(c.PostVisibilityLabel,null)),t&&Object(i.createElement)(M.Dropdown,{position:"bottom left",contentClassName:"edit-post-post-visibility__dialog",renderToggle:function(e){var t=e.isOpen,n=e.onToggle;return Object(i.createElement)(M.Button,{type:"button","aria-expanded":t,className:"edit-post-post-visibility__toggle",onClick:n,isLink:!0},Object(i.createElement)(c.PostVisibilityLabel,null))},renderContent:function(){return Object(i.createElement)(c.PostVisibility,null)}}))}})};function ut(){return Object(i.createElement)(c.PostTrashCheck,null,Object(i.createElement)(M.PanelRow,null,Object(i.createElement)(c.PostTrash,null)))}var dt=Object(T.withInstanceId)(function(e){var t=e.instanceId;return Object(i.createElement)(c.PostScheduleCheck,null,Object(i.createElement)(M.PanelRow,{className:"edit-post-post-schedule"},Object(i.createElement)("label",{htmlFor:"edit-post-post-schedule__toggle-".concat(t),id:"edit-post-post-schedule__heading-".concat(t)},Object(v.__)("Publish")),Object(i.createElement)(M.Dropdown,{position:"bottom left",contentClassName:"edit-post-post-schedule__dialog",renderToggle:function(e){var n=e.onToggle,o=e.isOpen;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)("label",{className:"edit-post-post-schedule__label",htmlFor:"edit-post-post-schedule__toggle-".concat(t)},Object(i.createElement)(c.PostScheduleLabel,null)," ",Object(v.__)("Click to change")),Object(i.createElement)(M.Button,{id:"edit-post-post-schedule__toggle-".concat(t),type:"button",className:"edit-post-post-schedule__toggle",onClick:n,"aria-expanded":o,"aria-live":"polite",isLink:!0},Object(i.createElement)(c.PostScheduleLabel,null)))},renderContent:function(){return Object(i.createElement)(c.PostSchedule,null)}})))});var bt=function(){return Object(i.createElement)(c.PostStickyCheck,null,Object(i.createElement)(M.PanelRow,null,Object(i.createElement)(c.PostSticky,null)))};var pt=function(){return Object(i.createElement)(c.PostAuthorCheck,null,Object(i.createElement)(M.PanelRow,null,Object(i.createElement)(c.PostAuthor,null)))};var Ot=function(){return Object(i.createElement)(c.PostFormatCheck,null,Object(i.createElement)(M.PanelRow,null,Object(i.createElement)(c.PostFormat,null)))};var mt=function(){return Object(i.createElement)(c.PostPendingStatusCheck,null,Object(i.createElement)(M.PanelRow,null,Object(i.createElement)(c.PostPendingStatus,null)))},ft=Object(M.createSlotFill)("PluginPostStatusInfo"),jt=ft.Fill,ht=ft.Slot,gt=function(e){var t=e.children,n=e.className;return Object(i.createElement)(jt,null,Object(i.createElement)(M.PanelRow,{className:n},t))};gt.Slot=ht;var Et=gt;var vt=Object(T.compose)([Object(u.withSelect)(function(e){return{isOpened:e("core/edit-post").isEditorPanelOpened("post-status")}}),Object(u.withDispatch)(function(e){return{onTogglePanel:function(){return e("core/edit-post").toggleEditorPanelOpened("post-status")}}})])(function(e){var t=e.isOpened,n=e.onTogglePanel;return Object(i.createElement)(M.PanelBody,{className:"edit-post-post-status",title:Object(v.__)("Status & Visibility"),opened:t,onToggle:n},Object(i.createElement)(Et.Slot,null,function(e){return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(st,null),Object(i.createElement)(dt,null),Object(i.createElement)(Ot,null),Object(i.createElement)(bt,null),Object(i.createElement)(mt,null),Object(i.createElement)(pt,null),e,Object(i.createElement)(ut,null))}))});var _t=Object(T.compose)([Object(u.withSelect)(function(e){return{isEnabled:e("core/edit-post").isEditorPanelEnabled("post-excerpt"),isOpened:e("core/edit-post").isEditorPanelOpened("post-excerpt")}}),Object(u.withDispatch)(function(e){return{onTogglePanel:function(){return e("core/edit-post").toggleEditorPanelOpened("post-excerpt")}}})])(function(e){var t=e.isEnabled,n=e.isOpened,o=e.onTogglePanel;return t?Object(i.createElement)(c.PostExcerptCheck,null,Object(i.createElement)(M.PanelBody,{title:Object(v.__)("Excerpt"),opened:n,onToggle:o},Object(i.createElement)(c.PostExcerpt,null))):null});var yt=Object(T.compose)(Object(u.withSelect)(function(e,t){var n=Object(E.get)(t.taxonomy,["slug"]),o=n?"taxonomy-panel-".concat(n):"";return{panelName:o,isEnabled:!!n&&e("core/edit-post").isEditorPanelEnabled(o),isOpened:!!n&&e("core/edit-post").isEditorPanelOpened(o)}}),Object(u.withDispatch)(function(e,t){return{onTogglePanel:function(){e("core/edit-post").toggleEditorPanelOpened(t.panelName)}}}))(function(e){var t=e.isEnabled,n=e.taxonomy,o=e.isOpened,r=e.onTogglePanel,c=e.children;if(!t)return null;var a=Object(E.get)(n,["labels","menu_name"]);return a?Object(i.createElement)(M.PanelBody,{title:a,opened:o,onToggle:r},c):null});var St=function(){return Object(i.createElement)(c.PostTaxonomiesCheck,null,Object(i.createElement)(c.PostTaxonomies,{taxonomyWrapper:function(e,t){return Object(i.createElement)(yt,{taxonomy:t},e)}}))};var Pt=Object(u.withSelect)(function(e){var t=e("core/editor").getEditedPostAttribute,n=e("core").getPostType,o=e("core/edit-post"),r=o.isEditorPanelEnabled,i=o.isEditorPanelOpened;return{postType:n(t("type")),isEnabled:r("featured-image"),isOpened:i("featured-image")}}),kt=Object(u.withDispatch)(function(e){var t=e("core/edit-post").toggleEditorPanelOpened;return{onTogglePanel:Object(E.partial)(t,"featured-image")}}),wt=Object(T.compose)(Pt,kt)(function(e){var t=e.isEnabled,n=e.isOpened,o=e.postType,r=e.onTogglePanel;return t?Object(i.createElement)(c.PostFeaturedImageCheck,null,Object(i.createElement)(M.PanelBody,{title:Object(E.get)(o,["labels","featured_image"],Object(v.__)("Featured Image")),opened:n,onToggle:r},Object(i.createElement)(c.PostFeaturedImage,null))):null});var Ct=Object(T.compose)([Object(u.withSelect)(function(e){return{isEnabled:e("core/edit-post").isEditorPanelEnabled("discussion-panel"),isOpened:e("core/edit-post").isEditorPanelOpened("discussion-panel")}}),Object(u.withDispatch)(function(e){return{onTogglePanel:function(){return e("core/edit-post").toggleEditorPanelOpened("discussion-panel")}}})])(function(e){var t=e.isEnabled,n=e.isOpened,o=e.onTogglePanel;return t?Object(i.createElement)(c.PostTypeSupportCheck,{supportKeys:["comments","trackbacks"]},Object(i.createElement)(M.PanelBody,{title:Object(v.__)("Discussion"),opened:n,onToggle:o},Object(i.createElement)(c.PostTypeSupportCheck,{supportKeys:"comments"},Object(i.createElement)(M.PanelRow,null,Object(i.createElement)(c.PostComments,null))),Object(i.createElement)(c.PostTypeSupportCheck,{supportKeys:"trackbacks"},Object(i.createElement)(M.PanelRow,null,Object(i.createElement)(c.PostPingbacks,null))))):null});var xt=function(){return Object(i.createElement)(c.PostLastRevisionCheck,null,Object(i.createElement)(M.PanelBody,{className:"edit-post-last-revision__panel"},Object(i.createElement)(c.PostLastRevision,null)))};var Mt=Object(u.withSelect)(function(e){var t=e("core/editor").getEditedPostAttribute,n=e("core/edit-post"),o=n.isEditorPanelEnabled,r=n.isEditorPanelOpened,i=e("core").getPostType;return{isEnabled:o("page-attributes"),isOpened:r("page-attributes"),postType:i(t("type"))}}),Tt=Object(u.withDispatch)(function(e){var t=e("core/edit-post").toggleEditorPanelOpened;return{onTogglePanel:Object(E.partial)(t,"page-attributes")}}),Bt=Object(T.compose)(Mt,Tt)(function(e){var t=e.isEnabled,n=e.isOpened,o=e.onTogglePanel,r=e.postType;return t&&r?Object(i.createElement)(c.PageAttributesCheck,null,Object(i.createElement)(M.PanelBody,{title:Object(E.get)(r,["labels","attributes"],Object(v.__)("Page Attributes")),opened:n,onToggle:o},Object(i.createElement)(c.PageTemplate,null),Object(i.createElement)(c.PageAttributesParent,null),Object(i.createElement)(M.PanelRow,null,Object(i.createElement)(c.PageAttributesOrder,null)))):null}),At=function(e){function t(){var e;return Object(O.a)(this,t),(e=Object(f.a)(this,Object(j.a)(t).apply(this,arguments))).bindContainerNode=e.bindContainerNode.bind(Object(g.a)(Object(g.a)(e))),e}return Object(h.a)(t,e),Object(m.a)(t,[{key:"componentDidMount",value:function(){this.form=document.querySelector(".metabox-location-"+this.props.location),this.form&&this.container.appendChild(this.form)}},{key:"componentWillUnmount",value:function(){this.form&&document.querySelector("#metaboxes").appendChild(this.form)}},{key:"bindContainerNode",value:function(e){this.container=e}},{key:"render",value:function(){var e=this.props,t=e.location,n=e.isSaving,o=Je()("edit-post-meta-boxes-area","is-".concat(t),{"is-loading":n});return Object(i.createElement)("div",{className:o},n&&Object(i.createElement)(M.Spinner,null),Object(i.createElement)("div",{className:"edit-post-meta-boxes-area__container",ref:this.bindContainerNode}),Object(i.createElement)("div",{className:"edit-post-meta-boxes-area__clear"}))}}]),t}(i.Component),Nt=Object(u.withSelect)(function(e){return{isSaving:e("core/edit-post").isSavingMetaBoxes()}})(At),It=function(e){function t(){return Object(O.a)(this,t),Object(f.a)(this,Object(j.a)(t).apply(this,arguments))}return Object(h.a)(t,e),Object(m.a)(t,[{key:"componentDidMount",value:function(){this.updateDOM()}},{key:"componentDidUpdate",value:function(e){this.props.isVisible!==e.isVisible&&this.updateDOM()}},{key:"updateDOM",value:function(){var e=this.props,t=e.id,n=e.isVisible,o=document.getElementById(t);o&&(o.style.display=n?"":"none")}},{key:"render",value:function(){return null}}]),t}(i.Component),Dt=Object(u.withSelect)(function(e,t){var n=t.id;return{isVisible:e("core/edit-post").isEditorPanelEnabled("meta-box-".concat(n))}})(It);var Lt=Object(u.withSelect)(function(e,t){var n=t.location,o=e("core/edit-post"),r=o.isMetaBoxLocationVisible;return{metaBoxes:(0,o.getMetaBoxesPerLocation)(n),isVisible:r(n)}})(function(e){var t=e.location,n=e.isVisible,o=e.metaBoxes;return Object(i.createElement)(i.Fragment,null,Object(E.map)(o,function(e){var t=e.id;return Object(i.createElement)(Dt,{key:t,id:t})}),n&&Object(i.createElement)(Nt,{location:t}))}),Gt=function(){return Object(i.createElement)(at,{name:"edit-post/document",label:Object(v.__)("Editor settings")},Object(i.createElement)(nt,{sidebarName:"edit-post/document"}),Object(i.createElement)(M.Panel,null,Object(i.createElement)(vt,null),Object(i.createElement)(xt,null),Object(i.createElement)(St,null),Object(i.createElement)(wt,null),Object(i.createElement)(_t,null),Object(i.createElement)(Ct,null),Object(i.createElement)(Bt,null),Object(i.createElement)(Lt,{location:"side"})))},Ft=[{value:"visual",label:Object(v.__)("Visual Editor")},{value:"text",label:Object(v.__)("Code Editor")}];var Rt=Object(T.compose)([Object(u.withSelect)(function(e){return{mode:e("core/edit-post").getEditorMode()}}),Object(u.withDispatch)(function(e,t){return{onSwitch:function(n){e("core/edit-post").switchEditorMode(n),t.onSelect(n)}}})])(function(e){var t=e.onSwitch,n=e.mode,o=Ft.map(function(e){return e.value!==n?Object(H.a)({},e,{shortcut:et.toggleEditorMode.display}):e});return Object(i.createElement)(M.MenuGroup,{label:Object(v.__)("Editor")},Object(i.createElement)(M.MenuItemsChoice,{choices:o,value:n,onSelect:t}))}),Ut=Object(M.createSlotFill)("PluginsMoreMenuGroup"),Vt=Ut.Fill,Ht=Ut.Slot;Vt.Slot=function(e){var t=e.fillProps;return Object(i.createElement)(Ht,{fillProps:t},function(e){return!Object(E.isEmpty)(e)&&Object(i.createElement)(M.MenuGroup,{label:Object(v.__)("Plugins")},e)})};var Wt=Vt;var qt=Object(u.withDispatch)(function(e){return{openModal:e("core/edit-post").openModal}})(function(e){var t=e.openModal,n=e.onSelect;return Object(i.createElement)(M.MenuItem,{onClick:function(){n(),t("edit-post/options")}},Object(v.__)("Options"))});var Xt=Object(T.compose)([Object(u.withSelect)(function(e,t){var n=t.feature;return{isActive:e("core/edit-post").isFeatureActive(n)}}),Object(u.withDispatch)(function(e,t){return{onToggle:function(){e("core/edit-post").toggleFeature(t.feature),t.onToggle()}}})])(function(e){var t=e.onToggle,n=e.isActive,o=e.label,r=e.info;return Object(i.createElement)(M.MenuItem,{icon:n&&"yes",isSelected:n,onClick:t,role:"menuitemcheckbox",label:o,info:r},o)});var zt=Object(l.ifViewportMatches)("medium")(function(e){var t=e.onClose;return Object(i.createElement)(M.MenuGroup,{label:Object(v._x)("View","noun")},Object(i.createElement)(Xt,{feature:"fixedToolbar",label:Object(v.__)("Unified Toolbar"),info:Object(v.__)("Access all block and document tools in a single place"),onToggle:t}),Object(i.createElement)(Xt,{feature:"focusMode",label:Object(v.__)("Spotlight Mode"),info:Object(v.__)("Focus on one block at a time"),onToggle:t}),Object(i.createElement)(Xt,{feature:"fullscreenMode",label:Object(v.__)("Fullscreen Mode"),info:Object(v.__)("Work without distraction"),onToggle:t}))}),Kt=function(){return Object(i.createElement)(M.Dropdown,{className:"edit-post-more-menu",contentClassName:"edit-post-more-menu__content",position:"bottom left",renderToggle:function(e){var t=e.isOpen,n=e.onToggle;return Object(i.createElement)(M.IconButton,{icon:"ellipsis",label:Object(v._x)("More","button to expand options"),onClick:n,"aria-expanded":t})},renderContent:function(e){var t=e.onClose;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(zt,{onClose:t}),Object(i.createElement)(Rt,{onSelect:t}),Object(i.createElement)(Wt.Slot,{fillProps:{onClose:t}}),Object(i.createElement)(U.Slot,{fillProps:{onClose:t}}),Object(i.createElement)(M.MenuGroup,null,Object(i.createElement)(qt,{onSelect:t})))}})};var Qt=Object(u.withSelect)(function(e){var t=e("core/editor").getCurrentPostType,n=e("core/edit-post").isFeatureActive,o=e("core").getPostType;return{isActive:n("fullscreenMode"),postType:o(t())}})(function(e){var t=e.isActive,n=e.postType;return t&&n?Object(i.createElement)(M.Toolbar,{className:"edit-post-fullscreen-mode-close__toolbar"},Object(i.createElement)(M.IconButton,{icon:"exit",href:Object(Ye.addQueryArgs)("edit.php",{post_type:n.slug}),label:Object(E.get)(n,["labels","view_items"],Object(v.__)("View Posts"))})):null});var Jt=Object(T.compose)([Object(u.withSelect)(function(e){return{hasFixedToolbar:e("core/edit-post").isFeatureActive("fixedToolbar"),mode:e("core/edit-post").getEditorMode()}}),Object(l.withViewportMatch)({isLargeViewport:"medium"})])(function(e){var t=e.hasFixedToolbar,n=e.isLargeViewport,o=e.mode;return Object(i.createElement)(c.NavigableToolbar,{className:"edit-post-header-toolbar","aria-label":Object(v.__)("Editor Toolbar")},Object(i.createElement)(Qt,null),Object(i.createElement)("div",null,Object(i.createElement)(c.Inserter,{disabled:"visual"!==o,position:"bottom right"}),Object(i.createElement)(a.DotTip,{id:"core/editor.inserter"},Object(v.__)("Welcome to the wonderful world of blocks! Click the “+” (“Add block”) button to add a new block. There are blocks available for all kinds of content: you can insert text, headings, images, lists, and lots more!"))),Object(i.createElement)(c.EditorHistoryUndo,null),Object(i.createElement)(c.EditorHistoryRedo,null),Object(i.createElement)(c.TableOfContents,null),Object(i.createElement)(c.BlockNavigationDropdown,null),t&&n&&Object(i.createElement)("div",{className:"edit-post-header-toolbar__block-toolbar"},Object(i.createElement)(c.BlockToolbar,null)))}),Yt=Object(M.createSlotFill)("PinnedPlugins"),$t=Yt.Fill,Zt=Yt.Slot;$t.Slot=function(e){return Object(i.createElement)(Zt,e,function(e){return!Object(E.isEmpty)(e)&&Object(i.createElement)("div",{className:"edit-post-pinned-plugins"},e)})};var en=$t;var tn=Object(T.compose)(Object(u.withSelect)(function(e){return{isEditorSidebarOpened:e("core/edit-post").isEditorSidebarOpened(),isPublishSidebarOpened:e("core/edit-post").isPublishSidebarOpened(),isPublishSidebarEnabled:e("core/editor").isPublishSidebarEnabled(),hasActiveMetaboxes:e("core/edit-post").hasMetaBoxes(),isSaving:e("core/edit-post").isSavingMetaBoxes(),hasBlockSelection:!!e("core/editor").getBlockSelectionStart()}}),Object(u.withDispatch)(function(e,t){var n=t.hasBlockSelection,o=e("core/edit-post"),r=o.openGeneralSidebar,i=o.closeGeneralSidebar,c=o.togglePublishSidebar,a=n?"edit-post/block":"edit-post/document";return{openGeneralSidebar:function(){return r(a)},closeGeneralSidebar:i,togglePublishSidebar:c,hasBlockSelection:void 0}}))(function(e){var t=e.isEditorSidebarOpened,n=e.openGeneralSidebar,o=e.closeGeneralSidebar,r=e.isPublishSidebarOpened,l=e.isPublishSidebarEnabled,s=e.togglePublishSidebar,u=e.hasActiveMetaboxes,d=e.isSaving,b=t?o:n;return Object(i.createElement)("div",{role:"region","aria-label":Object(v.__)("Editor top bar"),className:"edit-post-header",tabIndex:"-1"},Object(i.createElement)(Jt,null),!r&&Object(i.createElement)("div",{className:"edit-post-header__settings"},Object(i.createElement)(c.PostSavedState,{forceIsDirty:u,forceIsSaving:d}),Object(i.createElement)(c.PostPreviewButton,null),l?Object(i.createElement)(c.PostPublishPanelToggle,{isOpen:r,onToggle:s,forceIsDirty:u,forceIsSaving:d}):Object(i.createElement)(c.PostPublishButton,{forceIsDirty:u,forceIsSaving:d}),Object(i.createElement)("div",null,Object(i.createElement)(M.IconButton,{icon:"admin-generic",label:Object(v.__)("Settings"),onClick:b,isToggled:t,"aria-expanded":t,shortcut:et.toggleSidebar}),Object(i.createElement)(a.DotTip,{id:"core/editor.settings"},Object(v.__)("Youll find more settings for your page and blocks in the sidebar. Click “Settings” to open it."))),Object(i.createElement)(en.Slot,null),Object(i.createElement)(Kt,null)))});var nn=Object(u.withDispatch)(function(e){return{onExit:function(){e("core/edit-post").switchEditorMode("visual")}}})(function(e){var t=e.onExit;return Object(i.createElement)("div",{className:"edit-post-text-editor"},Object(i.createElement)("div",{className:"edit-post-text-editor__toolbar"},Object(i.createElement)("h2",null,Object(v.__)("Editing Code")),Object(i.createElement)(M.IconButton,{onClick:t,icon:"no-alt",shortcut:D.displayShortcut.secondary("m")},Object(v.__)("Exit Code Editor"))),Object(i.createElement)("div",{className:"edit-post-text-editor__body"},Object(i.createElement)(c.PostTitle,null),Object(i.createElement)(c.PostTextEditor,null)))});var on=Object(T.compose)(Object(u.withSelect)(function(e){return{areAdvancedSettingsOpened:"edit-post/block"===e("core/edit-post").getActiveGeneralSidebarName()}}),Object(u.withDispatch)(function(e){return{openEditorSidebar:function(){return e("core/edit-post").openGeneralSidebar("edit-post/block")},closeSidebar:e("core/edit-post").closeGeneralSidebar}}),M.withSpokenMessages)(function(e){var t=e.areAdvancedSettingsOpened,n=e.closeSidebar,o=e.openEditorSidebar,r=e.onClick,c=void 0===r?E.noop:r,a=e.small,l=void 0!==a&&a,s=e.speak,u=t?Object(v.__)("Hide Block Settings"):Object(v.__)("Show Block Settings");return Object(i.createElement)(M.MenuItem,{className:"editor-block-settings-menu__control",onClick:Object(E.flow)(t?n:o,function(){s(t?Object(v.__)("Block settings closed"):Object(v.__)("Additional settings are now available in the Editor block settings sidebar"))},c),icon:"admin-generic",label:l?u:void 0,shortcut:et.toggleSidebar},!l&&u)}),rn=Object(M.createSlotFill)("PluginBlockSettingsMenuGroup"),cn=rn.Fill,an=rn.Slot;cn.Slot=Object(u.withSelect)(function(e,t){var n=t.fillProps.clientIds;return{selectedBlocks:e("core/editor").getBlocksByClientId(n)}})(function(e){var t=e.fillProps,n=e.selectedBlocks;return n=Object(E.map)(n,function(e){return e.name}),Object(i.createElement)(an,{fillProps:Object(H.a)({},t,{selectedBlocks:n})},function(e){return!Object(E.isEmpty)(e)&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)("div",{className:"editor-block-settings-menu__separator"}),e)})});var ln=cn;var sn=function(){return Object(i.createElement)(c.BlockSelectionClearer,{className:"edit-post-visual-editor"},Object(i.createElement)(c.EditorGlobalKeyboardShortcuts,null),Object(i.createElement)(c.CopyHandler,null),Object(i.createElement)(c.MultiSelectScrollIntoView,null),Object(i.createElement)(c.WritingFlow,null,Object(i.createElement)(c.ObserveTyping,null,Object(i.createElement)(c.PostTitle,null),Object(i.createElement)(c.BlockList,null))),Object(i.createElement)(c._BlockSettingsMenuFirstItem,null,function(e){var t=e.onClose;return Object(i.createElement)(on,{onClick:t})}),Object(i.createElement)(c._BlockSettingsMenuPluginsExtension,null,function(e){var t=e.clientIds,n=e.onClose;return Object(i.createElement)(ln.Slot,{fillProps:{clientIds:t,onClose:n}})}))},un=function(e){function t(){var e;return Object(O.a)(this,t),(e=Object(f.a)(this,Object(j.a)(t).apply(this,arguments))).toggleMode=e.toggleMode.bind(Object(g.a)(Object(g.a)(e))),e.toggleSidebar=e.toggleSidebar.bind(Object(g.a)(Object(g.a)(e))),e}return Object(h.a)(t,e),Object(m.a)(t,[{key:"toggleMode",value:function(){var e=this.props,t=e.mode;(0,e.switchMode)("visual"===t?"text":"visual")}},{key:"toggleSidebar",value:function(e){e.preventDefault();var t=this.props,n=t.isEditorSidebarOpen,o=t.closeSidebar,r=t.openSidebar;n?o():r()}},{key:"render",value:function(){var e;return Object(i.createElement)(M.KeyboardShortcuts,{bindGlobal:!0,shortcuts:(e={},Object(V.a)(e,et.toggleEditorMode.raw,this.toggleMode),Object(V.a)(e,et.toggleSidebar.raw,this.toggleSidebar),e)})}}]),t}(i.Component),dn=Object(T.compose)([Object(u.withSelect)(function(e){return{mode:e("core/edit-post").getEditorMode(),isEditorSidebarOpen:e("core/edit-post").isEditorSidebarOpened(),hasBlockSelection:!!e("core/editor").getBlockSelectionStart()}}),Object(u.withDispatch)(function(e,t){var n=t.hasBlockSelection;return{switchMode:function(t){e("core/edit-post").switchEditorMode(t)},openSidebar:function(){var t=n?"edit-post/block":"edit-post/document";e("core/edit-post").openGeneralSidebar(t)},closeSidebar:e("core/edit-post").closeGeneralSidebar}})])(un),bn=D.displayShortcutList.primary,pn=D.displayShortcutList.primaryShift,On=D.displayShortcutList.primaryAlt,mn=D.displayShortcutList.secondary,fn=D.displayShortcutList.access,jn=D.displayShortcutList.ctrl,hn=D.displayShortcutList.ctrlShift,gn=D.displayShortcutList.shiftAlt,En=[{title:Object(v.__)("Global shortcuts"),shortcuts:[{keyCombination:fn("h"),description:Object(v.__)("Display this help.")},{keyCombination:bn("s"),description:Object(v.__)("Save your changes.")},{keyCombination:bn("z"),description:Object(v.__)("Undo your last changes.")},{keyCombination:pn("z"),description:Object(v.__)("Redo your last undo.")},{keyCombination:pn(","),description:Object(v.__)("Show or hide the settings sidebar."),ariaLabel:D.shortcutAriaLabel.primaryShift(",")},{keyCombination:fn("o"),description:Object(v.__)("Open the block navigation menu.")},{keyCombination:jn("`"),description:Object(v.__)("Navigate to the next part of the editor."),ariaLabel:D.shortcutAriaLabel.ctrl("`")},{keyCombination:hn("`"),description:Object(v.__)("Navigate to the previous part of the editor."),ariaLabel:D.shortcutAriaLabel.ctrlShift("`")},{keyCombination:gn("n"),description:Object(v.__)("Navigate to the next part of the editor (alternative).")},{keyCombination:gn("p"),description:Object(v.__)("Navigate to the previous part of the editor (alternative).")},{keyCombination:mn("m"),description:Object(v.__)("Switch between Visual Editor and Code Editor.")}]},{title:Object(v.__)("Selection shortcuts"),shortcuts:[{keyCombination:bn("a"),description:Object(v.__)("Select all text when typing. Press again to select all blocks.")},{keyCombination:"Esc",description:Object(v.__)("Clear selection."),ariaLabel:Object(v.__)("Escape")}]},{title:Object(v.__)("Block shortcuts"),shortcuts:[{keyCombination:pn("d"),description:Object(v.__)("Duplicate the selected block(s).")},{keyCombination:fn("z"),description:Object(v.__)("Remove the selected block(s).")},{keyCombination:On("t"),description:Object(v.__)("Insert a new block before the selected block(s).")},{keyCombination:On("y"),description:Object(v.__)("Insert a new block after the selected block(s).")},{keyCombination:"/",description:Object(v.__)("Change the block type after adding a new paragraph."),ariaLabel:Object(v.__)("Forward-slash")}]},{title:Object(v.__)("Text formatting"),shortcuts:[{keyCombination:bn("b"),description:Object(v.__)("Make the selected text bold.")},{keyCombination:bn("i"),description:Object(v.__)("Make the selected text italic.")},{keyCombination:bn("u"),description:Object(v.__)("Underline the selected text.")},{keyCombination:bn("k"),description:Object(v.__)("Convert the selected text into a link.")},{keyCombination:fn("s"),description:Object(v.__)("Remove a link.")},{keyCombination:fn("d"),description:Object(v.__)("Add a strikethrough to the selected text.")},{keyCombination:fn("x"),description:Object(v.__)("Display the selected text in a monospaced font.")}]}],vn="edit-post/keyboard-shortcut-help",_n=function(e){var t=e.shortcuts;return Object(i.createElement)("dl",{className:"edit-post-keyboard-shortcut-help__shortcut-list"},t.map(function(e,t){var n=e.keyCombination,o=e.description,r=e.ariaLabel;return Object(i.createElement)("div",{className:"edit-post-keyboard-shortcut-help__shortcut",key:t},Object(i.createElement)("dt",{className:"edit-post-keyboard-shortcut-help__shortcut-term"},Object(i.createElement)("kbd",{className:"edit-post-keyboard-shortcut-help__shortcut-key-combination","aria-label":r},function(e){return e.map(function(e,t){return"+"===e?Object(i.createElement)(i.Fragment,{key:t},e):Object(i.createElement)("kbd",{key:t,className:"edit-post-keyboard-shortcut-help__shortcut-key"},e)})}(Object(E.castArray)(n)))),Object(i.createElement)("dd",{className:"edit-post-keyboard-shortcut-help__shortcut-description"},o))}))},yn=function(e){var t=e.title,n=e.shortcuts;return Object(i.createElement)("section",{className:"edit-post-keyboard-shortcut-help__section"},Object(i.createElement)("h2",{className:"edit-post-keyboard-shortcut-help__section-title"},t),Object(i.createElement)(_n,{shortcuts:n}))};var Sn=Object(T.compose)([Object(u.withSelect)(function(e){return{isModalActive:e("core/edit-post").isModalActive(vn)}}),Object(u.withDispatch)(function(e,t){var n=t.isModalActive,o=e("core/edit-post"),r=o.openModal,i=o.closeModal;return{toggleModal:function(){return n?i():r(vn)}}})])(function(e){var t=e.isModalActive,n=e.toggleModal,o=Object(i.createElement)("span",{className:"edit-post-keyboard-shortcut-help__title"},Object(v.__)("Keyboard Shortcuts"));return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(M.KeyboardShortcuts,{bindGlobal:!0,shortcuts:Object(V.a)({},D.rawShortcut.access("h"),n)}),t&&Object(i.createElement)(M.Modal,{className:"edit-post-keyboard-shortcut-help",title:o,closeLabel:Object(v.__)("Close"),onRequestClose:n},En.map(function(e,t){return Object(i.createElement)(yn,Object(w.a)({key:t},e))})))}),Pn=function(e){var t=e.title,n=e.children;return Object(i.createElement)("section",{className:"edit-post-options-modal__section"},Object(i.createElement)("h2",{className:"edit-post-options-modal__section-title"},t),n)};function kn(e){var t=e.label,n=e.isChecked,o=e.onChange;return Object(i.createElement)(M.CheckboxControl,{className:"edit-post-options-modal__option",label:t,checked:n,onChange:o})}var wn=function(e){function t(e){var n,o=e.isChecked;return Object(O.a)(this,t),(n=Object(f.a)(this,Object(j.a)(t).apply(this,arguments))).state={isChecked:o},n}return Object(h.a)(t,e),Object(m.a)(t,[{key:"componentWillUnmount",value:function(){this.state.isChecked!==this.props.isChecked&&this.props.onChange(this.state.isChecked)}},{key:"render",value:function(){var e=this;return Object(i.createElement)(kn,{label:this.props.label,isChecked:this.state.isChecked,onChange:function(t){return e.setState({isChecked:t})}})}}]),t}(i.Component),Cn=Object(T.compose)(Object(u.withSelect)(function(e){return{isChecked:e("core/editor").isPublishSidebarEnabled()}}),Object(u.withDispatch)(function(e){var t=e("core/editor"),n=t.enablePublishSidebar,o=t.disablePublishSidebar;return{onChange:function(e){return e?n():o()}}}))(kn),xn=Object(T.compose)(Object(u.withSelect)(function(e){return{isChecked:e("core/nux").areTipsEnabled()}}),Object(u.withDispatch)(function(e){var t=e("core/nux"),n=t.enableTips,o=t.disableTips;return{onChange:function(e){return e?n():o()}}}))(wn),Mn=Object(T.compose)(Object(u.withSelect)(function(e,t){var n=t.panelName;return{isChecked:e("core/edit-post").isEditorPanelEnabled(n)}}),Object(u.withDispatch)(function(e,t){var n=t.panelName;return{onChange:function(){return e("core/edit-post").toggleEditorPanelEnabled(n)}}}))(kn);var Tn=Object(T.compose)(Object(u.withSelect)(function(e){return{isModalActive:e("core/edit-post").isModalActive("edit-post/options"),metaBoxes:e("core/edit-post").getAllMetaBoxes()}}),Object(u.withDispatch)(function(e){return{closeModal:function(){return e("core/edit-post").closeModal()}}}))(function(e){var t=e.isModalActive,n=e.closeModal,o=e.metaBoxes,r=void 0===o?[]:o;return t?Object(i.createElement)(M.Modal,{className:"edit-post-options-modal",title:Object(i.createElement)("span",{className:"edit-post-options-modal__title"},Object(v.__)("Options")),closeLabel:Object(v.__)("Close"),onRequestClose:n},Object(i.createElement)(Pn,{title:Object(v.__)("General")},Object(i.createElement)(Cn,{label:Object(v.__)("Enable Pre-publish Checks")}),Object(i.createElement)(xn,{label:Object(v.__)("Enable Tips")})),Object(i.createElement)(Pn,{title:Object(v.__)("Document Panels")},Object(i.createElement)(c.PostTaxonomies,{taxonomyWrapper:function(e,t){return Object(i.createElement)(Mn,{label:Object(E.get)(t,["labels","menu_name"]),panelName:"taxonomy-panel-".concat(t.slug)})}}),Object(i.createElement)(Mn,{label:Object(v.__)("Featured Image"),panelName:"featured-image"}),Object(i.createElement)(c.PostExcerptCheck,null,Object(i.createElement)(Mn,{label:Object(v.__)("Excerpt"),panelName:"post-excerpt"})),Object(i.createElement)(Mn,{label:Object(v.__)("Discussion"),panelName:"discussion-panel"}),Object(i.createElement)(c.PageAttributesCheck,null,Object(i.createElement)(Mn,{label:Object(v.__)("Page Attributes"),panelName:"page-attributes"}))),0!==r.length&&Object(i.createElement)(Pn,{title:Object(v.__)("Advanced Panels")},Object(E.map)(r,function(e){var t=e.title,n=e.id;return Object(i.createElement)(Mn,{key:n,label:t,panelName:"meta-box-".concat(n)})}))):null}),Bn=Object(M.createSlotFill)("PluginPostPublishPanel"),An=Bn.Fill,Nn=Bn.Slot,In=function(e){var t=e.children,n=e.className,o=e.title,r=e.initialOpen,c=void 0!==r&&r;return Object(i.createElement)(An,null,Object(i.createElement)(M.PanelBody,{className:n,initialOpen:c||!o,title:o},t))};In.Slot=Nn;var Dn=In,Ln=Object(M.createSlotFill)("PluginPrePublishPanel"),Gn=Ln.Fill,Fn=Ln.Slot,Rn=function(e){var t=e.children,n=e.className,o=e.title,r=e.initialOpen,c=void 0!==r&&r;return Object(i.createElement)(Gn,null,Object(i.createElement)(M.PanelBody,{className:n,initialOpen:c||!o,title:o},t))};Rn.Slot=Fn;var Un=Rn,Vn=function(e){function t(){return Object(O.a)(this,t),Object(f.a)(this,Object(j.a)(t).apply(this,arguments))}return Object(h.a)(t,e),Object(m.a)(t,[{key:"componentDidMount",value:function(){this.sync()}},{key:"componentDidUpdate",value:function(e){this.props.isActive!==e.isActive&&this.sync()}},{key:"sync",value:function(){this.props.isActive?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode")}},{key:"render",value:function(){return null}}]),t}(i.Component),Hn=Object(u.withSelect)(function(e){return{isActive:e("core/edit-post").isFeatureActive("fullscreenMode")}})(Vn);var Wn=Object(T.compose)(Object(u.withSelect)(function(e){return{mode:e("core/edit-post").getEditorMode(),editorSidebarOpened:e("core/edit-post").isEditorSidebarOpened(),pluginSidebarOpened:e("core/edit-post").isPluginSidebarOpened(),publishSidebarOpened:e("core/edit-post").isPublishSidebarOpened(),hasFixedToolbar:e("core/edit-post").isFeatureActive("fixedToolbar"),hasActiveMetaboxes:e("core/edit-post").hasMetaBoxes(),isSaving:e("core/edit-post").isSavingMetaBoxes()}}),Object(u.withDispatch)(function(e){var t=e("core/edit-post");return{closePublishSidebar:t.closePublishSidebar,togglePublishSidebar:t.togglePublishSidebar}}),M.navigateRegions,Object(l.withViewportMatch)({isMobileViewport:"< small"}))(function(e){var t=e.mode,n=e.editorSidebarOpened,o=e.pluginSidebarOpened,r=e.publishSidebarOpened,a=e.hasFixedToolbar,l=e.closePublishSidebar,s=e.togglePublishSidebar,u=e.hasActiveMetaboxes,d=e.isSaving,b=e.isMobileViewport,p=n||o||r,O=Je()("edit-post-layout",{"is-sidebar-opened":p,"has-fixed-toolbar":a}),m={role:"region","aria-label":Object(v.__)("Editor publish"),tabIndex:-1};return Object(i.createElement)("div",{className:O},Object(i.createElement)(Hn,null),Object(i.createElement)(Ze,null),Object(i.createElement)(c.UnsavedChangesWarning,null),Object(i.createElement)(c.AutosaveMonitor,null),Object(i.createElement)(tn,null),Object(i.createElement)("div",{className:"edit-post-layout__content",role:"region","aria-label":Object(v.__)("Editor content"),tabIndex:"-1"},Object(i.createElement)(c.EditorNotices,null),Object(i.createElement)(c.PreserveScrollInReorder,null),Object(i.createElement)(dn,null),Object(i.createElement)(Sn,null),Object(i.createElement)(Tn,null),"text"===t&&Object(i.createElement)(nn,null),"visual"===t&&Object(i.createElement)(sn,null),Object(i.createElement)("div",{className:"edit-post-layout__metaboxes"},Object(i.createElement)(Lt,{location:"normal"})),Object(i.createElement)("div",{className:"edit-post-layout__metaboxes"},Object(i.createElement)(Lt,{location:"advanced"}))),r?Object(i.createElement)(c.PostPublishPanel,Object(w.a)({},m,{onClose:l,forceIsDirty:u,forceIsSaving:d,PrePublishExtension:Un.Slot,PostPublishExtension:Dn.Slot})):Object(i.createElement)(i.Fragment,null,Object(i.createElement)("div",Object(w.a)({className:"edit-post-toggle-publish-panel"},m),Object(i.createElement)(M.Button,{isDefault:!0,type:"button",className:"edit-post-toggle-publish-panel__button",onClick:s,"aria-expanded":!1},Object(v.__)("Open publish panel"))),Object(i.createElement)(Gt,null),Object(i.createElement)(lt,null),Object(i.createElement)(at.Slot,null),b&&p&&Object(i.createElement)(M.ScrollLock,null)),Object(i.createElement)(M.Popover.Slot,null),Object(i.createElement)(N.PluginArea,null))});var qn=Object(u.withSelect)(function(e,t){var n=t.postId,o=t.postType;return{hasFixedToolbar:e("core/edit-post").isFeatureActive("fixedToolbar"),focusMode:e("core/edit-post").isFeatureActive("focusMode"),post:e("core").getEntityRecord("postType",o,n)}})(function(e){var t=e.settings,n=e.hasFixedToolbar,o=e.focusMode,r=e.post,a=e.overridePost,l=e.onError,s=Object(C.a)(e,["settings","hasFixedToolbar","focusMode","post","overridePost","onError"]);if(!r)return null;var u=Object(H.a)({},t,{hasFixedToolbar:n,focusMode:o});return Object(i.createElement)(i.StrictMode,null,Object(i.createElement)(c.EditorProvider,Object(w.a)({settings:u,post:Object(H.a)({},r,a)},s),Object(i.createElement)(c.ErrorBoundary,{onError:l},Object(i.createElement)(Wn,null)),Object(i.createElement)(c.PostLockedModal,null)))}),Xn=function(e,t){return!Array.isArray(t)||function(e,t){return 0===Object(E.difference)(e,t).length}(e,t)},zn=function(e){var t=e.allowedBlocks,n=e.icon,o=e.label,r=e.onClick,c=e.small,a=e.role;return Object(i.createElement)(ln,null,function(e){var l=e.selectedBlocks,s=e.onClose;return Xn(l,t)?Object(i.createElement)(M.IconButton,{className:"editor-block-settings-menu__control",onClick:Object(T.compose)(r,s),icon:n||"admin-plugins",label:c?o:void 0,role:a},!c&&o):null})};var Kn=Object(T.compose)(Object(N.withPluginContext)(function(e,t){return{icon:t.icon||e.icon,sidebarName:"".concat(e.name,"/").concat(t.name)}}),Object(u.withSelect)(function(e,t){var n=t.sidebarName,o=e("core/edit-post"),r=o.getActiveGeneralSidebarName,i=o.isPluginItemPinned;return{isActive:r()===n,isPinned:i(n)}}),Object(u.withDispatch)(function(e,t){var n=t.isActive,o=t.sidebarName,r=e("core/edit-post"),i=r.closeGeneralSidebar,c=r.openGeneralSidebar,a=r.togglePinnedPluginItem;return{togglePin:function(){a(o)},toggleSidebar:function(){n?i():c(o)}}}))(function(e){var t=e.children,n=e.icon,o=e.isActive,r=e.isPinnable,c=void 0===r||r,a=e.isPinned,l=e.sidebarName,s=e.title,u=e.togglePin,d=e.toggleSidebar;return Object(i.createElement)(i.Fragment,null,c&&Object(i.createElement)(en,null,a&&Object(i.createElement)(M.IconButton,{icon:n,label:s,onClick:d,isToggled:o,"aria-expanded":o})),Object(i.createElement)(at,{name:l,label:Object(v.__)("Editor plugins")},Object(i.createElement)(tt,{closeLabel:Object(v.__)("Close plugin")},Object(i.createElement)("strong",null,s),c&&Object(i.createElement)(M.IconButton,{icon:a?"star-filled":"star-empty",label:a?Object(v.__)("Unpin from toolbar"):Object(v.__)("Pin to toolbar"),onClick:u,isToggled:a,"aria-expanded":a})),Object(i.createElement)(M.Panel,null,t)))}),Qn=Object(T.compose)(Object(N.withPluginContext)(function(e,t){return{icon:t.icon||e.icon,sidebarName:"".concat(e.name,"/").concat(t.target)}}),Object(u.withSelect)(function(e,t){var n=t.sidebarName;return{isSelected:(0,e("core/edit-post").getActiveGeneralSidebarName)()===n}}),Object(u.withDispatch)(function(e,t){var n=t.isSelected,o=t.sidebarName,r=e("core/edit-post"),i=r.closeGeneralSidebar,c=r.openGeneralSidebar;return{onClick:n?i:function(){return c(o)}}}))(function(e){var t=e.children,n=e.icon,o=e.isSelected,r=e.onClick;return Object(i.createElement)(Wt,null,function(e){return Object(i.createElement)(M.MenuItem,{icon:o?"yes":n,isSelected:o,role:"menuitemcheckbox",onClick:Object(T.compose)(r,e.onClose)},t)})});function Jn(e,t,n,o,r){Object(i.unmountComponentAtNode)(n);var c=Jn.bind(null,e,t,n,o,r);Object(i.render)(Object(i.createElement)(qn,{settings:o,onError:c,postId:t,postType:e,overridePost:r,recovery:!0}),n)}function Yn(e,t,n,o,r){var c=document.getElementById(e),a=Jn.bind(null,t,n,c,o,r);return Object(s.registerCoreBlocks)(),Object(u.dispatch)("core/nux").triggerGuide(["core/editor.inserter","core/editor.settings","core/editor.preview","core/editor.publish"]),Object(i.render)(Object(i.createElement)(qn,{settings:o,onError:a,postId:n,postType:t,overridePost:r}),c),{initializeMetaBoxes:function(e){b()("editor.initializeMetaBoxes",{alternative:"setActiveMetaBoxLocations action (`core/edit-post`)",plugin:"Gutenberg",version:"4.2"}),Ke.dispatch(me())}}}n.d(t,"reinitializeEditor",function(){return Jn}),n.d(t,"initializeEditor",function(){return Yn}),n.d(t,"PluginBlockSettingsMenuItem",function(){return zn}),n.d(t,"PluginPostPublishPanel",function(){return Dn}),n.d(t,"PluginPostStatusInfo",function(){return Et}),n.d(t,"PluginPrePublishPanel",function(){return Un}),n.d(t,"PluginSidebar",function(){return Kn}),n.d(t,"PluginSidebarMoreMenuItem",function(){return Qn})},29:function(e,t,n){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){return(r="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}n.d(t,"a",function(){return r})},3:function(e,t,n){"use strict";function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",function(){return o})},30:function(e,t){!function(){e.exports=this.wp.url}()},31:function(e,t){!function(){e.exports=this.wp.apiFetch}()},33:function(e,t,n){"use strict";function o(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}n.d(t,"a",function(){return o})},34:function(e,t,n){"use strict";var o,r;function i(e){return[e]}function c(e){return!!e&&"object"==typeof e}function a(){var e={clear:function(){e.head=null}};return e}function l(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}o={},r="undefined"!=typeof WeakMap,t.a=function(e,t){var n,s;function u(){n=r?new WeakMap:a()}function d(){var n,o,r,i,c,a=arguments.length;for(i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];for(c=t.apply(null,i),(n=s(c)).isUniqueByDependants||(n.lastDependants&&!l(c,n.lastDependants,0)&&n.clear(),n.lastDependants=c),o=n.head;o;){if(l(o.args,i,1))return o!==n.head&&(o.prev.next=o.next,o.next&&(o.next.prev=o.prev),o.next=n.head,o.prev=null,n.head.prev=o,n.head=o),o.val;o=o.next}return o={val:e.apply(null,i)},i[0]=null,o.args=i,n.head&&(n.head.prev=o,o.next=n.head),n.head=o,o.val}return t||(t=i),s=r?function(e){var t,r,i,l,s=n,u=!0;for(t=0;t<e.length;t++){if(!c(r=e[t])){u=!1;break}s.has(r)?s=s.get(r):(i=new WeakMap,s.set(r,i),s=i)}return s.has(o)||((l=a()).isUniqueByDependants=u,s.set(o,l)),s.get(o)}:function(){return n},d.getDependants=t,d.clear=u,u(),d}},36:function(e,t,n){"use strict";function o(e){if(Array.isArray(e))return e}n.d(t,"a",function(){return o})},37:function(e,t,n){"use strict";function o(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}n.d(t,"a",function(){return o})},39:function(e,t){!function(){e.exports=this.wp.viewport}()},4:function(e,t){!function(){e.exports=this.wp.components}()},5:function(e,t){!function(){e.exports=this.wp.data}()},50:function(e,t){!function(){e.exports=this.wp.a11y}()},54:function(e,t){!function(){e.exports=this.wp.nux}()},6:function(e,t){!function(){e.exports=this.wp.compose}()},61:function(e,t){!function(){e.exports=this.wp.plugins}()},7:function(e,t){!function(){e.exports=this.wp.editor}()},78:function(e,t){!function(){e.exports=this.wp.coreData}()},8:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var o=n(15);function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Object(o.a)(e,t,n[t])})}return e}},86:function(e,t,n){"use strict";e.exports=function(e){var t,n={};return function e(t,n){var o;if(Array.isArray(n))for(o=0;o<n.length;o++)e(t,n[o]);else for(o in n)t[o]=(t[o]||[]).concat(n[o])}(n,e),(t=function(e){return function(t){return function(o){var r,i,c=n[o.type],a=t(o);if(c)for(r=0;r<c.length;r++)(i=c[r](o,e))&&e.dispatch(i);return a}}}).effects=n,t}},9:function(e,t,n){"use strict";function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function r(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}n.d(t,"a",function(){return r})}});