/*! This file is auto-generated */ this.wp=this.wp||{},this.wp.editor=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="PLxR")}({"//kF":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const s=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{fillRule:"evenodd",d:"M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));t.a=s},"16Al":function(e,t,n){"use strict";var o=n("WbBG");function r(){}function s(){}s.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,s,i){if(i!==o){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:r};return n.PropTypes=n,n}},"17x9":function(e,t,n){e.exports=n("16Al")()},"1ZqX":function(e,t){e.exports=window.wp.data},"51Zz":function(e,t){e.exports=window.wp.dataControls},"6aBm":function(e,t){e.exports=window.wp.mediaUtils},"7fqt":function(e,t){e.exports=window.wp.wordcount},CNgt:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),s=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){s=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t,n=null,o=null,i=null,c=function(){e.clientWidth!==o&&d()},a=function(t){window.removeEventListener("resize",c,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",c,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:a,update:d}),"vertical"===(t=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),n="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(n)&&(n=0),d()}function l(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var t=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+n+"px",o=e.clientWidth,t.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),o="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(o0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_EDITOR_STATE":case"RESET_POST":return t.post.id}return e},postType: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"SETUP_EDITOR_STATE":case"RESET_POST":return t.post.type}return e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ENABLE_PUBLISH_SIDEBAR":return{...e,isPublishSidebarEnabled:!0};case"DISABLE_PUBLISH_SIDEBAR":return{...e,isPublishSidebarEnabled:!1}}return e},saving: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_POST_UPDATE_START":case"REQUEST_POST_UPDATE_FINISH":return{pending:"REQUEST_POST_UPDATE_START"===t.type,options:t.options||{}}}return e},postLock:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isLocked:!1},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_POST_LOCK":return t.lock}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e},postSavingLock:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOCK_POST_SAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_SAVING":return Object(c.omit)(e,t.lockName)}return e},isReady:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_EDITOR_STATE":return!0;case"TEAR_DOWN_EDITOR":return!1}return e},editorSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_EDITOR_SETTINGS":return{...e,...t.settings}}return e},postAutosavingLock:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOCK_POST_AUTOSAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_AUTOSAVING":return Object(c.omit)(e,t.lockName)}return e}}),v=n("pPDe"),j=n("FqII"),_=n("Mmq9"),y=n("NMb1"),E=n.n(y),S=n("Civd");const w=new Set(["meta"]),P="core/editor",k=/%(?:postname|pagename)%/,C=["title","excerpt","content"];function T(e,t){return Object(_.addQueryArgs)(e,t)}function x(e){return e?Object(c.trim)(Object(c.deburr)(e).replace(/[\s\./]+/g,"-").replace(/[^\p{L}\p{N}_-]+/gu,"").toLowerCase(),"-"):""}var B=n("G8mJ"),I=n("//kF"),A=n("rvQu"),R=n("OE6V");function N(e){return"header"===e?B.a:"footer"===e?I.a:"sidebar"===e?A.a:R.a}const D={},L=[],U=Object(l.createRegistrySelector)(e=>()=>e(u.store).hasUndo()),F=Object(l.createRegistrySelector)(e=>()=>e(u.store).hasRedo());function M(e){return"auto-draft"===W(e).status}function z(e){const t=Y(e);return"blocks"in t||"content"in t}const V=Object(l.createRegistrySelector)(e=>t=>{const n=q(t),o=K(t);return!!e(u.store).hasEditsForEntityRecord("postType",n,o)}),H=Object(l.createRegistrySelector)(e=>t=>{const n=e(u.store).__experimentalGetDirtyEntityRecords(),{type:o,id:r}=W(t);return Object(c.some)(n,e=>"postType"!==e.kind||e.name!==o||e.key!==r)});function G(e){return!V(e)&&M(e)}const W=Object(l.createRegistrySelector)(e=>t=>{const n=K(t),o=q(t),r=e(u.store).getRawEntityRecord("postType",o,n);return r||D});function q(e){return e.postType}function K(e){return e.postId}function $(e){return Object(c.get)(W(e),["_links","version-history",0,"count"],0)}function Q(e){return Object(c.get)(W(e),["_links","predecessor-version",0,"id"],null)}const Y=Object(l.createRegistrySelector)(e=>t=>{const n=q(t),o=K(t);return e(u.store).getEntityRecordEdits("postType",n,o)||D}),J=Object(l.createRegistrySelector)(e=>()=>(E()("`wp.data.select( 'core/editor' ).getReferenceByDistinctEdits`",{since:"5.4",alternative:"`wp.data.select( 'core' ).getReferenceByDistinctEdits`"}),e(u.store).getReferenceByDistinctEdits()));function X(e,t){switch(t){case"type":return q(e);case"id":return K(e);default:const n=W(e);if(!n.hasOwnProperty(t))break;return f(n[t])}}function Z(e,t){switch(t){case"content":return ve(e)}const n=Y(e);return n.hasOwnProperty(t)?w.has(t)?((e,t)=>{const n=Y(e);return n.hasOwnProperty(t)?{...X(e,t),...n[t]}:X(e,t)})(e,t):n[t]:X(e,t)}const ee=Object(l.createRegistrySelector)(e=>(t,n)=>{if(!Object(c.includes)(C,n)&&"preview_link"!==n)return;const o=q(t),r=K(t),s=Object(c.get)(e(u.store).getCurrentUser(),["id"]),i=e(u.store).getAutosave(o,r,s);return i?f(i[n]):void 0});function te(e){if("private"===Z(e,"status"))return"private";return Z(e,"password")?"password":"public"}function ne(e){return"pending"===W(e).status}function oe(e,t){const n=t||W(e);return-1!==["publish","private"].indexOf(n.status)||"future"===n.status&&!Object(j.isInTheFuture)(new Date(Number(Object(j.getDate)(n.date))-6e4))}function re(e){return"future"===W(e).status&&!oe(e)}function se(e){const t=W(e);return V(e)||-1===["publish","private","future"].indexOf(t.status)}function ie(e){return!de(e)&&(!!Z(e,"title")||!!Z(e,"excerpt")||!ce(e)||"native"===i.Platform.OS)}function ce(e){const t=Ae(e);if(t.length){if(t.length>1)return!1;const e=t[0].name;if(e!==Object(a.getDefaultBlockName)()&&e!==Object(a.getFreeformContentHandlerName)())return!1}return!ve(e)}const ae=Object(l.createRegistrySelector)(e=>t=>{if(!ie(t))return!1;if(ke(t))return!1;const n=q(t),o=K(t),r=e(u.store).hasFetchedAutosaves(n,o),s=Object(c.get)(e(u.store).getCurrentUser(),["id"]),i=e(u.store).getAutosave(n,o,s);return!!r&&(!i||(!!z(t)||["title","excerpt"].some(e=>f(i[e])!==Z(t,e))))});function le(e){const t=Z(e,"date"),n=new Date(Number(Object(j.getDate)(t))-6e4);return Object(j.isInTheFuture)(n)}function ue(e){const t=Z(e,"date"),n=Z(e,"modified"),o=W(e).status;return("draft"===o||"auto-draft"===o||"pending"===o)&&(t===n||null===t)}const de=Object(l.createRegistrySelector)(e=>t=>{const n=q(t),o=K(t);return e(u.store).isSavingEntityRecord("postType",n,o)}),pe=Object(l.createRegistrySelector)(e=>t=>{const n=e(u.store).__experimentalGetEntitiesBeingSaved(),{type:o,id:r}=W(t);return Object(c.some)(n,e=>"postType"!==e.kind||e.name!==o||e.key!==r)}),be=Object(l.createRegistrySelector)(e=>t=>{const n=q(t),o=K(t);return!e(u.store).getLastEntitySaveError("postType",n,o)}),me=Object(l.createRegistrySelector)(e=>t=>{const n=q(t),o=K(t);return!!e(u.store).getLastEntitySaveError("postType",n,o)});function he(e){return!!de(e)&&!!Object(c.get)(e.saving,["options","isAutosave"])}function ge(e){return!!de(e)&&!!Object(c.get)(e.saving,["options","isPreview"])}function fe(e){if(e.saving.pending||de(e))return;let t=ee(e,"preview_link");t||(t=Z(e,"link"),t&&(t=Object(_.addQueryArgs)(t,{preview:!0})));const n=Z(e,"featured_media");return t&&n?Object(_.addQueryArgs)(t,{_thumbnail_id:n}):t}function Oe(e){const t=Ae(e);if(t.length>2)return null;let n;if(1===t.length&&(n=t[0].name,"core/embed"===n)){var o;const e=null===(o=t[0].attributes)||void 0===o?void 0:o.providerNameSlug;["youtube","vimeo"].includes(e)?n="core/video":["spotify","soundcloud"].includes(e)&&(n="core/audio")}switch(2===t.length&&"core/paragraph"===t[1].name&&(n=t[0].name),n){case"core/image":return"image";case"core/quote":case"core/pullquote":return"quote";case"core/gallery":return"gallery";case"core/video":return"video";case"core/audio":return"audio";default:return null}}const ve=Object(l.createRegistrySelector)(e=>t=>{const n=K(t),o=q(t),r=e(u.store).getEditedEntityRecord("postType",o,n);if(r){if("function"==typeof r.content)return r.content(r);if(r.blocks)return Object(a.__unstableSerializeAndClean)(r.blocks);if(r.content)return r.content}return""});function je(e){return de(e)&&!oe(e)&&"publish"===Z(e,"status")}function _e(e){const t=Z(e,"permalink_template");return k.test(t)}function ye(e){const t=Se(e);if(!t)return null;const{prefix:n,postName:o,suffix:r}=t;return _e(e)?n+o+r:n}function Ee(e){return Z(e,"slug")||x(Z(e,"title"))||K(e)}function Se(e){const t=Z(e,"permalink_template");if(!t)return null;const n=Z(e,"slug")||Z(e,"generated_slug"),[o,r]=t.split(k);return{prefix:o,postName:n,suffix:r}}function we(e){return e.postLock.isLocked}function Pe(e){return Object.keys(e.postSavingLock).length>0}function ke(e){return Object.keys(e.postAutosavingLock).length>0}function Ce(e){return e.postLock.isTakeover}function Te(e){return e.postLock.user}function xe(e){return e.postLock.activePostLock}function Be(e){return Object(c.has)(W(e),["_links","wp:action-unfiltered-html"])}function Ie(e){return e.preferences.hasOwnProperty("isPublishSidebarEnabled")?e.preferences.isPublishSidebarEnabled:h.isPublishSidebarEnabled}function Ae(e){return Z(e,"blocks")||L}function Re(e){var t;return E()("select('core/editor').getEditorSelectionStart",{since:"10.0",plugin:"Gutenberg",alternative:"select('core/editor').getEditorSelection"}),null===(t=Z(e,"selection"))||void 0===t?void 0:t.selectionStart}function Ne(e){var t;return E()("select('core/editor').getEditorSelectionStart",{since:"10.0",plugin:"Gutenberg",alternative:"select('core/editor').getEditorSelection"}),null===(t=Z(e,"selection"))||void 0===t?void 0:t.selectionEnd}function De(e){return Z(e,"selection")}function Le(e){return e.isReady}function Ue(e){return e.editorSettings}function Fe(){return E()("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function Me(){return E()("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function ze(e){return Object(l.createRegistrySelector)(t=>function(n){E()("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`"});for(var o=arguments.length,r=new Array(o>1?o-1:0),s=1;s{var t;const n=(null===(t=Ue(e))||void 0===t?void 0:t.defaultTemplatePartAreas)||[];return null==n?void 0:n.map(e=>({...e,icon:N(e.icon)}))},e=>{var t;return[null===(t=Ue(e))||void 0===t?void 0:t.defaultTemplatePartAreas]}),zt=Object(v.a)((e,t)=>Object(c.find)(Ft(e),{slug:t})||{},(e,t)=>[Ft(e),t]);function Vt(e,t){var n;if(!t)return{};const{excerpt:o,slug:r,title:s,area:i}=t,{title:a,description:l}=zt(e,r),u=Object(c.isString)(s)?s:null==s?void 0:s.rendered;return{title:u&&u!==r?u:a||r,description:(Object(c.isString)(o)?o:null==o?void 0:o.raw)||l,icon:(null===(n=Mt(e).find(e=>i===e.area))||void 0===n?void 0:n.icon)||S.a}}const Ht=Object(l.createRegistrySelector)(e=>t=>{var n;const o=q(t),r=e(u.store).getPostType(o);return null==r||null===(n=r.labels)||void 0===n?void 0:n.singular_name});var Gt=n("onLe"),Wt=n("l3Sj");function qt(e){const{previousPost:t,post:n,postType:o}=e;if(Object(c.get)(e.options,["isAutosave"]))return[];const r=["publish","private","future"],s=Object(c.includes)(r,t.status),i=Object(c.includes)(r,n.status);let a,l=Object(c.get)(o,["viewable"],!1);s||i?s&&!i?(a=o.labels.item_reverted_to_draft,l=!1):a=!s&&i?{publish:o.labels.item_published,private:o.labels.item_published_privately,future:o.labels.item_scheduled}[n.status]:o.labels.item_updated:(a=Object(Wt.__)("Saved"),l=!1);const u=[];return l&&u.push({label:o.labels.view_item,url:n.link}),[a,{id:"SAVE_POST_NOTICE_ID",type:"snackbar",actions:u}]}function Kt(e){const{post:t,edits:n,error:o}=e;if(o&&"rest_autosave_no_changes"===o.code)return[];const r=["publish","private","future"],s=-1!==r.indexOf(t.status),i={publish:Object(Wt.__)("Publishing failed."),private:Object(Wt.__)("Publishing failed."),future:Object(Wt.__)("Scheduling failed.")};let c=s||-1===r.indexOf(n.status)?Object(Wt.__)("Updating failed."):i[n.status];return o.message&&!/<\/?[^>]*>/.test(o.message)&&(c=[c,o.message].join(" ")),[c,{id:"SAVE_POST_NOTICE_ID"}]}function*$t(e,t,n){yield Yt(e),yield{type:"SETUP_EDITOR",post:e,edits:t,template:n},yield en(e);if("auto-draft"===e.status&&n){let o;o=Object(c.has)(t,["content"])?t.content:e.content.raw;let r=Object(a.parse)(o);r=Object(a.synchronizeBlocksWithTemplate)(r,n),yield fn(r,{__unstableShouldCreateUndoLevel:!1})}t&&Object.keys(t).some(n=>t[n]!==(Object(c.has)(e,[n,"raw"])?e[n].raw:e[n]))&&(yield tn(t))}function Qt(){return{type:"TEAR_DOWN_EDITOR"}}function Yt(e){return{type:"RESET_POST",post:e}}function Jt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:"REQUEST_POST_UPDATE_START",options:e}}function Xt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:"REQUEST_POST_UPDATE_FINISH",options:e}}function Zt(){return E()("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function en(e){return{type:"SETUP_EDITOR_STATE",post:e}}function*tn(e,t){const{id:n,type:o}=yield l.controls.select(P,"getCurrentPost");yield l.controls.dispatch(u.store,"editEntityRecord","postType",o,n,e,t)}function*nn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!(yield l.controls.select(P,"isEditedPostSaveable")))return;let t={content:yield l.controls.select(P,"getEditedPostContent")};e.isAutosave||(yield l.controls.dispatch(P,"editPost",t,{undoIgnore:!0})),yield Jt(e);const n=yield l.controls.select(P,"getCurrentPost");t={id:n.id,...yield l.controls.select(u.store,"getEntityRecordNonTransientEdits","postType",n.type,n.id),...t},yield l.controls.dispatch(u.store,"saveEntityRecord","postType",n.type,t,e),yield Xt(e);const o=yield l.controls.select(u.store,"getLastEntitySaveError","postType",n.type,n.id);if(o){const e=Kt({post:n,edits:t,error:o});e.length&&(yield l.controls.dispatch(Gt.store,"createErrorNotice",...e))}else{const t=yield l.controls.select(P,"getCurrentPost"),o=qt({previousPost:n,post:t,postType:yield l.controls.resolveSelect(u.store,"getPostType",t.type),options:e});o.length&&(yield l.controls.dispatch(Gt.store,"createSuccessNotice",...o)),e.isAutosave||(yield l.controls.dispatch(m.store,"__unstableMarkLastChangeAsPersistent"))}}function*on(){const e=yield l.controls.select(P,"getCurrentPost"),t=yield l.controls.select(P,"getCurrentPostType"),n=yield l.controls.resolveSelect(u.store,"getPostType",t),o=yield Object(b.apiFetch)({path:`/wp/v2/${n.rest_base}/${e.id}?context=edit&_timestamp=`+Date.now()});yield l.controls.dispatch(P,"resetPost",o)}function*rn(){const e=yield l.controls.select(P,"getCurrentPostType"),t=yield l.controls.resolveSelect(u.store,"getPostType",e);yield l.controls.dispatch(Gt.store,"removeNotice","TRASH_POST_NOTICE_ID");try{const e=yield l.controls.select(P,"getCurrentPost");yield Object(b.apiFetch)({path:`/wp/v2/${t.rest_base}/${e.id}`,method:"DELETE"}),yield l.controls.dispatch(P,"savePost")}catch(e){yield l.controls.dispatch(Gt.store,"createErrorNotice",...(n={error:e},[n.error.message&&"unknown_error"!==n.error.code?n.error.message:Object(Wt.__)("Trashing failed"),{id:"TRASH_POST_NOTICE_ID"}]))}var n}function*sn(){let{local:e=!1,...t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e){const e=yield l.controls.select(P,"getCurrentPost"),t=yield l.controls.select(P,"isEditedPostNew"),n=yield l.controls.select(P,"getEditedPostAttribute","title"),o=yield l.controls.select(P,"getEditedPostAttribute","content"),r=yield l.controls.select(P,"getEditedPostAttribute","excerpt");yield{type:"LOCAL_AUTOSAVE_SET",postId:e.id,isPostNew:t,title:n,content:o,excerpt:r}}else yield l.controls.dispatch(P,"savePost",{isAutosave:!0,...t})}function*cn(){yield l.controls.dispatch(u.store,"redo")}function*an(){yield l.controls.dispatch(u.store,"undo")}function ln(){return{type:"CREATE_UNDO_LEVEL"}}function un(e){return{type:"UPDATE_POST_LOCK",lock:e}}function dn(){return{type:"ENABLE_PUBLISH_SIDEBAR"}}function pn(){return{type:"DISABLE_PUBLISH_SIDEBAR"}}function bn(e){return{type:"LOCK_POST_SAVING",lockName:e}}function mn(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function hn(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function gn(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}function*fn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{__unstableShouldCreateUndoLevel:n,selection:o}=t,r={blocks:e,selection:o};if(!1!==n){const{id:e,type:t}=yield l.controls.select(P,"getCurrentPost");if((yield l.controls.select(u.store,"getEditedEntityRecord","postType",t,e)).blocks===r.blocks)return yield l.controls.dispatch(u.store,"__unstableCreateUndoLevel","postType",t,e);r.content=e=>{let{blocks:t=[]}=e;return Object(a.__unstableSerializeAndClean)(t)}}yield*tn(r)}function On(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const vn=e=>function*(){E()("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`"});for(var t=arguments.length,n=new Array(t),o=0;oObject(d.createHigherOrderComponent)(t=>n=>{let{attributes:o,setAttributes:r,...a}=n;const d=Object(l.useSelect)(e=>e(to).getCurrentPostType(),[]),[p,b]=Object(u.useEntityProp)("postType",d,"meta"),m=Object(i.useMemo)(()=>({...o,...Object(c.mapValues)(e,e=>p[e])}),[o,p]);return Object(i.createElement)(t,Object(s.a)({attributes:m,setAttributes:t=>{const n=Object(c.mapKeys)(Object(c.pickBy)(t,(t,n)=>e[n]),(t,n)=>e[n]);Object(c.isEmpty)(n)||b(n),r(t)}},a))},"withMetaAttributeSource"))(t)(e.edit)),e}function oo(e){const t=e.avatar_urls&&e.avatar_urls[24]?Object(i.createElement)("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):Object(i.createElement)("span",{className:"editor-autocompleters__no-avatar"});return Object(i.createElement)(i.Fragment,null,t,Object(i.createElement)("span",{className:"editor-autocompleters__user-name"},e.name),Object(i.createElement)("span",{className:"editor-autocompleters__user-slug"},e.slug))}Object(p.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",no),Object(l.select)(a.store).getBlockTypes().map(e=>{let{name:t}=e;return Object(l.select)(a.store).getBlockType(t)}).forEach(no);var ro={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=Object(l.useSelect)(t=>{const{getUsers:n}=t(u.store);return n({context:"view",search:encodeURIComponent(e)})},[e]);return[Object(i.useMemo)(()=>t?t.map(e=>({key:"user-"+e.slug,value:e,label:oo(e)})):[],[t])]},getOptionCompletion:e=>"@"+e.slug};Object(p.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.push(Object(c.clone)(ro)),e}));class so extends i.Component{constructor(e){super(e),this.needsAutosave=!(!e.isDirty||!e.isAutosaveable)}componentDidMount(){this.props.disableIntervalChecks||this.setAutosaveTimer()}componentDidUpdate(e){this.props.disableIntervalChecks?this.props.editsReference!==e.editsReference&&this.props.autosave():(this.props.interval!==e.interval&&(clearTimeout(this.timerId),this.setAutosaveTimer()),this.props.isDirty&&(!this.props.isAutosaving||e.isAutosaving)?this.props.editsReference!==e.editsReference&&(this.needsAutosave=!0):this.needsAutosave=!1)}componentWillUnmount(){clearTimeout(this.timerId)}setAutosaveTimer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3*this.props.interval;this.timerId=setTimeout(()=>{this.autosaveTimerHandler()},e)}autosaveTimerHandler(){this.props.isAutosaveable?(this.needsAutosave&&(this.needsAutosave=!1,this.props.autosave()),this.setAutosaveTimer()):this.setAutosaveTimer(1e3)}render(){return null}}var io=Object(d.compose)([Object(l.withSelect)((e,t)=>{const{getReferenceByDistinctEdits:n}=e(u.store),{isEditedPostDirty:o,isEditedPostAutosaveable:r,isAutosavingPost:s,getEditorSettings:i}=e(to),{interval:c=i().autosaveInterval}=t;return{editsReference:n(),isDirty:o(),isAutosaveable:r(),isAutosaving:s(),interval:c}}),Object(l.withDispatch)((e,t)=>({autosave(){const{autosave:n=e(to).autosave}=t;n()}}))])(so),co=n("qRz9"),ao=n("TSYQ"),lo=n.n(ao);var uo=e=>{let{children:t,isValid:n,level:o,href:r,onSelect:s}=e;return Object(i.createElement)("li",{className:lo()("document-outline__item","is-"+o.toLowerCase(),{"is-invalid":!n})},Object(i.createElement)("a",{href:r,className:"document-outline__button",onClick:s},Object(i.createElement)("span",{className:"document-outline__emdash","aria-hidden":"true"}),Object(i.createElement)("strong",{className:"document-outline__level"},o),Object(i.createElement)("span",{className:"document-outline__item-content"},t)))};const po=Object(i.createElement)("em",null,Object(Wt.__)("(Empty heading)")),bo=[Object(i.createElement)("br",{key:"incorrect-break"}),Object(i.createElement)("em",{key:"incorrect-message"},Object(Wt.__)("(Incorrect heading level)"))],mo=[Object(i.createElement)("br",{key:"incorrect-break-h1"}),Object(i.createElement)("em",{key:"incorrect-message-h1"},Object(Wt.__)("(Your theme may already use a H1 for the post title)"))],ho=[Object(i.createElement)("br",{key:"incorrect-break-multiple-h1"}),Object(i.createElement)("em",{key:"incorrect-message-multiple-h1"},Object(Wt.__)("(Multiple H1 headings are not recommended)"))],go=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Object(c.flatMap)(e,(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"core/heading"===e.name?{...e,level:e.attributes.level,isEmpty:fo(e)}:go(e.innerBlocks)}))},fo=e=>!e.attributes.content||0===e.attributes.content.length;var Oo=Object(d.compose)(Object(l.withSelect)(e=>{const{getBlocks:t}=e(m.store),{getEditedPostAttribute:n}=e(to),{getPostType:o}=e(u.store),r=o(n("type"));return{title:n("title"),blocks:t(),isTitleSupported:Object(c.get)(r,["supports","title"],!1)}}))(e=>{let{blocks:t=[],title:n,onSelect:o,isTitleSupported:r,hasOutlineItemsDisabled:s}=e;const a=go(t);if(a.length<1)return null;let l=1;const u=document.querySelector(".editor-post-title__input"),d=r&&n&&u,p=Object(c.countBy)(a,"level")[1]>1;return Object(i.createElement)("div",{className:"document-outline"},Object(i.createElement)("ul",null,d&&Object(i.createElement)(uo,{level:Object(Wt.__)("Title"),isValid:!0,onSelect:o,href:"#"+u.id,isDisabled:s},n),a.map((e,t)=>{const n=e.level>l+1,r=!(e.isEmpty||n||!e.level||1===e.level&&(p||d));return l=e.level,Object(i.createElement)(uo,{key:t,level:"H"+e.level,isValid:r,isDisabled:s,href:"#block-"+e.clientId,onSelect:o},e.isEmpty?po:Object(co.getTextContent)(Object(co.create)({html:e.attributes.content})),n&&bo,1===e.level&&p&&ho,d&&1===e.level&&!p&&mo)})))});var vo=Object(l.withSelect)(e=>({blocks:e(m.store).getBlocks()}))((function(e){let{blocks:t,children:n}=e;return Object(c.filter)(t,e=>"core/heading"===e.name).length<1?null:n})),jo=n("hF7m");var _o=function(e){let{resetBlocksOnSave:t}=e;const{resetEditorBlocks:n,savePost:o}=Object(l.useDispatch)(to),{isEditedPostDirty:r,getPostEdits:s,isPostSavingLocked:i}=Object(l.useSelect)(to);return Object(jo.useShortcut)("core/editor/save",e=>{if(e.preventDefault(),!i()&&r()){if(t){const e=s();if(e.content&&"string"==typeof e.content){const t=Object(a.parse)(e.content);n(t)}}o()}}),null};var yo=function(){const{redo:e,undo:t}=Object(l.useDispatch)(to);return Object(jo.useShortcut)("core/editor/undo",e=>{t(),e.preventDefault()}),Object(jo.useShortcut)("core/editor/redo",t=>{e(),t.preventDefault()}),Object(i.createElement)(_o,null)};function Eo(){return Object(i.createElement)(_o,{resetBlocksOnSave:!0})}var So=function(){const{registerShortcut:e}=Object(l.useDispatch)(jo.store);return Object(i.useEffect)(()=>{e({name:"core/editor/save",category:"global",description:Object(Wt.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/editor/undo",category:"global",description:Object(Wt.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/editor/redo",category:"global",description:Object(Wt.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}})},[e]),Object(i.createElement)(m.BlockEditorKeyboardShortcuts.Register,null)},wo=n("tI+e"),Po=n("RxS6"),ko=n("K2cm"),Co=n("Ntru");var To=Object(i.forwardRef)((function(e,t){const n=Object(l.useSelect)(e=>e(to).hasEditorRedo(),[]),{redo:o}=Object(l.useDispatch)(to);return Object(i.createElement)(wo.Button,Object(s.a)({},e,{ref:t,icon:Object(Wt.isRTL)()?Co.a:ko.a,label:Object(Wt.__)("Redo"),shortcut:Po.displayShortcut.primaryShift("z"),"aria-disabled":!n,onClick:n?o:void 0,className:"editor-history__redo"}))}));var xo=Object(i.forwardRef)((function(e,t){const n=Object(l.useSelect)(e=>e(to).hasEditorUndo(),[]),{undo:o}=Object(l.useDispatch)(to);return Object(i.createElement)(wo.Button,Object(s.a)({},e,{ref:t,icon:Object(Wt.isRTL)()?ko.a:Co.a,label:Object(Wt.__)("Undo"),shortcut:Po.displayShortcut.primary("z"),"aria-disabled":!n,onClick:n?o:void 0,className:"editor-history__undo"}))}));var Bo=Object(d.compose)([Object(l.withSelect)(e=>({isValid:e(m.store).isValidTemplate()})),Object(l.withDispatch)(e=>{const{setTemplateValidity:t,synchronizeTemplate:n}=e(m.store);return{resetTemplateValidity:()=>t(!0),synchronizeTemplate:n}})])((function(e){let{isValid:t,...n}=e;return t?null:Object(i.createElement)(wo.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:Object(Wt.__)("Keep it as is"),onClick:n.resetTemplateValidity},{label:Object(Wt.__)("Reset the template"),onClick:()=>{window.confirm(Object(Wt.__)("Resetting the template may result in loss of content, do you want to continue?"))&&n.synchronizeTemplate()}}]},Object(Wt.__)("The content of your post doesn’t match the template assigned to your post type."))}));var Io=Object(d.compose)([Object(l.withSelect)(e=>({notices:e(Gt.store).getNotices()})),Object(l.withDispatch)(e=>({onRemove:e(Gt.store).removeNotice}))])((function(e){let{notices:t,onRemove:n}=e;const o=Object(c.filter)(t,{isDismissible:!0,type:"default"}),r=Object(c.filter)(t,{isDismissible:!1,type:"default"});return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(wo.NoticeList,{notices:r,className:"components-editor-notices__pinned"}),Object(i.createElement)(wo.NoticeList,{notices:o,className:"components-editor-notices__dismissible",onRemove:n},Object(i.createElement)(Bo,null)))}));function Ao(){const e=Object(l.useSelect)(e=>e(Gt.store).getNotices(),[]),{removeNotice:t}=Object(l.useDispatch)(Gt.store),n=Object(c.filter)(e,{type:"snackbar"});return Object(i.createElement)(wo.SnackbarList,{notices:n,className:"components-editor-notices__snackbar",onRemove:t})}var Ro=n("w95h"),No=n("rmEH");function Do(e){let{record:t,checked:n,onChange:o,closePanel:r}=e;const{name:s,kind:c,title:a,key:d}=t,p=Object(l.useSelect)(e=>{var t;const{blocks:n=[]}=e(u.store).getEditedEntityRecord(c,s,d),o=e(m.store).getBlockParents(null===(t=n[0])||void 0===t?void 0:t.clientId);return o[o.length-1]},[]),b=Object(l.useSelect)(e=>{if("postType"!==c||"wp_template"!==s)return a;const t=e(u.store).getEditedEntityRecord(c,s,d);return e(to).__experimentalGetTemplateInfo(t).title},[s,c,a,d]),h=Object(l.useSelect)(e=>e(m.store).getSelectedBlockClientId()===p,[p]),g=h?Object(Wt.__)("Selected"):Object(Wt.__)("Select"),{selectBlock:f}=Object(l.useDispatch)(m.store),O=Object(i.useCallback)(()=>f(p),[p]),v=Object(i.useCallback)(()=>{f(p),r()},[p]);return Object(i.createElement)(wo.PanelRow,null,Object(i.createElement)(wo.CheckboxControl,{label:Object(i.createElement)("strong",null,Object(No.decodeEntities)(b)||Object(Wt.__)("Untitled")),checked:n,onChange:o}),p?Object(i.createElement)(i.Fragment,null,Object(i.createElement)(wo.Button,{onClick:O,className:"entities-saved-states__find-entity",disabled:h},g),Object(i.createElement)(wo.Button,{onClick:v,className:"entities-saved-states__find-entity-small",disabled:h},g)):null)}function Lo(e){let{list:t,unselectedEntities:n,setUnselectedEntities:o,closePanel:r}=e;const s=t[0],a=Object(l.useSelect)(e=>e(u.store).getEntity(s.kind,s.name),[s.kind,s.name]),{name:d}=s,p="wp_template_part"===d?Object(Wt._n)("Template Part","Template Parts",t.length):a.label,b=function(e,t){switch(e){case"site":return Object(Wt._n)("This change will affect your whole site.","These changes will affect your whole site.",t);case"wp_template":return Object(Wt._n)("This change will affect pages and posts that use this template.","These changes will affect pages and posts that use these templates.",t);case"page":case"post":return Object(Wt.__)("The following content has been modified.")}}(d,t.length);return Object(i.createElement)(wo.PanelBody,{title:p,initialOpen:!0},b&&Object(i.createElement)(wo.PanelRow,null,b),t.map(e=>Object(i.createElement)(Do,{key:e.key||e.property,record:e,checked:!Object(c.some)(n,t=>t.kind===e.kind&&t.name===e.name&&t.key===e.key&&t.property===e.property),onChange:t=>o(e,t),closePanel:r})))}const Uo={title:Object(Wt.__)("Title"),description:Object(Wt.__)("Tagline"),site_logo:Object(Wt.__)("Logo"),site_icon:Object(Wt.__)("Icon"),show_on_front:Object(Wt.__)("Show on front"),page_on_front:Object(Wt.__)("Page on front")},Fo=[{kind:"postType",name:"wp_navigation"}];function Mo(e){let{close:t}=e;const n=Object(i.useRef)(),{dirtyEntityRecords:o}=Object(l.useSelect)(e=>{const t=e(u.store).__experimentalGetDirtyEntityRecords().filter(e=>!("root"===e.kind&&"site"===e.name)),n=e(u.store).getEntityRecordEdits("root","site"),o=[];for(const e in n)o.push({kind:"root",name:"site",title:Uo[e]||e,property:e});return{dirtyEntityRecords:[...t,...o]}},[]),{editEntityRecord:r,saveEditedEntityRecord:a,__experimentalSaveSpecifiedEntityEdits:p}=Object(l.useDispatch)(u.store),{createSuccessNotice:b,createErrorNotice:m}=Object(l.useDispatch)(Gt.store),h=Object(c.groupBy)(o,"name"),{site:g,wp_template:f,wp_template_part:O,...v}=h,j=[g,f,O,...Object.values(v)].filter(Array.isArray),[_,y]=Object(i.useState)([]),E=(e,t)=>{let{kind:n,name:o,key:r,property:s}=e;y(t?_.filter(e=>e.kind!==n||e.name!==o||e.key!==r||e.property!==s):[..._,{kind:n,name:o,key:r,property:s}])},S=Object(i.useCallback)(()=>t(),[t]),[w,P]=Object(d.__experimentalUseDialog)({onClose:()=>S()});return Object(i.createElement)("div",Object(s.a)({ref:w},P,{className:"entities-saved-states__panel"}),Object(i.createElement)("div",{className:"entities-saved-states__panel-header"},Object(i.createElement)(wo.Button,{ref:n,variant:"primary",disabled:o.length-_.length==0,onClick:()=>{const e=o.filter(e=>{let{kind:t,name:n,key:o,property:r}=e;return!Object(c.some)(_,e=>e.kind===t&&e.name===n&&e.key===o&&e.property===r)});t(e);const n=[],s=[];e.forEach(e=>{let{kind:t,name:o,key:i,property:c}=e;"root"===t&&"site"===o?n.push(c):(Fo.some(e=>e.kind===t&&e.name===o)&&r(t,o,i,{status:"publish"}),s.push(a(t,o,i)))}),n.length&&s.push(p("root","site",void 0,n)),Promise.all(s).then(e=>{e.some(e=>void 0===e)?m(Object(Wt.__)("Saving failed.")):b(Object(Wt.__)("Site updated."),{type:"snackbar"})}).catch(e=>m(`${Object(Wt.__)("Saving failed.")} ${e}`))},className:"editor-entities-saved-states__save-button"},Object(Wt.__)("Save")),Object(i.createElement)(wo.Button,{icon:Ro.a,onClick:S,label:Object(Wt.__)("Close panel")})),Object(i.createElement)("div",{className:"entities-saved-states__text-prompt"},Object(i.createElement)("strong",null,Object(Wt.__)("Are you ready to save?")),Object(i.createElement)("p",null,Object(Wt.__)("The following changes have been made to your site, templates, and content."))),j.map(e=>Object(i.createElement)(Lo,{key:e[0].name,list:e,closePanel:S,unselectedEntities:_,setUnselectedEntities:E})))}function zo(e){let{text:t,children:n}=e;const o=Object(d.useCopyToClipboard)(t);return Object(i.createElement)(wo.Button,{variant:"secondary",ref:o},n)}class Vo extends i.Component{constructor(){super(...arguments),this.reboot=this.reboot.bind(this),this.getContent=this.getContent.bind(this),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}reboot(){this.props.onError()}getContent(){try{return Object(l.select)(to).getEditedPostContent()}catch(e){}}render(){const{error:e}=this.state;return e?Object(i.createElement)(m.Warning,{className:"editor-error-boundary",actions:[Object(i.createElement)(wo.Button,{key:"recovery",onClick:this.reboot,variant:"secondary"},Object(Wt.__)("Attempt Recovery")),Object(i.createElement)(zo,{key:"copy-post",text:this.getContent},Object(Wt.__)("Copy Post Text")),Object(i.createElement)(zo,{key:"copy-error",text:e.stack},Object(Wt.__)("Copy Error"))]},Object(Wt.__)("The editor has encountered an unexpected error.")):this.props.children}}var Ho=Vo;const Go=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame,Wo=Object(c.once)(()=>{try{return window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),!0}catch(e){return!1}});function qo(){const{postId:e,isEditedPostNew:t,hasRemoteAutosave:n}=Object(l.useSelect)(e=>({postId:e(to).getCurrentPostId(),isEditedPostNew:e(to).isEditedPostNew(),hasRemoteAutosave:!!e(to).getEditorSettings().autosave}),[]),{getEditedPostAttribute:o}=Object(l.useSelect)(to),{createWarningNotice:r,removeNotice:s}=Object(l.useDispatch)(Gt.store),{editPost:u,resetEditorBlocks:d}=Object(l.useDispatch)(to);Object(i.useEffect)(()=>{let i=function(e,t){return window.sessionStorage.getItem(Jn(e,t))}(e,t);if(!i)return;try{i=JSON.parse(i)}catch(e){return}const{post_title:l,content:p,excerpt:b}=i,m={title:l,content:p,excerpt:b};if(!Object.keys(m).some(e=>m[e]!==o(e)))return void Xn(e,t);if(n)return;const h=Object(c.uniqueId)("wpEditorAutosaveRestore");r(Object(Wt.__)("The backup of this post in your browser is different from the version below."),{id:h,actions:[{label:Object(Wt.__)("Restore the backup"),onClick(){u(Object(c.omit)(m,["content"])),d(Object(a.parse)(m.content)),s(h)}}]})},[t,e])}var Ko=Object(d.ifCondition)(Wo)((function(){const{autosave:e}=Object(l.useDispatch)(to),t=Object(i.useCallback)(()=>{Go(()=>e({local:!0}))},[]);qo(),function(){const{postId:e,isEditedPostNew:t,isDirty:n,isAutosaving:o,didError:r}=Object(l.useSelect)(e=>({postId:e(to).getCurrentPostId(),isEditedPostNew:e(to).isEditedPostNew(),isDirty:e(to).isEditedPostDirty(),isAutosaving:e(to).isAutosavingPost(),didError:e(to).didPostSaveRequestFail()}),[]),s=Object(i.useRef)(n),c=Object(i.useRef)(o);Object(i.useEffect)(()=>{!r&&(c.current&&!o||s.current&&!n)&&Xn(e,t),s.current=n,c.current=o},[n,o,r]);const a=Object(d.usePrevious)(t),u=Object(d.usePrevious)(e);Object(i.useEffect)(()=>{u===e&&a&&!t&&Xn(e,!0)},[t,e])}();const{localAutosaveInterval:n}=Object(l.useSelect)(e=>({localAutosaveInterval:e(to).getEditorSettings().__experimentalLocalAutosaveInterval}),[]);return Object(i.createElement)(io,{interval:n,autosave:t})}));var $o=function(e){let{children:t}=e;const n=Object(l.useSelect)(e=>{const{getEditedPostAttribute:t}=e(to),{getPostType:n}=e(u.store);return n(t("type"))},[]);return Object(c.get)(n,["supports","page-attributes"],!1)?t:null};var Qo=Object(l.withSelect)(e=>{const{getEditedPostAttribute:t}=e(to),{getPostType:n}=e(u.store);return{postType:n(t("type"))}})((function(e){let{postType:t,children:n,supportKeys:o}=e,r=!0;return t&&(r=Object(c.some)(Object(c.castArray)(o),e=>!!t.supports[e])),r?n:null}));const Yo=e=>{let{onUpdateOrder:t,order:n=0}=e;const[o,r]=Object(i.useState)(null),s=null===o?n:o;return Object(i.createElement)(wo.TextControl,{className:"editor-page-attributes__order",type:"number",label:Object(Wt.__)("Order"),value:s,onChange:e=>{r(e);const n=Number(e);Number.isInteger(n)&&""!==Object(c.invoke)(e,["trim"])&&t(Number(e))},size:6,onBlur:()=>{r(null)}})};var Jo=Object(d.compose)([Object(l.withSelect)(e=>({order:e(to).getEditedPostAttribute("menu_order")})),Object(l.withDispatch)(e=>({onUpdateOrder(t){e(to).editPost({menu_order:t})}}))])((function(e){return Object(i.createElement)(Qo,{supportKeys:"page-attributes"},Object(i.createElement)(Yo,e))}));function Xo(e){const t=e.map(e=>({children:[],parent:null,...e})),n=Object(c.groupBy)(t,"parent");if(n.null&&n.null.length)return t;const o=e=>e.map(e=>{const t=n[e.id];return{...e,children:t&&t.length?o(t):[]}});return o(n[0]||[])}const Zo=e=>Object(c.unescape)(e.replace("'","'")),er=e=>({...e,name:Zo(e.name)}),tr=e=>Object(c.map)(e,er);function nr(e){var t;return null!=e&&null!==(t=e.title)&&void 0!==t&&t.rendered?Object(No.decodeEntities)(e.title.rendered):`#${e.id} (${Object(Wt.__)("no title")})`}const or=(e,t)=>{const n=Object(c.deburr)(e).toLowerCase(),o=Object(c.deburr)(t).toLowerCase();return n===o?0:n.startsWith(o)?n.length:1/0};var rr=function(){const{editPost:e}=Object(l.useDispatch)(to),[t,n]=Object(i.useState)(!1),{parentPost:o,parentPostId:r,items:s,postType:a}=Object(l.useSelect)(e=>{const{getPostType:n,getEntityRecords:o,getEntityRecord:r}=e(u.store),{getCurrentPostId:s,getEditedPostAttribute:i}=e(to),a=i("type"),l=i("parent"),d=n(a),p=s(),b=Object(c.get)(d,["hierarchical"],!1),m={per_page:100,exclude:p,parent_exclude:p,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};return t&&(m.search=t),{parentPostId:l,parentPost:l?r("postType",a,l):null,items:b?o("postType",a,m):[],postType:d}},[t]),d=Object(c.get)(a,["hierarchical"],!1),p=Object(c.get)(a,["labels","parent_item_colon"]),b=s||[],m=Object(i.useMemo)(()=>{const e=function(n){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=n.map(t=>[{value:t.id,label:Object(c.repeat)("— ",o)+Object(c.unescape)(t.name),rawName:t.name},...e(t.children||[],o+1)]),s=r.sort((e,n)=>{let[o]=e,[r]=n;return or(o.rawName,t)>=or(r.rawName,t)?1:-1});return Object(c.flatten)(s)};let n=b.map(e=>({id:e.id,parent:e.parent,name:nr(e)}));t||(n=Xo(n));const s=e(n),i=Object(c.find)(s,e=>e.value===r);return o&&!i&&s.unshift({value:r,label:nr(o)}),s},[b,t]);return d&&p?Object(i.createElement)(wo.ComboboxControl,{className:"editor-page-attributes__parent",label:p,value:r,options:m,onFilterValueChange:Object(c.debounce)(e=>{n(e)},300),onChange:t=>{e({parent:t})}}):null};var sr=function(e){let{}=e;const{availableTemplates:t,selectedTemplate:n,isViewable:o}=Object(l.useSelect)(e=>{var t,n;const{getEditedPostAttribute:o,getEditorSettings:r,getCurrentPostType:s}=e(to),{getPostType:i}=e(u.store);return{selectedTemplate:o("template"),availableTemplates:r().availableTemplates,isViewable:null!==(t=null===(n=i(s()))||void 0===n?void 0:n.viewable)&&void 0!==t&&t}},[]),{editPost:r}=Object(l.useDispatch)(to);return!o||Object(c.isEmpty)(t)?null:Object(i.createElement)(wo.SelectControl,{label:Object(Wt.__)("Template:"),value:n,onChange:e=>{r({template:e||""})},options:Object(c.map)(t,(e,t)=>({value:t,label:e}))})};const ir={who:"authors",per_page:50,_fields:"id,name",context:"view"};var cr=function(){const[e,t]=Object(i.useState)(),{authorId:n,isLoading:o,authors:r,postAuthor:s}=Object(l.useSelect)(t=>{const{getUser:n,getUsers:o,isResolving:r}=t(u.store),{getEditedPostAttribute:s}=t(to),i=n(s("author"),{context:"view"}),c={...ir};return e&&(c.search=e),{authorId:s("author"),postAuthor:i,authors:o(c),isLoading:r("core","getUsers",[c])}},[e]),{editPost:a}=Object(l.useDispatch)(to),d=Object(i.useMemo)(()=>{const e=(null!=r?r:[]).map(e=>({value:e.id,label:Object(No.decodeEntities)(e.name)}));return e.findIndex(e=>{let{value:t}=e;return(null==s?void 0:s.id)===t})<0&&s?[{value:s.id,label:Object(No.decodeEntities)(s.name)},...e]:e},[r,s]);return s?Object(i.createElement)(wo.ComboboxControl,{label:Object(Wt.__)("Author"),options:d,value:n,onFilterValueChange:Object(c.debounce)(e=>{t(e)},300),onChange:e=>{e&&a({author:e})},isLoading:o,allowReset:!1}):null};var ar=function(){const{editPost:e}=Object(l.useDispatch)(to),{postAuthor:t,authors:n}=Object(l.useSelect)(e=>({postAuthor:e(to).getEditedPostAttribute("author"),authors:e(u.store).getUsers(ir)}),[]),o=Object(i.useMemo)(()=>(null!=n?n:[]).map(e=>({value:e.id,label:Object(No.decodeEntities)(e.name)})),[n]);return Object(i.createElement)(wo.SelectControl,{className:"post-author-selector",label:Object(Wt.__)("Author"),options:o,onChange:t=>{const n=Number(t);e({author:n})},value:t})};var lr=function(){return Object(l.useSelect)(e=>{const t=e(u.store).getUsers(ir);return(null==t?void 0:t.length)>=25},[])?Object(i.createElement)(cr,null):Object(i.createElement)(ar,null)};function ur(e){let{children:t}=e;const{hasAssignAuthorAction:n,hasAuthors:o}=Object(l.useSelect)(e=>{const t=e(to).getCurrentPost(),n=e(u.store).getUsers(ir);return{hasAssignAuthorAction:Object(c.get)(t,["_links","wp:action-assign-author"],!1),hasAuthors:(null==n?void 0:n.length)>=1}},[]);return n&&o?Object(i.createElement)(Qo,{supportKeys:"author"},t):null}var dr=Object(d.compose)([Object(l.withSelect)(e=>({commentStatus:e(to).getEditedPostAttribute("comment_status")})),Object(l.withDispatch)(e=>({editPost:e(to).editPost}))])((function(e){let{commentStatus:t="open",...n}=e;return Object(i.createElement)(wo.CheckboxControl,{label:Object(Wt.__)("Allow comments"),checked:"open"===t,onChange:()=>n.editPost({comment_status:"open"===t?"closed":"open"})})}));var pr=Object(d.compose)([Object(l.withSelect)(e=>({excerpt:e(to).getEditedPostAttribute("excerpt")})),Object(l.withDispatch)(e=>({onUpdateExcerpt(t){e(to).editPost({excerpt:t})}}))])((function(e){let{excerpt:t,onUpdateExcerpt:n}=e;return Object(i.createElement)("div",{className:"editor-post-excerpt"},Object(i.createElement)(wo.TextareaControl,{label:Object(Wt.__)("Write an excerpt (optional)"),className:"editor-post-excerpt__textarea",onChange:e=>n(e),value:t}),Object(i.createElement)(wo.ExternalLink,{href:Object(Wt.__)("https://wordpress.org/support/article/excerpt/")},Object(Wt.__)("Learn more about manual excerpts")))}));var br=function(e){return Object(i.createElement)(Qo,Object(s.a)({},e,{supportKeys:"excerpt"}))};var mr=Object(l.withSelect)(e=>{const{getThemeSupports:t}=e(u.store),{getEditedPostAttribute:n}=e(to);return{postType:n("type"),themeSupports:t()}})((function(e){let{themeSupports:t,children:n,postType:o,supportKeys:r}=e;return Object(c.some)(Object(c.castArray)(r),e=>{const n=Object(c.get)(t,[e],!1);return"post-thumbnails"===e&&Object(c.isArray)(n)?Object(c.includes)(n,o):n})?n:null}));var hr=function(e){return Object(i.createElement)(mr,{supportKeys:"post-thumbnails"},Object(i.createElement)(Qo,Object(s.a)({},e,{supportKeys:"thumbnail"})))};const gr=["image"],fr=Object(Wt.__)("Featured image"),Or=Object(Wt.__)("Set featured image"),vr=Object(Wt.__)("Remove image");const jr=Object(l.withSelect)(e=>{const{getMedia:t,getPostType:n}=e(u.store),{getCurrentPostId:o,getEditedPostAttribute:r}=e(to),s=r("featured_media");return{media:s?t(s,{context:"view"}):null,currentPostId:o(),postType:n(r("type")),featuredImageId:s}}),_r=Object(l.withDispatch)((e,t,n)=>{let{noticeOperations:o}=t,{select:r}=n;const{editPost:s}=e(to);return{onUpdateImage(e){s({featured_media:e.id})},onDropImage(e){r(m.store).getSettings().mediaUpload({allowedTypes:["image"],filesList:e,onFileChange(e){let[t]=e;s({featured_media:t.id})},onError(e){o.removeAllNotices(),o.createErrorNotice(e)}})},onRemoveImage(){s({featured_media:0})}}});var yr=Object(d.compose)(wo.withNotices,jr,_r,Object(wo.withFilters)("editor.PostFeaturedImage"))((function(e){var t,n;let{currentPostId:o,featuredImageId:r,onUpdateImage:s,onDropImage:a,onRemoveImage:l,media:u,postType:d,noticeUI:b}=e;const h=Object(c.get)(d,["labels"],{}),g=Object(i.createElement)("p",null,Object(Wt.__)("To edit the featured image, you need permission to upload media."));let f,O,v;if(u){const e=Object(p.applyFilters)("editor.PostFeaturedImage.imageSize","post-thumbnail",u.id,o);if(Object(c.has)(u,["media_details","sizes",e]))f=u.media_details.sizes[e].width,O=u.media_details.sizes[e].height,v=u.media_details.sizes[e].source_url;else{const e=Object(p.applyFilters)("editor.PostFeaturedImage.imageSize","thumbnail",u.id,o);Object(c.has)(u,["media_details","sizes",e])?(f=u.media_details.sizes[e].width,O=u.media_details.sizes[e].height,v=u.media_details.sizes[e].source_url):(f=u.media_details.width,O=u.media_details.height,v=u.source_url)}}return Object(i.createElement)(hr,null,b,Object(i.createElement)("div",{className:"editor-post-featured-image"},u&&Object(i.createElement)("div",{id:`editor-post-featured-image-${r}-describedby`,className:"hidden"},u.alt_text&&Object(Wt.sprintf)(Object(Wt.__)("Current image: %s"),u.alt_text),!u.alt_text&&Object(Wt.sprintf)(Object(Wt.__)("The current image has no alternative text. The file name is: %s"),(null===(t=u.media_details.sizes)||void 0===t||null===(n=t.full)||void 0===n?void 0:n.file)||u.slug)),Object(i.createElement)(m.MediaUploadCheck,{fallback:g},Object(i.createElement)(m.MediaUpload,{title:h.featured_image||fr,onSelect:s,unstableFeaturedImageFlow:!0,allowedTypes:gr,modalClass:"editor-post-featured-image__media-modal",render:e=>{let{open:t}=e;return Object(i.createElement)("div",{className:"editor-post-featured-image__container"},Object(i.createElement)(wo.Button,{className:r?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:t,"aria-label":r?Object(Wt.__)("Edit or update the image"):null,"aria-describedby":r?`editor-post-featured-image-${r}-describedby`:null},!!r&&u&&Object(i.createElement)(wo.ResponsiveWrapper,{naturalWidth:f,naturalHeight:O,isInline:!0},Object(i.createElement)("img",{src:v,alt:""})),!!r&&!u&&Object(i.createElement)(wo.Spinner,null),!r&&(h.set_featured_image||Or)),Object(i.createElement)(wo.DropZone,{onFilesDrop:a}))},value:r})),!!r&&u&&!u.isLoading&&Object(i.createElement)(m.MediaUploadCheck,null,Object(i.createElement)(m.MediaUpload,{title:h.featured_image||fr,onSelect:s,unstableFeaturedImageFlow:!0,allowedTypes:gr,modalClass:"editor-post-featured-image__media-modal",render:e=>{let{open:t}=e;return Object(i.createElement)(wo.Button,{onClick:t,variant:"secondary"},Object(Wt.__)("Replace Image"))}})),!!r&&Object(i.createElement)(m.MediaUploadCheck,null,Object(i.createElement)(wo.Button,{onClick:l,variant:"link",isDestructive:!0},h.remove_featured_image||vr))))}));var Er=Object(l.withSelect)(e=>({disablePostFormats:e(to).getEditorSettings().disablePostFormats}))((function(e){let{disablePostFormats:t,...n}=e;return!t&&Object(i.createElement)(Qo,Object(s.a)({},n,{supportKeys:"post-formats"}))}));const Sr=[{id:"aside",caption:Object(Wt.__)("Aside")},{id:"audio",caption:Object(Wt.__)("Audio")},{id:"chat",caption:Object(Wt.__)("Chat")},{id:"gallery",caption:Object(Wt.__)("Gallery")},{id:"image",caption:Object(Wt.__)("Image")},{id:"link",caption:Object(Wt.__)("Link")},{id:"quote",caption:Object(Wt.__)("Quote")},{id:"standard",caption:Object(Wt.__)("Standard")},{id:"status",caption:Object(Wt.__)("Status")},{id:"video",caption:Object(Wt.__)("Video")}].sort((e,t)=>{const n=e.caption.toUpperCase(),o=t.caption.toUpperCase();return no?1:0});function wr(){const e="post-format-selector-"+Object(d.useInstanceId)(wr),{postFormat:t,suggestedFormat:n,supportedFormats:o}=Object(l.useSelect)(e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:n}=e(to),o=t("format"),r=e(u.store).getThemeSupports();return{postFormat:null!=o?o:"standard",suggestedFormat:n(),supportedFormats:Object(c.union)([o],Object(c.get)(r,["formats"],[]))}},[]),r=Sr.filter(e=>Object(c.includes)(o,e.id)),s=Object(c.find)(r,e=>e.id===n),{editPost:a}=Object(l.useDispatch)(to),p=e=>a({format:e});return Object(i.createElement)(Er,null,Object(i.createElement)("div",{className:"editor-post-format"},Object(i.createElement)("div",{className:"editor-post-format__content"},Object(i.createElement)("label",{htmlFor:e},Object(Wt.__)("Post Format")),Object(i.createElement)(wo.SelectControl,{value:t,onChange:e=>p(e),id:e,options:r.map(e=>({label:e.caption,value:e.id}))})),s&&s.id!==t&&Object(i.createElement)("div",{className:"editor-post-format__suggestion"},Object(Wt.__)("Suggestion:")," ",Object(i.createElement)(wo.Button,{variant:"link",onClick:()=>p(s.id)},Object(Wt.sprintf)(Object(Wt.__)("Apply format: %s"),s.caption)))))}var Pr=n("Tqx9");var kr=Object(i.createElement)(Pr.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(Pr.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"}));var Cr=Object(l.withSelect)(e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(to);return{lastRevisionId:t(),revisionsCount:n()}})((function(e){let{lastRevisionId:t,revisionsCount:n,children:o}=e;return!t||n<2?null:Object(i.createElement)(Qo,{supportKeys:"revisions"},o)}));var Tr=Object(l.withSelect)(e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(to);return{lastRevisionId:t(),revisionsCount:n()}})((function(e){let{lastRevisionId:t,revisionsCount:n}=e;return Object(i.createElement)(Cr,null,Object(i.createElement)(wo.Button,{href:T("revision.php",{revision:t,gutenberg:!0}),className:"editor-post-last-revision__title",icon:kr},Object(Wt.sprintf)(Object(Wt._n)("%d Revision","%d Revisions",n),n)))}));class xr extends i.Component{constructor(){super(...arguments),this.buttonRef=Object(i.createRef)(),this.openPreviewWindow=this.openPreviewWindow.bind(this)}componentDidUpdate(e){const{previewLink:t}=this.props;t&&!e.previewLink&&this.setPreviewWindowLink(t)}setPreviewWindowLink(e){const{previewWindow:t}=this;t&&!t.closed&&(t.location=e,this.buttonRef.current&&this.buttonRef.current.focus())}getWindowTarget(){const{postId:e}=this.props;return"wp-preview-"+e}openPreviewWindow(e){e.preventDefault(),this.previewWindow&&!this.previewWindow.closed||(this.previewWindow=window.open("",this.getWindowTarget())),this.previewWindow.focus(),this.props.isAutosaveable&&!this.props.isPostLocked?(this.props.isDraft?this.props.savePost({isPreview:!0}):this.props.autosave({isPreview:!0}),function(e){let t=Object(i.renderToString)(Object(i.createElement)("div",{className:"editor-post-preview-button__interstitial-message"},Object(i.createElement)(wo.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96"},Object(i.createElement)(wo.Path,{className:"outer",d:"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",fill:"none"}),Object(i.createElement)(wo.Path,{className:"inner",d:"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",fill:"none"})),Object(i.createElement)("p",null,Object(Wt.__)("Generating preview…"))));t+='\n\t\t\n\t',t=Object(p.applyFilters)("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=Object(Wt.__)("Generating preview…"),e.close()}(this.previewWindow.document)):this.setPreviewWindowLink(e.target.href)}render(){const{previewLink:e,currentPostLink:t,isSaveable:n,role:o}=this.props,r=e||t,s=lo()({"editor-post-preview":!this.props.className},this.props.className);return Object(i.createElement)(wo.Button,{variant:this.props.className?void 0:"tertiary",className:s,href:r,target:this.getWindowTarget(),disabled:!n,onClick:this.openPreviewWindow,ref:this.buttonRef,role:o},this.props.textContent?this.props.textContent:Object(i.createElement)(i.Fragment,null,Object(Wt._x)("Preview","imperative verb"),Object(i.createElement)(wo.VisuallyHidden,{as:"span"},Object(Wt.__)("(opens in a new tab)"))))}}var Br=Object(d.compose)([Object(l.withSelect)((e,t)=>{let{forcePreviewLink:n,forceIsAutosaveable:o}=t;const{getCurrentPostId:r,getCurrentPostAttribute:s,getEditedPostAttribute:i,isEditedPostSaveable:a,isEditedPostAutosaveable:l,getEditedPostPreviewLink:d,isPostLocked:p}=e(to),{getPostType:b}=e(u.store),m=d(),h=b(i("type"));return{postId:r(),currentPostLink:s("link"),previewLink:void 0!==n?n:m,isSaveable:a(),isAutosaveable:o||l(),isViewable:Object(c.get)(h,["viewable"],!1),isDraft:-1!==["draft","auto-draft"].indexOf(i("status")),isPostLocked:p()}}),Object(l.withDispatch)(e=>({autosave:e(to).autosave,savePost:e(to).savePost})),Object(d.ifCondition)(e=>{let{isViewable:t}=e;return t})])(xr);function Ir(){const e="core/editor/post-locked-modal-"+Object(d.useInstanceId)(Ir),{autosave:t,updatePostLock:n}=Object(l.useDispatch)(to),{isLocked:o,isTakeover:r,user:s,postId:a,postLockUtils:b,activePostLock:m,postType:h}=Object(l.useSelect)(e=>{const{isPostLocked:t,isPostLockTakeover:n,getPostLockUser:o,getCurrentPostId:r,getActivePostLock:s,getEditedPostAttribute:i,getEditorSettings:c}=e(to),{getPostType:a}=e(u.store);return{isLocked:t(),isTakeover:n(),user:o(),postId:r(),postLockUtils:c().postLockUtils,activePostLock:s(),postType:a(i("type"))}},[]);if(Object(i.useEffect)(()=>{function r(){if(o||!m)return;const e=new window.FormData;if(e.append("action","wp-remove-post-lock"),e.append("_wpnonce",b.unlockNonce),e.append("post_ID",a),e.append("active_post_lock",m),window.navigator.sendBeacon)window.navigator.sendBeacon(b.ajaxUrl,e);else{const t=new window.XMLHttpRequest;t.open("POST",b.ajaxUrl,!1),t.send(e)}}return Object(p.addAction)("heartbeat.send",e,(function(e){o||(e["wp-refresh-post-lock"]={lock:m,post_id:a})})),Object(p.addAction)("heartbeat.tick",e,(function(e){if(!e["wp-refresh-post-lock"])return;const o=e["wp-refresh-post-lock"];o.lock_error?(t(),n({isLocked:!0,isTakeover:!0,user:{avatar:o.lock_error.avatar_src}})):o.new_lock&&n({isLocked:!1,activePostLock:o.new_lock})})),window.addEventListener("beforeunload",r),()=>{Object(p.removeAction)("heartbeat.send",e),Object(p.removeAction)("heartbeat.tick",e),window.removeEventListener("beforeunload",r)}},[]),!o)return null;const g=s.name,f=s.avatar,O=Object(_.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:a,action:"edit",_wpnonce:b.nonce}),v=T("edit.php",{post_type:Object(c.get)(h,["slug"])}),j=Object(Wt.__)("Exit the Editor");return Object(i.createElement)(wo.Modal,{title:r?Object(Wt.__)("Someone else has taken over this post."):Object(Wt.__)("This post is already being edited."),focusOnMount:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,className:"editor-post-locked-modal"},!!f&&Object(i.createElement)("img",{src:f,alt:Object(Wt.__)("Avatar"),className:"editor-post-locked-modal__avatar"}),!!r&&Object(i.createElement)("div",null,Object(i.createElement)("div",null,g?Object(Wt.sprintf)(Object(Wt.__)("%s now has editing control of this post. Don’t worry, your changes up to this moment have been saved."),g):Object(Wt.__)("Another user now has editing control of this post. Don’t worry, your changes up to this moment have been saved.")),Object(i.createElement)("div",{className:"editor-post-locked-modal__buttons"},Object(i.createElement)(wo.Button,{variant:"primary",href:v},j))),!r&&Object(i.createElement)("div",null,Object(i.createElement)("div",null,g?Object(Wt.sprintf)(Object(Wt.__)("%s is currently working on this post, which means you cannot make changes, unless you take over."),g):Object(Wt.__)("Another user is currently working on this post, which means you cannot make changes, unless you take over.")),Object(i.createElement)("div",{className:"editor-post-locked-modal__buttons"},Object(i.createElement)(wo.Button,{variant:"secondary",href:v},j),Object(i.createElement)(Br,null),Object(i.createElement)(wo.Button,{variant:"primary",href:O},Object(Wt.__)("Take Over")))))}var Ar=Object(d.compose)(Object(l.withSelect)(e=>{const{isCurrentPostPublished:t,getCurrentPostType:n,getCurrentPost:o}=e(to);return{hasPublishAction:Object(c.get)(o(),["_links","wp:action-publish"],!1),isPublished:t(),postType:n()}}))((function(e){let{hasPublishAction:t,isPublished:n,children:o}=e;return n||!t?null:o}));var Rr=Object(d.compose)(Object(l.withSelect)(e=>({status:e(to).getEditedPostAttribute("status")})),Object(l.withDispatch)(e=>({onUpdateStatus(t){e(to).editPost({status:t})}})))((function(e){let{status:t,onUpdateStatus:n}=e;return Object(i.createElement)(Ar,null,Object(i.createElement)(wo.CheckboxControl,{label:Object(Wt.__)("Pending review"),checked:"pending"===t,onChange:()=>{n("pending"===t?"draft":"pending")}}))}));var Nr=Object(d.compose)([Object(l.withSelect)(e=>({pingStatus:e(to).getEditedPostAttribute("ping_status")})),Object(l.withDispatch)(e=>({editPost:e(to).editPost}))])((function(e){let{pingStatus:t="open",...n}=e;return Object(i.createElement)(wo.CheckboxControl,{label:Object(Wt.__)("Allow pingbacks & trackbacks"),checked:"open"===t,onChange:()=>n.editPost({ping_status:"open"===t?"closed":"open"})})}));var Dr=Object(d.compose)([Object(l.withSelect)((e,t)=>{let{forceIsSaving:n}=t;const{isCurrentPostPublished:o,isEditedPostBeingScheduled:r,isSavingPost:s,isPublishingPost:i,getCurrentPost:a,getCurrentPostType:l,isAutosavingPost:u}=e(to);return{isPublished:o(),isBeingScheduled:r(),isSaving:n||s(),isPublishing:i(),hasPublishAction:Object(c.get)(a(),["_links","wp:action-publish"],!1),postType:l(),isAutosaving:u()}})])((function(e){let{isPublished:t,isBeingScheduled:n,isSaving:o,isPublishing:r,hasPublishAction:s,isAutosaving:i,hasNonPostEntityChanges:c}=e;return r?Object(Wt.__)("Publishing…"):t&&o&&!i?Object(Wt.__)("Updating…"):n&&o&&!i?Object(Wt.__)("Scheduling…"):s?t?c?Object(Wt.__)("Update…"):Object(Wt.__)("Update"):n?c?Object(Wt.__)("Schedule…"):Object(Wt.__)("Schedule"):Object(Wt.__)("Publish"):c?Object(Wt.__)("Submit for Review…"):Object(Wt.__)("Submit for Review")}));class Lr extends i.Component{constructor(e){super(e),this.buttonNode=Object(i.createRef)(),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}componentDidMount(){this.props.focusOnMount&&this.buttonNode.current.focus()}createOnClick(e){var t=this;return function(){for(var n=arguments.length,o=new Array(n),r=0;re(...o)}),i(()=>t.closeEntitiesSavedStates),c.noop):e(...o)}}closeEntitiesSavedStates(e){const{postType:t,postId:n}=this.props,{entitiesSavedStatesCallback:o}=this.state;this.setState({entitiesSavedStatesCallback:!1},()=>{e&&Object(c.some)(e,e=>"postType"===e.kind&&e.name===t&&e.key===n)&&o()})}render(){const{forceIsDirty:e,forceIsSaving:t,hasPublishAction:n,isBeingScheduled:o,isOpen:r,isPostSavingLocked:a,isPublishable:l,isPublished:u,isSaveable:d,isSaving:p,isAutoSaving:b,isToggle:m,onSave:h,onStatusChange:g,onSubmit:f=c.noop,onToggle:O,visibility:v,hasNonPostEntityChanges:j,isSavingNonPostEntityChanges:_}=this.props,y=(p||t||!d||a||!l&&!e)&&(!j||_),E=(u||p||t||!d||!l&&!e)&&(!j||_);let S;S=n?"private"===v?"private":o?"future":"publish":"pending";const w={"aria-disabled":y,className:"editor-post-publish-button",isBusy:!b&&p&&u,variant:"primary",onClick:this.createOnClick(()=>{y||(f(),g(S),h())})},P={"aria-disabled":E,"aria-expanded":r,className:"editor-post-publish-panel__toggle",isBusy:p&&u,variant:"primary",onClick:this.createOnClick(()=>{E||O()})},k=o?Object(Wt.__)("Schedule…"):Object(Wt.__)("Publish"),C=Object(i.createElement)(Dr,{forceIsSaving:t,hasNonPostEntityChanges:j}),T=m?P:w,x=m?k:C;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(wo.Button,Object(s.a)({ref:this.buttonNode},T,{className:lo()(T.className,"editor-post-publish-button__button",{"has-changes-dot":j})}),x))}}var Ur=Object(d.compose)([Object(l.withSelect)(e=>{const{isSavingPost:t,isAutosavingPost:n,isEditedPostBeingScheduled:o,getEditedPostVisibility:r,isCurrentPostPublished:s,isEditedPostSaveable:i,isEditedPostPublishable:a,isPostSavingLocked:l,getCurrentPost:u,getCurrentPostType:d,getCurrentPostId:p,hasNonPostEntityChanges:b,isSavingNonPostEntityChanges:m}=e(to),h=n();return{isSaving:t()||h,isAutoSaving:h,isBeingScheduled:o(),visibility:r(),isSaveable:i(),isPostSavingLocked:l(),isPublishable:a(),isPublished:s(),hasPublishAction:Object(c.get)(u(),["_links","wp:action-publish"],!1),postType:d(),postId:p(),hasNonPostEntityChanges:b(),isSavingNonPostEntityChanges:m()}}),Object(l.withDispatch)(e=>{const{editPost:t,savePost:n}=e(to);return{onStatusChange:e=>t({status:e},{undoIgnore:!0}),onSave:n}})])(Lr),Fr=n("bWcr"),Mr=n("wduq");const zr=[{value:"public",label:Object(Wt.__)("Public"),info:Object(Wt.__)("Visible to everyone.")},{value:"private",label:Object(Wt.__)("Private"),info:Object(Wt.__)("Only visible to site admins and editors.")},{value:"password",label:Object(Wt.__)("Password Protected"),info:Object(Wt.__)("Protected with a password you choose. Only those with the password can view this post.")}];class Vr extends i.Component{constructor(e){super(...arguments),this.setPublic=this.setPublic.bind(this),this.setPrivate=this.setPrivate.bind(this),this.setPasswordProtected=this.setPasswordProtected.bind(this),this.updatePassword=this.updatePassword.bind(this),this.state={hasPassword:!!e.password}}setPublic(){const{visibility:e,onUpdateVisibility:t,status:n}=this.props;t("private"===e?"draft":n),this.setState({hasPassword:!1})}setPrivate(){if(!window.confirm(Object(Wt.__)("Would you like to privately publish this post now?")))return;const{onUpdateVisibility:e,onSave:t}=this.props;e("private"),this.setState({hasPassword:!1}),t()}setPasswordProtected(){const{visibility:e,onUpdateVisibility:t,status:n,password:o}=this.props;t("private"===e?"draft":n,o||""),this.setState({hasPassword:!0})}updatePassword(e){const{status:t,onUpdateVisibility:n}=this.props;n(t,e.target.value)}render(){const{visibility:e,password:t,instanceId:n}=this.props,o={public:{onSelect:this.setPublic,checked:"public"===e&&!this.state.hasPassword},private:{onSelect:this.setPrivate,checked:"private"===e},password:{onSelect:this.setPasswordProtected,checked:this.state.hasPassword}};return[Object(i.createElement)("fieldset",{key:"visibility-selector",className:"editor-post-visibility__dialog-fieldset"},Object(i.createElement)("legend",{className:"editor-post-visibility__dialog-legend"},Object(Wt.__)("Post Visibility")),zr.map(e=>{let{value:t,label:r,info:s}=e;return Object(i.createElement)("div",{key:t,className:"editor-post-visibility__choice"},Object(i.createElement)("input",{type:"radio",name:"editor-post-visibility__setting-"+n,value:t,onChange:o[t].onSelect,checked:o[t].checked,id:`editor-post-${t}-${n}`,"aria-describedby":`editor-post-${t}-${n}-description`,className:"editor-post-visibility__dialog-radio"}),Object(i.createElement)("label",{htmlFor:`editor-post-${t}-${n}`,className:"editor-post-visibility__dialog-label"},r),Object(i.createElement)("p",{id:`editor-post-${t}-${n}-description`,className:"editor-post-visibility__dialog-info"},s))})),this.state.hasPassword&&Object(i.createElement)("div",{className:"editor-post-visibility__dialog-password",key:"password-selector"},Object(i.createElement)(wo.VisuallyHidden,{as:"label",htmlFor:"editor-post-visibility__dialog-password-input-"+n},Object(Wt.__)("Create password")),Object(i.createElement)("input",{className:"editor-post-visibility__dialog-password-input",id:"editor-post-visibility__dialog-password-input-"+n,type:"text",onChange:this.updatePassword,value:t,placeholder:Object(Wt.__)("Use a secure password")}))]}}var Hr=Object(d.compose)([Object(l.withSelect)(e=>{const{getEditedPostAttribute:t,getEditedPostVisibility:n}=e(to);return{status:t("status"),visibility:n(),password:t("password")}}),Object(l.withDispatch)(e=>{const{savePost:t,editPost:n}=e(to);return{onSave:t,onUpdateVisibility(e){n({status:e,password:arguments.length>1&&void 0!==arguments[1]?arguments[1]:""})}}}),d.withInstanceId])(Vr);var Gr=Object(l.withSelect)(e=>({visibility:e(to).getEditedPostVisibility()}))((function(e){let{visibility:t}=e;return Object(c.find)(zr,{value:t}).label}));function Wr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=new Date(e);return new Date(n.getFullYear(),n.getMonth()+(t?0:1),t?1:0).toISOString()}function qr(){const{postDate:e,postType:t}=Object(l.useSelect)(e=>({postDate:e(to).getEditedPostAttribute("date"),postType:e(to).getCurrentPostType()}),[]),{editPost:n}=Object(l.useDispatch)(to),[o,r]=Object(i.useState)(Wr(e)),s=Object(l.useSelect)(e=>e(u.store).getEntityRecords("postType",t,{status:"publish,future",after:Wr(o),before:Wr(o,!1),exclude:[e(to).getCurrentPostId()]}),[o,t]),c=Object(i.useMemo)(()=>(s||[]).map(e=>{let{title:t,type:n,date:o}=e;return{title:null==t?void 0:t.rendered,type:n,date:new Date(o)}}),[s]),a=Object(i.useRef)(),d=Object(j.__experimentalGetSettings)(),p=/a(?!\\)/i.test(d.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return Object(i.createElement)(wo.DateTimePicker,{ref:a,currentDate:e,onChange:function(e){n({date:e});const{ownerDocument:t}=a.current;t.activeElement.blur()},is12Hour:p,events:c,onMonthPreviewed:r})}var Kr=Object(l.withSelect)(e=>({date:e(to).getEditedPostAttribute("date"),isFloating:e(to).isEditedPostDateFloating()}))((function(e){let{date:t,isFloating:n}=e;const o=Object(j.__experimentalGetSettings)();return t&&!n?Object(j.format)(`${o.formats.date} ${o.formats.time}`,t):Object(Wt.__)("Immediately")})),$r=n("ywyh"),Qr=n.n($r),Yr=n("gdqT");const Jr={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function Xr(e){let{onSelect:t,taxonomy:n}=e;const{_terms:o,showTerms:r}=Object(l.useSelect)(e=>{const t=e(u.store).getEntityRecords("taxonomy",n.slug,Jr);return{_terms:t,showTerms:10===(null==t?void 0:t.length)}},[]);if(!r)return null;const s=tr(o),a=Object(c.get)(n,["labels","most_used"]);return Object(i.createElement)("div",{className:"editor-post-taxonomies__flat-term-most-used"},Object(i.createElement)("h3",{className:"editor-post-taxonomies__flat-term-most-used-label"},a),Object(i.createElement)("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list"},s.map(e=>Object(i.createElement)("li",{key:e.id},Object(i.createElement)(wo.Button,{variant:"link",onClick:()=>t(e)},e.name)))))}const Zr=[],es={per_page:20,orderby:"count",order:"desc",_fields:"id,name",context:"view"},ts=(e,t)=>Zo(e).toLowerCase()===Zo(t).toLowerCase(),ns=(e,t)=>e.map(e=>Object(c.find)(t,t=>ts(t.name,e)).id);var os=Object(wo.withFilters)("editor.PostTaxonomyType")((function(e){let{slug:t}=e;const[n,o]=Object(i.useState)([]),[r,s]=Object(i.useState)(""),a=Object(d.useDebounce)(s,500),{terms:p,termIds:b,taxonomy:m,hasAssignAction:h,hasCreateAction:g,hasResolvedTerms:f}=Object(l.useSelect)(e=>{const{getCurrentPost:n,getEditedPostAttribute:o}=e(to),{getEntityRecords:r,getTaxonomy:s,hasFinishedResolution:i}=e(u.store),a=n(),l=s(t),d=l?o(l.rest_base):Zr,p={...es,include:d.join(","),per_page:-1};return{hasCreateAction:!!l&&Object(c.get)(a,["_links","wp:action-create-"+l.rest_base],!1),hasAssignAction:!!l&&Object(c.get)(a,["_links","wp:action-assign-"+l.rest_base],!1),taxonomy:l,termIds:d,terms:d.length?r("taxonomy",t,p):Zr,hasResolvedTerms:i("getEntityRecords",["taxonomy",t,p])}},[t]),{searchResults:O}=Object(l.useSelect)(e=>{const{getEntityRecords:n}=e(u.store);return{searchResults:r?n("taxonomy",t,{...es,search:r}):Zr}},[r]);Object(i.useEffect)(()=>{if(f){const e=p.map(e=>Zo(e.name));o(e)}},[p,f]);const v=Object(i.useMemo)(()=>(null!=O?O:[]).map(e=>Zo(e.name)),[O]),{editPost:j}=Object(l.useDispatch)(to);if(!h)return null;function y(e){j({[m.rest_base]:e})}const E=Object(c.get)(m,["labels","add_new_item"],"post_tag"===t?Object(Wt.__)("Add new tag"):Object(Wt.__)("Add new Term")),S=Object(c.get)(m,["labels","singular_name"],"post_tag"===t?Object(Wt.__)("Tag"):Object(Wt.__)("Term")),w=Object(Wt.sprintf)(Object(Wt._x)("%s added","term"),S),P=Object(Wt.sprintf)(Object(Wt._x)("%s removed","term"),S),k=Object(Wt.sprintf)(Object(Wt._x)("Remove %s","term"),S);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(wo.FormTokenField,{value:n,suggestions:v,onChange:function(e){const t=[...p,...null!=O?O:[]],n=Object(c.uniqBy)(e,e=>e.toLowerCase()),r=n.filter(e=>!Object(c.find)(t,t=>ts(t.name,e)));if(o(n),0===r.length)return y(ns(n,t));g&&Promise.all(r.map(e=>function(e,t){const n=Object(c.escape)(e);return Qr()({path:"/wp/v2/"+t,method:"POST",data:{name:n}}).catch(o=>{if("term_exists"===o.code){return Qr()({path:Object(_.addQueryArgs)("/wp/v2/"+t,{...es,search:n})}).then(tr).then(t=>Object(c.find)(t,t=>ts(t.name,e)))}return Promise.reject(o)}).then(er)}(e,m.rest_base))).then(e=>{const o=t.concat(e);return y(ns(n,o))})},onInputChange:a,maxSuggestions:20,label:E,messages:{added:w,removed:P,remove:k}}),Object(i.createElement)(Xr,{taxonomy:m,onSelect:function(e){if(b.includes(e.id))return;const n=[...b,e.id],o=Object(Wt.sprintf)(Object(Wt._x)("%s added","term"),Object(c.get)(m,["labels","singular_name"],"post_tag"===t?Object(Wt.__)("Tag"):Object(Wt.__)("Term")));Object(Yr.speak)(o,"assertive"),y(n)}}))}));const rs=()=>{const e=[Object(Wt.__)("Suggestion:"),Object(i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},Object(Wt.__)("Add tags"))];return Object(i.createElement)(wo.PanelBody,{initialOpen:!1,title:e},Object(i.createElement)("p",null,Object(Wt.__)("Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.")),Object(i.createElement)(os,{slug:"post_tag"}))};class ss extends i.Component{constructor(e){super(e),this.state={hadTagsWhenOpeningThePanel:e.hasTags}}render(){return this.state.hadTagsWhenOpeningThePanel?null:Object(i.createElement)(rs,null)}}var is=Object(d.compose)(Object(l.withSelect)(e=>{const t=e(to).getCurrentPostType(),n=e(u.store).getTaxonomy("post_tag"),o=n&&e(to).getEditedPostAttribute(n.rest_base);return{areTagsFetched:void 0!==n,isPostTypeSupported:n&&Object(c.some)(n.types,e=>e===t),hasTags:o&&o.length}}),Object(d.ifCondition)(e=>{let{areTagsFetched:t,isPostTypeSupported:n}=e;return n&&t}))(ss);const cs=(e,t)=>{const n=Sr.filter(t=>Object(c.includes)(e,t.id));return Object(c.find)(n,e=>e.id===t)},as=e=>{let{suggestedPostFormat:t,suggestionText:n,onUpdatePostFormat:o}=e;return Object(i.createElement)(wo.Button,{variant:"link",onClick:()=>o(t)},n)};function ls(){const{currentPostFormat:e,suggestion:t}=Object(l.useSelect)(e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:n}=e(to),o=Object(c.get)(e(u.store).getThemeSupports(),["formats"],[]);return{currentPostFormat:t("format"),suggestion:cs(o,n())}},[]),{editPost:n}=Object(l.useDispatch)(to),o=[Object(Wt.__)("Suggestion:"),Object(i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},Object(Wt.__)("Use a post format"))];return t&&t.id!==e?Object(i.createElement)(wo.PanelBody,{initialOpen:!1,title:o},Object(i.createElement)("p",null,Object(Wt.__)("Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.")),Object(i.createElement)("p",null,Object(i.createElement)(as,{onUpdatePostFormat:e=>n({format:e}),suggestedPostFormat:t.id,suggestionText:Object(Wt.sprintf)(Object(Wt.__)('Apply the "%1$s" format.'),t.caption)}))):null}var us=function(e){let{children:t}=e;const{isBeingScheduled:n,isRequestingSiteIcon:o,hasPublishAction:r,siteIconUrl:s,siteTitle:a,siteHome:d}=Object(l.useSelect)(e=>{const{getCurrentPost:t,isEditedPostBeingScheduled:n}=e(to),{getEntityRecord:o,isResolving:r}=e(u.store),s=o("root","__unstableBase",void 0)||{};return{hasPublishAction:Object(c.get)(t(),["_links","wp:action-publish"],!1),isBeingScheduled:n(),isRequestingSiteIcon:r("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:s.site_icon_url,siteTitle:s.name,siteHome:s.home&&Object(_.filterURLForDisplay)(s.home)}},[]);let p,b,m=Object(i.createElement)(wo.Icon,{className:"components-site-icon",size:"36px",icon:Mr.a});return s&&(m=Object(i.createElement)("img",{alt:Object(Wt.__)("Site Icon"),className:"components-site-icon",src:s})),o&&(m=null),r?n?(p=Object(Wt.__)("Are you ready to schedule?"),b=Object(Wt.__)("Your work will be published at the specified date and time.")):(p=Object(Wt.__)("Are you ready to publish?"),b=Object(Wt.__)("Double-check your settings before publishing.")):(p=Object(Wt.__)("Are you ready to submit for review?"),b=Object(Wt.__)("When you’re ready, submit your work for review, and an Editor will be able to approve it for you.")),Object(i.createElement)("div",{className:"editor-post-publish-panel__prepublish"},Object(i.createElement)("div",null,Object(i.createElement)("strong",null,p)),Object(i.createElement)("p",null,b),Object(i.createElement)("div",{className:"components-site-card"},m,Object(i.createElement)("div",{className:"components-site-info"},Object(i.createElement)("span",{className:"components-site-name"},Object(No.decodeEntities)(a)||Object(Wt.__)("(Untitled)")),Object(i.createElement)("span",{className:"components-site-home"},d))),r&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(wo.PanelBody,{initialOpen:!1,title:[Object(Wt.__)("Visibility:"),Object(i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},Object(i.createElement)(Gr,null))]},Object(i.createElement)(Hr,null)),Object(i.createElement)(wo.PanelBody,{initialOpen:!1,title:[Object(Wt.__)("Publish:"),Object(i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},Object(i.createElement)(Kr,null))]},Object(i.createElement)(qr,null))),Object(i.createElement)(ls,null),Object(i.createElement)(is,null),t)};function ds(e){let{text:t,onCopy:n,children:o}=e;const r=Object(d.useCopyToClipboard)(t,n);return Object(i.createElement)(wo.Button,{variant:"secondary",ref:r},o)}class ps extends i.Component{constructor(){super(...arguments),this.state={showCopyConfirmation:!1},this.onCopy=this.onCopy.bind(this),this.onSelectInput=this.onSelectInput.bind(this),this.postLink=Object(i.createRef)()}componentDidMount(){this.props.focusOnMount&&this.postLink.current.focus()}componentWillUnmount(){clearTimeout(this.dismissCopyConfirmation)}onCopy(){this.setState({showCopyConfirmation:!0}),clearTimeout(this.dismissCopyConfirmation),this.dismissCopyConfirmation=setTimeout(()=>{this.setState({showCopyConfirmation:!1})},4e3)}onSelectInput(e){e.target.select()}render(){const{children:e,isScheduled:t,post:n,postType:o}=this.props,r=Object(c.get)(o,["labels","singular_name"]),s=Object(c.get)(o,["labels","view_item"]),a=Object(c.get)(o,["labels","add_new_item"]),l="future"===n.status?(e=>{const{slug:t}=e;return e.permalink_template.includes("%postname%")?e.permalink_template.replace("%postname%",t):e.permalink_template})(n):n.link,u=Object(_.addQueryArgs)("post-new.php",{post_type:n.type}),d=t?Object(i.createElement)(i.Fragment,null,Object(Wt.__)("is now scheduled. It will go live on")," ",Object(i.createElement)(Kr,null),"."):Object(Wt.__)("is now live.");return Object(i.createElement)("div",{className:"post-publish-panel__postpublish"},Object(i.createElement)(wo.PanelBody,{className:"post-publish-panel__postpublish-header"},Object(i.createElement)("a",{ref:this.postLink,href:l},Object(No.decodeEntities)(n.title)||Object(Wt.__)("(no title)"))," ",d),Object(i.createElement)(wo.PanelBody,null,Object(i.createElement)("p",{className:"post-publish-panel__postpublish-subheader"},Object(i.createElement)("strong",null,Object(Wt.__)("What’s next?"))),Object(i.createElement)("div",{className:"post-publish-panel__postpublish-post-address-container"},Object(i.createElement)(wo.TextControl,{className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:Object(Wt.sprintf)(Object(Wt.__)("%s address"),r),value:Object(_.safeDecodeURIComponent)(l),onFocus:this.onSelectInput}),Object(i.createElement)("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap"},Object(i.createElement)(ds,{text:l,onCopy:this.onCopy},this.state.showCopyConfirmation?Object(Wt.__)("Copied!"):Object(Wt.__)("Copy")))),Object(i.createElement)("div",{className:"post-publish-panel__postpublish-buttons"},!t&&Object(i.createElement)(wo.Button,{variant:"primary",href:l},s),Object(i.createElement)(wo.Button,{variant:t?"primary":"secondary",href:u},a))),e)}}var bs=Object(l.withSelect)(e=>{const{getEditedPostAttribute:t,getCurrentPost:n,isCurrentPostScheduled:o}=e(to),{getPostType:r}=e(u.store);return{post:n(),postType:r(t("type")),isScheduled:o()}})(ps);class ms extends i.Component{constructor(){super(...arguments),this.onSubmit=this.onSubmit.bind(this)}componentDidUpdate(e){e.isPublished&&!this.props.isSaving&&this.props.isDirty&&this.props.onClose()}onSubmit(){const{onClose:e,hasPublishAction:t,isPostTypeViewable:n}=this.props;t&&n||e()}render(){const{forceIsDirty:e,forceIsSaving:t,isBeingScheduled:n,isPublished:o,isPublishSidebarEnabled:r,isScheduled:a,isSaving:l,isSavingNonPostEntityChanges:u,onClose:d,onTogglePublishSidebar:p,PostPublishExtension:b,PrePublishExtension:m,...h}=this.props,g=Object(c.omit)(h,["hasPublishAction","isDirty","isPostTypeViewable"]),f=o||a&&n,O=!f&&!l,v=f&&!l;return Object(i.createElement)("div",Object(s.a)({className:"editor-post-publish-panel"},g),Object(i.createElement)("div",{className:"editor-post-publish-panel__header"},v?Object(i.createElement)(wo.Button,{onClick:d,icon:Fr.a,label:Object(Wt.__)("Close panel")}):Object(i.createElement)(i.Fragment,null,Object(i.createElement)("div",{className:"editor-post-publish-panel__header-publish-button"},Object(i.createElement)(Ur,{focusOnMount:!0,onSubmit:this.onSubmit,forceIsDirty:e,forceIsSaving:t})),Object(i.createElement)("div",{className:"editor-post-publish-panel__header-cancel-button"},Object(i.createElement)(wo.Button,{disabled:u,onClick:d,variant:"secondary"},Object(Wt.__)("Cancel"))))),Object(i.createElement)("div",{className:"editor-post-publish-panel__content"},O&&Object(i.createElement)(us,null,m&&Object(i.createElement)(m,null)),v&&Object(i.createElement)(bs,{focusOnMount:!0},b&&Object(i.createElement)(b,null)),l&&Object(i.createElement)(wo.Spinner,null)),Object(i.createElement)("div",{className:"editor-post-publish-panel__footer"},Object(i.createElement)(wo.CheckboxControl,{label:Object(Wt.__)("Always show pre-publish checks."),checked:r,onChange:p})))}}var hs=Object(d.compose)([Object(l.withSelect)(e=>{const{getPostType:t}=e(u.store),{getCurrentPost:n,getEditedPostAttribute:o,isCurrentPostPublished:r,isCurrentPostScheduled:s,isEditedPostBeingScheduled:i,isEditedPostDirty:a,isSavingPost:l,isSavingNonPostEntityChanges:d}=e(to),{isPublishSidebarEnabled:p}=e(to),b=t(o("type"));return{hasPublishAction:Object(c.get)(n(),["_links","wp:action-publish"],!1),isPostTypeViewable:Object(c.get)(b,["viewable"],!1),isBeingScheduled:i(),isDirty:a(),isPublished:r(),isPublishSidebarEnabled:p(),isSaving:l(),isSavingNonPostEntityChanges:d(),isScheduled:s()}}),Object(l.withDispatch)((e,t)=>{let{isPublishSidebarEnabled:n}=t;const{disablePublishSidebar:o,enablePublishSidebar:r}=e(to);return{onTogglePublishSidebar:()=>{n?o():r()}}}),wo.withFocusReturn,wo.withConstrainedTabbing])(ms);var gs=Object(i.createElement)(Pr.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(Pr.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-4v-2.4L14 14l1-1-3-3-3 3 1 1 1.2-1.2v2.4H7.7c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4H9l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8 0 1-.8 1.8-1.7 1.8z"})),fs=n("iClF"),Os=n("RMJe");var vs=Object(i.createElement)(Pr.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(Pr.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z"}));var js=Object(d.compose)([Object(l.withSelect)(e=>{const{isSavingPost:t,isCurrentPostPublished:n,isCurrentPostScheduled:o}=e(to);return{isSaving:t(),isPublished:n(),isScheduled:o()}}),Object(l.withDispatch)(e=>{const{editPost:t,savePost:n}=e(to);return{onClick:()=>{t({status:"draft"}),n()}}})])((function(e){let{isSaving:t,isPublished:n,isScheduled:o,onClick:r}=e;const s=Object(d.useViewportMatch)("small","<");return n||o?Object(i.createElement)(wo.Button,{className:"editor-post-switch-to-draft",onClick:()=>{let e;n?e=Object(Wt.__)("Are you sure you want to unpublish this post?"):o&&(e=Object(Wt.__)("Are you sure you want to unschedule this post?")),window.confirm(e)&&r()},disabled:t,variant:"tertiary"},s?Object(Wt.__)("Draft"):Object(Wt.__)("Switch to draft")):null}));function _s(e){let{forceIsDirty:t,forceIsSaving:n,showIconLabels:o=!1}=e;const[r,s]=Object(i.useState)(!1),c=Object(d.useViewportMatch)("small"),{isAutosaving:a,isDirty:u,isNew:p,isPending:b,isPublished:m,isSaveable:h,isSaving:g,isScheduled:f,hasPublishAction:O}=Object(l.useSelect)(e=>{var o,r,s;const{isEditedPostNew:i,isCurrentPostPublished:c,isCurrentPostScheduled:a,isEditedPostDirty:l,isSavingPost:u,isEditedPostSaveable:d,getCurrentPost:p,isAutosavingPost:b,getEditedPostAttribute:m}=e(to);return{isAutosaving:b(),isDirty:t||l(),isNew:i(),isPending:"pending"===m("status"),isPublished:c(),isSaving:n||u(),isSaveable:d(),isScheduled:a(),hasPublishAction:null!==(o=null===(r=p())||void 0===r||null===(s=r._links)||void 0===s?void 0:s["wp:action-publish"])&&void 0!==o&&o}},[t,n]),{savePost:v}=Object(l.useDispatch)(to),j=Object(d.usePrevious)(g);if(Object(i.useEffect)(()=>{let e;return j&&!g&&(s(!0),e=setTimeout(()=>{s(!1)},1e3)),()=>clearTimeout(e)},[g]),!O&&b)return null;if(m||f)return Object(i.createElement)(js,null);const _=b?Object(Wt.__)("Save as pending"):Object(Wt.__)("Save draft"),y=Object(Wt.__)("Save"),E=r||!p&&!u,S=g||E,w=g||E||!h;let P;return g?P=a?Object(Wt.__)("Autosaving"):Object(Wt.__)("Saving"):E?P=Object(Wt.__)("Saved"):c?P=_:o&&(P=y),Object(i.createElement)(wo.Button,{className:h||g?lo()({"editor-post-save-draft":!S,"editor-post-saved-state":S,"is-saving":g,"is-autosaving":a,"is-saved":E,[Object(wo.__unstableGetAnimateClassName)({type:"loading"})]:g}):void 0,onClick:w?void 0:()=>v(),shortcut:Po.displayShortcut.primary("s"),variant:c?"tertiary":void 0,icon:c?void 0:gs,label:_,"aria-disabled":w},S&&Object(i.createElement)(fs.a,{icon:E?Os.a:vs}),P)}var ys=Object(d.compose)([Object(l.withSelect)(e=>{const{getCurrentPost:t,getCurrentPostType:n}=e(to);return{hasPublishAction:Object(c.get)(t(),["_links","wp:action-publish"],!1),postType:n()}})])((function(e){let{hasPublishAction:t,children:n}=e;return t?n:null}));function Es(e){let{children:t}=e;return Object(i.createElement)(Qo,{supportKeys:"slug"},t)}class Ss extends i.Component{constructor(e){let{postSlug:t,postTitle:n,postID:o}=e;super(...arguments),this.state={editedSlug:Object(_.safeDecodeURIComponent)(t)||x(n)||o},this.setSlug=this.setSlug.bind(this)}setSlug(e){const{postSlug:t,onUpdateSlug:n}=this.props,{value:o}=e.target,r=x(o);r!==t&&n(r)}render(){const{instanceId:e}=this.props,{editedSlug:t}=this.state,n="editor-post-slug-"+e;return Object(i.createElement)(Es,null,Object(i.createElement)("label",{htmlFor:n},Object(Wt.__)("Slug")),Object(i.createElement)("input",{autoComplete:"off",spellCheck:"false",type:"text",id:n,value:t,onChange:e=>this.setState({editedSlug:e.target.value}),onBlur:this.setSlug,className:"editor-post-slug__input"}))}}var ws=Object(d.compose)([Object(l.withSelect)(e=>{const{getCurrentPost:t,getEditedPostAttribute:n}=e(to),{id:o}=t();return{postSlug:n("slug"),postTitle:n("title"),postID:o}}),Object(l.withDispatch)(e=>{const{editPost:t}=e(to);return{onUpdateSlug(e){t({slug:e})}}}),d.withInstanceId])(Ss);var Ps=Object(d.compose)([Object(l.withSelect)(e=>{const t=e(to).getCurrentPost();return{hasStickyAction:Object(c.get)(t,["_links","wp:action-sticky"],!1),postType:e(to).getCurrentPostType()}})])((function(e){let{hasStickyAction:t,postType:n,children:o}=e;return"post"===n&&t?o:null}));var ks=Object(d.compose)([Object(l.withSelect)(e=>({postSticky:e(to).getEditedPostAttribute("sticky")})),Object(l.withDispatch)(e=>({onUpdateSticky(t){e(to).editPost({sticky:t})}}))])((function(e){let{onUpdateSticky:t,postSticky:n=!1}=e;return Object(i.createElement)(Ps,null,Object(i.createElement)(wo.CheckboxControl,{label:Object(Wt.__)("Stick to the top of the blog"),checked:n,onChange:()=>t(!n)}))}));const Cs={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view"},Ts=[];var xs=Object(wo.withFilters)("editor.PostTaxonomyType")((function(e){let{slug:t}=e;const[n,o]=Object(i.useState)(!1),[r,s]=Object(i.useState)(""),[a,p]=Object(i.useState)(""),[b,m]=Object(i.useState)(!1),[h,g]=Object(i.useState)(""),[f,O]=Object(i.useState)([]),v=Object(d.useDebounce)(Yr.speak,500),{hasCreateAction:j,hasAssignAction:_,terms:y,loading:E,availableTerms:S,taxonomy:w}=Object(l.useSelect)(e=>{const{getCurrentPost:n,getEditedPostAttribute:o}=e(to),{getTaxonomy:r,getEntityRecords:s,isResolving:i}=e(u.store),a=r(t);return{hasCreateAction:!!a&&Object(c.get)(n(),["_links","wp:action-create-"+a.rest_base],!1),hasAssignAction:!!a&&Object(c.get)(n(),["_links","wp:action-assign-"+a.rest_base],!1),terms:a?o(a.rest_base):Ts,loading:i("getEntityRecords",["taxonomy",t,Cs]),availableTerms:s("taxonomy",t,Cs)||Ts,taxonomy:a}},[t]),{editPost:P}=Object(l.useDispatch)(to),{saveEntityRecord:k}=Object(l.useDispatch)(u.store),C=Object(i.useMemo)(()=>function(e,t){const n=e=>-1!==t.indexOf(e.id)||void 0!==e.children&&e.children.map(n).filter(e=>e).length>0,o=[...e];return o.sort((e,t)=>{const o=n(e),r=n(t);return o===r?0:o&&!r?-1:!o&&r?1:0}),o}(Xo(S),y),[S]);if(!_)return null;const T=e=>{P({[w.rest_base]:e})},x=e=>e.map(e=>Object(i.createElement)("div",{key:e.id,className:"editor-post-taxonomies__hierarchical-terms-choice"},Object(i.createElement)(wo.CheckboxControl,{checked:-1!==y.indexOf(e.id),onChange:()=>{(e=>{const t=y.includes(e)?Object(c.without)(y,e):[...y,e];T(t)})(parseInt(e.id,10))},label:Object(c.unescape)(e.name)}),!!e.children.length&&Object(i.createElement)("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices"},x(e.children)))),B=(e,n,o)=>Object(c.get)(w,["labels",e],"category"===t?n:o),I=B("add_new_item",Object(Wt.__)("Add new category"),Object(Wt.__)("Add new term")),A=B("new_item_name",Object(Wt.__)("Add new category"),Object(Wt.__)("Add new term")),R=B("parent_item",Object(Wt.__)("Parent Category"),Object(Wt.__)("Parent Term")),N=`— ${R} —`,D=I,L=Object(c.get)(w,["labels","search_items"],Object(Wt.__)("Search Terms")),U=Object(c.get)(w,["name"],Object(Wt.__)("Terms")),F=S.length>=8;return Object(i.createElement)(i.Fragment,null,F&&Object(i.createElement)(wo.TextControl,{className:"editor-post-taxonomies__hierarchical-terms-filter",label:L,value:h,onChange:e=>{const t=C.map(function(e){const t=n=>{if(""===e)return n;const o={...n};return o.children.length>0&&(o.children=o.children.map(t).filter(e=>e)),(-1!==o.name.toLowerCase().indexOf(e.toLowerCase())||o.children.length>0)&&o};return t}(e)).filter(e=>e),n=e=>{let t=0;for(let o=0;o{m(!b)},className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":b,variant:"link"},I),b&&Object(i.createElement)("form",{onSubmit:async e=>{if(e.preventDefault(),""===r||n)return;const i=function(e,t,n){return Object(c.find)(e,e=>(!e.parent&&!t||parseInt(e.parent)===parseInt(t))&&e.name.toLowerCase()===n.toLowerCase())}(S,a,r);if(i)return Object(c.some)(y,e=>e===i.id)||T([...y,i.id]),s(""),void p("");o(!0);const l=await(u={name:r,parent:a||void 0},k("taxonomy",t,u));var u;const d=Object(Wt.sprintf)(Object(Wt._x)("%s added","term"),Object(c.get)(w,["labels","singular_name"],"category"===t?Object(Wt.__)("Category"):Object(Wt.__)("Term")));Object(Yr.speak)(d,"assertive"),o(!1),s(""),p(""),T([...y,l.id])}},Object(i.createElement)(wo.TextControl,{className:"editor-post-taxonomies__hierarchical-terms-input",label:A,value:r,onChange:e=>{s(e)},required:!0}),!!S.length&&Object(i.createElement)(wo.TreeSelect,{label:R,noOptionLabel:N,onChange:e=>{p(e)},selectedId:a,tree:C}),Object(i.createElement)(wo.Button,{variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit"},D)))}));var Bs=Object(d.compose)([Object(l.withSelect)(e=>({postType:e(to).getCurrentPostType(),taxonomies:e(u.store).getTaxonomies({per_page:-1})}))])((function(e){let{postType:t,taxonomies:n,taxonomyWrapper:o=c.identity}=e;const r=Object(c.filter)(n,e=>Object(c.includes)(e.types,t));return Object(c.filter)(r,e=>e.visibility.show_ui).map(e=>{const t=e.hierarchical?xs:os;return Object(i.createElement)(i.Fragment,{key:"taxonomy-"+e.slug},o(Object(i.createElement)(t,{slug:e.slug}),e))})}));var Is=Object(d.compose)([Object(l.withSelect)(e=>({postType:e(to).getCurrentPostType(),taxonomies:e(u.store).getTaxonomies({per_page:-1})}))])((function(e){let{postType:t,taxonomies:n,children:o}=e;return Object(c.some)(n,e=>Object(c.includes)(e.types,t))?o:null})),As=n("O6Fj"),Rs=n.n(As);function Ns(){const e=Object(l.useSelect)(e=>e(to).getEditedPostContent(),[]),{editPost:t,resetEditorBlocks:n}=Object(l.useDispatch)(to),[o,r]=Object(i.useState)(e),[s,c]=Object(i.useState)(!1),u=Object(d.useInstanceId)(Ns);s||o===e||r(e);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(wo.VisuallyHidden,{as:"label",htmlFor:"post-content-"+u},Object(Wt.__)("Type text or HTML")),Object(i.createElement)(Rs.a,{autoComplete:"off",dir:"auto",value:o,onChange:e=>{const n=e.target.value;t({content:n}),r(n),c(!0)},onBlur:()=>{if(s){const e=Object(a.parse)(o);n(e),c(!1)}},className:"editor-post-text-editor",id:"post-content-"+u,placeholder:Object(Wt.__)("Start writing with text or HTML")}))}const Ds=/[\r\n]+/g;function Ls(){const e=Object(i.useRef)(),[t,n]=Object(i.useState)(!1),{editPost:o}=Object(l.useDispatch)(to),{insertDefaultBlock:r,clearSelectedBlock:s,insertBlocks:c}=Object(l.useDispatch)(m.store),{isCleanNewPost:u,title:p,placeholder:b,isFocusMode:h,hasFixedToolbar:g}=Object(l.useSelect)(e=>{const{getEditedPostAttribute:t,isCleanNewPost:n}=e(to),{getSettings:o}=e(m.store),{titlePlaceholder:r,focusMode:s,hasFixedToolbar:i}=o();return{isCleanNewPost:n(),title:t("title"),placeholder:r,isFocusMode:s,hasFixedToolbar:i}},[]);function f(e){c(e,0)}function O(e){o({title:e})}Object(i.useEffect)(()=>{if(!e.current)return;const{ownerDocument:t}=e.current,{activeElement:n,body:o}=t;!u||n&&o!==n||e.current.focus()},[u]);const[v,j]=Object(i.useState)({});function _(){n(!1),j({})}const y=lo()("wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",{"is-selected":t,"is-focus-mode":h,"has-fixed-toolbar":g}),E=Object(No.decodeEntities)(b)||Object(Wt.__)("Add title"),{ref:S}=Object(co.__unstableUseRichText)({value:p,onChange:function(e){O(e.replace(Ds," "))},placeholder:E,selectionStart:v.start,selectionEnd:v.end,onSelectionChange(e,t){j(n=>{const{start:o,end:r}=n;return o===e&&r===t?n:{start:e,end:t}})},__unstableDisableFormats:!0,preserveWhiteSpace:!0});return Object(i.createElement)(Qo,{supportKeys:"title"},Object(i.createElement)("h1",{ref:Object(d.useMergeRefs)([S,e]),contentEditable:!0,className:y,"aria-label":E,role:"textbox","aria-multiline":"true",onFocus:function(){n(!0),s()},onBlur:_,onKeyDown:function(e){e.keyCode===Po.ENTER&&(e.preventDefault(),r(void 0,void 0,0))},onKeyPress:_,onPaste:function(e){const t=e.clipboardData;let n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}window.console.log("Received HTML:\n\n",o),window.console.log("Received plain text:\n\n",n);const r=Object(a.pasteHandler)({HTML:o,plainText:n});if("string"!=typeof r&&r.length){e.preventDefault();const[t]=r;p||"core/heading"!==t.name&&"core/paragraph"!==t.name?f(r):(O(t.attributes.content),f(r.slice(1)))}}}))}var Us=Object(d.compose)([Object(l.withSelect)(e=>{const{isEditedPostNew:t,getCurrentPostId:n,getCurrentPostType:o}=e(to);return{isNew:t(),postId:n(),postType:o()}}),Object(l.withDispatch)(e=>({trashPost:e(to).trashPost}))])((function(e){let{isNew:t,postId:n,postType:o,...r}=e;return t||!n?null:Object(i.createElement)(wo.Button,{className:"editor-post-trash",isDestructive:!0,variant:"tertiary",onClick:()=>r.trashPost(n,o)},Object(Wt.__)("Move to trash"))}));var Fs=Object(l.withSelect)(e=>{const{isEditedPostNew:t,getCurrentPostId:n,getCurrentPostType:o}=e(to),{getPostType:r,canUser:s}=e(u.store),i=n(),c=r(o()),a=(null==c?void 0:c.rest_base)||"";return{isNew:t(),postId:i,canUserDelete:!(!i||!a)&&s("delete",a,i)}})((function(e){let{isNew:t,postId:n,canUserDelete:o,children:r}=e;return!t&&n&&o?r:null}));var Ms=Object(d.compose)([Object(l.withSelect)(e=>{const{getCurrentPost:t,getCurrentPostType:n}=e(to);return{hasPublishAction:Object(c.get)(t(),["_links","wp:action-publish"],!1),postType:n()}})])((function(e){let{hasPublishAction:t,render:n}=e;return n({canEdit:t})})),zs=n("FnAh"),Vs=n("7fqt");function Hs(){const e=Object(l.useSelect)(e=>e(to).getEditedPostAttribute("content"),[]),t=Object(Wt._x)("words","Word count type. Do not translate!");return Object(i.createElement)("span",{className:"word-count"},Object(Vs.count)(e,t))}function Gs(){const e=Object(l.useSelect)(e=>e(to).getEditedPostAttribute("content"),[]);return Object(Vs.count)(e,"characters_including_spaces")}var Ws=function(e){let{hasOutlineItemsDisabled:t,onRequestClose:n}=e;const{headingCount:o,paragraphCount:r,numberOfBlocks:s}=Object(l.useSelect)(e=>{const{getGlobalBlockCount:t}=e(m.store);return{headingCount:t("core/heading"),paragraphCount:t("core/paragraph"),numberOfBlocks:t()}},[]);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":Object(Wt.__)("Document Statistics"),tabIndex:"0"},Object(i.createElement)("ul",{role:"list",className:"table-of-contents__counts"},Object(i.createElement)("li",{className:"table-of-contents__count"},Object(Wt.__)("Characters"),Object(i.createElement)("span",{className:"table-of-contents__number"},Object(i.createElement)(Gs,null))),Object(i.createElement)("li",{className:"table-of-contents__count"},Object(Wt.__)("Words"),Object(i.createElement)(Hs,null)),Object(i.createElement)("li",{className:"table-of-contents__count"},Object(Wt.__)("Headings"),Object(i.createElement)("span",{className:"table-of-contents__number"},o)),Object(i.createElement)("li",{className:"table-of-contents__count"},Object(Wt.__)("Paragraphs"),Object(i.createElement)("span",{className:"table-of-contents__number"},r)),Object(i.createElement)("li",{className:"table-of-contents__count"},Object(Wt.__)("Blocks"),Object(i.createElement)("span",{className:"table-of-contents__number"},s)))),o>0&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)("hr",null),Object(i.createElement)("h2",{className:"table-of-contents__title"},Object(Wt.__)("Document Outline")),Object(i.createElement)(Oo,{onSelect:n,hasOutlineItemsDisabled:t})))};var qs=Object(i.forwardRef)((function(e,t){let{hasOutlineItemsDisabled:n,repositionDropdown:o,...r}=e;const c=Object(l.useSelect)(e=>!!e(m.store).getBlockCount(),[]);return Object(i.createElement)(wo.Dropdown,{position:o?"middle right right":"bottom",className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return Object(i.createElement)(wo.Button,Object(s.a)({},r,{ref:t,onClick:c?o:void 0,icon:zs.a,"aria-expanded":n,"aria-haspopup":"true",label:Object(Wt.__)("Details"),tooltipPosition:"bottom","aria-disabled":!c}))},renderContent:e=>{let{onClose:t}=e;return Object(i.createElement)(Ws,{onRequestClose:t,hasOutlineItemsDisabled:n})}})}));function Ks(){const e=Object(l.useSelect)(e=>()=>{const{__experimentalGetDirtyEntityRecords:t}=e(u.store);return t().length>0},[]),t=t=>{if(e())return t.returnValue=Object(Wt.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return Object(i.useEffect)(()=>(window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}),[]),null}var $s=n("diJD");var Qs=Object(d.createHigherOrderComponent)(e=>Object(l.withRegistry)(t=>{const{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return Object(i.createElement)(e,r);const[s,c]=Object(i.useState)(null);return Object(i.useEffect)(()=>{const e=Object(l.createRegistry)({"core/block-editor":m.storeConfig},o);e.registerStore("core/editor",eo),c(e)},[o]),s?Object(i.createElement)(l.RegistryProvider,{value:s},Object(i.createElement)(e,r)):null}),"withRegistryProvider"),Ys=n("6aBm");function Js(e){let{additionalData:t={},allowedTypes:n,filesList:o,maxUploadFileSize:r,onError:s=c.noop,onFileChange:i}=e;const{getCurrentPostId:a,getEditorSettings:u}=Object(l.select)(to),d=u().allowedMimeTypes;r=r||u().maxUploadFileSize,Object(Ys.uploadMedia)({allowedTypes:n,filesList:o,onFileChange:i,additionalData:{post:a(),...t},maxUploadFileSize:r,onError:e=>{let{message:t}=e;return s(t)},wpAllowedMimeTypes:d})}var Xs=function(e,t){const{reusableBlocks:n,hasUploadPermissions:o,canUseUnfilteredHTML:r,userCanCreatePages:s}=Object(l.useSelect)(e=>{const{canUserUseUnfilteredHTML:t}=e(to),n="web"===i.Platform.OS,{canUser:o,getUnstableBase:r,hasFinishedResolution:s}=e(u.store),a=r(),l=s("getUnstableBase");return{canUseUnfilteredHTML:t(),reusableBlocks:n?e(u.store).getEntityRecords("postType","wp_block",{per_page:-1}):[],hasUploadPermissions:Object(c.defaultTo)(o("create","media"),!0),hasResolvedLocalSiteData:l,baseUrl:(null==a?void 0:a.url)||"",userCanCreatePages:o("create","pages")}},[]),{undo:a}=Object(l.useDispatch)(to),{saveEntityRecord:d}=Object(l.useDispatch)(u.store),p=e=>s?d("postType","page",e):Promise.reject({message:Object(Wt.__)("You do not have permission to create Pages.")});return Object(i.useMemo)(()=>({...Object(c.pick)(e,["__experimentalBlockDirectory","__experimentalBlockPatternCategories","__experimentalBlockPatterns","__experimentalFeatures","__experimentalPreferredStyleVariations","__experimentalSetIsInserterOpened","__unstableGalleryWithImageBlocks","alignWide","allowedBlockTypes","bodyPlaceholder","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomGradients","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","focusMode","fontSizes","gradients","hasFixedToolbar","hasReducedUI","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isRTL","keepCaretInsideBlock","maxWidth","onUpdateDefaultBlockStyles","styles","template","templateLock","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock"]),mediaUpload:o?Js:void 0,__experimentalReusableBlocks:n,__experimentalFetchLinkSuggestions:(t,n)=>Object(u.__experimentalFetchLinkSuggestions)(t,n,e),__experimentalFetchRichUrlData:u.__experimentalFetchUrlData,__experimentalCanUserUseUnfilteredHTML:r,__experimentalUndo:a,outlineMode:t,__experimentalCreatePageEntity:p,__experimentalUserCanCreatePages:s}),[e,o,n,r,a,t,s])};var Zs=Qs((function(e){let{__unstableTemplate:t,post:n,settings:o,recovery:r,initialEdits:s,children:c}=e;const a=Object(i.useMemo)(()=>"wp_template"===n.type?{}:{postId:n.id,postType:n.type},[n.id,n.type]),{selection:d,isReady:p}=Object(l.useSelect)(e=>{const{getEditorSelection:t,__unstableIsEditorReady:n}=e(to);return{isReady:n(),selection:t()}},[]),{id:b,type:h}=null!=t?t:n,[g,f,O]=Object(u.useEntityBlockEditor)("postType",h,{id:b}),v=Xs(o,!!t),{updatePostLock:j,setupEditor:_,updateEditorSettings:y,__experimentalTearDownEditor:E}=Object(l.useDispatch)(to),{createWarningNotice:S}=Object(l.useDispatch)(Gt.store);return Object(i.useLayoutEffect)(()=>{if(!r)return j(o.postLock),_(n,s,o.template),o.autosave&&S(Object(Wt.__)("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:Object(Wt.__)("View the autosave"),url:o.autosave.editLink}]}),()=>{E()}},[]),Object(i.useEffect)(()=>{y(o)},[o]),p?Object(i.createElement)(u.EntityProvider,{kind:"root",type:"site"},Object(i.createElement)(u.EntityProvider,{kind:"postType",type:n.type,id:n.id},Object(i.createElement)(m.BlockContextProvider,{value:a},Object(i.createElement)(m.BlockEditorProvider,{value:g,onChange:O,onInput:f,selection:d,settings:v,useSubRegistry:!1},c,Object(i.createElement)($s.ReusableBlocksMenuItems,null))))):null})),ei=n("JREk"),ti=n.n(ei);function ni(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const o=Object(i.forwardRef)((n,o)=>(E()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e}),Object(i.createElement)(t,Object(s.a)({ref:o},n))));return n.forEach(n=>{o[n]=ni(e+"."+n,t[n])}),o}function oi(e,t){return function(){return E()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e}),t(...arguments)}}const ri=ni("RichText",m.RichText,["Content"]);ri.isEmpty=oi("RichText.isEmpty",m.RichText.isEmpty);const si=ni("Autocomplete",m.Autocomplete),ii=ni("AlignmentToolbar",m.AlignmentToolbar),ci=ni("BlockAlignmentToolbar",m.BlockAlignmentToolbar),ai=ni("BlockControls",m.BlockControls,["Slot"]),li=ni("BlockEdit",m.BlockEdit),ui=ni("BlockEditorKeyboardShortcuts",m.BlockEditorKeyboardShortcuts),di=ni("BlockFormatControls",m.BlockFormatControls,["Slot"]),pi=ni("BlockIcon",m.BlockIcon),bi=ni("BlockInspector",m.BlockInspector),mi=ni("BlockList",m.BlockList),hi=ni("BlockMover",m.BlockMover),gi=ni("BlockNavigationDropdown",m.BlockNavigationDropdown),fi=ni("BlockSelectionClearer",m.BlockSelectionClearer),Oi=ni("BlockSettingsMenu",m.BlockSettingsMenu),vi=ni("BlockTitle",m.BlockTitle),ji=ni("BlockToolbar",m.BlockToolbar),_i=ni("ColorPalette",m.ColorPalette),yi=ni("ContrastChecker",m.ContrastChecker),Ei=ni("CopyHandler",m.CopyHandler),Si=ni("DefaultBlockAppender",m.DefaultBlockAppender),wi=ni("FontSizePicker",m.FontSizePicker),Pi=ni("Inserter",m.Inserter),ki=ni("InnerBlocks",m.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),Ci=ni("InspectorAdvancedControls",m.InspectorAdvancedControls,["Slot"]),Ti=ni("InspectorControls",m.InspectorControls,["Slot"]),xi=ni("PanelColorSettings",m.PanelColorSettings),Bi=ni("PlainText",m.PlainText),Ii=ni("RichTextShortcut",m.RichTextShortcut),Ai=ni("RichTextToolbarButton",m.RichTextToolbarButton),Ri=ni("__unstableRichTextInputEvent",m.__unstableRichTextInputEvent),Ni=ni("MediaPlaceholder",m.MediaPlaceholder),Di=ni("MediaUpload",m.MediaUpload),Li=ni("MediaUploadCheck",m.MediaUploadCheck),Ui=ni("MultiSelectScrollIntoView",m.MultiSelectScrollIntoView),Fi=ni("NavigableToolbar",m.NavigableToolbar),Mi=ni("ObserveTyping",m.ObserveTyping),zi=ni("PreserveScrollInReorder",m.PreserveScrollInReorder),Vi=ni("SkipToSelectedBlock",m.SkipToSelectedBlock),Hi=ni("URLInput",m.URLInput),Gi=ni("URLInputButton",m.URLInputButton),Wi=ni("URLPopover",m.URLPopover),qi=ni("Warning",m.Warning),Ki=ni("WritingFlow",m.WritingFlow),$i=oi("createCustomColorsHOC",m.createCustomColorsHOC),Qi=oi("getColorClassName",m.getColorClassName),Yi=oi("getColorObjectByAttributeValues",m.getColorObjectByAttributeValues),Ji=oi("getColorObjectByColorValue",m.getColorObjectByColorValue),Xi=oi("getFontSize",m.getFontSize),Zi=oi("getFontSizeClass",m.getFontSizeClass),ec=oi("withColorContext",m.withColorContext),tc=oi("withColors",m.withColors),nc=oi("withFontSizes",m.withFontSizes)},RMJe:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const s=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));t.a=s},Rk8H:function(e,t,n){var o=n("jTPX");e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var s=e.nodeName,i=document.createElement(s);i.innerHTML=" ","TEXTAREA"===s.toUpperCase()&&i.setAttribute("rows","1");var c=o(e,"font-size");i.style.fontSize=c,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},RxS6:function(e,t){e.exports=window.wp.keycodes},TSYQ:function(e,t,n){var o; /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t