WordPress/wp-includes/js/dist/editor.min.js

12 lines
200 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! This file is auto-generated */
(()=>{var e={4306:function(e,t){var n,o,s;
/*!
autosize 4.0.4
license: MIT
http://www.jacklmoore.com/autosize
*/o=[e,t],n=function(e,t){"use strict";var n,o,s="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-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))}}),r=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){r=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!s.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&p()},a=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",p,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),s.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",p,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",s.set(e,{destroy:a,update:p}),l()}function l(){var n=window.getComputedStyle(e,null);"vertical"===n.resize?e.style.resize="none":"both"===n.resize&&(e.style.resize="horizontal"),t="content-box"===n.boxSizing?-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),isNaN(t)&&(t=0),p()}function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(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}function d(){if(0!==e.scrollHeight){var o=u(e),s=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),s&&(document.documentElement.scrollTop=s)}}function p(){d();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),s="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(s<t?"hidden"===n.overflowY&&(c("scroll"),d(),s="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),d(),s="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==s){o=s;var i=r("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function a(e){var t=s.get(e);t&&t.destroy()}function l(e){var t=s.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e,t)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],l),e}),t.default=c,e.exports=t.default},void 0===(s="function"==typeof n?n.apply(t,o):n)||(e.exports=s)},5755:(e,t)=>{var n;
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var o={}.hasOwnProperty;function s(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"===r||"number"===r)e.push(n);else if(Array.isArray(n)){if(n.length){var i=s.apply(null,n);i&&e.push(i)}}else if("object"===r){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var a in n)o.call(n,a)&&n[a]&&e.push(a)}}}return e.join(" ")}e.exports?(s.default=s,e.exports=s):void 0===(n=function(){return s}.apply(t,[]))||(e.exports=n)}()},6109:e=>{e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},461:(e,t,n)=>{var o=n(6109);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var s=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),s?e.style.lineHeight=s: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 r=e.nodeName,i=document.createElement(r);i.innerHTML="&nbsp;","TEXTAREA"===r.toUpperCase()&&i.setAttribute("rows","1");var a=o(e,"font-size");i.style.fontSize=a,i.style.padding="0px",i.style.border="0px";var l=document.body;l.appendChild(i),n=i.offsetHeight,l.removeChild(i)}return n}},628:(e,t,n)=>{"use strict";var o=n(4067);function s(){}function r(){}r.resetWarningCache=s,e.exports=function(){function e(e,t,n,s,r,i){if(i!==o){var a=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 a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:s};return n.PropTypes=n,n}},5826:(e,t,n)=>{e.exports=n(628)()},4067:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4462:function(e,t,n){"use strict";var o,s=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)}),r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(o=Object.getOwnPropertySymbols(e);s<o.length;s++)t.indexOf(o[s])<0&&(n[o[s]]=e[o[s]])}return n};t.__esModule=!0;var a=n(1609),l=n(5826),c=n(4306),u=n(461),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return s(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),s=(t.innerRef,t.children),l=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return a.createElement("textarea",r({},l,{onChange:this.onChange,style:u?r({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),s)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:l.number,maxRows:l.number,onResize:l.func,innerRef:l.any,async:l.bool},t}(a.Component);t.TextareaAutosize=a.forwardRef((function(e,t){return a.createElement(p,r({},e,{innerRef:t}))}))},4132:(e,t,n)=>{"use strict";var o=n(4462);t.A=o.TextareaAutosize},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",:"A",:"A",:"A",:"A",:"A",Æ:"AE",:"A",:"A",Ȃ:"A",:"A",:"A",:"A",:"A",:"A",Ç:"C",:"C",È:"E",É:"E",Ê:"E",Ë:"E",:"E",:"E",:"E",:"E",:"E",Ȇ:"E",:"E",:"E",:"E",:"E",:"E",:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",:"I",Ȋ:"I",:"I",:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",:"O",:"O",:"O",Ȏ:"O",:"O",:"O",:"O",:"O",:"O",:"O",:"O",:"O",:"O",:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",:"U",:"U",:"U",:"U",:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",:"a",:"a",:"a",:"a",:"a",æ:"ae",:"a",:"a",ȃ:"a",:"a",:"a",:"a",:"a",:"a",ç:"c",:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",:"e",:"e",:"e",:"e",ȇ:"e",:"e",:"e",:"e",:"e",:"e",:"e",ì:"i",í:"i",î:"i",ï:"i",:"i",ȋ:"i",:"i",:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",:"o",:"o",:"o",ȏ:"o",:"o",:"o",:"o",:"o",:"o",:"o",:"o",:"o",:"o",:"o",ù:"u",ú:"u",û:"u",ü:"u",:"u",:"u",:"u",:"u",:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",:"H",:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",:"K",:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",:"W",:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",:"U",:"u",:"U",:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",:"P",:"p",:"S",:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",:"O",:"o",:"O",:"o",:"U",:"u",:"W",:"w",:"Y",:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",:"S",:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",:"D",:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",:"H",:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},n=Object.keys(t).join("|"),o=new RegExp(n,"g"),s=new RegExp(n,"");function r(e){return t[e]}var i=function(e){return e.replace(o,r)};e.exports=i,e.exports.has=function(e){return!!e.match(s)},e.exports.remove=i},1609:e=>{"use strict";e.exports=window.React}},t={};function n(o){var s=t[o];if(void 0!==s)return s.exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{AlignmentToolbar:()=>Ql,Autocomplete:()=>ql,AutosaveMonitor:()=>$o,BlockAlignmentToolbar:()=>Xl,BlockControls:()=>Jl,BlockEdit:()=>ec,BlockEditorKeyboardShortcuts:()=>tc,BlockFormatControls:()=>nc,BlockIcon:()=>oc,BlockInspector:()=>sc,BlockList:()=>rc,BlockMover:()=>ic,BlockNavigationDropdown:()=>ac,BlockSelectionClearer:()=>lc,BlockSettingsMenu:()=>cc,BlockTitle:()=>uc,BlockToolbar:()=>dc,CharacterCount:()=>vl,ColorPalette:()=>pc,ContrastChecker:()=>mc,CopyHandler:()=>gc,DefaultBlockAppender:()=>hc,DocumentBar:()=>rs,DocumentOutline:()=>_s,DocumentOutlineCheck:()=>fs,EditorHistoryRedo:()=>ys,EditorHistoryUndo:()=>ws,EditorKeyboardShortcuts:()=>jo,EditorKeyboardShortcutsRegister:()=>Es,EditorNotices:()=>Ss,EditorProvider:()=>jl,EditorSnackbars:()=>Cs,EntitiesSavedStates:()=>Fs,ErrorBoundary:()=>Gs,FontSizePicker:()=>_c,InnerBlocks:()=>Ec,Inserter:()=>fc,InspectorAdvancedControls:()=>bc,InspectorControls:()=>vc,LocalAutosaveMonitor:()=>Ks,MediaPlaceholder:()=>Cc,MediaUpload:()=>Tc,MediaUploadCheck:()=>xc,MultiSelectScrollIntoView:()=>Bc,NavigableToolbar:()=>Ic,ObserveTyping:()=>Nc,PageAttributesCheck:()=>Zs,PageAttributesOrder:()=>Qs,PageAttributesPanel:()=>lr,PageAttributesParent:()=>ir,PageTemplate:()=>vr,PanelColorSettings:()=>yc,PlainText:()=>wc,PostAuthor:()=>Lr,PostAuthorCheck:()=>Mr,PostAuthorPanel:()=>Fr,PostComments:()=>Vr,PostDiscussionPanel:()=>zr,PostExcerpt:()=>Gr,PostExcerptCheck:()=>jr,PostExcerptPanel:()=>qr,PostFeaturedImage:()=>ii,PostFeaturedImageCheck:()=>Jr,PostFeaturedImagePanel:()=>li,PostFormat:()=>di,PostFormatCheck:()=>ci,PostLastRevision:()=>gi,PostLastRevisionCheck:()=>mi,PostLastRevisionPanel:()=>hi,PostLockedModal:()=>_i,PostPendingStatus:()=>Ei,PostPendingStatusCheck:()=>fi,PostPingbacks:()=>Ur,PostPreviewButton:()=>bi,PostPublishButton:()=>ki,PostPublishButtonLabel:()=>vi,PostPublishPanel:()=>Ia,PostSavedState:()=>Ra,PostSchedule:()=>Ki,PostScheduleCheck:()=>Oa,PostScheduleLabel:()=>Zi,PostSchedulePanel:()=>La,PostSlug:()=>Va,PostSlugCheck:()=>Ma,PostSticky:()=>Ha,PostStickyCheck:()=>Ua,PostSwitchToDraftButton:()=>za,PostSyncStatus:()=>ja,PostSyncStatusModal:()=>Wa,PostTaxonomies:()=>Ka,PostTaxonomiesCheck:()=>Za,PostTaxonomiesFlatTermSelector:()=>aa,PostTaxonomiesHierarchicalTermSelector:()=>fa,PostTaxonomiesPanel:()=>qa,PostTemplatePanel:()=>Ir,PostTextEditor:()=>Xa,PostTitle:()=>sl,PostTitleRaw:()=>rl,PostTrash:()=>il,PostTrashCheck:()=>al,PostTypeSupportCheck:()=>Ys,PostURL:()=>ll,PostURLCheck:()=>cl,PostURLLabel:()=>ul,PostURLPanel:()=>pl,PostVisibility:()=>Ti,PostVisibilityCheck:()=>gl,PostVisibilityLabel:()=>Bi,RichText:()=>Yl,RichTextShortcut:()=>kc,RichTextToolbarButton:()=>Sc,ServerSideRender:()=>$l(),SkipToSelectedBlock:()=>Dc,TableOfContents:()=>wl,TextEditorGlobalKeyboardShortcuts:()=>Zc,ThemeSupportCheck:()=>Xr,TimeToRead:()=>bl,URLInput:()=>Ac,URLInputButton:()=>Rc,URLPopover:()=>Oc,UnsavedChangesWarning:()=>kl,VisualEditorGlobalKeyboardShortcuts:()=>Kc,Warning:()=>Lc,WordCount:()=>fl,WritingFlow:()=>Mc,__unstableRichTextInputEvent:()=>Pc,cleanForSlug:()=>Yc,createCustomColorsHOC:()=>Fc,getColorClassName:()=>Vc,getColorObjectByAttributeValues:()=>Uc,getColorObjectByColorValue:()=>Hc,getFontSize:()=>zc,getFontSizeClass:()=>Gc,getTemplatePartIcon:()=>H,mediaUpload:()=>Dl,privateApis:()=>Du,store:()=>Bo,storeConfig:()=>xo,transformStyles:()=>g.transformStyles,useEntitiesSavedStatesIsDirty:()=>Os,usePostScheduleLabel:()=>Yi,usePostURLLabel:()=>dl,usePostVisibilityLabel:()=>Ii,userAutocompleter:()=>Ro,withColorContext:()=>jc,withColors:()=>Wc,withFontSizes:()=>$c});var e={};n.r(e),n.d(e,{__experimentalGetDefaultTemplatePartAreas:()=>en,__experimentalGetDefaultTemplateType:()=>tn,__experimentalGetDefaultTemplateTypes:()=>Jt,__experimentalGetTemplateInfo:()=>nn,__unstableIsEditorReady:()=>Ke,canInsertBlockType:()=>Yt,canUserUseUnfilteredHTML:()=>Fe,didPostSaveRequestFail:()=>ye,didPostSaveRequestSucceed:()=>ve,getActivePostLock:()=>Me,getAdjacentBlockClientId:()=>vt,getAutosaveAttribute:()=>ie,getBlock:()=>rt,getBlockAttributes:()=>st,getBlockCount:()=>dt,getBlockHierarchyRootClientId:()=>bt,getBlockIndex:()=>Rt,getBlockInsertionPoint:()=>jt,getBlockListSettings:()=>Xt,getBlockMode:()=>Ht,getBlockName:()=>nt,getBlockOrder:()=>At,getBlockRootClientId:()=>Et,getBlockSelectionEnd:()=>mt,getBlockSelectionStart:()=>pt,getBlocks:()=>it,getBlocksByClientId:()=>ut,getClientIdsOfDescendants:()=>at,getClientIdsWithDescendants:()=>lt,getCurrentPost:()=>q,getCurrentPostAttribute:()=>oe,getCurrentPostId:()=>X,getCurrentPostLastRevisionId:()=>te,getCurrentPostRevisionsCount:()=>ee,getCurrentPostType:()=>Q,getCurrentTemplateId:()=>J,getDeviceType:()=>qe,getEditedPostAttribute:()=>re,getEditedPostContent:()=>Ce,getEditedPostPreviewLink:()=>Se,getEditedPostSlug:()=>Ie,getEditedPostVisibility:()=>ae,getEditorBlocks:()=>Ue,getEditorSelection:()=>$e,getEditorSelectionEnd:()=>We,getEditorSelectionStart:()=>je,getEditorSettings:()=>Ze,getFirstMultiSelectedBlockClientId:()=>Ct,getGlobalBlockCount:()=>ct,getInserterItems:()=>qt,getLastMultiSelectedBlockClientId:()=>Tt,getMultiSelectedBlockClientIds:()=>St,getMultiSelectedBlocks:()=>Pt,getMultiSelectedBlocksEndClientId:()=>Dt,getMultiSelectedBlocksStartClientId:()=>Nt,getNextBlockClientId:()=>wt,getPermalink:()=>Be,getPermalinkParts:()=>Ne,getPostEdits:()=>ne,getPostLockUser:()=>Le,getPostTypeLabel:()=>on,getPreviousBlockClientId:()=>yt,getRenderingMode:()=>Ye,getSelectedBlock:()=>ft,getSelectedBlockClientId:()=>_t,getSelectedBlockCount:()=>gt,getSelectedBlocksInitialCaretPosition:()=>kt,getStateBeforeOptimisticTransaction:()=>Je,getSuggestedPostFormat:()=>Pe,getTemplate:()=>Kt,getTemplateLock:()=>Zt,hasChangedContent:()=>$,hasEditorRedo:()=>j,hasEditorUndo:()=>G,hasInserterItems:()=>Qt,hasMultiSelection:()=>Ft,hasNonPostEntityChanges:()=>Z,hasSelectedBlock:()=>ht,hasSelectedInnerBlock:()=>Lt,inSomeHistory:()=>et,isAncestorMultiSelected:()=>It,isAutosavingPost:()=>we,isBlockInsertionPointVisible:()=>Wt,isBlockMultiSelected:()=>Bt,isBlockSelected:()=>Ot,isBlockValid:()=>ot,isBlockWithinSelection:()=>Mt,isCaretWithinFormattedText:()=>Gt,isCleanNewPost:()=>Y,isCurrentPostPending:()=>le,isCurrentPostPublished:()=>ce,isCurrentPostScheduled:()=>ue,isDeletingPost:()=>fe,isEditedPostAutosaveable:()=>ge,isEditedPostBeingScheduled:()=>he,isEditedPostDateFloating:()=>_e,isEditedPostDirty:()=>K,isEditedPostEmpty:()=>me,isEditedPostNew:()=>W,isEditedPostPublishable:()=>de,isEditedPostSaveable:()=>pe,isEditorPanelEnabled:()=>ze,isEditorPanelOpened:()=>Ge,isEditorPanelRemoved:()=>He,isFirstMultiSelectedBlock:()=>xt,isInserterOpened:()=>Xe,isListViewOpened:()=>Qe,isMultiSelecting:()=>Vt,isPermalinkEditable:()=>xe,isPostAutosavingLocked:()=>Re,isPostLockTakeover:()=>Oe,isPostLocked:()=>De,isPostSavingLocked:()=>Ae,isPreviewingPost:()=>ke,isPublishSidebarEnabled:()=>Ve,isPublishingPost:()=>Te,isSavingNonPostEntityChanges:()=>be,isSavingPost:()=>Ee,isSelectionEnabled:()=>Ut,isTyping:()=>zt,isValidTemplate:()=>$t});var t={};n.r(t),n.d(t,{__experimentalTearDownEditor:()=>pn,__unstableSaveForPreview:()=>wn,autosave:()=>yn,clearSelectedBlock:()=>Qn,createUndoLevel:()=>Pn,disablePublishSidebar:()=>xn,editPost:()=>fn,enablePublishSidebar:()=>Tn,enterFormattedText:()=>fo,exitFormattedText:()=>Eo,hideInsertionPoint:()=>ao,insertBlock:()=>so,insertBlocks:()=>ro,insertDefaultBlock:()=>bo,lockPostAutosaving:()=>Nn,lockPostSaving:()=>Bn,mergeBlocks:()=>uo,moveBlockToPosition:()=>oo,moveBlocksDown:()=>to,moveBlocksUp:()=>no,multiSelect:()=>qn,receiveBlocks:()=>jn,redo:()=>kn,refreshPost:()=>bn,removeBlock:()=>mo,removeBlocks:()=>po,removeEditorPanel:()=>Vn,replaceBlock:()=>eo,replaceBlocks:()=>Jn,resetBlocks:()=>Gn,resetEditorBlocks:()=>An,resetPost:()=>mn,savePost:()=>En,selectBlock:()=>Kn,setDeviceType:()=>Ln,setEditedPost:()=>_n,setIsInserterOpened:()=>Un,setIsListViewOpened:()=>Hn,setRenderingMode:()=>On,setTemplateValidity:()=>lo,setupEditor:()=>dn,setupEditorState:()=>hn,showInsertionPoint:()=>io,startMultiSelect:()=>Zn,startTyping:()=>ho,stopMultiSelect:()=>Yn,stopTyping:()=>_o,synchronizeTemplate:()=>co,toggleBlockMode:()=>go,toggleEditorPanelEnabled:()=>Mn,toggleEditorPanelOpened:()=>Fn,toggleSelection:()=>Xn,trashPost:()=>vn,undo:()=>Sn,unlockPostAutosaving:()=>Dn,unlockPostSaving:()=>In,updateBlock:()=>Wn,updateBlockAttributes:()=>$n,updateBlockListSettings:()=>vo,updateEditorSettings:()=>Rn,updatePost:()=>gn,updatePostLock:()=>Cn});var s={};n.r(s),n.d(s,{createTemplate:()=>wo,hideBlockTypes:()=>So,setCurrentTemplateId:()=>yo,showBlockTypes:()=>ko});var r={};n.r(r),n.d(r,{getInsertionPoint:()=>Co,getListViewToggleRef:()=>To});const i=window.wp.blocks,a=window.wp.data,l=window.wp.privateApis,{lock:c,unlock:u}=(0,l.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/editor"),d=window.wp.i18n,p={name:"core/pattern-overrides",label:(0,d._x)("Pattern Overrides","block bindings source"),useSource:null,lockAttributesEditing:!1},m=window.wp.coreData,g=window.wp.blockEditor,h={...g.SETTINGS_DEFAULTS,richEditingEnabled:!0,codeEditingEnabled:!0,fontLibraryEnabled:!0,enableCustomFields:void 0,defaultRenderingMode:"post-only"};function _(e){return e&&"object"==typeof e&&"raw"in e?e.raw:e}const f=(0,a.combineReducers)({postId:function(e=null,t){return"SET_EDITED_POST"===t.type?t.postId:e},postType:function(e=null,t){return"SET_EDITED_POST"===t.type?t.postType:e},templateId:function(e=null,t){return"SET_CURRENT_TEMPLATE_ID"===t.type?t.id:e},saving:function(e={},t){switch(t.type){case"REQUEST_POST_UPDATE_START":case"REQUEST_POST_UPDATE_FINISH":return{pending:"REQUEST_POST_UPDATE_START"===t.type,options:t.options||{}}}return e},deleting:function(e={},t){switch(t.type){case"REQUEST_POST_DELETE_START":case"REQUEST_POST_DELETE_FINISH":return{pending:"REQUEST_POST_DELETE_START"===t.type}}return e},postLock:function(e={isLocked:!1},t){return"UPDATE_POST_LOCK"===t.type?t.lock:e},template:function(e={isValid:!0},t){return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},postSavingLock:function(e={},t){switch(t.type){case"LOCK_POST_SAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_SAVING":{const{[t.lockName]:n,...o}=e;return o}}return e},editorSettings:function(e=h,t){return"UPDATE_EDITOR_SETTINGS"===t.type?{...e,...t.settings}:e},postAutosavingLock:function(e={},t){switch(t.type){case"LOCK_POST_AUTOSAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_AUTOSAVING":{const{[t.lockName]:n,...o}=e;return o}}return e},renderingMode:function(e="post-only",t){return"SET_RENDERING_MODE"===t.type?t.mode:e},deviceType:function(e="Desktop",t){return"SET_DEVICE_TYPE"===t.type?t.deviceType:e},removedPanels:function(e=[],t){if("REMOVE_PANEL"===t.type)if(!e.includes(t.panelName))return[...e,t.panelName];return e},blockInserterPanel:function(e=!1,t){switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},listViewPanel:function(e=!1,t){switch(t.type){case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e},listViewToggleRef:function(e={current:null}){return e}});var E={};function b(e){return[e]}function v(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function y(e,t){var n,o=t||b;function s(){n=new WeakMap}function r(){var t,s,r,i,a,l=arguments.length;for(i=new Array(l),r=0;r<l;r++)i[r]=arguments[r];for(t=function(e){var t,o,s,r,i,a=n,l=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"object"!=typeof i){l=!1;break}a.has(o)?a=a.get(o):(s=new WeakMap,a.set(o,s),a=s)}return a.has(E)||((r=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=l,a.set(E,r)),a.get(E)}(a=o.apply(null,i)),t.isUniqueByDependants||(t.lastDependants&&!v(a,t.lastDependants,0)&&t.clear(),t.lastDependants=a),s=t.head;s;){if(v(s.args,i,1))return s!==t.head&&(s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=t.head,s.prev=null,t.head.prev=s,t.head=s),s.val;s=s.next}return s={val:e.apply(null,i)},i[0]=null,s.args=i,t.head&&(t.head.prev=s,s.next=t.head),t.head=s,s.val}return r.getDependants=o,r.clear=s,s(),r}const w=window.wp.date,k=window.wp.url,S=window.wp.deprecated;var P=n.n(S);const C=window.wp.element;var T=n(1609);const x=window.wp.primitives,B=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})),I=window.wp.preferences,N=new Set(["meta"]),D="SAVE_POST_NOTICE_ID",A="TRASH_POST_NOTICE_ID",R=/%(?:postname|pagename)%/,O=6e4,L=["title","excerpt","content"],M=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"M18.5 10.5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})),F=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.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"})),V=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})),U=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"}));function H(e){return"header"===e?M:"footer"===e?F:"sidebar"===e?V:U}const z={},G=(0,a.createRegistrySelector)((e=>()=>e(m.store).hasUndo())),j=(0,a.createRegistrySelector)((e=>()=>e(m.store).hasRedo()));function W(e){return"auto-draft"===q(e).status}function $(e){return"content"in ne(e)}const K=(0,a.createRegistrySelector)((e=>t=>{const n=Q(t),o=X(t);return!!e(m.store).hasEditsForEntityRecord("postType",n,o)})),Z=(0,a.createRegistrySelector)((e=>t=>{const n=e(m.store).__experimentalGetDirtyEntityRecords(),{type:o,id:s}=q(t);return n.some((e=>"postType"!==e.kind||e.name!==o||e.key!==s))}));function Y(e){return!K(e)&&W(e)}const q=(0,a.createRegistrySelector)((e=>t=>{const n=X(t),o=Q(t),s=e(m.store).getRawEntityRecord("postType",o,n);return s||z}));function Q(e){return e.postType}function X(e){return e.postId}function J(e){return e.templateId}function ee(e){var t;return null!==(t=q(e)._links?.["version-history"]?.[0]?.count)&&void 0!==t?t:0}function te(e){var t;return null!==(t=q(e)._links?.["predecessor-version"]?.[0]?.id)&&void 0!==t?t:null}const ne=(0,a.createRegistrySelector)((e=>t=>{const n=Q(t),o=X(t);return e(m.store).getEntityRecordEdits("postType",n,o)||z}));function oe(e,t){switch(t){case"type":return Q(e);case"id":return X(e);default:const n=q(e);if(!n.hasOwnProperty(t))break;return _(n[t])}}const se=y(((e,t)=>{const n=ne(e);return n.hasOwnProperty(t)?{...oe(e,t),...n[t]}:oe(e,t)}),((e,t)=>[oe(e,t),ne(e)[t]]));function re(e,t){if("content"===t)return Ce(e);const n=ne(e);return n.hasOwnProperty(t)?N.has(t)?se(e,t):n[t]:oe(e,t)}const ie=(0,a.createRegistrySelector)((e=>(t,n)=>{if(!L.includes(n)&&"preview_link"!==n)return;const o=Q(t);if("wp_template"===o)return!1;const s=X(t),r=e(m.store).getCurrentUser()?.id,i=e(m.store).getAutosave(o,s,r);return i?_(i[n]):void 0}));function ae(e){if("private"===re(e,"status"))return"private";return re(e,"password")?"password":"public"}function le(e){return"pending"===q(e).status}function ce(e,t){const n=t||q(e);return-1!==["publish","private"].indexOf(n.status)||"future"===n.status&&!(0,w.isInTheFuture)(new Date(Number((0,w.getDate)(n.date))-O))}function ue(e){return"future"===q(e).status&&!ce(e)}function de(e){const t=q(e);return K(e)||-1===["publish","private","future"].indexOf(t.status)}function pe(e){return!Ee(e)&&(!!re(e,"title")||!!re(e,"excerpt")||!me(e)||"native"===C.Platform.OS)}const me=(0,a.createRegistrySelector)((e=>t=>{const n=X(t),o=Q(t),s=e(m.store).getEditedEntityRecord("postType",o,n);if("function"!=typeof s.content)return!s.content;const r=re(t,"blocks");if(0===r.length)return!0;if(r.length>1)return!1;const a=r[0].name;return(a===(0,i.getDefaultBlockName)()||a===(0,i.getFreeformContentHandlerName)())&&!Ce(t)})),ge=(0,a.createRegistrySelector)((e=>t=>{if(!pe(t))return!1;if(Re(t))return!1;const n=Q(t);if("wp_template"===n)return!1;const o=X(t),s=e(m.store).hasFetchedAutosaves(n,o),r=e(m.store).getCurrentUser()?.id,i=e(m.store).getAutosave(n,o,r);return!!s&&(!i||(!!$(t)||["title","excerpt","meta"].some((e=>_(i[e])!==re(t,e)))))}));function he(e){const t=re(e,"date"),n=new Date(Number((0,w.getDate)(t))-O);return(0,w.isInTheFuture)(n)}function _e(e){const t=re(e,"date"),n=re(e,"modified"),o=q(e).status;return("draft"===o||"auto-draft"===o||"pending"===o)&&(t===n||null===t)}function fe(e){return!!e.deleting.pending}function Ee(e){return!!e.saving.pending}const be=(0,a.createRegistrySelector)((e=>t=>{const n=e(m.store).__experimentalGetEntitiesBeingSaved(),{type:o,id:s}=q(t);return n.some((e=>"postType"!==e.kind||e.name!==o||e.key!==s))})),ve=(0,a.createRegistrySelector)((e=>t=>{const n=Q(t),o=X(t);return!e(m.store).getLastEntitySaveError("postType",n,o)})),ye=(0,a.createRegistrySelector)((e=>t=>{const n=Q(t),o=X(t);return!!e(m.store).getLastEntitySaveError("postType",n,o)}));function we(e){return Ee(e)&&Boolean(e.saving.options?.isAutosave)}function ke(e){return Ee(e)&&Boolean(e.saving.options?.isPreview)}function Se(e){if(e.saving.pending||Ee(e))return;let t=ie(e,"preview_link");t&&"draft"!==q(e).status||(t=re(e,"link"),t&&(t=(0,k.addQueryArgs)(t,{preview:!0})));const n=re(e,"featured_media");return t&&n?(0,k.addQueryArgs)(t,{_thumbnail_id:n}):t}const Pe=(0,a.createRegistrySelector)((e=>()=>{const t=e(g.store).getBlocks();if(t.length>2)return null;let n;if(1===t.length&&(n=t[0].name,"core/embed"===n)){const e=t[0].attributes?.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}})),Ce=(0,a.createRegistrySelector)((e=>t=>{const n=X(t),o=Q(t),s=e(m.store).getEditedEntityRecord("postType",o,n);if(s){if("function"==typeof s.content)return s.content(s);if(s.blocks)return(0,i.__unstableSerializeAndClean)(s.blocks);if(s.content)return s.content}return""}));function Te(e){return Ee(e)&&!ce(e)&&"publish"===re(e,"status")}function xe(e){const t=re(e,"permalink_template");return R.test(t)}function Be(e){const t=Ne(e);if(!t)return null;const{prefix:n,postName:o,suffix:s}=t;return xe(e)?n+o+s:n}function Ie(e){return re(e,"slug")||(0,k.cleanForSlug)(re(e,"title"))||X(e)}function Ne(e){const t=re(e,"permalink_template");if(!t)return null;const n=re(e,"slug")||re(e,"generated_slug"),[o,s]=t.split(R);return{prefix:o,postName:n,suffix:s}}function De(e){return e.postLock.isLocked}function Ae(e){return Object.keys(e.postSavingLock).length>0}function Re(e){return Object.keys(e.postAutosavingLock).length>0}function Oe(e){return e.postLock.isTakeover}function Le(e){return e.postLock.user}function Me(e){return e.postLock.activePostLock}function Fe(e){return Boolean(q(e)._links?.hasOwnProperty("wp:action-unfiltered-html"))}const Ve=(0,a.createRegistrySelector)((e=>()=>!!e(I.store).get("core/edit-post","isPublishSidebarEnabled"))),Ue=y((e=>re(e,"blocks")||(0,i.parse)(Ce(e))),(e=>[re(e,"blocks"),Ce(e)]));function He(e,t){return e.removedPanels.includes(t)}const ze=(0,a.createRegistrySelector)((e=>(t,n)=>{const o=e(I.store).get("core","inactivePanels");return!He(t,n)&&!o?.includes(n)})),Ge=(0,a.createRegistrySelector)((e=>(t,n)=>{const o=e(I.store).get("core","openPanels");return!!o?.includes(n)}));function je(e){return P()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),re(e,"selection")?.selectionStart}function We(e){return P()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),re(e,"selection")?.selectionEnd}function $e(e){return re(e,"selection")}function Ke(e){return!!e.postId}function Ze(e){return e.editorSettings}function Ye(e){return e.renderingMode}function qe(e){return e.deviceType}function Qe(e){return e.listViewPanel}function Xe(e){return!!e.blockInserterPanel}function Je(){return P()("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function et(){return P()("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function tt(e){return(0,a.createRegistrySelector)((t=>(n,...o)=>(P()("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`",version:"6.2"}),t(g.store)[e](...o))))}const nt=tt("getBlockName"),ot=tt("isBlockValid"),st=tt("getBlockAttributes"),rt=tt("getBlock"),it=tt("getBlocks"),at=tt("getClientIdsOfDescendants"),lt=tt("getClientIdsWithDescendants"),ct=tt("getGlobalBlockCount"),ut=tt("getBlocksByClientId"),dt=tt("getBlockCount"),pt=tt("getBlockSelectionStart"),mt=tt("getBlockSelectionEnd"),gt=tt("getSelectedBlockCount"),ht=tt("hasSelectedBlock"),_t=tt("getSelectedBlockClientId"),ft=tt("getSelectedBlock"),Et=tt("getBlockRootClientId"),bt=tt("getBlockHierarchyRootClientId"),vt=tt("getAdjacentBlockClientId"),yt=tt("getPreviousBlockClientId"),wt=tt("getNextBlockClientId"),kt=tt("getSelectedBlocksInitialCaretPosition"),St=tt("getMultiSelectedBlockClientIds"),Pt=tt("getMultiSelectedBlocks"),Ct=tt("getFirstMultiSelectedBlockClientId"),Tt=tt("getLastMultiSelectedBlockClientId"),xt=tt("isFirstMultiSelectedBlock"),Bt=tt("isBlockMultiSelected"),It=tt("isAncestorMultiSelected"),Nt=tt("getMultiSelectedBlocksStartClientId"),Dt=tt("getMultiSelectedBlocksEndClientId"),At=tt("getBlockOrder"),Rt=tt("getBlockIndex"),Ot=tt("isBlockSelected"),Lt=tt("hasSelectedInnerBlock"),Mt=tt("isBlockWithinSelection"),Ft=tt("hasMultiSelection"),Vt=tt("isMultiSelecting"),Ut=tt("isSelectionEnabled"),Ht=tt("getBlockMode"),zt=tt("isTyping"),Gt=tt("isCaretWithinFormattedText"),jt=tt("getBlockInsertionPoint"),Wt=tt("isBlockInsertionPointVisible"),$t=tt("isValidTemplate"),Kt=tt("getTemplate"),Zt=tt("getTemplateLock"),Yt=tt("canInsertBlockType"),qt=tt("getInserterItems"),Qt=tt("hasInserterItems"),Xt=tt("getBlockListSettings");function Jt(e){return Ze(e)?.defaultTemplateTypes}const en=y((e=>{const t=Ze(e)?.defaultTemplatePartAreas||[];return t?.map((e=>({...e,icon:H(e.icon)})))}),(e=>[Ze(e)?.defaultTemplatePartAreas])),tn=y(((e,t)=>{var n;const o=Jt(e);return o&&null!==(n=Object.values(o).find((e=>e.slug===t)))&&void 0!==n?n:z}),((e,t)=>[Jt(e),t]));function nn(e,t){if(!t)return z;const{description:n,slug:o,title:s,area:r}=t,{title:i,description:a}=tn(e,o),l="string"==typeof s?s:s?.rendered;return{title:l&&l!==o?l:i||o,description:("string"==typeof n?n:n?.raw)||a,icon:en(e).find((e=>r===e.area))?.icon||B}}const on=(0,a.createRegistrySelector)((e=>t=>{const n=Q(t),o=e(m.store).getPostType(n);return o?.labels?.singular_name})),sn=window.wp.apiFetch;var rn=n.n(sn);const an=window.wp.notices,ln=window.wp.hooks;function cn(e,t){return`wp-autosave-block-editor-post-${t?"auto-draft":e}`}function un(e,t){window.sessionStorage.removeItem(cn(e,t))}const dn=(e,t,n)=>({dispatch:o})=>{o.setEditedPost(e.type,e.id);if("auto-draft"===e.status&&n){let s;s="content"in t?t.content:e.content.raw;let r=(0,i.parse)(s);r=(0,i.synchronizeBlocksWithTemplate)(r,n),o.resetEditorBlocks(r,{__unstableShouldCreateUndoLevel:!1})}t&&Object.values(t).some((([t,n])=>{var o;return n!==(null!==(o=e[t]?.raw)&&void 0!==o?o:e[t])}))&&o.editPost(t)};function pn(){return P()("wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor",{since:"6.5"}),{type:"DO_NOTHING"}}function mn(){return P()("wp.data.dispatch( 'core/editor' ).resetPost",{since:"6.0",version:"6.3",alternative:"Initialize the editor with the setupEditorState action"}),{type:"DO_NOTHING"}}function gn(){return P()("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function hn(e){return P()("wp.data.dispatch( 'core/editor' ).setupEditorState",{since:"6.5",alternative:"wp.data.dispatch( 'core/editor' ).setEditedPost"}),_n(e.type,e.id)}function _n(e,t){return{type:"SET_EDITED_POST",postType:e,postId:t}}const fn=(e,t)=>({select:n,registry:o})=>{const{id:s,type:r}=n.getCurrentPost();o.dispatch(m.store).editEntityRecord("postType",r,s,e,t)},En=(e={})=>async({select:t,dispatch:n,registry:o})=>{if(!t.isEditedPostSaveable())return;const s=t.getEditedPostContent();e.isAutosave||n.editPost({content:s},{undoIgnore:!0});const r=t.getCurrentPost(),i={id:r.id,...o.select(m.store).getEntityRecordNonTransientEdits("postType",r.type,r.id),content:s};n({type:"REQUEST_POST_UPDATE_START",options:e}),await o.dispatch(m.store).saveEntityRecord("postType",r.type,i,e);let a=o.select(m.store).getLastEntitySaveError("postType",r.type,r.id);if(a||await(0,ln.applyFilters)("editor.__unstableSavePost",Promise.resolve(),e).catch((e=>{a=e})),n({type:"REQUEST_POST_UPDATE_FINISH",options:e}),a){const e=function(e){const{post:t,edits:n,error:o}=e;if(o&&"rest_autosave_no_changes"===o.code)return[];const s=["publish","private","future"],r=-1!==s.indexOf(t.status),i={publish:(0,d.__)("Publishing failed."),private:(0,d.__)("Publishing failed."),future:(0,d.__)("Scheduling failed.")};let a=r||-1===s.indexOf(n.status)?(0,d.__)("Updating failed."):i[n.status];return o.message&&!/<\/?[^>]*>/.test(o.message)&&(a=[a,o.message].join(" ")),[a,{id:D}]}({post:r,edits:i,error:a});e.length&&o.dispatch(an.store).createErrorNotice(...e)}else{const n=t.getCurrentPost(),s=function(e){var t;const{previousPost:n,post:o,postType:s}=e;if(e.options?.isAutosave)return[];const r=["publish","private","future"],i=r.includes(n.status),a=r.includes(o.status),l="trash"===o.status&&"trash"!==n.status;let c,u,p=null!==(t=s?.viewable)&&void 0!==t&&t;l?(c=s.labels.item_trashed,p=!1):i||a?i&&!a?(c=s.labels.item_reverted_to_draft,p=!1):c=!i&&a?{publish:s.labels.item_published,private:s.labels.item_published_privately,future:s.labels.item_scheduled}[o.status]:s.labels.item_updated:(c=(0,d.__)("Draft saved."),u=!0);const m=[];return p&&m.push({label:u?(0,d.__)("View Preview"):s.labels.view_item,url:o.link}),[c,{id:D,type:"snackbar",actions:m}]}({previousPost:r,post:n,postType:await o.resolveSelect(m.store).getPostType(n.type),options:e});s.length&&o.dispatch(an.store).createSuccessNotice(...s),e.isAutosave||o.dispatch(g.store).__unstableMarkLastChangeAsPersistent()}};function bn(){return P()("wp.data.dispatch( 'core/editor' ).refreshPost",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}const vn=()=>async({select:e,dispatch:t,registry:n})=>{const o=e.getCurrentPostType(),s=await n.resolveSelect(m.store).getPostType(o);n.dispatch(an.store).removeNotice(A);const{rest_base:r,rest_namespace:i="wp/v2"}=s;t({type:"REQUEST_POST_DELETE_START"});try{const n=e.getCurrentPost();await rn()({path:`/${i}/${r}/${n.id}`,method:"DELETE"}),await t.savePost()}catch(e){n.dispatch(an.store).createErrorNotice(...(a={error:e},[a.error.message&&"unknown_error"!==a.error.code?a.error.message:(0,d.__)("Trashing failed"),{id:A}]))}var a;t({type:"REQUEST_POST_DELETE_FINISH"})},yn=({local:e=!1,...t}={})=>async({select:n,dispatch:o})=>{const s=n.getCurrentPost();if("wp_template"!==s.type)if(e){const e=n.isEditedPostNew(),t=n.getEditedPostAttribute("title"),o=n.getEditedPostAttribute("content"),r=n.getEditedPostAttribute("excerpt");!function(e,t,n,o,s){window.sessionStorage.setItem(cn(e,t),JSON.stringify({post_title:n,content:o,excerpt:s}))}(s.id,e,t,o,r)}else await o.savePost({isAutosave:!0,...t})},wn=({forceIsAutosaveable:e}={})=>async({select:t,dispatch:n})=>{if((e||t.isEditedPostAutosaveable())&&!t.isPostLocked()){["draft","auto-draft"].includes(t.getEditedPostAttribute("status"))?await n.savePost({isPreview:!0}):await n.autosave({isPreview:!0})}return t.getEditedPostPreviewLink()},kn=()=>({registry:e})=>{e.dispatch(m.store).redo()},Sn=()=>({registry:e})=>{e.dispatch(m.store).undo()};function Pn(){return P()("wp.data.dispatch( 'core/editor' ).createUndoLevel",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function Cn(e){return{type:"UPDATE_POST_LOCK",lock:e}}const Tn=()=>({registry:e})=>{e.dispatch(I.store).set("core/edit-post","isPublishSidebarEnabled",!0)},xn=()=>({registry:e})=>{e.dispatch(I.store).set("core/edit-post","isPublishSidebarEnabled",!1)};function Bn(e){return{type:"LOCK_POST_SAVING",lockName:e}}function In(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function Nn(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function Dn(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}const An=(e,t={})=>({select:n,dispatch:o,registry:s})=>{const{__unstableShouldCreateUndoLevel:r,selection:a}=t,l={blocks:e,selection:a};if(!1!==r){const{id:e,type:t}=n.getCurrentPost();if(s.select(m.store).getEditedEntityRecord("postType",t,e).blocks===l.blocks)return void s.dispatch(m.store).__unstableCreateUndoLevel("postType",t,e);l.content=({blocks:e=[]})=>(0,i.__unstableSerializeAndClean)(e)}o.editPost(l)};function Rn(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const On=e=>({dispatch:t,registry:n,select:o})=>{o.__unstableIsEditorReady()&&(n.dispatch(g.store).clearSelectedBlock(),t.editPost({selection:void 0},{undoIgnore:!0})),t({type:"SET_RENDERING_MODE",mode:e})};function Ln(e){return{type:"SET_DEVICE_TYPE",deviceType:e}}const Mn=e=>({registry:t})=>{var n;const o=null!==(n=t.select(I.store).get("core","inactivePanels"))&&void 0!==n?n:[];let s;s=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(I.store).set("core","inactivePanels",s)},Fn=e=>({registry:t})=>{var n;const o=null!==(n=t.select(I.store).get("core","openPanels"))&&void 0!==n?n:[];let s;s=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(I.store).set("core","openPanels",s)};function Vn(e){return{type:"REMOVE_PANEL",panelName:e}}function Un(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function Hn(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const zn=e=>(...t)=>({registry:n})=>{P()("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`",version:"6.2"}),n.dispatch(g.store)[e](...t)},Gn=zn("resetBlocks"),jn=zn("receiveBlocks"),Wn=zn("updateBlock"),$n=zn("updateBlockAttributes"),Kn=zn("selectBlock"),Zn=zn("startMultiSelect"),Yn=zn("stopMultiSelect"),qn=zn("multiSelect"),Qn=zn("clearSelectedBlock"),Xn=zn("toggleSelection"),Jn=zn("replaceBlocks"),eo=zn("replaceBlock"),to=zn("moveBlocksDown"),no=zn("moveBlocksUp"),oo=zn("moveBlockToPosition"),so=zn("insertBlock"),ro=zn("insertBlocks"),io=zn("showInsertionPoint"),ao=zn("hideInsertionPoint"),lo=zn("setTemplateValidity"),co=zn("synchronizeTemplate"),uo=zn("mergeBlocks"),po=zn("removeBlocks"),mo=zn("removeBlock"),go=zn("toggleBlockMode"),ho=zn("startTyping"),_o=zn("stopTyping"),fo=zn("enterFormattedText"),Eo=zn("exitFormattedText"),bo=zn("insertDefaultBlock"),vo=zn("updateBlockListSettings");function yo(e){return{type:"SET_CURRENT_TEMPLATE_ID",id:e}}const wo=e=>async({select:t,dispatch:n,registry:o})=>{const s=await o.dispatch(m.store).saveEntityRecord("postType","wp_template",e);return o.dispatch(m.store).editEntityRecord("postType",t.getCurrentPostType(),t.getCurrentPostId(),{template:s.slug}),o.dispatch(an.store).createSuccessNotice((0,d.__)("Custom template created. You're in template mode now."),{type:"snackbar",actions:[{label:(0,d.__)("Go back"),onClick:()=>n.setRenderingMode(t.getEditorSettings().defaultRenderingMode)}]}),s},ko=e=>({registry:t})=>{var n;const o=(null!==(n=t.select(I.store).get("core","hiddenBlockTypes"))&&void 0!==n?n:[]).filter((t=>!(Array.isArray(e)?e:[e]).includes(t)));t.dispatch(I.store).set("core","hiddenBlockTypes",o)},So=e=>({registry:t})=>{var n;const o=null!==(n=t.select(I.store).get("core","hiddenBlockTypes"))&&void 0!==n?n:[],s=new Set([...o,...Array.isArray(e)?e:[e]]);t.dispatch(I.store).set("core","hiddenBlockTypes",[...s])},Po={rootClientId:void 0,insertionIndex:void 0,filterValue:void 0},Co=(0,a.createRegistrySelector)((e=>t=>{if("object"==typeof t.blockInserterPanel)return t.blockInserterPanel;if("template-locked"===Ye(t)){const[t]=e(g.store).getBlocksByName("core/post-content");if(t)return{rootClientId:t,insertionIndex:void 0,filterValue:void 0}}return Po}));function To(e){return e.listViewToggleRef}const xo={reducer:f,selectors:e,actions:t},Bo=(0,a.createReduxStore)("core/editor",{...xo});(0,a.register)(Bo),u(Bo).registerPrivateActions(s),u(Bo).registerPrivateSelectors(r);const Io={name:"core/post-meta",label:(0,d._x)("Post Meta","block bindings source"),useSource(e,t){const{getCurrentPostType:n}=(0,a.useSelect)(Bo),{context:o}=e,{key:s}=t,r=o.postType?o.postType:n(),[i,l]=(0,m.useEntityProp)("postType",o.postType,"meta",o.postId);if("wp_template"===r)return{placeholder:s};const c=i[s];return{placeholder:s,value:c,updateValue:e=>{l({...i,[s]:e})}}}},{registerBlockBindingsSource:No}=u((0,a.dispatch)(i.store));No(p),No(Io);const Do=window.wp.compose;function Ao(e){const t=e.avatar_urls&&e.avatar_urls[24]?(0,T.createElement)("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):(0,T.createElement)("span",{className:"editor-autocompleters__no-avatar"});return(0,T.createElement)(T.Fragment,null,t,(0,T.createElement)("span",{className:"editor-autocompleters__user-name"},e.name),(0,T.createElement)("span",{className:"editor-autocompleters__user-slug"},e.slug))}(0,ln.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",(function(e){var t;const n=Object.fromEntries(Object.entries(null!==(t=e.attributes)&&void 0!==t?t:{}).filter((([,{source:e}])=>"meta"===e)).map((([e,{meta:t}])=>[e,t])));return Object.entries(n).length&&(e.edit=(e=>(0,Do.createHigherOrderComponent)((t=>({attributes:n,setAttributes:o,...s})=>{const r=(0,a.useSelect)((e=>e(Bo).getCurrentPostType()),[]),[i,l]=(0,m.useEntityProp)("postType",r,"meta"),c=(0,C.useMemo)((()=>({...n,...Object.fromEntries(Object.entries(e).map((([e,t])=>[e,i[t]])))})),[n,i]);return(0,T.createElement)(t,{attributes:c,setAttributes:t=>{const n=Object.fromEntries(Object.entries(null!=t?t:{}).filter((([t])=>t in e)).map((([t,n])=>[e[t],n])));Object.entries(n).length&&l(n),o(t)},...s})}),"withMetaAttributeSource"))(n)(e.edit)),e}));const Ro={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=(0,a.useSelect)((t=>{const{getUsers:n}=t(m.store);return n({context:"view",search:encodeURIComponent(e)})}),[e]),n=(0,C.useMemo)((()=>t?t.map((e=>({key:`user-${e.slug}`,value:e,label:Ao(e)}))):[]),[t]);return[n]},getOptionCompletion:e=>`@${e.slug}`};(0,ln.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(e=[]){return e.push({...Ro}),e}));const Oo=window.wp.patterns,{useSetPatternBindings:Lo,ResetOverridesControl:Mo,PATTERN_TYPES:Fo,PARTIAL_SYNCING_SUPPORTED_BLOCKS:Vo}=u(Oo.privateApis),Uo=(0,Do.createHigherOrderComponent)((e=>t=>{const n=Object.keys(Vo).includes(t.name);return(0,T.createElement)(T.Fragment,null,(0,T.createElement)(e,{...t}),n&&(0,T.createElement)(Ho,{...t}),t.isSelected&&n&&(0,T.createElement)(zo,{...t}))}));function Ho(e){const t=(0,a.useSelect)((e=>e(Bo).getCurrentPostType()),[]);return Lo(e,t),null}function zo(e){const t=(0,g.useBlockEditingMode)(),n=(0,a.useSelect)((e=>e(Bo).getCurrentPostType()===Fo.user),[]),o=e.attributes.metadata?.bindings,s=!!o&&Object.values(o).some((e=>"core/pattern-overrides"===e.source)),r=!n&&!!e.attributes.metadata?.name&&"disabled"!==t&&s;return(0,T.createElement)(T.Fragment,null,r&&(0,T.createElement)(Mo,{...e}))}(0,ln.addFilter)("editor.BlockEdit","core/editor/with-pattern-override-controls",Uo);const Go=window.wp.keyboardShortcuts;function jo(){const{redo:e,undo:t,savePost:n,setIsListViewOpened:o}=(0,a.useDispatch)(Bo),{isEditedPostDirty:s,isPostSavingLocked:r,isListViewOpened:i}=(0,a.useSelect)(Bo);return(0,Go.useShortcut)("core/editor/undo",(e=>{t(),e.preventDefault()})),(0,Go.useShortcut)("core/editor/redo",(t=>{e(),t.preventDefault()})),(0,Go.useShortcut)("core/editor/save",(e=>{e.preventDefault(),r()||s()&&n()})),(0,Go.useShortcut)("core/editor/toggle-list-view",(e=>{i()||(e.preventDefault(),o(!0))})),null}class Wo extends C.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}}const $o=(0,Do.compose)([(0,a.withSelect)(((e,t)=>{const{getReferenceByDistinctEdits:n}=e(m.store),{isEditedPostDirty:o,isEditedPostAutosaveable:s,isAutosavingPost:r,getEditorSettings:i}=e(Bo),{interval:a=i().autosaveInterval}=t;return{editsReference:n(),isDirty:o(),isAutosaveable:s(),isAutosaving:r(),interval:a}})),(0,a.withDispatch)(((e,t)=>({autosave(){const{autosave:n=e(Bo).autosave}=t;n()}})))])(Wo);var Ko=n(5755),Zo=n.n(Ko);const Yo=window.wp.components,qo=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})),Qo=(0,T.createElement)(x.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,T.createElement)(x.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"})),Xo=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,T.createElement)(x.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})),Jo=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),es=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})),ts=window.wp.keycodes,ns=window.wp.commands,os={wp_pattern:(0,d.__)("Editing pattern: %s"),wp_navigation:(0,d.__)("Editing navigation menu: %s"),wp_template:(0,d.__)("Editing template: %s"),wp_template_part:(0,d.__)("Editing template part: %s")},ss={wp_block:qo,wp_navigation:Qo};function rs(){const{postType:e,postId:t,onNavigateToPreviousEntityRecord:n}=(0,a.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:n,getEditorSettings:o}=e(Bo);return{postType:n(),postId:t(),onNavigateToPreviousEntityRecord:o().onNavigateToPreviousEntityRecord,getEditorSettings:o}}),[]);return(0,T.createElement)(is,{postType:e,postId:t,onBack:n?()=>{n&&n()}:void 0})}function is({postType:e,postId:t,onBack:n}){var o;const{open:s}=(0,a.useDispatch)(ns.store),{editedRecord:r,isResolving:i}=(0,m.useEntityRecord)("postType",e,t),{templateIcon:l,templateTitle:c}=(0,a.useSelect)((e=>{const{__experimentalGetTemplateInfo:t}=e(Bo),n=t(r);return{templateIcon:n.icon,templateTitle:n.title}})),u=!r&&!i,p=null!==(o=ss[e])&&void 0!==o?o:Xo,[h,_]=(0,C.useState)(!1),f=(0,C.useRef)(!0),E=["wp_template","wp_template_part"].includes(e),b=["wp_template","wp_navigation","wp_template_part","wp_block"].includes(e);(0,C.useEffect)((()=>{f.current||_(!0),f.current=!1}),[e,t]);const v=E?c:r.title;return(0,T.createElement)("div",{className:Zo()("editor-document-bar",{"has-back-button":!!n,"is-animated":h,"is-global":b})},n&&(0,T.createElement)(Yo.Button,{className:"editor-document-bar__back",icon:(0,d.isRTL)()?Jo:es,onClick:e=>{e.stopPropagation(),n()},size:"compact"},(0,d.__)("Back")),u&&(0,T.createElement)(Yo.__experimentalText,null,(0,d.__)("Document not found")),!u&&(0,T.createElement)(Yo.Button,{className:"editor-document-bar__command",onClick:()=>s(),size:"compact"},(0,T.createElement)(Yo.__experimentalHStack,{className:"editor-document-bar__title",spacing:1,justify:"center"},(0,T.createElement)(g.BlockIcon,{icon:E?l:p}),(0,T.createElement)(Yo.__experimentalText,{size:"body",as:"h1","aria-label":os[e]?(0,d.sprintf)(os[e],v):void 0},v)),(0,T.createElement)("span",{className:"editor-document-bar__shortcut"},ts.displayShortcut.primary("k"))))}const as=window.wp.richText,ls=({children:e,isValid:t,level:n,href:o,onSelect:s})=>(0,T.createElement)("li",{className:Zo()("document-outline__item",`is-${n.toLowerCase()}`,{"is-invalid":!t})},(0,T.createElement)("a",{href:o,className:"document-outline__button",onClick:s},(0,T.createElement)("span",{className:"document-outline__emdash","aria-hidden":"true"}),(0,T.createElement)("strong",{className:"document-outline__level"},n),(0,T.createElement)("span",{className:"document-outline__item-content"},e))),cs=(0,T.createElement)("em",null,(0,d.__)("(Empty heading)")),us=[(0,T.createElement)("br",{key:"incorrect-break"}),(0,T.createElement)("em",{key:"incorrect-message"},(0,d.__)("(Incorrect heading level)"))],ds=[(0,T.createElement)("br",{key:"incorrect-break-h1"}),(0,T.createElement)("em",{key:"incorrect-message-h1"},(0,d.__)("(Your theme may already use a H1 for the post title)"))],ps=[(0,T.createElement)("br",{key:"incorrect-break-multiple-h1"}),(0,T.createElement)("em",{key:"incorrect-message-multiple-h1"},(0,d.__)("(Multiple H1 headings are not recommended)"))];function ms(){return(0,T.createElement)(Yo.SVG,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,T.createElement)(Yo.Rect,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),(0,T.createElement)(Yo.Line,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),(0,T.createElement)(Yo.Rect,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),(0,T.createElement)(Yo.Path,{d:"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z",fill:"black"}),(0,T.createElement)(Yo.Line,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),(0,T.createElement)(Yo.Rect,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,T.createElement)(Yo.Path,{d:"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z",fill:"black"}),(0,T.createElement)(Yo.Line,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),(0,T.createElement)(Yo.Rect,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),(0,T.createElement)(Yo.Path,{d:"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z",fill:"black"}),(0,T.createElement)(Yo.Line,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),(0,T.createElement)(Yo.Rect,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,T.createElement)(Yo.Path,{d:"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z",fill:"black"}))}const gs=(e=[])=>e.flatMap(((e={})=>"core/heading"===e.name?{...e,level:e.attributes.level,isEmpty:hs(e)}:gs(e.innerBlocks))),hs=e=>!e.attributes.content||0===e.attributes.content.length,_s=(0,Do.compose)((0,a.withSelect)((e=>{var t;const{getBlocks:n}=e(g.store),{getEditedPostAttribute:o}=e(Bo),{getPostType:s}=e(m.store),r=s(o("type"));return{title:o("title"),blocks:n(),isTitleSupported:null!==(t=r?.supports?.title)&&void 0!==t&&t}})))((({blocks:e=[],title:t,onSelect:n,isTitleSupported:o,hasOutlineItemsDisabled:s})=>{const r=gs(e),{selectBlock:i}=(0,a.useDispatch)(g.store);if(r.length<1)return(0,T.createElement)("div",{className:"editor-document-outline has-no-headings"},(0,T.createElement)(ms,null),(0,T.createElement)("p",null,(0,d.__)("Navigate the structure of your document and address issues like empty or incorrect heading levels.")));let l=1;const c=document.querySelector(".editor-post-title__input"),u=o&&t&&c,p=r.reduce(((e,t)=>({...e,[t.level]:(e[t.level]||0)+1})),{})[1]>1;return(0,T.createElement)("div",{className:"document-outline"},(0,T.createElement)("ul",null,u&&(0,T.createElement)(ls,{level:(0,d.__)("Title"),isValid:!0,onSelect:n,href:`#${c.id}`,isDisabled:s},t),r.map(((e,t)=>{const o=e.level>l+1,r=!(e.isEmpty||o||!e.level||1===e.level&&(p||u));return l=e.level,(0,T.createElement)(ls,{key:t,level:`H${e.level}`,isValid:r,isDisabled:s,href:`#block-${e.clientId}`,onSelect:()=>{i(e.clientId),n?.()}},e.isEmpty?cs:(0,as.getTextContent)((0,as.create)({html:e.attributes.content})),o&&us,1===e.level&&p&&ps,u&&1===e.level&&!p&&ds)}))))}));const fs=(0,a.withSelect)((e=>({blocks:e(g.store).getBlocks()})))((function({blocks:e,children:t}){return e.filter((e=>"core/heading"===e.name)).length<1?null:t}));const Es=function(){const{registerShortcut:e}=(0,a.useDispatch)(Go.store);return(0,C.useEffect)((()=>{e({name:"core/editor/save",category:"global",description:(0,d.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/editor/undo",category:"global",description:(0,d.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/editor/redo",category:"global",description:(0,d.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,ts.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/editor/toggle-list-view",category:"global",description:(0,d.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}})}),[e]),(0,T.createElement)(g.BlockEditorKeyboardShortcuts.Register,null)},bs=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"})),vs=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"}));const ys=(0,C.forwardRef)((function(e,t){const n=(0,ts.isAppleOS)()?ts.displayShortcut.primaryShift("z"):ts.displayShortcut.primary("y"),o=(0,a.useSelect)((e=>e(Bo).hasEditorRedo()),[]),{redo:s}=(0,a.useDispatch)(Bo);return(0,T.createElement)(Yo.Button,{...e,ref:t,icon:(0,d.isRTL)()?vs:bs,label:(0,d.__)("Redo"),shortcut:n,"aria-disabled":!o,onClick:o?s:void 0,className:"editor-history__redo"})}));const ws=(0,C.forwardRef)((function(e,t){const n=(0,a.useSelect)((e=>e(Bo).hasEditorUndo()),[]),{undo:o}=(0,a.useDispatch)(Bo);return(0,T.createElement)(Yo.Button,{...e,ref:t,icon:(0,d.isRTL)()?bs:vs,label:(0,d.__)("Undo"),shortcut:ts.displayShortcut.primary("z"),"aria-disabled":!n,onClick:n?o:void 0,className:"editor-history__undo"})}));const ks=(0,Do.compose)([(0,a.withSelect)((e=>({isValid:e(g.store).isValidTemplate()}))),(0,a.withDispatch)((e=>{const{setTemplateValidity:t,synchronizeTemplate:n}=e(g.store);return{resetTemplateValidity:()=>t(!0),synchronizeTemplate:n}}))])((function({isValid:e,...t}){return e?null:(0,T.createElement)(Yo.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:(0,d.__)("Keep it as is"),onClick:t.resetTemplateValidity},{label:(0,d.__)("Reset the template"),onClick:()=>{window.confirm((0,d.__)("Resetting the template may result in loss of content, do you want to continue?"))&&t.synchronizeTemplate()}}]},(0,d.__)("The content of your post doesnt match the template assigned to your post type."))}));const Ss=function(){const{notices:e}=(0,a.useSelect)((e=>({notices:e(an.store).getNotices()})),[]),{removeNotice:t}=(0,a.useDispatch)(an.store),n=e.filter((({isDismissible:e,type:t})=>e&&"default"===t)),o=e.filter((({isDismissible:e,type:t})=>!e&&"default"===t));return(0,T.createElement)(T.Fragment,null,(0,T.createElement)(Yo.NoticeList,{notices:o,className:"components-editor-notices__pinned"}),(0,T.createElement)(Yo.NoticeList,{notices:n,className:"components-editor-notices__dismissible",onRemove:t},(0,T.createElement)(ks,null)))},Ps=-3;function Cs(){const e=(0,a.useSelect)((e=>e(an.store).getNotices()),[]),{removeNotice:t}=(0,a.useDispatch)(an.store),n=e.filter((({type:e})=>"snackbar"===e)).slice(Ps);return(0,T.createElement)(Yo.SnackbarList,{notices:n,className:"components-editor-notices__snackbar",onRemove:t})}const Ts=window.wp.htmlEntities;function xs({record:e,checked:t,onChange:n}){const{name:o,kind:s,title:r,key:i}=e,l=(0,a.useSelect)((e=>{if("postType"!==s||"wp_template"!==o)return r;const t=e(m.store).getEditedEntityRecord(s,o,i);return e(Bo).__experimentalGetTemplateInfo(t).title}),[o,s,r,i]);return(0,T.createElement)(Yo.PanelRow,null,(0,T.createElement)(Yo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Ts.decodeEntities)(l)||(0,d.__)("Untitled"),checked:t,onChange:n}))}const{getGlobalStylesChanges:Bs,GlobalStylesContext:Is}=u(g.privateApis);function Ns({record:e}){const{user:t}=(0,C.useContext)(Is),n=(0,a.useSelect)((t=>t(m.store).getEntityRecord(e.kind,e.name,e.key)),[e.kind,e.name,e.key]),o=Bs(t,n,{maxResults:10});return o.length?(0,T.createElement)("ul",{className:"entities-saved-states__changes"},o.map((e=>(0,T.createElement)("li",{key:e},e)))):null}function Ds({record:e,count:t}){if("globalStyles"===e?.name)return null;const n=function(e,t){switch(e){case"site":return 1===t?(0,d.__)("This change will affect your whole site."):(0,d.__)("These changes will affect your whole site.");case"wp_template":return(0,d.__)("This change will affect pages and posts that use this template.");case"page":case"post":return(0,d.__)("The following has been modified.")}}(e?.name,t);return n?(0,T.createElement)(Yo.PanelRow,null,n):null}function As({list:e,unselectedEntities:t,setUnselectedEntities:n}){const o=e.length,s=e[0];let r=(0,a.useSelect)((e=>e(m.store).getEntityConfig(s.kind,s.name)),[s.kind,s.name]).label;return"wp_template_part"===s?.name&&(r=1===o?(0,d.__)("Template Part"):(0,d.__)("Template Parts")),(0,T.createElement)(Yo.PanelBody,{title:r,initialOpen:!0},(0,T.createElement)(Ds,{record:s,count:o}),e.map((e=>(0,T.createElement)(xs,{key:e.key||e.property,record:e,checked:!t.some((t=>t.kind===e.kind&&t.name===e.name&&t.key===e.key&&t.property===e.property)),onChange:t=>n(e,t)}))),"globalStyles"===s?.name&&(0,T.createElement)(Ns,{record:s}))}const Rs={title:(0,d.__)("Title"),description:(0,d.__)("Tagline"),site_logo:(0,d.__)("Logo"),site_icon:(0,d.__)("Icon"),show_on_front:(0,d.__)("Show on front"),page_on_front:(0,d.__)("Page on front"),posts_per_page:(0,d.__)("Maximum posts per page"),default_comment_status:(0,d.__)("Allow comments on new posts")},Os=()=>{const{editedEntities:e,siteEdits:t}=(0,a.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,getEntityRecordEdits:n}=e(m.store);return{editedEntities:t(),siteEdits:n("root","site")}}),[]),n=(0,C.useMemo)((()=>{const n=e.filter((e=>!("root"===e.kind&&"site"===e.name))),o=[];for(const e in t)o.push({kind:"root",name:"site",title:Rs[e]||e,property:e});return[...n,...o]}),[e,t]),[o,s]=(0,C.useState)([]);return{dirtyEntityRecords:n,isDirty:n.length-o.length>0,setUnselectedEntities:({kind:e,name:t,key:n,property:r},i)=>{s(i?o.filter((o=>o.kind!==e||o.name!==t||o.key!==n||o.property!==r)):[...o,{kind:e,name:t,key:n,property:r}])},unselectedEntities:o}},Ls=[{kind:"postType",name:"wp_navigation"}];function Ms(e){return e}function Fs({close:e}){const t=Os();return(0,T.createElement)(Vs,{close:e,...t})}function Vs({additionalPrompt:e,close:t,onSave:n=Ms,saveEnabled:o,saveLabel:s=(0,d.__)("Save"),dirtyEntityRecords:r,isDirty:i,setUnselectedEntities:l,unselectedEntities:c}){const u=(0,C.useRef)(),{editEntityRecord:p,saveEditedEntityRecord:h,__experimentalSaveSpecifiedEntityEdits:_}=(0,a.useDispatch)(m.store),{__unstableMarkLastChangeAsPersistent:f}=(0,a.useDispatch)(g.store),{createSuccessNotice:E,createErrorNotice:b,removeNotice:v}=(0,a.useDispatch)(an.store),y=r.reduce(((e,t)=>{const{name:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{}),{site:w,wp_template:k,wp_template_part:S,...P}=y,x=[w,k,S,...Object.values(P)].filter(Array.isArray),B=null!=o?o:i,{homeUrl:I}=(0,a.useSelect)((e=>{const{getUnstableBase:t}=e(m.store);return{homeUrl:t()?.home}}),[]),N=(0,C.useCallback)((()=>t()),[t]),[D,A]=(0,Do.__experimentalUseDialog)({onClose:()=>N()});return(0,T.createElement)("div",{ref:D,...A,className:"entities-saved-states__panel"},(0,T.createElement)(Yo.Flex,{className:"entities-saved-states__panel-header",gap:2},(0,T.createElement)(Yo.FlexItem,{isBlock:!0,as:Yo.Button,ref:u,variant:"primary",disabled:!B,onClick:()=>{const e="site-editor-save-success";v(e);const o=r.filter((({kind:e,name:t,key:n,property:o})=>!c.some((s=>s.kind===e&&s.name===t&&s.key===n&&s.property===o))));t(o);const s=[],i=[];o.forEach((({kind:e,name:t,key:n,property:o})=>{"root"===e&&"site"===t?s.push(o):(Ls.some((n=>n.kind===e&&n.name===t))&&p(e,t,n,{status:"publish"}),i.push(h(e,t,n)))})),s.length&&i.push(_("root","site",void 0,s)),f(),Promise.all(i).then((e=>n(e))).then((t=>{t.some((e=>void 0===e))?b((0,d.__)("Saving failed.")):E((0,d.__)("Site updated."),{type:"snackbar",id:e,actions:[{label:(0,d.__)("View site"),url:I}]})})).catch((e=>b(`${(0,d.__)("Saving failed.")} ${e}`)))},className:"editor-entities-saved-states__save-button"},s),(0,T.createElement)(Yo.FlexItem,{isBlock:!0,as:Yo.Button,variant:"secondary",onClick:N},(0,d.__)("Cancel"))),(0,T.createElement)("div",{className:"entities-saved-states__text-prompt"},(0,T.createElement)("strong",{className:"entities-saved-states__text-prompt--header"},(0,d.__)("Are you ready to save?")),e,(0,T.createElement)("p",null,i?(0,C.createInterpolateElement)((0,d.sprintf)((0,d._n)("There is <strong>%d site change</strong> waiting to be saved.","There are <strong>%d site changes</strong> waiting to be saved.",x.length),x.length),{strong:(0,T.createElement)("strong",null)}):(0,d.__)("Select the items you want to save."))),x.map((e=>(0,T.createElement)(As,{key:e[0].name,list:e,unselectedEntities:c,setUnselectedEntities:l}))))}function Us(){try{return(0,a.select)(Bo).getEditedPostContent()}catch(e){}}function Hs({text:e,children:t}){const n=(0,Do.useCopyToClipboard)(e);return(0,T.createElement)(Yo.Button,{variant:"secondary",ref:n},t)}class zs extends C.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,ln.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){const{error:e}=this.state;if(!e)return this.props.children;const t=[(0,T.createElement)(Hs,{key:"copy-post",text:Us},(0,d.__)("Copy Post Text")),(0,T.createElement)(Hs,{key:"copy-error",text:e.stack},(0,d.__)("Copy Error"))];return(0,T.createElement)(g.Warning,{className:"editor-error-boundary",actions:t},(0,d.__)("The editor has encountered an unexpected error."))}}const Gs=zs,js=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame;let Ws;function $s(){const{postId:e,isEditedPostNew:t,hasRemoteAutosave:n}=(0,a.useSelect)((e=>({postId:e(Bo).getCurrentPostId(),isEditedPostNew:e(Bo).isEditedPostNew(),hasRemoteAutosave:!!e(Bo).getEditorSettings().autosave})),[]),{getEditedPostAttribute:o}=(0,a.useSelect)(Bo),{createWarningNotice:s,removeNotice:r}=(0,a.useDispatch)(an.store),{editPost:l,resetEditorBlocks:c}=(0,a.useDispatch)(Bo);(0,C.useEffect)((()=>{let a=function(e,t){return window.sessionStorage.getItem(cn(e,t))}(e,t);if(!a)return;try{a=JSON.parse(a)}catch{return}const{post_title:u,content:p,excerpt:m}=a,g={title:u,content:p,excerpt:m};if(!Object.keys(g).some((e=>g[e]!==o(e))))return void un(e,t);if(n)return;const h="wpEditorAutosaveRestore";s((0,d.__)("The backup of this post in your browser is different from the version below."),{id:h,actions:[{label:(0,d.__)("Restore the backup"),onClick(){const{content:e,...t}=g;l(t),c((0,i.parse)(g.content)),r(h)}}]})}),[t,e])}const Ks=(0,Do.ifCondition)((()=>{if(void 0!==Ws)return Ws;try{window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),Ws=!0}catch{Ws=!1}return Ws}))((function(){const{autosave:e}=(0,a.useDispatch)(Bo),t=(0,C.useCallback)((()=>{js((()=>e({local:!0})))}),[]);$s(),function(){const{postId:e,isEditedPostNew:t,isDirty:n,isAutosaving:o,didError:s}=(0,a.useSelect)((e=>({postId:e(Bo).getCurrentPostId(),isEditedPostNew:e(Bo).isEditedPostNew(),isDirty:e(Bo).isEditedPostDirty(),isAutosaving:e(Bo).isAutosavingPost(),didError:e(Bo).didPostSaveRequestFail()})),[]),r=(0,C.useRef)(n),i=(0,C.useRef)(o);(0,C.useEffect)((()=>{!s&&(i.current&&!o||r.current&&!n)&&un(e,t),r.current=n,i.current=o}),[n,o,s]);const l=(0,Do.usePrevious)(t),c=(0,Do.usePrevious)(e);(0,C.useEffect)((()=>{c===e&&l&&!t&&un(e,!0)}),[t,e])}();const n=(0,a.useSelect)((e=>e(Bo).getEditorSettings().localAutosaveInterval),[]);return(0,T.createElement)($o,{interval:n,autosave:t})}));const Zs=function({children:e}){const t=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Bo),{getPostType:n}=e(m.store),o=n(t("type"));return!!o?.supports?.["page-attributes"]}),[]);return t?e:null};const Ys=function({children:e,supportKeys:t}){const n=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Bo),{getPostType:n}=e(m.store);return n(t("type"))}),[]);let o=!0;return n&&(o=(Array.isArray(t)?t:[t]).some((e=>!!n.supports[e]))),o?e:null};function qs(){const e=(0,a.useSelect)((e=>{var t;return null!==(t=e(Bo).getEditedPostAttribute("menu_order"))&&void 0!==t?t:0}),[]),{editPost:t}=(0,a.useDispatch)(Bo),[n,o]=(0,C.useState)(null),s=null!=n?n:e;return(0,T.createElement)(Yo.Flex,null,(0,T.createElement)(Yo.FlexBlock,null,(0,T.createElement)(Yo.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,d.__)("Order"),value:s,onChange:e=>{o(e);const n=Number(e);Number.isInteger(n)&&""!==e.trim?.()&&t({menu_order:n})},labelPosition:"side",onBlur:()=>{o(null)}})))}function Qs(){return(0,T.createElement)(Ys,{supportKeys:"page-attributes"},(0,T.createElement)(qs,null))}var Xs=n(9681),Js=n.n(Xs);function er(e){const t=e.map((e=>({children:[],parent:null,...e})));if(t.some((({parent:e})=>null===e)))return t;const n=t.reduce(((e,t)=>{const{parent:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{}),o=e=>e.map((e=>{const t=n[e.id];return{...e,children:t&&t.length?o(t):[]}}));return o(n[0]||[])}const tr=e=>(0,Ts.decodeEntities)(e),nr=e=>({...e,name:tr(e.name)}),or=e=>(null!=e?e:[]).map(nr);function sr(e){return e?.title?.rendered?(0,Ts.decodeEntities)(e.title.rendered):`#${e.id} (${(0,d.__)("no title")})`}const rr=(e,t)=>{const n=Js()(e||"").toLowerCase(),o=Js()(t||"").toLowerCase();return n===o?0:n.startsWith(o)?n.length:1/0};const ir=function(){const{editPost:e}=(0,a.useDispatch)(Bo),[t,n]=(0,C.useState)(!1),{isHierarchical:o,parentPostId:s,parentPostTitle:r,pageItems:i}=(0,a.useSelect)((e=>{var n;const{getPostType:o,getEntityRecords:s,getEntityRecord:r}=e(m.store),{getCurrentPostId:i,getEditedPostAttribute:a}=e(Bo),l=a("type"),c=a("parent"),u=o(l),d=i(),p=null!==(n=u?.hierarchical)&&void 0!==n&&n,g={per_page:100,exclude:d,parent_exclude:d,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};t&&(g.search=t);const h=c?r("postType",l,c):null;return{isHierarchical:p,parentPostId:c,parentPostTitle:h?sr(h):"",pageItems:p?s("postType",l,g):null}}),[t]),l=(0,C.useMemo)((()=>{const e=(n,o=0)=>n.map((t=>[{value:t.id,label:"— ".repeat(o)+(0,Ts.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],o+1)])).sort((([e],[n])=>rr(e.rawName,t)>=rr(n.rawName,t)?1:-1)).flat();if(!i)return[];let n=i.map((e=>({id:e.id,parent:e.parent,name:sr(e)})));t||(n=er(n));const o=e(n),a=o.find((e=>e.value===s));return r&&!a&&o.unshift({value:s,label:r}),o}),[i,t,r,s]);return o?(0,T.createElement)(Yo.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:(0,d.__)("Parent"),value:s,options:l,onFilterValueChange:(0,Do.debounce)((e=>{n(e)}),300),onChange:t=>{e({parent:t})}}):null},ar="page-attributes";const lr=function(){var e;const{isEnabled:t,isOpened:n,postType:o}=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:n,isEditorPanelOpened:o}=e(Bo),{getPostType:s}=e(m.store);return{isEnabled:n(ar),isOpened:o(ar),postType:s(t("type"))}}),[]),{toggleEditorPanelOpened:s}=(0,a.useDispatch)(Bo);return t&&o?(0,T.createElement)(Zs,null,(0,T.createElement)(Yo.PanelBody,{title:null!==(e=o?.labels?.attributes)&&void 0!==e?e:(0,d.__)("Page attributes"),opened:n,onToggle:(...e)=>s(ar,...e)},(0,T.createElement)(ir,null),(0,T.createElement)(Yo.PanelRow,null,(0,T.createElement)(Qs,null)))):null},cr=(0,T.createElement)(x.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,T.createElement)(x.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18.5 5.5V8H20V5.5H22.5V4H20V1.5H18.5V4H16V5.5H18.5ZM13.9624 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V10.0391H18.5V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 10.4917L16.4589 10.5139L16.4641 9.01389L5.5 8.97618V6C5.5 5.72386 5.72386 5.5 6 5.5H13.9624V4ZM5.5 10.4762V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 10.4865L5.5 10.4762Z"})),ur=(0,d.__)("Custom Template");function dr({onClose:e}){const{defaultBlockTemplate:t,onNavigateToEntityRecord:n}=(0,a.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:n}=e(Bo);return{defaultBlockTemplate:t().defaultBlockTemplate,onNavigateToEntityRecord:t().onNavigateToEntityRecord,getTemplateId:n}})),{createTemplate:o}=u((0,a.useDispatch)(Bo)),[s,r]=(0,C.useState)(""),[l,c]=(0,C.useState)(!1),p=()=>{r(""),e()};return(0,T.createElement)(Yo.Modal,{title:(0,d.__)("Create custom template"),onRequestClose:p},(0,T.createElement)("form",{className:"editor-post-template__create-form",onSubmit:async e=>{if(e.preventDefault(),l)return;c(!0);const r=null!=t?t:(0,i.serialize)([(0,i.createBlock)("core/group",{tagName:"header",layout:{inherit:!0}},[(0,i.createBlock)("core/site-title"),(0,i.createBlock)("core/site-tagline")]),(0,i.createBlock)("core/separator"),(0,i.createBlock)("core/group",{tagName:"main"},[(0,i.createBlock)("core/group",{layout:{inherit:!0}},[(0,i.createBlock)("core/post-title")]),(0,i.createBlock)("core/post-content",{layout:{inherit:!0}})])]),a=await o({slug:(0,k.cleanForSlug)(s||ur),content:r,title:s||ur});c(!1),n({postId:a.id,postType:"wp_template"}),p()}},(0,T.createElement)(Yo.__experimentalVStack,{spacing:"3"},(0,T.createElement)(Yo.TextControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Name"),value:s,onChange:r,placeholder:ur,disabled:l,help:(0,d.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),(0,T.createElement)(Yo.__experimentalHStack,{justify:"right"},(0,T.createElement)(Yo.Button,{variant:"tertiary",onClick:p},(0,d.__)("Cancel")),(0,T.createElement)(Yo.Button,{variant:"primary",type:"submit",isBusy:l,"aria-disabled":l},(0,d.__)("Create"))))))}function pr(){return(0,a.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:n}=e(Bo);return{postId:t(),postType:n()}}),[])}function mr(){const{postType:e,postId:t}=pr();return(0,a.useSelect)((n=>{const{getEntityRecord:o,getEntityRecords:s}=n(m.store),r=o("root","site"),i=s("postType","wp_template",{per_page:-1}),a=+t===r?.page_for_posts,l="page"===e&&+t===r?.page_on_front&&i?.some((({slug:e})=>"front-page"===e));return!a&&!l}),[t,e])}function gr(e){return(0,a.useSelect)((t=>t(m.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:e})),[e])}function hr(e){const t=_r(),n=mr(),o=gr(e);return(0,C.useMemo)((()=>n&&o?.filter((e=>e.is_custom&&e.slug!==t&&!!e.content.raw))),[o,t,n])}function _r(){const{postType:e,postId:t}=pr(),n=gr(e),o=(0,a.useSelect)((n=>{const o=n(m.store).getEditedEntityRecord("postType",e,t);return o?.template}),[e,t]);if(o)return n?.find((e=>e.slug===o))?.slug}const fr={className:"editor-post-template__dropdown",placement:"bottom-start"};function Er({isOpen:e,onClick:t}){const n=(0,a.useSelect)((e=>{const t=e(Bo).getEditedPostAttribute("template"),{supportsTemplateMode:n,availableTemplates:o}=e(Bo).getEditorSettings();if(!n&&o[t])return o[t];const s=e(m.store).canUser("create","templates")&&e(Bo).getCurrentTemplateId();return s?.title||s?.slug||o?.[t]}),[]);return(0,T.createElement)(Yo.Button,{__next40pxDefaultSize:!0,className:"edit-post-post-template__toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,d.__)("Template options"),onClick:t},null!=n?n:(0,d.__)("Default template"))}function br({onClose:e}){var t,n;const o=mr(),{availableTemplates:s,fetchedTemplates:r,selectedTemplateSlug:i,canCreate:l,canEdit:c,currentTemplateId:u,onNavigateToEntityRecord:p,getEditorSettings:h}=(0,a.useSelect)((e=>{const{canUser:t,getEntityRecords:n}=e(m.store),s=e(Bo).getEditorSettings(),r=t("create","templates"),i=e(Bo).getCurrentTemplateId();return{availableTemplates:s.availableTemplates,fetchedTemplates:r?n("postType","wp_template",{post_type:e(Bo).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:e(Bo).getEditedPostAttribute("template"),canCreate:o&&r&&s.supportsTemplateMode,canEdit:o&&r&&s.supportsTemplateMode&&!!i,currentTemplateId:i,onNavigateToEntityRecord:s.onNavigateToEntityRecord,getEditorSettings:e(Bo).getEditorSettings}}),[o]),_=(0,C.useMemo)((()=>Object.entries({...s,...Object.fromEntries((null!=r?r:[]).map((({slug:e,title:t})=>[e,t.rendered])))}).map((([e,t])=>({value:e,label:t})))),[s,r]),f=null!==(t=_.find((e=>e.value===i)))&&void 0!==t?t:_.find((e=>!e.value)),{editPost:E}=(0,a.useDispatch)(Bo),{createSuccessNotice:b}=(0,a.useDispatch)(an.store),[v,y]=(0,C.useState)(!1);return(0,T.createElement)("div",{className:"editor-post-template__classic-theme-dropdown"},(0,T.createElement)(g.__experimentalInspectorPopoverHeader,{title:(0,d.__)("Template"),help:(0,d.__)("Templates define the way content is displayed when viewing your site."),actions:l?[{icon:cr,label:(0,d.__)("Add template"),onClick:()=>y(!0)}]:[],onClose:e}),o?(0,T.createElement)(Yo.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:(0,d.__)("Template"),value:null!==(n=f?.value)&&void 0!==n?n:"",options:_,onChange:e=>E({template:e||""})}):(0,T.createElement)(Yo.Notice,{status:"warning",isDismissible:!1},(0,d.__)("The posts page template cannot be changed.")),c&&p&&(0,T.createElement)("p",null,(0,T.createElement)(Yo.Button,{variant:"link",onClick:()=>{p({postId:u,postType:"wp_template"}),e(),b((0,d.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:[{label:(0,d.__)("Go back"),onClick:()=>h().onNavigateToPreviousEntityRecord()}]})}},(0,d.__)("Edit template"))),v&&(0,T.createElement)(dr,{onClose:()=>y(!1)}))}const vr=function(){return(0,T.createElement)(Yo.Dropdown,{popoverProps:fr,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,T.createElement)(Er,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,T.createElement)(br,{onClose:e})})},yr=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));function wr({onClick:e}){const[t,n]=(0,C.useState)(!1),o=(0,C.useCallback)((()=>{n(!1)}),[]),{postType:s,postId:r}=pr(),i=hr(s),{editEntityRecord:l}=(0,a.useDispatch)(m.store);if(!i?.length)return null;return(0,T.createElement)(T.Fragment,null,(0,T.createElement)(Yo.MenuItem,{onClick:()=>n(!0)},(0,d.__)("Swap template")),t&&(0,T.createElement)(Yo.Modal,{title:(0,d.__)("Choose a template"),onRequestClose:o,overlayClassName:"editor-post-template__swap-template-modal",isFullScreen:!0},(0,T.createElement)("div",{className:"editor-post-template__swap-template-modal-content"},(0,T.createElement)(kr,{postType:s,onSelect:async t=>{l("postType",s,r,{template:t.name},{undoIgnore:!0}),o(),e()}}))))}function kr({postType:e,onSelect:t}){const n=hr(e),o=(0,C.useMemo)((()=>n.map((e=>({name:e.slug,blocks:(0,i.parse)(e.content.raw),title:(0,Ts.decodeEntities)(e.title.rendered),id:e.id})))),[n]),s=(0,Do.useAsyncList)(o);return(0,T.createElement)(g.__experimentalBlockPatternsList,{label:(0,d.__)("Templates"),blockPatterns:o,shownPatterns:s,onClickPattern:t})}function Sr({onClick:e}){const t=_r(),n=mr(),{postType:o,postId:s}=pr(),{editEntityRecord:r}=(0,a.useDispatch)(m.store);return t&&n?(0,T.createElement)(Yo.MenuItem,{onClick:()=>{r("postType",o,s,{template:""},{undoIgnore:!0}),e()}},(0,d.__)("Use default template")):null}function Pr({onClick:e}){const{canCreateTemplates:t}=(0,a.useSelect)((e=>{const{canUser:t}=e(m.store);return{canCreateTemplates:t("create","templates")}}),[]),[n,o]=(0,C.useState)(!1),s=mr();return t&&s?(0,T.createElement)(T.Fragment,null,(0,T.createElement)(Yo.MenuItem,{onClick:()=>{o(!0)}},(0,d.__)("Create new template")),n&&(0,T.createElement)(dr,{onClose:()=>{o(!1),e()}})):null}const Cr={className:"editor-post-template__dropdown",placement:"bottom-start"};function Tr({id:e}){const{isTemplateHidden:t,onNavigateToEntityRecord:n,getEditorSettings:o,hasGoBack:s}=(0,a.useSelect)((e=>{const{getRenderingMode:t,getEditorSettings:n}=u(e(Bo)),o=n();return{isTemplateHidden:"post-only"===t(),onNavigateToEntityRecord:o.onNavigateToEntityRecord,getEditorSettings:n,hasGoBack:o.hasOwnProperty("onNavigateToPreviousEntityRecord")}}),[]),{editedRecord:r,hasResolved:i}=(0,m.useEntityRecord)("postType","wp_template",e),{createSuccessNotice:l}=(0,a.useDispatch)(an.store),{setRenderingMode:c}=(0,a.useDispatch)(Bo);if(!i)return null;const p=s?[{label:(0,d.__)("Go back"),onClick:()=>o().onNavigateToPreviousEntityRecord()}]:void 0;return(0,T.createElement)(Yo.DropdownMenu,{popoverProps:Cr,focusOnMount:!0,toggleProps:{__next40pxDefaultSize:!0,variant:"tertiary"},label:(0,d.__)("Template options"),text:(0,Ts.decodeEntities)(r.title),icon:null},(({onClose:e})=>(0,T.createElement)(T.Fragment,null,(0,T.createElement)(Yo.MenuGroup,null,(0,T.createElement)(Yo.MenuItem,{onClick:()=>{n({postId:r.id,postType:"wp_template"}),e(),l((0,d.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:p})}},(0,d.__)("Edit template")),(0,T.createElement)(wr,{onClick:e}),(0,T.createElement)(Sr,{onClick:e}),(0,T.createElement)(Pr,{onClick:e})),(0,T.createElement)(Yo.MenuGroup,null,(0,T.createElement)(Yo.MenuItem,{icon:t?void 0:yr,isSelected:!t,role:"menuitemcheckbox",onClick:()=>{c(t?"template-locked":"post-only")}},(0,d.__)("Template preview"))))))}const xr=(0,C.forwardRef)((({className:e,label:t,children:n},o)=>(0,T.createElement)(Yo.__experimentalHStack,{className:Zo()("editor-post-panel__row",e),ref:o},t&&(0,T.createElement)("div",{className:"editor-post-panel__row-label"},t),(0,T.createElement)("div",{className:"editor-post-panel__row-control"},n)))),Br=xr;function Ir(){const{templateId:e,isBlockTheme:t}=(0,a.useSelect)((e=>{const{getCurrentTemplateId:t,getEditorSettings:n}=e(Bo);return{templateId:t(),isBlockTheme:n().__unstableIsBlockBasedTheme}}),[]),n=(0,a.useSelect)((e=>{var t;const n=e(Bo).getCurrentPostType(),o=e(m.store).getPostType(n);if(!o?.viewable)return!1;const s=e(Bo).getEditorSettings();if(!!s.availableTemplates&&Object.keys(s.availableTemplates).length>0)return!0;if(!s.supportsTemplateMode)return!1;return null!==(t=e(m.store).canUser("create","templates"))&&void 0!==t&&t}),[]),o=(0,a.useSelect)((e=>{var t;return null!==(t=e(m.store).canUser("read","templates"))&&void 0!==t&&t}),[]);return t&&o||!n?t&&e?(0,T.createElement)(Br,{label:(0,d.__)("Template")},(0,T.createElement)(Tr,{id:e})):null:(0,T.createElement)(Br,{label:(0,d.__)("Template")},(0,T.createElement)(vr,null))}const Nr={_fields:"id,name",context:"view"},Dr={who:"authors",per_page:50,...Nr};function Ar(e){const{authorId:t,authors:n,postAuthor:o}=(0,a.useSelect)((t=>{const{getUser:n,getUsers:o}=t(m.store),{getEditedPostAttribute:s}=t(Bo),r=s("author"),i={...Dr};return e&&(i.search=e),{authorId:r,authors:o(i),postAuthor:n(r,Nr)}}),[e]);return{authorId:t,authorOptions:(0,C.useMemo)((()=>{const e=(null!=n?n:[]).map((e=>({value:e.id,label:(0,Ts.decodeEntities)(e.name)})));return e.findIndex((({value:e})=>o?.id===e))<0&&o?[{value:o.id,label:(0,Ts.decodeEntities)(o.name)},...e]:e}),[n,o])}}function Rr(){const[e,t]=(0,C.useState)(),{editPost:n}=(0,a.useDispatch)(Bo),{authorId:o,authorOptions:s}=Ar(e);return(0,T.createElement)(Yo.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,d.__)("Author"),options:s,value:o,onFilterValueChange:(0,Do.debounce)((e=>{t(e)}),300),onChange:e=>{e&&n({author:e})},allowReset:!1})}function Or(){const{editPost:e}=(0,a.useDispatch)(Bo),{authorId:t,authorOptions:n}=Ar();return(0,T.createElement)(Yo.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-author-selector",label:(0,d.__)("Author"),options:n,onChange:t=>{const n=Number(t);e({author:n})},value:t})}const Lr=function(){return(0,a.useSelect)((e=>{const t=e(m.store).getUsers(Dr);return t?.length>=25}),[])?(0,T.createElement)(Rr,null):(0,T.createElement)(Or,null)};function Mr({children:e}){const{hasAssignAuthorAction:t,hasAuthors:n}=(0,a.useSelect)((e=>{var t;const n=e(Bo).getCurrentPost(),o=e(m.store).getUsers(Dr);return{hasAssignAuthorAction:null!==(t=n._links?.["wp:action-assign-author"])&&void 0!==t&&t,hasAuthors:o?.length>=1}}),[]);return t&&n?(0,T.createElement)(Ys,{supportKeys:"author"},e):null}const Fr=function(){return(0,T.createElement)(Mr,null,(0,T.createElement)(Br,{className:"editor-post-author__panel"},(0,T.createElement)(Lr,null)))};const Vr=function(){const e=(0,a.useSelect)((e=>{var t;return null!==(t=e(Bo).getEditedPostAttribute("comment_status"))&&void 0!==t?t:"open"}),[]),{editPost:t}=(0,a.useDispatch)(Bo);return(0,T.createElement)(Yo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Allow comments"),checked:"open"===e,onChange:()=>t({comment_status:"open"===e?"closed":"open"})})};const Ur=function(){const e=(0,a.useSelect)((e=>{var t;return null!==(t=e(Bo).getEditedPostAttribute("ping_status"))&&void 0!==t?t:"open"}),[]),{editPost:t}=(0,a.useDispatch)(Bo);return(0,T.createElement)(Yo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Allow pingbacks & trackbacks"),checked:"open"===e,onChange:()=>t({ping_status:"open"===e?"closed":"open"})})},Hr="discussion-panel";const zr=function(){const{isEnabled:e,isOpened:t}=(0,a.useSelect)((e=>{const{isEditorPanelEnabled:t,isEditorPanelOpened:n}=e(Bo);return{isEnabled:t(Hr),isOpened:n(Hr)}}),[]),{toggleEditorPanelOpened:n}=(0,a.useDispatch)(Bo);return e?(0,T.createElement)(Ys,{supportKeys:["comments","trackbacks"]},(0,T.createElement)(Yo.PanelBody,{title:(0,d.__)("Discussion"),opened:t,onToggle:()=>n(Hr)},(0,T.createElement)(Ys,{supportKeys:"comments"},(0,T.createElement)(Yo.PanelRow,null,(0,T.createElement)(Vr,null))),(0,T.createElement)(Ys,{supportKeys:"trackbacks"},(0,T.createElement)(Yo.PanelRow,null,(0,T.createElement)(Ur,null))))):null};const Gr=function(){const e=(0,a.useSelect)((e=>e(Bo).getEditedPostAttribute("excerpt")),[]),{editPost:t}=(0,a.useDispatch)(Bo);return(0,T.createElement)("div",{className:"editor-post-excerpt"},(0,T.createElement)(Yo.TextareaControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Write an excerpt (optional)"),className:"editor-post-excerpt__textarea",onChange:e=>t({excerpt:e}),value:e}),(0,T.createElement)(Yo.ExternalLink,{href:(0,d.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt")},(0,d.__)("Learn more about manual excerpts")))};const jr=function({children:e}){const t=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Bo);return t("type")}),[]);return["wp_template","wp_template_part"].includes(t)?null:(0,T.createElement)(Ys,{supportKeys:"excerpt"},e)},{Fill:Wr,Slot:$r}=(0,Yo.createSlotFill)("PluginPostExcerpt"),Kr=({children:e,className:t})=>(0,T.createElement)(Wr,null,(0,T.createElement)(Yo.PanelRow,{className:t},e));Kr.Slot=$r;const Zr=Kr,Yr="post-excerpt";function qr(){const{isOpened:e,isEnabled:t}=(0,a.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:n}=e(Bo);return{isOpened:t(Yr),isEnabled:n(Yr)}}),[]),{toggleEditorPanelOpened:n}=(0,a.useDispatch)(Bo);return t?(0,T.createElement)(jr,null,(0,T.createElement)(Yo.PanelBody,{title:(0,d.__)("Excerpt"),opened:e,onToggle:()=>n(Yr)},(0,T.createElement)(Zr.Slot,null,(e=>(0,T.createElement)(T.Fragment,null,(0,T.createElement)(Gr,null),e))))):null}const Qr=window.wp.blob;const Xr=(0,a.withSelect)((e=>{const{getThemeSupports:t}=e(m.store),{getEditedPostAttribute:n}=e(Bo);return{postType:n("type"),themeSupports:t()}}))((function({themeSupports:e,children:t,postType:n,supportKeys:o}){return(Array.isArray(o)?o:[o]).some((t=>{var o;const s=null!==(o=e?.[t])&&void 0!==o&&o;return"post-thumbnails"===t&&Array.isArray(s)?s.includes(n):s}))?t:null}));const Jr=function({children:e}){return(0,T.createElement)(Xr,{supportKeys:"post-thumbnails"},(0,T.createElement)(Ys,{supportKeys:"thumbnail"},e))},ei=["image"],ti=(0,d.__)("Featured image"),ni=(0,d.__)("Set featured image"),oi=(0,T.createElement)("p",null,(0,d.__)("To edit the featured image, you need permission to upload media."));const si=(0,a.withSelect)((e=>{const{getMedia:t,getPostType:n}=e(m.store),{getCurrentPostId:o,getEditedPostAttribute:s}=e(Bo),r=s("featured_media");return{media:r?t(r,{context:"view"}):null,currentPostId:o(),postType:n(s("type")),featuredImageId:r}})),ri=(0,a.withDispatch)(((e,{noticeOperations:t},{select:n})=>{const{editPost:o}=e(Bo);return{onUpdateImage(e){o({featured_media:e.id})},onDropImage(e){n(g.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})}}})),ii=(0,Do.compose)(Yo.withNotices,si,ri,(0,Yo.withFilters)("editor.PostFeaturedImage"))((function({currentPostId:e,featuredImageId:t,onUpdateImage:n,onRemoveImage:o,media:s,postType:r,noticeUI:i,noticeOperations:l}){const c=(0,C.useRef)(),[u,p]=(0,C.useState)(!1),{getSettings:m}=(0,a.useSelect)(g.store),{mediaWidth:h,mediaHeight:_,mediaSourceUrl:f}=function(e,t){var n,o;if(!e)return{};const s=(0,ln.applyFilters)("editor.PostFeaturedImage.imageSize","large",e.id,t);if(s in(null!==(n=e?.media_details?.sizes)&&void 0!==n?n:{}))return{mediaWidth:e.media_details.sizes[s].width,mediaHeight:e.media_details.sizes[s].height,mediaSourceUrl:e.media_details.sizes[s].source_url};const r=(0,ln.applyFilters)("editor.PostFeaturedImage.imageSize","thumbnail",e.id,t);return r in(null!==(o=e?.media_details?.sizes)&&void 0!==o?o:{})?{mediaWidth:e.media_details.sizes[r].width,mediaHeight:e.media_details.sizes[r].height,mediaSourceUrl:e.media_details.sizes[r].source_url}:{mediaWidth:e.media_details.width,mediaHeight:e.media_details.height,mediaSourceUrl:e.source_url}}(s,e);function E(e){m().mediaUpload({allowedTypes:ei,filesList:e,onFileChange([e]){(0,Qr.isBlobURL)(e?.url)?p(!0):(e&&n(e),p(!1))},onError(e){l.removeAllNotices(),l.createErrorNotice(e)}})}return(0,T.createElement)(Jr,null,i,(0,T.createElement)("div",{className:"editor-post-featured-image"},s&&(0,T.createElement)("div",{id:`editor-post-featured-image-${t}-describedby`,className:"hidden"},s.alt_text&&(0,d.sprintf)((0,d.__)("Current image: %s"),s.alt_text),!s.alt_text&&(0,d.sprintf)((0,d.__)("The current image has no alternative text. The file name is: %s"),s.media_details.sizes?.full?.file||s.slug)),(0,T.createElement)(g.MediaUploadCheck,{fallback:oi},(0,T.createElement)(g.MediaUpload,{title:r?.labels?.featured_image||ti,onSelect:n,unstableFeaturedImageFlow:!0,allowedTypes:ei,modalClass:"editor-post-featured-image__media-modal",render:({open:e})=>(0,T.createElement)("div",{className:"editor-post-featured-image__container"},(0,T.createElement)(Yo.Button,{ref:c,className:t?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:e,"aria-label":t?(0,d.__)("Edit or replace the image"):null,"aria-describedby":t?`editor-post-featured-image-${t}-describedby`:null},!!t&&s&&(0,T.createElement)(Yo.ResponsiveWrapper,{naturalWidth:h,naturalHeight:_,isInline:!0},(0,T.createElement)("img",{src:f,alt:""})),u&&(0,T.createElement)(Yo.Spinner,null),!t&&!u&&(r?.labels?.set_featured_image||ni)),!!t&&(0,T.createElement)(Yo.__experimentalHStack,{className:"editor-post-featured-image__actions"},(0,T.createElement)(Yo.Button,{className:"editor-post-featured-image__action",onClick:e},(0,d.__)("Replace")),(0,T.createElement)(Yo.Button,{className:"editor-post-featured-image__action",onClick:()=>{o(),c.current.focus()}},(0,d.__)("Remove"))),(0,T.createElement)(Yo.DropZone,{onFilesDrop:E})),value:t}))))})),ai="featured-image";const li=function(){var e;const{postType:t,isEnabled:n,isOpened:o}=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:n,isEditorPanelOpened:o}=e(Bo),{getPostType:s}=e(m.store);return{postType:s(t("type")),isEnabled:n(ai),isOpened:o(ai)}}),[]),{toggleEditorPanelOpened:s}=(0,a.useDispatch)(Bo);return n?(0,T.createElement)(Jr,null,(0,T.createElement)(Yo.PanelBody,{title:null!==(e=t?.labels?.featured_image)&&void 0!==e?e:(0,d.__)("Featured image"),opened:o,onToggle:()=>s(ai)},(0,T.createElement)(ii,null))):null};const ci=function({children:e}){return(0,a.useSelect)((e=>e(Bo).getEditorSettings().disablePostFormats),[])?null:(0,T.createElement)(Ys,{supportKeys:"post-formats"},e)},ui=[{id:"aside",caption:(0,d.__)("Aside")},{id:"audio",caption:(0,d.__)("Audio")},{id:"chat",caption:(0,d.__)("Chat")},{id:"gallery",caption:(0,d.__)("Gallery")},{id:"image",caption:(0,d.__)("Image")},{id:"link",caption:(0,d.__)("Link")},{id:"quote",caption:(0,d.__)("Quote")},{id:"standard",caption:(0,d.__)("Standard")},{id:"status",caption:(0,d.__)("Status")},{id:"video",caption:(0,d.__)("Video")}].sort(((e,t)=>{const n=e.caption.toUpperCase(),o=t.caption.toUpperCase();return n<o?-1:n>o?1:0}));function di(){const e=`post-format-selector-${(0,Do.useInstanceId)(di)}`,{postFormat:t,suggestedFormat:n,supportedFormats:o}=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:n}=e(Bo),o=t("format"),s=e(m.store).getThemeSupports();return{postFormat:null!=o?o:"standard",suggestedFormat:n(),supportedFormats:s.formats}}),[]),s=ui.filter((e=>o?.includes(e.id)||t===e.id)),r=s.find((e=>e.id===n)),{editPost:i}=(0,a.useDispatch)(Bo),l=e=>i({format:e});return(0,T.createElement)(ci,null,(0,T.createElement)("div",{className:"editor-post-format"},(0,T.createElement)(Yo.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Post Format"),value:t,onChange:e=>l(e),id:e,options:s.map((e=>({label:e.caption,value:e.id})))}),r&&r.id!==t&&(0,T.createElement)("p",{className:"editor-post-format__suggestion"},(0,T.createElement)(Yo.Button,{variant:"link",onClick:()=>l(r.id)},(0,d.sprintf)((0,d.__)("Apply suggested format: %s"),r.caption)))))}const pi=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.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"}));const mi=function({children:e}){const{lastRevisionId:t,revisionsCount:n}=(0,a.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(Bo);return{lastRevisionId:t(),revisionsCount:n()}}),[]);return!t||n<2?null:(0,T.createElement)(Ys,{supportKeys:"revisions"},e)};const gi=function(){const{lastRevisionId:e,revisionsCount:t}=(0,a.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(Bo);return{lastRevisionId:t(),revisionsCount:n()}}),[]);return(0,T.createElement)(mi,null,(0,T.createElement)(Yo.Button,{href:(0,k.addQueryArgs)("revision.php",{revision:e}),className:"editor-post-last-revision__title",icon:pi,iconPosition:"right",text:(0,d.sprintf)((0,d.__)("Revisions (%s)"),t)}))};const hi=function(){return(0,T.createElement)(mi,null,(0,T.createElement)(Yo.PanelBody,{className:"editor-post-last-revision__panel"},(0,T.createElement)(gi,null)))};function _i(){const e="core/editor/post-locked-modal-"+(0,Do.useInstanceId)(_i),{autosave:t,updatePostLock:n}=(0,a.useDispatch)(Bo),{isLocked:o,isTakeover:s,user:r,postId:i,postLockUtils:l,activePostLock:c,postType:u,previewLink:p}=(0,a.useSelect)((e=>{const{isPostLocked:t,isPostLockTakeover:n,getPostLockUser:o,getCurrentPostId:s,getActivePostLock:r,getEditedPostAttribute:i,getEditedPostPreviewLink:a,getEditorSettings:l}=e(Bo),{getPostType:c}=e(m.store);return{isLocked:t(),isTakeover:n(),user:o(),postId:s(),postLockUtils:l().postLockUtils,activePostLock:r(),postType:c(i("type")),previewLink:a()}}),[]);if((0,C.useEffect)((()=>{function s(){if(o||!c)return;const e=new window.FormData;if(e.append("action","wp-remove-post-lock"),e.append("_wpnonce",l.unlockNonce),e.append("post_ID",i),e.append("active_post_lock",c),window.navigator.sendBeacon)window.navigator.sendBeacon(l.ajaxUrl,e);else{const t=new window.XMLHttpRequest;t.open("POST",l.ajaxUrl,!1),t.send(e)}}return(0,ln.addAction)("heartbeat.send",e,(function(e){o||(e["wp-refresh-post-lock"]={lock:c,post_id:i})})),(0,ln.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:{name:o.lock_error.name,avatar:o.lock_error.avatar_src_2x}})):o.new_lock&&n({isLocked:!1,activePostLock:o.new_lock})})),window.addEventListener("beforeunload",s),()=>{(0,ln.removeAction)("heartbeat.send",e),(0,ln.removeAction)("heartbeat.tick",e),window.removeEventListener("beforeunload",s)}}),[]),!o)return null;const g=r.name,h=r.avatar,_=(0,k.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:i,action:"edit",_wpnonce:l.nonce}),f=(0,k.addQueryArgs)("edit.php",{post_type:u?.slug}),E=(0,d.__)("Exit editor");return(0,T.createElement)(Yo.Modal,{title:s?(0,d.__)("Someone else has taken over this post"):(0,d.__)("This post is already being edited"),focusOnMount:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,size:"medium"},(0,T.createElement)(Yo.__experimentalHStack,{alignment:"top",spacing:6},!!h&&(0,T.createElement)("img",{src:h,alt:(0,d.__)("Avatar"),className:"editor-post-locked-modal__avatar",width:64,height:64}),(0,T.createElement)("div",null,!!s&&(0,T.createElement)("p",null,(0,C.createInterpolateElement)(g?(0,d.sprintf)((0,d.__)("<strong>%s</strong> now has editing control of this post (<PreviewLink />). Dont worry, your changes up to this moment have been saved."),g):(0,d.__)("Another user now has editing control of this post (<PreviewLink />). Dont worry, your changes up to this moment have been saved."),{strong:(0,T.createElement)("strong",null),PreviewLink:(0,T.createElement)(Yo.ExternalLink,{href:p},(0,d.__)("preview"))})),!s&&(0,T.createElement)(T.Fragment,null,(0,T.createElement)("p",null,(0,C.createInterpolateElement)(g?(0,d.sprintf)((0,d.__)("<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."),g):(0,d.__)("Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."),{strong:(0,T.createElement)("strong",null),PreviewLink:(0,T.createElement)(Yo.ExternalLink,{href:p},(0,d.__)("preview"))})),(0,T.createElement)("p",null,(0,d.__)("If you take over, the other user will lose editing control to the post, but their changes will be saved."))),(0,T.createElement)(Yo.__experimentalHStack,{className:"editor-post-locked-modal__buttons",justify:"flex-end"},!s&&(0,T.createElement)(Yo.Button,{variant:"tertiary",href:_},(0,d.__)("Take over")),(0,T.createElement)(Yo.Button,{variant:"primary",href:f},E)))))}const fi=function({children:e}){const{hasPublishAction:t,isPublished:n}=(0,a.useSelect)((e=>{var t;const{isCurrentPostPublished:n,getCurrentPost:o}=e(Bo);return{hasPublishAction:null!==(t=o()._links?.["wp:action-publish"])&&void 0!==t&&t,isPublished:n()}}),[]);return n||!t?null:e};const Ei=function(){const e=(0,a.useSelect)((e=>e(Bo).getEditedPostAttribute("status")),[]),{editPost:t}=(0,a.useDispatch)(Bo);return(0,T.createElement)(fi,null,(0,T.createElement)(Yo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Pending review"),checked:"pending"===e,onChange:()=>{t({status:"pending"===e?"draft":"pending"})}}))};function bi({className:e,textContent:t,forceIsAutosaveable:n,role:o,onPreview:s}){const{postId:r,currentPostLink:i,previewLink:l,isSaveable:c,isViewable:u}=(0,a.useSelect)((e=>{var t;const n=e(Bo),o=e(m.store).getPostType(n.getCurrentPostType("type"));return{postId:n.getCurrentPostId(),currentPostLink:n.getCurrentPostAttribute("link"),previewLink:n.getEditedPostPreviewLink(),isSaveable:n.isEditedPostSaveable(),isViewable:null!==(t=o?.viewable)&&void 0!==t&&t}}),[]),{__unstableSaveForPreview:p}=(0,a.useDispatch)(Bo);if(!u)return null;const g=`wp-preview-${r}`,h=l||i;return(0,T.createElement)(Yo.Button,{variant:e?void 0:"tertiary",className:e||"editor-post-preview",href:h,target:g,disabled:!c,onClick:async e=>{e.preventDefault();const t=window.open("",g);t.focus(),function(e){let t=(0,C.renderToString)((0,T.createElement)("div",{className:"editor-post-preview-button__interstitial-message"},(0,T.createElement)(Yo.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96"},(0,T.createElement)(Yo.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"}),(0,T.createElement)(Yo.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"})),(0,T.createElement)("p",null,(0,d.__)("Generating preview…"))));t+='\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t',t=(0,ln.applyFilters)("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=(0,d.__)("Generating preview…"),e.close()}(t.document);const o=await p({forceIsAutosaveable:n});t.location=o,s?.()},role:o},t||(0,T.createElement)(T.Fragment,null,(0,d._x)("Preview","imperative verb"),(0,T.createElement)(Yo.VisuallyHidden,{as:"span"},(0,d.__)("(opens in a new tab)"))))}const vi=(0,Do.compose)([(0,a.withSelect)((e=>{var t;const{isCurrentPostPublished:n,isEditedPostBeingScheduled:o,isSavingPost:s,isPublishingPost:r,getCurrentPost:i,getCurrentPostType:a,isAutosavingPost:l}=e(Bo);return{isPublished:n(),isBeingScheduled:o(),isSaving:s(),isPublishing:r(),hasPublishAction:null!==(t=i()._links?.["wp:action-publish"])&&void 0!==t&&t,postType:a(),isAutosaving:l()}}))])((function({isPublished:e,isBeingScheduled:t,isSaving:n,isPublishing:o,hasPublishAction:s,isAutosaving:r,hasNonPostEntityChanges:i}){return o?(0,d.__)("Publishing…"):e&&n&&!r?(0,d.__)("Updating…"):t&&n&&!r?(0,d.__)("Scheduling…"):s?e?i?(0,d.__)("Update…"):(0,d.__)("Update"):t?i?(0,d.__)("Schedule…"):(0,d.__)("Schedule"):(0,d.__)("Publish"):i?(0,d.__)("Submit for Review…"):(0,d.__)("Submit for Review")})),yi=()=>{};class wi extends C.Component{constructor(e){super(e),this.buttonNode=(0,C.createRef)(),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}componentDidMount(){this.props.focusOnMount&&(this.timeoutID=setTimeout((()=>{this.buttonNode.current.focus()}),0))}componentWillUnmount(){clearTimeout(this.timeoutID)}createOnClick(e){return(...t)=>{const{hasNonPostEntityChanges:n,setEntitiesSavedStatesCallback:o}=this.props;return n&&o?(this.setState({entitiesSavedStatesCallback:()=>e(...t)}),o((()=>this.closeEntitiesSavedStates)),yi):e(...t)}}closeEntitiesSavedStates(e){const{postType:t,postId:n}=this.props,{entitiesSavedStatesCallback:o}=this.state;this.setState({entitiesSavedStatesCallback:!1},(()=>{e&&e.some((e=>"postType"===e.kind&&e.name===t&&e.key===n))&&o()}))}render(){const{forceIsDirty:e,hasPublishAction:t,isBeingScheduled:n,isOpen:o,isPostSavingLocked:s,isPublishable:r,isPublished:i,isSaveable:a,isSaving:l,isAutoSaving:c,isToggle:u,onSave:p,onStatusChange:m,onSubmit:g=yi,onToggle:h,visibility:_,hasNonPostEntityChanges:f,isSavingNonPostEntityChanges:E}=this.props,b=(l||!a||s||!r&&!e)&&(!f||E),v=(i||l||!a||!r&&!e)&&(!f||E);let y;y=t?"private"===_?"private":n?"future":"publish":"pending";const w={"aria-disabled":b,className:"editor-post-publish-button",isBusy:!c&&l,variant:"primary",onClick:this.createOnClick((()=>{b||(g(),m(y),p())}))},k={"aria-disabled":v,"aria-expanded":o,className:"editor-post-publish-panel__toggle",isBusy:l&&i,variant:"primary",size:"compact",onClick:this.createOnClick((()=>{v||h()}))},S=n?(0,d.__)("Schedule…"):(0,d.__)("Publish"),P=(0,T.createElement)(vi,{hasNonPostEntityChanges:f}),C=u?k:w,x=u?S:P;return(0,T.createElement)(T.Fragment,null,(0,T.createElement)(Yo.Button,{ref:this.buttonNode,...C,className:Zo()(C.className,"editor-post-publish-button__button",{"has-changes-dot":f})},x))}}const ki=(0,Do.compose)([(0,a.withSelect)((e=>{var t;const{isSavingPost:n,isAutosavingPost:o,isEditedPostBeingScheduled:s,getEditedPostVisibility:r,isCurrentPostPublished:i,isEditedPostSaveable:a,isEditedPostPublishable:l,isPostSavingLocked:c,getCurrentPost:u,getCurrentPostType:d,getCurrentPostId:p,hasNonPostEntityChanges:m,isSavingNonPostEntityChanges:g}=e(Bo);return{isSaving:n(),isAutoSaving:o(),isBeingScheduled:s(),visibility:r(),isSaveable:a(),isPostSavingLocked:c(),isPublishable:l(),isPublished:i(),hasPublishAction:null!==(t=u()._links?.["wp:action-publish"])&&void 0!==t&&t,postType:d(),postId:p(),hasNonPostEntityChanges:m(),isSavingNonPostEntityChanges:g()}})),(0,a.withDispatch)((e=>{const{editPost:t,savePost:n}=e(Bo);return{onStatusChange:e=>t({status:e},{undoIgnore:!0}),onSave:n}}))])(wi),Si=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})),Pi=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,T.createElement)(x.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})),Ci={public:{label:(0,d.__)("Public"),info:(0,d.__)("Visible to everyone.")},private:{label:(0,d.__)("Private"),info:(0,d.__)("Only visible to site admins and editors.")},password:{label:(0,d.__)("Password protected"),info:(0,d.__)("Only those with the password can view this post.")}};function Ti({onClose:e}){const t=(0,Do.useInstanceId)(Ti),{status:n,visibility:o,password:s}=(0,a.useSelect)((e=>({status:e(Bo).getEditedPostAttribute("status"),visibility:e(Bo).getEditedPostVisibility(),password:e(Bo).getEditedPostAttribute("password")}))),{editPost:r,savePost:i}=(0,a.useDispatch)(Bo),[l,c]=(0,C.useState)(!!s),[u,p]=(0,C.useState)(!1);return(0,T.createElement)("div",{className:"editor-post-visibility"},(0,T.createElement)(g.__experimentalInspectorPopoverHeader,{title:(0,d.__)("Visibility"),help:(0,d.__)("Control how this post is viewed."),onClose:e}),(0,T.createElement)("fieldset",{className:"editor-post-visibility__fieldset"},(0,T.createElement)(Yo.VisuallyHidden,{as:"legend"},(0,d.__)("Visibility")),(0,T.createElement)(xi,{instanceId:t,value:"public",label:Ci.public.label,info:Ci.public.info,checked:"public"===o&&!l,onChange:()=>{r({status:"private"===o?"draft":n,password:""}),c(!1)}}),(0,T.createElement)(xi,{instanceId:t,value:"private",label:Ci.private.label,info:Ci.private.info,checked:"private"===o,onChange:()=>{p(!0)}}),(0,T.createElement)(xi,{instanceId:t,value:"password",label:Ci.password.label,info:Ci.password.info,checked:l,onChange:()=>{r({status:"private"===o?"draft":n,password:s||""}),c(!0)}}),l&&(0,T.createElement)("div",{className:"editor-post-visibility__password"},(0,T.createElement)(Yo.VisuallyHidden,{as:"label",htmlFor:`editor-post-visibility__password-input-${t}`},(0,d.__)("Create password")),(0,T.createElement)("input",{className:"editor-post-visibility__password-input",id:`editor-post-visibility__password-input-${t}`,type:"text",onChange:e=>{r({password:e.target.value})},value:s,placeholder:(0,d.__)("Use a secure password")}))),(0,T.createElement)(Yo.__experimentalConfirmDialog,{isOpen:u,onConfirm:()=>{r({status:"private",password:""}),c(!1),p(!1),i()},onCancel:()=>{p(!1)}},(0,d.__)("Would you like to privately publish this post now?")))}function xi({instanceId:e,value:t,label:n,info:o,...s}){return(0,T.createElement)("div",{className:"editor-post-visibility__choice"},(0,T.createElement)("input",{type:"radio",name:`editor-post-visibility__setting-${e}`,value:t,id:`editor-post-${t}-${e}`,"aria-describedby":`editor-post-${t}-${e}-description`,className:"editor-post-visibility__radio",...s}),(0,T.createElement)("label",{htmlFor:`editor-post-${t}-${e}`,className:"editor-post-visibility__label"},n),(0,T.createElement)("p",{id:`editor-post-${t}-${e}-description`,className:"editor-post-visibility__info"},o))}function Bi(){return Ii()}function Ii(){const e=(0,a.useSelect)((e=>e(Bo).getEditedPostVisibility()));return Ci[e]?.label}function Ni(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Di(e){return Di="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Di(e)}function Ai(e){Ni(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===Di(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function Ri(e){Ni(1,arguments);var t=Ai(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Oi(e){Ni(1,arguments);var t=Ai(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}Math.pow(10,8);var Li=6e4,Mi=36e5;function Fi(e,t){var n;Ni(1,arguments);var o=function(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}(null!==(n=null==t?void 0:t.additionalDigits)&&void 0!==n?n:2);if(2!==o&&1!==o&&0!==o)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var s,r=function(e){var t,n={},o=e.split(Vi.dateTimeDelimiter);if(o.length>2)return n;/:/.test(o[0])?t=o[0]:(n.date=o[0],t=o[1],Vi.timeZoneDelimiter.test(n.date)&&(n.date=e.split(Vi.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length)));if(t){var s=Vi.timezone.exec(t);s?(n.time=t.replace(s[1],""),n.timezone=s[1]):n.time=t}return n}(e);if(r.date){var i=function(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),o=e.match(n);if(!o)return{year:NaN,restDateString:""};var s=o[1]?parseInt(o[1]):null,r=o[2]?parseInt(o[2]):null;return{year:null===r?s:100*r,restDateString:e.slice((o[1]||o[2]).length)}}(r.date,o);s=function(e,t){if(null===t)return new Date(NaN);var n=e.match(Ui);if(!n)return new Date(NaN);var o=!!n[4],s=Gi(n[1]),r=Gi(n[2])-1,i=Gi(n[3]),a=Gi(n[4]),l=Gi(n[5])-1;if(o)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,a,l)?function(e,t,n){var o=new Date(0);o.setUTCFullYear(e,0,4);var s=o.getUTCDay()||7,r=7*(t-1)+n+1-s;return o.setUTCDate(o.getUTCDate()+r),o}(t,a,l):new Date(NaN);var c=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Wi[t]||($i(e)?29:28))}(t,r,i)&&function(e,t){return t>=1&&t<=($i(e)?366:365)}(t,s)?(c.setUTCFullYear(t,r,Math.max(s,i)),c):new Date(NaN)}(i.restDateString,i.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);var a,l=s.getTime(),c=0;if(r.time&&(c=function(e){var t=e.match(Hi);if(!t)return NaN;var n=ji(t[1]),o=ji(t[2]),s=ji(t[3]);if(!function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,o,s))return NaN;return n*Mi+o*Li+1e3*s}(r.time),isNaN(c)))return new Date(NaN);if(!r.timezone){var u=new Date(l+c),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return a=function(e){if("Z"===e)return 0;var t=e.match(zi);if(!t)return 0;var n="+"===t[1]?-1:1,o=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,s))return NaN;return n*(o*Mi+s*Li)}(r.timezone),isNaN(a)?new Date(NaN):new Date(l+c+a)}var Vi={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Ui=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Hi=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,zi=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Gi(e){return e?parseInt(e):1}function ji(e){return e&&parseFloat(e.replace(",","."))||0}var Wi=[31,null,31,30,31,30,31,31,30,31,30,31];function $i(e){return e%400==0||e%4==0&&e%100!=0}function Ki({onClose:e}){const{postDate:t,postType:n}=(0,a.useSelect)((e=>({postDate:e(Bo).getEditedPostAttribute("date"),postType:e(Bo).getCurrentPostType()})),[]),{editPost:o}=(0,a.useDispatch)(Bo),[s,r]=(0,C.useState)(Ri(new Date(t))),i=(0,a.useSelect)((e=>e(m.store).getEntityRecords("postType",n,{status:"publish,future",after:Ri(s).toISOString(),before:Oi(s).toISOString(),exclude:[e(Bo).getCurrentPostId()],per_page:100,_fields:"id,date"})),[s,n]),l=(0,C.useMemo)((()=>(i||[]).map((({date:e})=>({date:new Date(e)})))),[i]),c=(0,w.getSettings)(),u=/a(?!\\)/i.test(c.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,T.createElement)(g.__experimentalPublishDateTimePicker,{currentDate:t,onChange:e=>o({date:e}),is12Hour:u,events:l,onMonthPreviewed:e=>r(Fi(e)),onClose:e})}function Zi(e){return Yi(e)}function Yi({full:e=!1}={}){const{date:t,isFloating:n}=(0,a.useSelect)((e=>({date:e(Bo).getEditedPostAttribute("date"),isFloating:e(Bo).isEditedPostDateFloating()})),[]);return e?qi(t):function(e,{isFloating:t=!1,now:n=new Date}={}){if(!e||t)return(0,d.__)("Immediately");if(!function(e){const{timezone:t}=(0,w.getSettings)(),n=Number(t.offset),o=e.getTimezoneOffset()/60*-1;return n===o}(n))return qi(e);const o=(0,w.getDate)(e);if(Qi(o,n))return(0,d.sprintf)((0,d.__)("Today at %s"),(0,w.dateI18n)((0,d._x)("g:i a","post schedule time format"),o));const s=new Date(n);if(s.setDate(s.getDate()+1),Qi(o,s))return(0,d.sprintf)((0,d.__)("Tomorrow at %s"),(0,w.dateI18n)((0,d._x)("g:i a","post schedule time format"),o));if(o.getFullYear()===n.getFullYear())return(0,w.dateI18n)((0,d._x)("F j g:i a","post schedule date format without year"),o);return(0,w.dateI18n)((0,d._x)("F j, Y g:i a","post schedule full date format"),o)}(t,{isFloating:n})}function qi(e){const t=(0,w.getDate)(e),n=function(){const{timezone:e}=(0,w.getSettings)();if(e.abbr&&isNaN(Number(e.abbr)))return e.abbr;const t=e.offset<0?"":"+";return`UTC${t}${e.offsetFormatted}`}(),o=(0,w.dateI18n)((0,d._x)("F j, Y g:i a","post schedule full date format"),t);return(0,d.isRTL)()?`${n} ${o}`:`${o} ${n}`}function Qi(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}const Xi=window.wp.a11y,Ji=3,ea={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function ta({onSelect:e,taxonomy:t}){const{_terms:n,showTerms:o}=(0,a.useSelect)((e=>{const n=e(m.store).getEntityRecords("taxonomy",t.slug,ea);return{_terms:n,showTerms:n?.length>=Ji}}),[t.slug]);if(!o)return null;const s=or(n);return(0,T.createElement)("div",{className:"editor-post-taxonomies__flat-term-most-used"},(0,T.createElement)(Yo.BaseControl.VisualLabel,{as:"h3",className:"editor-post-taxonomies__flat-term-most-used-label"},t.labels.most_used),(0,T.createElement)("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list"},s.map((t=>(0,T.createElement)("li",{key:t.id},(0,T.createElement)(Yo.Button,{variant:"link",onClick:()=>e(t)},t.name))))))}const na=[],oa=20,sa={per_page:oa,_fields:"id,name",context:"view"},ra=(e,t)=>tr(e).toLowerCase()===tr(t).toLowerCase(),ia=(e,t)=>e.map((e=>t.find((t=>ra(t.name,e))).id));function aa({slug:e}){var t,n;const[o,s]=(0,C.useState)([]),[r,i]=(0,C.useState)(""),l=(0,Do.useDebounce)(i,500),{terms:c,termIds:u,taxonomy:p,hasAssignAction:g,hasCreateAction:h,hasResolvedTerms:_}=(0,a.useSelect)((t=>{var n,o;const{getCurrentPost:s,getEditedPostAttribute:r}=t(Bo),{getEntityRecords:i,getTaxonomy:a,hasFinishedResolution:l}=t(m.store),c=s(),u=a(e),d=u?r(u.rest_base):na,p={...sa,include:d.join(","),per_page:-1};return{hasCreateAction:!!u&&(null!==(n=c._links?.["wp:action-create-"+u.rest_base])&&void 0!==n&&n),hasAssignAction:!!u&&(null!==(o=c._links?.["wp:action-assign-"+u.rest_base])&&void 0!==o&&o),taxonomy:u,termIds:d,terms:d.length?i("taxonomy",e,p):na,hasResolvedTerms:l("getEntityRecords",["taxonomy",e,p])}}),[e]),{searchResults:f}=(0,a.useSelect)((t=>{const{getEntityRecords:n}=t(m.store);return{searchResults:r?n("taxonomy",e,{...sa,search:r}):na}}),[r,e]);(0,C.useEffect)((()=>{if(_){const e=(null!=c?c:[]).map((e=>tr(e.name)));s(e)}}),[c,_]);const E=(0,C.useMemo)((()=>(null!=f?f:[]).map((e=>tr(e.name)))),[f]),{editPost:b}=(0,a.useDispatch)(Bo),{saveEntityRecord:v}=(0,a.useDispatch)(m.store),{createErrorNotice:y}=(0,a.useDispatch)(an.store);if(!g)return null;function w(e){b({[p.rest_base]:e})}const k=null!==(t=p?.labels?.add_new_item)&&void 0!==t?t:"post_tag"===e?(0,d.__)("Add new tag"):(0,d.__)("Add new Term"),S=null!==(n=p?.labels?.singular_name)&&void 0!==n?n:"post_tag"===e?(0,d.__)("Tag"):(0,d.__)("Term"),P=(0,d.sprintf)((0,d._x)("%s added","term"),S),x=(0,d.sprintf)((0,d._x)("%s removed","term"),S),B=(0,d.sprintf)((0,d._x)("Remove %s","term"),S);return(0,T.createElement)(T.Fragment,null,(0,T.createElement)(Yo.FormTokenField,{__next40pxDefaultSize:!0,value:o,suggestions:E,onChange:function(t){const n=[...null!=c?c:[],...null!=f?f:[]],o=t.reduce(((e,t)=>(e.some((e=>e.toLowerCase()===t.toLowerCase()))||e.push(t),e)),[]),r=o.filter((e=>!n.find((t=>ra(t.name,e)))));if(s(o),0===r.length)return w(ia(o,n));h&&Promise.all(r.map((t=>async function(t){try{const n=await v("taxonomy",e,t,{throwOnError:!0});return nr(n)}catch(e){if("term_exists"!==e.code)throw e;return{id:e.data.term_id,name:t.name}}}({name:t})))).then((e=>{const t=n.concat(e);return w(ia(o,t))})).catch((e=>{y(e.message,{type:"snackbar"})}))},onInputChange:l,maxSuggestions:oa,label:k,messages:{added:P,removed:x,remove:B}}),(0,T.createElement)(ta,{taxonomy:p,onSelect:function(t){var n;if(u.includes(t.id))return;const o=[...u,t.id],s="post_tag"===e?(0,d.__)("Tag"):(0,d.__)("Term"),r=(0,d.sprintf)((0,d._x)("%s added","term"),null!==(n=p?.labels?.singular_name)&&void 0!==n?n:s);(0,Xi.speak)(r,"assertive"),w(o)}}))}const la=(0,Yo.withFilters)("editor.PostTaxonomyType")(aa),ca=()=>{const e=[(0,d.__)("Suggestion:"),(0,T.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,d.__)("Add tags"))];return(0,T.createElement)(Yo.PanelBody,{initialOpen:!1,title:e},(0,T.createElement)("p",null,(0,d.__)("Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.")),(0,T.createElement)(la,{slug:"post_tag"}))},ua=()=>{const{hasTags:e,isPostTypeSupported:t}=(0,a.useSelect)((e=>{const t=e(Bo).getCurrentPostType(),n=e(m.store).getTaxonomy("post_tag"),o=n?.types?.includes(t),s=void 0!==n,r=n&&e(Bo).getEditedPostAttribute(n.rest_base);return{hasTags:!!r?.length,isPostTypeSupported:s&&o}}),[]),[n]=(0,C.useState)(e);return t?n?null:(0,T.createElement)(ca,null):null},da=(e,t)=>ui.filter((t=>e?.includes(t.id))).find((e=>e.id===t)),pa=({suggestedPostFormat:e,suggestionText:t,onUpdatePostFormat:n})=>(0,T.createElement)(Yo.Button,{variant:"link",onClick:()=>n(e)},t);function ma(){const{currentPostFormat:e,suggestion:t}=(0,a.useSelect)((e=>{var t;const{getEditedPostAttribute:n,getSuggestedPostFormat:o}=e(Bo),s=null!==(t=e(m.store).getThemeSupports().formats)&&void 0!==t?t:[];return{currentPostFormat:n("format"),suggestion:da(s,o())}}),[]),{editPost:n}=(0,a.useDispatch)(Bo),o=[(0,d.__)("Suggestion:"),(0,T.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,d.__)("Use a post format"))];return t&&t.id!==e?(0,T.createElement)(Yo.PanelBody,{initialOpen:!1,title:o},(0,T.createElement)("p",null,(0,d.__)("Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.")),(0,T.createElement)("p",null,(0,T.createElement)(pa,{onUpdatePostFormat:e=>n({format:e}),suggestedPostFormat:t.id,suggestionText:(0,d.sprintf)((0,d.__)('Apply the "%1$s" format.'),t.caption)}))):null}const ga={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view"},ha=8,_a=[];function fa({slug:e}){var t,n;const[o,s]=(0,C.useState)(!1),[r,i]=(0,C.useState)(""),[l,c]=(0,C.useState)(""),[u,p]=(0,C.useState)(!1),[g,h]=(0,C.useState)(""),[_,f]=(0,C.useState)([]),E=(0,Do.useDebounce)(Xi.speak,500),{hasCreateAction:b,hasAssignAction:v,terms:y,loading:w,availableTerms:k,taxonomy:S}=(0,a.useSelect)((t=>{var n,o;const{getCurrentPost:s,getEditedPostAttribute:r}=t(Bo),{getTaxonomy:i,getEntityRecords:a,isResolving:l}=t(m.store),c=i(e),u=s();return{hasCreateAction:!!c&&(null!==(n=u._links?.["wp:action-create-"+c.rest_base])&&void 0!==n&&n),hasAssignAction:!!c&&(null!==(o=u._links?.["wp:action-assign-"+c.rest_base])&&void 0!==o&&o),terms:c?r(c.rest_base):_a,loading:l("getEntityRecords",["taxonomy",e,ga]),availableTerms:a("taxonomy",e,ga)||_a,taxonomy:c}}),[e]),{editPost:P}=(0,a.useDispatch)(Bo),{saveEntityRecord:x}=(0,a.useDispatch)(m.store),B=(0,C.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),s=n(t);return o===s?0:o&&!s?-1:!o&&s?1:0})),o}(er(k),y)),[k]),{createErrorNotice:I}=(0,a.useDispatch)(an.store);if(!v)return null;const N=e=>{P({[S.rest_base]:e})},D=e=>e.map((e=>(0,T.createElement)("div",{key:e.id,className:"editor-post-taxonomies__hierarchical-terms-choice"},(0,T.createElement)(Yo.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:-1!==y.indexOf(e.id),onChange:()=>{(e=>{const t=y.includes(e)?y.filter((t=>t!==e)):[...y,e];N(t)})(parseInt(e.id,10))},label:(0,Ts.decodeEntities)(e.name)}),!!e.children.length&&(0,T.createElement)("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices"},D(e.children))))),A=(t,n,o)=>{var s;return null!==(s=S?.labels?.[t])&&void 0!==s?s:"category"===e?n:o},R=A("add_new_item",(0,d.__)("Add new category"),(0,d.__)("Add new term")),O=A("new_item_name",(0,d.__)("Add new category"),(0,d.__)("Add new term")),L=A("parent_item",(0,d.__)("Parent Category"),(0,d.__)("Parent Term")),M=`${L}`,F=R,V=null!==(t=S?.labels?.search_items)&&void 0!==t?t:(0,d.__)("Search Terms"),U=null!==(n=S?.name)&&void 0!==n?n:(0,d.__)("Terms"),H=k.length>=ha;return(0,T.createElement)(Yo.Flex,{direction:"column",gap:"4"},H&&(0,T.createElement)(Yo.TextControl,{__nextHasNoMarginBottom:!0,label:V,value:g,onChange:e=>{const t=B.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<e.length;o++)t++,void 0!==e[o].children&&(t+=n(e[o].children));return t};h(e),f(t);const o=n(t),s=(0,d.sprintf)((0,d._n)("%d result found.","%d results found.",o),o);E(s,"assertive")}}),(0,T.createElement)("div",{className:"editor-post-taxonomies__hierarchical-terms-list",tabIndex:"0",role:"group","aria-label":U},D(""!==g?_:B)),!w&&b&&(0,T.createElement)(Yo.FlexItem,null,(0,T.createElement)(Yo.Button,{onClick:()=>{p(!u)},className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":u,variant:"link"},R)),u&&(0,T.createElement)("form",{onSubmit:async t=>{var n;if(t.preventDefault(),""===r||o)return;const a=function(e,t,n){return e.find((e=>(!e.parent&&!t||parseInt(e.parent)===parseInt(t))&&e.name.toLowerCase()===n.toLowerCase()))}(k,l,r);if(a)return y.some((e=>e===a.id))||N([...y,a.id]),i(""),void c("");let u;s(!0);try{u=await(p={name:r,parent:l||void 0},x("taxonomy",e,p,{throwOnError:!0}))}catch(e){return void I(e.message,{type:"snackbar"})}var p;const m="category"===e?(0,d.__)("Category"):(0,d.__)("Term"),g=(0,d.sprintf)((0,d._x)("%s added","term"),null!==(n=S?.labels?.singular_name)&&void 0!==n?n:m);(0,Xi.speak)(g,"assertive"),s(!1),i(""),c(""),N([...y,u.id])}},(0,T.createElement)(Yo.Flex,{direction:"column",gap:"4"},(0,T.createElement)(Yo.TextControl,{__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-input",label:O,value:r,onChange:e=>{i(e)},required:!0}),!!k.length&&(0,T.createElement)(Yo.TreeSelect,{__nextHasNoMarginBottom:!0,label:L,noOptionLabel:M,onChange:e=>{c(e)},selectedId:l,tree:B}),(0,T.createElement)(Yo.FlexItem,null,(0,T.createElement)(Yo.Button,{variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit"},F)))))}const Ea=(0,Yo.withFilters)("editor.PostTaxonomyType")(fa);const ba=function(){const e=(0,a.useSelect)((e=>{const t=e(Bo).getCurrentPostType(),{canUser:n,getEntityRecord:o,getTaxonomy:s}=e(m.store),r=s("category"),i=n("read","settings")?o("root","site")?.default_category:void 0,a=i?o("taxonomy","category",i):void 0,l=r&&r.types.some((e=>e===t)),c=r&&e(Bo).getEditedPostAttribute(r.rest_base);return!!r&&!!a&&l&&(0===c?.length||1===c?.length&&a?.id===c[0])}),[]),[t,n]=(0,C.useState)(!1);if((0,C.useEffect)((()=>{e&&n(!0)}),[e]),!t)return null;const o=[(0,d.__)("Suggestion:"),(0,T.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,d.__)("Assign a category"))];return(0,T.createElement)(Yo.PanelBody,{initialOpen:!1,title:o},(0,T.createElement)("p",null,(0,d.__)("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")),(0,T.createElement)(Ea,{slug:"category"}))};function va(e){const t=[];return e.forEach((e=>{t.push(e),t.push(...va(e.innerBlocks))})),t}function ya(e){const{selectBlock:t}=(0,a.useDispatch)(g.store);return(0,T.createElement)(Yo.__unstableMotion.img,{tabIndex:0,role:"button","aria-label":(0,d.__)("Select image block."),onClick:()=>{t(e.clientId)},onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(t(e.clientId),n.preventDefault())},key:e.clientId,alt:e.attributes.alt,src:e.attributes.url,animate:{opacity:1},exit:{opacity:0,scale:0},style:{width:"36px",height:"36px",objectFit:"cover",borderRadius:"2px",cursor:"pointer"},whileHover:{scale:1.08}})}function wa(){const[e,t]=(0,C.useState)(!1),{editorBlocks:n,mediaUpload:o}=(0,a.useSelect)((e=>({editorBlocks:e(Bo).getEditorBlocks(),mediaUpload:e(g.store).getSettings().mediaUpload})),[]),s=va(n).filter((e=>"core/image"===e.name&&e.attributes.url&&!e.attributes.id)),{updateBlockAttributes:r}=(0,a.useDispatch)(g.store);if(!o||!s.length)return null;const i=[(0,d.__)("Suggestion:"),(0,T.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,d.__)("External media"))];return(0,T.createElement)(Yo.PanelBody,{initialOpen:!0,title:i},(0,T.createElement)("p",null,(0,d.__)("Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.")),(0,T.createElement)("div",{style:{display:"inline-flex",flexWrap:"wrap",gap:"8px"}},(0,T.createElement)(Yo.__unstableAnimatePresence,null,s.map((e=>(0,T.createElement)(ya,{key:e.clientId,...e})))),e?(0,T.createElement)(Yo.Spinner,null):(0,T.createElement)(Yo.Button,{variant:"primary",onClick:function(){t(!0),Promise.all(s.map((e=>window.fetch(e.attributes.url.includes("?")?e.attributes.url:e.attributes.url+"?").then((e=>e.blob())).then((t=>new Promise(((n,s)=>{o({filesList:[t],onFileChange:([t])=>{(0,Qr.isBlobURL)(t.url)||(r(e.clientId,{id:t.id,url:t.url}),n())},onError(){s()}})}))))))).finally((()=>{t(!1)}))}},(0,d.__)("Upload"))))}const ka=function({children:e}){const{isBeingScheduled:t,isRequestingSiteIcon:n,hasPublishAction:o,siteIconUrl:s,siteTitle:r,siteHome:i}=(0,a.useSelect)((e=>{var t;const{getCurrentPost:n,isEditedPostBeingScheduled:o}=e(Bo),{getEntityRecord:s,isResolving:r}=e(m.store),i=s("root","__unstableBase",void 0)||{};return{hasPublishAction:null!==(t=n()._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:o(),isRequestingSiteIcon:r("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:i.site_icon_url,siteTitle:i.name,siteHome:i.home&&(0,k.filterURLForDisplay)(i.home)}}),[]);let l,c,u=(0,T.createElement)(Yo.Icon,{className:"components-site-icon",size:"36px",icon:Pi});return s&&(u=(0,T.createElement)("img",{alt:(0,d.__)("Site Icon"),className:"components-site-icon",src:s})),n&&(u=null),o?t?(l=(0,d.__)("Are you ready to schedule?"),c=(0,d.__)("Your work will be published at the specified date and time.")):(l=(0,d.__)("Are you ready to publish?"),c=(0,d.__)("Double-check your settings before publishing.")):(l=(0,d.__)("Are you ready to submit for review?"),c=(0,d.__)("When youre ready, submit your work for review, and an Editor will be able to approve it for you.")),(0,T.createElement)("div",{className:"editor-post-publish-panel__prepublish"},(0,T.createElement)("div",null,(0,T.createElement)("strong",null,l)),(0,T.createElement)("p",null,c),(0,T.createElement)("div",{className:"components-site-card"},u,(0,T.createElement)("div",{className:"components-site-info"},(0,T.createElement)("span",{className:"components-site-name"},(0,Ts.decodeEntities)(r)||(0,d.__)("(Untitled)")),(0,T.createElement)("span",{className:"components-site-home"},i))),(0,T.createElement)(wa,null),o&&(0,T.createElement)(T.Fragment,null,(0,T.createElement)(Yo.PanelBody,{initialOpen:!1,title:[(0,d.__)("Visibility:"),(0,T.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,T.createElement)(Bi,null))]},(0,T.createElement)(Ti,null)),(0,T.createElement)(Yo.PanelBody,{initialOpen:!1,title:[(0,d.__)("Publish:"),(0,T.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,T.createElement)(Zi,null))]},(0,T.createElement)(Ki,null))),(0,T.createElement)(ma,null),(0,T.createElement)(ua,null),(0,T.createElement)(ba,null),e)},Sa="%postname%",Pa="%pagename%";function Ca({text:e,onCopy:t,children:n}){const o=(0,Do.useCopyToClipboard)(e,t);return(0,T.createElement)(Yo.Button,{variant:"secondary",ref:o},n)}class Ta extends C.Component{constructor(){super(...arguments),this.state={showCopyConfirmation:!1},this.onCopy=this.onCopy.bind(this),this.onSelectInput=this.onSelectInput.bind(this),this.postLink=(0,C.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,s=o?.labels?.singular_name,r=o?.labels?.view_item,i=o?.labels?.add_new_item,a="future"===n.status?(e=>{const{slug:t}=e;return e.permalink_template.includes(Sa)?e.permalink_template.replace(Sa,t):e.permalink_template.includes(Pa)?e.permalink_template.replace(Pa,t):e.permalink_template})(n):n.link,l=(0,k.addQueryArgs)("post-new.php",{post_type:n.type}),c=t?(0,T.createElement)(T.Fragment,null,(0,d.__)("is now scheduled. It will go live on")," ",(0,T.createElement)(Zi,null),"."):(0,d.__)("is now live.");return(0,T.createElement)("div",{className:"post-publish-panel__postpublish"},(0,T.createElement)(Yo.PanelBody,{className:"post-publish-panel__postpublish-header"},(0,T.createElement)("a",{ref:this.postLink,href:a},(0,Ts.decodeEntities)(n.title)||(0,d.__)("(no title)"))," ",c),(0,T.createElement)(Yo.PanelBody,null,(0,T.createElement)("p",{className:"post-publish-panel__postpublish-subheader"},(0,T.createElement)("strong",null,(0,d.__)("Whats next?"))),(0,T.createElement)("div",{className:"post-publish-panel__postpublish-post-address-container"},(0,T.createElement)(Yo.TextControl,{__nextHasNoMarginBottom:!0,className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:(0,d.sprintf)((0,d.__)("%s address"),s),value:(0,k.safeDecodeURIComponent)(a),onFocus:this.onSelectInput}),(0,T.createElement)("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap"},(0,T.createElement)(Ca,{text:a,onCopy:this.onCopy},this.state.showCopyConfirmation?(0,d.__)("Copied!"):(0,d.__)("Copy")))),(0,T.createElement)("div",{className:"post-publish-panel__postpublish-buttons"},!t&&(0,T.createElement)(Yo.Button,{variant:"primary",href:a},r),(0,T.createElement)(Yo.Button,{variant:t?"primary":"secondary",href:l},i))),e)}}const xa=(0,a.withSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPost:n,isCurrentPostScheduled:o}=e(Bo),{getPostType:s}=e(m.store);return{post:n(),postType:s(t("type")),isScheduled:o()}}))(Ta);class Ba extends C.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,isBeingScheduled:t,isPublished:n,isPublishSidebarEnabled:o,isScheduled:s,isSaving:r,isSavingNonPostEntityChanges:i,onClose:a,onTogglePublishSidebar:l,PostPublishExtension:c,PrePublishExtension:u,...p}=this.props,{hasPublishAction:m,isDirty:g,isPostTypeViewable:h,..._}=p,f=n||s&&t,E=!f&&!r,b=f&&!r;return(0,T.createElement)("div",{className:"editor-post-publish-panel",..._},(0,T.createElement)("div",{className:"editor-post-publish-panel__header"},b?(0,T.createElement)(Yo.Button,{onClick:a,icon:Si,label:(0,d.__)("Close panel")}):(0,T.createElement)(T.Fragment,null,(0,T.createElement)("div",{className:"editor-post-publish-panel__header-publish-button"},(0,T.createElement)(ki,{focusOnMount:!0,onSubmit:this.onSubmit,forceIsDirty:e})),(0,T.createElement)("div",{className:"editor-post-publish-panel__header-cancel-button"},(0,T.createElement)(Yo.Button,{disabled:i,onClick:a,variant:"secondary"},(0,d.__)("Cancel"))))),(0,T.createElement)("div",{className:"editor-post-publish-panel__content"},E&&(0,T.createElement)(ka,null,u&&(0,T.createElement)(u,null)),b&&(0,T.createElement)(xa,{focusOnMount:!0},c&&(0,T.createElement)(c,null)),r&&(0,T.createElement)(Yo.Spinner,null)),(0,T.createElement)("div",{className:"editor-post-publish-panel__footer"},(0,T.createElement)(Yo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Always show pre-publish checks."),checked:o,onChange:l})))}}const Ia=(0,Do.compose)([(0,a.withSelect)((e=>{var t;const{getPostType:n}=e(m.store),{getCurrentPost:o,getEditedPostAttribute:s,isCurrentPostPublished:r,isCurrentPostScheduled:i,isEditedPostBeingScheduled:a,isEditedPostDirty:l,isAutosavingPost:c,isSavingPost:u,isSavingNonPostEntityChanges:d}=e(Bo),{isPublishSidebarEnabled:p}=e(Bo),g=n(s("type"));return{hasPublishAction:null!==(t=o()._links?.["wp:action-publish"])&&void 0!==t&&t,isPostTypeViewable:g?.viewable,isBeingScheduled:a(),isDirty:l(),isPublished:r(),isPublishSidebarEnabled:p(),isSaving:u()&&!c(),isSavingNonPostEntityChanges:d(),isScheduled:i()}})),(0,a.withDispatch)(((e,{isPublishSidebarEnabled:t})=>{const{disablePublishSidebar:n,enablePublishSidebar:o}=e(Bo);return{onTogglePublishSidebar:()=>{t?n():o()}}})),Yo.withFocusReturn,Yo.withConstrainedTabbing])(Ba),Na=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.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"}));const Da=(0,C.forwardRef)((function({icon:e,size:t=24,...n},o){return(0,C.cloneElement)(e,{width:t,height:t,...n,ref:o})})),Aa=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.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"}));function Ra({forceIsDirty:e}){const[t,n]=(0,C.useState)(!1),o=(0,Do.useViewportMatch)("small"),{isAutosaving:s,isDirty:r,isNew:i,isPending:l,isPublished:c,isSaveable:u,isSaving:p,isScheduled:m,hasPublishAction:g,showIconLabels:h}=(0,a.useSelect)((t=>{var n;const{isEditedPostNew:o,isCurrentPostPublished:s,isCurrentPostScheduled:r,isEditedPostDirty:i,isSavingPost:a,isEditedPostSaveable:l,getCurrentPost:c,isAutosavingPost:u,getEditedPostAttribute:d}=t(Bo),{get:p}=t(I.store);return{isAutosaving:u(),isDirty:e||i(),isNew:o(),isPending:"pending"===d("status"),isPublished:s(),isSaving:a(),isSaveable:l(),isScheduled:r(),hasPublishAction:null!==(n=c()?._links?.["wp:action-publish"])&&void 0!==n&&n,showIconLabels:p("core","showIconLabels")}}),[e]),{savePost:_}=(0,a.useDispatch)(Bo),f=(0,Do.usePrevious)(p);if((0,C.useEffect)((()=>{let e;return f&&!p&&(n(!0),e=setTimeout((()=>{n(!1)}),1e3)),()=>clearTimeout(e)}),[p]),!g&&l)return null;if(c||m)return null;const E=l?(0,d.__)("Save as pending"):(0,d.__)("Save draft"),b=(0,d.__)("Save"),v=t||!i&&!r,y=p||v,w=p||v||!u;let k;return p?k=s?(0,d.__)("Autosaving"):(0,d.__)("Saving"):v?k=(0,d.__)("Saved"):o?k=E:h&&(k=b),(0,T.createElement)(Yo.Button,{className:u||p?Zo()({"editor-post-save-draft":!y,"editor-post-saved-state":y,"is-saving":p,"is-autosaving":s,"is-saved":v,[(0,Yo.__unstableGetAnimateClassName)({type:"loading"})]:p}):void 0,onClick:w?void 0:()=>_(),shortcut:w?void 0:ts.displayShortcut.primary("s"),variant:"tertiary",size:"compact",icon:o?void 0:Na,label:k||E,"aria-disabled":w},y&&(0,T.createElement)(Da,{icon:v?yr:Aa}),k)}function Oa({children:e}){return(0,a.useSelect)((e=>{var t;return null!==(t=e(Bo).getCurrentPost()._links?.["wp:action-publish"])&&void 0!==t&&t}),[])?e:null}function La(){const[e,t]=(0,C.useState)(null),n=(0,C.useMemo)((()=>({anchor:e,"aria-label":(0,d.__)("Change publish date"),placement:"bottom-end"})),[e]),o=Yi(),s=Yi({full:!0});return(0,T.createElement)(Oa,null,(0,T.createElement)(Br,{label:(0,d.__)("Publish"),ref:t},(0,T.createElement)(Yo.Dropdown,{popoverProps:n,focusOnMount:!0,className:"editor-post-schedule__panel-dropdown",contentClassName:"editor-post-schedule__dialog",renderToggle:({onToggle:e,isOpen:t})=>(0,T.createElement)(Yo.Button,{__next40pxDefaultSize:!0,className:"editor-post-schedule__dialog-toggle",variant:"tertiary",onClick:e,"aria-label":(0,d.sprintf)((0,d.__)("Change date: %s"),o),label:s,showTooltip:o!==s,"aria-expanded":t},o),renderContent:({onClose:e})=>(0,T.createElement)(Ki,{onClose:e})})))}function Ma({children:e}){return(0,T.createElement)(Ys,{supportKeys:"slug"},e)}class Fa extends C.Component{constructor({postSlug:e,postTitle:t,postID:n}){super(...arguments),this.state={editedSlug:(0,k.safeDecodeURIComponent)(e)||(0,k.cleanForSlug)(t)||n},this.setSlug=this.setSlug.bind(this)}setSlug(e){const{postSlug:t,onUpdateSlug:n}=this.props,{value:o}=e.target,s=(0,k.cleanForSlug)(o);s!==t&&n(s)}render(){const{editedSlug:e}=this.state;return(0,T.createElement)(Ma,null,(0,T.createElement)(Yo.TextControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Slug"),autoComplete:"off",spellCheck:"false",value:e,onChange:e=>this.setState({editedSlug:e}),onBlur:this.setSlug,className:"editor-post-slug"}))}}const Va=(0,Do.compose)([(0,a.withSelect)((e=>{const{getCurrentPost:t,getEditedPostAttribute:n}=e(Bo),{id:o}=t();return{postSlug:n("slug"),postTitle:n("title"),postID:o}})),(0,a.withDispatch)((e=>{const{editPost:t}=e(Bo);return{onUpdateSlug(e){t({slug:e})}}}))])(Fa);function Ua({children:e}){const{hasStickyAction:t,postType:n}=(0,a.useSelect)((e=>{var t;const n=e(Bo).getCurrentPost();return{hasStickyAction:null!==(t=n._links?.["wp:action-sticky"])&&void 0!==t&&t,postType:e(Bo).getCurrentPostType()}}),[]);return"post"===n&&t?e:null}function Ha(){const e=(0,a.useSelect)((e=>{var t;return null!==(t=e(Bo).getEditedPostAttribute("sticky"))&&void 0!==t&&t}),[]),{editPost:t}=(0,a.useDispatch)(Bo);return(0,T.createElement)(Ua,null,(0,T.createElement)(Yo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Stick to the top of the blog"),checked:e,onChange:()=>t({sticky:!e})}))}function za(){const[e,t]=(0,C.useState)(!1),{editPost:n,savePost:o}=(0,a.useDispatch)(Bo),{isSaving:s,isPublished:r,isScheduled:i}=(0,a.useSelect)((e=>{const{isSavingPost:t,isCurrentPostPublished:n,isCurrentPostScheduled:o}=e(Bo);return{isSaving:t(),isPublished:n(),isScheduled:o()}}),[]),l=s||!r&&!i;let c;r?c=(0,d.__)("Are you sure you want to unpublish this post?"):i&&(c=(0,d.__)("Are you sure you want to unschedule this post?"));return(0,T.createElement)(T.Fragment,null,(0,T.createElement)(Yo.Button,{__next40pxDefaultSize:!0,className:"editor-post-switch-to-draft",onClick:()=>{l||t(!0)},"aria-disabled":l,variant:"secondary",style:{flexGrow:"1",justifyContent:"center"}},(0,d.__)("Switch to draft")),(0,T.createElement)(Yo.__experimentalConfirmDialog,{isOpen:e,onConfirm:()=>{t(!1),n({status:"draft"}),o()},onCancel:()=>t(!1)},c))}const{ReusableBlocksRenameHint:Ga}=u(g.privateApis);function ja(){const{syncStatus:e,postType:t}=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Bo),n=t("meta");return{syncStatus:"unsynced"===n?.wp_pattern_sync_status?"unsynced":t("wp_pattern_sync_status"),postType:t("type")}}));return"wp_block"!==t?null:(0,T.createElement)(Br,{label:(0,d.__)("Sync status")},(0,T.createElement)("div",{className:"editor-post-sync-status__value"},"unsynced"===e?(0,d._x)("Not synced","Text that indicates that the pattern is not synchronized"):(0,d._x)("Synced","Text that indicates that the pattern is synchronized")))}function Wa(){const{editPost:e}=(0,a.useDispatch)(Bo),[t,n]=(0,C.useState)(!1),[o,s]=(0,C.useState)(void 0),{postType:r,isNewPost:i}=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t,isCleanNewPost:n}=e(Bo);return{postType:t("type"),isNewPost:n()}}),[]);(0,C.useEffect)((()=>{i&&"wp_block"===r&&n(!0)}),[]);return"wp_block"===r&&i?(0,T.createElement)(T.Fragment,null,t&&(0,T.createElement)(Yo.Modal,{title:(0,d.__)("Set pattern sync status"),onRequestClose:()=>{n(!1)},overlayClassName:"reusable-blocks-menu-items__convert-modal"},(0,T.createElement)("form",{onSubmit:t=>{t.preventDefault(),n(!1),e({meta:{wp_pattern_sync_status:o}})}},(0,T.createElement)(Yo.__experimentalVStack,{spacing:"5"},(0,T.createElement)(Ga,null),(0,T.createElement)(Yo.ToggleControl,{label:(0,d._x)("Synced","Option that makes an individual pattern synchronized"),help:(0,d.__)("Sync this pattern across multiple locations."),checked:!o,onChange:()=>{s(o?void 0:"unsynced")}}),(0,T.createElement)(Yo.__experimentalHStack,{justify:"right"},(0,T.createElement)(Yo.Button,{variant:"primary",type:"submit"},(0,d.__)("Create"))))))):null}const $a=e=>e;const Ka=function({taxonomyWrapper:e=$a}){const{postType:t,taxonomies:n}=(0,a.useSelect)((e=>({postType:e(Bo).getCurrentPostType(),taxonomies:e(m.store).getTaxonomies({per_page:-1})})),[]);return(null!=n?n:[]).filter((e=>e.types.includes(t)&&e.visibility?.show_ui)).map((t=>{const n=t.hierarchical?Ea:la;return(0,T.createElement)(C.Fragment,{key:`taxonomy-${t.slug}`},e((0,T.createElement)(n,{slug:t.slug}),t))}))};function Za({children:e}){const t=(0,a.useSelect)((e=>{const t=e(Bo).getCurrentPostType(),n=e(m.store).getTaxonomies({per_page:-1});return n?.some((e=>e.types.includes(t)))}),[]);return t?e:null}function Ya({taxonomy:e,children:t}){const n=e?.slug,o=n?`taxonomy-panel-${n}`:"",{isEnabled:s,isOpened:r}=(0,a.useSelect)((e=>{const{isEditorPanelEnabled:t,isEditorPanelOpened:s}=e(Bo);return{isEnabled:!!n&&t(o),isOpened:!!n&&s(o)}}),[o,n]),{toggleEditorPanelOpened:i}=(0,a.useDispatch)(Bo);if(!s)return null;const l=e?.labels?.menu_name;return l?(0,T.createElement)(Yo.PanelBody,{title:l,opened:r,onToggle:()=>i(o)},t):null}const qa=function(){return(0,T.createElement)(Za,null,(0,T.createElement)(Ka,{taxonomyWrapper:(e,t)=>(0,T.createElement)(Ya,{taxonomy:t},e)}))};var Qa=n(4132);function Xa(){const e=(0,Do.useInstanceId)(Xa),{content:t,blocks:n,type:o,id:s}=(0,a.useSelect)((e=>{const{getEditedEntityRecord:t}=e(m.store),{getCurrentPostType:n,getCurrentPostId:o}=e(Bo),s=n(),r=o(),i=t("postType",s,r);return{content:i?.content,blocks:i?.blocks,type:s,id:r}}),[]),{editEntityRecord:r}=(0,a.useDispatch)(m.store),l=(0,C.useMemo)((()=>t instanceof Function?t({blocks:n}):n?(0,i.__unstableSerializeAndClean)(n):t),[t,n]);return(0,T.createElement)(T.Fragment,null,(0,T.createElement)(Yo.VisuallyHidden,{as:"label",htmlFor:`post-content-${e}`},(0,d.__)("Type text or HTML")),(0,T.createElement)(Qa.A,{autoComplete:"off",dir:"auto",value:l,onChange:e=>{r("postType",o,s,{content:e.target.value,blocks:void 0,selection:void 0})},className:"editor-post-text-editor",id:`post-content-${e}`,placeholder:(0,d.__)("Start writing with text or HTML")}))}const Ja=window.wp.dom,el="wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",tl=/[\r\n]+/g;function nl(e){const t=(0,C.useRef)(),{isCleanNewPost:n}=(0,a.useSelect)((e=>{const{isCleanNewPost:t}=e(Bo);return{isCleanNewPost:t()}}),[]);return(0,C.useImperativeHandle)(e,(()=>({focus:()=>{t?.current?.focus()}}))),(0,C.useEffect)((()=>{if(!t.current)return;const{defaultView:e}=t.current.ownerDocument,{name:o,parent:s}=e,r="editor-canvas"===o?s.document:e.document,{activeElement:i,body:a}=r;!n||i&&a!==i||t.current.focus()}),[n]),{ref:t}}function ol(){const{editPost:e}=(0,a.useDispatch)(Bo),{title:t}=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Bo);return{title:t("title")}}),[]);return{title:t,setTitle:function(t){e({title:t})}}}const sl=(0,C.forwardRef)((function(e,t){const{placeholder:n,hasFixedToolbar:o}=(0,a.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Bo),{getSettings:n}=e(g.store),{titlePlaceholder:o,hasFixedToolbar:s}=n();return{title:t("title"),placeholder:o,hasFixedToolbar:s}}),[]),[s,r]=(0,C.useState)(!1),{ref:l}=nl(t),{title:c,setTitle:u}=ol(),[p,m]=(0,C.useState)({}),{clearSelectedBlock:h,insertBlocks:_,insertDefaultBlock:f}=(0,a.useDispatch)(g.store);function E(e){_(e,0)}function b(){r(!1),m({})}const v=(0,Ts.decodeEntities)(n)||(0,d.__)("Add title"),{ref:y}=(0,as.__unstableUseRichText)({value:c,onChange:function(e){u(e.replace(tl," "))},placeholder:v,selectionStart:p.start,selectionEnd:p.end,onSelectionChange(e,t){m((n=>{const{start:o,end:s}=n;return o===e&&s===t?n:{start:e,end:t}}))},__unstableDisableFormats:!1}),w=Zo()(el,{"is-selected":s,"has-fixed-toolbar":o});return(0,T.createElement)(Ys,{supportKeys:"title"},(0,T.createElement)("h1",{ref:(0,Do.useMergeRefs)([y,l]),contentEditable:!0,className:w,"aria-label":v,role:"textbox","aria-multiline":"true",onFocus:function(){r(!0),h()},onBlur:b,onKeyDown:function(e){e.keyCode===ts.ENTER&&(e.preventDefault(),f(void 0,void 0,0))},onKeyPress:b,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 s=(0,i.pasteHandler)({HTML:o,plainText:n});if(e.preventDefault(),s.length)if("string"!=typeof s){const[e]=s;if(c||"core/heading"!==e.name&&"core/paragraph"!==e.name)E(s);else{const t=(0,Ja.__unstableStripHTML)(e.attributes.content);u(t),E(s.slice(1))}}else{const e={...(0,as.create)({html:c}),...p},t=(0,Ja.__unstableStripHTML)(s),n=(0,as.insert)(e,(0,as.create)({html:t}));u((0,as.toHTMLString)({value:n})),m({start:n.start,end:n.end})}}}))}));const rl=(0,C.forwardRef)((function(e,t){const{placeholder:n,hasFixedToolbar:o}=(0,a.useSelect)((e=>{const{getSettings:t}=e(g.store),{titlePlaceholder:n,hasFixedToolbar:o}=t();return{placeholder:n,hasFixedToolbar:o}}),[]),[s,r]=(0,C.useState)(!1),{title:i,setTitle:l}=ol(),{ref:c}=nl(t),u=Zo()(el,{"is-selected":s,"has-fixed-toolbar":o,"is-raw-text":!0}),p=(0,Ts.decodeEntities)(n)||(0,d.__)("Add title");return(0,T.createElement)(Yo.TextareaControl,{ref:c,value:i,onChange:function(e){l(e.replace(tl," "))},onFocus:function(){r(!0)},onBlur:function(){r(!1)},label:n,className:u,placeholder:p,hideLabelFromVision:!0,autoComplete:"off",dir:"auto",rows:1,__nextHasNoMarginBottom:!0})}));function il(){const{isNew:e,isDeleting:t,postId:n}=(0,a.useSelect)((e=>{const t=e(Bo);return{isNew:t.isEditedPostNew(),isDeleting:t.isDeletingPost(),postId:t.getCurrentPostId()}}),[]),{trashPost:o}=(0,a.useDispatch)(Bo),[s,r]=(0,C.useState)(!1);if(e||!n)return null;return(0,T.createElement)(T.Fragment,null,(0,T.createElement)(Yo.Button,{__next40pxDefaultSize:!0,className:"editor-post-trash",isDestructive:!0,variant:"secondary",isBusy:t,"aria-disabled":t,onClick:t?void 0:()=>r(!0)},(0,d.__)("Move to trash")),(0,T.createElement)(Yo.__experimentalConfirmDialog,{isOpen:s,onConfirm:()=>{r(!1),o()},onCancel:()=>r(!1)},(0,d.__)("Are you sure you want to move this post to the trash?")))}const al=(0,a.withSelect)((e=>{const{isEditedPostNew:t,getCurrentPostId:n,getCurrentPostType:o}=e(Bo),{getPostType:s,canUser:r}=e(m.store),i=n(),a=s(o()),l=a?.rest_base||"";return{isNew:t(),postId:i,canUserDelete:!(!i||!l)&&r("delete",l,i)}}))((function({isNew:e,postId:t,canUserDelete:n,children:o}){return!e&&t&&n?o:null}));function ll({onClose:e}){const{isEditable:t,postSlug:n,viewPostLabel:o,postLink:s,permalinkPrefix:r,permalinkSuffix:i}=(0,a.useSelect)((e=>{var t;const n=e(Bo).getCurrentPost(),o=e(Bo).getCurrentPostType(),s=e(m.store).getPostType(o),r=e(Bo).getPermalinkParts(),i=null!==(t=n?._links?.["wp:action-publish"])&&void 0!==t&&t;return{isEditable:e(Bo).isPermalinkEditable()&&i,postSlug:(0,k.safeDecodeURIComponent)(e(Bo).getEditedPostSlug()),viewPostLabel:s?.labels.view_item,postLink:n.link,permalinkPrefix:r?.prefix,permalinkSuffix:r?.suffix}}),[]),{editPost:l}=(0,a.useDispatch)(Bo),[c,u]=(0,C.useState)(!1);return(0,T.createElement)("div",{className:"editor-post-url"},(0,T.createElement)(g.__experimentalInspectorPopoverHeader,{title:(0,d.__)("URL"),onClose:e}),t&&(0,T.createElement)(Yo.TextControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Permalink"),value:c?"":n,autoComplete:"off",spellCheck:"false",help:(0,T.createElement)(T.Fragment,null,(0,d.__)("The last part of the URL.")," ",(0,T.createElement)(Yo.ExternalLink,{href:(0,d.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink")},(0,d.__)("Learn more."))),onChange:e=>{l({slug:e}),e?c&&u(!1):c||u(!0)},onBlur:e=>{l({slug:(0,k.cleanForSlug)(e.target.value)}),c&&u(!1)}}),t&&(0,T.createElement)("h3",{className:"editor-post-url__link-label"},null!=o?o:(0,d.__)("View post")),(0,T.createElement)("p",null,(0,T.createElement)(Yo.ExternalLink,{className:"editor-post-url__link",href:s,target:"_blank"},t?(0,T.createElement)(T.Fragment,null,(0,T.createElement)("span",{className:"editor-post-url__link-prefix"},r),(0,T.createElement)("span",{className:"editor-post-url__link-slug"},n),(0,T.createElement)("span",{className:"editor-post-url__link-suffix"},i)):s)))}function cl({children:e}){const t=(0,a.useSelect)((e=>{const t=e(Bo).getCurrentPostType(),n=e(m.store).getPostType(t);if(!n?.viewable)return!1;if(!e(Bo).getCurrentPost().link)return!1;return!!e(Bo).getPermalinkParts()}),[]);return t?e:null}function ul(){return dl()}function dl(){const e=(0,a.useSelect)((e=>e(Bo).getPermalink()),[]);return(0,k.filterURLForDisplay)((0,k.safeDecodeURIComponent)(e))}function pl(){const[e,t]=(0,C.useState)(null),n=(0,C.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,T.createElement)(cl,null,(0,T.createElement)(Br,{label:(0,d.__)("URL"),ref:t},(0,T.createElement)(Yo.Dropdown,{popoverProps:n,className:"editor-post-url__panel-dropdown",contentClassName:"editor-post-url__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,T.createElement)(ml,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,T.createElement)(ll,{onClose:e})})))}function ml({isOpen:e,onClick:t}){const n=dl();return(0,T.createElement)(Yo.Button,{__next40pxDefaultSize:!0,className:"editor-post-url__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,d.sprintf)((0,d.__)("Change URL: %s"),n),onClick:t},n)}function gl({render:e}){return e({canEdit:(0,a.useSelect)((e=>{var t;return null!==(t=e(Bo).getCurrentPost()._links?.["wp:action-publish"])&&void 0!==t&&t}))})}const hl=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),_l=window.wp.wordcount;function fl(){const e=(0,a.useSelect)((e=>e(Bo).getEditedPostAttribute("content")),[]),t=(0,d._x)("words","Word count type. Do not translate!");return(0,T.createElement)("span",{className:"word-count"},(0,_l.count)(e,t))}const El=189;function bl(){const e=(0,a.useSelect)((e=>e(Bo).getEditedPostAttribute("content")),[]),t=(0,d._x)("words","Word count type. Do not translate!"),n=Math.round((0,_l.count)(e,t)/El),o=0===n?(0,C.createInterpolateElement)((0,d.__)("<span>< 1</span> minute"),{span:(0,T.createElement)("span",null)}):(0,C.createInterpolateElement)((0,d.sprintf)((0,d._n)("<span>%d</span> minute","<span>%d</span> minutes",n),n),{span:(0,T.createElement)("span",null)});return(0,T.createElement)("span",{className:"time-to-read"},o)}function vl(){const e=(0,a.useSelect)((e=>e(Bo).getEditedPostAttribute("content")),[]);return(0,_l.count)(e,"characters_including_spaces")}const yl=function({hasOutlineItemsDisabled:e,onRequestClose:t}){const{headingCount:n,paragraphCount:o,numberOfBlocks:s}=(0,a.useSelect)((e=>{const{getGlobalBlockCount:t}=e(g.store);return{headingCount:t("core/heading"),paragraphCount:t("core/paragraph"),numberOfBlocks:t()}}),[]);return(0,T.createElement)(T.Fragment,null,(0,T.createElement)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":(0,d.__)("Document Statistics"),tabIndex:"0"},(0,T.createElement)("ul",{role:"list",className:"table-of-contents__counts"},(0,T.createElement)("li",{className:"table-of-contents__count"},(0,d.__)("Words"),(0,T.createElement)(fl,null)),(0,T.createElement)("li",{className:"table-of-contents__count"},(0,d.__)("Characters"),(0,T.createElement)("span",{className:"table-of-contents__number"},(0,T.createElement)(vl,null))),(0,T.createElement)("li",{className:"table-of-contents__count"},(0,d.__)("Time to read"),(0,T.createElement)(bl,null)),(0,T.createElement)("li",{className:"table-of-contents__count"},(0,d.__)("Headings"),(0,T.createElement)("span",{className:"table-of-contents__number"},n)),(0,T.createElement)("li",{className:"table-of-contents__count"},(0,d.__)("Paragraphs"),(0,T.createElement)("span",{className:"table-of-contents__number"},o)),(0,T.createElement)("li",{className:"table-of-contents__count"},(0,d.__)("Blocks"),(0,T.createElement)("span",{className:"table-of-contents__number"},s)))),n>0&&(0,T.createElement)(T.Fragment,null,(0,T.createElement)("hr",null),(0,T.createElement)("h2",{className:"table-of-contents__title"},(0,d.__)("Document Outline")),(0,T.createElement)(_s,{onSelect:t,hasOutlineItemsDisabled:e})))};const wl=(0,C.forwardRef)((function({hasOutlineItemsDisabled:e,repositionDropdown:t,...n},o){const s=(0,a.useSelect)((e=>!!e(g.store).getBlockCount()),[]);return(0,T.createElement)(Yo.Dropdown,{popoverProps:{placement:t?"right":"bottom"},className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:({isOpen:e,onToggle:t})=>(0,T.createElement)(Yo.Button,{...n,ref:o,onClick:s?t:void 0,icon:hl,"aria-expanded":e,"aria-haspopup":"true",label:(0,d.__)("Details"),tooltipPosition:"bottom","aria-disabled":!s}),renderContent:({onClose:t})=>(0,T.createElement)(yl,{onRequestClose:t,hasOutlineItemsDisabled:e})})}));function kl(){const{__experimentalGetDirtyEntityRecords:e}=(0,a.useSelect)(m.store);return(0,C.useEffect)((()=>{const t=t=>{if(e().length>0)return t.returnValue=(0,d.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}}),[e]),null}const Sl=(0,Do.createHigherOrderComponent)((e=>(0,a.withRegistry)((t=>{const{useSubRegistry:n=!0,registry:o,...s}=t;if(!n)return(0,T.createElement)(e,{...s});const[r,i]=(0,C.useState)(null);return(0,C.useEffect)((()=>{const e=(0,a.createRegistry)({"core/block-editor":g.storeConfig},o);e.registerStore("core/editor",xo),i(e)}),[o]),r?(0,T.createElement)(a.RegistryProvider,{value:r},(0,T.createElement)(e,{...s})):null}))),"withRegistryProvider"),Pl=(e,t)=>`<a ${Cl(e)}>${t}</a>`,Cl=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,Tl=e=>{const{title:t,foreign_landing_url:n,creator:o,creator_url:s,license:r,license_version:i,license_url:a}=e,l=((e,t)=>{let n=e.trim();return"pdm"!==e&&(n=e.toUpperCase().replace("SAMPLING","Sampling")),t&&(n+=` ${t}`),["pdm","cc0"].includes(e)||(n=`CC ${n}`),n})(r,i),c=(0,Ts.decodeEntities)(o);let u;return u=c?t?(0,d.sprintf)((0,d._x)('"%1$s" by %2$s/ %3$s',"caption"),Pl(n,(0,Ts.decodeEntities)(t)),s?Pl(s,c):c,a?Pl(`${a}?ref=openverse`,l):l):(0,d.sprintf)((0,d._x)("<a %1$s>Work</a> by %2$s/ %3$s","caption"),Cl(n),s?Pl(s,c):c,a?Pl(`${a}?ref=openverse`,l):l):t?(0,d.sprintf)((0,d._x)('"%1$s"/ %2$s',"caption"),Pl(n,(0,Ts.decodeEntities)(t)),a?Pl(`${a}?ref=openverse`,l):l):(0,d.sprintf)((0,d._x)("<a %1$s>Work</a>/ %2$s","caption"),Cl(n),a?Pl(`${a}?ref=openverse`,l):l),u.replace(/\s{2}/g," ")},xl=async(e={})=>(await(0,a.resolveSelect)(m.store).getMediaItems({...e,orderBy:e?.search?"relevance":"date"})).map((e=>({...e,alt:e.alt_text,url:e.source_url,previewUrl:e.media_details?.sizes?.medium?.source_url,caption:e.caption?.raw}))),Bl=[{name:"images",labels:{name:(0,d.__)("Images"),search_items:(0,d.__)("Search images")},mediaType:"image",fetch:async(e={})=>xl({...e,media_type:"image"})},{name:"videos",labels:{name:(0,d.__)("Videos"),search_items:(0,d.__)("Search videos")},mediaType:"video",fetch:async(e={})=>xl({...e,media_type:"video"})},{name:"audio",labels:{name:(0,d.__)("Audio"),search_items:(0,d.__)("Search audio")},mediaType:"audio",fetch:async(e={})=>xl({...e,media_type:"audio"})},{name:"openverse",labels:{name:(0,d.__)("Openverse"),search_items:(0,d.__)("Search Openverse")},mediaType:"image",async fetch(e={}){const t={...e,mature:!1,excluded_source:"flickr,inaturalist,wikimedia",license:"pdm,cc0"},n={per_page:"page_size",search:"q"},o=new URL("https://api.openverse.engineering/v1/images/");Object.entries(t).forEach((([e,t])=>{const s=n[e]||e;o.searchParams.set(s,t)}));const s=await window.fetch(o,{headers:{"User-Agent":"WordPress/inserter-media-fetch"}});return(await s.json()).results.map((e=>({...e,title:e.title?.toLowerCase().startsWith("file:")?e.title.slice(5):e.title,sourceId:e.id,id:void 0,caption:Tl(e),previewUrl:e.thumbnail})))},getReportUrl:({sourceId:e})=>`https://wordpress.org/openverse/image/${e}/report/`,isExternalResource:!0}],Il=window.wp.mediaUtils,Nl=()=>{};function Dl({additionalData:e={},allowedTypes:t,filesList:n,maxUploadFileSize:o,onError:s=Nl,onFileChange:r}){const{getCurrentPost:i,getEditorSettings:l}=(0,a.select)(Bo),c=l().allowedMimeTypes;o=o||l().maxUploadFileSize;const u=i(),d="number"==typeof u?.id?u.id:u?.wp_id,p=d?{post:d}:{};(0,Il.uploadMedia)({allowedTypes:t,filesList:n,onFileChange:r,additionalData:{...p,...e},maxUploadFileSize:o,onError:({message:e})=>s(e),wpAllowedMimeTypes:c})}const Al=[],Rl=["__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","__experimentalPreferredStyleVariations","__unstableGalleryWithImageBlocks","alignWide","blockInspectorTabs","allowedMimeTypes","bodyPlaceholder","canLockBlocks","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","fontSizes","gradients","generateAnchors","onNavigateToEntityRecord","hasInlineToolbar","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isRTL","locale","maxWidth","onUpdateDefaultBlockStyles","postContentAttributes","postsPerPage","readOnly","styles","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableIsPreviewMode","__unstableResolvedAssets","__unstableIsBlockBasedTheme","__experimentalArchiveTitleTypeLabel","__experimentalArchiveTitleNameLabel"];const Ol=function(e,t,n){var o,s;const r=(0,Do.useViewportMatch)("medium"),{allowRightClickOverrides:l,blockTypes:c,focusMode:p,hasFixedToolbar:h,isDistractionFree:_,keepCaretInsideBlock:f,reusableBlocks:E,hasUploadPermissions:b,hiddenBlockTypes:v,canUseUnfilteredHTML:y,userCanCreatePages:w,pageOnFront:k,pageForPosts:S,userPatternCategories:P,restBlockPatternCategories:T}=(0,a.useSelect)((e=>{var o;const s="web"===C.Platform.OS,{canUser:a,getRawEntityRecord:l,getEntityRecord:c,getUserPatternCategories:u,getEntityRecords:d,getBlockPatternCategories:p}=e(m.store),{get:g}=e(I.store),{getBlockTypes:h}=e(i.store),_=a("read","settings")?c("root","site"):void 0;return{allowRightClickOverrides:g("core","allowRightClickOverrides"),blockTypes:h(),canUseUnfilteredHTML:l("postType",t,n)?._links?.hasOwnProperty("wp:action-unfiltered-html"),focusMode:g("core","focusMode"),hasFixedToolbar:g("core","fixedToolbar")||!r,hiddenBlockTypes:g("core","hiddenBlockTypes"),isDistractionFree:g("core","distractionFree"),keepCaretInsideBlock:g("core","keepCaretInsideBlock"),reusableBlocks:s?d("postType","wp_block",{per_page:-1}):Al,hasUploadPermissions:null===(o=a("create","media"))||void 0===o||o,userCanCreatePages:a("create","pages"),pageOnFront:_?.page_on_front,pageForPosts:_?.page_for_posts,userPatternCategories:u(),restBlockPatternCategories:p()}}),[t,n,r]),x=null!==(o=e.__experimentalAdditionalBlockPatterns)&&void 0!==o?o:e.__experimentalBlockPatterns,B=null!==(s=e.__experimentalAdditionalBlockPatternCategories)&&void 0!==s?s:e.__experimentalBlockPatternCategories,N=(0,C.useMemo)((()=>[...x||[]].filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(t)))),[x,t]),D=(0,C.useMemo)((()=>[...B||[],...T||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))),[B,T]),{undo:A,setIsInserterOpened:R}=(0,a.useDispatch)(Bo),{saveEntityRecord:O}=(0,a.useDispatch)(m.store),L=(0,C.useCallback)((e=>w?O("postType","page",e):Promise.reject({message:(0,d.__)("You do not have permission to create Pages.")})),[O,w]),M=(0,C.useMemo)((()=>{if(v&&v.length>0){return(!0===e.allowedBlockTypes?c.map((({name:e})=>e)):e.allowedBlockTypes||[]).filter((e=>!v.includes(e)))}return e.allowedBlockTypes}),[e.allowedBlockTypes,v,c]),F=!1===e.focusMode;return(0,C.useMemo)((()=>({...Object.fromEntries(Object.entries(e).filter((([e])=>Rl.includes(e)))),allowedBlockTypes:M,allowRightClickOverrides:l,focusMode:p&&!F,hasFixedToolbar:h,isDistractionFree:_,keepCaretInsideBlock:f,mediaUpload:b?Dl:void 0,__experimentalBlockPatterns:N,[u(g.privateApis).selectBlockPatternsKey]:e=>u(e(m.store)).getBlockPatternsForPostType(t),__experimentalReusableBlocks:E,__experimentalBlockPatternCategories:D,__experimentalUserPatternCategories:P,__experimentalFetchLinkSuggestions:(t,n)=>(0,m.__experimentalFetchLinkSuggestions)(t,n,e),inserterMediaCategories:Bl,__experimentalFetchRichUrlData:m.__experimentalFetchUrlData,__experimentalCanUserUseUnfilteredHTML:y,__experimentalUndo:A,outlineMode:"wp_template"===t,__experimentalCreatePageEntity:L,__experimentalUserCanCreatePages:w,pageOnFront:k,pageForPosts:S,__experimentalPreferPatternsOnRoot:"wp_template"===t,templateLock:"wp_navigation"===t?"insert":e.templateLock,template:"wp_navigation"===t?[["core/navigation",{},[]]]:e.template,__experimentalSetIsInserterOpened:R})),[M,l,p,F,h,_,f,e,b,E,P,N,D,y,A,L,w,k,S,t,R])},Ll=["core/post-title","core/post-featured-image","core/post-content"];function Ml(){!function(){const e=(0,a.useSelect)((e=>{const{getBlocksByName:t,getBlockParents:n,getBlockName:o}=e(g.store);return t(Ll).filter((e=>n(e).every((e=>{const t=o(e);return"core/query"!==t&&!Ll.includes(t)}))))}),[]),{setBlockEditingMode:t,unsetBlockEditingMode:n}=(0,a.useDispatch)(g.store);(0,C.useEffect)((()=>{t("","disabled");for(const n of e)t(n,"contentOnly");return()=>{n("");for(const t of e)n(t)}}),[e,t,n])}()}function Fl(){const e=(0,a.useSelect)((e=>e(g.store).getBlockOrder()?.[0]),[]),{setBlockEditingMode:t,unsetBlockEditingMode:n}=(0,a.useDispatch)(g.store);(0,C.useEffect)((()=>{if(e)return t(e,"contentOnly"),()=>{n(e)}}),[e,n,t])}const{ExperimentalBlockEditorProvider:Vl}=u(g.privateApis),{PatternsMenuItems:Ul}=u(Oo.privateApis),Hl=()=>{},zl=["wp_block","wp_template","wp_navigation","wp_template_part"];const Gl=Sl((({post:e,settings:t,recovery:n,initialEdits:o,children:s,BlockEditorProviderComponent:r=Vl,__unstableTemplate:l})=>{const c=(0,a.useSelect)((e=>e(Bo).getRenderingMode()),[]),p=!!l&&"post-only"!==c,h=p?l:e,_=(0,C.useMemo)((()=>({...!zl.includes(h.type)||p?{postId:e.id,postType:e.type}:{},templateSlug:"wp_template"===h.type?h.slug:void 0})),[p,e.id,e.type,h.type,h.slug]),{editorSettings:f,selection:E,isReady:b}=(0,a.useSelect)((e=>{const{getEditorSettings:t,getEditorSelection:n,__unstableIsEditorReady:o}=e(Bo);return{editorSettings:t(),isReady:o(),selection:n()}}),[]),{id:v,type:y}=h,w=Ol(f,y,v),[k,S,P]=function(e,t,n){const o="post-only"!==n&&t?"template":"post",[s,r,a]=(0,m.useEntityBlockEditor)("postType",e.type,{id:e.id}),[l,c,u]=(0,m.useEntityBlockEditor)("postType",t?.type,{id:t?.id}),d=(0,C.useMemo)((()=>{if("wp_navigation"===e.type)return[(0,i.createBlock)("core/navigation",{ref:e.id,templateLock:!1})]}),[e.type,e.id]),p=(0,C.useMemo)((()=>d||("template"===o?l:s)),[d,o,l,s]);return t&&"template-locked"===n||"wp_navigation"===e.type?[p,Hl,Hl]:[p,"post"===o?r:c,"post"===o?a:u]}(e,l,c),{updatePostLock:x,setupEditor:B,updateEditorSettings:I,setCurrentTemplateId:N,setEditedPost:D,setRenderingMode:A}=u((0,a.useDispatch)(Bo)),{createWarningNotice:R}=(0,a.useDispatch)(an.store);return(0,C.useLayoutEffect)((()=>{n||(x(t.postLock),B(e,o,t.template),t.autosave&&R((0,d.__)("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:(0,d.__)("View the autosave"),url:t.autosave.editLink}]}))}),[]),(0,C.useEffect)((()=>{D(e.type,e.id)}),[e.type,e.id,D]),(0,C.useEffect)((()=>{I(t)}),[t,I]),(0,C.useEffect)((()=>{N(l?.id)}),[l?.id,N]),(0,C.useEffect)((()=>{var e;A(null!==(e=t.defaultRenderingMode)&&void 0!==e?e:"post-only")}),[t.defaultRenderingMode,A]),b?(0,T.createElement)(m.EntityProvider,{kind:"root",type:"site"},(0,T.createElement)(m.EntityProvider,{kind:"postType",type:e.type,id:e.id},(0,T.createElement)(g.BlockContextProvider,{value:_},(0,T.createElement)(r,{value:k,onChange:P,onInput:S,selection:E,settings:w,useSubRegistry:!1},s,(0,T.createElement)(Ul,null),"template-locked"===c&&(0,T.createElement)(Ml,null),"wp_navigation"===y&&(0,T.createElement)(Fl,null))))):null}));const jl=function(e){return(0,T.createElement)(Gl,{...e,BlockEditorProviderComponent:g.BlockEditorProvider},e.children)},Wl=window.wp.serverSideRender;var $l=n.n(Wl);function Kl(e,t,n=[]){const o=(0,C.forwardRef)(((n,o)=>(P()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),(0,T.createElement)(t,{ref:o,...n}))));return n.forEach((n=>{o[n]=Kl(e+"."+n,t[n])})),o}function Zl(e,t){return(...n)=>(P()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),t(...n))}const Yl=Kl("RichText",g.RichText,["Content"]);Yl.isEmpty=Zl("RichText.isEmpty",g.RichText.isEmpty);const ql=Kl("Autocomplete",g.Autocomplete),Ql=Kl("AlignmentToolbar",g.AlignmentToolbar),Xl=Kl("BlockAlignmentToolbar",g.BlockAlignmentToolbar),Jl=Kl("BlockControls",g.BlockControls,["Slot"]),ec=Kl("BlockEdit",g.BlockEdit),tc=Kl("BlockEditorKeyboardShortcuts",g.BlockEditorKeyboardShortcuts),nc=Kl("BlockFormatControls",g.BlockFormatControls,["Slot"]),oc=Kl("BlockIcon",g.BlockIcon),sc=Kl("BlockInspector",g.BlockInspector),rc=Kl("BlockList",g.BlockList),ic=Kl("BlockMover",g.BlockMover),ac=Kl("BlockNavigationDropdown",g.BlockNavigationDropdown),lc=Kl("BlockSelectionClearer",g.BlockSelectionClearer),cc=Kl("BlockSettingsMenu",g.BlockSettingsMenu),uc=Kl("BlockTitle",g.BlockTitle),dc=Kl("BlockToolbar",g.BlockToolbar),pc=Kl("ColorPalette",g.ColorPalette),mc=Kl("ContrastChecker",g.ContrastChecker),gc=Kl("CopyHandler",g.CopyHandler),hc=Kl("DefaultBlockAppender",g.DefaultBlockAppender),_c=Kl("FontSizePicker",g.FontSizePicker),fc=Kl("Inserter",g.Inserter),Ec=Kl("InnerBlocks",g.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),bc=Kl("InspectorAdvancedControls",g.InspectorAdvancedControls,["Slot"]),vc=Kl("InspectorControls",g.InspectorControls,["Slot"]),yc=Kl("PanelColorSettings",g.PanelColorSettings),wc=Kl("PlainText",g.PlainText),kc=Kl("RichTextShortcut",g.RichTextShortcut),Sc=Kl("RichTextToolbarButton",g.RichTextToolbarButton),Pc=Kl("__unstableRichTextInputEvent",g.__unstableRichTextInputEvent),Cc=Kl("MediaPlaceholder",g.MediaPlaceholder),Tc=Kl("MediaUpload",g.MediaUpload),xc=Kl("MediaUploadCheck",g.MediaUploadCheck),Bc=Kl("MultiSelectScrollIntoView",g.MultiSelectScrollIntoView),Ic=Kl("NavigableToolbar",g.NavigableToolbar),Nc=Kl("ObserveTyping",g.ObserveTyping),Dc=Kl("SkipToSelectedBlock",g.SkipToSelectedBlock),Ac=Kl("URLInput",g.URLInput),Rc=Kl("URLInputButton",g.URLInputButton),Oc=Kl("URLPopover",g.URLPopover),Lc=Kl("Warning",g.Warning),Mc=Kl("WritingFlow",g.WritingFlow),Fc=Zl("createCustomColorsHOC",g.createCustomColorsHOC),Vc=Zl("getColorClassName",g.getColorClassName),Uc=Zl("getColorObjectByAttributeValues",g.getColorObjectByAttributeValues),Hc=Zl("getColorObjectByColorValue",g.getColorObjectByColorValue),zc=Zl("getFontSize",g.getFontSize),Gc=Zl("getFontSizeClass",g.getFontSizeClass),jc=Zl("withColorContext",g.withColorContext),Wc=Zl("withColors",g.withColors),$c=Zl("withFontSizes",g.withFontSizes),Kc=jo,Zc=jo;function Yc(e){return P()("wp.editor.cleanForSlug",{since:"12.7",plugin:"Gutenberg",alternative:"wp.url.cleanForSlug"}),(0,k.cleanForSlug)(e)}function qc({contentRef:e}){const{onNavigateToEntityRecord:t,templateId:n}=(0,a.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:n}=e(Bo);return{onNavigateToEntityRecord:t().onNavigateToEntityRecord,templateId:n()}}),[]),{getNotices:o}=(0,a.useSelect)(an.store),{createInfoNotice:s,removeNotice:r}=(0,a.useDispatch)(an.store),[i,l]=(0,C.useState)(!1),c=(0,C.useRef)(0);return(0,C.useEffect)((()=>{const i=async e=>{if(!e.target.classList.contains("is-root-container"))return;const r=o().some((e=>e.id===c.current));if(r)return;const{notice:i}=await s((0,d.__)("Edit your template to edit this block."),{isDismissible:!0,type:"snackbar",actions:[{label:(0,d.__)("Edit template"),onClick:()=>t({postId:n,postType:"wp_template"})}]});c.current=i.id},a=e=>{e.target.classList.contains("is-root-container")&&(c.current&&r(c.current),l(!0))},u=e.current;return u?.addEventListener("click",i),u?.addEventListener("dblclick",a),()=>{u?.removeEventListener("click",i),u?.removeEventListener("dblclick",a)}}),[c,e,o,s,t,n,r]),(0,T.createElement)(Yo.__experimentalConfirmDialog,{isOpen:i,confirmButtonText:(0,d.__)("Edit template"),onConfirm:()=>{l(!1),t({postId:n,postType:"wp_template"})},onCancel:()=>l(!1)},(0,d.__)("Edit your template to edit this block."))}const{LayoutStyle:Qc,useLayoutClasses:Xc,useLayoutStyles:Jc,ExperimentalBlockCanvas:eu,useFlashEditableBlocks:tu}=u(g.privateApis),nu=()=>{},ou=["wp_block","wp_template","wp_navigation","wp_template_part"];function su(e){for(let t=0;t<e.length;t++){if("core/post-content"===e[t].name)return e[t].attributes;if(e[t].innerBlocks.length){const n=su(e[t].innerBlocks);if(n)return n}}}function ru(e){for(let t=0;t<e.length;t++)if("core/post-content"===e[t].name)return!0;return!1}const iu=function({autoFocus:e,className:t,renderAppender:n,styles:o,disableIframe:s=!1,iframeProps:r,children:l}){const{renderingMode:c,postContentAttributes:u,editedPostTemplate:d={},wrapperBlockName:p,wrapperUniqueId:h,deviceType:_,showEditorPadding:f,isDesignPostType:E}=(0,a.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:n,getCurrentTemplateId:o,getEditorSettings:s,getRenderingMode:r,getDeviceType:i}=e(Bo),{getPostType:a,canUser:l,getEditedEntityRecord:c}=e(m.store),u=n(),d=r();let p;"wp_block"===u?p="core/block":"post-only"===d&&(p="core/post-content");const g=s(),h=g.supportsTemplateMode,_=a(u),f=l("create","templates"),E=o(),b=E?c("postType","wp_template",E):void 0;return{renderingMode:d,postContentAttributes:g.postContentAttributes,isDesignPostType:ou.includes(u),editedPostTemplate:_?.viewable&&h&&f?b:void 0,wrapperBlockName:p,wrapperUniqueId:t(),deviceType:i(),showEditorPadding:!!g.onNavigateToPreviousEntityRecord}}),[]),{isCleanNewPost:b}=(0,a.useSelect)(Bo),{hasRootPaddingAwareAlignments:v,themeHasDisabledLayoutStyles:y,themeSupportsLayout:w}=(0,a.useSelect)((e=>{const t=e(g.store).getSettings();return{themeHasDisabledLayoutStyles:t.disableLayoutStyles,themeSupportsLayout:t.supportsLayout,hasRootPaddingAwareAlignments:t.__experimentalFeatures?.useRootPaddingAwareAlignments}}),[]),k=(0,g.__experimentalUseResizeCanvas)(_),[S]=(0,g.useSettings)("layout"),P=(0,C.useMemo)((()=>"post-only"!==c||E?{type:"default"}:w?{...S,type:"constrained"}:{type:"default"}),[c,w,S,E]),x=(0,C.useMemo)((()=>{if(!d?.content&&!d?.blocks&&u)return u;if(d?.blocks)return su(d?.blocks);const e="string"==typeof d?.content?d?.content:"";return su((0,i.parse)(e))||{}}),[d?.content,d?.blocks,u]),B=(0,C.useMemo)((()=>{if(!d?.content&&!d?.blocks)return!1;if(d?.blocks)return ru(d?.blocks);const e="string"==typeof d?.content?d?.content:"";return ru((0,i.parse)(e))||!1}),[d?.content,d?.blocks]),{layout:I={},align:N=""}=x||{},D=Xc(x,"core/post-content"),A=Zo()({"is-layout-flow":!w},w&&D,N&&`align${N}`),R=Jc(x,"core/post-content",".block-editor-block-list__layout.is-root-container"),O=(0,C.useMemo)((()=>I&&("constrained"===I?.type||I?.inherit||I?.contentSize||I?.wideSize)?{...S,...I,type:"constrained"}:{...S,...I,type:"default"}),[I?.type,I?.inherit,I?.contentSize,I?.wideSize,S]),L=u?O:P,M="default"!==L?.type||B?L:P,F=(0,g.__unstableUseTypingObserver)(),V=(0,C.useRef)();(0,C.useEffect)((()=>{e&&b()&&V?.current?.focus()}),[e,b]);const U=(0,C.useRef)(),H=(0,g.__unstableUseTypewriter)(),z=(0,Do.useMergeRefs)([U,"post-only"===c?H:nu,tu({isEnabled:"template-locked"===c})]);return(0,T.createElement)(eu,{shouldIframe:!s||["Tablet","Mobile"].includes(_),contentRef:z,styles:o,height:"100%",iframeProps:{className:Zo()("editor-canvas__iframe",{"has-editor-padding":f}),...r,style:{...r?.style,...k}}},w&&!y&&"post-only"===c&&!E&&(0,T.createElement)(T.Fragment,null,(0,T.createElement)(Qc,{selector:".editor-editor-canvas__post-title-wrapper",layout:P}),(0,T.createElement)(Qc,{selector:".block-editor-block-list__layout.is-root-container",layout:M}),N&&(0,T.createElement)(Qc,{css:".is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}"}),R&&(0,T.createElement)(Qc,{layout:O,css:R})),"post-only"===c&&!E&&(0,T.createElement)("div",{className:Zo()("editor-editor-canvas__post-title-wrapper","edit-post-visual-editor__post-title-wrapper",{"has-global-padding":v}),contentEditable:!1,ref:F,style:{marginTop:"4rem"}},(0,T.createElement)(sl,{ref:V})),(0,T.createElement)(g.RecursionProvider,{blockName:p,uniqueId:h},(0,T.createElement)(g.BlockList,{className:Zo()(t,"is-"+_.toLowerCase()+"-preview","post-only"!==c||E?"wp-site-blocks":`${A} wp-block-post-content`),layout:L,dropZoneElement:s?U.current:U.current?.parentNode,renderAppender:n,__unstableDisableDropZone:"template-locked"===c}),"template-locked"===c&&(0,T.createElement)(qc,{contentRef:U})),l)},{PreferenceBaseOption:au}=u(I.privateApis),lu=(0,Do.compose)((0,a.withSelect)(((e,{panelName:t})=>{const{isEditorPanelEnabled:n,isEditorPanelRemoved:o}=e(Bo);return{isRemoved:o(t),isChecked:n(t)}})),(0,Do.ifCondition)((({isRemoved:e})=>!e)),(0,a.withDispatch)(((e,{panelName:t})=>({onChange:()=>e(Bo).toggleEditorPanelEnabled(t)}))))(au),{Fill:cu,Slot:uu}=(0,Yo.createSlotFill)("EnablePluginDocumentSettingPanelOption"),du=({label:e,panelName:t})=>(0,T.createElement)(cu,null,(0,T.createElement)(lu,{label:e,panelName:t}));du.Slot=uu;const pu=du,mu=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})),gu=(0,T.createElement)(x.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,T.createElement)(x.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})),{useCanBlockToolbarBeFocused:hu}=u(g.privateApis),_u=e=>{e.preventDefault()};const fu=function({className:e,disableBlockTools:t=!1,children:n,listViewLabel:o=(0,d.__)("Document Overview")}){const s=(0,C.useRef)(),{setIsInserterOpened:r,setIsListViewOpened:i}=(0,a.useDispatch)(Bo),{isDistractionFree:l,isInserterOpened:c,isListViewOpen:p,listViewShortcut:m,listViewToggleRef:h,hasFixedToolbar:_,showIconLabels:f}=(0,a.useSelect)((e=>{const{getSettings:t}=e(g.store),{get:n}=e(I.store),{isListViewOpened:o,getListViewToggleRef:s}=u(e(Bo)),{getShortcutRepresentation:r}=e(Go.store);return{isInserterOpened:e(Bo).isInserterOpened(),isListViewOpen:o(),listViewShortcut:r("core/editor/toggle-list-view"),listViewToggleRef:s(),hasFixedToolbar:t().hasFixedToolbar,showIconLabels:n("core","showIconLabels"),isDistractionFree:n("core","distractionFree")}}),[]),E=(0,Do.useViewportMatch)("medium"),b=(0,Do.useViewportMatch)("wide"),v=hu(),y=(0,d.__)("Document tools"),w=(0,C.useCallback)((()=>i(!p)),[i,p]),k=(0,C.useCallback)((()=>{c?(s.current.focus(),r(!1)):r(!0)}),[c,r]),S=(0,d._x)("Toggle block inserter","Generic label for block inserter button"),P=c?(0,d.__)("Close"):(0,d.__)("Add");return(0,T.createElement)(g.NavigableToolbar,{className:Zo()("editor-document-tools","edit-post-header-toolbar",e),"aria-label":y,shouldUseKeyboardFocusShortcut:!v,variant:"unstyled"},(0,T.createElement)("div",{className:"editor-document-tools__left"},(0,T.createElement)(Yo.ToolbarItem,{ref:s,as:Yo.Button,className:"editor-document-tools__inserter-toggle",variant:"primary",isPressed:c,onMouseDown:_u,onClick:k,disabled:t,icon:mu,label:f?P:S,showTooltip:!f,"aria-expanded":c}),(b||!f)&&(0,T.createElement)(T.Fragment,null,E&&!_&&(0,T.createElement)(Yo.ToolbarItem,{as:g.ToolSelector,showTooltip:!f,variant:f?"tertiary":void 0,disabled:t,size:"compact"}),(0,T.createElement)(Yo.ToolbarItem,{as:ws,showTooltip:!f,variant:f?"tertiary":void 0,size:"compact"}),(0,T.createElement)(Yo.ToolbarItem,{as:ys,showTooltip:!f,variant:f?"tertiary":void 0,size:"compact"}),!l&&(0,T.createElement)(Yo.ToolbarItem,{as:Yo.Button,className:"editor-document-tools__document-overview-toggle",icon:gu,disabled:t,isPressed:p,label:o,onClick:w,shortcut:m,showTooltip:!f,variant:f?"tertiary":void 0,"aria-expanded":p,ref:h,size:"compact"})),n))},Eu=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function bu(){return(0,T.createElement)(T.Fragment,null,(0,T.createElement)("div",{className:"editor-list-view-sidebar__outline"},(0,T.createElement)("div",null,(0,T.createElement)(Yo.__experimentalText,null,(0,d.__)("Characters:")),(0,T.createElement)(Yo.__experimentalText,null,(0,T.createElement)(vl,null))),(0,T.createElement)("div",null,(0,T.createElement)(Yo.__experimentalText,null,(0,d.__)("Words:")),(0,T.createElement)(fl,null)),(0,T.createElement)("div",null,(0,T.createElement)(Yo.__experimentalText,null,(0,d.__)("Time to read:")),(0,T.createElement)(bl,null))),(0,T.createElement)(_s,null))}const{Tabs:vu}=u(Yo.privateApis);const yu=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"}));const wu=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"})),ku=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"M17 4H7c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12zm-7.5-.5h4V16h-4v1.5z"})),Su=(0,T.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,T.createElement)(x.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"}));const Pu=function({blockTypes:e,value:t,onItemChange:n}){return(0,T.createElement)("ul",{className:"editor-block-manager__checklist"},e.map((e=>(0,T.createElement)("li",{key:e.name,className:"editor-block-manager__checklist-item"},(0,T.createElement)(Yo.CheckboxControl,{__nextHasNoMarginBottom:!0,label:e.title,checked:t.includes(e.name),onChange:(...t)=>n(e.name,...t)}),(0,T.createElement)(g.BlockIcon,{icon:e.icon})))))};const Cu=function e({title:t,blockTypes:n}){const o=(0,Do.useInstanceId)(e),{allowedBlockTypes:s,hiddenBlockTypes:r}=(0,a.useSelect)((e=>{const{getEditorSettings:t}=e(Bo),{get:n}=e(I.store);return{allowedBlockTypes:t().allowedBlockTypes,hiddenBlockTypes:n("core","hiddenBlockTypes")}}),[]),i=(0,C.useMemo)((()=>!0===s?n:n.filter((({name:e})=>s?.includes(e)))),[s,n]),{showBlockTypes:l,hideBlockTypes:c}=u((0,a.useDispatch)(Bo)),d=(0,C.useCallback)(((e,t)=>{t?l(e):c(e)}),[l,c]),p=(0,C.useCallback)((e=>{const t=n.map((({name:e})=>e));e?l(t):c(t)}),[n,l,c]);if(!i.length)return null;const m=i.map((({name:e})=>e)).filter((e=>!(null!=r?r:[]).includes(e))),g="editor-block-manager__category-title-"+o,h=m.length===i.length,_=!h&&m.length>0;return(0,T.createElement)("div",{role:"group","aria-labelledby":g,className:"editor-block-manager__category"},(0,T.createElement)(Yo.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:h,onChange:p,className:"editor-block-manager__category-title",indeterminate:_,label:(0,T.createElement)("span",{id:g},t)}),(0,T.createElement)(Pu,{blockTypes:i,value:m,onItemChange:d}))};const Tu=(0,Do.compose)([(0,a.withSelect)((e=>{var t;const{getBlockTypes:n,getCategories:o,hasBlockSupport:s,isMatchingSearchTerm:r}=e(i.store),{get:a}=e(I.store),l=n(),c=(null!==(t=a("core","hiddenBlockTypes"))&&void 0!==t?t:[]).filter((e=>l.some((t=>t.name===e)))),u=Array.isArray(c)&&c.length;return{blockTypes:l,categories:o(),hasBlockSupport:s,isMatchingSearchTerm:r,numberOfHiddenBlocks:u}})),(0,a.withDispatch)((e=>{const{showBlockTypes:t}=u(e(Bo));return{enableAllBlockTypes:e=>{const n=e.map((({name:e})=>e));t(n)}}}))])((function({blockTypes:e,categories:t,hasBlockSupport:n,isMatchingSearchTerm:o,numberOfHiddenBlocks:s,enableAllBlockTypes:r}){const i=(0,Do.useDebounce)(Xi.speak,500),[a,l]=(0,C.useState)("");return e=e.filter((e=>n(e,"inserter",!0)&&(!a||o(e,a))&&(!e.parent||e.parent.includes("core/post-content")))),(0,C.useEffect)((()=>{if(!a)return;const t=e.length,n=(0,d.sprintf)((0,d._n)("%d result found.","%d results found.",t),t);i(n)}),[e.length,a,i]),(0,T.createElement)("div",{className:"editor-block-manager__content"},!!s&&(0,T.createElement)("div",{className:"editor-block-manager__disabled-blocks-count"},(0,d.sprintf)((0,d._n)("%d block is hidden.","%d blocks are hidden.",s),s),(0,T.createElement)(Yo.Button,{variant:"link",onClick:()=>r(e)},(0,d.__)("Reset"))),(0,T.createElement)(Yo.SearchControl,{__nextHasNoMarginBottom:!0,label:(0,d.__)("Search for a block"),placeholder:(0,d.__)("Search for a block"),value:a,onChange:e=>l(e),className:"editor-block-manager__search"}),(0,T.createElement)("div",{tabIndex:"0",role:"region","aria-label":(0,d.__)("Available block types"),className:"editor-block-manager__results"},0===e.length&&(0,T.createElement)("p",{className:"editor-block-manager__no-results"},(0,d.__)("No blocks found.")),t.map((t=>(0,T.createElement)(Cu,{key:t.slug,title:t.title,blockTypes:e.filter((e=>e.category===t.slug))}))),(0,T.createElement)(Cu,{title:(0,d.__)("Uncategorized"),blockTypes:e.filter((({category:e})=>!e))})))})),{PreferencesModal:xu,PreferencesModalTabs:Bu,PreferencesModalSection:Iu,PreferenceToggleControl:Nu}=u(I.privateApis);const Du={};c(Du,{DocumentTools:fu,EditorCanvas:iu,ExperimentalEditorProvider:Gl,EnablePluginDocumentSettingPanelOption:pu,EntitiesSavedStatesExtensible:Vs,InserterSidebar:function(){const{insertionPoint:e,showMostUsedBlocks:t}=(0,a.useSelect)((e=>{const{getInsertionPoint:t}=u(e(Bo)),{get:n}=e(I.store);return{insertionPoint:t(),showMostUsedBlocks:n("core","mostUsedBlocks")}}),[]),{setIsInserterOpened:n}=(0,a.useDispatch)(Bo),o=(0,Do.useViewportMatch)("medium","<"),s=o?"div":Yo.VisuallyHidden,[r,i]=(0,Do.__experimentalUseDialog)({onClose:()=>n(!1),focusOnMount:null}),l=(0,C.useRef)();return(0,C.useEffect)((()=>{l.current.focusSearch()}),[]),(0,T.createElement)("div",{ref:r,...i,className:"editor-inserter-sidebar"},(0,T.createElement)(s,{className:"editor-inserter-sidebar__header"},(0,T.createElement)(Yo.Button,{icon:Eu,label:(0,d.__)("Close block inserter"),onClick:()=>n(!1)})),(0,T.createElement)("div",{className:"editor-inserter-sidebar__content"},(0,T.createElement)(g.__experimentalLibrary,{showMostUsedBlocks:t,showInserterHelpPanel:!0,shouldFocusBlock:o,rootClientId:e.rootClientId,__experimentalInsertionIndex:e.insertionIndex,__experimentalFilterValue:e.filterValue,ref:l})))},ListViewSidebar:function(){const{setIsListViewOpened:e}=(0,a.useDispatch)(Bo),{getListViewToggleRef:t}=u((0,a.useSelect)(Bo)),n=(0,Do.useFocusOnMount)("firstElement"),o=(0,C.useCallback)((()=>{e(!1),t().current?.focus()}),[t,e]),s=(0,C.useCallback)((e=>{e.keyCode!==ts.ESCAPE||e.defaultPrevented||(e.preventDefault(),o())}),[o]),[r,i]=(0,C.useState)(null),[l,c]=(0,C.useState)("list-view"),p=(0,C.useRef)(),m=(0,C.useRef)(),h=(0,C.useRef)(),_=(0,Do.useMergeRefs)([n,h,i]),f=(0,C.useCallback)((()=>{p.current.contains(p.current.ownerDocument.activeElement)?o():function(e){const t=Ja.focus.tabbable.find(m.current)[0];if("list-view"===e){const e=Ja.focus.tabbable.find(h.current)[0];(p.current.contains(e)?e:t).focus()}else t.focus()}(l)}),[o,l]);return(0,Go.useShortcut)("core/editor/toggle-list-view",f),(0,T.createElement)("div",{className:"editor-list-view-sidebar",onKeyDown:s,ref:p},(0,T.createElement)(vu,{onSelect:e=>c(e),selectOnMove:!1,initialTabId:"list-view"},(0,T.createElement)("div",{className:"edit-post-editor__document-overview-panel__header"},(0,T.createElement)(Yo.Button,{className:"editor-list-view-sidebar__close-button",icon:Si,label:(0,d.__)("Close"),onClick:o}),(0,T.createElement)(vu.TabList,{className:"editor-list-view-sidebar__tabs-tablist",ref:m},(0,T.createElement)(vu.Tab,{className:"editor-list-view-sidebar__tabs-tab",tabId:"list-view"},(0,d._x)("List View","Post overview")),(0,T.createElement)(vu.Tab,{className:"editor-list-view-sidebar__tabs-tab",tabId:"outline"},(0,d._x)("Outline","Post overview")))),(0,T.createElement)(vu.TabPanel,{ref:_,className:"editor-list-view-sidebar__tabs-tabpanel",tabId:"list-view",focusable:!1},(0,T.createElement)("div",{className:"editor-list-view-sidebar__list-view-container"},(0,T.createElement)("div",{className:"editor-list-view-sidebar__list-view-panel-content"},(0,T.createElement)(g.__experimentalListView,{dropZoneElement:r})))),(0,T.createElement)(vu.TabPanel,{className:"editor-list-view-sidebar__tabs-tabpanel",tabId:"outline",focusable:!1},(0,T.createElement)("div",{className:"editor-list-view-sidebar__list-view-container"},(0,T.createElement)(bu,null)))))},PluginPostExcerpt:Zr,PostPanelRow:Br,PostViewLink:function(){const{hasLoaded:e,permalink:t,isPublished:n,label:o,showIconLabels:s}=(0,a.useSelect)((e=>{const t=e(Bo).getCurrentPostType(),n=e(m.store).getPostType(t),{get:o}=e(I.store);return{permalink:e(Bo).getPermalink(),isPublished:e(Bo).isCurrentPostPublished(),label:n?.labels.view_item,hasLoaded:!!n,showIconLabels:o("core","showIconLabels")}}),[]);return n&&t&&e?(0,T.createElement)(Yo.Button,{icon:yu,label:o||(0,d.__)("View post"),href:t,target:"_blank",showTooltip:!s}):null},PreviewDropdown:function({forceIsAutosaveable:e,disabled:t}){const{deviceType:n,homeUrl:o,isTemplate:s,isViewable:r,showIconLabels:i}=(0,a.useSelect)((e=>{var t;const{getDeviceType:n,getCurrentPostType:o}=e(Bo),{getUnstableBase:s,getPostType:r}=e(m.store),{get:i}=e(I.store),a=o();return{deviceType:n(),homeUrl:s()?.home,isTemplate:"wp_template"===a,isViewable:null!==(t=r(a)?.viewable)&&void 0!==t&&t,showIconLabels:i("core","showIconLabels")}}),[]),{setDeviceType:l}=(0,a.useDispatch)(Bo);if((0,Do.useViewportMatch)("medium","<"))return null;const c={className:"editor-preview-dropdown__toggle",size:"compact",showTooltip:!i,disabled:t,__experimentalIsFocusable:t},u={"aria-label":(0,d.__)("View options")},p={mobile:wu,tablet:ku,desktop:Su};return(0,T.createElement)(Yo.DropdownMenu,{className:"editor-preview-dropdown",popoverProps:{placement:"bottom-end"},toggleProps:c,menuProps:u,icon:p[n.toLowerCase()],label:(0,d.__)("View"),disableOpenOnArrowDown:t},(({onClose:t})=>(0,T.createElement)(T.Fragment,null,(0,T.createElement)(Yo.MenuGroup,null,(0,T.createElement)(Yo.MenuItem,{onClick:()=>l("Desktop"),icon:"Desktop"===n&&yr},(0,d.__)("Desktop")),(0,T.createElement)(Yo.MenuItem,{onClick:()=>l("Tablet"),icon:"Tablet"===n&&yr},(0,d.__)("Tablet")),(0,T.createElement)(Yo.MenuItem,{onClick:()=>l("Mobile"),icon:"Mobile"===n&&yr},(0,d.__)("Mobile"))),s&&(0,T.createElement)(Yo.MenuGroup,null,(0,T.createElement)(Yo.MenuItem,{href:o,target:"_blank",icon:yu,onClick:t},(0,d.__)("View site"),(0,T.createElement)(Yo.VisuallyHidden,{as:"span"},(0,d.__)("(opens in a new tab)")))),r&&(0,T.createElement)(Yo.MenuGroup,null,(0,T.createElement)(bi,{className:"editor-preview-dropdown__button-external",role:"menuitem",forceIsAutosaveable:e,textContent:(0,T.createElement)(T.Fragment,null,(0,d.__)("Preview in new tab"),(0,T.createElement)(Yo.Icon,{icon:yu})),onPreview:t})))))},PreferencesModal:function({extraSections:e={},isActive:t,onClose:n}){const o=(0,Do.useViewportMatch)("medium"),{showBlockBreadcrumbsOption:s}=(0,a.useSelect)((e=>{const{getEditorSettings:t}=e(Bo),{get:n}=e(I.store),s=t().richEditingEnabled;return{showBlockBreadcrumbsOption:!n("core","distractionFree")&&o&&s}}),[o]),{setIsListViewOpened:r,setIsInserterOpened:i}=(0,a.useDispatch)(Bo),{set:l}=(0,a.useDispatch)(I.store),c=()=>{l("core","fixedToolbar",!0),i(!1),r(!1)},u=()=>{l("core","distractionFree",!1)},p=(0,C.useMemo)((()=>[{name:"general",tabLabel:(0,d.__)("General"),content:(0,T.createElement)(T.Fragment,null,(0,T.createElement)(Iu,{title:(0,d.__)("Interface")},(0,T.createElement)(Nu,{scope:"core",featureName:"showListViewByDefault",help:(0,d.__)("Opens the block list view sidebar by default."),label:(0,d.__)("Always open list view")}),s&&(0,T.createElement)(Nu,{scope:"core",featureName:"showBlockBreadcrumbs",help:(0,d.__)("Display the block hierarchy trail at the bottom of the editor."),label:(0,d.__)("Show block breadcrumbs")}),(0,T.createElement)(Nu,{scope:"core",featureName:"allowRightClickOverrides",help:(0,d.__)("Allows contextual list view menus via right-click, overriding browser defaults."),label:(0,d.__)("Allow right-click contextual menus")})),(0,T.createElement)(Iu,{title:(0,d.__)("Document settings"),description:(0,d.__)("Select what settings are shown in the document panel.")},(0,T.createElement)(pu.Slot,null),(0,T.createElement)(Ka,{taxonomyWrapper:(e,t)=>(0,T.createElement)(lu,{label:t.labels.menu_name,panelName:`taxonomy-panel-${t.slug}`})}),(0,T.createElement)(Jr,null,(0,T.createElement)(lu,{label:(0,d.__)("Featured image"),panelName:"featured-image"})),(0,T.createElement)(jr,null,(0,T.createElement)(lu,{label:(0,d.__)("Excerpt"),panelName:"post-excerpt"})),(0,T.createElement)(Ys,{supportKeys:["comments","trackbacks"]},(0,T.createElement)(lu,{label:(0,d.__)("Discussion"),panelName:"discussion-panel"})),(0,T.createElement)(Zs,null,(0,T.createElement)(lu,{label:(0,d.__)("Page attributes"),panelName:"page-attributes"}))),e?.general)},{name:"appearance",tabLabel:(0,d.__)("Appearance"),content:(0,T.createElement)(Iu,{title:(0,d.__)("Appearance"),description:(0,d.__)("Customize the editor interface to suit your needs.")},(0,T.createElement)(Nu,{scope:"core",featureName:"fixedToolbar",onToggle:u,help:(0,d.__)("Access all block and document tools in a single place."),label:(0,d.__)("Top toolbar")}),(0,T.createElement)(Nu,{scope:"core",featureName:"distractionFree",onToggle:c,help:(0,d.__)("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:(0,d.__)("Distraction free")}),(0,T.createElement)(Nu,{scope:"core",featureName:"focusMode",help:(0,d.__)("Highlights the current block and fades other content."),label:(0,d.__)("Spotlight mode")}),e?.appearance)},{name:"accessibility",tabLabel:(0,d.__)("Accessibility"),content:(0,T.createElement)(T.Fragment,null,(0,T.createElement)(Iu,{title:(0,d.__)("Navigation"),description:(0,d.__)("Optimize the editing experience for enhanced control.")},(0,T.createElement)(Nu,{scope:"core",featureName:"keepCaretInsideBlock",help:(0,d.__)("Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block."),label:(0,d.__)("Contain text cursor inside block")})),(0,T.createElement)(Iu,{title:(0,d.__)("Interface")},(0,T.createElement)(Nu,{scope:"core",featureName:"showIconLabels",label:(0,d.__)("Show button text labels"),help:(0,d.__)("Show text instead of icons on buttons across the interface.")})))},{name:"blocks",tabLabel:(0,d.__)("Blocks"),content:(0,T.createElement)(T.Fragment,null,(0,T.createElement)(Iu,{title:(0,d.__)("Inserter")},(0,T.createElement)(Nu,{scope:"core",featureName:"mostUsedBlocks",help:(0,d.__)("Adds a category with the most frequently used blocks in the inserter."),label:(0,d.__)("Show most used blocks")})),(0,T.createElement)(Iu,{title:(0,d.__)("Manage block visibility"),description:(0,d.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")},(0,T.createElement)(Tu,null)))}]),[o,s,e]);return t?(0,T.createElement)(xu,{closeModal:n},(0,T.createElement)(Bu,{sections:p})):null},useBlockEditorSettings:Ol})})(),(window.wp=window.wp||{}).editor=o})();