/*! 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,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(o()=>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 g(n[t])}}function Z(e,t){switch(t){case"content":return je(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?g(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(v.isInTheFuture)(new Date(Number(Object(v.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!je(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=>g(i[e])!==Z(t,e))))});function le(e){const t=Z(e,"date"),n=new Date(Number(Object(v.getDate)(t))-6e4);return Object(v.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 fe(e){return!!de(e)&&!!Object(c.get)(e.saving,["options","isPreview"])}function ge(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 je=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 ve(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=>(n,...o)=>(E()("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`"}),t(m.store)[e](...o)))}const Ve=ze("getBlockName"),He=ze("isBlockValid"),Ge=ze("getBlockAttributes"),We=ze("getBlock"),qe=ze("getBlocks"),Ke=ze("getClientIdsOfDescendants"),$e=ze("getClientIdsWithDescendants"),Qe=ze("getGlobalBlockCount"),Ye=ze("getBlocksByClientId"),Je=ze("getBlockCount"),Xe=ze("getBlockSelectionStart"),Ze=ze("getBlockSelectionEnd"),et=ze("getSelectedBlockCount"),tt=ze("hasSelectedBlock"),nt=ze("getSelectedBlockClientId"),ot=ze("getSelectedBlock"),rt=ze("getBlockRootClientId"),st=ze("getBlockHierarchyRootClientId"),it=ze("getAdjacentBlockClientId"),ct=ze("getPreviousBlockClientId"),at=ze("getNextBlockClientId"),lt=ze("getSelectedBlocksInitialCaretPosition"),ut=ze("getMultiSelectedBlockClientIds"),dt=ze("getMultiSelectedBlocks"),pt=ze("getFirstMultiSelectedBlockClientId"),bt=ze("getLastMultiSelectedBlockClientId"),mt=ze("isFirstMultiSelectedBlock"),ht=ze("isBlockMultiSelected"),ft=ze("isAncestorMultiSelected"),gt=ze("getMultiSelectedBlocksStartClientId"),Ot=ze("getMultiSelectedBlocksEndClientId"),jt=ze("getBlockOrder"),vt=ze("getBlockIndex"),_t=ze("isBlockSelected"),yt=ze("hasSelectedInnerBlock"),Et=ze("isBlockWithinSelection"),St=ze("hasMultiSelection"),wt=ze("isMultiSelecting"),Pt=ze("isSelectionEnabled"),kt=ze("getBlockMode"),Ct=ze("isTyping"),Tt=ze("isCaretWithinFormattedText"),xt=ze("getBlockInsertionPoint"),Bt=ze("isBlockInsertionPointVisible"),It=ze("isValidTemplate"),At=ze("getTemplate"),Rt=ze("getTemplateLock"),Nt=ze("canInsertBlockType"),Dt=ze("getInserterItems"),Lt=ze("hasInserterItems"),Ut=ze("getBlockListSettings");function Ft(e){var t;return null===(t=Ue(e))||void 0===t?void 0:t.defaultTemplateTypes}const Mt=Object(j.a)(e=>{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(j.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,t,n){yield $t(e),yield{type:"SETUP_EDITOR",post:e,edits:t,template:n},yield Xt(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 hn(r,{__unstableShouldCreateUndoLevel:!1})}t&&Object.keys(t).some(n=>t[n]!==(Object(c.has)(e,[n,"raw"])?e[n].raw:e[n]))&&(yield Zt(t))}function Kt(){return{type:"TEAR_DOWN_EDITOR"}}function $t(e){return{type:"RESET_POST",post:e}}function Qt(e={}){return{type:"REQUEST_POST_UPDATE_START",options:e}}function Yt(e={}){return{type:"REQUEST_POST_UPDATE_FINISH",options:e}}function Jt(){return E()("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function Xt(e){return{type:"SETUP_EDITOR_STATE",post:e}}function*Zt(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*en(e={}){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 Qt(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 Yt(e);const o=yield l.controls.select(u.store,"getLastEntitySaveError","postType",n.type,n.id);if(o){const e=function(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"}]}({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=function(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}]}({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*tn(){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*nn(){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*on({local:e=!1,...t}={}){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*rn(){yield l.controls.dispatch(u.store,"redo")}function*sn(){yield l.controls.dispatch(u.store,"undo")}function cn(){return{type:"CREATE_UNDO_LEVEL"}}function an(e){return{type:"UPDATE_POST_LOCK",lock:e}}function ln(){return{type:"ENABLE_PUBLISH_SIDEBAR"}}function un(){return{type:"DISABLE_PUBLISH_SIDEBAR"}}function dn(e){return{type:"LOCK_POST_SAVING",lockName:e}}function pn(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function bn(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function mn(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}function*hn(e,t={}){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=({blocks:e=[]})=>Object(a.__unstableSerializeAndClean)(e)}yield*Zt(r)}function fn(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const gn=e=>function*(...t){E()("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`"}),yield l.controls.dispatch(m.store,e,...t)},On=gn("resetBlocks"),jn=gn("receiveBlocks"),vn=gn("updateBlock"),_n=gn("updateBlockAttributes"),yn=gn("selectBlock"),En=gn("startMultiSelect"),Sn=gn("stopMultiSelect"),wn=gn("multiSelect"),Pn=gn("clearSelectedBlock"),kn=gn("toggleSelection"),Cn=gn("replaceBlocks"),Tn=gn("replaceBlock"),xn=gn("moveBlocksDown"),Bn=gn("moveBlocksUp"),In=gn("moveBlockToPosition"),An=gn("insertBlock"),Rn=gn("insertBlocks"),Nn=gn("showInsertionPoint"),Dn=gn("hideInsertionPoint"),Ln=gn("setTemplateValidity"),Un=gn("synchronizeTemplate"),Fn=gn("mergeBlocks"),Mn=gn("removeBlocks"),zn=gn("removeBlock"),Vn=gn("toggleBlockMode"),Hn=gn("startTyping"),Gn=gn("stopTyping"),Wn=gn("enterFormattedText"),qn=gn("exitFormattedText"),Kn=gn("insertDefaultBlock"),$n=gn("updateBlockListSettings");function Qn(e,t){return"wp-autosave-block-editor-post-"+(t?"auto-draft":e)}function Yn(e,t){window.sessionStorage.removeItem(Qn(e,t))}var Jn={LOCAL_AUTOSAVE_SET({postId:e,isPostNew:t,title:n,content:o,excerpt:r}){!function(e,t,n,o,r){window.sessionStorage.setItem(Qn(e,t),JSON.stringify({post_title:n,content:o,excerpt:r}))}(e,t,n,o,r)}};const Xn={reducer:O,selectors:o,actions:r,controls:{...b.controls,...Jn}},Zn=Object(l.createReduxStore)(P,{...Xn,persist:["preferences"]});Object(l.registerStore)(P,{...Xn,persist:["preferences"]});function eo(e){const t=Object(c.mapValues)(Object(c.pickBy)(e.attributes,{source:"meta"}),"meta");return Object(c.isEmpty)(t)||(e.edit=(e=>Object(d.createHigherOrderComponent)(t=>({attributes:n,setAttributes:o,...r})=>{const a=Object(l.useSelect)(e=>e(Zn).getCurrentPostType(),[]),[d,p]=Object(u.useEntityProp)("postType",a,"meta"),b=Object(i.useMemo)(()=>({...n,...Object(c.mapValues)(e,e=>d[e])}),[n,d]);return Object(i.createElement)(t,Object(s.a)({attributes:b,setAttributes:t=>{const n=Object(c.mapKeys)(Object(c.pickBy)(t,(t,n)=>e[n]),(t,n)=>e[n]);Object(c.isEmpty)(n)||p(n),o(t)}},r))},"withMetaAttributeSource"))(t)(e.edit)),e}function to(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",eo),Object(l.select)(a.store).getBlockTypes().map(({name:e})=>Object(l.select)(a.store).getBlockType(e)).forEach(eo);var no={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:to(e)})):[],[t])]},getOptionCompletion:e=>"@"+e.slug};Object(p.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(e=[]){return e.push(Object(c.clone)(no)),e}));class oo 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(e=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 ro=Object(d.compose)([Object(l.withSelect)((e,t)=>{const{getReferenceByDistinctEdits:n}=e(u.store),{isEditedPostDirty:o,isEditedPostAutosaveable:r,isAutosavingPost:s,getEditorSettings:i}=e(Zn),{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(Zn).autosave}=t;n()}}))])(oo),so=n("qRz9"),io=n("TSYQ"),co=n.n(io);var ao=({children:e,isValid:t,level:n,href:o,onSelect:r})=>Object(i.createElement)("li",{className:co()("document-outline__item","is-"+n.toLowerCase(),{"is-invalid":!t})},Object(i.createElement)("a",{href:o,className:"document-outline__button",onClick:r},Object(i.createElement)("span",{className:"document-outline__emdash","aria-hidden":"true"}),Object(i.createElement)("strong",{className:"document-outline__level"},n),Object(i.createElement)("span",{className:"document-outline__item-content"},e)));const lo=Object(i.createElement)("em",null,Object(Wt.__)("(Empty heading)")),uo=[Object(i.createElement)("br",{key:"incorrect-break"}),Object(i.createElement)("em",{key:"incorrect-message"},Object(Wt.__)("(Incorrect heading level)"))],po=[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)"))],bo=[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)"))],mo=(e=[])=>Object(c.flatMap)(e,(e={})=>"core/heading"===e.name?{...e,level:e.attributes.level,isEmpty:ho(e)}:mo(e.innerBlocks)),ho=e=>!e.attributes.content||0===e.attributes.content.length;var fo=Object(d.compose)(Object(l.withSelect)(e=>{const{getBlocks:t}=e(m.store),{getEditedPostAttribute:n}=e(Zn),{getPostType:o}=e(u.store),r=o(n("type"));return{title:n("title"),blocks:t(),isTitleSupported:Object(c.get)(r,["supports","title"],!1)}}))(({blocks:e=[],title:t,onSelect:n,isTitleSupported:o,hasOutlineItemsDisabled:r})=>{const s=mo(e);if(s.length<1)return null;let a=1;const l=document.querySelector(".editor-post-title__input"),u=o&&t&&l,d=Object(c.countBy)(s,"level")[1]>1;return Object(i.createElement)("div",{className:"document-outline"},Object(i.createElement)("ul",null,u&&Object(i.createElement)(ao,{level:Object(Wt.__)("Title"),isValid:!0,onSelect:n,href:"#"+l.id,isDisabled:r},t),s.map((e,t)=>{const o=e.level>a+1,s=!(e.isEmpty||o||!e.level||1===e.level&&(d||u));return a=e.level,Object(i.createElement)(ao,{key:t,level:"H"+e.level,isValid:s,isDisabled:r,href:"#block-"+e.clientId,onSelect:n},e.isEmpty?lo:Object(so.getTextContent)(Object(so.create)({html:e.attributes.content})),o&&uo,1===e.level&&d&&bo,u&&1===e.level&&!d&&po)})))});var go=Object(l.withSelect)(e=>({blocks:e(m.store).getBlocks()}))((function({blocks:e,children:t}){return Object(c.filter)(e,e=>"core/heading"===e.name).length<1?null:t})),Oo=n("hF7m");var jo=function({resetBlocksOnSave:e}){const{resetEditorBlocks:t,savePost:n}=Object(l.useDispatch)(Zn),{isEditedPostDirty:o,getPostEdits:r,isPostSavingLocked:s}=Object(l.useSelect)(Zn);return Object(Oo.useShortcut)("core/editor/save",i=>{if(i.preventDefault(),!s()&&o()){if(e){const e=r();if(e.content&&"string"==typeof e.content){const n=Object(a.parse)(e.content);t(n)}}n()}}),null};var vo=function(){const{redo:e,undo:t}=Object(l.useDispatch)(Zn);return Object(Oo.useShortcut)("core/editor/undo",e=>{t(),e.preventDefault()}),Object(Oo.useShortcut)("core/editor/redo",t=>{e(),t.preventDefault()}),Object(i.createElement)(jo,null)};function _o(){return Object(i.createElement)(jo,{resetBlocksOnSave:!0})}var yo=function(){const{registerShortcut:e}=Object(l.useDispatch)(Oo.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)},Eo=n("tI+e"),So=n("RxS6"),wo=n("K2cm"),Po=n("Ntru");var ko=Object(i.forwardRef)((function(e,t){const n=Object(l.useSelect)(e=>e(Zn).hasEditorRedo(),[]),{redo:o}=Object(l.useDispatch)(Zn);return Object(i.createElement)(Eo.Button,Object(s.a)({},e,{ref:t,icon:Object(Wt.isRTL)()?Po.a:wo.a,label:Object(Wt.__)("Redo"),shortcut:So.displayShortcut.primaryShift("z"),"aria-disabled":!n,onClick:n?o:void 0,className:"editor-history__redo"}))}));var Co=Object(i.forwardRef)((function(e,t){const n=Object(l.useSelect)(e=>e(Zn).hasEditorUndo(),[]),{undo:o}=Object(l.useDispatch)(Zn);return Object(i.createElement)(Eo.Button,Object(s.a)({},e,{ref:t,icon:Object(Wt.isRTL)()?wo.a:Po.a,label:Object(Wt.__)("Undo"),shortcut:So.displayShortcut.primary("z"),"aria-disabled":!n,onClick:n?o:void 0,className:"editor-history__undo"}))}));var To=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({isValid:e,...t}){return e?null:Object(i.createElement)(Eo.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:Object(Wt.__)("Keep it as is"),onClick:t.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?"))&&t.synchronizeTemplate()}}]},Object(Wt.__)("The content of your post doesn’t match the template assigned to your post type."))}));var xo=Object(d.compose)([Object(l.withSelect)(e=>({notices:e(Gt.store).getNotices()})),Object(l.withDispatch)(e=>({onRemove:e(Gt.store).removeNotice}))])((function({notices:e,onRemove:t}){const n=Object(c.filter)(e,{isDismissible:!0,type:"default"}),o=Object(c.filter)(e,{isDismissible:!1,type:"default"});return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Eo.NoticeList,{notices:o,className:"components-editor-notices__pinned"}),Object(i.createElement)(Eo.NoticeList,{notices:n,className:"components-editor-notices__dismissible",onRemove:t},Object(i.createElement)(To,null)))}));function Bo(){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)(Eo.SnackbarList,{notices:n,className:"components-editor-notices__snackbar",onRemove:t})}var Io=n("w95h");function Ao({record:e,checked:t,onChange:n,closePanel:o}){const{name:r,kind:s,title:c,key:a}=e,d=Object(l.useSelect)(e=>{var t;const{blocks:n=[]}=e(u.store).getEditedEntityRecord(s,r,a),o=e(m.store).getBlockParents(null===(t=n[0])||void 0===t?void 0:t.clientId);return o[o.length-1]},[]),p=Object(l.useSelect)(e=>{if("postType"!==s||"wp_template"!==r)return c;const t=e(u.store).getEditedEntityRecord(s,r,a);return e(Zn).__experimentalGetTemplateInfo(t).title},[r,s,c,a]),b=Object(l.useSelect)(e=>e(m.store).getSelectedBlockClientId()===d,[d]),h=b?Object(Wt.__)("Selected"):Object(Wt.__)("Select"),{selectBlock:f}=Object(l.useDispatch)(m.store),g=Object(i.useCallback)(()=>f(d),[d]),O=Object(i.useCallback)(()=>{f(d),o()},[d]);return Object(i.createElement)(Eo.PanelRow,null,Object(i.createElement)(Eo.CheckboxControl,{label:Object(i.createElement)("strong",null,p||Object(Wt.__)("Untitled")),checked:t,onChange:n}),d?Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Eo.Button,{onClick:g,className:"entities-saved-states__find-entity",disabled:b},h),Object(i.createElement)(Eo.Button,{onClick:O,className:"entities-saved-states__find-entity-small",disabled:b},h)):null)}function Ro({list:e,unselectedEntities:t,setUnselectedEntities:n,closePanel:o}){const r=e[0],s=Object(l.useSelect)(e=>e(u.store).getEntity(r.kind,r.name),[r.kind,r.name]),{name:a}=r,d="wp_template_part"===a?Object(Wt._n)("Template Part","Template Parts",e.length):s.label,p=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.")}}(a,e.length);return Object(i.createElement)(Eo.PanelBody,{title:d,initialOpen:!0},p&&Object(i.createElement)(Eo.PanelRow,null,p),e.map(e=>Object(i.createElement)(Ao,{key:e.key||e.property,record:e,checked:!Object(c.some)(t,t=>t.kind===e.kind&&t.name===e.name&&t.key===e.key&&t.property===e.property),onChange:t=>n(e,t),closePanel:o})))}const No={title:Object(Wt.__)("Title"),description:Object(Wt.__)("Tagline"),site_logo:Object(Wt.__)("Logo"),show_on_front:Object(Wt.__)("Show on front"),page_on_front:Object(Wt.__)("Page on front")},Do=[{kind:"postType",name:"wp_navigation"}];function Lo({close:e}){const t=Object(i.useRef)(),{dirtyEntityRecords:n}=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:No[e]||e,property:e});return{dirtyEntityRecords:[...t,...o]}},[]),{editEntityRecord:o,saveEditedEntityRecord:r,__experimentalSaveSpecifiedEntityEdits:a}=Object(l.useDispatch)(u.store),p=Object(c.groupBy)(n,"name"),{site:b,wp_template:m,wp_template_part:h,...f}=p,g=[b,m,h,...Object.values(f)].filter(Array.isArray),[O,j]=Object(i.useState)([]),v=({kind:e,name:t,key:n,property:o},r)=>{j(r?O.filter(r=>r.kind!==e||r.name!==t||r.key!==n||r.property!==o):[...O,{kind:e,name:t,key:n,property:o}])},_=Object(i.useCallback)(()=>e(),[e]),[y,E]=Object(d.__experimentalUseDialog)({onClose:()=>_()});return Object(i.createElement)("div",Object(s.a)({ref:y},E,{className:"entities-saved-states__panel"}),Object(i.createElement)("div",{className:"entities-saved-states__panel-header"},Object(i.createElement)(Eo.Button,{ref:t,variant:"primary",disabled:n.length-O.length==0,onClick:()=>{const t=n.filter(({kind:e,name:t,key:n,property:o})=>!Object(c.some)(O,r=>r.kind===e&&r.name===t&&r.key===n&&r.property===o));e(t);const s=[];t.forEach(({kind:e,name:t,key:n,property:i})=>{"root"===e&&"site"===t?s.push(i):(Do.some(n=>n.kind===e&&n.name===t)&&o(e,t,n,{status:"publish"}),r(e,t,n))}),a("root","site",void 0,s)},className:"editor-entities-saved-states__save-button"},Object(Wt.__)("Save")),Object(i.createElement)(Eo.Button,{icon:Io.a,onClick:_,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."))),g.map(e=>Object(i.createElement)(Ro,{key:e[0].name,list:e,closePanel:_,unselectedEntities:O,setUnselectedEntities:v})))}function Uo({text:e,children:t}){const n=Object(d.useCopyToClipboard)(e);return Object(i.createElement)(Eo.Button,{variant:"secondary",ref:n},t)}class Fo 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)(Zn).getEditedPostContent()}catch(e){}}render(){const{error:e}=this.state;return e?Object(i.createElement)(m.Warning,{className:"editor-error-boundary",actions:[Object(i.createElement)(Eo.Button,{key:"recovery",onClick:this.reboot,variant:"secondary"},Object(Wt.__)("Attempt Recovery")),Object(i.createElement)(Uo,{key:"copy-post",text:this.getContent},Object(Wt.__)("Copy Post Text")),Object(i.createElement)(Uo,{key:"copy-error",text:e.stack},Object(Wt.__)("Copy Error"))]},Object(Wt.__)("The editor has encountered an unexpected error.")):this.props.children}}var Mo=Fo;const zo=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame,Vo=Object(c.once)(()=>{try{return window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),!0}catch(e){return!1}});function Ho(){const{postId:e,isEditedPostNew:t,hasRemoteAutosave:n}=Object(l.useSelect)(e=>({postId:e(Zn).getCurrentPostId(),isEditedPostNew:e(Zn).isEditedPostNew(),hasRemoteAutosave:!!e(Zn).getEditorSettings().autosave}),[]),{getEditedPostAttribute:o}=Object(l.useSelect)(Zn),{createWarningNotice:r,removeNotice:s}=Object(l.useDispatch)(Gt.store),{editPost:u,resetEditorBlocks:d}=Object(l.useDispatch)(Zn);Object(i.useEffect)(()=>{let i=function(e,t){return window.sessionStorage.getItem(Qn(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 Yn(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 Go=Object(d.ifCondition)(Vo)((function(){const{autosave:e}=Object(l.useDispatch)(Zn),t=Object(i.useCallback)(()=>{zo(()=>e({local:!0}))},[]);Ho(),function(){const{postId:e,isEditedPostNew:t,isDirty:n,isAutosaving:o,didError:r}=Object(l.useSelect)(e=>({postId:e(Zn).getCurrentPostId(),isEditedPostNew:e(Zn).isEditedPostNew(),isDirty:e(Zn).isEditedPostDirty(),isAutosaving:e(Zn).isAutosavingPost(),didError:e(Zn).didPostSaveRequestFail()}),[]),s=Object(i.useRef)(n),c=Object(i.useRef)(o);Object(i.useEffect)(()=>{!r&&(c.current&&!o||s.current&&!n)&&Yn(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&&Yn(e,!0)},[t,e])}();const{localAutosaveInterval:n}=Object(l.useSelect)(e=>({localAutosaveInterval:e(Zn).getEditorSettings().__experimentalLocalAutosaveInterval}),[]);return Object(i.createElement)(ro,{interval:n,autosave:t})}));var Wo=function({children:e}){const t=Object(l.useSelect)(e=>{const{getEditedPostAttribute:t}=e(Zn),{getPostType:n}=e(u.store);return n(t("type"))},[]);return Object(c.get)(t,["supports","page-attributes"],!1)?e:null};var qo=Object(l.withSelect)(e=>{const{getEditedPostAttribute:t}=e(Zn),{getPostType:n}=e(u.store);return{postType:n(t("type"))}})((function({postType:e,children:t,supportKeys:n}){let o=!0;return e&&(o=Object(c.some)(Object(c.castArray)(n),t=>!!e.supports[t])),o?t:null}));const Ko=({onUpdateOrder:e,order:t=0})=>{const[n,o]=Object(i.useState)(null),r=null===n?t:n;return Object(i.createElement)(Eo.TextControl,{className:"editor-page-attributes__order",type:"number",label:Object(Wt.__)("Order"),value:r,onChange:t=>{o(t);const n=Number(t);Number.isInteger(n)&&""!==Object(c.invoke)(t,["trim"])&&e(Number(t))},size:6,onBlur:()=>{o(null)}})};var $o=Object(d.compose)([Object(l.withSelect)(e=>({order:e(Zn).getEditedPostAttribute("menu_order")})),Object(l.withDispatch)(e=>({onUpdateOrder(t){e(Zn).editPost({menu_order:t})}}))])((function(e){return Object(i.createElement)(qo,{supportKeys:"page-attributes"},Object(i.createElement)(Ko,e))})),Qo=n("rmEH");function Yo(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 Jo=e=>Object(c.unescape)(e.replace("'","'")),Xo=e=>({...e,name:Jo(e.name)}),Zo=e=>Object(c.map)(e,Xo);function er(e){var t;return null!=e&&null!==(t=e.title)&&void 0!==t&&t.rendered?Object(Qo.decodeEntities)(e.title.rendered):`#${e.id} (${Object(Wt.__)("no title")})`}const tr=(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 nr=function(){const{editPost:e}=Object(l.useDispatch)(Zn),[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(Zn),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=(n,o=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)]).sort(([e],[n])=>tr(e.rawName,t)>=tr(n.rawName,t)?1:-1);return Object(c.flatten)(r)};let n=b.map(e=>({id:e.id,parent:e.parent,name:er(e)}));t||(n=Yo(n));const s=e(n),i=Object(c.find)(s,e=>e.value===r);return o&&!i&&s.unshift({value:r,label:er(o)}),s},[b,t]);return d&&p?Object(i.createElement)(Eo.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 or=function({}){const{availableTemplates:e,selectedTemplate:t,isViewable:n}=Object(l.useSelect)(e=>{var t,n;const{getEditedPostAttribute:o,getEditorSettings:r,getCurrentPostType:s}=e(Zn),{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:o}=Object(l.useDispatch)(Zn);return!n||Object(c.isEmpty)(e)?null:Object(i.createElement)(Eo.SelectControl,{label:Object(Wt.__)("Template:"),value:t,onChange:e=>{o({template:e||""})},options:Object(c.map)(e,(e,t)=>({value:t,label:e}))})};const rr={who:"authors",per_page:50,_fields:"id,name",context:"view"};var sr=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(Zn),i=n(s("author"),{context:"view"}),c={...rr};return e&&(c.search=e),{authorId:s("author"),postAuthor:i,authors:o(c),isLoading:r("core","getUsers",[c])}},[e]),{editPost:a}=Object(l.useDispatch)(Zn),d=Object(i.useMemo)(()=>{const e=(null!=r?r:[]).map(e=>({value:e.id,label:Object(Qo.decodeEntities)(e.name)}));return e.findIndex(({value:e})=>(null==s?void 0:s.id)===e)<0&&s?[{value:s.id,label:Object(Qo.decodeEntities)(s.name)},...e]:e},[r,s]);return s?Object(i.createElement)(Eo.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 ir=function(){const{editPost:e}=Object(l.useDispatch)(Zn),{postAuthor:t,authors:n}=Object(l.useSelect)(e=>({postAuthor:e(Zn).getEditedPostAttribute("author"),authors:e(u.store).getUsers(rr)}),[]),o=Object(i.useMemo)(()=>(null!=n?n:[]).map(e=>({value:e.id,label:Object(Qo.decodeEntities)(e.name)})),[n]);return Object(i.createElement)(Eo.SelectControl,{className:"post-author-selector",label:Object(Wt.__)("Author"),options:o,onChange:t=>{const n=Number(t);e({author:n})},value:t})};var cr=function(){return Object(l.useSelect)(e=>{const t=e(u.store).getUsers(rr);return(null==t?void 0:t.length)>=25},[])?Object(i.createElement)(sr,null):Object(i.createElement)(ir,null)};function ar({children:e}){const{hasAssignAuthorAction:t,hasAuthors:n}=Object(l.useSelect)(e=>{const t=e(Zn).getCurrentPost(),n=e(u.store).getUsers(rr);return{hasAssignAuthorAction:Object(c.get)(t,["_links","wp:action-assign-author"],!1),hasAuthors:(null==n?void 0:n.length)>=1}},[]);return t&&n?Object(i.createElement)(qo,{supportKeys:"author"},e):null}var lr=Object(d.compose)([Object(l.withSelect)(e=>({commentStatus:e(Zn).getEditedPostAttribute("comment_status")})),Object(l.withDispatch)(e=>({editPost:e(Zn).editPost}))])((function({commentStatus:e="open",...t}){return Object(i.createElement)(Eo.CheckboxControl,{label:Object(Wt.__)("Allow comments"),checked:"open"===e,onChange:()=>t.editPost({comment_status:"open"===e?"closed":"open"})})}));var ur=Object(d.compose)([Object(l.withSelect)(e=>({excerpt:e(Zn).getEditedPostAttribute("excerpt")})),Object(l.withDispatch)(e=>({onUpdateExcerpt(t){e(Zn).editPost({excerpt:t})}}))])((function({excerpt:e,onUpdateExcerpt:t}){return Object(i.createElement)("div",{className:"editor-post-excerpt"},Object(i.createElement)(Eo.TextareaControl,{label:Object(Wt.__)("Write an excerpt (optional)"),className:"editor-post-excerpt__textarea",onChange:e=>t(e),value:e}),Object(i.createElement)(Eo.ExternalLink,{href:Object(Wt.__)("https://wordpress.org/support/article/excerpt/")},Object(Wt.__)("Learn more about manual excerpts")))}));var dr=function(e){return Object(i.createElement)(qo,Object(s.a)({},e,{supportKeys:"excerpt"}))};var pr=Object(l.withSelect)(e=>{const{getThemeSupports:t}=e(u.store),{getEditedPostAttribute:n}=e(Zn);return{postType:n("type"),themeSupports:t()}})((function({themeSupports:e,children:t,postType:n,supportKeys:o}){return Object(c.some)(Object(c.castArray)(o),t=>{const o=Object(c.get)(e,[t],!1);return"post-thumbnails"===t&&Object(c.isArray)(o)?Object(c.includes)(o,n):o})?t:null}));var br=function(e){return Object(i.createElement)(pr,{supportKeys:"post-thumbnails"},Object(i.createElement)(qo,Object(s.a)({},e,{supportKeys:"thumbnail"})))};const mr=["image"],hr=Object(Wt.__)("Featured image"),fr=Object(Wt.__)("Set featured image"),gr=Object(Wt.__)("Remove image");const Or=Object(l.withSelect)(e=>{const{getMedia:t,getPostType:n}=e(u.store),{getCurrentPostId:o,getEditedPostAttribute:r}=e(Zn),s=r("featured_media");return{media:s?t(s,{context:"view"}):null,currentPostId:o(),postType:n(r("type")),featuredImageId:s}}),jr=Object(l.withDispatch)((e,{noticeOperations:t},{select:n})=>{const{editPost:o}=e(Zn);return{onUpdateImage(e){o({featured_media:e.id})},onDropImage(e){n(m.store).getSettings().mediaUpload({allowedTypes:["image"],filesList:e,onFileChange([e]){o({featured_media:e.id})},onError(e){t.removeAllNotices(),t.createErrorNotice(e)}})},onRemoveImage(){o({featured_media:0})}}});var vr=Object(d.compose)(Eo.withNotices,Or,jr,Object(Eo.withFilters)("editor.PostFeaturedImage"))((function({currentPostId:e,featuredImageId:t,onUpdateImage:n,onDropImage:o,onRemoveImage:r,media:s,postType:a,noticeUI:l}){var u,d;const b=Object(c.get)(a,["labels"],{}),h=Object(i.createElement)("p",null,Object(Wt.__)("To edit the featured image, you need permission to upload media."));let f,g,O;if(s){const t=Object(p.applyFilters)("editor.PostFeaturedImage.imageSize","post-thumbnail",s.id,e);if(Object(c.has)(s,["media_details","sizes",t]))f=s.media_details.sizes[t].width,g=s.media_details.sizes[t].height,O=s.media_details.sizes[t].source_url;else{const t=Object(p.applyFilters)("editor.PostFeaturedImage.imageSize","thumbnail",s.id,e);Object(c.has)(s,["media_details","sizes",t])?(f=s.media_details.sizes[t].width,g=s.media_details.sizes[t].height,O=s.media_details.sizes[t].source_url):(f=s.media_details.width,g=s.media_details.height,O=s.source_url)}}return Object(i.createElement)(br,null,l,Object(i.createElement)("div",{className:"editor-post-featured-image"},s&&Object(i.createElement)("div",{id:`editor-post-featured-image-${t}-describedby`,className:"hidden"},s.alt_text&&Object(Wt.sprintf)(Object(Wt.__)("Current image: %s"),s.alt_text),!s.alt_text&&Object(Wt.sprintf)(Object(Wt.__)("The current image has no alternative text. The file name is: %s"),(null===(u=s.media_details.sizes)||void 0===u||null===(d=u.full)||void 0===d?void 0:d.file)||s.slug)),Object(i.createElement)(m.MediaUploadCheck,{fallback:h},Object(i.createElement)(m.MediaUpload,{title:b.featured_image||hr,onSelect:n,unstableFeaturedImageFlow:!0,allowedTypes:mr,modalClass:"editor-post-featured-image__media-modal",render:({open:e})=>Object(i.createElement)("div",{className:"editor-post-featured-image__container"},Object(i.createElement)(Eo.Button,{className:t?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:e,"aria-label":t?Object(Wt.__)("Edit or update the image"):null,"aria-describedby":t?`editor-post-featured-image-${t}-describedby`:null},!!t&&s&&Object(i.createElement)(Eo.ResponsiveWrapper,{naturalWidth:f,naturalHeight:g,isInline:!0},Object(i.createElement)("img",{src:O,alt:""})),!!t&&!s&&Object(i.createElement)(Eo.Spinner,null),!t&&(b.set_featured_image||fr)),Object(i.createElement)(Eo.DropZone,{onFilesDrop:o})),value:t})),!!t&&s&&!s.isLoading&&Object(i.createElement)(m.MediaUploadCheck,null,Object(i.createElement)(m.MediaUpload,{title:b.featured_image||hr,onSelect:n,unstableFeaturedImageFlow:!0,allowedTypes:mr,modalClass:"editor-post-featured-image__media-modal",render:({open:e})=>Object(i.createElement)(Eo.Button,{onClick:e,variant:"secondary"},Object(Wt.__)("Replace Image"))})),!!t&&Object(i.createElement)(m.MediaUploadCheck,null,Object(i.createElement)(Eo.Button,{onClick:r,variant:"link",isDestructive:!0},b.remove_featured_image||gr))))}));var _r=Object(l.withSelect)(e=>({disablePostFormats:e(Zn).getEditorSettings().disablePostFormats}))((function({disablePostFormats:e,...t}){return!e&&Object(i.createElement)(qo,Object(s.a)({},t,{supportKeys:"post-formats"}))}));const yr=[{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 Er(){const e="post-format-selector-"+Object(d.useInstanceId)(Er),{postFormat:t,suggestedFormat:n,supportedFormats:o}=Object(l.useSelect)(e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:n}=e(Zn),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=yr.filter(e=>Object(c.includes)(o,e.id)),s=Object(c.find)(r,e=>e.id===n),{editPost:a}=Object(l.useDispatch)(Zn),p=e=>a({format:e});return Object(i.createElement)(_r,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)(Eo.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)(Eo.Button,{variant:"link",onClick:()=>p(s.id)},Object(Wt.sprintf)(Object(Wt.__)("Apply format: %s"),s.caption)))))}var Sr=n("Tqx9");var wr=Object(i.createElement)(Sr.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(Sr.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 Pr=Object(l.withSelect)(e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(Zn);return{lastRevisionId:t(),revisionsCount:n()}})((function({lastRevisionId:e,revisionsCount:t,children:n}){return!e||t<2?null:Object(i.createElement)(qo,{supportKeys:"revisions"},n)}));var kr=Object(l.withSelect)(e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(Zn);return{lastRevisionId:t(),revisionsCount:n()}})((function({lastRevisionId:e,revisionsCount:t}){return Object(i.createElement)(Pr,null,Object(i.createElement)(Eo.Button,{href:T("revision.php",{revision:e,gutenberg:!0}),className:"editor-post-last-revision__title",icon:wr},Object(Wt.sprintf)(Object(Wt._n)("%d Revision","%d Revisions",t),t)))}));class Cr 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)(Eo.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96"},Object(i.createElement)(Eo.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)(Eo.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=co()({"editor-post-preview":!this.props.className},this.props.className);return Object(i.createElement)(Eo.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)(Eo.VisuallyHidden,{as:"span"},Object(Wt.__)("(opens in a new tab)"))))}}var Tr=Object(d.compose)([Object(l.withSelect)((e,{forcePreviewLink:t,forceIsAutosaveable:n})=>{const{getCurrentPostId:o,getCurrentPostAttribute:r,getEditedPostAttribute:s,isEditedPostSaveable:i,isEditedPostAutosaveable:a,getEditedPostPreviewLink:l,isPostLocked:d}=e(Zn),{getPostType:p}=e(u.store),b=l(),m=p(s("type"));return{postId:o(),currentPostLink:r("link"),previewLink:void 0!==t?t:b,isSaveable:i(),isAutosaveable:n||a(),isViewable:Object(c.get)(m,["viewable"],!1),isDraft:-1!==["draft","auto-draft"].indexOf(s("status")),isPostLocked:d()}}),Object(l.withDispatch)(e=>({autosave:e(Zn).autosave,savePost:e(Zn).savePost})),Object(d.ifCondition)(({isViewable:e})=>e)])(Cr);function xr(){const e="core/editor/post-locked-modal-"+Object(d.useInstanceId)(xr),{autosave:t,updatePostLock:n}=Object(l.useDispatch)(Zn),{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(Zn),{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 f=s.name,g=s.avatar,O=Object(_.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:a,action:"edit",_wpnonce:b.nonce}),j=T("edit.php",{post_type:Object(c.get)(h,["slug"])}),v=Object(Wt.__)("Exit the Editor");return Object(i.createElement)(Eo.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"},!!g&&Object(i.createElement)("img",{src:g,alt:Object(Wt.__)("Avatar"),className:"editor-post-locked-modal__avatar"}),!!r&&Object(i.createElement)("div",null,Object(i.createElement)("div",null,f?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."),f):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)(Eo.Button,{variant:"primary",href:j},v))),!r&&Object(i.createElement)("div",null,Object(i.createElement)("div",null,f?Object(Wt.sprintf)(Object(Wt.__)("%s is currently working on this post, which means you cannot make changes, unless you take over."),f):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)(Eo.Button,{variant:"secondary",href:j},v),Object(i.createElement)(Tr,null),Object(i.createElement)(Eo.Button,{variant:"primary",href:O},Object(Wt.__)("Take Over")))))}var Br=Object(d.compose)(Object(l.withSelect)(e=>{const{isCurrentPostPublished:t,getCurrentPostType:n,getCurrentPost:o}=e(Zn);return{hasPublishAction:Object(c.get)(o(),["_links","wp:action-publish"],!1),isPublished:t(),postType:n()}}))((function({hasPublishAction:e,isPublished:t,children:n}){return t||!e?null:n}));var Ir=Object(d.compose)(Object(l.withSelect)(e=>({status:e(Zn).getEditedPostAttribute("status")})),Object(l.withDispatch)(e=>({onUpdateStatus(t){e(Zn).editPost({status:t})}})))((function({status:e,onUpdateStatus:t}){return Object(i.createElement)(Br,null,Object(i.createElement)(Eo.CheckboxControl,{label:Object(Wt.__)("Pending review"),checked:"pending"===e,onChange:()=>{t("pending"===e?"draft":"pending")}}))}));var Ar=Object(d.compose)([Object(l.withSelect)(e=>({pingStatus:e(Zn).getEditedPostAttribute("ping_status")})),Object(l.withDispatch)(e=>({editPost:e(Zn).editPost}))])((function({pingStatus:e="open",...t}){return Object(i.createElement)(Eo.CheckboxControl,{label:Object(Wt.__)("Allow pingbacks & trackbacks"),checked:"open"===e,onChange:()=>t.editPost({ping_status:"open"===e?"closed":"open"})})}));var Rr=Object(d.compose)([Object(l.withSelect)((e,{forceIsSaving:t})=>{const{isCurrentPostPublished:n,isEditedPostBeingScheduled:o,isSavingPost:r,isPublishingPost:s,getCurrentPost:i,getCurrentPostType:a,isAutosavingPost:l}=e(Zn);return{isPublished:n(),isBeingScheduled:o(),isSaving:t||r(),isPublishing:s(),hasPublishAction:Object(c.get)(i(),["_links","wp:action-publish"],!1),postType:a(),isAutosaving:l()}})])((function({isPublished:e,isBeingScheduled:t,isSaving:n,isPublishing:o,hasPublishAction:r,isAutosaving:s,hasNonPostEntityChanges:i}){return o?Object(Wt.__)("Publishing…"):e&&n&&!s?Object(Wt.__)("Updating…"):t&&n&&!s?Object(Wt.__)("Scheduling…"):r?e?i?Object(Wt.__)("Update…"):Object(Wt.__)("Update"):t?i?Object(Wt.__)("Schedule…"):Object(Wt.__)("Schedule"):Object(Wt.__)("Publish"):i?Object(Wt.__)("Submit for Review…"):Object(Wt.__)("Submit for Review")}));class Nr 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){return(...t)=>{const{hasNonPostEntityChanges:n}=this.props;return n?(this.setState({entitiesSavedStatesCallback:()=>e(...t)}),this.props.setEntitiesSavedStatesCallback(()=>this.closeEntitiesSavedStates),c.noop):e(...t)}}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:f,onSubmit:g=c.noop,onToggle:O,visibility:j,hasNonPostEntityChanges:v,isSavingNonPostEntityChanges:_}=this.props,y=(p||t||!d||a||!l&&!e)&&(!v||_),E=(u||p||t||!d||!l&&!e)&&(!v||_);let S;S=n?"private"===j?"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||(g(),f(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)(Rr,{forceIsSaving:t,hasNonPostEntityChanges:v}),T=m?P:w,x=m?k:C;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Eo.Button,Object(s.a)({ref:this.buttonNode},T,{className:co()(T.className,"editor-post-publish-button__button",{"has-changes-dot":v})}),x))}}var Dr=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(Zn),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(Zn);return{onStatusChange:e=>t({status:e},{undoIgnore:!0}),onSave:n}})])(Nr),Lr=n("bWcr"),Ur=n("wduq");const Fr=[{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 Mr 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")),Fr.map(({value:e,label:t,info:r})=>Object(i.createElement)("div",{key:e,className:"editor-post-visibility__choice"},Object(i.createElement)("input",{type:"radio",name:"editor-post-visibility__setting-"+n,value:e,onChange:o[e].onSelect,checked:o[e].checked,id:`editor-post-${e}-${n}`,"aria-describedby":`editor-post-${e}-${n}-description`,className:"editor-post-visibility__dialog-radio"}),Object(i.createElement)("label",{htmlFor:`editor-post-${e}-${n}`,className:"editor-post-visibility__dialog-label"},t),Object(i.createElement)("p",{id:`editor-post-${e}-${n}-description`,className:"editor-post-visibility__dialog-info"},r)))),this.state.hasPassword&&Object(i.createElement)("div",{className:"editor-post-visibility__dialog-password",key:"password-selector"},Object(i.createElement)(Eo.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 zr=Object(d.compose)([Object(l.withSelect)(e=>{const{getEditedPostAttribute:t,getEditedPostVisibility:n}=e(Zn);return{status:t("status"),visibility:n(),password:t("password")}}),Object(l.withDispatch)(e=>{const{savePost:t,editPost:n}=e(Zn);return{onSave:t,onUpdateVisibility(e,t=""){n({status:e,password:t})}}}),d.withInstanceId])(Mr);var Vr=Object(l.withSelect)(e=>({visibility:e(Zn).getEditedPostVisibility()}))((function({visibility:e}){return Object(c.find)(Fr,{value:e}).label}));function Hr(e=new Date,t=!0){const n=new Date(e);return new Date(n.getFullYear(),n.getMonth()+(t?0:1),t?1:0).toISOString()}function Gr(){const{postDate:e,postType:t}=Object(l.useSelect)(e=>({postDate:e(Zn).getEditedPostAttribute("date"),postType:e(Zn).getCurrentPostType()}),[]),{editPost:n}=Object(l.useDispatch)(Zn),[o,r]=Object(i.useState)(Hr(e)),s=Object(l.useSelect)(e=>e(u.store).getEntityRecords("postType",t,{status:"publish,future",after:Hr(o),before:Hr(o,!1),exclude:[e(Zn).getCurrentPostId()]}),[o,t]),c=Object(i.useMemo)(()=>(s||[]).map(({title:e,type:t,date:n})=>({title:null==e?void 0:e.rendered,type:t,date:new Date(n)})),[s]),a=Object(i.useRef)(),d=Object(v.__experimentalGetSettings)(),p=/a(?!\\)/i.test(d.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return Object(i.createElement)(Eo.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 Wr=Object(l.withSelect)(e=>({date:e(Zn).getEditedPostAttribute("date"),isFloating:e(Zn).isEditedPostDateFloating()}))((function({date:e,isFloating:t}){const n=Object(v.__experimentalGetSettings)();return e&&!t?Object(v.format)(`${n.formats.date} ${n.formats.time}`,e):Object(Wt.__)("Immediately")})),qr=n("ywyh"),Kr=n.n(qr),$r=n("gdqT");const Qr={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function Yr({onSelect:e,taxonomy:t}){const{_terms:n,showTerms:o}=Object(l.useSelect)(e=>{const n=e(u.store).getEntityRecords("taxonomy",t.slug,Qr);return{_terms:n,showTerms:10===(null==n?void 0:n.length)}},[]);if(!o)return null;const r=Zo(n),s=Object(c.get)(t,["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"},s),Object(i.createElement)("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list"},r.map(t=>Object(i.createElement)("li",{key:t.id},Object(i.createElement)(Eo.Button,{variant:"link",onClick:()=>e(t)},t.name)))))}const Jr=[],Xr={per_page:20,orderby:"count",order:"desc",_fields:"id,name",context:"view"},Zr=(e,t)=>Jo(e).toLowerCase()===Jo(t).toLowerCase(),es=(e,t)=>e.map(e=>Object(c.find)(t,t=>Zr(t.name,e)).id);var ts=Object(Eo.withFilters)("editor.PostTaxonomyType")((function({slug:e}){const[t,n]=Object(i.useState)([]),[o,r]=Object(i.useState)(""),s=Object(d.useDebounce)(r,500),{terms:a,termIds:p,taxonomy:b,hasAssignAction:m,hasCreateAction:h,hasResolvedTerms:f}=Object(l.useSelect)(t=>{const{getCurrentPost:n,getEditedPostAttribute:o}=t(Zn),{getEntityRecords:r,getTaxonomy:s,hasFinishedResolution:i}=t(u.store),a=n(),l=s(e),d=l?o(l.rest_base):Jr,p={...Xr,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",e,p):Jr,hasResolvedTerms:i("getEntityRecords",["taxonomy",e,p])}},[e]),{searchResults:g}=Object(l.useSelect)(t=>{const{getEntityRecords:n}=t(u.store);return{searchResults:o?n("taxonomy",e,{...Xr,search:o}):Jr}},[o]);Object(i.useEffect)(()=>{if(f){const e=a.map(e=>Jo(e.name));n(e)}},[a,f]);const O=Object(i.useMemo)(()=>(null!=g?g:[]).map(e=>Jo(e.name)),[g]),{editPost:j}=Object(l.useDispatch)(Zn);if(!m)return null;function v(e){j({[b.rest_base]:e})}const y=Object(c.get)(b,["labels","add_new_item"],"post_tag"===e?Object(Wt.__)("Add new tag"):Object(Wt.__)("Add new Term")),E=Object(c.get)(b,["labels","singular_name"],"post_tag"===e?Object(Wt.__)("Tag"):Object(Wt.__)("Term")),S=Object(Wt.sprintf)(Object(Wt._x)("%s added","term"),E),w=Object(Wt.sprintf)(Object(Wt._x)("%s removed","term"),E),P=Object(Wt.sprintf)(Object(Wt._x)("Remove %s","term"),E);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Eo.FormTokenField,{value:t,suggestions:O,onChange:function(e){const t=[...a,...null!=g?g:[]],o=Object(c.uniqBy)(e,e=>e.toLowerCase()),r=o.filter(e=>!Object(c.find)(t,t=>Zr(t.name,e)));if(n(o),0===r.length)return v(es(o,t));h&&Promise.all(r.map(e=>function(e,t){const n=Object(c.escape)(e);return Kr()({path:"/wp/v2/"+t,method:"POST",data:{name:n}}).catch(o=>{if("term_exists"===o.code){return Kr()({path:Object(_.addQueryArgs)("/wp/v2/"+t,{...Xr,search:n})}).then(Zo).then(t=>Object(c.find)(t,t=>Zr(t.name,e)))}return Promise.reject(o)}).then(Xo)}(e,b.rest_base))).then(e=>{const n=t.concat(e);return v(es(o,n))})},onInputChange:s,maxSuggestions:20,label:y,messages:{added:S,removed:w,remove:P}}),Object(i.createElement)(Yr,{taxonomy:b,onSelect:function(t){if(p.includes(t.id))return;const n=[...p,t.id],o=Object(Wt.sprintf)(Object(Wt._x)("%s added","term"),Object(c.get)(b,["labels","singular_name"],"post_tag"===e?Object(Wt.__)("Tag"):Object(Wt.__)("Term")));Object($r.speak)(o,"assertive"),v(n)}}))}));const ns=()=>{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)(Eo.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)(ts,{slug:"post_tag"}))};class os extends i.Component{constructor(e){super(e),this.state={hadTagsWhenOpeningThePanel:e.hasTags}}render(){return this.state.hadTagsWhenOpeningThePanel?null:Object(i.createElement)(ns,null)}}var rs=Object(d.compose)(Object(l.withSelect)(e=>{const t=e(Zn).getCurrentPostType(),n=e(u.store).getTaxonomy("post_tag"),o=n&&e(Zn).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)(({areTagsFetched:e,isPostTypeSupported:t})=>t&&e))(os);const ss=(e,t)=>{const n=yr.filter(t=>Object(c.includes)(e,t.id));return Object(c.find)(n,e=>e.id===t)},is=({suggestedPostFormat:e,suggestionText:t,onUpdatePostFormat:n})=>Object(i.createElement)(Eo.Button,{variant:"link",onClick:()=>n(e)},t);function cs(){const{currentPostFormat:e,suggestion:t}=Object(l.useSelect)(e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:n}=e(Zn),o=Object(c.get)(e(u.store).getThemeSupports(),["formats"],[]);return{currentPostFormat:t("format"),suggestion:ss(o,n())}},[]),{editPost:n}=Object(l.useDispatch)(Zn),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)(Eo.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)(is,{onUpdatePostFormat:e=>n({format:e}),suggestedPostFormat:t.id,suggestionText:Object(Wt.sprintf)(Object(Wt.__)('Apply the "%1$s" format.'),t.caption)}))):null}var as=function({children:e}){const{isBeingScheduled:t,isRequestingSiteIcon:n,hasPublishAction:o,siteIconUrl:r,siteTitle:s,siteHome:a}=Object(l.useSelect)(e=>{const{getCurrentPost:t,isEditedPostBeingScheduled:n}=e(Zn),{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 d,p,b=Object(i.createElement)(Eo.Icon,{className:"components-site-icon",size:"36px",icon:Ur.a});return r&&(b=Object(i.createElement)("img",{alt:Object(Wt.__)("Site Icon"),className:"components-site-icon",src:r})),n&&(b=null),o?t?(d=Object(Wt.__)("Are you ready to schedule?"),p=Object(Wt.__)("Your work will be published at the specified date and time.")):(d=Object(Wt.__)("Are you ready to publish?"),p=Object(Wt.__)("Double-check your settings before publishing.")):(d=Object(Wt.__)("Are you ready to submit for review?"),p=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,d)),Object(i.createElement)("p",null,p),Object(i.createElement)("div",{className:"components-site-card"},b,Object(i.createElement)("div",{className:"components-site-info"},Object(i.createElement)("span",{className:"components-site-name"},Object(Qo.decodeEntities)(s)||Object(Wt.__)("(Untitled)")),Object(i.createElement)("span",{className:"components-site-home"},a))),o&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Eo.PanelBody,{initialOpen:!1,title:[Object(Wt.__)("Visibility:"),Object(i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},Object(i.createElement)(Vr,null))]},Object(i.createElement)(zr,null)),Object(i.createElement)(Eo.PanelBody,{initialOpen:!1,title:[Object(Wt.__)("Publish:"),Object(i.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},Object(i.createElement)(Wr,null))]},Object(i.createElement)(Gr,null))),Object(i.createElement)(cs,null),Object(i.createElement)(rs,null),e)};function ls({text:e,onCopy:t,children:n}){const o=Object(d.useCopyToClipboard)(e,t);return Object(i.createElement)(Eo.Button,{variant:"secondary",ref:o},n)}class us 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)(Wr,null),"."):Object(Wt.__)("is now live.");return Object(i.createElement)("div",{className:"post-publish-panel__postpublish"},Object(i.createElement)(Eo.PanelBody,{className:"post-publish-panel__postpublish-header"},Object(i.createElement)("a",{ref:this.postLink,href:l},Object(Qo.decodeEntities)(n.title)||Object(Wt.__)("(no title)"))," ",d),Object(i.createElement)(Eo.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)(Eo.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)(ls,{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)(Eo.Button,{variant:"primary",href:l},s),Object(i.createElement)(Eo.Button,{variant:t?"primary":"secondary",href:u},a))),e)}}var ds=Object(l.withSelect)(e=>{const{getEditedPostAttribute:t,getCurrentPost:n,isCurrentPostScheduled:o}=e(Zn),{getPostType:r}=e(u.store);return{post:n(),postType:r(t("type")),isScheduled:o()}})(us);class ps 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,f=Object(c.omit)(h,["hasPublishAction","isDirty","isPostTypeViewable"]),g=o||a&&n,O=!g&&!l,j=g&&!l;return Object(i.createElement)("div",Object(s.a)({className:"editor-post-publish-panel"},f),Object(i.createElement)("div",{className:"editor-post-publish-panel__header"},j?Object(i.createElement)(Eo.Button,{onClick:d,icon:Lr.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)(Dr,{focusOnMount:!0,onSubmit:this.onSubmit,forceIsDirty:e,forceIsSaving:t})),Object(i.createElement)("div",{className:"editor-post-publish-panel__header-cancel-button"},Object(i.createElement)(Eo.Button,{disabled:u,onClick:d,variant:"secondary"},Object(Wt.__)("Cancel"))))),Object(i.createElement)("div",{className:"editor-post-publish-panel__content"},O&&Object(i.createElement)(as,null,m&&Object(i.createElement)(m,null)),j&&Object(i.createElement)(ds,{focusOnMount:!0},b&&Object(i.createElement)(b,null)),l&&Object(i.createElement)(Eo.Spinner,null)),Object(i.createElement)("div",{className:"editor-post-publish-panel__footer"},Object(i.createElement)(Eo.CheckboxControl,{label:Object(Wt.__)("Always show pre-publish checks."),checked:r,onChange:p})))}}var bs=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(Zn),{isPublishSidebarEnabled:p}=e(Zn),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,{isPublishSidebarEnabled:t})=>{const{disablePublishSidebar:n,enablePublishSidebar:o}=e(Zn);return{onTogglePublishSidebar:()=>{t?n():o()}}}),Eo.withFocusReturn,Eo.withConstrainedTabbing])(ps);var ms=Object(i.createElement)(Sr.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(Sr.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"})),hs=n("iClF"),fs=n("RMJe");var gs=Object(i.createElement)(Sr.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(Sr.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 Os=Object(d.compose)([Object(l.withSelect)(e=>{const{isSavingPost:t,isCurrentPostPublished:n,isCurrentPostScheduled:o}=e(Zn);return{isSaving:t(),isPublished:n(),isScheduled:o()}}),Object(l.withDispatch)(e=>{const{editPost:t,savePost:n}=e(Zn);return{onClick:()=>{t({status:"draft"}),n()}}})])((function({isSaving:e,isPublished:t,isScheduled:n,onClick:o}){const r=Object(d.useViewportMatch)("small","<");return t||n?Object(i.createElement)(Eo.Button,{className:"editor-post-switch-to-draft",onClick:()=>{let e;t?e=Object(Wt.__)("Are you sure you want to unpublish this post?"):n&&(e=Object(Wt.__)("Are you sure you want to unschedule this post?")),window.confirm(e)&&o()},disabled:e,variant:"tertiary"},r?Object(Wt.__)("Draft"):Object(Wt.__)("Switch to draft")):null}));function js({forceIsDirty:e,forceIsSaving:t,showIconLabels:n=!1}){const[o,r]=Object(i.useState)(!1),s=Object(d.useViewportMatch)("small"),{isAutosaving:c,isDirty:a,isNew:u,isPending:p,isPublished:b,isSaveable:m,isSaving:h,isScheduled:f,hasPublishAction:g}=Object(l.useSelect)(n=>{var o,r,s;const{isEditedPostNew:i,isCurrentPostPublished:c,isCurrentPostScheduled:a,isEditedPostDirty:l,isSavingPost:u,isEditedPostSaveable:d,getCurrentPost:p,isAutosavingPost:b,getEditedPostAttribute:m}=n(Zn);return{isAutosaving:b(),isDirty:e||l(),isNew:i(),isPending:"pending"===m("status"),isPublished:c(),isSaving:t||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}},[e,t]),{savePost:O}=Object(l.useDispatch)(Zn),j=Object(d.usePrevious)(h);if(Object(i.useEffect)(()=>{let e;return j&&!h&&(r(!0),e=setTimeout(()=>{r(!1)},1e3)),()=>clearTimeout(e)},[h]),!g&&p)return null;if(b||f)return Object(i.createElement)(Os,null);const v=p?Object(Wt.__)("Save as pending"):Object(Wt.__)("Save draft"),_=Object(Wt.__)("Save"),y=o||!u&&!a,E=h||y,S=h||y||!m;let w;return h?w=c?Object(Wt.__)("Autosaving"):Object(Wt.__)("Saving"):y?w=Object(Wt.__)("Saved"):s?w=v:n&&(w=_),Object(i.createElement)(Eo.Button,{className:m||h?co()({"editor-post-save-draft":!E,"editor-post-saved-state":E,"is-saving":h,"is-autosaving":c,"is-saved":y,[Object(Eo.__unstableGetAnimateClassName)({type:"loading"})]:h}):void 0,onClick:S?void 0:()=>O(),shortcut:So.displayShortcut.primary("s"),variant:s?"tertiary":void 0,icon:s?void 0:ms,label:v,"aria-disabled":S},E&&Object(i.createElement)(hs.a,{icon:y?fs.a:gs}),w)}var vs=Object(d.compose)([Object(l.withSelect)(e=>{const{getCurrentPost:t,getCurrentPostType:n}=e(Zn);return{hasPublishAction:Object(c.get)(t(),["_links","wp:action-publish"],!1),postType:n()}})])((function({hasPublishAction:e,children:t}){return e?t:null}));function _s({children:e}){return Object(i.createElement)(qo,{supportKeys:"slug"},e)}class ys extends i.Component{constructor({postSlug:e,postTitle:t,postID:n}){super(...arguments),this.state={editedSlug:Object(_.safeDecodeURIComponent)(e)||x(t)||n},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)(_s,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 Es=Object(d.compose)([Object(l.withSelect)(e=>{const{getCurrentPost:t,getEditedPostAttribute:n}=e(Zn),{id:o}=t();return{postSlug:n("slug"),postTitle:n("title"),postID:o}}),Object(l.withDispatch)(e=>{const{editPost:t}=e(Zn);return{onUpdateSlug(e){t({slug:e})}}}),d.withInstanceId])(ys);var Ss=Object(d.compose)([Object(l.withSelect)(e=>{const t=e(Zn).getCurrentPost();return{hasStickyAction:Object(c.get)(t,["_links","wp:action-sticky"],!1),postType:e(Zn).getCurrentPostType()}})])((function({hasStickyAction:e,postType:t,children:n}){return"post"===t&&e?n:null}));var ws=Object(d.compose)([Object(l.withSelect)(e=>({postSticky:e(Zn).getEditedPostAttribute("sticky")})),Object(l.withDispatch)(e=>({onUpdateSticky(t){e(Zn).editPost({sticky:t})}}))])((function({onUpdateSticky:e,postSticky:t=!1}){return Object(i.createElement)(Ss,null,Object(i.createElement)(Eo.CheckboxControl,{label:Object(Wt.__)("Stick to the top of the blog"),checked:t,onChange:()=>e(!t)}))}));const Ps={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view"},ks=[];var Cs=Object(Eo.withFilters)("editor.PostTaxonomyType")((function({slug:e}){const[t,n]=Object(i.useState)(!1),[o,r]=Object(i.useState)(""),[s,a]=Object(i.useState)(""),[p,b]=Object(i.useState)(!1),[m,h]=Object(i.useState)(""),[f,g]=Object(i.useState)([]),O=Object(d.useDebounce)($r.speak,500),{hasCreateAction:j,hasAssignAction:v,terms:_,loading:y,availableTerms:E,taxonomy:S}=Object(l.useSelect)(t=>{const{getCurrentPost:n,getEditedPostAttribute:o}=t(Zn),{getTaxonomy:r,getEntityRecords:s,isResolving:i}=t(u.store),a=r(e);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):ks,loading:i("getEntityRecords",["taxonomy",e,Ps]),availableTerms:s("taxonomy",e,Ps)||ks,taxonomy:a}},[e]),{editPost:w}=Object(l.useDispatch)(Zn),{saveEntityRecord:P}=Object(l.useDispatch)(u.store),k=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}(Yo(E),_),[E]);if(!v)return null;const C=e=>{w({[S.rest_base]:e})},T=e=>e.map(e=>Object(i.createElement)("div",{key:e.id,className:"editor-post-taxonomies__hierarchical-terms-choice"},Object(i.createElement)(Eo.CheckboxControl,{checked:-1!==_.indexOf(e.id),onChange:()=>{(e=>{const t=_.includes(e)?Object(c.without)(_,e):[..._,e];C(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"},T(e.children)))),x=(t,n,o)=>Object(c.get)(S,["labels",t],"category"===e?n:o),B=x("add_new_item",Object(Wt.__)("Add new category"),Object(Wt.__)("Add new term")),I=x("new_item_name",Object(Wt.__)("Add new category"),Object(Wt.__)("Add new term")),A=x("parent_item",Object(Wt.__)("Parent Category"),Object(Wt.__)("Parent Term")),R=`— ${A} —`,N=B,D=Object(c.get)(S,["labels","search_items"],Object(Wt.__)("Search Terms")),L=Object(c.get)(S,["name"],Object(Wt.__)("Terms")),U=E.length>=8;return Object(i.createElement)(i.Fragment,null,U&&Object(i.createElement)(Eo.TextControl,{className:"editor-post-taxonomies__hierarchical-terms-filter",label:D,value:m,onChange:e=>{const t=k.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{b(!p)},className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":p,variant:"link"},B),p&&Object(i.createElement)("form",{onSubmit:async i=>{if(i.preventDefault(),""===o||t)return;const l=function(e,t,n){return Object(c.find)(e,e=>(!e.parent&&!t||parseInt(e.parent)===parseInt(t))&&e.name.toLowerCase()===n.toLowerCase())}(E,s,o);if(l)return Object(c.some)(_,e=>e===l.id)||C([..._,l.id]),r(""),void a("");n(!0);const u=await(d={name:o,parent:s||void 0},P("taxonomy",e,d));var d;const p=Object(Wt.sprintf)(Object(Wt._x)("%s added","term"),Object(c.get)(S,["labels","singular_name"],"category"===e?Object(Wt.__)("Category"):Object(Wt.__)("Term")));Object($r.speak)(p,"assertive"),n(!1),r(""),a(""),C([..._,u.id])}},Object(i.createElement)(Eo.TextControl,{className:"editor-post-taxonomies__hierarchical-terms-input",label:I,value:o,onChange:e=>{r(e)},required:!0}),!!E.length&&Object(i.createElement)(Eo.TreeSelect,{label:A,noOptionLabel:R,onChange:e=>{a(e)},selectedId:s,tree:k}),Object(i.createElement)(Eo.Button,{variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit"},N)))}));var Ts=Object(d.compose)([Object(l.withSelect)(e=>({postType:e(Zn).getCurrentPostType(),taxonomies:e(u.store).getTaxonomies({per_page:-1})}))])((function({postType:e,taxonomies:t,taxonomyWrapper:n=c.identity}){const o=Object(c.filter)(t,t=>Object(c.includes)(t.types,e));return Object(c.filter)(o,e=>e.visibility.show_ui).map(e=>{const t=e.hierarchical?Cs:ts;return Object(i.createElement)(i.Fragment,{key:"taxonomy-"+e.slug},n(Object(i.createElement)(t,{slug:e.slug}),e))})}));var xs=Object(d.compose)([Object(l.withSelect)(e=>({postType:e(Zn).getCurrentPostType(),taxonomies:e(u.store).getTaxonomies({per_page:-1})}))])((function({postType:e,taxonomies:t,children:n}){return Object(c.some)(t,t=>Object(c.includes)(t.types,e))?n:null})),Bs=n("O6Fj"),Is=n.n(Bs);function As(){const e=Object(l.useSelect)(e=>e(Zn).getEditedPostContent(),[]),{editPost:t,resetEditorBlocks:n}=Object(l.useDispatch)(Zn),[o,r]=Object(i.useState)(e),[s,c]=Object(i.useState)(!1),u=Object(d.useInstanceId)(As);s||o===e||r(e);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Eo.VisuallyHidden,{as:"label",htmlFor:"post-content-"+u},Object(Wt.__)("Type text or HTML")),Object(i.createElement)(Is.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 Rs=/[\r\n]+/g;function Ns(){const e=Object(i.useRef)(),[t,n]=Object(i.useState)(!1),{editPost:o}=Object(l.useDispatch)(Zn),{insertDefaultBlock:r,clearSelectedBlock:s,insertBlocks:c}=Object(l.useDispatch)(m.store),{isCleanNewPost:u,title:p,placeholder:b,isFocusMode:h,hasFixedToolbar:f}=Object(l.useSelect)(e=>{const{getEditedPostAttribute:t,isCleanNewPost:n}=e(Zn),{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 g(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[j,v]=Object(i.useState)({});function _(){n(!1),v({})}const y=co()("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":f}),E=Object(Qo.decodeEntities)(b)||Object(Wt.__)("Add title"),{ref:S}=Object(so.__unstableUseRichText)({value:p,onChange:function(e){O(e.replace(Rs," "))},placeholder:E,selectionStart:j.start,selectionEnd:j.end,onSelectionChange(e,t){v(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===So.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?g(r):(O(t.attributes.content),g(r.slice(1)))}}}))}var Ds=Object(d.compose)([Object(l.withSelect)(e=>{const{isEditedPostNew:t,getCurrentPostId:n,getCurrentPostType:o}=e(Zn);return{isNew:t(),postId:n(),postType:o()}}),Object(l.withDispatch)(e=>({trashPost:e(Zn).trashPost}))])((function({isNew:e,postId:t,postType:n,...o}){return e||!t?null:Object(i.createElement)(Eo.Button,{className:"editor-post-trash",isDestructive:!0,variant:"tertiary",onClick:()=>o.trashPost(t,n)},Object(Wt.__)("Move to trash"))}));var Ls=Object(l.withSelect)(e=>{const{isEditedPostNew:t,getCurrentPostId:n,getCurrentPostType:o}=e(Zn),{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({isNew:e,postId:t,canUserDelete:n,children:o}){return!e&&t&&n?o:null}));var Us=Object(d.compose)([Object(l.withSelect)(e=>{const{getCurrentPost:t,getCurrentPostType:n}=e(Zn);return{hasPublishAction:Object(c.get)(t(),["_links","wp:action-publish"],!1),postType:n()}})])((function({hasPublishAction:e,render:t}){return t({canEdit:e})})),Fs=n("FnAh"),Ms=n("7fqt");function zs(){const e=Object(l.useSelect)(e=>e(Zn).getEditedPostAttribute("content"),[]),t=Object(Wt._x)("words","Word count type. Do not translate!");return Object(i.createElement)("span",{className:"word-count"},Object(Ms.count)(e,t))}function Vs(){const e=Object(l.useSelect)(e=>e(Zn).getEditedPostAttribute("content"),[]);return Object(Ms.count)(e,"characters_including_spaces")}var Hs=function({hasOutlineItemsDisabled:e,onRequestClose:t}){const{headingCount:n,paragraphCount:o,numberOfBlocks:r}=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)(Vs,null))),Object(i.createElement)("li",{className:"table-of-contents__count"},Object(Wt.__)("Words"),Object(i.createElement)(zs,null)),Object(i.createElement)("li",{className:"table-of-contents__count"},Object(Wt.__)("Headings"),Object(i.createElement)("span",{className:"table-of-contents__number"},n)),Object(i.createElement)("li",{className:"table-of-contents__count"},Object(Wt.__)("Paragraphs"),Object(i.createElement)("span",{className:"table-of-contents__number"},o)),Object(i.createElement)("li",{className:"table-of-contents__count"},Object(Wt.__)("Blocks"),Object(i.createElement)("span",{className:"table-of-contents__number"},r)))),n>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)(fo,{onSelect:t,hasOutlineItemsDisabled:e})))};var Gs=Object(i.forwardRef)((function({hasOutlineItemsDisabled:e,repositionDropdown:t,...n},o){const r=Object(l.useSelect)(e=>!!e(m.store).getBlockCount(),[]);return Object(i.createElement)(Eo.Dropdown,{position:t?"middle right right":"bottom",className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:({isOpen:e,onToggle:t})=>Object(i.createElement)(Eo.Button,Object(s.a)({},n,{ref:o,onClick:r?t:void 0,icon:Fs.a,"aria-expanded":e,"aria-haspopup":"true",label:Object(Wt.__)("Details"),tooltipPosition:"bottom","aria-disabled":!r})),renderContent:({onClose:t})=>Object(i.createElement)(Hs,{onRequestClose:t,hasOutlineItemsDisabled:e})})}));function Ws(){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 qs=n("diJD");var Ks=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",Xn),c(e)},[o]),s?Object(i.createElement)(l.RegistryProvider,{value:s},Object(i.createElement)(e,r)):null}),"withRegistryProvider"),$s=n("6aBm");function Qs({additionalData:e={},allowedTypes:t,filesList:n,maxUploadFileSize:o,onError:r=c.noop,onFileChange:s}){const{getCurrentPostId:i,getEditorSettings:a}=Object(l.select)(Zn),u=a().allowedMimeTypes;o=o||a().maxUploadFileSize,Object($s.uploadMedia)({allowedTypes:t,filesList:n,onFileChange:s,additionalData:{post:i(),...e},maxUploadFileSize:o,onError:({message:e})=>r(e),wpAllowedMimeTypes:u})}var Ys=function(e,t){const{reusableBlocks:n,hasUploadPermissions:o,canUseUnfilteredHTML:r,userCanCreatePages:s}=Object(l.useSelect)(e=>{const{canUserUseUnfilteredHTML:t}=e(Zn),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)(Zn),{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?Qs: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 Js=Ks((function({__unstableTemplate:e,post:t,settings:n,recovery:o,initialEdits:r,children:s}){const c=Object(i.useMemo)(()=>"wp_template"===t.type?{}:{postId:t.id,postType:t.type},[t.id,t.type]),{selection:a,isReady:d}=Object(l.useSelect)(e=>{const{getEditorSelection:t,__unstableIsEditorReady:n}=e(Zn);return{isReady:n(),selection:t()}},[]),{id:p,type:b}=null!=e?e:t,[h,f,g]=Object(u.useEntityBlockEditor)("postType",b,{id:p}),O=Ys(n,!!e),{updatePostLock:j,setupEditor:v,updateEditorSettings:_,__experimentalTearDownEditor:y}=Object(l.useDispatch)(Zn),{createWarningNotice:E}=Object(l.useDispatch)(Gt.store);return Object(i.useLayoutEffect)(()=>{if(!o)return j(n.postLock),v(t,r,n.template),n.autosave&&E(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:n.autosave.editLink}]}),()=>{y()}},[]),Object(i.useEffect)(()=>{_(n)},[n]),d?Object(i.createElement)(u.EntityProvider,{kind:"root",type:"site"},Object(i.createElement)(u.EntityProvider,{kind:"postType",type:t.type,id:t.id},Object(i.createElement)(m.BlockContextProvider,{value:c},Object(i.createElement)(m.BlockEditorProvider,{value:h,onChange:g,onInput:f,selection:a,settings:O,useSubRegistry:!1},s,Object(i.createElement)(qs.ReusableBlocksMenuItems,null))))):null})),Xs=n("JREk"),Zs=n.n(Xs);function ei(e,t,n=[]){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]=ei(e+"."+n,t[n])}),o}function ti(e,t){return(...n)=>(E()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e}),t(...n))}const ni=ei("RichText",m.RichText,["Content"]);ni.isEmpty=ti("RichText.isEmpty",m.RichText.isEmpty);const oi=ei("Autocomplete",m.Autocomplete),ri=ei("AlignmentToolbar",m.AlignmentToolbar),si=ei("BlockAlignmentToolbar",m.BlockAlignmentToolbar),ii=ei("BlockControls",m.BlockControls,["Slot"]),ci=ei("BlockEdit",m.BlockEdit),ai=ei("BlockEditorKeyboardShortcuts",m.BlockEditorKeyboardShortcuts),li=ei("BlockFormatControls",m.BlockFormatControls,["Slot"]),ui=ei("BlockIcon",m.BlockIcon),di=ei("BlockInspector",m.BlockInspector),pi=ei("BlockList",m.BlockList),bi=ei("BlockMover",m.BlockMover),mi=ei("BlockNavigationDropdown",m.BlockNavigationDropdown),hi=ei("BlockSelectionClearer",m.BlockSelectionClearer),fi=ei("BlockSettingsMenu",m.BlockSettingsMenu),gi=ei("BlockTitle",m.BlockTitle),Oi=ei("BlockToolbar",m.BlockToolbar),ji=ei("ColorPalette",m.ColorPalette),vi=ei("ContrastChecker",m.ContrastChecker),_i=ei("CopyHandler",m.CopyHandler),yi=ei("DefaultBlockAppender",m.DefaultBlockAppender),Ei=ei("FontSizePicker",m.FontSizePicker),Si=ei("Inserter",m.Inserter),wi=ei("InnerBlocks",m.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),Pi=ei("InspectorAdvancedControls",m.InspectorAdvancedControls,["Slot"]),ki=ei("InspectorControls",m.InspectorControls,["Slot"]),Ci=ei("PanelColorSettings",m.PanelColorSettings),Ti=ei("PlainText",m.PlainText),xi=ei("RichTextShortcut",m.RichTextShortcut),Bi=ei("RichTextToolbarButton",m.RichTextToolbarButton),Ii=ei("__unstableRichTextInputEvent",m.__unstableRichTextInputEvent),Ai=ei("MediaPlaceholder",m.MediaPlaceholder),Ri=ei("MediaUpload",m.MediaUpload),Ni=ei("MediaUploadCheck",m.MediaUploadCheck),Di=ei("MultiSelectScrollIntoView",m.MultiSelectScrollIntoView),Li=ei("NavigableToolbar",m.NavigableToolbar),Ui=ei("ObserveTyping",m.ObserveTyping),Fi=ei("PreserveScrollInReorder",m.PreserveScrollInReorder),Mi=ei("SkipToSelectedBlock",m.SkipToSelectedBlock),zi=ei("URLInput",m.URLInput),Vi=ei("URLInputButton",m.URLInputButton),Hi=ei("URLPopover",m.URLPopover),Gi=ei("Warning",m.Warning),Wi=ei("WritingFlow",m.WritingFlow),qi=ti("createCustomColorsHOC",m.createCustomColorsHOC),Ki=ti("getColorClassName",m.getColorClassName),$i=ti("getColorObjectByAttributeValues",m.getColorObjectByAttributeValues),Qi=ti("getColorObjectByColorValue",m.getColorObjectByColorValue),Yi=ti("getFontSize",m.getFontSize),Ji=ti("getFontSizeClass",m.getFontSizeClass),Xi=ti("withColorContext",m.withColorContext),Zi=ti("withColors",m.withColors),ec=ti("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