| 1 |
(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=React;var n=t.n(e);function r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,a=function(){};return{s:a,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,i=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){u=!0,s=t},f:function(){try{i||null==n.return||n.return()}finally{if(u)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var a=wp.i18n.__,s=wp.editPost.PluginPostStatusInfo,i=wp.plugins.registerPlugin,u=wp.data,l=u.subscribe,c=u.dispatch,d=u.select,f=u.withSelect,p=u.withDispatch,v=wp.compose.compose,m=wp.components.SelectControl,w=window.EditFlowCustomStatuses.map((function(t){return{label:t.name,value:t.slug}})),b=null;function h(t){t&&t.children<1&&(t.innerText===a("Save Draft")||t.innerText===a("Save as Pending"))&&(t.innerText=a("Save"))}l((function(){d("core/editor").getCurrentPostId()&&(d("core/editor").isCleanNewPost()&&c("core/editor").editPost({status:ef_default_custom_status}),h(document.querySelector(".editor-post-save-draft")),null===b&&window.MutationObserver&&d("core/editor").isSavingPost()&&(b=function(t){if(!t)return null;var e=new MutationObserver((function(t){var e,n=r(t);try{for(n.s();!(e=n.n()).done;){var o,a=r(e.value.addedNodes);try{for(a.s();!(o=a.n()).done;)h(o.value)}catch(t){a.e(t)}finally{a.f()}}}catch(t){n.e(t)}finally{n.f()}}));return e.observe(t,{childList:!0}),e}(document.querySelector(".edit-post-header__settings"))))}));var y=v(f((function(t){return{status:t("core/editor").getEditedPostAttribute("status")}})),p((function(t){return{onUpdate:function(e){t("core/editor").editPost({status:e})}}})))((function(t){var e=t.onUpdate,r=t.status;return n().createElement(s,{className:"edit-flow-extended-post-status edit-flow-extended-post-status-".concat(r)},n().createElement("h4",null,a("publish"!==r?"Extended Post Status":"Extended Post Status Disabled.","edit-flow")),"publish"!==r?n().createElement(m,{label:"",value:r,options:w,onChange:e}):null,n().createElement("small",{className:"edit-flow-extended-post-status-note"},a("publish"!==r?"Note: this will override all status settings above.":"To select a custom status, please unpublish the content first.","edit-flow")))}));i("edit-flow-custom-status",{icon:"edit-flow",render:y})})(); |