[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/js/dist/ -> editor.js (source)

   1  /******/ (() => { // webpackBootstrap
   2  /******/     var __webpack_modules__ = ({
   3  
   4  /***/ 66:
   5  /***/ ((module) => {
   6  
   7  "use strict";
   8  
   9  
  10  var isMergeableObject = function isMergeableObject(value) {
  11      return isNonNullObject(value)
  12          && !isSpecial(value)
  13  };
  14  
  15  function isNonNullObject(value) {
  16      return !!value && typeof value === 'object'
  17  }
  18  
  19  function isSpecial(value) {
  20      var stringValue = Object.prototype.toString.call(value);
  21  
  22      return stringValue === '[object RegExp]'
  23          || stringValue === '[object Date]'
  24          || isReactElement(value)
  25  }
  26  
  27  // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
  28  var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
  29  var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
  30  
  31  function isReactElement(value) {
  32      return value.$$typeof === REACT_ELEMENT_TYPE
  33  }
  34  
  35  function emptyTarget(val) {
  36      return Array.isArray(val) ? [] : {}
  37  }
  38  
  39  function cloneUnlessOtherwiseSpecified(value, options) {
  40      return (options.clone !== false && options.isMergeableObject(value))
  41          ? deepmerge(emptyTarget(value), value, options)
  42          : value
  43  }
  44  
  45  function defaultArrayMerge(target, source, options) {
  46      return target.concat(source).map(function(element) {
  47          return cloneUnlessOtherwiseSpecified(element, options)
  48      })
  49  }
  50  
  51  function getMergeFunction(key, options) {
  52      if (!options.customMerge) {
  53          return deepmerge
  54      }
  55      var customMerge = options.customMerge(key);
  56      return typeof customMerge === 'function' ? customMerge : deepmerge
  57  }
  58  
  59  function getEnumerableOwnPropertySymbols(target) {
  60      return Object.getOwnPropertySymbols
  61          ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
  62              return Object.propertyIsEnumerable.call(target, symbol)
  63          })
  64          : []
  65  }
  66  
  67  function getKeys(target) {
  68      return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
  69  }
  70  
  71  function propertyIsOnObject(object, property) {
  72      try {
  73          return property in object
  74      } catch(_) {
  75          return false
  76      }
  77  }
  78  
  79  // Protects from prototype poisoning and unexpected merging up the prototype chain.
  80  function propertyIsUnsafe(target, key) {
  81      return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
  82          && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
  83              && Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
  84  }
  85  
  86  function mergeObject(target, source, options) {
  87      var destination = {};
  88      if (options.isMergeableObject(target)) {
  89          getKeys(target).forEach(function(key) {
  90              destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
  91          });
  92      }
  93      getKeys(source).forEach(function(key) {
  94          if (propertyIsUnsafe(target, key)) {
  95              return
  96          }
  97  
  98          if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
  99              destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
 100          } else {
 101              destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
 102          }
 103      });
 104      return destination
 105  }
 106  
 107  function deepmerge(target, source, options) {
 108      options = options || {};
 109      options.arrayMerge = options.arrayMerge || defaultArrayMerge;
 110      options.isMergeableObject = options.isMergeableObject || isMergeableObject;
 111      // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
 112      // implementations can use it. The caller may not replace it.
 113      options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
 114  
 115      var sourceIsArray = Array.isArray(source);
 116      var targetIsArray = Array.isArray(target);
 117      var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
 118  
 119      if (!sourceAndTargetTypesMatch) {
 120          return cloneUnlessOtherwiseSpecified(source, options)
 121      } else if (sourceIsArray) {
 122          return options.arrayMerge(target, source, options)
 123      } else {
 124          return mergeObject(target, source, options)
 125      }
 126  }
 127  
 128  deepmerge.all = function deepmergeAll(array, options) {
 129      if (!Array.isArray(array)) {
 130          throw new Error('first argument should be an array')
 131      }
 132  
 133      return array.reduce(function(prev, next) {
 134          return deepmerge(prev, next, options)
 135      }, {})
 136  };
 137  
 138  var deepmerge_1 = deepmerge;
 139  
 140  module.exports = deepmerge_1;
 141  
 142  
 143  /***/ }),
 144  
 145  /***/ 461:
 146  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
 147  
 148  // Load in dependencies
 149  var computedStyle = __webpack_require__(6109);
 150  
 151  /**
 152   * Calculate the `line-height` of a given node
 153   * @param {HTMLElement} node Element to calculate line height of. Must be in the DOM.
 154   * @returns {Number} `line-height` of the element in pixels
 155   */
 156  function lineHeight(node) {
 157    // Grab the line-height via style
 158    var lnHeightStr = computedStyle(node, 'line-height');
 159    var lnHeight = parseFloat(lnHeightStr, 10);
 160  
 161    // If the lineHeight did not contain a unit (i.e. it was numeric), convert it to ems (e.g. '2.3' === '2.3em')
 162    if (lnHeightStr === lnHeight + '') {
 163      // Save the old lineHeight style and update the em unit to the element
 164      var _lnHeightStyle = node.style.lineHeight;
 165      node.style.lineHeight = lnHeightStr + 'em';
 166  
 167      // Calculate the em based height
 168      lnHeightStr = computedStyle(node, 'line-height');
 169      lnHeight = parseFloat(lnHeightStr, 10);
 170  
 171      // Revert the lineHeight style
 172      if (_lnHeightStyle) {
 173        node.style.lineHeight = _lnHeightStyle;
 174      } else {
 175        delete node.style.lineHeight;
 176      }
 177    }
 178  
 179    // If the lineHeight is in `pt`, convert it to pixels (4px for 3pt)
 180    // DEV: `em` units are converted to `pt` in IE6
 181    // Conversion ratio from https://developer.mozilla.org/en-US/docs/Web/CSS/length
 182    if (lnHeightStr.indexOf('pt') !== -1) {
 183      lnHeight *= 4;
 184      lnHeight /= 3;
 185    // Otherwise, if the lineHeight is in `mm`, convert it to pixels (96px for 25.4mm)
 186    } else if (lnHeightStr.indexOf('mm') !== -1) {
 187      lnHeight *= 96;
 188      lnHeight /= 25.4;
 189    // Otherwise, if the lineHeight is in `cm`, convert it to pixels (96px for 2.54cm)
 190    } else if (lnHeightStr.indexOf('cm') !== -1) {
 191      lnHeight *= 96;
 192      lnHeight /= 2.54;
 193    // Otherwise, if the lineHeight is in `in`, convert it to pixels (96px for 1in)
 194    } else if (lnHeightStr.indexOf('in') !== -1) {
 195      lnHeight *= 96;
 196    // Otherwise, if the lineHeight is in `pc`, convert it to pixels (12pt for 1pc)
 197    } else if (lnHeightStr.indexOf('pc') !== -1) {
 198      lnHeight *= 16;
 199    }
 200  
 201    // Continue our computation
 202    lnHeight = Math.round(lnHeight);
 203  
 204    // If the line-height is "normal", calculate by font-size
 205    if (lnHeightStr === 'normal') {
 206      // Create a temporary node
 207      var nodeName = node.nodeName;
 208      var _node = document.createElement(nodeName);
 209      _node.innerHTML = ' ';
 210  
 211      // If we have a text area, reset it to only 1 row
 212      // https://github.com/twolfson/line-height/issues/4
 213      if (nodeName.toUpperCase() === 'TEXTAREA') {
 214        _node.setAttribute('rows', '1');
 215      }
 216  
 217      // Set the font-size of the element
 218      var fontSizeStr = computedStyle(node, 'font-size');
 219      _node.style.fontSize = fontSizeStr;
 220  
 221      // Remove default padding/border which can affect offset height
 222      // https://github.com/twolfson/line-height/issues/4
 223      // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight
 224      _node.style.padding = '0px';
 225      _node.style.border = '0px';
 226  
 227      // Append it to the body
 228      var body = document.body;
 229      body.appendChild(_node);
 230  
 231      // Assume the line height of the element is the height
 232      var height = _node.offsetHeight;
 233      lnHeight = height;
 234  
 235      // Remove our child from the DOM
 236      body.removeChild(_node);
 237    }
 238  
 239    // Return the calculated height
 240    return lnHeight;
 241  }
 242  
 243  // Export lineHeight
 244  module.exports = lineHeight;
 245  
 246  
 247  /***/ }),
 248  
 249  /***/ 628:
 250  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
 251  
 252  "use strict";
 253  /**
 254   * Copyright (c) 2013-present, Facebook, Inc.
 255   *
 256   * This source code is licensed under the MIT license found in the
 257   * LICENSE file in the root directory of this source tree.
 258   */
 259  
 260  
 261  
 262  var ReactPropTypesSecret = __webpack_require__(4067);
 263  
 264  function emptyFunction() {}
 265  function emptyFunctionWithReset() {}
 266  emptyFunctionWithReset.resetWarningCache = emptyFunction;
 267  
 268  module.exports = function() {
 269    function shim(props, propName, componentName, location, propFullName, secret) {
 270      if (secret === ReactPropTypesSecret) {
 271        // It is still safe when called from React.
 272        return;
 273      }
 274      var err = new Error(
 275        'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
 276        'Use PropTypes.checkPropTypes() to call them. ' +
 277        'Read more at http://fb.me/use-check-prop-types'
 278      );
 279      err.name = 'Invariant Violation';
 280      throw err;
 281    };
 282    shim.isRequired = shim;
 283    function getShim() {
 284      return shim;
 285    };
 286    // Important!
 287    // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
 288    var ReactPropTypes = {
 289      array: shim,
 290      bigint: shim,
 291      bool: shim,
 292      func: shim,
 293      number: shim,
 294      object: shim,
 295      string: shim,
 296      symbol: shim,
 297  
 298      any: shim,
 299      arrayOf: getShim,
 300      element: shim,
 301      elementType: shim,
 302      instanceOf: getShim,
 303      node: shim,
 304      objectOf: getShim,
 305      oneOf: getShim,
 306      oneOfType: getShim,
 307      shape: getShim,
 308      exact: getShim,
 309  
 310      checkPropTypes: emptyFunctionWithReset,
 311      resetWarningCache: emptyFunction
 312    };
 313  
 314    ReactPropTypes.PropTypes = ReactPropTypes;
 315  
 316    return ReactPropTypes;
 317  };
 318  
 319  
 320  /***/ }),
 321  
 322  /***/ 1609:
 323  /***/ ((module) => {
 324  
 325  "use strict";
 326  module.exports = window["React"];
 327  
 328  /***/ }),
 329  
 330  /***/ 4067:
 331  /***/ ((module) => {
 332  
 333  "use strict";
 334  /**
 335   * Copyright (c) 2013-present, Facebook, Inc.
 336   *
 337   * This source code is licensed under the MIT license found in the
 338   * LICENSE file in the root directory of this source tree.
 339   */
 340  
 341  
 342  
 343  var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
 344  
 345  module.exports = ReactPropTypesSecret;
 346  
 347  
 348  /***/ }),
 349  
 350  /***/ 4132:
 351  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
 352  
 353  "use strict";
 354  var __webpack_unused_export__;
 355  
 356  __webpack_unused_export__ = true;
 357  var TextareaAutosize_1 = __webpack_require__(4462);
 358  exports.A = TextareaAutosize_1.TextareaAutosize;
 359  
 360  
 361  /***/ }),
 362  
 363  /***/ 4306:
 364  /***/ (function(module, exports) {
 365  
 366  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
 367      autosize 4.0.4
 368      license: MIT
 369      http://www.jacklmoore.com/autosize
 370  */
 371  (function (global, factory) {
 372      if (true) {
 373          !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
 374          __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
 375          (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
 376          __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
 377      } else { var mod; }
 378  })(this, function (module, exports) {
 379      'use strict';
 380  
 381      var map = typeof Map === "function" ? new Map() : function () {
 382          var keys = [];
 383          var values = [];
 384  
 385          return {
 386              has: function has(key) {
 387                  return keys.indexOf(key) > -1;
 388              },
 389              get: function get(key) {
 390                  return values[keys.indexOf(key)];
 391              },
 392              set: function set(key, value) {
 393                  if (keys.indexOf(key) === -1) {
 394                      keys.push(key);
 395                      values.push(value);
 396                  }
 397              },
 398              delete: function _delete(key) {
 399                  var index = keys.indexOf(key);
 400                  if (index > -1) {
 401                      keys.splice(index, 1);
 402                      values.splice(index, 1);
 403                  }
 404              }
 405          };
 406      }();
 407  
 408      var createEvent = function createEvent(name) {
 409          return new Event(name, { bubbles: true });
 410      };
 411      try {
 412          new Event('test');
 413      } catch (e) {
 414          // IE does not support `new Event()`
 415          createEvent = function createEvent(name) {
 416              var evt = document.createEvent('Event');
 417              evt.initEvent(name, true, false);
 418              return evt;
 419          };
 420      }
 421  
 422  	function assign(ta) {
 423          if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return;
 424  
 425          var heightOffset = null;
 426          var clientWidth = null;
 427          var cachedHeight = null;
 428  
 429  		function init() {
 430              var style = window.getComputedStyle(ta, null);
 431  
 432              if (style.resize === 'vertical') {
 433                  ta.style.resize = 'none';
 434              } else if (style.resize === 'both') {
 435                  ta.style.resize = 'horizontal';
 436              }
 437  
 438              if (style.boxSizing === 'content-box') {
 439                  heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));
 440              } else {
 441                  heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
 442              }
 443              // Fix when a textarea is not on document body and heightOffset is Not a Number
 444              if (isNaN(heightOffset)) {
 445                  heightOffset = 0;
 446              }
 447  
 448              update();
 449          }
 450  
 451  		function changeOverflow(value) {
 452              {
 453                  // Chrome/Safari-specific fix:
 454                  // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space
 455                  // made available by removing the scrollbar. The following forces the necessary text reflow.
 456                  var width = ta.style.width;
 457                  ta.style.width = '0px';
 458                  // Force reflow:
 459                  /* jshint ignore:start */
 460                  ta.offsetWidth;
 461                  /* jshint ignore:end */
 462                  ta.style.width = width;
 463              }
 464  
 465              ta.style.overflowY = value;
 466          }
 467  
 468  		function getParentOverflows(el) {
 469              var arr = [];
 470  
 471              while (el && el.parentNode && el.parentNode instanceof Element) {
 472                  if (el.parentNode.scrollTop) {
 473                      arr.push({
 474                          node: el.parentNode,
 475                          scrollTop: el.parentNode.scrollTop
 476                      });
 477                  }
 478                  el = el.parentNode;
 479              }
 480  
 481              return arr;
 482          }
 483  
 484  		function resize() {
 485              if (ta.scrollHeight === 0) {
 486                  // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.
 487                  return;
 488              }
 489  
 490              var overflows = getParentOverflows(ta);
 491              var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)
 492  
 493              ta.style.height = '';
 494              ta.style.height = ta.scrollHeight + heightOffset + 'px';
 495  
 496              // used to check if an update is actually necessary on window.resize
 497              clientWidth = ta.clientWidth;
 498  
 499              // prevents scroll-position jumping
 500              overflows.forEach(function (el) {
 501                  el.node.scrollTop = el.scrollTop;
 502              });
 503  
 504              if (docTop) {
 505                  document.documentElement.scrollTop = docTop;
 506              }
 507          }
 508  
 509  		function update() {
 510              resize();
 511  
 512              var styleHeight = Math.round(parseFloat(ta.style.height));
 513              var computed = window.getComputedStyle(ta, null);
 514  
 515              // Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box
 516              var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight;
 517  
 518              // The actual height not matching the style height (set via the resize method) indicates that 
 519              // the max-height has been exceeded, in which case the overflow should be allowed.
 520              if (actualHeight < styleHeight) {
 521                  if (computed.overflowY === 'hidden') {
 522                      changeOverflow('scroll');
 523                      resize();
 524                      actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
 525                  }
 526              } else {
 527                  // Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands.
 528                  if (computed.overflowY !== 'hidden') {
 529                      changeOverflow('hidden');
 530                      resize();
 531                      actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
 532                  }
 533              }
 534  
 535              if (cachedHeight !== actualHeight) {
 536                  cachedHeight = actualHeight;
 537                  var evt = createEvent('autosize:resized');
 538                  try {
 539                      ta.dispatchEvent(evt);
 540                  } catch (err) {
 541                      // Firefox will throw an error on dispatchEvent for a detached element
 542                      // https://bugzilla.mozilla.org/show_bug.cgi?id=889376
 543                  }
 544              }
 545          }
 546  
 547          var pageResize = function pageResize() {
 548              if (ta.clientWidth !== clientWidth) {
 549                  update();
 550              }
 551          };
 552  
 553          var destroy = function (style) {
 554              window.removeEventListener('resize', pageResize, false);
 555              ta.removeEventListener('input', update, false);
 556              ta.removeEventListener('keyup', update, false);
 557              ta.removeEventListener('autosize:destroy', destroy, false);
 558              ta.removeEventListener('autosize:update', update, false);
 559  
 560              Object.keys(style).forEach(function (key) {
 561                  ta.style[key] = style[key];
 562              });
 563  
 564              map.delete(ta);
 565          }.bind(ta, {
 566              height: ta.style.height,
 567              resize: ta.style.resize,
 568              overflowY: ta.style.overflowY,
 569              overflowX: ta.style.overflowX,
 570              wordWrap: ta.style.wordWrap
 571          });
 572  
 573          ta.addEventListener('autosize:destroy', destroy, false);
 574  
 575          // IE9 does not fire onpropertychange or oninput for deletions,
 576          // so binding to onkeyup to catch most of those events.
 577          // There is no way that I know of to detect something like 'cut' in IE9.
 578          if ('onpropertychange' in ta && 'oninput' in ta) {
 579              ta.addEventListener('keyup', update, false);
 580          }
 581  
 582          window.addEventListener('resize', pageResize, false);
 583          ta.addEventListener('input', update, false);
 584          ta.addEventListener('autosize:update', update, false);
 585          ta.style.overflowX = 'hidden';
 586          ta.style.wordWrap = 'break-word';
 587  
 588          map.set(ta, {
 589              destroy: destroy,
 590              update: update
 591          });
 592  
 593          init();
 594      }
 595  
 596  	function destroy(ta) {
 597          var methods = map.get(ta);
 598          if (methods) {
 599              methods.destroy();
 600          }
 601      }
 602  
 603  	function update(ta) {
 604          var methods = map.get(ta);
 605          if (methods) {
 606              methods.update();
 607          }
 608      }
 609  
 610      var autosize = null;
 611  
 612      // Do nothing in Node.js environment and IE8 (or lower)
 613      if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {
 614          autosize = function autosize(el) {
 615              return el;
 616          };
 617          autosize.destroy = function (el) {
 618              return el;
 619          };
 620          autosize.update = function (el) {
 621              return el;
 622          };
 623      } else {
 624          autosize = function autosize(el, options) {
 625              if (el) {
 626                  Array.prototype.forEach.call(el.length ? el : [el], function (x) {
 627                      return assign(x, options);
 628                  });
 629              }
 630              return el;
 631          };
 632          autosize.destroy = function (el) {
 633              if (el) {
 634                  Array.prototype.forEach.call(el.length ? el : [el], destroy);
 635              }
 636              return el;
 637          };
 638          autosize.update = function (el) {
 639              if (el) {
 640                  Array.prototype.forEach.call(el.length ? el : [el], update);
 641              }
 642              return el;
 643          };
 644      }
 645  
 646      exports.default = autosize;
 647      module.exports = exports['default'];
 648  });
 649  
 650  /***/ }),
 651  
 652  /***/ 4462:
 653  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
 654  
 655  "use strict";
 656  
 657  var __extends = (this && this.__extends) || (function () {
 658      var extendStatics = Object.setPrototypeOf ||
 659          ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
 660          function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
 661      return function (d, b) {
 662          extendStatics(d, b);
 663          function __() { this.constructor = d; }
 664          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
 665      };
 666  })();
 667  var __assign = (this && this.__assign) || Object.assign || function(t) {
 668      for (var s, i = 1, n = arguments.length; i < n; i++) {
 669          s = arguments[i];
 670          for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
 671              t[p] = s[p];
 672      }
 673      return t;
 674  };
 675  var __rest = (this && this.__rest) || function (s, e) {
 676      var t = {};
 677      for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
 678          t[p] = s[p];
 679      if (s != null && typeof Object.getOwnPropertySymbols === "function")
 680          for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
 681              t[p[i]] = s[p[i]];
 682      return t;
 683  };
 684  exports.__esModule = true;
 685  var React = __webpack_require__(1609);
 686  var PropTypes = __webpack_require__(5826);
 687  var autosize = __webpack_require__(4306);
 688  var _getLineHeight = __webpack_require__(461);
 689  var getLineHeight = _getLineHeight;
 690  var RESIZED = "autosize:resized";
 691  /**
 692   * A light replacement for built-in textarea component
 693   * which automaticaly adjusts its height to match the content
 694   */
 695  var TextareaAutosizeClass = /** @class */ (function (_super) {
 696      __extends(TextareaAutosizeClass, _super);
 697      function TextareaAutosizeClass() {
 698          var _this = _super !== null && _super.apply(this, arguments) || this;
 699          _this.state = {
 700              lineHeight: null
 701          };
 702          _this.textarea = null;
 703          _this.onResize = function (e) {
 704              if (_this.props.onResize) {
 705                  _this.props.onResize(e);
 706              }
 707          };
 708          _this.updateLineHeight = function () {
 709              if (_this.textarea) {
 710                  _this.setState({
 711                      lineHeight: getLineHeight(_this.textarea)
 712                  });
 713              }
 714          };
 715          _this.onChange = function (e) {
 716              var onChange = _this.props.onChange;
 717              _this.currentValue = e.currentTarget.value;
 718              onChange && onChange(e);
 719          };
 720          return _this;
 721      }
 722      TextareaAutosizeClass.prototype.componentDidMount = function () {
 723          var _this = this;
 724          var _a = this.props, maxRows = _a.maxRows, async = _a.async;
 725          if (typeof maxRows === "number") {
 726              this.updateLineHeight();
 727          }
 728          if (typeof maxRows === "number" || async) {
 729              /*
 730                the defer is needed to:
 731                  - force "autosize" to activate the scrollbar when this.props.maxRows is passed
 732                  - support StyledComponents (see #71)
 733              */
 734              setTimeout(function () { return _this.textarea && autosize(_this.textarea); });
 735          }
 736          else {
 737              this.textarea && autosize(this.textarea);
 738          }
 739          if (this.textarea) {
 740              this.textarea.addEventListener(RESIZED, this.onResize);
 741          }
 742      };
 743      TextareaAutosizeClass.prototype.componentWillUnmount = function () {
 744          if (this.textarea) {
 745              this.textarea.removeEventListener(RESIZED, this.onResize);
 746              autosize.destroy(this.textarea);
 747          }
 748      };
 749      TextareaAutosizeClass.prototype.render = function () {
 750          var _this = this;
 751          var _a = this, _b = _a.props, onResize = _b.onResize, maxRows = _b.maxRows, onChange = _b.onChange, style = _b.style, innerRef = _b.innerRef, children = _b.children, props = __rest(_b, ["onResize", "maxRows", "onChange", "style", "innerRef", "children"]), lineHeight = _a.state.lineHeight;
 752          var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null;
 753          return (React.createElement("textarea", __assign({}, props, { onChange: this.onChange, style: maxHeight ? __assign({}, style, { maxHeight: maxHeight }) : style, ref: function (element) {
 754                  _this.textarea = element;
 755                  if (typeof _this.props.innerRef === 'function') {
 756                      _this.props.innerRef(element);
 757                  }
 758                  else if (_this.props.innerRef) {
 759                      _this.props.innerRef.current = element;
 760                  }
 761              } }), children));
 762      };
 763      TextareaAutosizeClass.prototype.componentDidUpdate = function () {
 764          this.textarea && autosize.update(this.textarea);
 765      };
 766      TextareaAutosizeClass.defaultProps = {
 767          rows: 1,
 768          async: false
 769      };
 770      TextareaAutosizeClass.propTypes = {
 771          rows: PropTypes.number,
 772          maxRows: PropTypes.number,
 773          onResize: PropTypes.func,
 774          innerRef: PropTypes.any,
 775          async: PropTypes.bool
 776      };
 777      return TextareaAutosizeClass;
 778  }(React.Component));
 779  exports.TextareaAutosize = React.forwardRef(function (props, ref) {
 780      return React.createElement(TextareaAutosizeClass, __assign({}, props, { innerRef: ref }));
 781  });
 782  
 783  
 784  /***/ }),
 785  
 786  /***/ 5215:
 787  /***/ ((module) => {
 788  
 789  "use strict";
 790  
 791  
 792  // do not edit .js files directly - edit src/index.jst
 793  
 794  
 795  
 796  module.exports = function equal(a, b) {
 797    if (a === b) return true;
 798  
 799    if (a && b && typeof a == 'object' && typeof b == 'object') {
 800      if (a.constructor !== b.constructor) return false;
 801  
 802      var length, i, keys;
 803      if (Array.isArray(a)) {
 804        length = a.length;
 805        if (length != b.length) return false;
 806        for (i = length; i-- !== 0;)
 807          if (!equal(a[i], b[i])) return false;
 808        return true;
 809      }
 810  
 811  
 812  
 813      if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
 814      if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
 815      if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
 816  
 817      keys = Object.keys(a);
 818      length = keys.length;
 819      if (length !== Object.keys(b).length) return false;
 820  
 821      for (i = length; i-- !== 0;)
 822        if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
 823  
 824      for (i = length; i-- !== 0;) {
 825        var key = keys[i];
 826  
 827        if (!equal(a[key], b[key])) return false;
 828      }
 829  
 830      return true;
 831    }
 832  
 833    // true if both NaN, false otherwise
 834    return a!==a && b!==b;
 835  };
 836  
 837  
 838  /***/ }),
 839  
 840  /***/ 5826:
 841  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
 842  
 843  /**
 844   * Copyright (c) 2013-present, Facebook, Inc.
 845   *
 846   * This source code is licensed under the MIT license found in the
 847   * LICENSE file in the root directory of this source tree.
 848   */
 849  
 850  if (false) { var throwOnDirectAccess, ReactIs; } else {
 851    // By explicitly using `prop-types` you are opting into new production behavior.
 852    // http://fb.me/prop-types-in-prod
 853    module.exports = __webpack_require__(628)();
 854  }
 855  
 856  
 857  /***/ }),
 858  
 859  /***/ 6109:
 860  /***/ ((module) => {
 861  
 862  // This code has been refactored for 140 bytes
 863  // You can see the original here: https://github.com/twolfson/computedStyle/blob/04cd1da2e30fa45844f95f5cb1ac898e9b9ef050/lib/computedStyle.js
 864  var computedStyle = function (el, prop, getComputedStyle) {
 865    getComputedStyle = window.getComputedStyle;
 866  
 867    // In one fell swoop
 868    return (
 869      // If we have getComputedStyle
 870      getComputedStyle ?
 871        // Query it
 872        // TODO: From CSS-Query notes, we might need (node, null) for FF
 873        getComputedStyle(el) :
 874  
 875      // Otherwise, we are in IE and use currentStyle
 876        el.currentStyle
 877    )[
 878      // Switch to camelCase for CSSOM
 879      // DEV: Grabbed from jQuery
 880      // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194
 881      // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597
 882      prop.replace(/-(\w)/gi, function (word, letter) {
 883        return letter.toUpperCase();
 884      })
 885    ];
 886  };
 887  
 888  module.exports = computedStyle;
 889  
 890  
 891  /***/ }),
 892  
 893  /***/ 9681:
 894  /***/ ((module) => {
 895  
 896  var characterMap = {
 897      "À": "A",
 898      "Á": "A",
 899      "Â": "A",
 900      "Ã": "A",
 901      "Ä": "A",
 902      "Å": "A",
 903      "Ấ": "A",
 904      "Ắ": "A",
 905      "Ẳ": "A",
 906      "Ẵ": "A",
 907      "Ặ": "A",
 908      "Æ": "AE",
 909      "Ầ": "A",
 910      "Ằ": "A",
 911      "Ȃ": "A",
 912      "Ả": "A",
 913      "Ạ": "A",
 914      "Ẩ": "A",
 915      "Ẫ": "A",
 916      "Ậ": "A",
 917      "Ç": "C",
 918      "Ḉ": "C",
 919      "È": "E",
 920      "É": "E",
 921      "Ê": "E",
 922      "Ë": "E",
 923      "Ế": "E",
 924      "Ḗ": "E",
 925      "Ề": "E",
 926      "Ḕ": "E",
 927      "Ḝ": "E",
 928      "Ȇ": "E",
 929      "Ẻ": "E",
 930      "Ẽ": "E",
 931      "Ẹ": "E",
 932      "Ể": "E",
 933      "Ễ": "E",
 934      "Ệ": "E",
 935      "Ì": "I",
 936      "Í": "I",
 937      "Î": "I",
 938      "Ï": "I",
 939      "Ḯ": "I",
 940      "Ȋ": "I",
 941      "Ỉ": "I",
 942      "Ị": "I",
 943      "Ð": "D",
 944      "Ñ": "N",
 945      "Ò": "O",
 946      "Ó": "O",
 947      "Ô": "O",
 948      "Õ": "O",
 949      "Ö": "O",
 950      "Ø": "O",
 951      "Ố": "O",
 952      "Ṍ": "O",
 953      "Ṓ": "O",
 954      "Ȏ": "O",
 955      "Ỏ": "O",
 956      "Ọ": "O",
 957      "Ổ": "O",
 958      "Ỗ": "O",
 959      "Ộ": "O",
 960      "Ờ": "O",
 961      "Ở": "O",
 962      "Ỡ": "O",
 963      "Ớ": "O",
 964      "Ợ": "O",
 965      "Ù": "U",
 966      "Ú": "U",
 967      "Û": "U",
 968      "Ü": "U",
 969      "Ủ": "U",
 970      "Ụ": "U",
 971      "Ử": "U",
 972      "Ữ": "U",
 973      "Ự": "U",
 974      "Ý": "Y",
 975      "à": "a",
 976      "á": "a",
 977      "â": "a",
 978      "ã": "a",
 979      "ä": "a",
 980      "å": "a",
 981      "ấ": "a",
 982      "ắ": "a",
 983      "ẳ": "a",
 984      "ẵ": "a",
 985      "ặ": "a",
 986      "æ": "ae",
 987      "ầ": "a",
 988      "ằ": "a",
 989      "ȃ": "a",
 990      "ả": "a",
 991      "ạ": "a",
 992      "ẩ": "a",
 993      "ẫ": "a",
 994      "ậ": "a",
 995      "ç": "c",
 996      "ḉ": "c",
 997      "è": "e",
 998      "é": "e",
 999      "ê": "e",
1000      "ë": "e",
1001      "ế": "e",
1002      "ḗ": "e",
1003      "ề": "e",
1004      "ḕ": "e",
1005      "ḝ": "e",
1006      "ȇ": "e",
1007      "ẻ": "e",
1008      "ẽ": "e",
1009      "ẹ": "e",
1010      "ể": "e",
1011      "ễ": "e",
1012      "ệ": "e",
1013      "ì": "i",
1014      "í": "i",
1015      "î": "i",
1016      "ï": "i",
1017      "ḯ": "i",
1018      "ȋ": "i",
1019      "ỉ": "i",
1020      "ị": "i",
1021      "ð": "d",
1022      "ñ": "n",
1023      "ò": "o",
1024      "ó": "o",
1025      "ô": "o",
1026      "õ": "o",
1027      "ö": "o",
1028      "ø": "o",
1029      "ố": "o",
1030      "ṍ": "o",
1031      "ṓ": "o",
1032      "ȏ": "o",
1033      "ỏ": "o",
1034      "ọ": "o",
1035      "ổ": "o",
1036      "ỗ": "o",
1037      "ộ": "o",
1038      "ờ": "o",
1039      "ở": "o",
1040      "ỡ": "o",
1041      "ớ": "o",
1042      "ợ": "o",
1043      "ù": "u",
1044      "ú": "u",
1045      "û": "u",
1046      "ü": "u",
1047      "ủ": "u",
1048      "ụ": "u",
1049      "ử": "u",
1050      "ữ": "u",
1051      "ự": "u",
1052      "ý": "y",
1053      "ÿ": "y",
1054      "Ā": "A",
1055      "ā": "a",
1056      "Ă": "A",
1057      "ă": "a",
1058      "Ą": "A",
1059      "ą": "a",
1060      "Ć": "C",
1061      "ć": "c",
1062      "Ĉ": "C",
1063      "ĉ": "c",
1064      "Ċ": "C",
1065      "ċ": "c",
1066      "Č": "C",
1067      "č": "c",
1068      "C̆": "C",
1069      "c̆": "c",
1070      "Ď": "D",
1071      "ď": "d",
1072      "Đ": "D",
1073      "đ": "d",
1074      "Ē": "E",
1075      "ē": "e",
1076      "Ĕ": "E",
1077      "ĕ": "e",
1078      "Ė": "E",
1079      "ė": "e",
1080      "Ę": "E",
1081      "ę": "e",
1082      "Ě": "E",
1083      "ě": "e",
1084      "Ĝ": "G",
1085      "Ǵ": "G",
1086      "ĝ": "g",
1087      "ǵ": "g",
1088      "Ğ": "G",
1089      "ğ": "g",
1090      "Ġ": "G",
1091      "ġ": "g",
1092      "Ģ": "G",
1093      "ģ": "g",
1094      "Ĥ": "H",
1095      "ĥ": "h",
1096      "Ħ": "H",
1097      "ħ": "h",
1098      "Ḫ": "H",
1099      "ḫ": "h",
1100      "Ĩ": "I",
1101      "ĩ": "i",
1102      "Ī": "I",
1103      "ī": "i",
1104      "Ĭ": "I",
1105      "ĭ": "i",
1106      "Į": "I",
1107      "į": "i",
1108      "İ": "I",
1109      "ı": "i",
1110      "IJ": "IJ",
1111      "ij": "ij",
1112      "Ĵ": "J",
1113      "ĵ": "j",
1114      "Ķ": "K",
1115      "ķ": "k",
1116      "Ḱ": "K",
1117      "ḱ": "k",
1118      "K̆": "K",
1119      "k̆": "k",
1120      "Ĺ": "L",
1121      "ĺ": "l",
1122      "Ļ": "L",
1123      "ļ": "l",
1124      "Ľ": "L",
1125      "ľ": "l",
1126      "Ŀ": "L",
1127      "ŀ": "l",
1128      "Ł": "l",
1129      "ł": "l",
1130      "Ḿ": "M",
1131      "ḿ": "m",
1132      "M̆": "M",
1133      "m̆": "m",
1134      "Ń": "N",
1135      "ń": "n",
1136      "Ņ": "N",
1137      "ņ": "n",
1138      "Ň": "N",
1139      "ň": "n",
1140      "ʼn": "n",
1141      "N̆": "N",
1142      "n̆": "n",
1143      "Ō": "O",
1144      "ō": "o",
1145      "Ŏ": "O",
1146      "ŏ": "o",
1147      "Ő": "O",
1148      "ő": "o",
1149      "Œ": "OE",
1150      "œ": "oe",
1151      "P̆": "P",
1152      "p̆": "p",
1153      "Ŕ": "R",
1154      "ŕ": "r",
1155      "Ŗ": "R",
1156      "ŗ": "r",
1157      "Ř": "R",
1158      "ř": "r",
1159      "R̆": "R",
1160      "r̆": "r",
1161      "Ȓ": "R",
1162      "ȓ": "r",
1163      "Ś": "S",
1164      "ś": "s",
1165      "Ŝ": "S",
1166      "ŝ": "s",
1167      "Ş": "S",
1168      "Ș": "S",
1169      "ș": "s",
1170      "ş": "s",
1171      "Š": "S",
1172      "š": "s",
1173      "Ţ": "T",
1174      "ţ": "t",
1175      "ț": "t",
1176      "Ț": "T",
1177      "Ť": "T",
1178      "ť": "t",
1179      "Ŧ": "T",
1180      "ŧ": "t",
1181      "T̆": "T",
1182      "t̆": "t",
1183      "Ũ": "U",
1184      "ũ": "u",
1185      "Ū": "U",
1186      "ū": "u",
1187      "Ŭ": "U",
1188      "ŭ": "u",
1189      "Ů": "U",
1190      "ů": "u",
1191      "Ű": "U",
1192      "ű": "u",
1193      "Ų": "U",
1194      "ų": "u",
1195      "Ȗ": "U",
1196      "ȗ": "u",
1197      "V̆": "V",
1198      "v̆": "v",
1199      "Ŵ": "W",
1200      "ŵ": "w",
1201      "Ẃ": "W",
1202      "ẃ": "w",
1203      "X̆": "X",
1204      "x̆": "x",
1205      "Ŷ": "Y",
1206      "ŷ": "y",
1207      "Ÿ": "Y",
1208      "Y̆": "Y",
1209      "y̆": "y",
1210      "Ź": "Z",
1211      "ź": "z",
1212      "Ż": "Z",
1213      "ż": "z",
1214      "Ž": "Z",
1215      "ž": "z",
1216      "ſ": "s",
1217      "ƒ": "f",
1218      "Ơ": "O",
1219      "ơ": "o",
1220      "Ư": "U",
1221      "ư": "u",
1222      "Ǎ": "A",
1223      "ǎ": "a",
1224      "Ǐ": "I",
1225      "ǐ": "i",
1226      "Ǒ": "O",
1227      "ǒ": "o",
1228      "Ǔ": "U",
1229      "ǔ": "u",
1230      "Ǖ": "U",
1231      "ǖ": "u",
1232      "Ǘ": "U",
1233      "ǘ": "u",
1234      "Ǚ": "U",
1235      "ǚ": "u",
1236      "Ǜ": "U",
1237      "ǜ": "u",
1238      "Ứ": "U",
1239      "ứ": "u",
1240      "Ṹ": "U",
1241      "ṹ": "u",
1242      "Ǻ": "A",
1243      "ǻ": "a",
1244      "Ǽ": "AE",
1245      "ǽ": "ae",
1246      "Ǿ": "O",
1247      "ǿ": "o",
1248      "Þ": "TH",
1249      "þ": "th",
1250      "Ṕ": "P",
1251      "ṕ": "p",
1252      "Ṥ": "S",
1253      "ṥ": "s",
1254      "X́": "X",
1255      "x́": "x",
1256      "Ѓ": "Г",
1257      "ѓ": "г",
1258      "Ќ": "К",
1259      "ќ": "к",
1260      "A̋": "A",
1261      "a̋": "a",
1262      "E̋": "E",
1263      "e̋": "e",
1264      "I̋": "I",
1265      "i̋": "i",
1266      "Ǹ": "N",
1267      "ǹ": "n",
1268      "Ồ": "O",
1269      "ồ": "o",
1270      "Ṑ": "O",
1271      "ṑ": "o",
1272      "Ừ": "U",
1273      "ừ": "u",
1274      "Ẁ": "W",
1275      "ẁ": "w",
1276      "Ỳ": "Y",
1277      "ỳ": "y",
1278      "Ȁ": "A",
1279      "ȁ": "a",
1280      "Ȅ": "E",
1281      "ȅ": "e",
1282      "Ȉ": "I",
1283      "ȉ": "i",
1284      "Ȍ": "O",
1285      "ȍ": "o",
1286      "Ȑ": "R",
1287      "ȑ": "r",
1288      "Ȕ": "U",
1289      "ȕ": "u",
1290      "B̌": "B",
1291      "b̌": "b",
1292      "Č̣": "C",
1293      "č̣": "c",
1294      "Ê̌": "E",
1295      "ê̌": "e",
1296      "F̌": "F",
1297      "f̌": "f",
1298      "Ǧ": "G",
1299      "ǧ": "g",
1300      "Ȟ": "H",
1301      "ȟ": "h",
1302      "J̌": "J",
1303      "ǰ": "j",
1304      "Ǩ": "K",
1305      "ǩ": "k",
1306      "M̌": "M",
1307      "m̌": "m",
1308      "P̌": "P",
1309      "p̌": "p",
1310      "Q̌": "Q",
1311      "q̌": "q",
1312      "Ř̩": "R",
1313      "ř̩": "r",
1314      "Ṧ": "S",
1315      "ṧ": "s",
1316      "V̌": "V",
1317      "v̌": "v",
1318      "W̌": "W",
1319      "w̌": "w",
1320      "X̌": "X",
1321      "x̌": "x",
1322      "Y̌": "Y",
1323      "y̌": "y",
1324      "A̧": "A",
1325      "a̧": "a",
1326      "B̧": "B",
1327      "b̧": "b",
1328      "Ḑ": "D",
1329      "ḑ": "d",
1330      "Ȩ": "E",
1331      "ȩ": "e",
1332      "Ɛ̧": "E",
1333      "ɛ̧": "e",
1334      "Ḩ": "H",
1335      "ḩ": "h",
1336      "I̧": "I",
1337      "i̧": "i",
1338      "Ɨ̧": "I",
1339      "ɨ̧": "i",
1340      "M̧": "M",
1341      "m̧": "m",
1342      "O̧": "O",
1343      "o̧": "o",
1344      "Q̧": "Q",
1345      "q̧": "q",
1346      "U̧": "U",
1347      "u̧": "u",
1348      "X̧": "X",
1349      "x̧": "x",
1350      "Z̧": "Z",
1351      "z̧": "z",
1352      "й":"и",
1353      "Й":"И",
1354      "ё":"е",
1355      "Ё":"Е",
1356  };
1357  
1358  var chars = Object.keys(characterMap).join('|');
1359  var allAccents = new RegExp(chars, 'g');
1360  var firstAccent = new RegExp(chars, '');
1361  
1362  function matcher(match) {
1363      return characterMap[match];
1364  }
1365  
1366  var removeAccents = function(string) {
1367      return string.replace(allAccents, matcher);
1368  };
1369  
1370  var hasAccents = function(string) {
1371      return !!string.match(firstAccent);
1372  };
1373  
1374  module.exports = removeAccents;
1375  module.exports.has = hasAccents;
1376  module.exports.remove = removeAccents;
1377  
1378  
1379  /***/ })
1380  
1381  /******/     });
1382  /************************************************************************/
1383  /******/     // The module cache
1384  /******/     var __webpack_module_cache__ = {};
1385  /******/     
1386  /******/     // The require function
1387  /******/ 	function __webpack_require__(moduleId) {
1388  /******/         // Check if module is in cache
1389  /******/         var cachedModule = __webpack_module_cache__[moduleId];
1390  /******/         if (cachedModule !== undefined) {
1391  /******/             return cachedModule.exports;
1392  /******/         }
1393  /******/         // Create a new module (and put it into the cache)
1394  /******/         var module = __webpack_module_cache__[moduleId] = {
1395  /******/             // no module.id needed
1396  /******/             // no module.loaded needed
1397  /******/             exports: {}
1398  /******/         };
1399  /******/     
1400  /******/         // Execute the module function
1401  /******/         __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
1402  /******/     
1403  /******/         // Return the exports of the module
1404  /******/         return module.exports;
1405  /******/     }
1406  /******/     
1407  /************************************************************************/
1408  /******/     /* webpack/runtime/compat get default export */
1409  /******/     (() => {
1410  /******/         // getDefaultExport function for compatibility with non-harmony modules
1411  /******/         __webpack_require__.n = (module) => {
1412  /******/             var getter = module && module.__esModule ?
1413  /******/                 () => (module['default']) :
1414  /******/                 () => (module);
1415  /******/             __webpack_require__.d(getter, { a: getter });
1416  /******/             return getter;
1417  /******/         };
1418  /******/     })();
1419  /******/     
1420  /******/     /* webpack/runtime/define property getters */
1421  /******/     (() => {
1422  /******/         // define getter functions for harmony exports
1423  /******/         __webpack_require__.d = (exports, definition) => {
1424  /******/             for(var key in definition) {
1425  /******/                 if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
1426  /******/                     Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
1427  /******/                 }
1428  /******/             }
1429  /******/         };
1430  /******/     })();
1431  /******/     
1432  /******/     /* webpack/runtime/hasOwnProperty shorthand */
1433  /******/     (() => {
1434  /******/         __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
1435  /******/     })();
1436  /******/     
1437  /******/     /* webpack/runtime/make namespace object */
1438  /******/     (() => {
1439  /******/         // define __esModule on exports
1440  /******/         __webpack_require__.r = (exports) => {
1441  /******/             if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1442  /******/                 Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1443  /******/             }
1444  /******/             Object.defineProperty(exports, '__esModule', { value: true });
1445  /******/         };
1446  /******/     })();
1447  /******/     
1448  /************************************************************************/
1449  var __webpack_exports__ = {};
1450  // This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
1451  (() => {
1452  "use strict";
1453  // ESM COMPAT FLAG
1454  __webpack_require__.r(__webpack_exports__);
1455  
1456  // EXPORTS
1457  __webpack_require__.d(__webpack_exports__, {
1458    AlignmentToolbar: () => (/* reexport */ AlignmentToolbar),
1459    Autocomplete: () => (/* reexport */ Autocomplete),
1460    AutosaveMonitor: () => (/* reexport */ autosave_monitor),
1461    BlockAlignmentToolbar: () => (/* reexport */ BlockAlignmentToolbar),
1462    BlockControls: () => (/* reexport */ BlockControls),
1463    BlockEdit: () => (/* reexport */ BlockEdit),
1464    BlockEditorKeyboardShortcuts: () => (/* reexport */ BlockEditorKeyboardShortcuts),
1465    BlockFormatControls: () => (/* reexport */ BlockFormatControls),
1466    BlockIcon: () => (/* reexport */ BlockIcon),
1467    BlockInspector: () => (/* reexport */ BlockInspector),
1468    BlockList: () => (/* reexport */ BlockList),
1469    BlockMover: () => (/* reexport */ BlockMover),
1470    BlockNavigationDropdown: () => (/* reexport */ BlockNavigationDropdown),
1471    BlockSelectionClearer: () => (/* reexport */ BlockSelectionClearer),
1472    BlockSettingsMenu: () => (/* reexport */ BlockSettingsMenu),
1473    BlockTitle: () => (/* reexport */ BlockTitle),
1474    BlockToolbar: () => (/* reexport */ BlockToolbar),
1475    CharacterCount: () => (/* reexport */ CharacterCount),
1476    ColorPalette: () => (/* reexport */ ColorPalette),
1477    ContrastChecker: () => (/* reexport */ ContrastChecker),
1478    CopyHandler: () => (/* reexport */ CopyHandler),
1479    DefaultBlockAppender: () => (/* reexport */ DefaultBlockAppender),
1480    DocumentBar: () => (/* reexport */ DocumentBar),
1481    DocumentOutline: () => (/* reexport */ DocumentOutline),
1482    DocumentOutlineCheck: () => (/* reexport */ DocumentOutlineCheck),
1483    EditorHistoryRedo: () => (/* reexport */ editor_history_redo),
1484    EditorHistoryUndo: () => (/* reexport */ editor_history_undo),
1485    EditorKeyboardShortcuts: () => (/* reexport */ EditorKeyboardShortcuts),
1486    EditorKeyboardShortcutsRegister: () => (/* reexport */ register_shortcuts),
1487    EditorNotices: () => (/* reexport */ editor_notices),
1488    EditorProvider: () => (/* reexport */ provider),
1489    EditorSnackbars: () => (/* reexport */ EditorSnackbars),
1490    EntitiesSavedStates: () => (/* reexport */ EntitiesSavedStates),
1491    ErrorBoundary: () => (/* reexport */ error_boundary),
1492    FontSizePicker: () => (/* reexport */ FontSizePicker),
1493    InnerBlocks: () => (/* reexport */ InnerBlocks),
1494    Inserter: () => (/* reexport */ Inserter),
1495    InspectorAdvancedControls: () => (/* reexport */ InspectorAdvancedControls),
1496    InspectorControls: () => (/* reexport */ InspectorControls),
1497    LocalAutosaveMonitor: () => (/* reexport */ local_autosave_monitor),
1498    MediaPlaceholder: () => (/* reexport */ MediaPlaceholder),
1499    MediaUpload: () => (/* reexport */ MediaUpload),
1500    MediaUploadCheck: () => (/* reexport */ MediaUploadCheck),
1501    MultiSelectScrollIntoView: () => (/* reexport */ MultiSelectScrollIntoView),
1502    NavigableToolbar: () => (/* reexport */ NavigableToolbar),
1503    ObserveTyping: () => (/* reexport */ ObserveTyping),
1504    PageAttributesCheck: () => (/* reexport */ page_attributes_check),
1505    PageAttributesOrder: () => (/* reexport */ PageAttributesOrderWithChecks),
1506    PageAttributesPanel: () => (/* reexport */ PageAttributesPanel),
1507    PageAttributesParent: () => (/* reexport */ page_attributes_parent),
1508    PageTemplate: () => (/* reexport */ classic_theme),
1509    PanelColorSettings: () => (/* reexport */ PanelColorSettings),
1510    PlainText: () => (/* reexport */ PlainText),
1511    PluginBlockSettingsMenuItem: () => (/* reexport */ plugin_block_settings_menu_item),
1512    PluginDocumentSettingPanel: () => (/* reexport */ plugin_document_setting_panel),
1513    PluginMoreMenuItem: () => (/* reexport */ PluginMoreMenuItem),
1514    PluginPostPublishPanel: () => (/* reexport */ plugin_post_publish_panel),
1515    PluginPostStatusInfo: () => (/* reexport */ plugin_post_status_info),
1516    PluginPrePublishPanel: () => (/* reexport */ plugin_pre_publish_panel),
1517    PluginPreviewMenuItem: () => (/* reexport */ PluginPreviewMenuItem),
1518    PluginSidebar: () => (/* reexport */ PluginSidebar),
1519    PluginSidebarMoreMenuItem: () => (/* reexport */ PluginSidebarMoreMenuItem),
1520    PostAuthor: () => (/* reexport */ post_author),
1521    PostAuthorCheck: () => (/* reexport */ PostAuthorCheck),
1522    PostAuthorPanel: () => (/* reexport */ panel),
1523    PostComments: () => (/* reexport */ post_comments),
1524    PostDiscussionPanel: () => (/* reexport */ PostDiscussionPanel),
1525    PostExcerpt: () => (/* reexport */ PostExcerpt),
1526    PostExcerptCheck: () => (/* reexport */ post_excerpt_check),
1527    PostExcerptPanel: () => (/* reexport */ PostExcerptPanel),
1528    PostFeaturedImage: () => (/* reexport */ post_featured_image),
1529    PostFeaturedImageCheck: () => (/* reexport */ post_featured_image_check),
1530    PostFeaturedImagePanel: () => (/* reexport */ PostFeaturedImagePanel),
1531    PostFormat: () => (/* reexport */ PostFormat),
1532    PostFormatCheck: () => (/* reexport */ PostFormatCheck),
1533    PostLastRevision: () => (/* reexport */ post_last_revision),
1534    PostLastRevisionCheck: () => (/* reexport */ post_last_revision_check),
1535    PostLastRevisionPanel: () => (/* reexport */ post_last_revision_panel),
1536    PostLockedModal: () => (/* reexport */ PostLockedModal),
1537    PostPendingStatus: () => (/* reexport */ post_pending_status),
1538    PostPendingStatusCheck: () => (/* reexport */ post_pending_status_check),
1539    PostPingbacks: () => (/* reexport */ post_pingbacks),
1540    PostPreviewButton: () => (/* reexport */ PostPreviewButton),
1541    PostPublishButton: () => (/* reexport */ post_publish_button),
1542    PostPublishButtonLabel: () => (/* reexport */ PublishButtonLabel),
1543    PostPublishPanel: () => (/* reexport */ post_publish_panel),
1544    PostSavedState: () => (/* reexport */ PostSavedState),
1545    PostSchedule: () => (/* reexport */ PostSchedule),
1546    PostScheduleCheck: () => (/* reexport */ PostScheduleCheck),
1547    PostScheduleLabel: () => (/* reexport */ PostScheduleLabel),
1548    PostSchedulePanel: () => (/* reexport */ PostSchedulePanel),
1549    PostSticky: () => (/* reexport */ PostSticky),
1550    PostStickyCheck: () => (/* reexport */ PostStickyCheck),
1551    PostSwitchToDraftButton: () => (/* reexport */ PostSwitchToDraftButton),
1552    PostSyncStatus: () => (/* reexport */ PostSyncStatus),
1553    PostTaxonomies: () => (/* reexport */ post_taxonomies),
1554    PostTaxonomiesCheck: () => (/* reexport */ PostTaxonomiesCheck),
1555    PostTaxonomiesFlatTermSelector: () => (/* reexport */ FlatTermSelector),
1556    PostTaxonomiesHierarchicalTermSelector: () => (/* reexport */ HierarchicalTermSelector),
1557    PostTaxonomiesPanel: () => (/* reexport */ panel_PostTaxonomies),
1558    PostTemplatePanel: () => (/* reexport */ PostTemplatePanel),
1559    PostTextEditor: () => (/* reexport */ PostTextEditor),
1560    PostTitle: () => (/* reexport */ post_title),
1561    PostTitleRaw: () => (/* reexport */ post_title_raw),
1562    PostTrash: () => (/* reexport */ PostTrash),
1563    PostTrashCheck: () => (/* reexport */ PostTrashCheck),
1564    PostTypeSupportCheck: () => (/* reexport */ post_type_support_check),
1565    PostURL: () => (/* reexport */ PostURL),
1566    PostURLCheck: () => (/* reexport */ PostURLCheck),
1567    PostURLLabel: () => (/* reexport */ PostURLLabel),
1568    PostURLPanel: () => (/* reexport */ PostURLPanel),
1569    PostVisibility: () => (/* reexport */ PostVisibility),
1570    PostVisibilityCheck: () => (/* reexport */ PostVisibilityCheck),
1571    PostVisibilityLabel: () => (/* reexport */ PostVisibilityLabel),
1572    RichText: () => (/* reexport */ RichText),
1573    RichTextShortcut: () => (/* reexport */ RichTextShortcut),
1574    RichTextToolbarButton: () => (/* reexport */ RichTextToolbarButton),
1575    ServerSideRender: () => (/* reexport */ (external_wp_serverSideRender_default())),
1576    SkipToSelectedBlock: () => (/* reexport */ SkipToSelectedBlock),
1577    TableOfContents: () => (/* reexport */ table_of_contents),
1578    TextEditorGlobalKeyboardShortcuts: () => (/* reexport */ TextEditorGlobalKeyboardShortcuts),
1579    ThemeSupportCheck: () => (/* reexport */ ThemeSupportCheck),
1580    TimeToRead: () => (/* reexport */ TimeToRead),
1581    URLInput: () => (/* reexport */ URLInput),
1582    URLInputButton: () => (/* reexport */ URLInputButton),
1583    URLPopover: () => (/* reexport */ URLPopover),
1584    UnsavedChangesWarning: () => (/* reexport */ UnsavedChangesWarning),
1585    VisualEditorGlobalKeyboardShortcuts: () => (/* reexport */ VisualEditorGlobalKeyboardShortcuts),
1586    Warning: () => (/* reexport */ Warning),
1587    WordCount: () => (/* reexport */ WordCount),
1588    WritingFlow: () => (/* reexport */ WritingFlow),
1589    __unstableRichTextInputEvent: () => (/* reexport */ __unstableRichTextInputEvent),
1590    cleanForSlug: () => (/* reexport */ cleanForSlug),
1591    createCustomColorsHOC: () => (/* reexport */ createCustomColorsHOC),
1592    getColorClassName: () => (/* reexport */ getColorClassName),
1593    getColorObjectByAttributeValues: () => (/* reexport */ getColorObjectByAttributeValues),
1594    getColorObjectByColorValue: () => (/* reexport */ getColorObjectByColorValue),
1595    getFontSize: () => (/* reexport */ getFontSize),
1596    getFontSizeClass: () => (/* reexport */ getFontSizeClass),
1597    getTemplatePartIcon: () => (/* reexport */ getTemplatePartIcon),
1598    mediaUpload: () => (/* reexport */ mediaUpload),
1599    privateApis: () => (/* reexport */ privateApis),
1600    registerEntityAction: () => (/* reexport */ api_registerEntityAction),
1601    registerEntityField: () => (/* reexport */ api_registerEntityField),
1602    store: () => (/* reexport */ store_store),
1603    storeConfig: () => (/* reexport */ storeConfig),
1604    transformStyles: () => (/* reexport */ external_wp_blockEditor_namespaceObject.transformStyles),
1605    unregisterEntityAction: () => (/* reexport */ api_unregisterEntityAction),
1606    unregisterEntityField: () => (/* reexport */ api_unregisterEntityField),
1607    useEntitiesSavedStatesIsDirty: () => (/* reexport */ useIsDirty),
1608    usePostScheduleLabel: () => (/* reexport */ usePostScheduleLabel),
1609    usePostURLLabel: () => (/* reexport */ usePostURLLabel),
1610    usePostVisibilityLabel: () => (/* reexport */ usePostVisibilityLabel),
1611    userAutocompleter: () => (/* reexport */ user),
1612    withColorContext: () => (/* reexport */ withColorContext),
1613    withColors: () => (/* reexport */ withColors),
1614    withFontSizes: () => (/* reexport */ withFontSizes)
1615  });
1616  
1617  // NAMESPACE OBJECT: ./node_modules/@wordpress/editor/build-module/store/selectors.js
1618  var selectors_namespaceObject = {};
1619  __webpack_require__.r(selectors_namespaceObject);
1620  __webpack_require__.d(selectors_namespaceObject, {
1621    __experimentalGetDefaultTemplatePartAreas: () => (__experimentalGetDefaultTemplatePartAreas),
1622    __experimentalGetDefaultTemplateType: () => (__experimentalGetDefaultTemplateType),
1623    __experimentalGetDefaultTemplateTypes: () => (__experimentalGetDefaultTemplateTypes),
1624    __experimentalGetTemplateInfo: () => (__experimentalGetTemplateInfo),
1625    __unstableIsEditorReady: () => (__unstableIsEditorReady),
1626    canInsertBlockType: () => (canInsertBlockType),
1627    canUserUseUnfilteredHTML: () => (canUserUseUnfilteredHTML),
1628    didPostSaveRequestFail: () => (didPostSaveRequestFail),
1629    didPostSaveRequestSucceed: () => (didPostSaveRequestSucceed),
1630    getActivePostLock: () => (getActivePostLock),
1631    getAdjacentBlockClientId: () => (getAdjacentBlockClientId),
1632    getAutosaveAttribute: () => (getAutosaveAttribute),
1633    getBlock: () => (getBlock),
1634    getBlockAttributes: () => (getBlockAttributes),
1635    getBlockCount: () => (getBlockCount),
1636    getBlockHierarchyRootClientId: () => (getBlockHierarchyRootClientId),
1637    getBlockIndex: () => (getBlockIndex),
1638    getBlockInsertionPoint: () => (getBlockInsertionPoint),
1639    getBlockListSettings: () => (getBlockListSettings),
1640    getBlockMode: () => (getBlockMode),
1641    getBlockName: () => (getBlockName),
1642    getBlockOrder: () => (getBlockOrder),
1643    getBlockRootClientId: () => (getBlockRootClientId),
1644    getBlockSelectionEnd: () => (getBlockSelectionEnd),
1645    getBlockSelectionStart: () => (getBlockSelectionStart),
1646    getBlocks: () => (getBlocks),
1647    getBlocksByClientId: () => (getBlocksByClientId),
1648    getClientIdsOfDescendants: () => (getClientIdsOfDescendants),
1649    getClientIdsWithDescendants: () => (getClientIdsWithDescendants),
1650    getCurrentPost: () => (getCurrentPost),
1651    getCurrentPostAttribute: () => (getCurrentPostAttribute),
1652    getCurrentPostId: () => (getCurrentPostId),
1653    getCurrentPostLastRevisionId: () => (getCurrentPostLastRevisionId),
1654    getCurrentPostRevisionsCount: () => (getCurrentPostRevisionsCount),
1655    getCurrentPostType: () => (getCurrentPostType),
1656    getCurrentTemplateId: () => (getCurrentTemplateId),
1657    getDeviceType: () => (getDeviceType),
1658    getEditedPostAttribute: () => (getEditedPostAttribute),
1659    getEditedPostContent: () => (getEditedPostContent),
1660    getEditedPostPreviewLink: () => (getEditedPostPreviewLink),
1661    getEditedPostSlug: () => (getEditedPostSlug),
1662    getEditedPostVisibility: () => (getEditedPostVisibility),
1663    getEditorBlocks: () => (getEditorBlocks),
1664    getEditorMode: () => (getEditorMode),
1665    getEditorSelection: () => (getEditorSelection),
1666    getEditorSelectionEnd: () => (getEditorSelectionEnd),
1667    getEditorSelectionStart: () => (getEditorSelectionStart),
1668    getEditorSettings: () => (getEditorSettings),
1669    getFirstMultiSelectedBlockClientId: () => (getFirstMultiSelectedBlockClientId),
1670    getGlobalBlockCount: () => (getGlobalBlockCount),
1671    getInserterItems: () => (getInserterItems),
1672    getLastMultiSelectedBlockClientId: () => (getLastMultiSelectedBlockClientId),
1673    getMultiSelectedBlockClientIds: () => (getMultiSelectedBlockClientIds),
1674    getMultiSelectedBlocks: () => (getMultiSelectedBlocks),
1675    getMultiSelectedBlocksEndClientId: () => (getMultiSelectedBlocksEndClientId),
1676    getMultiSelectedBlocksStartClientId: () => (getMultiSelectedBlocksStartClientId),
1677    getNextBlockClientId: () => (getNextBlockClientId),
1678    getPermalink: () => (getPermalink),
1679    getPermalinkParts: () => (getPermalinkParts),
1680    getPostEdits: () => (getPostEdits),
1681    getPostLockUser: () => (getPostLockUser),
1682    getPostTypeLabel: () => (getPostTypeLabel),
1683    getPreviousBlockClientId: () => (getPreviousBlockClientId),
1684    getRenderingMode: () => (getRenderingMode),
1685    getSelectedBlock: () => (getSelectedBlock),
1686    getSelectedBlockClientId: () => (getSelectedBlockClientId),
1687    getSelectedBlockCount: () => (getSelectedBlockCount),
1688    getSelectedBlocksInitialCaretPosition: () => (getSelectedBlocksInitialCaretPosition),
1689    getStateBeforeOptimisticTransaction: () => (getStateBeforeOptimisticTransaction),
1690    getSuggestedPostFormat: () => (getSuggestedPostFormat),
1691    getTemplate: () => (getTemplate),
1692    getTemplateLock: () => (getTemplateLock),
1693    hasChangedContent: () => (hasChangedContent),
1694    hasEditorRedo: () => (hasEditorRedo),
1695    hasEditorUndo: () => (hasEditorUndo),
1696    hasInserterItems: () => (hasInserterItems),
1697    hasMultiSelection: () => (hasMultiSelection),
1698    hasNonPostEntityChanges: () => (hasNonPostEntityChanges),
1699    hasSelectedBlock: () => (hasSelectedBlock),
1700    hasSelectedInnerBlock: () => (hasSelectedInnerBlock),
1701    inSomeHistory: () => (inSomeHistory),
1702    isAncestorMultiSelected: () => (isAncestorMultiSelected),
1703    isAutosavingPost: () => (isAutosavingPost),
1704    isBlockInsertionPointVisible: () => (isBlockInsertionPointVisible),
1705    isBlockMultiSelected: () => (isBlockMultiSelected),
1706    isBlockSelected: () => (isBlockSelected),
1707    isBlockValid: () => (isBlockValid),
1708    isBlockWithinSelection: () => (isBlockWithinSelection),
1709    isCaretWithinFormattedText: () => (isCaretWithinFormattedText),
1710    isCleanNewPost: () => (isCleanNewPost),
1711    isCurrentPostPending: () => (isCurrentPostPending),
1712    isCurrentPostPublished: () => (isCurrentPostPublished),
1713    isCurrentPostScheduled: () => (isCurrentPostScheduled),
1714    isDeletingPost: () => (isDeletingPost),
1715    isEditedPostAutosaveable: () => (isEditedPostAutosaveable),
1716    isEditedPostBeingScheduled: () => (isEditedPostBeingScheduled),
1717    isEditedPostDateFloating: () => (isEditedPostDateFloating),
1718    isEditedPostDirty: () => (isEditedPostDirty),
1719    isEditedPostEmpty: () => (isEditedPostEmpty),
1720    isEditedPostNew: () => (isEditedPostNew),
1721    isEditedPostPublishable: () => (isEditedPostPublishable),
1722    isEditedPostSaveable: () => (isEditedPostSaveable),
1723    isEditorPanelEnabled: () => (isEditorPanelEnabled),
1724    isEditorPanelOpened: () => (isEditorPanelOpened),
1725    isEditorPanelRemoved: () => (isEditorPanelRemoved),
1726    isFirstMultiSelectedBlock: () => (isFirstMultiSelectedBlock),
1727    isInserterOpened: () => (isInserterOpened),
1728    isListViewOpened: () => (isListViewOpened),
1729    isMultiSelecting: () => (isMultiSelecting),
1730    isPermalinkEditable: () => (isPermalinkEditable),
1731    isPostAutosavingLocked: () => (isPostAutosavingLocked),
1732    isPostLockTakeover: () => (isPostLockTakeover),
1733    isPostLocked: () => (isPostLocked),
1734    isPostSavingLocked: () => (isPostSavingLocked),
1735    isPreviewingPost: () => (isPreviewingPost),
1736    isPublishSidebarEnabled: () => (isPublishSidebarEnabled),
1737    isPublishSidebarOpened: () => (isPublishSidebarOpened),
1738    isPublishingPost: () => (isPublishingPost),
1739    isSavingNonPostEntityChanges: () => (isSavingNonPostEntityChanges),
1740    isSavingPost: () => (isSavingPost),
1741    isSelectionEnabled: () => (isSelectionEnabled),
1742    isTyping: () => (isTyping),
1743    isValidTemplate: () => (isValidTemplate)
1744  });
1745  
1746  // NAMESPACE OBJECT: ./node_modules/@wordpress/editor/build-module/store/actions.js
1747  var actions_namespaceObject = {};
1748  __webpack_require__.r(actions_namespaceObject);
1749  __webpack_require__.d(actions_namespaceObject, {
1750    __experimentalTearDownEditor: () => (__experimentalTearDownEditor),
1751    __unstableSaveForPreview: () => (__unstableSaveForPreview),
1752    autosave: () => (autosave),
1753    clearSelectedBlock: () => (clearSelectedBlock),
1754    closePublishSidebar: () => (closePublishSidebar),
1755    createUndoLevel: () => (createUndoLevel),
1756    disablePublishSidebar: () => (disablePublishSidebar),
1757    editPost: () => (editPost),
1758    enablePublishSidebar: () => (enablePublishSidebar),
1759    enterFormattedText: () => (enterFormattedText),
1760    exitFormattedText: () => (exitFormattedText),
1761    hideInsertionPoint: () => (hideInsertionPoint),
1762    insertBlock: () => (insertBlock),
1763    insertBlocks: () => (insertBlocks),
1764    insertDefaultBlock: () => (insertDefaultBlock),
1765    lockPostAutosaving: () => (lockPostAutosaving),
1766    lockPostSaving: () => (lockPostSaving),
1767    mergeBlocks: () => (mergeBlocks),
1768    moveBlockToPosition: () => (moveBlockToPosition),
1769    moveBlocksDown: () => (moveBlocksDown),
1770    moveBlocksUp: () => (moveBlocksUp),
1771    multiSelect: () => (multiSelect),
1772    openPublishSidebar: () => (openPublishSidebar),
1773    receiveBlocks: () => (receiveBlocks),
1774    redo: () => (redo),
1775    refreshPost: () => (refreshPost),
1776    removeBlock: () => (removeBlock),
1777    removeBlocks: () => (removeBlocks),
1778    removeEditorPanel: () => (removeEditorPanel),
1779    replaceBlock: () => (replaceBlock),
1780    replaceBlocks: () => (replaceBlocks),
1781    resetBlocks: () => (resetBlocks),
1782    resetEditorBlocks: () => (resetEditorBlocks),
1783    resetPost: () => (resetPost),
1784    savePost: () => (savePost),
1785    selectBlock: () => (selectBlock),
1786    setDeviceType: () => (setDeviceType),
1787    setEditedPost: () => (setEditedPost),
1788    setIsInserterOpened: () => (setIsInserterOpened),
1789    setIsListViewOpened: () => (setIsListViewOpened),
1790    setRenderingMode: () => (setRenderingMode),
1791    setTemplateValidity: () => (setTemplateValidity),
1792    setupEditor: () => (setupEditor),
1793    setupEditorState: () => (setupEditorState),
1794    showInsertionPoint: () => (showInsertionPoint),
1795    startMultiSelect: () => (startMultiSelect),
1796    startTyping: () => (startTyping),
1797    stopMultiSelect: () => (stopMultiSelect),
1798    stopTyping: () => (stopTyping),
1799    switchEditorMode: () => (switchEditorMode),
1800    synchronizeTemplate: () => (synchronizeTemplate),
1801    toggleBlockMode: () => (toggleBlockMode),
1802    toggleDistractionFree: () => (toggleDistractionFree),
1803    toggleEditorPanelEnabled: () => (toggleEditorPanelEnabled),
1804    toggleEditorPanelOpened: () => (toggleEditorPanelOpened),
1805    togglePublishSidebar: () => (togglePublishSidebar),
1806    toggleSelection: () => (toggleSelection),
1807    toggleSpotlightMode: () => (toggleSpotlightMode),
1808    toggleTopToolbar: () => (toggleTopToolbar),
1809    trashPost: () => (trashPost),
1810    undo: () => (undo),
1811    unlockPostAutosaving: () => (unlockPostAutosaving),
1812    unlockPostSaving: () => (unlockPostSaving),
1813    updateBlock: () => (updateBlock),
1814    updateBlockAttributes: () => (updateBlockAttributes),
1815    updateBlockListSettings: () => (updateBlockListSettings),
1816    updateEditorSettings: () => (updateEditorSettings),
1817    updatePost: () => (updatePost),
1818    updatePostLock: () => (updatePostLock)
1819  });
1820  
1821  // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js
1822  var store_actions_namespaceObject = {};
1823  __webpack_require__.r(store_actions_namespaceObject);
1824  __webpack_require__.d(store_actions_namespaceObject, {
1825    closeModal: () => (closeModal),
1826    disableComplementaryArea: () => (disableComplementaryArea),
1827    enableComplementaryArea: () => (enableComplementaryArea),
1828    openModal: () => (openModal),
1829    pinItem: () => (pinItem),
1830    setDefaultComplementaryArea: () => (setDefaultComplementaryArea),
1831    setFeatureDefaults: () => (setFeatureDefaults),
1832    setFeatureValue: () => (setFeatureValue),
1833    toggleFeature: () => (toggleFeature),
1834    unpinItem: () => (unpinItem)
1835  });
1836  
1837  // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/selectors.js
1838  var store_selectors_namespaceObject = {};
1839  __webpack_require__.r(store_selectors_namespaceObject);
1840  __webpack_require__.d(store_selectors_namespaceObject, {
1841    getActiveComplementaryArea: () => (getActiveComplementaryArea),
1842    isComplementaryAreaLoading: () => (isComplementaryAreaLoading),
1843    isFeatureActive: () => (isFeatureActive),
1844    isItemPinned: () => (isItemPinned),
1845    isModalActive: () => (isModalActive)
1846  });
1847  
1848  // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/index.js
1849  var build_module_namespaceObject = {};
1850  __webpack_require__.r(build_module_namespaceObject);
1851  __webpack_require__.d(build_module_namespaceObject, {
1852    ActionItem: () => (action_item),
1853    ComplementaryArea: () => (complementary_area),
1854    ComplementaryAreaMoreMenuItem: () => (ComplementaryAreaMoreMenuItem),
1855    FullscreenMode: () => (fullscreen_mode),
1856    InterfaceSkeleton: () => (interface_skeleton),
1857    NavigableRegion: () => (navigable_region),
1858    PinnedItems: () => (pinned_items),
1859    store: () => (store)
1860  });
1861  
1862  // NAMESPACE OBJECT: ./node_modules/@wordpress/editor/build-module/store/private-actions.js
1863  var store_private_actions_namespaceObject = {};
1864  __webpack_require__.r(store_private_actions_namespaceObject);
1865  __webpack_require__.d(store_private_actions_namespaceObject, {
1866    createTemplate: () => (createTemplate),
1867    hideBlockTypes: () => (hideBlockTypes),
1868    registerEntityAction: () => (registerEntityAction),
1869    registerEntityField: () => (registerEntityField),
1870    registerPostTypeSchema: () => (registerPostTypeSchema),
1871    removeTemplates: () => (removeTemplates),
1872    revertTemplate: () => (private_actions_revertTemplate),
1873    saveDirtyEntities: () => (saveDirtyEntities),
1874    setCurrentTemplateId: () => (setCurrentTemplateId),
1875    setDefaultRenderingMode: () => (setDefaultRenderingMode),
1876    setIsReady: () => (setIsReady),
1877    showBlockTypes: () => (showBlockTypes),
1878    unregisterEntityAction: () => (unregisterEntityAction),
1879    unregisterEntityField: () => (unregisterEntityField)
1880  });
1881  
1882  // NAMESPACE OBJECT: ./node_modules/@wordpress/editor/build-module/store/private-selectors.js
1883  var store_private_selectors_namespaceObject = {};
1884  __webpack_require__.r(store_private_selectors_namespaceObject);
1885  __webpack_require__.d(store_private_selectors_namespaceObject, {
1886    getDefaultRenderingMode: () => (getDefaultRenderingMode),
1887    getEntityActions: () => (private_selectors_getEntityActions),
1888    getEntityFields: () => (private_selectors_getEntityFields),
1889    getInserter: () => (getInserter),
1890    getInserterSidebarToggleRef: () => (getInserterSidebarToggleRef),
1891    getListViewToggleRef: () => (getListViewToggleRef),
1892    getPostBlocksByName: () => (getPostBlocksByName),
1893    getPostIcon: () => (getPostIcon),
1894    hasPostMetaChanges: () => (hasPostMetaChanges),
1895    isEntityReady: () => (private_selectors_isEntityReady)
1896  });
1897  
1898  ;// external ["wp","data"]
1899  const external_wp_data_namespaceObject = window["wp"]["data"];
1900  ;// external ["wp","coreData"]
1901  const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
1902  ;// external ["wp","element"]
1903  const external_wp_element_namespaceObject = window["wp"]["element"];
1904  ;// external ["wp","compose"]
1905  const external_wp_compose_namespaceObject = window["wp"]["compose"];
1906  ;// external ["wp","hooks"]
1907  const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
1908  ;// external ["wp","blockEditor"]
1909  const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
1910  ;// ./node_modules/@wordpress/editor/build-module/store/defaults.js
1911  /**
1912   * WordPress dependencies
1913   */
1914  
1915  
1916  /**
1917   * The default post editor settings.
1918   *
1919   * @property {boolean|Array} allowedBlockTypes     Allowed block types
1920   * @property {boolean}       richEditingEnabled    Whether rich editing is enabled or not
1921   * @property {boolean}       codeEditingEnabled    Whether code editing is enabled or not
1922   * @property {boolean}       fontLibraryEnabled    Whether the font library is enabled or not.
1923   * @property {boolean}       enableCustomFields    Whether the WordPress custom fields are enabled or not.
1924   *                                                 true  = the user has opted to show the Custom Fields panel at the bottom of the editor.
1925   *                                                 false = the user has opted to hide the Custom Fields panel at the bottom of the editor.
1926   *                                                 undefined = the current environment does not support Custom Fields, so the option toggle in Preferences -> Panels to enable the Custom Fields panel is not displayed.
1927   * @property {number}        autosaveInterval      How often in seconds the post will be auto-saved via the REST API.
1928   * @property {number}        localAutosaveInterval How often in seconds the post will be backed up to sessionStorage.
1929   * @property {Array?}        availableTemplates    The available post templates
1930   * @property {boolean}       disablePostFormats    Whether or not the post formats are disabled
1931   * @property {Array?}        allowedMimeTypes      List of allowed mime types and file extensions
1932   * @property {number}        maxUploadFileSize     Maximum upload file size
1933   * @property {boolean}       supportsLayout        Whether the editor supports layouts.
1934   */
1935  const EDITOR_SETTINGS_DEFAULTS = {
1936    ...external_wp_blockEditor_namespaceObject.SETTINGS_DEFAULTS,
1937    richEditingEnabled: true,
1938    codeEditingEnabled: true,
1939    fontLibraryEnabled: true,
1940    enableCustomFields: undefined,
1941    defaultRenderingMode: 'post-only'
1942  };
1943  
1944  ;// ./node_modules/@wordpress/editor/build-module/dataviews/store/reducer.js
1945  /**
1946   * WordPress dependencies
1947   */
1948  
1949  function isReady(state = {}, action) {
1950    switch (action.type) {
1951      case 'SET_IS_READY':
1952        return {
1953          ...state,
1954          [action.kind]: {
1955            ...state[action.kind],
1956            [action.name]: true
1957          }
1958        };
1959    }
1960    return state;
1961  }
1962  function actions(state = {}, action) {
1963    var _state$action$kind$ac;
1964    switch (action.type) {
1965      case 'REGISTER_ENTITY_ACTION':
1966        return {
1967          ...state,
1968          [action.kind]: {
1969            ...state[action.kind],
1970            [action.name]: [...((_state$action$kind$ac = state[action.kind]?.[action.name]) !== null && _state$action$kind$ac !== void 0 ? _state$action$kind$ac : []).filter(_action => _action.id !== action.config.id), action.config]
1971          }
1972        };
1973      case 'UNREGISTER_ENTITY_ACTION':
1974        {
1975          var _state$action$kind$ac2;
1976          return {
1977            ...state,
1978            [action.kind]: {
1979              ...state[action.kind],
1980              [action.name]: ((_state$action$kind$ac2 = state[action.kind]?.[action.name]) !== null && _state$action$kind$ac2 !== void 0 ? _state$action$kind$ac2 : []).filter(_action => _action.id !== action.actionId)
1981            }
1982          };
1983        }
1984    }
1985    return state;
1986  }
1987  function fields(state = {}, action) {
1988    var _state$action$kind$ac3, _state$action$kind$ac4;
1989    switch (action.type) {
1990      case 'REGISTER_ENTITY_FIELD':
1991        return {
1992          ...state,
1993          [action.kind]: {
1994            ...state[action.kind],
1995            [action.name]: [...((_state$action$kind$ac3 = state[action.kind]?.[action.name]) !== null && _state$action$kind$ac3 !== void 0 ? _state$action$kind$ac3 : []).filter(_field => _field.id !== action.config.id), action.config]
1996          }
1997        };
1998      case 'UNREGISTER_ENTITY_FIELD':
1999        return {
2000          ...state,
2001          [action.kind]: {
2002            ...state[action.kind],
2003            [action.name]: ((_state$action$kind$ac4 = state[action.kind]?.[action.name]) !== null && _state$action$kind$ac4 !== void 0 ? _state$action$kind$ac4 : []).filter(_field => _field.id !== action.fieldId)
2004          }
2005        };
2006    }
2007    return state;
2008  }
2009  /* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
2010    actions,
2011    fields,
2012    isReady
2013  }));
2014  
2015  ;// ./node_modules/@wordpress/editor/build-module/store/reducer.js
2016  /**
2017   * WordPress dependencies
2018   */
2019  
2020  
2021  /**
2022   * Internal dependencies
2023   */
2024  
2025  
2026  
2027  /**
2028   * Returns a post attribute value, flattening nested rendered content using its
2029   * raw value in place of its original object form.
2030   *
2031   * @param {*} value Original value.
2032   *
2033   * @return {*} Raw value.
2034   */
2035  function getPostRawValue(value) {
2036    if (value && 'object' === typeof value && 'raw' in value) {
2037      return value.raw;
2038    }
2039    return value;
2040  }
2041  
2042  /**
2043   * Returns true if the two object arguments have the same keys, or false
2044   * otherwise.
2045   *
2046   * @param {Object} a First object.
2047   * @param {Object} b Second object.
2048   *
2049   * @return {boolean} Whether the two objects have the same keys.
2050   */
2051  function hasSameKeys(a, b) {
2052    const keysA = Object.keys(a).sort();
2053    const keysB = Object.keys(b).sort();
2054    return keysA.length === keysB.length && keysA.every((key, index) => keysB[index] === key);
2055  }
2056  
2057  /**
2058   * Returns true if, given the currently dispatching action and the previously
2059   * dispatched action, the two actions are editing the same post property, or
2060   * false otherwise.
2061   *
2062   * @param {Object} action         Currently dispatching action.
2063   * @param {Object} previousAction Previously dispatched action.
2064   *
2065   * @return {boolean} Whether actions are updating the same post property.
2066   */
2067  function isUpdatingSamePostProperty(action, previousAction) {
2068    return action.type === 'EDIT_POST' && hasSameKeys(action.edits, previousAction.edits);
2069  }
2070  
2071  /**
2072   * Returns true if, given the currently dispatching action and the previously
2073   * dispatched action, the two actions are modifying the same property such that
2074   * undo history should be batched.
2075   *
2076   * @param {Object} action         Currently dispatching action.
2077   * @param {Object} previousAction Previously dispatched action.
2078   *
2079   * @return {boolean} Whether to overwrite present state.
2080   */
2081  function shouldOverwriteState(action, previousAction) {
2082    if (action.type === 'RESET_EDITOR_BLOCKS') {
2083      return !action.shouldCreateUndoLevel;
2084    }
2085    if (!previousAction || action.type !== previousAction.type) {
2086      return false;
2087    }
2088    return isUpdatingSamePostProperty(action, previousAction);
2089  }
2090  function postId(state = null, action) {
2091    switch (action.type) {
2092      case 'SET_EDITED_POST':
2093        return action.postId;
2094    }
2095    return state;
2096  }
2097  function templateId(state = null, action) {
2098    switch (action.type) {
2099      case 'SET_CURRENT_TEMPLATE_ID':
2100        return action.id;
2101    }
2102    return state;
2103  }
2104  function postType(state = null, action) {
2105    switch (action.type) {
2106      case 'SET_EDITED_POST':
2107        return action.postType;
2108    }
2109    return state;
2110  }
2111  
2112  /**
2113   * Reducer returning whether the post blocks match the defined template or not.
2114   *
2115   * @param {Object} state  Current state.
2116   * @param {Object} action Dispatched action.
2117   *
2118   * @return {boolean} Updated state.
2119   */
2120  function template(state = {
2121    isValid: true
2122  }, action) {
2123    switch (action.type) {
2124      case 'SET_TEMPLATE_VALIDITY':
2125        return {
2126          ...state,
2127          isValid: action.isValid
2128        };
2129    }
2130    return state;
2131  }
2132  
2133  /**
2134   * Reducer returning current network request state (whether a request to
2135   * the WP REST API is in progress, successful, or failed).
2136   *
2137   * @param {Object} state  Current state.
2138   * @param {Object} action Dispatched action.
2139   *
2140   * @return {Object} Updated state.
2141   */
2142  function saving(state = {}, action) {
2143    switch (action.type) {
2144      case 'REQUEST_POST_UPDATE_START':
2145      case 'REQUEST_POST_UPDATE_FINISH':
2146        return {
2147          pending: action.type === 'REQUEST_POST_UPDATE_START',
2148          options: action.options || {}
2149        };
2150    }
2151    return state;
2152  }
2153  
2154  /**
2155   * Reducer returning deleting post request state.
2156   *
2157   * @param {Object} state  Current state.
2158   * @param {Object} action Dispatched action.
2159   *
2160   * @return {Object} Updated state.
2161   */
2162  function deleting(state = {}, action) {
2163    switch (action.type) {
2164      case 'REQUEST_POST_DELETE_START':
2165      case 'REQUEST_POST_DELETE_FINISH':
2166        return {
2167          pending: action.type === 'REQUEST_POST_DELETE_START'
2168        };
2169    }
2170    return state;
2171  }
2172  
2173  /**
2174   * Post Lock State.
2175   *
2176   * @typedef {Object} PostLockState
2177   *
2178   * @property {boolean}  isLocked       Whether the post is locked.
2179   * @property {?boolean} isTakeover     Whether the post editing has been taken over.
2180   * @property {?boolean} activePostLock Active post lock value.
2181   * @property {?Object}  user           User that took over the post.
2182   */
2183  
2184  /**
2185   * Reducer returning the post lock status.
2186   *
2187   * @param {PostLockState} state  Current state.
2188   * @param {Object}        action Dispatched action.
2189   *
2190   * @return {PostLockState} Updated state.
2191   */
2192  function postLock(state = {
2193    isLocked: false
2194  }, action) {
2195    switch (action.type) {
2196      case 'UPDATE_POST_LOCK':
2197        return action.lock;
2198    }
2199    return state;
2200  }
2201  
2202  /**
2203   * Post saving lock.
2204   *
2205   * When post saving is locked, the post cannot be published or updated.
2206   *
2207   * @param {PostLockState} state  Current state.
2208   * @param {Object}        action Dispatched action.
2209   *
2210   * @return {PostLockState} Updated state.
2211   */
2212  function postSavingLock(state = {}, action) {
2213    switch (action.type) {
2214      case 'LOCK_POST_SAVING':
2215        return {
2216          ...state,
2217          [action.lockName]: true
2218        };
2219      case 'UNLOCK_POST_SAVING':
2220        {
2221          const {
2222            [action.lockName]: removedLockName,
2223            ...restState
2224          } = state;
2225          return restState;
2226        }
2227    }
2228    return state;
2229  }
2230  
2231  /**
2232   * Post autosaving lock.
2233   *
2234   * When post autosaving is locked, the post will not autosave.
2235   *
2236   * @param {PostLockState} state  Current state.
2237   * @param {Object}        action Dispatched action.
2238   *
2239   * @return {PostLockState} Updated state.
2240   */
2241  function postAutosavingLock(state = {}, action) {
2242    switch (action.type) {
2243      case 'LOCK_POST_AUTOSAVING':
2244        return {
2245          ...state,
2246          [action.lockName]: true
2247        };
2248      case 'UNLOCK_POST_AUTOSAVING':
2249        {
2250          const {
2251            [action.lockName]: removedLockName,
2252            ...restState
2253          } = state;
2254          return restState;
2255        }
2256    }
2257    return state;
2258  }
2259  
2260  /**
2261   * Reducer returning the post editor setting.
2262   *
2263   * @param {Object} state  Current state.
2264   * @param {Object} action Dispatched action.
2265   *
2266   * @return {Object} Updated state.
2267   */
2268  function editorSettings(state = EDITOR_SETTINGS_DEFAULTS, action) {
2269    switch (action.type) {
2270      case 'UPDATE_EDITOR_SETTINGS':
2271        return {
2272          ...state,
2273          ...action.settings
2274        };
2275    }
2276    return state;
2277  }
2278  function renderingMode(state = 'post-only', action) {
2279    switch (action.type) {
2280      case 'SET_RENDERING_MODE':
2281        return action.mode;
2282    }
2283    return state;
2284  }
2285  
2286  /**
2287   * Reducer returning the editing canvas device type.
2288   *
2289   * @param {Object} state  Current state.
2290   * @param {Object} action Dispatched action.
2291   *
2292   * @return {Object} Updated state.
2293   */
2294  function deviceType(state = 'Desktop', action) {
2295    switch (action.type) {
2296      case 'SET_DEVICE_TYPE':
2297        return action.deviceType;
2298    }
2299    return state;
2300  }
2301  
2302  /**
2303   * Reducer storing the list of all programmatically removed panels.
2304   *
2305   * @param {Array}  state  Current state.
2306   * @param {Object} action Action object.
2307   *
2308   * @return {Array} Updated state.
2309   */
2310  function removedPanels(state = [], action) {
2311    switch (action.type) {
2312      case 'REMOVE_PANEL':
2313        if (!state.includes(action.panelName)) {
2314          return [...state, action.panelName];
2315        }
2316    }
2317    return state;
2318  }
2319  
2320  /**
2321   * Reducer to set the block inserter panel open or closed.
2322   *
2323   * Note: this reducer interacts with the list view panel reducer
2324   * to make sure that only one of the two panels is open at the same time.
2325   *
2326   * @param {Object} state  Current state.
2327   * @param {Object} action Dispatched action.
2328   */
2329  function blockInserterPanel(state = false, action) {
2330    switch (action.type) {
2331      case 'SET_IS_LIST_VIEW_OPENED':
2332        return action.isOpen ? false : state;
2333      case 'SET_IS_INSERTER_OPENED':
2334        return action.value;
2335    }
2336    return state;
2337  }
2338  
2339  /**
2340   * Reducer to set the list view panel open or closed.
2341   *
2342   * Note: this reducer interacts with the inserter panel reducer
2343   * to make sure that only one of the two panels is open at the same time.
2344   *
2345   * @param {Object} state  Current state.
2346   * @param {Object} action Dispatched action.
2347   */
2348  function listViewPanel(state = false, action) {
2349    switch (action.type) {
2350      case 'SET_IS_INSERTER_OPENED':
2351        return action.value ? false : state;
2352      case 'SET_IS_LIST_VIEW_OPENED':
2353        return action.isOpen;
2354    }
2355    return state;
2356  }
2357  
2358  /**
2359   * This reducer does nothing aside initializing a ref to the list view toggle.
2360   * We will have a unique ref per "editor" instance.
2361   *
2362   * @param {Object} state
2363   * @return {Object} Reference to the list view toggle button.
2364   */
2365  function listViewToggleRef(state = {
2366    current: null
2367  }) {
2368    return state;
2369  }
2370  
2371  /**
2372   * This reducer does nothing aside initializing a ref to the inserter sidebar toggle.
2373   * We will have a unique ref per "editor" instance.
2374   *
2375   * @param {Object} state
2376   * @return {Object} Reference to the inserter sidebar toggle button.
2377   */
2378  function inserterSidebarToggleRef(state = {
2379    current: null
2380  }) {
2381    return state;
2382  }
2383  function publishSidebarActive(state = false, action) {
2384    switch (action.type) {
2385      case 'OPEN_PUBLISH_SIDEBAR':
2386        return true;
2387      case 'CLOSE_PUBLISH_SIDEBAR':
2388        return false;
2389      case 'TOGGLE_PUBLISH_SIDEBAR':
2390        return !state;
2391    }
2392    return state;
2393  }
2394  /* harmony default export */ const store_reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
2395    postId,
2396    postType,
2397    templateId,
2398    saving,
2399    deleting,
2400    postLock,
2401    template,
2402    postSavingLock,
2403    editorSettings,
2404    postAutosavingLock,
2405    renderingMode,
2406    deviceType,
2407    removedPanels,
2408    blockInserterPanel,
2409    inserterSidebarToggleRef,
2410    listViewPanel,
2411    listViewToggleRef,
2412    publishSidebarActive,
2413    dataviews: reducer
2414  }));
2415  
2416  ;// external ["wp","blocks"]
2417  const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
2418  ;// external ["wp","date"]
2419  const external_wp_date_namespaceObject = window["wp"]["date"];
2420  ;// external ["wp","url"]
2421  const external_wp_url_namespaceObject = window["wp"]["url"];
2422  ;// external ["wp","deprecated"]
2423  const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
2424  var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
2425  ;// external ["wp","preferences"]
2426  const external_wp_preferences_namespaceObject = window["wp"]["preferences"];
2427  ;// ./node_modules/@wordpress/editor/build-module/store/constants.js
2428  /**
2429   * Set of post properties for which edits should assume a merging behavior,
2430   * assuming an object value.
2431   *
2432   * @type {Set}
2433   */
2434  const EDIT_MERGE_PROPERTIES = new Set(['meta']);
2435  
2436  /**
2437   * Constant for the store module (or reducer) key.
2438   */
2439  const STORE_NAME = 'core/editor';
2440  const PERMALINK_POSTNAME_REGEX = /%(?:postname|pagename)%/;
2441  const ONE_MINUTE_IN_MS = 60 * 1000;
2442  const AUTOSAVE_PROPERTIES = ['title', 'excerpt', 'content'];
2443  const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';
2444  const TEMPLATE_POST_TYPE = 'wp_template';
2445  const TEMPLATE_PART_POST_TYPE = 'wp_template_part';
2446  const PATTERN_POST_TYPE = 'wp_block';
2447  const NAVIGATION_POST_TYPE = 'wp_navigation';
2448  const TEMPLATE_ORIGINS = {
2449    custom: 'custom',
2450    theme: 'theme',
2451    plugin: 'plugin'
2452  };
2453  const TEMPLATE_POST_TYPES = ['wp_template', 'wp_template_part'];
2454  const GLOBAL_POST_TYPES = [...TEMPLATE_POST_TYPES, 'wp_block', 'wp_navigation'];
2455  
2456  ;// external ["wp","primitives"]
2457  const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
2458  ;// external "ReactJSXRuntime"
2459  const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
2460  ;// ./node_modules/@wordpress/icons/build-module/library/header.js
2461  /**
2462   * WordPress dependencies
2463   */
2464  
2465  
2466  const header = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
2467    xmlns: "http://www.w3.org/2000/svg",
2468    viewBox: "0 0 24 24",
2469    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
2470      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"
2471    })
2472  });
2473  /* harmony default export */ const library_header = (header);
2474  
2475  ;// ./node_modules/@wordpress/icons/build-module/library/footer.js
2476  /**
2477   * WordPress dependencies
2478   */
2479  
2480  
2481  const footer = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
2482    xmlns: "http://www.w3.org/2000/svg",
2483    viewBox: "0 0 24 24",
2484    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
2485      fillRule: "evenodd",
2486      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"
2487    })
2488  });
2489  /* harmony default export */ const library_footer = (footer);
2490  
2491  ;// ./node_modules/@wordpress/icons/build-module/library/sidebar.js
2492  /**
2493   * WordPress dependencies
2494   */
2495  
2496  
2497  const sidebar = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
2498    xmlns: "http://www.w3.org/2000/svg",
2499    viewBox: "0 0 24 24",
2500    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
2501      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"
2502    })
2503  });
2504  /* harmony default export */ const library_sidebar = (sidebar);
2505  
2506  ;// ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js
2507  /**
2508   * WordPress dependencies
2509   */
2510  
2511  
2512  const symbolFilled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
2513    xmlns: "http://www.w3.org/2000/svg",
2514    viewBox: "0 0 24 24",
2515    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
2516      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"
2517    })
2518  });
2519  /* harmony default export */ const symbol_filled = (symbolFilled);
2520  
2521  ;// ./node_modules/@wordpress/editor/build-module/utils/get-template-part-icon.js
2522  /**
2523   * WordPress dependencies
2524   */
2525  
2526  /**
2527   * Helper function to retrieve the corresponding icon by name.
2528   *
2529   * @param {string} iconName The name of the icon.
2530   *
2531   * @return {Object} The corresponding icon.
2532   */
2533  function getTemplatePartIcon(iconName) {
2534    if ('header' === iconName) {
2535      return library_header;
2536    } else if ('footer' === iconName) {
2537      return library_footer;
2538    } else if ('sidebar' === iconName) {
2539      return library_sidebar;
2540    }
2541    return symbol_filled;
2542  }
2543  
2544  ;// external ["wp","privateApis"]
2545  const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
2546  ;// ./node_modules/@wordpress/editor/build-module/lock-unlock.js
2547  /**
2548   * WordPress dependencies
2549   */
2550  
2551  const {
2552    lock,
2553    unlock
2554  } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/editor');
2555  
2556  ;// ./node_modules/@wordpress/icons/build-module/library/layout.js
2557  /**
2558   * WordPress dependencies
2559   */
2560  
2561  
2562  const layout = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
2563    xmlns: "http://www.w3.org/2000/svg",
2564    viewBox: "0 0 24 24",
2565    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
2566      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"
2567    })
2568  });
2569  /* harmony default export */ const library_layout = (layout);
2570  
2571  ;// ./node_modules/@wordpress/editor/build-module/utils/get-template-info.js
2572  /**
2573   * WordPress dependencies
2574   */
2575  
2576  /**
2577   * Internal dependencies
2578   */
2579  
2580  const EMPTY_OBJECT = {};
2581  
2582  /**
2583   * Helper function to retrieve the corresponding template info for a given template.
2584   * @param {Object} params
2585   * @param {Array}  params.templateTypes
2586   * @param {Array}  [params.templateAreas]
2587   * @param {Object} params.template
2588   */
2589  const getTemplateInfo = params => {
2590    var _Object$values$find;
2591    if (!params) {
2592      return EMPTY_OBJECT;
2593    }
2594    const {
2595      templateTypes,
2596      templateAreas,
2597      template
2598    } = params;
2599    const {
2600      description,
2601      slug,
2602      title,
2603      area
2604    } = template;
2605    const {
2606      title: defaultTitle,
2607      description: defaultDescription
2608    } = (_Object$values$find = Object.values(templateTypes).find(type => type.slug === slug)) !== null && _Object$values$find !== void 0 ? _Object$values$find : EMPTY_OBJECT;
2609    const templateTitle = typeof title === 'string' ? title : title?.rendered;
2610    const templateDescription = typeof description === 'string' ? description : description?.raw;
2611    const templateAreasWithIcon = templateAreas?.map(item => ({
2612      ...item,
2613      icon: getTemplatePartIcon(item.icon)
2614    }));
2615    const templateIcon = templateAreasWithIcon?.find(item => area === item.area)?.icon || library_layout;
2616    return {
2617      title: templateTitle && templateTitle !== slug ? templateTitle : defaultTitle || slug,
2618      description: templateDescription || defaultDescription,
2619      icon: templateIcon
2620    };
2621  };
2622  
2623  ;// ./node_modules/@wordpress/editor/build-module/store/selectors.js
2624  /**
2625   * WordPress dependencies
2626   */
2627  
2628  
2629  
2630  
2631  
2632  
2633  
2634  
2635  
2636  
2637  /**
2638   * Internal dependencies
2639   */
2640  
2641  
2642  
2643  
2644  
2645  
2646  /**
2647   * Shared reference to an empty object for cases where it is important to avoid
2648   * returning a new object reference on every invocation, as in a connected or
2649   * other pure component which performs `shouldComponentUpdate` check on props.
2650   * This should be used as a last resort, since the normalized data should be
2651   * maintained by the reducer result in state.
2652   */
2653  const selectors_EMPTY_OBJECT = {};
2654  
2655  /**
2656   * Returns true if any past editor history snapshots exist, or false otherwise.
2657   *
2658   * @param {Object} state Global application state.
2659   *
2660   * @return {boolean} Whether undo history exists.
2661   */
2662  const hasEditorUndo = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
2663    return select(external_wp_coreData_namespaceObject.store).hasUndo();
2664  });
2665  
2666  /**
2667   * Returns true if any future editor history snapshots exist, or false
2668   * otherwise.
2669   *
2670   * @param {Object} state Global application state.
2671   *
2672   * @return {boolean} Whether redo history exists.
2673   */
2674  const hasEditorRedo = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
2675    return select(external_wp_coreData_namespaceObject.store).hasRedo();
2676  });
2677  
2678  /**
2679   * Returns true if the currently edited post is yet to be saved, or false if
2680   * the post has been saved.
2681   *
2682   * @param {Object} state Global application state.
2683   *
2684   * @return {boolean} Whether the post is new.
2685   */
2686  function isEditedPostNew(state) {
2687    return getCurrentPost(state).status === 'auto-draft';
2688  }
2689  
2690  /**
2691   * Returns true if content includes unsaved changes, or false otherwise.
2692   *
2693   * @param {Object} state Editor state.
2694   *
2695   * @return {boolean} Whether content includes unsaved changes.
2696   */
2697  function hasChangedContent(state) {
2698    const edits = getPostEdits(state);
2699    return 'content' in edits;
2700  }
2701  
2702  /**
2703   * Returns true if there are unsaved values for the current edit session, or
2704   * false if the editing state matches the saved or new post.
2705   *
2706   * @param {Object} state Global application state.
2707   *
2708   * @return {boolean} Whether unsaved values exist.
2709   */
2710  const isEditedPostDirty = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
2711    // Edits should contain only fields which differ from the saved post (reset
2712    // at initial load and save complete). Thus, a non-empty edits state can be
2713    // inferred to contain unsaved values.
2714    const postType = getCurrentPostType(state);
2715    const postId = getCurrentPostId(state);
2716    return select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord('postType', postType, postId);
2717  });
2718  
2719  /**
2720   * Returns true if there are unsaved edits for entities other than
2721   * the editor's post, and false otherwise.
2722   *
2723   * @param {Object} state Global application state.
2724   *
2725   * @return {boolean} Whether there are edits or not.
2726   */
2727  const hasNonPostEntityChanges = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
2728    const dirtyEntityRecords = select(external_wp_coreData_namespaceObject.store).__experimentalGetDirtyEntityRecords();
2729    const {
2730      type,
2731      id
2732    } = getCurrentPost(state);
2733    return dirtyEntityRecords.some(entityRecord => entityRecord.kind !== 'postType' || entityRecord.name !== type || entityRecord.key !== id);
2734  });
2735  
2736  /**
2737   * Returns true if there are no unsaved values for the current edit session and
2738   * if the currently edited post is new (has never been saved before).
2739   *
2740   * @param {Object} state Global application state.
2741   *
2742   * @return {boolean} Whether new post and unsaved values exist.
2743   */
2744  function isCleanNewPost(state) {
2745    return !isEditedPostDirty(state) && isEditedPostNew(state);
2746  }
2747  
2748  /**
2749   * Returns the post currently being edited in its last known saved state, not
2750   * including unsaved edits. Returns an object containing relevant default post
2751   * values if the post has not yet been saved.
2752   *
2753   * @param {Object} state Global application state.
2754   *
2755   * @return {Object} Post object.
2756   */
2757  const getCurrentPost = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
2758    const postId = getCurrentPostId(state);
2759    const postType = getCurrentPostType(state);
2760    const post = select(external_wp_coreData_namespaceObject.store).getRawEntityRecord('postType', postType, postId);
2761    if (post) {
2762      return post;
2763    }
2764  
2765    // This exists for compatibility with the previous selector behavior
2766    // which would guarantee an object return based on the editor reducer's
2767    // default empty object state.
2768    return selectors_EMPTY_OBJECT;
2769  });
2770  
2771  /**
2772   * Returns the post type of the post currently being edited.
2773   *
2774   * @param {Object} state Global application state.
2775   *
2776   * @example
2777   *
2778   *```js
2779   * const currentPostType = wp.data.select( 'core/editor' ).getCurrentPostType();
2780   *```
2781   * @return {string} Post type.
2782   */
2783  function getCurrentPostType(state) {
2784    return state.postType;
2785  }
2786  
2787  /**
2788   * Returns the ID of the post currently being edited, or null if the post has
2789   * not yet been saved.
2790   *
2791   * @param {Object} state Global application state.
2792   *
2793   * @return {?number} ID of current post.
2794   */
2795  function getCurrentPostId(state) {
2796    return state.postId;
2797  }
2798  
2799  /**
2800   * Returns the template ID currently being rendered/edited
2801   *
2802   * @param {Object} state Global application state.
2803   *
2804   * @return {?string} Template ID.
2805   */
2806  function getCurrentTemplateId(state) {
2807    return state.templateId;
2808  }
2809  
2810  /**
2811   * Returns the number of revisions of the post currently being edited.
2812   *
2813   * @param {Object} state Global application state.
2814   *
2815   * @return {number} Number of revisions.
2816   */
2817  function getCurrentPostRevisionsCount(state) {
2818    var _getCurrentPost$_link;
2819    return (_getCurrentPost$_link = getCurrentPost(state)._links?.['version-history']?.[0]?.count) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : 0;
2820  }
2821  
2822  /**
2823   * Returns the last revision ID of the post currently being edited,
2824   * or null if the post has no revisions.
2825   *
2826   * @param {Object} state Global application state.
2827   *
2828   * @return {?number} ID of the last revision.
2829   */
2830  function getCurrentPostLastRevisionId(state) {
2831    var _getCurrentPost$_link2;
2832    return (_getCurrentPost$_link2 = getCurrentPost(state)._links?.['predecessor-version']?.[0]?.id) !== null && _getCurrentPost$_link2 !== void 0 ? _getCurrentPost$_link2 : null;
2833  }
2834  
2835  /**
2836   * Returns any post values which have been changed in the editor but not yet
2837   * been saved.
2838   *
2839   * @param {Object} state Global application state.
2840   *
2841   * @return {Object} Object of key value pairs comprising unsaved edits.
2842   */
2843  const getPostEdits = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
2844    const postType = getCurrentPostType(state);
2845    const postId = getCurrentPostId(state);
2846    return select(external_wp_coreData_namespaceObject.store).getEntityRecordEdits('postType', postType, postId) || selectors_EMPTY_OBJECT;
2847  });
2848  
2849  /**
2850   * Returns an attribute value of the saved post.
2851   *
2852   * @param {Object} state         Global application state.
2853   * @param {string} attributeName Post attribute name.
2854   *
2855   * @return {*} Post attribute value.
2856   */
2857  function getCurrentPostAttribute(state, attributeName) {
2858    switch (attributeName) {
2859      case 'type':
2860        return getCurrentPostType(state);
2861      case 'id':
2862        return getCurrentPostId(state);
2863      default:
2864        const post = getCurrentPost(state);
2865        if (!post.hasOwnProperty(attributeName)) {
2866          break;
2867        }
2868        return getPostRawValue(post[attributeName]);
2869    }
2870  }
2871  
2872  /**
2873   * Returns a single attribute of the post being edited, preferring the unsaved
2874   * edit if one exists, but merging with the attribute value for the last known
2875   * saved state of the post (this is needed for some nested attributes like meta).
2876   *
2877   * @param {Object} state         Global application state.
2878   * @param {string} attributeName Post attribute name.
2879   *
2880   * @return {*} Post attribute value.
2881   */
2882  const getNestedEditedPostProperty = (0,external_wp_data_namespaceObject.createSelector)((state, attributeName) => {
2883    const edits = getPostEdits(state);
2884    if (!edits.hasOwnProperty(attributeName)) {
2885      return getCurrentPostAttribute(state, attributeName);
2886    }
2887    return {
2888      ...getCurrentPostAttribute(state, attributeName),
2889      ...edits[attributeName]
2890    };
2891  }, (state, attributeName) => [getCurrentPostAttribute(state, attributeName), getPostEdits(state)[attributeName]]);
2892  
2893  /**
2894   * Returns a single attribute of the post being edited, preferring the unsaved
2895   * edit if one exists, but falling back to the attribute for the last known
2896   * saved state of the post.
2897   *
2898   * @param {Object} state         Global application state.
2899   * @param {string} attributeName Post attribute name.
2900   *
2901   * @example
2902   *
2903   *```js
2904   *     // Get specific media size based on the featured media ID
2905   *     // Note: change sizes?.large for any registered size
2906   *     const getFeaturedMediaUrl = useSelect( ( select ) => {
2907   *         const getFeaturedMediaId =
2908   *             select( 'core/editor' ).getEditedPostAttribute( 'featured_media' );
2909   *         const getMedia = select( 'core' ).getMedia( getFeaturedMediaId );
2910   *
2911   *         return (
2912   *             getMedia?.media_details?.sizes?.large?.source_url || getMedia?.source_url || ''
2913   *         );
2914   * }, [] );
2915   *```
2916   *
2917   * @return {*} Post attribute value.
2918   */
2919  function getEditedPostAttribute(state, attributeName) {
2920    // Special cases.
2921    switch (attributeName) {
2922      case 'content':
2923        return getEditedPostContent(state);
2924    }
2925  
2926    // Fall back to saved post value if not edited.
2927    const edits = getPostEdits(state);
2928    if (!edits.hasOwnProperty(attributeName)) {
2929      return getCurrentPostAttribute(state, attributeName);
2930    }
2931  
2932    // Merge properties are objects which contain only the patch edit in state,
2933    // and thus must be merged with the current post attribute.
2934    if (EDIT_MERGE_PROPERTIES.has(attributeName)) {
2935      return getNestedEditedPostProperty(state, attributeName);
2936    }
2937    return edits[attributeName];
2938  }
2939  
2940  /**
2941   * Returns an attribute value of the current autosave revision for a post, or
2942   * null if there is no autosave for the post.
2943   *
2944   * @deprecated since 5.6. Callers should use the `getAutosave( postType, postId, userId )` selector
2945   *                from the '@wordpress/core-data' package and access properties on the returned
2946   *                autosave object using getPostRawValue.
2947   *
2948   * @param {Object} state         Global application state.
2949   * @param {string} attributeName Autosave attribute name.
2950   *
2951   * @return {*} Autosave attribute value.
2952   */
2953  const getAutosaveAttribute = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, attributeName) => {
2954    if (!AUTOSAVE_PROPERTIES.includes(attributeName) && attributeName !== 'preview_link') {
2955      return;
2956    }
2957    const postType = getCurrentPostType(state);
2958  
2959    // Currently template autosaving is not supported.
2960    if (postType === 'wp_template') {
2961      return false;
2962    }
2963    const postId = getCurrentPostId(state);
2964    const currentUserId = select(external_wp_coreData_namespaceObject.store).getCurrentUser()?.id;
2965    const autosave = select(external_wp_coreData_namespaceObject.store).getAutosave(postType, postId, currentUserId);
2966    if (autosave) {
2967      return getPostRawValue(autosave[attributeName]);
2968    }
2969  });
2970  
2971  /**
2972   * Returns the current visibility of the post being edited, preferring the
2973   * unsaved value if different than the saved post. The return value is one of
2974   * "private", "password", or "public".
2975   *
2976   * @param {Object} state Global application state.
2977   *
2978   * @return {string} Post visibility.
2979   */
2980  function getEditedPostVisibility(state) {
2981    const status = getEditedPostAttribute(state, 'status');
2982    if (status === 'private') {
2983      return 'private';
2984    }
2985    const password = getEditedPostAttribute(state, 'password');
2986    if (password) {
2987      return 'password';
2988    }
2989    return 'public';
2990  }
2991  
2992  /**
2993   * Returns true if post is pending review.
2994   *
2995   * @param {Object} state Global application state.
2996   *
2997   * @return {boolean} Whether current post is pending review.
2998   */
2999  function isCurrentPostPending(state) {
3000    return getCurrentPost(state).status === 'pending';
3001  }
3002  
3003  /**
3004   * Return true if the current post has already been published.
3005   *
3006   * @param {Object} state         Global application state.
3007   * @param {Object} [currentPost] Explicit current post for bypassing registry selector.
3008   *
3009   * @return {boolean} Whether the post has been published.
3010   */
3011  function isCurrentPostPublished(state, currentPost) {
3012    const post = currentPost || getCurrentPost(state);
3013    return ['publish', 'private'].indexOf(post.status) !== -1 || post.status === 'future' && !(0,external_wp_date_namespaceObject.isInTheFuture)(new Date(Number((0,external_wp_date_namespaceObject.getDate)(post.date)) - ONE_MINUTE_IN_MS));
3014  }
3015  
3016  /**
3017   * Returns true if post is already scheduled.
3018   *
3019   * @param {Object} state Global application state.
3020   *
3021   * @return {boolean} Whether current post is scheduled to be posted.
3022   */
3023  function isCurrentPostScheduled(state) {
3024    return getCurrentPost(state).status === 'future' && !isCurrentPostPublished(state);
3025  }
3026  
3027  /**
3028   * Return true if the post being edited can be published.
3029   *
3030   * @param {Object} state Global application state.
3031   *
3032   * @return {boolean} Whether the post can been published.
3033   */
3034  function isEditedPostPublishable(state) {
3035    const post = getCurrentPost(state);
3036  
3037    // TODO: Post being publishable should be superset of condition of post
3038    // being saveable. Currently this restriction is imposed at UI.
3039    //
3040    //  See: <PostPublishButton /> (`isButtonEnabled` assigned by `isSaveable`).
3041  
3042    return isEditedPostDirty(state) || ['publish', 'private', 'future'].indexOf(post.status) === -1;
3043  }
3044  
3045  /**
3046   * Returns true if the post can be saved, or false otherwise. A post must
3047   * contain a title, an excerpt, or non-empty content to be valid for save.
3048   *
3049   * @param {Object} state Global application state.
3050   *
3051   * @return {boolean} Whether the post can be saved.
3052   */
3053  function isEditedPostSaveable(state) {
3054    if (isSavingPost(state)) {
3055      return false;
3056    }
3057  
3058    // TODO: Post should not be saveable if not dirty. Cannot be added here at
3059    // this time since posts where meta boxes are present can be saved even if
3060    // the post is not dirty. Currently this restriction is imposed at UI, but
3061    // should be moved here.
3062    //
3063    //  See: `isEditedPostPublishable` (includes `isEditedPostDirty` condition)
3064    //  See: <PostSavedState /> (`forceIsDirty` prop)
3065    //  See: <PostPublishButton /> (`forceIsDirty` prop)
3066    //  See: https://github.com/WordPress/gutenberg/pull/4184.
3067  
3068    return !!getEditedPostAttribute(state, 'title') || !!getEditedPostAttribute(state, 'excerpt') || !isEditedPostEmpty(state) || external_wp_element_namespaceObject.Platform.OS === 'native';
3069  }
3070  
3071  /**
3072   * Returns true if the edited post has content. A post has content if it has at
3073   * least one saveable block or otherwise has a non-empty content property
3074   * assigned.
3075   *
3076   * @param {Object} state Global application state.
3077   *
3078   * @return {boolean} Whether post has content.
3079   */
3080  const isEditedPostEmpty = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
3081    // While the condition of truthy content string is sufficient to determine
3082    // emptiness, testing saveable blocks length is a trivial operation. Since
3083    // this function can be called frequently, optimize for the fast case as a
3084    // condition of the mere existence of blocks. Note that the value of edited
3085    // content takes precedent over block content, and must fall through to the
3086    // default logic.
3087    const postId = getCurrentPostId(state);
3088    const postType = getCurrentPostType(state);
3089    const record = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', postType, postId);
3090    if (typeof record.content !== 'function') {
3091      return !record.content;
3092    }
3093    const blocks = getEditedPostAttribute(state, 'blocks');
3094    if (blocks.length === 0) {
3095      return true;
3096    }
3097  
3098    // Pierce the abstraction of the serializer in knowing that blocks are
3099    // joined with newlines such that even if every individual block
3100    // produces an empty save result, the serialized content is non-empty.
3101    if (blocks.length > 1) {
3102      return false;
3103    }
3104  
3105    // There are two conditions under which the optimization cannot be
3106    // assumed, and a fallthrough to getEditedPostContent must occur:
3107    //
3108    // 1. getBlocksForSerialization has special treatment in omitting a
3109    //    single unmodified default block.
3110    // 2. Comment delimiters are omitted for a freeform or unregistered
3111    //    block in its serialization. The freeform block specifically may
3112    //    produce an empty string in its saved output.
3113    //
3114    // For all other content, the single block is assumed to make a post
3115    // non-empty, if only by virtue of its own comment delimiters.
3116    const blockName = blocks[0].name;
3117    if (blockName !== (0,external_wp_blocks_namespaceObject.getDefaultBlockName)() && blockName !== (0,external_wp_blocks_namespaceObject.getFreeformContentHandlerName)()) {
3118      return false;
3119    }
3120    return !getEditedPostContent(state);
3121  });
3122  
3123  /**
3124   * Returns true if the post can be autosaved, or false otherwise.
3125   *
3126   * @param {Object} state    Global application state.
3127   * @param {Object} autosave A raw autosave object from the REST API.
3128   *
3129   * @return {boolean} Whether the post can be autosaved.
3130   */
3131  const isEditedPostAutosaveable = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
3132    // A post must contain a title, an excerpt, or non-empty content to be valid for autosaving.
3133    if (!isEditedPostSaveable(state)) {
3134      return false;
3135    }
3136  
3137    // A post is not autosavable when there is a post autosave lock.
3138    if (isPostAutosavingLocked(state)) {
3139      return false;
3140    }
3141    const postType = getCurrentPostType(state);
3142  
3143    // Currently template autosaving is not supported.
3144    if (postType === 'wp_template') {
3145      return false;
3146    }
3147    const postId = getCurrentPostId(state);
3148    const hasFetchedAutosave = select(external_wp_coreData_namespaceObject.store).hasFetchedAutosaves(postType, postId);
3149    const currentUserId = select(external_wp_coreData_namespaceObject.store).getCurrentUser()?.id;
3150  
3151    // Disable reason - this line causes the side-effect of fetching the autosave
3152    // via a resolver, moving below the return would result in the autosave never
3153    // being fetched.
3154    // eslint-disable-next-line @wordpress/no-unused-vars-before-return
3155    const autosave = select(external_wp_coreData_namespaceObject.store).getAutosave(postType, postId, currentUserId);
3156  
3157    // If any existing autosaves have not yet been fetched, this function is
3158    // unable to determine if the post is autosaveable, so return false.
3159    if (!hasFetchedAutosave) {
3160      return false;
3161    }
3162  
3163    // If we don't already have an autosave, the post is autosaveable.
3164    if (!autosave) {
3165      return true;
3166    }
3167  
3168    // To avoid an expensive content serialization, use the content dirtiness
3169    // flag in place of content field comparison against the known autosave.
3170    // This is not strictly accurate, and relies on a tolerance toward autosave
3171    // request failures for unnecessary saves.
3172    if (hasChangedContent(state)) {
3173      return true;
3174    }
3175  
3176    // If title, excerpt, or meta have changed, the post is autosaveable.
3177    return ['title', 'excerpt', 'meta'].some(field => getPostRawValue(autosave[field]) !== getEditedPostAttribute(state, field));
3178  });
3179  
3180  /**
3181   * Return true if the post being edited is being scheduled. Preferring the
3182   * unsaved status values.
3183   *
3184   * @param {Object} state Global application state.
3185   *
3186   * @return {boolean} Whether the post has been published.
3187   */
3188  function isEditedPostBeingScheduled(state) {
3189    const date = getEditedPostAttribute(state, 'date');
3190    // Offset the date by one minute (network latency).
3191    const checkedDate = new Date(Number((0,external_wp_date_namespaceObject.getDate)(date)) - ONE_MINUTE_IN_MS);
3192    return (0,external_wp_date_namespaceObject.isInTheFuture)(checkedDate);
3193  }
3194  
3195  /**
3196   * Returns whether the current post should be considered to have a "floating"
3197   * date (i.e. that it would publish "Immediately" rather than at a set time).
3198   *
3199   * Unlike in the PHP backend, the REST API returns a full date string for posts
3200   * where the 0000-00-00T00:00:00 placeholder is present in the database. To
3201   * infer that a post is set to publish "Immediately" we check whether the date
3202   * and modified date are the same.
3203   *
3204   * @param {Object} state Editor state.
3205   *
3206   * @return {boolean} Whether the edited post has a floating date value.
3207   */
3208  function isEditedPostDateFloating(state) {
3209    const date = getEditedPostAttribute(state, 'date');
3210    const modified = getEditedPostAttribute(state, 'modified');
3211  
3212    // This should be the status of the persisted post
3213    // It shouldn't use the "edited" status otherwise it breaks the
3214    // inferred post data floating status
3215    // See https://github.com/WordPress/gutenberg/issues/28083.
3216    const status = getCurrentPost(state).status;
3217    if (status === 'draft' || status === 'auto-draft' || status === 'pending') {
3218      return date === modified || date === null;
3219    }
3220    return false;
3221  }
3222  
3223  /**
3224   * Returns true if the post is currently being deleted, or false otherwise.
3225   *
3226   * @param {Object} state Editor state.
3227   *
3228   * @return {boolean} Whether post is being deleted.
3229   */
3230  function isDeletingPost(state) {
3231    return !!state.deleting.pending;
3232  }
3233  
3234  /**
3235   * Returns true if the post is currently being saved, or false otherwise.
3236   *
3237   * @param {Object} state Global application state.
3238   *
3239   * @return {boolean} Whether post is being saved.
3240   */
3241  function isSavingPost(state) {
3242    return !!state.saving.pending;
3243  }
3244  
3245  /**
3246   * Returns true if non-post entities are currently being saved, or false otherwise.
3247   *
3248   * @param {Object} state Global application state.
3249   *
3250   * @return {boolean} Whether non-post entities are being saved.
3251   */
3252  const isSavingNonPostEntityChanges = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
3253    const entitiesBeingSaved = select(external_wp_coreData_namespaceObject.store).__experimentalGetEntitiesBeingSaved();
3254    const {
3255      type,
3256      id
3257    } = getCurrentPost(state);
3258    return entitiesBeingSaved.some(entityRecord => entityRecord.kind !== 'postType' || entityRecord.name !== type || entityRecord.key !== id);
3259  });
3260  
3261  /**
3262   * Returns true if a previous post save was attempted successfully, or false
3263   * otherwise.
3264   *
3265   * @param {Object} state Global application state.
3266   *
3267   * @return {boolean} Whether the post was saved successfully.
3268   */
3269  const didPostSaveRequestSucceed = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
3270    const postType = getCurrentPostType(state);
3271    const postId = getCurrentPostId(state);
3272    return !select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError('postType', postType, postId);
3273  });
3274  
3275  /**
3276   * Returns true if a previous post save was attempted but failed, or false
3277   * otherwise.
3278   *
3279   * @param {Object} state Global application state.
3280   *
3281   * @return {boolean} Whether the post save failed.
3282   */
3283  const didPostSaveRequestFail = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
3284    const postType = getCurrentPostType(state);
3285    const postId = getCurrentPostId(state);
3286    return !!select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError('postType', postType, postId);
3287  });
3288  
3289  /**
3290   * Returns true if the post is autosaving, or false otherwise.
3291   *
3292   * @param {Object} state Global application state.
3293   *
3294   * @return {boolean} Whether the post is autosaving.
3295   */
3296  function isAutosavingPost(state) {
3297    return isSavingPost(state) && Boolean(state.saving.options?.isAutosave);
3298  }
3299  
3300  /**
3301   * Returns true if the post is being previewed, or false otherwise.
3302   *
3303   * @param {Object} state Global application state.
3304   *
3305   * @return {boolean} Whether the post is being previewed.
3306   */
3307  function isPreviewingPost(state) {
3308    return isSavingPost(state) && Boolean(state.saving.options?.isPreview);
3309  }
3310  
3311  /**
3312   * Returns the post preview link
3313   *
3314   * @param {Object} state Global application state.
3315   *
3316   * @return {string | undefined} Preview Link.
3317   */
3318  function getEditedPostPreviewLink(state) {
3319    if (state.saving.pending || isSavingPost(state)) {
3320      return;
3321    }
3322    let previewLink = getAutosaveAttribute(state, 'preview_link');
3323    // Fix for issue: https://github.com/WordPress/gutenberg/issues/33616
3324    // If the post is draft, ignore the preview link from the autosave record,
3325    // because the preview could be a stale autosave if the post was switched from
3326    // published to draft.
3327    // See: https://github.com/WordPress/gutenberg/pull/37952.
3328    if (!previewLink || 'draft' === getCurrentPost(state).status) {
3329      previewLink = getEditedPostAttribute(state, 'link');
3330      if (previewLink) {
3331        previewLink = (0,external_wp_url_namespaceObject.addQueryArgs)(previewLink, {
3332          preview: true
3333        });
3334      }
3335    }
3336    const featuredImageId = getEditedPostAttribute(state, 'featured_media');
3337    if (previewLink && featuredImageId) {
3338      return (0,external_wp_url_namespaceObject.addQueryArgs)(previewLink, {
3339        _thumbnail_id: featuredImageId
3340      });
3341    }
3342    return previewLink;
3343  }
3344  
3345  /**
3346   * Returns a suggested post format for the current post, inferred only if there
3347   * is a single block within the post and it is of a type known to match a
3348   * default post format. Returns null if the format cannot be determined.
3349   *
3350   * @return {?string} Suggested post format.
3351   */
3352  const getSuggestedPostFormat = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
3353    const blocks = select(external_wp_blockEditor_namespaceObject.store).getBlocks();
3354    if (blocks.length > 2) {
3355      return null;
3356    }
3357    let name;
3358    // If there is only one block in the content of the post grab its name
3359    // so we can derive a suitable post format from it.
3360    if (blocks.length === 1) {
3361      name = blocks[0].name;
3362      // Check for core/embed `video` and `audio` eligible suggestions.
3363      if (name === 'core/embed') {
3364        const provider = blocks[0].attributes?.providerNameSlug;
3365        if (['youtube', 'vimeo'].includes(provider)) {
3366          name = 'core/video';
3367        } else if (['spotify', 'soundcloud'].includes(provider)) {
3368          name = 'core/audio';
3369        }
3370      }
3371    }
3372  
3373    // If there are two blocks in the content and the last one is a text blocks
3374    // grab the name of the first one to also suggest a post format from it.
3375    if (blocks.length === 2 && blocks[1].name === 'core/paragraph') {
3376      name = blocks[0].name;
3377    }
3378  
3379    // We only convert to default post formats in core.
3380    switch (name) {
3381      case 'core/image':
3382        return 'image';
3383      case 'core/quote':
3384      case 'core/pullquote':
3385        return 'quote';
3386      case 'core/gallery':
3387        return 'gallery';
3388      case 'core/video':
3389        return 'video';
3390      case 'core/audio':
3391        return 'audio';
3392      default:
3393        return null;
3394    }
3395  });
3396  
3397  /**
3398   * Returns the content of the post being edited.
3399   *
3400   * @param {Object} state Global application state.
3401   *
3402   * @return {string} Post content.
3403   */
3404  const getEditedPostContent = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
3405    const postId = getCurrentPostId(state);
3406    const postType = getCurrentPostType(state);
3407    const record = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', postType, postId);
3408    if (record) {
3409      if (typeof record.content === 'function') {
3410        return record.content(record);
3411      } else if (record.blocks) {
3412        return (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(record.blocks);
3413      } else if (record.content) {
3414        return record.content;
3415      }
3416    }
3417    return '';
3418  });
3419  
3420  /**
3421   * Returns true if the post is being published, or false otherwise.
3422   *
3423   * @param {Object} state Global application state.
3424   *
3425   * @return {boolean} Whether post is being published.
3426   */
3427  function isPublishingPost(state) {
3428    return isSavingPost(state) && !isCurrentPostPublished(state) && getEditedPostAttribute(state, 'status') === 'publish';
3429  }
3430  
3431  /**
3432   * Returns whether the permalink is editable or not.
3433   *
3434   * @param {Object} state Editor state.
3435   *
3436   * @return {boolean} Whether or not the permalink is editable.
3437   */
3438  function isPermalinkEditable(state) {
3439    const permalinkTemplate = getEditedPostAttribute(state, 'permalink_template');
3440    return PERMALINK_POSTNAME_REGEX.test(permalinkTemplate);
3441  }
3442  
3443  /**
3444   * Returns the permalink for the post.
3445   *
3446   * @param {Object} state Editor state.
3447   *
3448   * @return {?string} The permalink, or null if the post is not viewable.
3449   */
3450  function getPermalink(state) {
3451    const permalinkParts = getPermalinkParts(state);
3452    if (!permalinkParts) {
3453      return null;
3454    }
3455    const {
3456      prefix,
3457      postName,
3458      suffix
3459    } = permalinkParts;
3460    if (isPermalinkEditable(state)) {
3461      return prefix + postName + suffix;
3462    }
3463    return prefix;
3464  }
3465  
3466  /**
3467   * Returns the slug for the post being edited, preferring a manually edited
3468   * value if one exists, then a sanitized version of the current post title, and
3469   * finally the post ID.
3470   *
3471   * @param {Object} state Editor state.
3472   *
3473   * @return {string} The current slug to be displayed in the editor
3474   */
3475  function getEditedPostSlug(state) {
3476    return getEditedPostAttribute(state, 'slug') || (0,external_wp_url_namespaceObject.cleanForSlug)(getEditedPostAttribute(state, 'title')) || getCurrentPostId(state);
3477  }
3478  
3479  /**
3480   * Returns the permalink for a post, split into its three parts: the prefix,
3481   * the postName, and the suffix.
3482   *
3483   * @param {Object} state Editor state.
3484   *
3485   * @return {Object} An object containing the prefix, postName, and suffix for
3486   *                  the permalink, or null if the post is not viewable.
3487   */
3488  function getPermalinkParts(state) {
3489    const permalinkTemplate = getEditedPostAttribute(state, 'permalink_template');
3490    if (!permalinkTemplate) {
3491      return null;
3492    }
3493    const postName = getEditedPostAttribute(state, 'slug') || getEditedPostAttribute(state, 'generated_slug');
3494    const [prefix, suffix] = permalinkTemplate.split(PERMALINK_POSTNAME_REGEX);
3495    return {
3496      prefix,
3497      postName,
3498      suffix
3499    };
3500  }
3501  
3502  /**
3503   * Returns whether the post is locked.
3504   *
3505   * @param {Object} state Global application state.
3506   *
3507   * @return {boolean} Is locked.
3508   */
3509  function isPostLocked(state) {
3510    return state.postLock.isLocked;
3511  }
3512  
3513  /**
3514   * Returns whether post saving is locked.
3515   *
3516   * @param {Object} state Global application state.
3517   *
3518   * @return {boolean} Is locked.
3519   */
3520  function isPostSavingLocked(state) {
3521    return Object.keys(state.postSavingLock).length > 0;
3522  }
3523  
3524  /**
3525   * Returns whether post autosaving is locked.
3526   *
3527   * @param {Object} state Global application state.
3528   *
3529   * @return {boolean} Is locked.
3530   */
3531  function isPostAutosavingLocked(state) {
3532    return Object.keys(state.postAutosavingLock).length > 0;
3533  }
3534  
3535  /**
3536   * Returns whether the edition of the post has been taken over.
3537   *
3538   * @param {Object} state Global application state.
3539   *
3540   * @return {boolean} Is post lock takeover.
3541   */
3542  function isPostLockTakeover(state) {
3543    return state.postLock.isTakeover;
3544  }
3545  
3546  /**
3547   * Returns details about the post lock user.
3548   *
3549   * @param {Object} state Global application state.
3550   *
3551   * @return {Object} A user object.
3552   */
3553  function getPostLockUser(state) {
3554    return state.postLock.user;
3555  }
3556  
3557  /**
3558   * Returns the active post lock.
3559   *
3560   * @param {Object} state Global application state.
3561   *
3562   * @return {Object} The lock object.
3563   */
3564  function getActivePostLock(state) {
3565    return state.postLock.activePostLock;
3566  }
3567  
3568  /**
3569   * Returns whether or not the user has the unfiltered_html capability.
3570   *
3571   * @param {Object} state Editor state.
3572   *
3573   * @return {boolean} Whether the user can or can't post unfiltered HTML.
3574   */
3575  function canUserUseUnfilteredHTML(state) {
3576    return Boolean(getCurrentPost(state)._links?.hasOwnProperty('wp:action-unfiltered-html'));
3577  }
3578  
3579  /**
3580   * Returns whether the pre-publish panel should be shown
3581   * or skipped when the user clicks the "publish" button.
3582   *
3583   * @return {boolean} Whether the pre-publish panel should be shown or not.
3584   */
3585  const isPublishSidebarEnabled = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => !!select(external_wp_preferences_namespaceObject.store).get('core', 'isPublishSidebarEnabled'));
3586  
3587  /**
3588   * Return the current block list.
3589   *
3590   * @param {Object} state
3591   * @return {Array} Block list.
3592   */
3593  const getEditorBlocks = (0,external_wp_data_namespaceObject.createSelector)(state => {
3594    return getEditedPostAttribute(state, 'blocks') || (0,external_wp_blocks_namespaceObject.parse)(getEditedPostContent(state));
3595  }, state => [getEditedPostAttribute(state, 'blocks'), getEditedPostContent(state)]);
3596  
3597  /**
3598   * Returns true if the given panel was programmatically removed, or false otherwise.
3599   * All panels are not removed by default.
3600   *
3601   * @param {Object} state     Global application state.
3602   * @param {string} panelName A string that identifies the panel.
3603   *
3604   * @return {boolean} Whether or not the panel is removed.
3605   */
3606  function isEditorPanelRemoved(state, panelName) {
3607    return state.removedPanels.includes(panelName);
3608  }
3609  
3610  /**
3611   * Returns true if the given panel is enabled, or false otherwise. Panels are
3612   * enabled by default.
3613   *
3614   * @param {Object} state     Global application state.
3615   * @param {string} panelName A string that identifies the panel.
3616   *
3617   * @return {boolean} Whether or not the panel is enabled.
3618   */
3619  const isEditorPanelEnabled = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, panelName) => {
3620    // For backward compatibility, we check edit-post
3621    // even though now this is in "editor" package.
3622    const inactivePanels = select(external_wp_preferences_namespaceObject.store).get('core', 'inactivePanels');
3623    return !isEditorPanelRemoved(state, panelName) && !inactivePanels?.includes(panelName);
3624  });
3625  
3626  /**
3627   * Returns true if the given panel is open, or false otherwise. Panels are
3628   * closed by default.
3629   *
3630   * @param {Object} state     Global application state.
3631   * @param {string} panelName A string that identifies the panel.
3632   *
3633   * @return {boolean} Whether or not the panel is open.
3634   */
3635  const isEditorPanelOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, panelName) => {
3636    // For backward compatibility, we check edit-post
3637    // even though now this is in "editor" package.
3638    const openPanels = select(external_wp_preferences_namespaceObject.store).get('core', 'openPanels');
3639    return !!openPanels?.includes(panelName);
3640  });
3641  
3642  /**
3643   * A block selection object.
3644   *
3645   * @typedef {Object} WPBlockSelection
3646   *
3647   * @property {string} clientId     A block client ID.
3648   * @property {string} attributeKey A block attribute key.
3649   * @property {number} offset       An attribute value offset, based on the rich
3650   *                                 text value. See `wp.richText.create`.
3651   */
3652  
3653  /**
3654   * Returns the current selection start.
3655   *
3656   * @deprecated since Gutenberg 10.0.0.
3657   *
3658   * @param {Object} state
3659   * @return {WPBlockSelection} The selection start.
3660   */
3661  function getEditorSelectionStart(state) {
3662    external_wp_deprecated_default()("select('core/editor').getEditorSelectionStart", {
3663      since: '5.8',
3664      alternative: "select('core/editor').getEditorSelection"
3665    });
3666    return getEditedPostAttribute(state, 'selection')?.selectionStart;
3667  }
3668  
3669  /**
3670   * Returns the current selection end.
3671   *
3672   * @deprecated since Gutenberg 10.0.0.
3673   *
3674   * @param {Object} state
3675   * @return {WPBlockSelection} The selection end.
3676   */
3677  function getEditorSelectionEnd(state) {
3678    external_wp_deprecated_default()("select('core/editor').getEditorSelectionStart", {
3679      since: '5.8',
3680      alternative: "select('core/editor').getEditorSelection"
3681    });
3682    return getEditedPostAttribute(state, 'selection')?.selectionEnd;
3683  }
3684  
3685  /**
3686   * Returns the current selection.
3687   *
3688   * @param {Object} state
3689   * @return {WPBlockSelection} The selection end.
3690   */
3691  function getEditorSelection(state) {
3692    return getEditedPostAttribute(state, 'selection');
3693  }
3694  
3695  /**
3696   * Is the editor ready
3697   *
3698   * @param {Object} state
3699   * @return {boolean} is Ready.
3700   */
3701  function __unstableIsEditorReady(state) {
3702    return !!state.postId;
3703  }
3704  
3705  /**
3706   * Returns the post editor settings.
3707   *
3708   * @param {Object} state Editor state.
3709   *
3710   * @return {Object} The editor settings object.
3711   */
3712  function getEditorSettings(state) {
3713    return state.editorSettings;
3714  }
3715  
3716  /**
3717   * Returns the post editor's rendering mode.
3718   *
3719   * @param {Object} state Editor state.
3720   *
3721   * @return {string} Rendering mode.
3722   */
3723  function getRenderingMode(state) {
3724    return state.renderingMode;
3725  }
3726  
3727  /**
3728   * Returns the current editing canvas device type.
3729   *
3730   * @param {Object} state Global application state.
3731   *
3732   * @return {string} Device type.
3733   */
3734  const getDeviceType = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
3735    const isZoomOut = unlock(select(external_wp_blockEditor_namespaceObject.store)).isZoomOut();
3736    if (isZoomOut) {
3737      return 'Desktop';
3738    }
3739    return state.deviceType;
3740  });
3741  
3742  /**
3743   * Returns true if the list view is opened.
3744   *
3745   * @param {Object} state Global application state.
3746   *
3747   * @return {boolean} Whether the list view is opened.
3748   */
3749  function isListViewOpened(state) {
3750    return state.listViewPanel;
3751  }
3752  
3753  /**
3754   * Returns true if the inserter is opened.
3755   *
3756   * @param {Object} state Global application state.
3757   *
3758   * @return {boolean} Whether the inserter is opened.
3759   */
3760  function isInserterOpened(state) {
3761    return !!state.blockInserterPanel;
3762  }
3763  
3764  /**
3765   * Returns the current editing mode.
3766   *
3767   * @param {Object} state Global application state.
3768   *
3769   * @return {string} Editing mode.
3770   */
3771  const getEditorMode = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
3772    var _select$get;
3773    return (_select$get = select(external_wp_preferences_namespaceObject.store).get('core', 'editorMode')) !== null && _select$get !== void 0 ? _select$get : 'visual';
3774  });
3775  
3776  /*
3777   * Backward compatibility
3778   */
3779  
3780  /**
3781   * Returns state object prior to a specified optimist transaction ID, or `null`
3782   * if the transaction corresponding to the given ID cannot be found.
3783   *
3784   * @deprecated since Gutenberg 9.7.0.
3785   */
3786  function getStateBeforeOptimisticTransaction() {
3787    external_wp_deprecated_default()("select('core/editor').getStateBeforeOptimisticTransaction", {
3788      since: '5.7',
3789      hint: 'No state history is kept on this store anymore'
3790    });
3791    return null;
3792  }
3793  /**
3794   * Returns true if an optimistic transaction is pending commit, for which the
3795   * before state satisfies the given predicate function.
3796   *
3797   * @deprecated since Gutenberg 9.7.0.
3798   */
3799  function inSomeHistory() {
3800    external_wp_deprecated_default()("select('core/editor').inSomeHistory", {
3801      since: '5.7',
3802      hint: 'No state history is kept on this store anymore'
3803    });
3804    return false;
3805  }
3806  function getBlockEditorSelector(name) {
3807    return (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, ...args) => {
3808      external_wp_deprecated_default()("`wp.data.select( 'core/editor' )." + name + '`', {
3809        since: '5.3',
3810        alternative: "`wp.data.select( 'core/block-editor' )." + name + '`',
3811        version: '6.2'
3812      });
3813      return select(external_wp_blockEditor_namespaceObject.store)[name](...args);
3814    });
3815  }
3816  
3817  /**
3818   * @see getBlockName in core/block-editor store.
3819   */
3820  const getBlockName = getBlockEditorSelector('getBlockName');
3821  
3822  /**
3823   * @see isBlockValid in core/block-editor store.
3824   */
3825  const isBlockValid = getBlockEditorSelector('isBlockValid');
3826  
3827  /**
3828   * @see getBlockAttributes in core/block-editor store.
3829   */
3830  const getBlockAttributes = getBlockEditorSelector('getBlockAttributes');
3831  
3832  /**
3833   * @see getBlock in core/block-editor store.
3834   */
3835  const getBlock = getBlockEditorSelector('getBlock');
3836  
3837  /**
3838   * @see getBlocks in core/block-editor store.
3839   */
3840  const getBlocks = getBlockEditorSelector('getBlocks');
3841  
3842  /**
3843   * @see getClientIdsOfDescendants in core/block-editor store.
3844   */
3845  const getClientIdsOfDescendants = getBlockEditorSelector('getClientIdsOfDescendants');
3846  
3847  /**
3848   * @see getClientIdsWithDescendants in core/block-editor store.
3849   */
3850  const getClientIdsWithDescendants = getBlockEditorSelector('getClientIdsWithDescendants');
3851  
3852  /**
3853   * @see getGlobalBlockCount in core/block-editor store.
3854   */
3855  const getGlobalBlockCount = getBlockEditorSelector('getGlobalBlockCount');
3856  
3857  /**
3858   * @see getBlocksByClientId in core/block-editor store.
3859   */
3860  const getBlocksByClientId = getBlockEditorSelector('getBlocksByClientId');
3861  
3862  /**
3863   * @see getBlockCount in core/block-editor store.
3864   */
3865  const getBlockCount = getBlockEditorSelector('getBlockCount');
3866  
3867  /**
3868   * @see getBlockSelectionStart in core/block-editor store.
3869   */
3870  const getBlockSelectionStart = getBlockEditorSelector('getBlockSelectionStart');
3871  
3872  /**
3873   * @see getBlockSelectionEnd in core/block-editor store.
3874   */
3875  const getBlockSelectionEnd = getBlockEditorSelector('getBlockSelectionEnd');
3876  
3877  /**
3878   * @see getSelectedBlockCount in core/block-editor store.
3879   */
3880  const getSelectedBlockCount = getBlockEditorSelector('getSelectedBlockCount');
3881  
3882  /**
3883   * @see hasSelectedBlock in core/block-editor store.
3884   */
3885  const hasSelectedBlock = getBlockEditorSelector('hasSelectedBlock');
3886  
3887  /**
3888   * @see getSelectedBlockClientId in core/block-editor store.
3889   */
3890  const getSelectedBlockClientId = getBlockEditorSelector('getSelectedBlockClientId');
3891  
3892  /**
3893   * @see getSelectedBlock in core/block-editor store.
3894   */
3895  const getSelectedBlock = getBlockEditorSelector('getSelectedBlock');
3896  
3897  /**
3898   * @see getBlockRootClientId in core/block-editor store.
3899   */
3900  const getBlockRootClientId = getBlockEditorSelector('getBlockRootClientId');
3901  
3902  /**
3903   * @see getBlockHierarchyRootClientId in core/block-editor store.
3904   */
3905  const getBlockHierarchyRootClientId = getBlockEditorSelector('getBlockHierarchyRootClientId');
3906  
3907  /**
3908   * @see getAdjacentBlockClientId in core/block-editor store.
3909   */
3910  const getAdjacentBlockClientId = getBlockEditorSelector('getAdjacentBlockClientId');
3911  
3912  /**
3913   * @see getPreviousBlockClientId in core/block-editor store.
3914   */
3915  const getPreviousBlockClientId = getBlockEditorSelector('getPreviousBlockClientId');
3916  
3917  /**
3918   * @see getNextBlockClientId in core/block-editor store.
3919   */
3920  const getNextBlockClientId = getBlockEditorSelector('getNextBlockClientId');
3921  
3922  /**
3923   * @see getSelectedBlocksInitialCaretPosition in core/block-editor store.
3924   */
3925  const getSelectedBlocksInitialCaretPosition = getBlockEditorSelector('getSelectedBlocksInitialCaretPosition');
3926  
3927  /**
3928   * @see getMultiSelectedBlockClientIds in core/block-editor store.
3929   */
3930  const getMultiSelectedBlockClientIds = getBlockEditorSelector('getMultiSelectedBlockClientIds');
3931  
3932  /**
3933   * @see getMultiSelectedBlocks in core/block-editor store.
3934   */
3935  const getMultiSelectedBlocks = getBlockEditorSelector('getMultiSelectedBlocks');
3936  
3937  /**
3938   * @see getFirstMultiSelectedBlockClientId in core/block-editor store.
3939   */
3940  const getFirstMultiSelectedBlockClientId = getBlockEditorSelector('getFirstMultiSelectedBlockClientId');
3941  
3942  /**
3943   * @see getLastMultiSelectedBlockClientId in core/block-editor store.
3944   */
3945  const getLastMultiSelectedBlockClientId = getBlockEditorSelector('getLastMultiSelectedBlockClientId');
3946  
3947  /**
3948   * @see isFirstMultiSelectedBlock in core/block-editor store.
3949   */
3950  const isFirstMultiSelectedBlock = getBlockEditorSelector('isFirstMultiSelectedBlock');
3951  
3952  /**
3953   * @see isBlockMultiSelected in core/block-editor store.
3954   */
3955  const isBlockMultiSelected = getBlockEditorSelector('isBlockMultiSelected');
3956  
3957  /**
3958   * @see isAncestorMultiSelected in core/block-editor store.
3959   */
3960  const isAncestorMultiSelected = getBlockEditorSelector('isAncestorMultiSelected');
3961  
3962  /**
3963   * @see getMultiSelectedBlocksStartClientId in core/block-editor store.
3964   */
3965  const getMultiSelectedBlocksStartClientId = getBlockEditorSelector('getMultiSelectedBlocksStartClientId');
3966  
3967  /**
3968   * @see getMultiSelectedBlocksEndClientId in core/block-editor store.
3969   */
3970  const getMultiSelectedBlocksEndClientId = getBlockEditorSelector('getMultiSelectedBlocksEndClientId');
3971  
3972  /**
3973   * @see getBlockOrder in core/block-editor store.
3974   */
3975  const getBlockOrder = getBlockEditorSelector('getBlockOrder');
3976  
3977  /**
3978   * @see getBlockIndex in core/block-editor store.
3979   */
3980  const getBlockIndex = getBlockEditorSelector('getBlockIndex');
3981  
3982  /**
3983   * @see isBlockSelected in core/block-editor store.
3984   */
3985  const isBlockSelected = getBlockEditorSelector('isBlockSelected');
3986  
3987  /**
3988   * @see hasSelectedInnerBlock in core/block-editor store.
3989   */
3990  const hasSelectedInnerBlock = getBlockEditorSelector('hasSelectedInnerBlock');
3991  
3992  /**
3993   * @see isBlockWithinSelection in core/block-editor store.
3994   */
3995  const isBlockWithinSelection = getBlockEditorSelector('isBlockWithinSelection');
3996  
3997  /**
3998   * @see hasMultiSelection in core/block-editor store.
3999   */
4000  const hasMultiSelection = getBlockEditorSelector('hasMultiSelection');
4001  
4002  /**
4003   * @see isMultiSelecting in core/block-editor store.
4004   */
4005  const isMultiSelecting = getBlockEditorSelector('isMultiSelecting');
4006  
4007  /**
4008   * @see isSelectionEnabled in core/block-editor store.
4009   */
4010  const isSelectionEnabled = getBlockEditorSelector('isSelectionEnabled');
4011  
4012  /**
4013   * @see getBlockMode in core/block-editor store.
4014   */
4015  const getBlockMode = getBlockEditorSelector('getBlockMode');
4016  
4017  /**
4018   * @see isTyping in core/block-editor store.
4019   */
4020  const isTyping = getBlockEditorSelector('isTyping');
4021  
4022  /**
4023   * @see isCaretWithinFormattedText in core/block-editor store.
4024   */
4025  const isCaretWithinFormattedText = getBlockEditorSelector('isCaretWithinFormattedText');
4026  
4027  /**
4028   * @see getBlockInsertionPoint in core/block-editor store.
4029   */
4030  const getBlockInsertionPoint = getBlockEditorSelector('getBlockInsertionPoint');
4031  
4032  /**
4033   * @see isBlockInsertionPointVisible in core/block-editor store.
4034   */
4035  const isBlockInsertionPointVisible = getBlockEditorSelector('isBlockInsertionPointVisible');
4036  
4037  /**
4038   * @see isValidTemplate in core/block-editor store.
4039   */
4040  const isValidTemplate = getBlockEditorSelector('isValidTemplate');
4041  
4042  /**
4043   * @see getTemplate in core/block-editor store.
4044   */
4045  const getTemplate = getBlockEditorSelector('getTemplate');
4046  
4047  /**
4048   * @see getTemplateLock in core/block-editor store.
4049   */
4050  const getTemplateLock = getBlockEditorSelector('getTemplateLock');
4051  
4052  /**
4053   * @see canInsertBlockType in core/block-editor store.
4054   */
4055  const canInsertBlockType = getBlockEditorSelector('canInsertBlockType');
4056  
4057  /**
4058   * @see getInserterItems in core/block-editor store.
4059   */
4060  const getInserterItems = getBlockEditorSelector('getInserterItems');
4061  
4062  /**
4063   * @see hasInserterItems in core/block-editor store.
4064   */
4065  const hasInserterItems = getBlockEditorSelector('hasInserterItems');
4066  
4067  /**
4068   * @see getBlockListSettings in core/block-editor store.
4069   */
4070  const getBlockListSettings = getBlockEditorSelector('getBlockListSettings');
4071  const __experimentalGetDefaultTemplateTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
4072    external_wp_deprecated_default()("select('core/editor').__experimentalGetDefaultTemplateTypes", {
4073      since: '6.8',
4074      alternative: "select('core/core-data').getCurrentTheme()?.default_template_types"
4075    });
4076    return select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_types;
4077  });
4078  
4079  /**
4080   * Returns the default template part areas.
4081   *
4082   * @param {Object} state Global application state.
4083   *
4084   * @return {Array} The template part areas.
4085   */
4086  const __experimentalGetDefaultTemplatePartAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)(() => {
4087    external_wp_deprecated_default()("select('core/editor').__experimentalGetDefaultTemplatePartAreas", {
4088      since: '6.8',
4089      alternative: "select('core/core-data').getCurrentTheme()?.default_template_part_areas"
4090    });
4091    const areas = select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_part_areas || [];
4092    return areas.map(item => {
4093      return {
4094        ...item,
4095        icon: getTemplatePartIcon(item.icon)
4096      };
4097    });
4098  }));
4099  
4100  /**
4101   * Returns a default template type searched by slug.
4102   *
4103   * @param {Object} state Global application state.
4104   * @param {string} slug  The template type slug.
4105   *
4106   * @return {Object} The template type.
4107   */
4108  const __experimentalGetDefaultTemplateType = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, slug) => {
4109    var _Object$values$find;
4110    external_wp_deprecated_default()("select('core/editor').__experimentalGetDefaultTemplateType", {
4111      since: '6.8'
4112    });
4113    const templateTypes = select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_types;
4114    if (!templateTypes) {
4115      return selectors_EMPTY_OBJECT;
4116    }
4117    return (_Object$values$find = Object.values(templateTypes).find(type => type.slug === slug)) !== null && _Object$values$find !== void 0 ? _Object$values$find : selectors_EMPTY_OBJECT;
4118  }));
4119  
4120  /**
4121   * Given a template entity, return information about it which is ready to be
4122   * rendered, such as the title, description, and icon.
4123   *
4124   * @param {Object} state    Global application state.
4125   * @param {Object} template The template for which we need information.
4126   * @return {Object} Information about the template, including title, description, and icon.
4127   */
4128  const __experimentalGetTemplateInfo = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, template) => {
4129    external_wp_deprecated_default()("select('core/editor').__experimentalGetTemplateInfo", {
4130      since: '6.8'
4131    });
4132    if (!template) {
4133      return selectors_EMPTY_OBJECT;
4134    }
4135    const currentTheme = select(external_wp_coreData_namespaceObject.store).getCurrentTheme();
4136    const templateTypes = currentTheme?.default_template_types || [];
4137    const templateAreas = currentTheme?.default_template_part_areas || [];
4138    return getTemplateInfo({
4139      template,
4140      templateAreas,
4141      templateTypes
4142    });
4143  }));
4144  
4145  /**
4146   * Returns a post type label depending on the current post.
4147   *
4148   * @param {Object} state Global application state.
4149   *
4150   * @return {string|undefined} The post type label if available, otherwise undefined.
4151   */
4152  const getPostTypeLabel = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
4153    const currentPostType = getCurrentPostType(state);
4154    const postType = select(external_wp_coreData_namespaceObject.store).getPostType(currentPostType);
4155    // Disable reason: Post type labels object is shaped like this.
4156    // eslint-disable-next-line camelcase
4157    return postType?.labels?.singular_name;
4158  });
4159  
4160  /**
4161   * Returns true if the publish sidebar is opened.
4162   *
4163   * @param {Object} state Global application state
4164   *
4165   * @return {boolean} Whether the publish sidebar is open.
4166   */
4167  function isPublishSidebarOpened(state) {
4168    return state.publishSidebarActive;
4169  }
4170  
4171  ;// external ["wp","a11y"]
4172  const external_wp_a11y_namespaceObject = window["wp"]["a11y"];
4173  ;// external ["wp","apiFetch"]
4174  const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
4175  var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
4176  ;// external ["wp","notices"]
4177  const external_wp_notices_namespaceObject = window["wp"]["notices"];
4178  ;// external ["wp","i18n"]
4179  const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
4180  ;// ./node_modules/@wordpress/editor/build-module/store/local-autosave.js
4181  /**
4182   * Function returning a sessionStorage key to set or retrieve a given post's
4183   * automatic session backup.
4184   *
4185   * Keys are crucially prefixed with 'wp-autosave-' so that wp-login.php's
4186   * `loggedout` handler can clear sessionStorage of any user-private content.
4187   *
4188   * @see https://github.com/WordPress/wordpress-develop/blob/6dad32d2aed47e6c0cf2aee8410645f6d7aba6bd/src/wp-login.php#L103
4189   *
4190   * @param {string}  postId    Post ID.
4191   * @param {boolean} isPostNew Whether post new.
4192   *
4193   * @return {string} sessionStorage key
4194   */
4195  function postKey(postId, isPostNew) {
4196    return `wp-autosave-block-editor-post-$isPostNew ? 'auto-draft' : postId}`;
4197  }
4198  function localAutosaveGet(postId, isPostNew) {
4199    return window.sessionStorage.getItem(postKey(postId, isPostNew));
4200  }
4201  function localAutosaveSet(postId, isPostNew, title, content, excerpt) {
4202    window.sessionStorage.setItem(postKey(postId, isPostNew), JSON.stringify({
4203      post_title: title,
4204      content,
4205      excerpt
4206    }));
4207  }
4208  function localAutosaveClear(postId, isPostNew) {
4209    window.sessionStorage.removeItem(postKey(postId, isPostNew));
4210  }
4211  
4212  ;// ./node_modules/@wordpress/editor/build-module/store/utils/notice-builder.js
4213  /**
4214   * WordPress dependencies
4215   */
4216  
4217  
4218  /**
4219   * Builds the arguments for a success notification dispatch.
4220   *
4221   * @param {Object} data Incoming data to build the arguments from.
4222   *
4223   * @return {Array} Arguments for dispatch. An empty array signals no
4224   *                 notification should be sent.
4225   */
4226  function getNotificationArgumentsForSaveSuccess(data) {
4227    var _postType$viewable;
4228    const {
4229      previousPost,
4230      post,
4231      postType
4232    } = data;
4233    // Autosaves are neither shown a notice nor redirected.
4234    if (data.options?.isAutosave) {
4235      return [];
4236    }
4237    const publishStatus = ['publish', 'private', 'future'];
4238    const isPublished = publishStatus.includes(previousPost.status);
4239    const willPublish = publishStatus.includes(post.status);
4240    const willTrash = post.status === 'trash' && previousPost.status !== 'trash';
4241    let noticeMessage;
4242    let shouldShowLink = (_postType$viewable = postType?.viewable) !== null && _postType$viewable !== void 0 ? _postType$viewable : false;
4243    let isDraft;
4244  
4245    // Always should a notice, which will be spoken for accessibility.
4246    if (willTrash) {
4247      noticeMessage = postType.labels.item_trashed;
4248      shouldShowLink = false;
4249    } else if (!isPublished && !willPublish) {
4250      // If saving a non-published post, don't show notice.
4251      noticeMessage = (0,external_wp_i18n_namespaceObject.__)('Draft saved.');
4252      isDraft = true;
4253    } else if (isPublished && !willPublish) {
4254      // If undoing publish status, show specific notice.
4255      noticeMessage = postType.labels.item_reverted_to_draft;
4256      shouldShowLink = false;
4257    } else if (!isPublished && willPublish) {
4258      // If publishing or scheduling a post, show the corresponding
4259      // publish message.
4260      noticeMessage = {
4261        publish: postType.labels.item_published,
4262        private: postType.labels.item_published_privately,
4263        future: postType.labels.item_scheduled
4264      }[post.status];
4265    } else {
4266      // Generic fallback notice.
4267      noticeMessage = postType.labels.item_updated;
4268    }
4269    const actions = [];
4270    if (shouldShowLink) {
4271      actions.push({
4272        label: isDraft ? (0,external_wp_i18n_namespaceObject.__)('View Preview') : postType.labels.view_item,
4273        url: post.link
4274      });
4275    }
4276    return [noticeMessage, {
4277      id: 'editor-save',
4278      type: 'snackbar',
4279      actions
4280    }];
4281  }
4282  
4283  /**
4284   * Builds the fail notification arguments for dispatch.
4285   *
4286   * @param {Object} data Incoming data to build the arguments with.
4287   *
4288   * @return {Array} Arguments for dispatch. An empty array signals no
4289   *                 notification should be sent.
4290   */
4291  function getNotificationArgumentsForSaveFail(data) {
4292    const {
4293      post,
4294      edits,
4295      error
4296    } = data;
4297    if (error && 'rest_autosave_no_changes' === error.code) {
4298      // Autosave requested a new autosave, but there were no changes. This shouldn't
4299      // result in an error notice for the user.
4300      return [];
4301    }
4302    const publishStatus = ['publish', 'private', 'future'];
4303    const isPublished = publishStatus.indexOf(post.status) !== -1;
4304    // If the post was being published, we show the corresponding publish error message
4305    // Unless we publish an "updating failed" message.
4306    const messages = {
4307      publish: (0,external_wp_i18n_namespaceObject.__)('Publishing failed.'),
4308      private: (0,external_wp_i18n_namespaceObject.__)('Publishing failed.'),
4309      future: (0,external_wp_i18n_namespaceObject.__)('Scheduling failed.')
4310    };
4311    let noticeMessage = !isPublished && publishStatus.indexOf(edits.status) !== -1 ? messages[edits.status] : (0,external_wp_i18n_namespaceObject.__)('Updating failed.');
4312  
4313    // Check if message string contains HTML. Notice text is currently only
4314    // supported as plaintext, and stripping the tags may muddle the meaning.
4315    if (error.message && !/<\/?[^>]*>/.test(error.message)) {
4316      noticeMessage = [noticeMessage, error.message].join(' ');
4317    }
4318    return [noticeMessage, {
4319      id: 'editor-save'
4320    }];
4321  }
4322  
4323  /**
4324   * Builds the trash fail notification arguments for dispatch.
4325   *
4326   * @param {Object} data
4327   *
4328   * @return {Array} Arguments for dispatch.
4329   */
4330  function getNotificationArgumentsForTrashFail(data) {
4331    return [data.error.message && data.error.code !== 'unknown_error' ? data.error.message : (0,external_wp_i18n_namespaceObject.__)('Trashing failed'), {
4332      id: 'editor-trash-fail'
4333    }];
4334  }
4335  
4336  ;// ./node_modules/@wordpress/editor/build-module/store/actions.js
4337  /**
4338   * WordPress dependencies
4339   */
4340  
4341  
4342  
4343  
4344  
4345  
4346  
4347  
4348  
4349  
4350  
4351  /**
4352   * Internal dependencies
4353   */
4354  
4355  
4356  
4357  /**
4358   * Returns an action generator used in signalling that editor has initialized with
4359   * the specified post object and editor settings.
4360   *
4361   * @param {Object} post       Post object.
4362   * @param {Object} edits      Initial edited attributes object.
4363   * @param {Array}  [template] Block Template.
4364   */
4365  const setupEditor = (post, edits, template) => ({
4366    dispatch
4367  }) => {
4368    dispatch.setEditedPost(post.type, post.id);
4369    // Apply a template for new posts only, if exists.
4370    const isNewPost = post.status === 'auto-draft';
4371    if (isNewPost && template) {
4372      // In order to ensure maximum of a single parse during setup, edits are
4373      // included as part of editor setup action. Assume edited content as
4374      // canonical if provided, falling back to post.
4375      let content;
4376      if ('content' in edits) {
4377        content = edits.content;
4378      } else {
4379        content = post.content.raw;
4380      }
4381      let blocks = (0,external_wp_blocks_namespaceObject.parse)(content);
4382      blocks = (0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)(blocks, template);
4383      dispatch.resetEditorBlocks(blocks, {
4384        __unstableShouldCreateUndoLevel: false
4385      });
4386    }
4387    if (edits && Object.values(edits).some(([key, edit]) => {
4388      var _post$key$raw;
4389      return edit !== ((_post$key$raw = post[key]?.raw) !== null && _post$key$raw !== void 0 ? _post$key$raw : post[key]);
4390    })) {
4391      dispatch.editPost(edits);
4392    }
4393  };
4394  
4395  /**
4396   * Returns an action object signalling that the editor is being destroyed and
4397   * that any necessary state or side-effect cleanup should occur.
4398   *
4399   * @deprecated
4400   *
4401   * @return {Object} Action object.
4402   */
4403  function __experimentalTearDownEditor() {
4404    external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor", {
4405      since: '6.5'
4406    });
4407    return {
4408      type: 'DO_NOTHING'
4409    };
4410  }
4411  
4412  /**
4413   * Returns an action object used in signalling that the latest version of the
4414   * post has been received, either by initialization or save.
4415   *
4416   * @deprecated Since WordPress 6.0.
4417   */
4418  function resetPost() {
4419    external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).resetPost", {
4420      since: '6.0',
4421      version: '6.3',
4422      alternative: 'Initialize the editor with the setupEditorState action'
4423    });
4424    return {
4425      type: 'DO_NOTHING'
4426    };
4427  }
4428  
4429  /**
4430   * Returns an action object used in signalling that a patch of updates for the
4431   * latest version of the post have been received.
4432   *
4433   * @return {Object} Action object.
4434   * @deprecated since Gutenberg 9.7.0.
4435   */
4436  function updatePost() {
4437    external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).updatePost", {
4438      since: '5.7',
4439      alternative: 'Use the core entities store instead'
4440    });
4441    return {
4442      type: 'DO_NOTHING'
4443    };
4444  }
4445  
4446  /**
4447   * Setup the editor state.
4448   *
4449   * @deprecated
4450   *
4451   * @param {Object} post Post object.
4452   */
4453  function setupEditorState(post) {
4454    external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).setupEditorState", {
4455      since: '6.5',
4456      alternative: "wp.data.dispatch( 'core/editor' ).setEditedPost"
4457    });
4458    return setEditedPost(post.type, post.id);
4459  }
4460  
4461  /**
4462   * Returns an action that sets the current post Type and post ID.
4463   *
4464   * @param {string} postType Post Type.
4465   * @param {string} postId   Post ID.
4466   *
4467   * @return {Object} Action object.
4468   */
4469  function setEditedPost(postType, postId) {
4470    return {
4471      type: 'SET_EDITED_POST',
4472      postType,
4473      postId
4474    };
4475  }
4476  
4477  /**
4478   * Returns an action object used in signalling that attributes of the post have
4479   * been edited.
4480   *
4481   * @param {Object} edits     Post attributes to edit.
4482   * @param {Object} [options] Options for the edit.
4483   *
4484   * @example
4485   * ```js
4486   * // Update the post title
4487   * wp.data.dispatch( 'core/editor' ).editPost( { title: `${ newTitle }` } );
4488   * ```
4489   *
4490   * @example
4491   *```js
4492   *     // Get specific media size based on the featured media ID
4493   *     // Note: change sizes?.large for any registered size
4494   *     const getFeaturedMediaUrl = useSelect( ( select ) => {
4495   *         const getFeaturedMediaId =
4496   *             select( 'core/editor' ).getEditedPostAttribute( 'featured_media' );
4497   *         const getMedia = select( 'core' ).getMedia( getFeaturedMediaId );
4498   *
4499   *         return (
4500   *             getMedia?.media_details?.sizes?.large?.source_url || getMedia?.source_url || ''
4501   *         );
4502   * }, [] );
4503   * ```
4504   *
4505   * @return {Object} Action object
4506   */
4507  const editPost = (edits, options) => ({
4508    select,
4509    registry
4510  }) => {
4511    const {
4512      id,
4513      type
4514    } = select.getCurrentPost();
4515    registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', type, id, edits, options);
4516  };
4517  
4518  /**
4519   * Action for saving the current post in the editor.
4520   *
4521   * @param {Object} [options]
4522   */
4523  const savePost = (options = {}) => async ({
4524    select,
4525    dispatch,
4526    registry
4527  }) => {
4528    if (!select.isEditedPostSaveable()) {
4529      return;
4530    }
4531    const content = select.getEditedPostContent();
4532    if (!options.isAutosave) {
4533      dispatch.editPost({
4534        content
4535      }, {
4536        undoIgnore: true
4537      });
4538    }
4539    const previousRecord = select.getCurrentPost();
4540    let edits = {
4541      id: previousRecord.id,
4542      ...registry.select(external_wp_coreData_namespaceObject.store).getEntityRecordNonTransientEdits('postType', previousRecord.type, previousRecord.id),
4543      content
4544    };
4545    dispatch({
4546      type: 'REQUEST_POST_UPDATE_START',
4547      options
4548    });
4549    let error = false;
4550    try {
4551      edits = await (0,external_wp_hooks_namespaceObject.applyFiltersAsync)('editor.preSavePost', edits, options);
4552    } catch (err) {
4553      error = err;
4554    }
4555    if (!error) {
4556      try {
4557        await registry.dispatch(external_wp_coreData_namespaceObject.store).saveEntityRecord('postType', previousRecord.type, edits, options);
4558      } catch (err) {
4559        error = err.message && err.code !== 'unknown_error' ? err.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while updating.');
4560      }
4561    }
4562    if (!error) {
4563      error = registry.select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError('postType', previousRecord.type, previousRecord.id);
4564    }
4565  
4566    // Run the hook with legacy unstable name for backward compatibility
4567    if (!error) {
4568      try {
4569        await (0,external_wp_hooks_namespaceObject.applyFilters)('editor.__unstableSavePost', Promise.resolve(), options);
4570      } catch (err) {
4571        error = err;
4572      }
4573    }
4574    if (!error) {
4575      try {
4576        await (0,external_wp_hooks_namespaceObject.doActionAsync)('editor.savePost', {
4577          id: previousRecord.id
4578        }, options);
4579      } catch (err) {
4580        error = err;
4581      }
4582    }
4583    dispatch({
4584      type: 'REQUEST_POST_UPDATE_FINISH',
4585      options
4586    });
4587    if (error) {
4588      const args = getNotificationArgumentsForSaveFail({
4589        post: previousRecord,
4590        edits,
4591        error
4592      });
4593      if (args.length) {
4594        registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(...args);
4595      }
4596    } else {
4597      const updatedRecord = select.getCurrentPost();
4598      const args = getNotificationArgumentsForSaveSuccess({
4599        previousPost: previousRecord,
4600        post: updatedRecord,
4601        postType: await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getPostType(updatedRecord.type),
4602        options
4603      });
4604      if (args.length) {
4605        registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice(...args);
4606      }
4607      // Make sure that any edits after saving create an undo level and are
4608      // considered for change detection.
4609      if (!options.isAutosave) {
4610        registry.dispatch(external_wp_blockEditor_namespaceObject.store).__unstableMarkLastChangeAsPersistent();
4611      }
4612    }
4613  };
4614  
4615  /**
4616   * Action for refreshing the current post.
4617   *
4618   * @deprecated Since WordPress 6.0.
4619   */
4620  function refreshPost() {
4621    external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).refreshPost", {
4622      since: '6.0',
4623      version: '6.3',
4624      alternative: 'Use the core entities store instead'
4625    });
4626    return {
4627      type: 'DO_NOTHING'
4628    };
4629  }
4630  
4631  /**
4632   * Action for trashing the current post in the editor.
4633   */
4634  const trashPost = () => async ({
4635    select,
4636    dispatch,
4637    registry
4638  }) => {
4639    const postTypeSlug = select.getCurrentPostType();
4640    const postType = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug);
4641    const {
4642      rest_base: restBase,
4643      rest_namespace: restNamespace = 'wp/v2'
4644    } = postType;
4645    dispatch({
4646      type: 'REQUEST_POST_DELETE_START'
4647    });
4648    try {
4649      const post = select.getCurrentPost();
4650      await external_wp_apiFetch_default()({
4651        path: `/$restNamespace}/$restBase}/$post.id}`,
4652        method: 'DELETE'
4653      });
4654      await dispatch.savePost();
4655    } catch (error) {
4656      registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(...getNotificationArgumentsForTrashFail({
4657        error
4658      }));
4659    }
4660    dispatch({
4661      type: 'REQUEST_POST_DELETE_FINISH'
4662    });
4663  };
4664  
4665  /**
4666   * Action that autosaves the current post.  This
4667   * includes server-side autosaving (default) and client-side (a.k.a. local)
4668   * autosaving (e.g. on the Web, the post might be committed to Session
4669   * Storage).
4670   *
4671   * @param {Object}  [options]       Extra flags to identify the autosave.
4672   * @param {boolean} [options.local] Whether to perform a local autosave.
4673   */
4674  const autosave = ({
4675    local = false,
4676    ...options
4677  } = {}) => async ({
4678    select,
4679    dispatch
4680  }) => {
4681    const post = select.getCurrentPost();
4682  
4683    // Currently template autosaving is not supported.
4684    if (post.type === 'wp_template') {
4685      return;
4686    }
4687    if (local) {
4688      const isPostNew = select.isEditedPostNew();
4689      const title = select.getEditedPostAttribute('title');
4690      const content = select.getEditedPostAttribute('content');
4691      const excerpt = select.getEditedPostAttribute('excerpt');
4692      localAutosaveSet(post.id, isPostNew, title, content, excerpt);
4693    } else {
4694      await dispatch.savePost({
4695        isAutosave: true,
4696        ...options
4697      });
4698    }
4699  };
4700  const __unstableSaveForPreview = ({
4701    forceIsAutosaveable
4702  } = {}) => async ({
4703    select,
4704    dispatch
4705  }) => {
4706    if ((forceIsAutosaveable || select.isEditedPostAutosaveable()) && !select.isPostLocked()) {
4707      const isDraft = ['draft', 'auto-draft'].includes(select.getEditedPostAttribute('status'));
4708      if (isDraft) {
4709        await dispatch.savePost({
4710          isPreview: true
4711        });
4712      } else {
4713        await dispatch.autosave({
4714          isPreview: true
4715        });
4716      }
4717    }
4718    return select.getEditedPostPreviewLink();
4719  };
4720  
4721  /**
4722   * Action that restores last popped state in undo history.
4723   */
4724  const redo = () => ({
4725    registry
4726  }) => {
4727    registry.dispatch(external_wp_coreData_namespaceObject.store).redo();
4728  };
4729  
4730  /**
4731   * Action that pops a record from undo history and undoes the edit.
4732   */
4733  const undo = () => ({
4734    registry
4735  }) => {
4736    registry.dispatch(external_wp_coreData_namespaceObject.store).undo();
4737  };
4738  
4739  /**
4740   * Action that creates an undo history record.
4741   *
4742   * @deprecated Since WordPress 6.0
4743   */
4744  function createUndoLevel() {
4745    external_wp_deprecated_default()("wp.data.dispatch( 'core/editor' ).createUndoLevel", {
4746      since: '6.0',
4747      version: '6.3',
4748      alternative: 'Use the core entities store instead'
4749    });
4750    return {
4751      type: 'DO_NOTHING'
4752    };
4753  }
4754  
4755  /**
4756   * Action that locks the editor.
4757   *
4758   * @param {Object} lock Details about the post lock status, user, and nonce.
4759   * @return {Object} Action object.
4760   */
4761  function updatePostLock(lock) {
4762    return {
4763      type: 'UPDATE_POST_LOCK',
4764      lock
4765    };
4766  }
4767  
4768  /**
4769   * Enable the publish sidebar.
4770   */
4771  const enablePublishSidebar = () => ({
4772    registry
4773  }) => {
4774    registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'isPublishSidebarEnabled', true);
4775  };
4776  
4777  /**
4778   * Disables the publish sidebar.
4779   */
4780  const disablePublishSidebar = () => ({
4781    registry
4782  }) => {
4783    registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'isPublishSidebarEnabled', false);
4784  };
4785  
4786  /**
4787   * Action that locks post saving.
4788   *
4789   * @param {string} lockName The lock name.
4790   *
4791   * @example
4792   * ```
4793   * const { subscribe } = wp.data;
4794   *
4795   * const initialPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );
4796   *
4797   * // Only allow publishing posts that are set to a future date.
4798   * if ( 'publish' !== initialPostStatus ) {
4799   *
4800   *     // Track locking.
4801   *     let locked = false;
4802   *
4803   *     // Watch for the publish event.
4804   *     let unssubscribe = subscribe( () => {
4805   *         const currentPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );
4806   *         if ( 'publish' !== currentPostStatus ) {
4807   *
4808   *             // Compare the post date to the current date, lock the post if the date isn't in the future.
4809   *             const postDate = new Date( wp.data.select( 'core/editor' ).getEditedPostAttribute( 'date' ) );
4810   *             const currentDate = new Date();
4811   *             if ( postDate.getTime() <= currentDate.getTime() ) {
4812   *                 if ( ! locked ) {
4813   *                     locked = true;
4814   *                     wp.data.dispatch( 'core/editor' ).lockPostSaving( 'futurelock' );
4815   *                 }
4816   *             } else {
4817   *                 if ( locked ) {
4818   *                     locked = false;
4819   *                     wp.data.dispatch( 'core/editor' ).unlockPostSaving( 'futurelock' );
4820   *                 }
4821   *             }
4822   *         }
4823   *     } );
4824   * }
4825   * ```
4826   *
4827   * @return {Object} Action object
4828   */
4829  function lockPostSaving(lockName) {
4830    return {
4831      type: 'LOCK_POST_SAVING',
4832      lockName
4833    };
4834  }
4835  
4836  /**
4837   * Action that unlocks post saving.
4838   *
4839   * @param {string} lockName The lock name.
4840   *
4841   * @example
4842   * ```
4843   * // Unlock post saving with the lock key `mylock`:
4844   * wp.data.dispatch( 'core/editor' ).unlockPostSaving( 'mylock' );
4845   * ```
4846   *
4847   * @return {Object} Action object
4848   */
4849  function unlockPostSaving(lockName) {
4850    return {
4851      type: 'UNLOCK_POST_SAVING',
4852      lockName
4853    };
4854  }
4855  
4856  /**
4857   * Action that locks post autosaving.
4858   *
4859   * @param {string} lockName The lock name.
4860   *
4861   * @example
4862   * ```
4863   * // Lock post autosaving with the lock key `mylock`:
4864   * wp.data.dispatch( 'core/editor' ).lockPostAutosaving( 'mylock' );
4865   * ```
4866   *
4867   * @return {Object} Action object
4868   */
4869  function lockPostAutosaving(lockName) {
4870    return {
4871      type: 'LOCK_POST_AUTOSAVING',
4872      lockName
4873    };
4874  }
4875  
4876  /**
4877   * Action that unlocks post autosaving.
4878   *
4879   * @param {string} lockName The lock name.
4880   *
4881   * @example
4882   * ```
4883   * // Unlock post saving with the lock key `mylock`:
4884   * wp.data.dispatch( 'core/editor' ).unlockPostAutosaving( 'mylock' );
4885   * ```
4886   *
4887   * @return {Object} Action object
4888   */
4889  function unlockPostAutosaving(lockName) {
4890    return {
4891      type: 'UNLOCK_POST_AUTOSAVING',
4892      lockName
4893    };
4894  }
4895  
4896  /**
4897   * Returns an action object used to signal that the blocks have been updated.
4898   *
4899   * @param {Array}  blocks    Block Array.
4900   * @param {Object} [options] Optional options.
4901   */
4902  const resetEditorBlocks = (blocks, options = {}) => ({
4903    select,
4904    dispatch,
4905    registry
4906  }) => {
4907    const {
4908      __unstableShouldCreateUndoLevel,
4909      selection
4910    } = options;
4911    const edits = {
4912      blocks,
4913      selection
4914    };
4915    if (__unstableShouldCreateUndoLevel !== false) {
4916      const {
4917        id,
4918        type
4919      } = select.getCurrentPost();
4920      const noChange = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', type, id).blocks === edits.blocks;
4921      if (noChange) {
4922        registry.dispatch(external_wp_coreData_namespaceObject.store).__unstableCreateUndoLevel('postType', type, id);
4923        return;
4924      }
4925  
4926      // We create a new function here on every persistent edit
4927      // to make sure the edit makes the post dirty and creates
4928      // a new undo level.
4929      edits.content = ({
4930        blocks: blocksForSerialization = []
4931      }) => (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization);
4932    }
4933    dispatch.editPost(edits);
4934  };
4935  
4936  /*
4937   * Returns an action object used in signalling that the post editor settings have been updated.
4938   *
4939   * @param {Object} settings Updated settings
4940   *
4941   * @return {Object} Action object
4942   */
4943  function updateEditorSettings(settings) {
4944    return {
4945      type: 'UPDATE_EDITOR_SETTINGS',
4946      settings
4947    };
4948  }
4949  
4950  /**
4951   * Returns an action used to set the rendering mode of the post editor. We support multiple rendering modes:
4952   *
4953   * -   `post-only`: This mode extracts the post blocks from the template and renders only those. The idea is to allow the user to edit the post/page in isolation without the wrapping template.
4954   * -   `template-locked`: This mode renders both the template and the post blocks but the template blocks are locked and can't be edited. The post blocks are editable.
4955   *
4956   * @param {string} mode Mode (one of 'post-only' or 'template-locked').
4957   */
4958  const setRenderingMode = mode => ({
4959    dispatch,
4960    registry,
4961    select
4962  }) => {
4963    if (select.__unstableIsEditorReady()) {
4964      // We clear the block selection but we also need to clear the selection from the core store.
4965      registry.dispatch(external_wp_blockEditor_namespaceObject.store).clearSelectedBlock();
4966      dispatch.editPost({
4967        selection: undefined
4968      }, {
4969        undoIgnore: true
4970      });
4971    }
4972    dispatch({
4973      type: 'SET_RENDERING_MODE',
4974      mode
4975    });
4976  };
4977  
4978  /**
4979   * Action that changes the width of the editing canvas.
4980   *
4981   * @param {string} deviceType
4982   *
4983   * @return {Object} Action object.
4984   */
4985  function setDeviceType(deviceType) {
4986    return {
4987      type: 'SET_DEVICE_TYPE',
4988      deviceType
4989    };
4990  }
4991  
4992  /**
4993   * Returns an action object used to enable or disable a panel in the editor.
4994   *
4995   * @param {string} panelName A string that identifies the panel to enable or disable.
4996   *
4997   * @return {Object} Action object.
4998   */
4999  const toggleEditorPanelEnabled = panelName => ({
5000    registry
5001  }) => {
5002    var _registry$select$get;
5003    const inactivePanels = (_registry$select$get = registry.select(external_wp_preferences_namespaceObject.store).get('core', 'inactivePanels')) !== null && _registry$select$get !== void 0 ? _registry$select$get : [];
5004    const isPanelInactive = !!inactivePanels?.includes(panelName);
5005  
5006    // If the panel is inactive, remove it to enable it, else add it to
5007    // make it inactive.
5008    let updatedInactivePanels;
5009    if (isPanelInactive) {
5010      updatedInactivePanels = inactivePanels.filter(invactivePanelName => invactivePanelName !== panelName);
5011    } else {
5012      updatedInactivePanels = [...inactivePanels, panelName];
5013    }
5014    registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'inactivePanels', updatedInactivePanels);
5015  };
5016  
5017  /**
5018   * Opens a closed panel and closes an open panel.
5019   *
5020   * @param {string} panelName A string that identifies the panel to open or close.
5021   */
5022  const toggleEditorPanelOpened = panelName => ({
5023    registry
5024  }) => {
5025    var _registry$select$get2;
5026    const openPanels = (_registry$select$get2 = registry.select(external_wp_preferences_namespaceObject.store).get('core', 'openPanels')) !== null && _registry$select$get2 !== void 0 ? _registry$select$get2 : [];
5027    const isPanelOpen = !!openPanels?.includes(panelName);
5028  
5029    // If the panel is open, remove it to close it, else add it to
5030    // make it open.
5031    let updatedOpenPanels;
5032    if (isPanelOpen) {
5033      updatedOpenPanels = openPanels.filter(openPanelName => openPanelName !== panelName);
5034    } else {
5035      updatedOpenPanels = [...openPanels, panelName];
5036    }
5037    registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'openPanels', updatedOpenPanels);
5038  };
5039  
5040  /**
5041   * Returns an action object used to remove a panel from the editor.
5042   *
5043   * @param {string} panelName A string that identifies the panel to remove.
5044   *
5045   * @return {Object} Action object.
5046   */
5047  function removeEditorPanel(panelName) {
5048    return {
5049      type: 'REMOVE_PANEL',
5050      panelName
5051    };
5052  }
5053  
5054  /**
5055   * Returns an action object used to open/close the inserter.
5056   *
5057   * @param {boolean|Object} value                Whether the inserter should be
5058   *                                              opened (true) or closed (false).
5059   *                                              To specify an insertion point,
5060   *                                              use an object.
5061   * @param {string}         value.rootClientId   The root client ID to insert at.
5062   * @param {number}         value.insertionIndex The index to insert at.
5063   * @param {string}         value.filterValue    A query to filter the inserter results.
5064   * @param {Function}       value.onSelect       A callback when an item is selected.
5065   * @param {string}         value.tab            The tab to open in the inserter.
5066   * @param {string}         value.category       The category to initialize in the inserter.
5067   *
5068   * @return {Object} Action object.
5069   */
5070  const setIsInserterOpened = value => ({
5071    dispatch,
5072    registry
5073  }) => {
5074    if (typeof value === 'object' && value.hasOwnProperty('rootClientId') && value.hasOwnProperty('insertionIndex')) {
5075      unlock(registry.dispatch(external_wp_blockEditor_namespaceObject.store)).setInsertionPoint({
5076        rootClientId: value.rootClientId,
5077        index: value.insertionIndex
5078      });
5079    }
5080    dispatch({
5081      type: 'SET_IS_INSERTER_OPENED',
5082      value
5083    });
5084  };
5085  
5086  /**
5087   * Returns an action object used to open/close the list view.
5088   *
5089   * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.
5090   * @return {Object} Action object.
5091   */
5092  function setIsListViewOpened(isOpen) {
5093    return {
5094      type: 'SET_IS_LIST_VIEW_OPENED',
5095      isOpen
5096    };
5097  }
5098  
5099  /**
5100   * Action that toggles Distraction free mode.
5101   * Distraction free mode expects there are no sidebars, as due to the
5102   * z-index values set, you can't close sidebars.
5103   *
5104   * @param {Object}  [options={}]                Optional configuration object
5105   * @param {boolean} [options.createNotice=true] Whether to create a notice
5106   */
5107  const toggleDistractionFree = ({
5108    createNotice = true
5109  } = {}) => ({
5110    dispatch,
5111    registry
5112  }) => {
5113    const isDistractionFree = registry.select(external_wp_preferences_namespaceObject.store).get('core', 'distractionFree');
5114    if (isDistractionFree) {
5115      registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'fixedToolbar', false);
5116    }
5117    if (!isDistractionFree) {
5118      registry.batch(() => {
5119        registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'fixedToolbar', true);
5120        dispatch.setIsInserterOpened(false);
5121        dispatch.setIsListViewOpened(false);
5122        unlock(registry.dispatch(external_wp_blockEditor_namespaceObject.store)).resetZoomLevel();
5123      });
5124    }
5125    registry.batch(() => {
5126      registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'distractionFree', !isDistractionFree);
5127      if (createNotice) {
5128        registry.dispatch(external_wp_notices_namespaceObject.store).createInfoNotice(isDistractionFree ? (0,external_wp_i18n_namespaceObject.__)('Distraction free mode deactivated.') : (0,external_wp_i18n_namespaceObject.__)('Distraction free mode activated.'), {
5129          id: 'core/editor/distraction-free-mode/notice',
5130          type: 'snackbar',
5131          actions: [{
5132            label: (0,external_wp_i18n_namespaceObject.__)('Undo'),
5133            onClick: () => {
5134              registry.batch(() => {
5135                registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'fixedToolbar', isDistractionFree);
5136                registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core', 'distractionFree');
5137              });
5138            }
5139          }]
5140        });
5141      }
5142    });
5143  };
5144  
5145  /**
5146   * Action that toggles the Spotlight Mode view option.
5147   */
5148  const toggleSpotlightMode = () => ({
5149    registry
5150  }) => {
5151    registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core', 'focusMode');
5152    const isFocusMode = registry.select(external_wp_preferences_namespaceObject.store).get('core', 'focusMode');
5153    registry.dispatch(external_wp_notices_namespaceObject.store).createInfoNotice(isFocusMode ? (0,external_wp_i18n_namespaceObject.__)('Spotlight mode activated.') : (0,external_wp_i18n_namespaceObject.__)('Spotlight mode deactivated.'), {
5154      id: 'core/editor/toggle-spotlight-mode/notice',
5155      type: 'snackbar',
5156      actions: [{
5157        label: (0,external_wp_i18n_namespaceObject.__)('Undo'),
5158        onClick: () => {
5159          registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core', 'focusMode');
5160        }
5161      }]
5162    });
5163  };
5164  
5165  /**
5166   * Action that toggles the Top Toolbar view option.
5167   */
5168  const toggleTopToolbar = () => ({
5169    registry
5170  }) => {
5171    registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core', 'fixedToolbar');
5172    const isTopToolbar = registry.select(external_wp_preferences_namespaceObject.store).get('core', 'fixedToolbar');
5173    registry.dispatch(external_wp_notices_namespaceObject.store).createInfoNotice(isTopToolbar ? (0,external_wp_i18n_namespaceObject.__)('Top toolbar activated.') : (0,external_wp_i18n_namespaceObject.__)('Top toolbar deactivated.'), {
5174      id: 'core/editor/toggle-top-toolbar/notice',
5175      type: 'snackbar',
5176      actions: [{
5177        label: (0,external_wp_i18n_namespaceObject.__)('Undo'),
5178        onClick: () => {
5179          registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core', 'fixedToolbar');
5180        }
5181      }]
5182    });
5183  };
5184  
5185  /**
5186   * Triggers an action used to switch editor mode.
5187   *
5188   * @param {string} mode The editor mode.
5189   */
5190  const switchEditorMode = mode => ({
5191    dispatch,
5192    registry
5193  }) => {
5194    registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'editorMode', mode);
5195    if (mode !== 'visual') {
5196      // Unselect blocks when we switch to a non visual mode.
5197      registry.dispatch(external_wp_blockEditor_namespaceObject.store).clearSelectedBlock();
5198      // Exit zoom out state when switching to a non visual mode.
5199      unlock(registry.dispatch(external_wp_blockEditor_namespaceObject.store)).resetZoomLevel();
5200    }
5201    if (mode === 'visual') {
5202      (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Visual editor selected'), 'assertive');
5203    } else if (mode === 'text') {
5204      const isDistractionFree = registry.select(external_wp_preferences_namespaceObject.store).get('core', 'distractionFree');
5205      if (isDistractionFree) {
5206        dispatch.toggleDistractionFree();
5207      }
5208      (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Code editor selected'), 'assertive');
5209    }
5210  };
5211  
5212  /**
5213   * Returns an action object used in signalling that the user opened the publish
5214   * sidebar.
5215   *
5216   * @return {Object} Action object
5217   */
5218  function openPublishSidebar() {
5219    return {
5220      type: 'OPEN_PUBLISH_SIDEBAR'
5221    };
5222  }
5223  
5224  /**
5225   * Returns an action object used in signalling that the user closed the
5226   * publish sidebar.
5227   *
5228   * @return {Object} Action object.
5229   */
5230  function closePublishSidebar() {
5231    return {
5232      type: 'CLOSE_PUBLISH_SIDEBAR'
5233    };
5234  }
5235  
5236  /**
5237   * Returns an action object used in signalling that the user toggles the publish sidebar.
5238   *
5239   * @return {Object} Action object
5240   */
5241  function togglePublishSidebar() {
5242    return {
5243      type: 'TOGGLE_PUBLISH_SIDEBAR'
5244    };
5245  }
5246  
5247  /**
5248   * Backward compatibility
5249   */
5250  
5251  const getBlockEditorAction = name => (...args) => ({
5252    registry
5253  }) => {
5254    external_wp_deprecated_default()("`wp.data.dispatch( 'core/editor' )." + name + '`', {
5255      since: '5.3',
5256      alternative: "`wp.data.dispatch( 'core/block-editor' )." + name + '`',
5257      version: '6.2'
5258    });
5259    registry.dispatch(external_wp_blockEditor_namespaceObject.store)[name](...args);
5260  };
5261  
5262  /**
5263   * @see resetBlocks in core/block-editor store.
5264   */
5265  const resetBlocks = getBlockEditorAction('resetBlocks');
5266  
5267  /**
5268   * @see receiveBlocks in core/block-editor store.
5269   */
5270  const receiveBlocks = getBlockEditorAction('receiveBlocks');
5271  
5272  /**
5273   * @see updateBlock in core/block-editor store.
5274   */
5275  const updateBlock = getBlockEditorAction('updateBlock');
5276  
5277  /**
5278   * @see updateBlockAttributes in core/block-editor store.
5279   */
5280  const updateBlockAttributes = getBlockEditorAction('updateBlockAttributes');
5281  
5282  /**
5283   * @see selectBlock in core/block-editor store.
5284   */
5285  const selectBlock = getBlockEditorAction('selectBlock');
5286  
5287  /**
5288   * @see startMultiSelect in core/block-editor store.
5289   */
5290  const startMultiSelect = getBlockEditorAction('startMultiSelect');
5291  
5292  /**
5293   * @see stopMultiSelect in core/block-editor store.
5294   */
5295  const stopMultiSelect = getBlockEditorAction('stopMultiSelect');
5296  
5297  /**
5298   * @see multiSelect in core/block-editor store.
5299   */
5300  const multiSelect = getBlockEditorAction('multiSelect');
5301  
5302  /**
5303   * @see clearSelectedBlock in core/block-editor store.
5304   */
5305  const clearSelectedBlock = getBlockEditorAction('clearSelectedBlock');
5306  
5307  /**
5308   * @see toggleSelection in core/block-editor store.
5309   */
5310  const toggleSelection = getBlockEditorAction('toggleSelection');
5311  
5312  /**
5313   * @see replaceBlocks in core/block-editor store.
5314   */
5315  const replaceBlocks = getBlockEditorAction('replaceBlocks');
5316  
5317  /**
5318   * @see replaceBlock in core/block-editor store.
5319   */
5320  const replaceBlock = getBlockEditorAction('replaceBlock');
5321  
5322  /**
5323   * @see moveBlocksDown in core/block-editor store.
5324   */
5325  const moveBlocksDown = getBlockEditorAction('moveBlocksDown');
5326  
5327  /**
5328   * @see moveBlocksUp in core/block-editor store.
5329   */
5330  const moveBlocksUp = getBlockEditorAction('moveBlocksUp');
5331  
5332  /**
5333   * @see moveBlockToPosition in core/block-editor store.
5334   */
5335  const moveBlockToPosition = getBlockEditorAction('moveBlockToPosition');
5336  
5337  /**
5338   * @see insertBlock in core/block-editor store.
5339   */
5340  const insertBlock = getBlockEditorAction('insertBlock');
5341  
5342  /**
5343   * @see insertBlocks in core/block-editor store.
5344   */
5345  const insertBlocks = getBlockEditorAction('insertBlocks');
5346  
5347  /**
5348   * @see showInsertionPoint in core/block-editor store.
5349   */
5350  const showInsertionPoint = getBlockEditorAction('showInsertionPoint');
5351  
5352  /**
5353   * @see hideInsertionPoint in core/block-editor store.
5354   */
5355  const hideInsertionPoint = getBlockEditorAction('hideInsertionPoint');
5356  
5357  /**
5358   * @see setTemplateValidity in core/block-editor store.
5359   */
5360  const setTemplateValidity = getBlockEditorAction('setTemplateValidity');
5361  
5362  /**
5363   * @see synchronizeTemplate in core/block-editor store.
5364   */
5365  const synchronizeTemplate = getBlockEditorAction('synchronizeTemplate');
5366  
5367  /**
5368   * @see mergeBlocks in core/block-editor store.
5369   */
5370  const mergeBlocks = getBlockEditorAction('mergeBlocks');
5371  
5372  /**
5373   * @see removeBlocks in core/block-editor store.
5374   */
5375  const removeBlocks = getBlockEditorAction('removeBlocks');
5376  
5377  /**
5378   * @see removeBlock in core/block-editor store.
5379   */
5380  const removeBlock = getBlockEditorAction('removeBlock');
5381  
5382  /**
5383   * @see toggleBlockMode in core/block-editor store.
5384   */
5385  const toggleBlockMode = getBlockEditorAction('toggleBlockMode');
5386  
5387  /**
5388   * @see startTyping in core/block-editor store.
5389   */
5390  const startTyping = getBlockEditorAction('startTyping');
5391  
5392  /**
5393   * @see stopTyping in core/block-editor store.
5394   */
5395  const stopTyping = getBlockEditorAction('stopTyping');
5396  
5397  /**
5398   * @see enterFormattedText in core/block-editor store.
5399   */
5400  const enterFormattedText = getBlockEditorAction('enterFormattedText');
5401  
5402  /**
5403   * @see exitFormattedText in core/block-editor store.
5404   */
5405  const exitFormattedText = getBlockEditorAction('exitFormattedText');
5406  
5407  /**
5408   * @see insertDefaultBlock in core/block-editor store.
5409   */
5410  const insertDefaultBlock = getBlockEditorAction('insertDefaultBlock');
5411  
5412  /**
5413   * @see updateBlockListSettings in core/block-editor store.
5414   */
5415  const updateBlockListSettings = getBlockEditorAction('updateBlockListSettings');
5416  
5417  ;// external ["wp","htmlEntities"]
5418  const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
5419  ;// ./node_modules/@wordpress/editor/build-module/store/utils/is-template-revertable.js
5420  /**
5421   * Internal dependencies
5422   */
5423  
5424  
5425  // Copy of the function from packages/edit-site/src/utils/is-template-revertable.js
5426  
5427  /**
5428   * Check if a template or template part is revertable to its original theme-provided file.
5429   *
5430   * @param {Object} templateOrTemplatePart The entity to check.
5431   * @return {boolean} Whether the entity is revertable.
5432   */
5433  function isTemplateRevertable(templateOrTemplatePart) {
5434    if (!templateOrTemplatePart) {
5435      return false;
5436    }
5437    return templateOrTemplatePart.source === TEMPLATE_ORIGINS.custom && (Boolean(templateOrTemplatePart?.plugin) || templateOrTemplatePart?.has_theme_file);
5438  }
5439  
5440  ;// ./node_modules/@wordpress/icons/build-module/library/external.js
5441  /**
5442   * WordPress dependencies
5443   */
5444  
5445  
5446  const external = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
5447    xmlns: "http://www.w3.org/2000/svg",
5448    viewBox: "0 0 24 24",
5449    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
5450      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"
5451    })
5452  });
5453  /* harmony default export */ const library_external = (external);
5454  
5455  ;// ./node_modules/@wordpress/fields/build-module/actions/view-post.js
5456  /**
5457   * WordPress dependencies
5458   */
5459  
5460  
5461  
5462  /**
5463   * Internal dependencies
5464   */
5465  
5466  const viewPost = {
5467    id: 'view-post',
5468    label: (0,external_wp_i18n_namespaceObject._x)('View', 'verb'),
5469    isPrimary: true,
5470    icon: library_external,
5471    isEligible(post) {
5472      return post.status !== 'trash';
5473    },
5474    callback(posts, {
5475      onActionPerformed
5476    }) {
5477      const post = posts[0];
5478      window.open(post?.link, '_blank');
5479      if (onActionPerformed) {
5480        onActionPerformed(posts);
5481      }
5482    }
5483  };
5484  
5485  /**
5486   * View post action for BasePost.
5487   */
5488  /* harmony default export */ const view_post = (viewPost);
5489  
5490  ;// ./node_modules/@wordpress/fields/build-module/actions/view-post-revisions.js
5491  /**
5492   * WordPress dependencies
5493   */
5494  
5495  
5496  
5497  /**
5498   * Internal dependencies
5499   */
5500  
5501  const viewPostRevisions = {
5502    id: 'view-post-revisions',
5503    context: 'list',
5504    label(items) {
5505      var _items$0$_links$versi;
5506      const revisionsCount = (_items$0$_links$versi = items[0]._links?.['version-history']?.[0]?.count) !== null && _items$0$_links$versi !== void 0 ? _items$0$_links$versi : 0;
5507      return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: number of revisions. */
5508      (0,external_wp_i18n_namespaceObject.__)('View revisions (%s)'), revisionsCount);
5509    },
5510    isEligible(post) {
5511      var _post$_links$predeces, _post$_links$version;
5512      if (post.status === 'trash') {
5513        return false;
5514      }
5515      const lastRevisionId = (_post$_links$predeces = post?._links?.['predecessor-version']?.[0]?.id) !== null && _post$_links$predeces !== void 0 ? _post$_links$predeces : null;
5516      const revisionsCount = (_post$_links$version = post?._links?.['version-history']?.[0]?.count) !== null && _post$_links$version !== void 0 ? _post$_links$version : 0;
5517      return !!lastRevisionId && revisionsCount > 1;
5518    },
5519    callback(posts, {
5520      onActionPerformed
5521    }) {
5522      const post = posts[0];
5523      const href = (0,external_wp_url_namespaceObject.addQueryArgs)('revision.php', {
5524        revision: post?._links?.['predecessor-version']?.[0]?.id
5525      });
5526      document.location.href = href;
5527      if (onActionPerformed) {
5528        onActionPerformed(posts);
5529      }
5530    }
5531  };
5532  
5533  /**
5534   * View post revisions action for Post.
5535   */
5536  /* harmony default export */ const view_post_revisions = (viewPostRevisions);
5537  
5538  ;// external ["wp","components"]
5539  const external_wp_components_namespaceObject = window["wp"]["components"];
5540  ;// ./node_modules/@wordpress/icons/build-module/library/check.js
5541  /**
5542   * WordPress dependencies
5543   */
5544  
5545  
5546  const check = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
5547    xmlns: "http://www.w3.org/2000/svg",
5548    viewBox: "0 0 24 24",
5549    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
5550      d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
5551    })
5552  });
5553  /* harmony default export */ const library_check = (check);
5554  
5555  ;// ./node_modules/tslib/tslib.es6.mjs
5556  /******************************************************************************
5557  Copyright (c) Microsoft Corporation.
5558  
5559  Permission to use, copy, modify, and/or distribute this software for any
5560  purpose with or without fee is hereby granted.
5561  
5562  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
5563  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
5564  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
5565  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
5566  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
5567  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
5568  PERFORMANCE OF THIS SOFTWARE.
5569  ***************************************************************************** */
5570  /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
5571  
5572  var extendStatics = function(d, b) {
5573    extendStatics = Object.setPrototypeOf ||
5574        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5575        function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
5576    return extendStatics(d, b);
5577  };
5578  
5579  function __extends(d, b) {
5580    if (typeof b !== "function" && b !== null)
5581        throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
5582    extendStatics(d, b);
5583    function __() { this.constructor = d; }
5584    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5585  }
5586  
5587  var __assign = function() {
5588    __assign = Object.assign || function __assign(t) {
5589        for (var s, i = 1, n = arguments.length; i < n; i++) {
5590            s = arguments[i];
5591            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
5592        }
5593        return t;
5594    }
5595    return __assign.apply(this, arguments);
5596  }
5597  
5598  function __rest(s, e) {
5599    var t = {};
5600    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5601        t[p] = s[p];
5602    if (s != null && typeof Object.getOwnPropertySymbols === "function")
5603        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
5604            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
5605                t[p[i]] = s[p[i]];
5606        }
5607    return t;
5608  }
5609  
5610  function __decorate(decorators, target, key, desc) {
5611    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5612    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5613    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5614    return c > 3 && r && Object.defineProperty(target, key, r), r;
5615  }
5616  
5617  function __param(paramIndex, decorator) {
5618    return function (target, key) { decorator(target, key, paramIndex); }
5619  }
5620  
5621  function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
5622    function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
5623    var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
5624    var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5625    var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
5626    var _, done = false;
5627    for (var i = decorators.length - 1; i >= 0; i--) {
5628        var context = {};
5629        for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
5630        for (var p in contextIn.access) context.access[p] = contextIn.access[p];
5631        context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
5632        var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
5633        if (kind === "accessor") {
5634            if (result === void 0) continue;
5635            if (result === null || typeof result !== "object") throw new TypeError("Object expected");
5636            if (_ = accept(result.get)) descriptor.get = _;
5637            if (_ = accept(result.set)) descriptor.set = _;
5638            if (_ = accept(result.init)) initializers.unshift(_);
5639        }
5640        else if (_ = accept(result)) {
5641            if (kind === "field") initializers.unshift(_);
5642            else descriptor[key] = _;
5643        }
5644    }
5645    if (target) Object.defineProperty(target, contextIn.name, descriptor);
5646    done = true;
5647  };
5648  
5649  function __runInitializers(thisArg, initializers, value) {
5650    var useValue = arguments.length > 2;
5651    for (var i = 0; i < initializers.length; i++) {
5652        value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
5653    }
5654    return useValue ? value : void 0;
5655  };
5656  
5657  function __propKey(x) {
5658    return typeof x === "symbol" ? x : "".concat(x);
5659  };
5660  
5661  function __setFunctionName(f, name, prefix) {
5662    if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
5663    return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
5664  };
5665  
5666  function __metadata(metadataKey, metadataValue) {
5667    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
5668  }
5669  
5670  function __awaiter(thisArg, _arguments, P, generator) {
5671    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5672    return new (P || (P = Promise))(function (resolve, reject) {
5673        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5674        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
5675        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
5676        step((generator = generator.apply(thisArg, _arguments || [])).next());
5677    });
5678  }
5679  
5680  function __generator(thisArg, body) {
5681    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
5682    return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
5683    function verb(n) { return function (v) { return step([n, v]); }; }
5684    function step(op) {
5685        if (f) throw new TypeError("Generator is already executing.");
5686        while (g && (g = 0, op[0] && (_ = 0)), _) try {
5687            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
5688            if (y = 0, t) op = [op[0] & 2, t.value];
5689            switch (op[0]) {
5690                case 0: case 1: t = op; break;
5691                case 4: _.label++; return { value: op[1], done: false };
5692                case 5: _.label++; y = op[1]; op = [0]; continue;
5693                case 7: op = _.ops.pop(); _.trys.pop(); continue;
5694                default:
5695                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
5696                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
5697                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
5698                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
5699                    if (t[2]) _.ops.pop();
5700                    _.trys.pop(); continue;
5701            }
5702            op = body.call(thisArg, _);
5703        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
5704        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
5705    }
5706  }
5707  
5708  var __createBinding = Object.create ? (function(o, m, k, k2) {
5709    if (k2 === undefined) k2 = k;
5710    var desc = Object.getOwnPropertyDescriptor(m, k);
5711    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
5712        desc = { enumerable: true, get: function() { return m[k]; } };
5713    }
5714    Object.defineProperty(o, k2, desc);
5715  }) : (function(o, m, k, k2) {
5716    if (k2 === undefined) k2 = k;
5717    o[k2] = m[k];
5718  });
5719  
5720  function __exportStar(m, o) {
5721    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
5722  }
5723  
5724  function __values(o) {
5725    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
5726    if (m) return m.call(o);
5727    if (o && typeof o.length === "number") return {
5728        next: function () {
5729            if (o && i >= o.length) o = void 0;
5730            return { value: o && o[i++], done: !o };
5731        }
5732    };
5733    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
5734  }
5735  
5736  function __read(o, n) {
5737    var m = typeof Symbol === "function" && o[Symbol.iterator];
5738    if (!m) return o;
5739    var i = m.call(o), r, ar = [], e;
5740    try {
5741        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
5742    }
5743    catch (error) { e = { error: error }; }
5744    finally {
5745        try {
5746            if (r && !r.done && (m = i["return"])) m.call(i);
5747        }
5748        finally { if (e) throw e.error; }
5749    }
5750    return ar;
5751  }
5752  
5753  /** @deprecated */
5754  function __spread() {
5755    for (var ar = [], i = 0; i < arguments.length; i++)
5756        ar = ar.concat(__read(arguments[i]));
5757    return ar;
5758  }
5759  
5760  /** @deprecated */
5761  function __spreadArrays() {
5762    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
5763    for (var r = Array(s), k = 0, i = 0; i < il; i++)
5764        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
5765            r[k] = a[j];
5766    return r;
5767  }
5768  
5769  function __spreadArray(to, from, pack) {
5770    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
5771        if (ar || !(i in from)) {
5772            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5773            ar[i] = from[i];
5774        }
5775    }
5776    return to.concat(ar || Array.prototype.slice.call(from));
5777  }
5778  
5779  function __await(v) {
5780    return this instanceof __await ? (this.v = v, this) : new __await(v);
5781  }
5782  
5783  function __asyncGenerator(thisArg, _arguments, generator) {
5784    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
5785    var g = generator.apply(thisArg, _arguments || []), i, q = [];
5786    return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
5787    function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
5788    function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
5789    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
5790    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
5791    function fulfill(value) { resume("next", value); }
5792    function reject(value) { resume("throw", value); }
5793    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
5794  }
5795  
5796  function __asyncDelegator(o) {
5797    var i, p;
5798    return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
5799    function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
5800  }
5801  
5802  function __asyncValues(o) {
5803    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
5804    var m = o[Symbol.asyncIterator], i;
5805    return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
5806    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
5807    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
5808  }
5809  
5810  function __makeTemplateObject(cooked, raw) {
5811    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
5812    return cooked;
5813  };
5814  
5815  var __setModuleDefault = Object.create ? (function(o, v) {
5816    Object.defineProperty(o, "default", { enumerable: true, value: v });
5817  }) : function(o, v) {
5818    o["default"] = v;
5819  };
5820  
5821  var ownKeys = function(o) {
5822    ownKeys = Object.getOwnPropertyNames || function (o) {
5823      var ar = [];
5824      for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
5825      return ar;
5826    };
5827    return ownKeys(o);
5828  };
5829  
5830  function __importStar(mod) {
5831    if (mod && mod.__esModule) return mod;
5832    var result = {};
5833    if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
5834    __setModuleDefault(result, mod);
5835    return result;
5836  }
5837  
5838  function __importDefault(mod) {
5839    return (mod && mod.__esModule) ? mod : { default: mod };
5840  }
5841  
5842  function __classPrivateFieldGet(receiver, state, kind, f) {
5843    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
5844    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5845    return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5846  }
5847  
5848  function __classPrivateFieldSet(receiver, state, value, kind, f) {
5849    if (kind === "m") throw new TypeError("Private method is not writable");
5850    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5851    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5852    return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
5853  }
5854  
5855  function __classPrivateFieldIn(state, receiver) {
5856    if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
5857    return typeof state === "function" ? receiver === state : state.has(receiver);
5858  }
5859  
5860  function __addDisposableResource(env, value, async) {
5861    if (value !== null && value !== void 0) {
5862      if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
5863      var dispose, inner;
5864      if (async) {
5865        if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
5866        dispose = value[Symbol.asyncDispose];
5867      }
5868      if (dispose === void 0) {
5869        if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
5870        dispose = value[Symbol.dispose];
5871        if (async) inner = dispose;
5872      }
5873      if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
5874      if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
5875      env.stack.push({ value: value, dispose: dispose, async: async });
5876    }
5877    else if (async) {
5878      env.stack.push({ async: true });
5879    }
5880    return value;
5881  }
5882  
5883  var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
5884    var e = new Error(message);
5885    return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
5886  };
5887  
5888  function __disposeResources(env) {
5889    function fail(e) {
5890      env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
5891      env.hasError = true;
5892    }
5893    var r, s = 0;
5894    function next() {
5895      while (r = env.stack.pop()) {
5896        try {
5897          if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
5898          if (r.dispose) {
5899            var result = r.dispose.call(r.value);
5900            if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
5901          }
5902          else s |= 1;
5903        }
5904        catch (e) {
5905          fail(e);
5906        }
5907      }
5908      if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
5909      if (env.hasError) throw env.error;
5910    }
5911    return next();
5912  }
5913  
5914  function __rewriteRelativeImportExtension(path, preserveJsx) {
5915    if (typeof path === "string" && /^\.\.?\//.test(path)) {
5916        return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
5917            return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
5918        });
5919    }
5920    return path;
5921  }
5922  
5923  /* harmony default export */ const tslib_es6 = ({
5924    __extends,
5925    __assign,
5926    __rest,
5927    __decorate,
5928    __param,
5929    __esDecorate,
5930    __runInitializers,
5931    __propKey,
5932    __setFunctionName,
5933    __metadata,
5934    __awaiter,
5935    __generator,
5936    __createBinding,
5937    __exportStar,
5938    __values,
5939    __read,
5940    __spread,
5941    __spreadArrays,
5942    __spreadArray,
5943    __await,
5944    __asyncGenerator,
5945    __asyncDelegator,
5946    __asyncValues,
5947    __makeTemplateObject,
5948    __importStar,
5949    __importDefault,
5950    __classPrivateFieldGet,
5951    __classPrivateFieldSet,
5952    __classPrivateFieldIn,
5953    __addDisposableResource,
5954    __disposeResources,
5955    __rewriteRelativeImportExtension,
5956  });
5957  
5958  ;// ./node_modules/lower-case/dist.es2015/index.js
5959  /**
5960   * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
5961   */
5962  var SUPPORTED_LOCALE = {
5963      tr: {
5964          regexp: /\u0130|\u0049|\u0049\u0307/g,
5965          map: {
5966              İ: "\u0069",
5967              I: "\u0131",
5968              İ: "\u0069",
5969          },
5970      },
5971      az: {
5972          regexp: /\u0130/g,
5973          map: {
5974              İ: "\u0069",
5975              I: "\u0131",
5976              İ: "\u0069",
5977          },
5978      },
5979      lt: {
5980          regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
5981          map: {
5982              I: "\u0069\u0307",
5983              J: "\u006A\u0307",
5984              Į: "\u012F\u0307",
5985              Ì: "\u0069\u0307\u0300",
5986              Í: "\u0069\u0307\u0301",
5987              Ĩ: "\u0069\u0307\u0303",
5988          },
5989      },
5990  };
5991  /**
5992   * Localized lower case.
5993   */
5994  function localeLowerCase(str, locale) {
5995      var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
5996      if (lang)
5997          return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
5998      return lowerCase(str);
5999  }
6000  /**
6001   * Lower case as a function.
6002   */
6003  function lowerCase(str) {
6004      return str.toLowerCase();
6005  }
6006  
6007  ;// ./node_modules/no-case/dist.es2015/index.js
6008  
6009  // Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
6010  var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
6011  // Remove all non-word characters.
6012  var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
6013  /**
6014   * Normalize the string into something other libraries can manipulate easier.
6015   */
6016  function noCase(input, options) {
6017      if (options === void 0) { options = {}; }
6018      var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
6019      var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
6020      var start = 0;
6021      var end = result.length;
6022      // Trim the delimiter from around the output string.
6023      while (result.charAt(start) === "\0")
6024          start++;
6025      while (result.charAt(end - 1) === "\0")
6026          end--;
6027      // Transform each token independently.
6028      return result.slice(start, end).split("\0").map(transform).join(delimiter);
6029  }
6030  /**
6031   * Replace `re` in the input string with the replacement value.
6032   */
6033  function replace(input, re, value) {
6034      if (re instanceof RegExp)
6035          return input.replace(re, value);
6036      return re.reduce(function (input, re) { return input.replace(re, value); }, input);
6037  }
6038  
6039  ;// ./node_modules/dot-case/dist.es2015/index.js
6040  
6041  
6042  function dotCase(input, options) {
6043      if (options === void 0) { options = {}; }
6044      return noCase(input, __assign({ delimiter: "." }, options));
6045  }
6046  
6047  ;// ./node_modules/param-case/dist.es2015/index.js
6048  
6049  
6050  function paramCase(input, options) {
6051      if (options === void 0) { options = {}; }
6052      return dotCase(input, __assign({ delimiter: "-" }, options));
6053  }
6054  
6055  ;// ./node_modules/@wordpress/fields/build-module/components/create-template-part-modal/utils.js
6056  /**
6057   * External dependencies
6058   */
6059  
6060  
6061  /**
6062   * WordPress dependencies
6063   */
6064  
6065  
6066  
6067  /**
6068   * Internal dependencies
6069   */
6070  
6071  const useExistingTemplateParts = () => {
6072    var _useSelect;
6073    return (_useSelect = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', 'wp_template_part', {
6074      per_page: -1
6075    }), [])) !== null && _useSelect !== void 0 ? _useSelect : [];
6076  };
6077  
6078  /**
6079   * Return a unique template part title based on
6080   * the given title and existing template parts.
6081   *
6082   * @param {string} title         The original template part title.
6083   * @param {Object} templateParts The array of template part entities.
6084   * @return {string} A unique template part title.
6085   */
6086  const getUniqueTemplatePartTitle = (title, templateParts) => {
6087    const lowercaseTitle = title.toLowerCase();
6088    const existingTitles = templateParts.map(templatePart => templatePart.title.rendered.toLowerCase());
6089    if (!existingTitles.includes(lowercaseTitle)) {
6090      return title;
6091    }
6092    let suffix = 2;
6093    while (existingTitles.includes(`$lowercaseTitle} $suffix}`)) {
6094      suffix++;
6095    }
6096    return `$title} $suffix}`;
6097  };
6098  
6099  /**
6100   * Get a valid slug for a template part.
6101   * Currently template parts only allow latin chars.
6102   * The fallback slug will receive suffix by default.
6103   *
6104   * @param {string} title The template part title.
6105   * @return {string} A valid template part slug.
6106   */
6107  const getCleanTemplatePartSlug = title => {
6108    return paramCase(title).replace(/[^\w-]+/g, '') || 'wp-custom-part';
6109  };
6110  
6111  ;// ./node_modules/@wordpress/fields/build-module/components/create-template-part-modal/index.js
6112  /**
6113   * WordPress dependencies
6114   */
6115  
6116  
6117  
6118  
6119  
6120  
6121  
6122  
6123  // @ts-expect-error serialize is not typed
6124  
6125  
6126  /**
6127   * Internal dependencies
6128   */
6129  
6130  
6131  function getAreaRadioId(value, instanceId) {
6132    return `fields-create-template-part-modal__area-option-$value}-$instanceId}`;
6133  }
6134  function getAreaRadioDescriptionId(value, instanceId) {
6135    return `fields-create-template-part-modal__area-option-description-$value}-$instanceId}`;
6136  }
6137  /**
6138   * A React component that renders a modal for creating a template part. The modal displays a title and the contents for creating the template part.
6139   * This component should not live in this package, it should be moved to a dedicated package responsible for managing template.
6140   * @param {Object} props            The component props.
6141   * @param          props.modalTitle
6142   */
6143  function CreateTemplatePartModal({
6144    modalTitle,
6145    ...restProps
6146  }) {
6147    const defaultModalTitle = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getPostType('wp_template_part')?.labels?.add_new_item, []);
6148    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
6149      title: modalTitle || defaultModalTitle,
6150      onRequestClose: restProps.closeModal,
6151      overlayClassName: "fields-create-template-part-modal",
6152      focusOnMount: "firstContentElement",
6153      size: "medium",
6154      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreateTemplatePartModalContents, {
6155        ...restProps
6156      })
6157    });
6158  }
6159  const create_template_part_modal_getTemplatePartIcon = iconName => {
6160    if ('header' === iconName) {
6161      return library_header;
6162    } else if ('footer' === iconName) {
6163      return library_footer;
6164    } else if ('sidebar' === iconName) {
6165      return library_sidebar;
6166    }
6167    return symbol_filled;
6168  };
6169  
6170  /**
6171   * A React component that renders the content of a model for creating a template part.
6172   * This component should not live in this package; it should be moved to a dedicated package responsible for managing template.
6173   *
6174   * @param {Object}   props                             - The component props.
6175   * @param {string}   [props.defaultArea=uncategorized] - The default area for the template part.
6176   * @param {Array}    [props.blocks=[]]                 - The blocks to be included in the template part.
6177   * @param {string}   [props.confirmLabel='Add']        - The label for the confirm button.
6178   * @param {Function} props.closeModal                  - Function to close the modal.
6179   * @param {Function} props.onCreate                    - Function to call when the template part is successfully created.
6180   * @param {Function} [props.onError]                   - Function to call when there is an error creating the template part.
6181   * @param {string}   [props.defaultTitle='']           - The default title for the template part.
6182   */
6183  function CreateTemplatePartModalContents({
6184    defaultArea = 'uncategorized',
6185    blocks = [],
6186    confirmLabel = (0,external_wp_i18n_namespaceObject.__)('Add'),
6187    closeModal,
6188    onCreate,
6189    onError,
6190    defaultTitle = ''
6191  }) {
6192    const {
6193      createErrorNotice
6194    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
6195    const {
6196      saveEntityRecord
6197    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
6198    const existingTemplateParts = useExistingTemplateParts();
6199    const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(defaultTitle);
6200    const [area, setArea] = (0,external_wp_element_namespaceObject.useState)(defaultArea);
6201    const [isSubmitting, setIsSubmitting] = (0,external_wp_element_namespaceObject.useState)(false);
6202    const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(CreateTemplatePartModal);
6203    const defaultTemplatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_part_areas, []);
6204    async function createTemplatePart() {
6205      if (!title || isSubmitting) {
6206        return;
6207      }
6208      try {
6209        setIsSubmitting(true);
6210        const uniqueTitle = getUniqueTemplatePartTitle(title, existingTemplateParts);
6211        const cleanSlug = getCleanTemplatePartSlug(uniqueTitle);
6212        const templatePart = await saveEntityRecord('postType', 'wp_template_part', {
6213          slug: cleanSlug,
6214          title: uniqueTitle,
6215          content: (0,external_wp_blocks_namespaceObject.serialize)(blocks),
6216          area
6217        }, {
6218          throwOnError: true
6219        });
6220        await onCreate(templatePart);
6221  
6222        // TODO: Add a success notice?
6223      } catch (error) {
6224        const errorMessage = error instanceof Error && 'code' in error && error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while creating the template part.');
6225        createErrorNotice(errorMessage, {
6226          type: 'snackbar'
6227        });
6228        onError?.();
6229      } finally {
6230        setIsSubmitting(false);
6231      }
6232    }
6233    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
6234      onSubmit: async event => {
6235        event.preventDefault();
6236        await createTemplatePart();
6237      },
6238      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
6239        spacing: "4",
6240        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
6241          __next40pxDefaultSize: true,
6242          __nextHasNoMarginBottom: true,
6243          label: (0,external_wp_i18n_namespaceObject.__)('Name'),
6244          value: title,
6245          onChange: setTitle,
6246          required: true
6247        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", {
6248          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, {
6249            as: "legend",
6250            children: (0,external_wp_i18n_namespaceObject.__)('Area')
6251          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
6252            className: "fields-create-template-part-modal__area-radio-group",
6253            children: (defaultTemplatePartAreas !== null && defaultTemplatePartAreas !== void 0 ? defaultTemplatePartAreas : []).map(item => {
6254              const icon = create_template_part_modal_getTemplatePartIcon(item.icon);
6255              return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
6256                className: "fields-create-template-part-modal__area-radio-wrapper",
6257                children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
6258                  type: "radio",
6259                  id: getAreaRadioId(item.area, instanceId),
6260                  name: `fields-create-template-part-modal__area-$instanceId}`,
6261                  value: item.area,
6262                  checked: area === item.area,
6263                  onChange: () => {
6264                    setArea(item.area);
6265                  },
6266                  "aria-describedby": getAreaRadioDescriptionId(item.area, instanceId)
6267                }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
6268                  icon: icon,
6269                  className: "fields-create-template-part-modal__area-radio-icon"
6270                }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("label", {
6271                  htmlFor: getAreaRadioId(item.area, instanceId),
6272                  className: "fields-create-template-part-modal__area-radio-label",
6273                  children: item.label
6274                }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
6275                  icon: library_check,
6276                  className: "fields-create-template-part-modal__area-radio-checkmark"
6277                }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
6278                  className: "fields-create-template-part-modal__area-radio-description",
6279                  id: getAreaRadioDescriptionId(item.area, instanceId),
6280                  children: item.description
6281                })]
6282              }, item.area);
6283            })
6284          })]
6285        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
6286          justify: "right",
6287          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
6288            __next40pxDefaultSize: true,
6289            variant: "tertiary",
6290            onClick: () => {
6291              closeModal();
6292            },
6293            children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
6294          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
6295            __next40pxDefaultSize: true,
6296            variant: "primary",
6297            type: "submit",
6298            "aria-disabled": !title || isSubmitting,
6299            isBusy: isSubmitting,
6300            children: confirmLabel
6301          })]
6302        })]
6303      })
6304    });
6305  }
6306  
6307  ;// ./node_modules/@wordpress/fields/build-module/actions/utils.js
6308  /**
6309   * WordPress dependencies
6310   */
6311  
6312  
6313  /**
6314   * Internal dependencies
6315   */
6316  
6317  function isTemplate(post) {
6318    return post.type === 'wp_template';
6319  }
6320  function isTemplatePart(post) {
6321    return post.type === 'wp_template_part';
6322  }
6323  function isTemplateOrTemplatePart(p) {
6324    return p.type === 'wp_template' || p.type === 'wp_template_part';
6325  }
6326  function getItemTitle(item) {
6327    if (typeof item.title === 'string') {
6328      return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title);
6329    }
6330    if (item.title && 'rendered' in item.title) {
6331      return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title.rendered);
6332    }
6333    if (item.title && 'raw' in item.title) {
6334      return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title.raw);
6335    }
6336    return '';
6337  }
6338  
6339  /**
6340   * Check if a template is removable.
6341   *
6342   * @param template The template entity to check.
6343   * @return Whether the template is removable.
6344   */
6345  function isTemplateRemovable(template) {
6346    if (!template) {
6347      return false;
6348    }
6349    // In patterns list page we map the templates parts to a different object
6350    // than the one returned from the endpoint. This is why we need to check for
6351    // two props whether is custom or has a theme file.
6352    return [template.source, template.source].includes('custom') && !Boolean(template.type === 'wp_template' && template?.plugin) && !template.has_theme_file;
6353  }
6354  
6355  ;// ./node_modules/@wordpress/fields/build-module/actions/duplicate-template-part.js
6356  /**
6357   * WordPress dependencies
6358   */
6359  
6360  
6361  
6362  
6363  // @ts-ignore
6364  
6365  
6366  /**
6367   * Internal dependencies
6368   */
6369  
6370  
6371  
6372  
6373  /**
6374   * This action is used to duplicate a template part.
6375   */
6376  
6377  const duplicateTemplatePart = {
6378    id: 'duplicate-template-part',
6379    label: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label'),
6380    isEligible: item => item.type === 'wp_template_part',
6381    modalHeader: (0,external_wp_i18n_namespaceObject._x)('Duplicate template part', 'action label'),
6382    RenderModal: ({
6383      items,
6384      closeModal
6385    }) => {
6386      const [item] = items;
6387      const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => {
6388        var _item$blocks;
6389        return (_item$blocks = item.blocks) !== null && _item$blocks !== void 0 ? _item$blocks : (0,external_wp_blocks_namespaceObject.parse)(typeof item.content === 'string' ? item.content : item.content.raw, {
6390          __unstableSkipMigrationLogs: true
6391        });
6392      }, [item.content, item.blocks]);
6393      const {
6394        createSuccessNotice
6395      } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
6396      function onTemplatePartSuccess(templatePart) {
6397        createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
6398        // translators: %s: The new template part's title e.g. 'Call to action (copy)'.
6399        (0,external_wp_i18n_namespaceObject._x)('"%s" duplicated.', 'template part'), getItemTitle(templatePart)), {
6400          type: 'snackbar',
6401          id: 'edit-site-patterns-success'
6402        });
6403        closeModal?.();
6404      }
6405      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreateTemplatePartModalContents, {
6406        blocks: blocks,
6407        defaultArea: item.area,
6408        defaultTitle: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Existing template part title */
6409        (0,external_wp_i18n_namespaceObject._x)('%s (Copy)', 'template part'), getItemTitle(item)),
6410        onCreate: onTemplatePartSuccess,
6411        onError: closeModal,
6412        confirmLabel: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label'),
6413        closeModal: closeModal !== null && closeModal !== void 0 ? closeModal : () => {}
6414      });
6415    }
6416  };
6417  /**
6418   * Duplicate action for TemplatePart.
6419   */
6420  /* harmony default export */ const duplicate_template_part = (duplicateTemplatePart);
6421  
6422  ;// external ["wp","patterns"]
6423  const external_wp_patterns_namespaceObject = window["wp"]["patterns"];
6424  ;// ./node_modules/@wordpress/fields/build-module/lock-unlock.js
6425  /**
6426   * WordPress dependencies
6427   */
6428  
6429  const {
6430    lock: lock_unlock_lock,
6431    unlock: lock_unlock_unlock
6432  } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/fields');
6433  
6434  ;// ./node_modules/@wordpress/fields/build-module/actions/duplicate-pattern.js
6435  /**
6436   * WordPress dependencies
6437   */
6438  
6439  // @ts-ignore
6440  
6441  /**
6442   * Internal dependencies
6443   */
6444  
6445  
6446  // Patterns.
6447  const {
6448    CreatePatternModalContents,
6449    useDuplicatePatternProps
6450  } = lock_unlock_unlock(external_wp_patterns_namespaceObject.privateApis);
6451  const duplicatePattern = {
6452    id: 'duplicate-pattern',
6453    label: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label'),
6454    isEligible: item => item.type !== 'wp_template_part',
6455    modalHeader: (0,external_wp_i18n_namespaceObject._x)('Duplicate pattern', 'action label'),
6456    RenderModal: ({
6457      items,
6458      closeModal
6459    }) => {
6460      const [item] = items;
6461      const duplicatedProps = useDuplicatePatternProps({
6462        pattern: item,
6463        onSuccess: () => closeModal?.()
6464      });
6465      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreatePatternModalContents, {
6466        onClose: closeModal,
6467        confirmLabel: (0,external_wp_i18n_namespaceObject._x)('Duplicate', 'action label'),
6468        ...duplicatedProps
6469      });
6470    }
6471  };
6472  
6473  /**
6474   * Duplicate action for Pattern.
6475   */
6476  /* harmony default export */ const duplicate_pattern = (duplicatePattern);
6477  
6478  ;// ./node_modules/@wordpress/fields/build-module/actions/rename-post.js
6479  /**
6480   * WordPress dependencies
6481   */
6482  
6483  
6484  
6485  
6486  // @ts-ignore
6487  
6488  
6489  
6490  
6491  /**
6492   * Internal dependencies
6493   */
6494  
6495  
6496  
6497  
6498  // Patterns.
6499  const {
6500    PATTERN_TYPES
6501  } = lock_unlock_unlock(external_wp_patterns_namespaceObject.privateApis);
6502  const renamePost = {
6503    id: 'rename-post',
6504    label: (0,external_wp_i18n_namespaceObject.__)('Rename'),
6505    isEligible(post) {
6506      if (post.status === 'trash') {
6507        return false;
6508      }
6509      // Templates, template parts and patterns have special checks for renaming.
6510      if (!['wp_template', 'wp_template_part', ...Object.values(PATTERN_TYPES)].includes(post.type)) {
6511        return post.permissions?.update;
6512      }
6513  
6514      // In the case of templates, we can only rename custom templates.
6515      if (isTemplate(post)) {
6516        return isTemplateRemovable(post) && post.is_custom && post.permissions?.update;
6517      }
6518      if (isTemplatePart(post)) {
6519        return post.source === 'custom' && !post?.has_theme_file && post.permissions?.update;
6520      }
6521      return post.type === PATTERN_TYPES.user && post.permissions?.update;
6522    },
6523    RenderModal: ({
6524      items,
6525      closeModal,
6526      onActionPerformed
6527    }) => {
6528      const [item] = items;
6529      const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(() => getItemTitle(item));
6530      const {
6531        editEntityRecord,
6532        saveEditedEntityRecord
6533      } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
6534      const {
6535        createSuccessNotice,
6536        createErrorNotice
6537      } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
6538      async function onRename(event) {
6539        event.preventDefault();
6540        try {
6541          await editEntityRecord('postType', item.type, item.id, {
6542            title
6543          });
6544          // Update state before saving rerenders the list.
6545          setTitle('');
6546          closeModal?.();
6547          // Persist edited entity.
6548          await saveEditedEntityRecord('postType', item.type, item.id, {
6549            throwOnError: true
6550          });
6551          createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Name updated'), {
6552            type: 'snackbar'
6553          });
6554          onActionPerformed?.(items);
6555        } catch (error) {
6556          const typedError = error;
6557          const errorMessage = typedError.message && typedError.code !== 'unknown_error' ? typedError.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while updating the name');
6558          createErrorNotice(errorMessage, {
6559            type: 'snackbar'
6560          });
6561        }
6562      }
6563      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
6564        onSubmit: onRename,
6565        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
6566          spacing: "5",
6567          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
6568            __nextHasNoMarginBottom: true,
6569            __next40pxDefaultSize: true,
6570            label: (0,external_wp_i18n_namespaceObject.__)('Name'),
6571            value: title,
6572            onChange: setTitle,
6573            required: true
6574          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
6575            justify: "right",
6576            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
6577              __next40pxDefaultSize: true,
6578              variant: "tertiary",
6579              onClick: () => {
6580                closeModal?.();
6581              },
6582              children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
6583            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
6584              __next40pxDefaultSize: true,
6585              variant: "primary",
6586              type: "submit",
6587              children: (0,external_wp_i18n_namespaceObject.__)('Save')
6588            })]
6589          })]
6590        })
6591      });
6592    }
6593  };
6594  
6595  /**
6596   * Rename action for PostWithPermissions.
6597   */
6598  /* harmony default export */ const rename_post = (renamePost);
6599  
6600  ;// ./node_modules/@wordpress/dataviews/build-module/field-types/integer.js
6601  /**
6602   * Internal dependencies
6603   */
6604  
6605  function sort(a, b, direction) {
6606    return direction === 'asc' ? a - b : b - a;
6607  }
6608  function isValid(value, context) {
6609    // TODO: this implicitly means the value is required.
6610    if (value === '') {
6611      return false;
6612    }
6613    if (!Number.isInteger(Number(value))) {
6614      return false;
6615    }
6616    if (context?.elements) {
6617      const validValues = context?.elements.map(f => f.value);
6618      if (!validValues.includes(Number(value))) {
6619        return false;
6620      }
6621    }
6622    return true;
6623  }
6624  /* harmony default export */ const integer = ({
6625    sort,
6626    isValid,
6627    Edit: 'integer'
6628  });
6629  
6630  ;// ./node_modules/@wordpress/dataviews/build-module/field-types/text.js
6631  /**
6632   * Internal dependencies
6633   */
6634  
6635  function text_sort(valueA, valueB, direction) {
6636    return direction === 'asc' ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
6637  }
6638  function text_isValid(value, context) {
6639    if (context?.elements) {
6640      const validValues = context?.elements?.map(f => f.value);
6641      if (!validValues.includes(value)) {
6642        return false;
6643      }
6644    }
6645    return true;
6646  }
6647  /* harmony default export */ const field_types_text = ({
6648    sort: text_sort,
6649    isValid: text_isValid,
6650    Edit: 'text'
6651  });
6652  
6653  ;// ./node_modules/@wordpress/dataviews/build-module/field-types/datetime.js
6654  /**
6655   * Internal dependencies
6656   */
6657  
6658  function datetime_sort(a, b, direction) {
6659    const timeA = new Date(a).getTime();
6660    const timeB = new Date(b).getTime();
6661    return direction === 'asc' ? timeA - timeB : timeB - timeA;
6662  }
6663  function datetime_isValid(value, context) {
6664    if (context?.elements) {
6665      const validValues = context?.elements.map(f => f.value);
6666      if (!validValues.includes(value)) {
6667        return false;
6668      }
6669    }
6670    return true;
6671  }
6672  /* harmony default export */ const datetime = ({
6673    sort: datetime_sort,
6674    isValid: datetime_isValid,
6675    Edit: 'datetime'
6676  });
6677  
6678  ;// ./node_modules/@wordpress/dataviews/build-module/field-types/index.js
6679  /**
6680   * Internal dependencies
6681   */
6682  
6683  
6684  
6685  
6686  
6687  /**
6688   *
6689   * @param {FieldType} type The field type definition to get.
6690   *
6691   * @return A field type definition.
6692   */
6693  function getFieldTypeDefinition(type) {
6694    if ('integer' === type) {
6695      return integer;
6696    }
6697    if ('text' === type) {
6698      return field_types_text;
6699    }
6700    if ('datetime' === type) {
6701      return datetime;
6702    }
6703    return {
6704      sort: (a, b, direction) => {
6705        if (typeof a === 'number' && typeof b === 'number') {
6706          return direction === 'asc' ? a - b : b - a;
6707        }
6708        return direction === 'asc' ? a.localeCompare(b) : b.localeCompare(a);
6709      },
6710      isValid: (value, context) => {
6711        if (context?.elements) {
6712          const validValues = context?.elements?.map(f => f.value);
6713          if (!validValues.includes(value)) {
6714            return false;
6715          }
6716        }
6717        return true;
6718      },
6719      Edit: () => null
6720    };
6721  }
6722  
6723  ;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/datetime.js
6724  /**
6725   * WordPress dependencies
6726   */
6727  
6728  
6729  
6730  /**
6731   * Internal dependencies
6732   */
6733  
6734  function DateTime({
6735    data,
6736    field,
6737    onChange,
6738    hideLabelFromVision
6739  }) {
6740    const {
6741      id,
6742      label
6743    } = field;
6744    const value = field.getValue({
6745      item: data
6746    });
6747    const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({
6748      [id]: newValue
6749    }), [id, onChange]);
6750    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", {
6751      className: "dataviews-controls__datetime",
6752      children: [!hideLabelFromVision && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, {
6753        as: "legend",
6754        children: label
6755      }), hideLabelFromVision && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
6756        as: "legend",
6757        children: label
6758      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TimePicker, {
6759        currentTime: value,
6760        onChange: onChangeControl,
6761        hideLabelFromVision: true
6762      })]
6763    });
6764  }
6765  
6766  ;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/integer.js
6767  /**
6768   * WordPress dependencies
6769   */
6770  
6771  
6772  
6773  /**
6774   * Internal dependencies
6775   */
6776  
6777  function Integer({
6778    data,
6779    field,
6780    onChange,
6781    hideLabelFromVision
6782  }) {
6783    var _field$getValue;
6784    const {
6785      id,
6786      label,
6787      description
6788    } = field;
6789    const value = (_field$getValue = field.getValue({
6790      item: data
6791    })) !== null && _field$getValue !== void 0 ? _field$getValue : '';
6792    const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({
6793      [id]: Number(newValue)
6794    }), [id, onChange]);
6795    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, {
6796      label: label,
6797      help: description,
6798      value: value,
6799      onChange: onChangeControl,
6800      __next40pxDefaultSize: true,
6801      hideLabelFromVision: hideLabelFromVision
6802    });
6803  }
6804  
6805  ;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/radio.js
6806  /**
6807   * WordPress dependencies
6808   */
6809  
6810  
6811  
6812  /**
6813   * Internal dependencies
6814   */
6815  
6816  function Radio({
6817    data,
6818    field,
6819    onChange,
6820    hideLabelFromVision
6821  }) {
6822    const {
6823      id,
6824      label
6825    } = field;
6826    const value = field.getValue({
6827      item: data
6828    });
6829    const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({
6830      [id]: newValue
6831    }), [id, onChange]);
6832    if (field.elements) {
6833      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RadioControl, {
6834        label: label,
6835        onChange: onChangeControl,
6836        options: field.elements,
6837        selected: value,
6838        hideLabelFromVision: hideLabelFromVision
6839      });
6840    }
6841    return null;
6842  }
6843  
6844  ;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/select.js
6845  /**
6846   * WordPress dependencies
6847   */
6848  
6849  
6850  
6851  
6852  /**
6853   * Internal dependencies
6854   */
6855  
6856  function Select({
6857    data,
6858    field,
6859    onChange,
6860    hideLabelFromVision
6861  }) {
6862    var _field$getValue, _field$elements;
6863    const {
6864      id,
6865      label
6866    } = field;
6867    const value = (_field$getValue = field.getValue({
6868      item: data
6869    })) !== null && _field$getValue !== void 0 ? _field$getValue : '';
6870    const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({
6871      [id]: newValue
6872    }), [id, onChange]);
6873    const elements = [
6874    /*
6875     * Value can be undefined when:
6876     *
6877     * - the field is not required
6878     * - in bulk editing
6879     *
6880     */
6881    {
6882      label: (0,external_wp_i18n_namespaceObject.__)('Select item'),
6883      value: ''
6884    }, ...((_field$elements = field?.elements) !== null && _field$elements !== void 0 ? _field$elements : [])];
6885    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, {
6886      label: label,
6887      value: value,
6888      options: elements,
6889      onChange: onChangeControl,
6890      __next40pxDefaultSize: true,
6891      __nextHasNoMarginBottom: true,
6892      hideLabelFromVision: hideLabelFromVision
6893    });
6894  }
6895  
6896  ;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/text.js
6897  /**
6898   * WordPress dependencies
6899   */
6900  
6901  
6902  
6903  /**
6904   * Internal dependencies
6905   */
6906  
6907  function Text({
6908    data,
6909    field,
6910    onChange,
6911    hideLabelFromVision
6912  }) {
6913    const {
6914      id,
6915      label,
6916      placeholder
6917    } = field;
6918    const value = field.getValue({
6919      item: data
6920    });
6921    const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({
6922      [id]: newValue
6923    }), [id, onChange]);
6924    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
6925      label: label,
6926      placeholder: placeholder,
6927      value: value !== null && value !== void 0 ? value : '',
6928      onChange: onChangeControl,
6929      __next40pxDefaultSize: true,
6930      __nextHasNoMarginBottom: true,
6931      hideLabelFromVision: hideLabelFromVision
6932    });
6933  }
6934  
6935  ;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/index.js
6936  /**
6937   * External dependencies
6938   */
6939  
6940  /**
6941   * Internal dependencies
6942   */
6943  
6944  
6945  
6946  
6947  
6948  
6949  const FORM_CONTROLS = {
6950    datetime: DateTime,
6951    integer: Integer,
6952    radio: Radio,
6953    select: Select,
6954    text: Text
6955  };
6956  function getControl(field, fieldTypeDefinition) {
6957    if (typeof field.Edit === 'function') {
6958      return field.Edit;
6959    }
6960    if (typeof field.Edit === 'string') {
6961      return getControlByType(field.Edit);
6962    }
6963    if (field.elements) {
6964      return getControlByType('select');
6965    }
6966    if (typeof fieldTypeDefinition.Edit === 'string') {
6967      return getControlByType(fieldTypeDefinition.Edit);
6968    }
6969    return fieldTypeDefinition.Edit;
6970  }
6971  function getControlByType(type) {
6972    if (Object.keys(FORM_CONTROLS).includes(type)) {
6973      return FORM_CONTROLS[type];
6974    }
6975    throw 'Control ' + type + ' not found';
6976  }
6977  
6978  ;// ./node_modules/@wordpress/dataviews/build-module/normalize-fields.js
6979  /**
6980   * Internal dependencies
6981   */
6982  
6983  
6984  const getValueFromId = id => ({
6985    item
6986  }) => {
6987    const path = id.split('.');
6988    let value = item;
6989    for (const segment of path) {
6990      if (value.hasOwnProperty(segment)) {
6991        value = value[segment];
6992      } else {
6993        value = undefined;
6994      }
6995    }
6996    return value;
6997  };
6998  
6999  /**
7000   * Apply default values and normalize the fields config.
7001   *
7002   * @param fields Fields config.
7003   * @return Normalized fields config.
7004   */
7005  function normalizeFields(fields) {
7006    return fields.map(field => {
7007      var _field$sort, _field$isValid, _field$enableHiding, _field$enableSorting;
7008      const fieldTypeDefinition = getFieldTypeDefinition(field.type);
7009      const getValue = field.getValue || getValueFromId(field.id);
7010      const sort = (_field$sort = field.sort) !== null && _field$sort !== void 0 ? _field$sort : function sort(a, b, direction) {
7011        return fieldTypeDefinition.sort(getValue({
7012          item: a
7013        }), getValue({
7014          item: b
7015        }), direction);
7016      };
7017      const isValid = (_field$isValid = field.isValid) !== null && _field$isValid !== void 0 ? _field$isValid : function isValid(item, context) {
7018        return fieldTypeDefinition.isValid(getValue({
7019          item
7020        }), context);
7021      };
7022      const Edit = getControl(field, fieldTypeDefinition);
7023      const renderFromElements = ({
7024        item
7025      }) => {
7026        const value = getValue({
7027          item
7028        });
7029        return field?.elements?.find(element => element.value === value)?.label || getValue({
7030          item
7031        });
7032      };
7033      const render = field.render || (field.elements ? renderFromElements : getValue);
7034      return {
7035        ...field,
7036        label: field.label || field.id,
7037        header: field.header || field.label || field.id,
7038        getValue,
7039        render,
7040        sort,
7041        isValid,
7042        Edit,
7043        enableHiding: (_field$enableHiding = field.enableHiding) !== null && _field$enableHiding !== void 0 ? _field$enableHiding : true,
7044        enableSorting: (_field$enableSorting = field.enableSorting) !== null && _field$enableSorting !== void 0 ? _field$enableSorting : true
7045      };
7046    });
7047  }
7048  
7049  ;// ./node_modules/@wordpress/dataviews/build-module/validation.js
7050  /**
7051   * Internal dependencies
7052   */
7053  
7054  /**
7055   * Whether or not the given item's value is valid according to the fields and form config.
7056   *
7057   * @param item   The item to validate.
7058   * @param fields Fields config.
7059   * @param form   Form config.
7060   *
7061   * @return A boolean indicating if the item is valid (true) or not (false).
7062   */
7063  function isItemValid(item, fields, form) {
7064    const _fields = normalizeFields(fields.filter(({
7065      id
7066    }) => !!form.fields?.includes(id)));
7067    return _fields.every(field => {
7068      return field.isValid(item, {
7069        elements: field.elements
7070      });
7071    });
7072  }
7073  
7074  ;// ./node_modules/@wordpress/dataviews/build-module/components/dataform-context/index.js
7075  /**
7076   * WordPress dependencies
7077   */
7078  
7079  
7080  /**
7081   * Internal dependencies
7082   */
7083  
7084  const DataFormContext = (0,external_wp_element_namespaceObject.createContext)({
7085    fields: []
7086  });
7087  function DataFormProvider({
7088    fields,
7089    children
7090  }) {
7091    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormContext.Provider, {
7092      value: {
7093        fields
7094      },
7095      children: children
7096    });
7097  }
7098  /* harmony default export */ const dataform_context = (DataFormContext);
7099  
7100  ;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/is-combined-field.js
7101  /**
7102   * Internal dependencies
7103   */
7104  
7105  function isCombinedField(field) {
7106    return field.children !== undefined;
7107  }
7108  
7109  ;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/regular/index.js
7110  /**
7111   * WordPress dependencies
7112   */
7113  
7114  
7115  
7116  /**
7117   * Internal dependencies
7118   */
7119  
7120  
7121  
7122  
7123  
7124  function Header({
7125    title
7126  }) {
7127    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, {
7128      className: "dataforms-layouts-regular__header",
7129      spacing: 4,
7130      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
7131        alignment: "center",
7132        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, {
7133          level: 2,
7134          size: 13,
7135          children: title
7136        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, {})]
7137      })
7138    });
7139  }
7140  function FormRegularField({
7141    data,
7142    field,
7143    onChange,
7144    hideLabelFromVision
7145  }) {
7146    var _field$labelPosition;
7147    const {
7148      fields
7149    } = (0,external_wp_element_namespaceObject.useContext)(dataform_context);
7150    const form = (0,external_wp_element_namespaceObject.useMemo)(() => {
7151      if (isCombinedField(field)) {
7152        return {
7153          fields: field.children.map(child => {
7154            if (typeof child === 'string') {
7155              return {
7156                id: child
7157              };
7158            }
7159            return child;
7160          }),
7161          type: 'regular'
7162        };
7163      }
7164      return {
7165        type: 'regular',
7166        fields: []
7167      };
7168    }, [field]);
7169    if (isCombinedField(field)) {
7170      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
7171        children: [!hideLabelFromVision && field.label && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Header, {
7172          title: field.label
7173        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormLayout, {
7174          data: data,
7175          form: form,
7176          onChange: onChange
7177        })]
7178      });
7179    }
7180    const labelPosition = (_field$labelPosition = field.labelPosition) !== null && _field$labelPosition !== void 0 ? _field$labelPosition : 'top';
7181    const fieldDefinition = fields.find(fieldDef => fieldDef.id === field.id);
7182    if (!fieldDefinition) {
7183      return null;
7184    }
7185    if (labelPosition === 'side') {
7186      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
7187        className: "dataforms-layouts-regular__field",
7188        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
7189          className: "dataforms-layouts-regular__field-label",
7190          children: fieldDefinition.label
7191        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
7192          className: "dataforms-layouts-regular__field-control",
7193          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fieldDefinition.Edit, {
7194            data: data,
7195            field: fieldDefinition,
7196            onChange: onChange,
7197            hideLabelFromVision: true
7198          }, fieldDefinition.id)
7199        })]
7200      });
7201    }
7202    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
7203      className: "dataforms-layouts-regular__field",
7204      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fieldDefinition.Edit, {
7205        data: data,
7206        field: fieldDefinition,
7207        onChange: onChange,
7208        hideLabelFromVision: labelPosition === 'none' ? true : hideLabelFromVision
7209      })
7210    });
7211  }
7212  
7213  ;// ./node_modules/@wordpress/icons/build-module/library/close-small.js
7214  /**
7215   * WordPress dependencies
7216   */
7217  
7218  
7219  const closeSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
7220    xmlns: "http://www.w3.org/2000/svg",
7221    viewBox: "0 0 24 24",
7222    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
7223      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"
7224    })
7225  });
7226  /* harmony default export */ const close_small = (closeSmall);
7227  
7228  ;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/panel/index.js
7229  /**
7230   * WordPress dependencies
7231   */
7232  
7233  
7234  
7235  
7236  
7237  /**
7238   * Internal dependencies
7239   */
7240  
7241  
7242  
7243  
7244  
7245  function DropdownHeader({
7246    title,
7247    onClose
7248  }) {
7249    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, {
7250      className: "dataforms-layouts-panel__dropdown-header",
7251      spacing: 4,
7252      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
7253        alignment: "center",
7254        children: [title && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, {
7255          level: 2,
7256          size: 13,
7257          children: title
7258        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, {}), onClose && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
7259          label: (0,external_wp_i18n_namespaceObject.__)('Close'),
7260          icon: close_small,
7261          onClick: onClose,
7262          size: "small"
7263        })]
7264      })
7265    });
7266  }
7267  function PanelDropdown({
7268    fieldDefinition,
7269    popoverAnchor,
7270    labelPosition = 'side',
7271    data,
7272    onChange,
7273    field
7274  }) {
7275    const fieldLabel = isCombinedField(field) ? field.label : fieldDefinition?.label;
7276    const form = (0,external_wp_element_namespaceObject.useMemo)(() => {
7277      if (isCombinedField(field)) {
7278        return {
7279          type: 'regular',
7280          fields: field.children.map(child => {
7281            if (typeof child === 'string') {
7282              return {
7283                id: child
7284              };
7285            }
7286            return child;
7287          })
7288        };
7289      }
7290      // If not explicit children return the field id itself.
7291      return {
7292        type: 'regular',
7293        fields: [{
7294          id: field.id
7295        }]
7296      };
7297    }, [field]);
7298  
7299    // Memoize popoverProps to avoid returning a new object every time.
7300    const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
7301      // Anchor the popover to the middle of the entire row so that it doesn't
7302      // move around when the label changes.
7303      anchor: popoverAnchor,
7304      placement: 'left-start',
7305      offset: 36,
7306      shift: true
7307    }), [popoverAnchor]);
7308    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
7309      contentClassName: "dataforms-layouts-panel__field-dropdown",
7310      popoverProps: popoverProps,
7311      focusOnMount: true,
7312      toggleProps: {
7313        size: 'compact',
7314        variant: 'tertiary',
7315        tooltipPosition: 'middle left'
7316      },
7317      renderToggle: ({
7318        isOpen,
7319        onToggle
7320      }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
7321        className: "dataforms-layouts-panel__field-control",
7322        size: "compact",
7323        variant: ['none', 'top'].includes(labelPosition) ? 'link' : 'tertiary',
7324        "aria-expanded": isOpen,
7325        "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
7326        // translators: %s: Field name.
7327        (0,external_wp_i18n_namespaceObject._x)('Edit %s', 'field'), fieldLabel),
7328        onClick: onToggle,
7329        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fieldDefinition.render, {
7330          item: data
7331        })
7332      }),
7333      renderContent: ({
7334        onClose
7335      }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
7336        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownHeader, {
7337          title: fieldLabel,
7338          onClose: onClose
7339        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormLayout, {
7340          data: data,
7341          form: form,
7342          onChange: onChange,
7343          children: (FieldLayout, nestedField) => {
7344            var _form$fields;
7345            return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldLayout, {
7346              data: data,
7347              field: nestedField,
7348              onChange: onChange,
7349              hideLabelFromVision: ((_form$fields = form?.fields) !== null && _form$fields !== void 0 ? _form$fields : []).length < 2
7350            }, nestedField.id);
7351          }
7352        })]
7353      })
7354    });
7355  }
7356  function FormPanelField({
7357    data,
7358    field,
7359    onChange
7360  }) {
7361    var _field$labelPosition;
7362    const {
7363      fields
7364    } = (0,external_wp_element_namespaceObject.useContext)(dataform_context);
7365    const fieldDefinition = fields.find(fieldDef => {
7366      // Default to the first child if it is a combined field.
7367      if (isCombinedField(field)) {
7368        const children = field.children.filter(child => typeof child === 'string' || !isCombinedField(child));
7369        const firstChildFieldId = typeof children[0] === 'string' ? children[0] : children[0].id;
7370        return fieldDef.id === firstChildFieldId;
7371      }
7372      return fieldDef.id === field.id;
7373    });
7374    const labelPosition = (_field$labelPosition = field.labelPosition) !== null && _field$labelPosition !== void 0 ? _field$labelPosition : 'side';
7375  
7376    // Use internal state instead of a ref to make sure that the component
7377    // re-renders when the popover's anchor updates.
7378    const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
7379    if (!fieldDefinition) {
7380      return null;
7381    }
7382    const fieldLabel = isCombinedField(field) ? field.label : fieldDefinition?.label;
7383    if (labelPosition === 'top') {
7384      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
7385        className: "dataforms-layouts-panel__field",
7386        spacing: 0,
7387        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
7388          className: "dataforms-layouts-panel__field-label",
7389          style: {
7390            paddingBottom: 0
7391          },
7392          children: fieldLabel
7393        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
7394          className: "dataforms-layouts-panel__field-control",
7395          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelDropdown, {
7396            field: field,
7397            popoverAnchor: popoverAnchor,
7398            fieldDefinition: fieldDefinition,
7399            data: data,
7400            onChange: onChange,
7401            labelPosition: labelPosition
7402          })
7403        })]
7404      });
7405    }
7406    if (labelPosition === 'none') {
7407      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
7408        className: "dataforms-layouts-panel__field",
7409        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelDropdown, {
7410          field: field,
7411          popoverAnchor: popoverAnchor,
7412          fieldDefinition: fieldDefinition,
7413          data: data,
7414          onChange: onChange,
7415          labelPosition: labelPosition
7416        })
7417      });
7418    }
7419  
7420    // Defaults to label position side.
7421    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
7422      ref: setPopoverAnchor,
7423      className: "dataforms-layouts-panel__field",
7424      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
7425        className: "dataforms-layouts-panel__field-label",
7426        children: fieldLabel
7427      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
7428        className: "dataforms-layouts-panel__field-control",
7429        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelDropdown, {
7430          field: field,
7431          popoverAnchor: popoverAnchor,
7432          fieldDefinition: fieldDefinition,
7433          data: data,
7434          onChange: onChange,
7435          labelPosition: labelPosition
7436        })
7437      })]
7438    });
7439  }
7440  
7441  ;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/index.js
7442  /**
7443   * Internal dependencies
7444   */
7445  
7446  
7447  const FORM_FIELD_LAYOUTS = [{
7448    type: 'regular',
7449    component: FormRegularField
7450  }, {
7451    type: 'panel',
7452    component: FormPanelField
7453  }];
7454  function getFormFieldLayout(type) {
7455    return FORM_FIELD_LAYOUTS.find(layout => layout.type === type);
7456  }
7457  
7458  ;// ./node_modules/@wordpress/dataviews/build-module/normalize-form-fields.js
7459  /**
7460   * Internal dependencies
7461   */
7462  
7463  function normalizeFormFields(form) {
7464    var _form$type, _form$labelPosition, _form$fields;
7465    let layout = 'regular';
7466    if (['regular', 'panel'].includes((_form$type = form.type) !== null && _form$type !== void 0 ? _form$type : '')) {
7467      layout = form.type;
7468    }
7469    const labelPosition = (_form$labelPosition = form.labelPosition) !== null && _form$labelPosition !== void 0 ? _form$labelPosition : layout === 'regular' ? 'top' : 'side';
7470    return ((_form$fields = form.fields) !== null && _form$fields !== void 0 ? _form$fields : []).map(field => {
7471      var _field$layout, _field$labelPosition;
7472      if (typeof field === 'string') {
7473        return {
7474          id: field,
7475          layout,
7476          labelPosition
7477        };
7478      }
7479      const fieldLayout = (_field$layout = field.layout) !== null && _field$layout !== void 0 ? _field$layout : layout;
7480      const fieldLabelPosition = (_field$labelPosition = field.labelPosition) !== null && _field$labelPosition !== void 0 ? _field$labelPosition : fieldLayout === 'regular' ? 'top' : 'side';
7481      return {
7482        ...field,
7483        layout: fieldLayout,
7484        labelPosition: fieldLabelPosition
7485      };
7486    });
7487  }
7488  
7489  ;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/data-form-layout.js
7490  /**
7491   * WordPress dependencies
7492   */
7493  
7494  
7495  
7496  /**
7497   * Internal dependencies
7498   */
7499  
7500  
7501  
7502  
7503  
7504  
7505  function DataFormLayout({
7506    data,
7507    form,
7508    onChange,
7509    children
7510  }) {
7511    const {
7512      fields: fieldDefinitions
7513    } = (0,external_wp_element_namespaceObject.useContext)(dataform_context);
7514    function getFieldDefinition(field) {
7515      const fieldId = typeof field === 'string' ? field : field.id;
7516      return fieldDefinitions.find(fieldDefinition => fieldDefinition.id === fieldId);
7517    }
7518    const normalizedFormFields = (0,external_wp_element_namespaceObject.useMemo)(() => normalizeFormFields(form), [form]);
7519    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, {
7520      spacing: 2,
7521      children: normalizedFormFields.map(formField => {
7522        const FieldLayout = getFormFieldLayout(formField.layout)?.component;
7523        if (!FieldLayout) {
7524          return null;
7525        }
7526        const fieldDefinition = !isCombinedField(formField) ? getFieldDefinition(formField) : undefined;
7527        if (fieldDefinition && fieldDefinition.isVisible && !fieldDefinition.isVisible(data)) {
7528          return null;
7529        }
7530        if (children) {
7531          return children(FieldLayout, formField);
7532        }
7533        return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldLayout, {
7534          data: data,
7535          field: formField,
7536          onChange: onChange
7537        }, formField.id);
7538      })
7539    });
7540  }
7541  
7542  ;// ./node_modules/@wordpress/dataviews/build-module/components/dataform/index.js
7543  /**
7544   * WordPress dependencies
7545   */
7546  
7547  
7548  /**
7549   * Internal dependencies
7550   */
7551  
7552  
7553  
7554  
7555  
7556  function DataForm({
7557    data,
7558    form,
7559    fields,
7560    onChange
7561  }) {
7562    const normalizedFields = (0,external_wp_element_namespaceObject.useMemo)(() => normalizeFields(fields), [fields]);
7563    if (!form.fields) {
7564      return null;
7565    }
7566    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormProvider, {
7567      fields: normalizedFields,
7568      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormLayout, {
7569        data: data,
7570        form: form,
7571        onChange: onChange
7572      })
7573    });
7574  }
7575  
7576  ;// ./node_modules/@wordpress/fields/build-module/fields/order/index.js
7577  /**
7578   * WordPress dependencies
7579   */
7580  
7581  
7582  
7583  /**
7584   * Internal dependencies
7585   */
7586  
7587  const orderField = {
7588    id: 'menu_order',
7589    type: 'integer',
7590    label: (0,external_wp_i18n_namespaceObject.__)('Order'),
7591    description: (0,external_wp_i18n_namespaceObject.__)('Determines the order of pages.')
7592  };
7593  
7594  /**
7595   * Order field for BasePost.
7596   */
7597  /* harmony default export */ const order = (orderField);
7598  
7599  ;// ./node_modules/@wordpress/fields/build-module/actions/reorder-page.js
7600  /**
7601   * WordPress dependencies
7602   */
7603  
7604  
7605  
7606  
7607  
7608  
7609  
7610  
7611  /**
7612   * Internal dependencies
7613   */
7614  
7615  
7616  
7617  const reorder_page_fields = [order];
7618  const formOrderAction = {
7619    fields: ['menu_order']
7620  };
7621  function ReorderModal({
7622    items,
7623    closeModal,
7624    onActionPerformed
7625  }) {
7626    const [item, setItem] = (0,external_wp_element_namespaceObject.useState)(items[0]);
7627    const orderInput = item.menu_order;
7628    const {
7629      editEntityRecord,
7630      saveEditedEntityRecord
7631    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
7632    const {
7633      createSuccessNotice,
7634      createErrorNotice
7635    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
7636    async function onOrder(event) {
7637      event.preventDefault();
7638      if (!isItemValid(item, reorder_page_fields, formOrderAction)) {
7639        return;
7640      }
7641      try {
7642        await editEntityRecord('postType', item.type, item.id, {
7643          menu_order: orderInput
7644        });
7645        closeModal?.();
7646        // Persist edited entity.
7647        await saveEditedEntityRecord('postType', item.type, item.id, {
7648          throwOnError: true
7649        });
7650        createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Order updated.'), {
7651          type: 'snackbar'
7652        });
7653        onActionPerformed?.(items);
7654      } catch (error) {
7655        const typedError = error;
7656        const errorMessage = typedError.message && typedError.code !== 'unknown_error' ? typedError.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while updating the order');
7657        createErrorNotice(errorMessage, {
7658          type: 'snackbar'
7659        });
7660      }
7661    }
7662    const isSaveDisabled = !isItemValid(item, reorder_page_fields, formOrderAction);
7663    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
7664      onSubmit: onOrder,
7665      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
7666        spacing: "5",
7667        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
7668          children: (0,external_wp_i18n_namespaceObject.__)('Determines the order of pages. Pages with the same order value are sorted alphabetically. Negative order values are supported.')
7669        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataForm, {
7670          data: item,
7671          fields: reorder_page_fields,
7672          form: formOrderAction,
7673          onChange: changes => setItem({
7674            ...item,
7675            ...changes
7676          })
7677        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
7678          justify: "right",
7679          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
7680            __next40pxDefaultSize: true,
7681            variant: "tertiary",
7682            onClick: () => {
7683              closeModal?.();
7684            },
7685            children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
7686          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
7687            __next40pxDefaultSize: true,
7688            variant: "primary",
7689            type: "submit",
7690            accessibleWhenDisabled: true,
7691            disabled: isSaveDisabled,
7692            children: (0,external_wp_i18n_namespaceObject.__)('Save')
7693          })]
7694        })]
7695      })
7696    });
7697  }
7698  const reorderPage = {
7699    id: 'order-pages',
7700    label: (0,external_wp_i18n_namespaceObject.__)('Order'),
7701    isEligible({
7702      status
7703    }) {
7704      return status !== 'trash';
7705    },
7706    RenderModal: ReorderModal
7707  };
7708  
7709  /**
7710   * Reorder action for BasePost.
7711   */
7712  /* harmony default export */ const reorder_page = (reorderPage);
7713  
7714  ;// ./node_modules/client-zip/index.js
7715  "stream"in Blob.prototype||Object.defineProperty(Blob.prototype,"stream",{value(){return new Response(this).body}}),"setBigUint64"in DataView.prototype||Object.defineProperty(DataView.prototype,"setBigUint64",{value(e,n,t){const i=Number(0xffffffffn&n),r=Number(n>>32n);this.setUint32(e+(t?0:4),i,t),this.setUint32(e+(t?4:0),r,t)}});var e=e=>new DataView(new ArrayBuffer(e)),n=e=>new Uint8Array(e.buffer||e),t=e=>(new TextEncoder).encode(String(e)),i=e=>Math.min(4294967295,Number(e)),r=e=>Math.min(65535,Number(e));function o(e,i,r){void 0===i||i instanceof Date||(i=new Date(i));const o=void 0!==e;if(r||(r=o?436:509),e instanceof File)return{isFile:o,t:i||new Date(e.lastModified),bytes:e.stream(),mode:r};if(e instanceof Response)return{isFile:o,t:i||new Date(e.headers.get("Last-Modified")||Date.now()),bytes:e.body,mode:r};if(void 0===i)i=new Date;else if(isNaN(i))throw new Error("Invalid modification date.");if(!o)return{isFile:o,t:i,mode:r};if("string"==typeof e)return{isFile:o,t:i,bytes:t(e),mode:r};if(e instanceof Blob)return{isFile:o,t:i,bytes:e.stream(),mode:r};if(e instanceof Uint8Array||e instanceof ReadableStream)return{isFile:o,t:i,bytes:e,mode:r};if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{isFile:o,t:i,bytes:n(e),mode:r};if(Symbol.asyncIterator in e)return{isFile:o,t:i,bytes:f(e[Symbol.asyncIterator]()),mode:r};throw new TypeError("Unsupported input format.")}function f(e,n=e){return new ReadableStream({async pull(n){let t=0;for(;n.desiredSize>t;){const i=await e.next();if(!i.value){n.close();break}{const e=a(i.value);n.enqueue(e),t+=e.byteLength}}},cancel(e){n.throw?.(e)}})}function a(e){return"string"==typeof e?t(e):e instanceof Uint8Array?e:n(e)}function s(e,i,r){let[o,f]=function(e){return e?e instanceof Uint8Array?[e,1]:ArrayBuffer.isView(e)||e instanceof ArrayBuffer?[n(e),1]:[t(e),0]:[void 0,0]}(i);if(e instanceof File)return{i:d(o||t(e.name)),o:BigInt(e.size),u:f};if(e instanceof Response){const n=e.headers.get("content-disposition"),i=n&&n.match(/;\s*filename\*?\s*=\s*(?:UTF-\d+''|)["']?([^;"'\r\n]*)["']?(?:;|$)/i),a=i&&i[1]||e.url&&new URL(e.url).pathname.split("/").findLast(Boolean),s=a&&decodeURIComponent(a),u=r||+e.headers.get("content-length");return{i:d(o||t(s)),o:BigInt(u),u:f}}return o=d(o,void 0!==e||void 0!==r),"string"==typeof e?{i:o,o:BigInt(t(e).length),u:f}:e instanceof Blob?{i:o,o:BigInt(e.size),u:f}:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?{i:o,o:BigInt(e.byteLength),u:f}:{i:o,o:u(e,r),u:f}}function u(e,n){return n>-1?BigInt(n):e?void 0:0n}function d(e,n=1){if(!e||e.every((c=>47===c)))throw new Error("The file must have a name.");if(n)for(;47===e[e.length-1];)e=e.subarray(0,-1);else 47!==e[e.length-1]&&(e=new Uint8Array([...e,47]));return e}var l=new Uint32Array(256);for(let e=0;e<256;++e){let n=e;for(let e=0;e<8;++e)n=n>>>1^(1&n&&3988292384);l[e]=n}function y(e,n=0){n=~n;for(var t=0,i=e.length;t<i;t++)n=n>>>8^l[255&n^e[t]];return~n>>>0}function w(e,n,t=0){const i=e.getSeconds()>>1|e.getMinutes()<<5|e.getHours()<<11,r=e.getDate()|e.getMonth()+1<<5|e.getFullYear()-1980<<9;n.setUint16(t,i,1),n.setUint16(t+2,r,1)}function B({i:e,u:n},t){return 8*(!n||(t??function(e){try{b.decode(e)}catch{return 0}return 1}(e)))}var b=new TextDecoder("utf8",{fatal:1});function p(t,i=0){const r=e(30);return r.setUint32(0,1347093252),r.setUint32(4,754976768|i),w(t.t,r,10),r.setUint16(26,t.i.length,1),n(r)}async function*g(e){let{bytes:n}=e;if("then"in n&&(n=await n),n instanceof Uint8Array)yield n,e.l=y(n,0),e.o=BigInt(n.length);else{e.o=0n;const t=n.getReader();for(;;){const{value:n,done:i}=await t.read();if(i)break;e.l=y(n,e.l),e.o+=BigInt(n.length),yield n}}}function I(t,r){const o=e(16+(r?8:0));return o.setUint32(0,1347094280),o.setUint32(4,t.isFile?t.l:0,1),r?(o.setBigUint64(8,t.o,1),o.setBigUint64(16,t.o,1)):(o.setUint32(8,i(t.o),1),o.setUint32(12,i(t.o),1)),n(o)}function v(t,r,o=0,f=0){const a=e(46);return a.setUint32(0,1347092738),a.setUint32(4,755182848),a.setUint16(8,2048|o),w(t.t,a,12),a.setUint32(16,t.isFile?t.l:0,1),a.setUint32(20,i(t.o),1),a.setUint32(24,i(t.o),1),a.setUint16(28,t.i.length,1),a.setUint16(30,f,1),a.setUint16(40,t.mode|(t.isFile?32768:16384),1),a.setUint32(42,i(r),1),n(a)}function h(t,i,r){const o=e(r);return o.setUint16(0,1,1),o.setUint16(2,r-4,1),16&r&&(o.setBigUint64(4,t.o,1),o.setBigUint64(12,t.o,1)),o.setBigUint64(r-8,i,1),n(o)}function D(e){return e instanceof File||e instanceof Response?[[e],[e]]:[[e.input,e.name,e.size],[e.input,e.lastModified,e.mode]]}var S=e=>function(e){let n=BigInt(22),t=0n,i=0;for(const r of e){if(!r.i)throw new Error("Every file must have a non-empty name.");if(void 0===r.o)throw new Error(`Missing size for file "${(new TextDecoder).decode(r.i)}".`);const e=r.o>=0xffffffffn,o=t>=0xffffffffn;t+=BigInt(46+r.i.length+(e&&8))+r.o,n+=BigInt(r.i.length+46+(12*o|28*e)),i||(i=e)}return(i||t>=0xffffffffn)&&(n+=BigInt(76)),n+t}(function*(e){for(const n of e)yield s(...D(n)[0])}(e));function A(e,n={}){const t={"Content-Type":"application/zip","Content-Disposition":"attachment"};return("bigint"==typeof n.length||Number.isInteger(n.length))&&n.length>0&&(t["Content-Length"]=String(n.length)),n.metadata&&(t["Content-Length"]=String(S(n.metadata))),new Response(N(e,n),{headers:t})}function N(t,a={}){const u=function(e){const n=e[Symbol.iterator in e?Symbol.iterator:Symbol.asyncIterator]();return{async next(){const e=await n.next();if(e.done)return e;const[t,i]=D(e.value);return{done:0,value:Object.assign(o(...i),s(...t))}},throw:n.throw?.bind(n),[Symbol.asyncIterator](){return this}}}(t);return f(async function*(t,o){const f=[];let a=0n,s=0n,u=0;for await(const e of t){const n=B(e,o.buffersAreUTF8);yield p(e,n),yield new Uint8Array(e.i),e.isFile&&(yield*g(e));const t=e.o>=0xffffffffn,i=12*(a>=0xffffffffn)|28*t;yield I(e,t),f.push(v(e,a,n,i)),f.push(e.i),i&&f.push(h(e,a,i)),t&&(a+=8n),s++,a+=BigInt(46+e.i.length)+e.o,u||(u=t)}let d=0n;for(const e of f)yield e,d+=BigInt(e.length);if(u||a>=0xffffffffn){const t=e(76);t.setUint32(0,1347094022),t.setBigUint64(4,BigInt(44),1),t.setUint32(12,755182848),t.setBigUint64(24,s,1),t.setBigUint64(32,s,1),t.setBigUint64(40,d,1),t.setBigUint64(48,a,1),t.setUint32(56,1347094023),t.setBigUint64(64,a+d,1),t.setUint32(72,1,1),yield n(t)}const l=e(22);l.setUint32(0,1347093766),l.setUint16(8,r(s),1),l.setUint16(10,r(s),1),l.setUint32(12,i(d),1),l.setUint32(16,i(a),1),yield n(l)}(u,a),u)}
7716  ;// external ["wp","blob"]
7717  const external_wp_blob_namespaceObject = window["wp"]["blob"];
7718  ;// ./node_modules/@wordpress/icons/build-module/library/download.js
7719  /**
7720   * WordPress dependencies
7721   */
7722  
7723  
7724  const download = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
7725    xmlns: "http://www.w3.org/2000/svg",
7726    viewBox: "0 0 24 24",
7727    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
7728      d: "M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"
7729    })
7730  });
7731  /* harmony default export */ const library_download = (download);
7732  
7733  ;// ./node_modules/@wordpress/fields/build-module/actions/export-pattern.js
7734  /**
7735   * External dependencies
7736   */
7737  
7738  
7739  
7740  /**
7741   * WordPress dependencies
7742   */
7743  
7744  
7745  
7746  
7747  /**
7748   * Internal dependencies
7749   */
7750  
7751  
7752  function getJsonFromItem(item) {
7753    return JSON.stringify({
7754      __file: item.type,
7755      title: getItemTitle(item),
7756      content: typeof item.content === 'string' ? item.content : item.content?.raw,
7757      syncStatus: item.wp_pattern_sync_status
7758    }, null, 2);
7759  }
7760  const exportPattern = {
7761    id: 'export-pattern',
7762    label: (0,external_wp_i18n_namespaceObject.__)('Export as JSON'),
7763    icon: library_download,
7764    supportsBulk: true,
7765    isEligible: item => item.type === 'wp_block',
7766    callback: async items => {
7767      if (items.length === 1) {
7768        return (0,external_wp_blob_namespaceObject.downloadBlob)(`$paramCase(getItemTitle(items[0]) || items[0].slug)}.json`, getJsonFromItem(items[0]), 'application/json');
7769      }
7770      const nameCount = {};
7771      const filesToZip = items.map(item => {
7772        const name = paramCase(getItemTitle(item) || item.slug);
7773        nameCount[name] = (nameCount[name] || 0) + 1;
7774        return {
7775          name: `$name + (nameCount[name] > 1 ? '-' + (nameCount[name] - 1) : '')}.json`,
7776          lastModified: new Date(),
7777          input: getJsonFromItem(item)
7778        };
7779      });
7780      return (0,external_wp_blob_namespaceObject.downloadBlob)((0,external_wp_i18n_namespaceObject.__)('patterns-export') + '.zip', await A(filesToZip).blob(), 'application/zip');
7781    }
7782  };
7783  
7784  /**
7785   * Export action as JSON for Pattern.
7786   */
7787  /* harmony default export */ const export_pattern = (exportPattern);
7788  
7789  ;// ./node_modules/@wordpress/icons/build-module/library/backup.js
7790  /**
7791   * WordPress dependencies
7792   */
7793  
7794  
7795  const backup = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
7796    xmlns: "http://www.w3.org/2000/svg",
7797    viewBox: "0 0 24 24",
7798    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
7799      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"
7800    })
7801  });
7802  /* harmony default export */ const library_backup = (backup);
7803  
7804  ;// ./node_modules/@wordpress/fields/build-module/actions/restore-post.js
7805  /**
7806   * WordPress dependencies
7807   */
7808  
7809  
7810  
7811  
7812  /**
7813   * Internal dependencies
7814   */
7815  
7816  const restorePost = {
7817    id: 'restore',
7818    label: (0,external_wp_i18n_namespaceObject.__)('Restore'),
7819    isPrimary: true,
7820    icon: library_backup,
7821    supportsBulk: true,
7822    isEligible(item) {
7823      return !isTemplateOrTemplatePart(item) && item.type !== 'wp_block' && item.status === 'trash' && item.permissions?.update;
7824    },
7825    async callback(posts, {
7826      registry,
7827      onActionPerformed
7828    }) {
7829      const {
7830        createSuccessNotice,
7831        createErrorNotice
7832      } = registry.dispatch(external_wp_notices_namespaceObject.store);
7833      const {
7834        editEntityRecord,
7835        saveEditedEntityRecord
7836      } = registry.dispatch(external_wp_coreData_namespaceObject.store);
7837      await Promise.allSettled(posts.map(post => {
7838        return editEntityRecord('postType', post.type, post.id, {
7839          status: 'draft'
7840        });
7841      }));
7842      const promiseResult = await Promise.allSettled(posts.map(post => {
7843        return saveEditedEntityRecord('postType', post.type, post.id, {
7844          throwOnError: true
7845        });
7846      }));
7847      if (promiseResult.every(({
7848        status
7849      }) => status === 'fulfilled')) {
7850        let successMessage;
7851        if (posts.length === 1) {
7852          successMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The number of posts. */
7853          (0,external_wp_i18n_namespaceObject.__)('"%s" has been restored.'), getItemTitle(posts[0]));
7854        } else if (posts[0].type === 'page') {
7855          successMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The number of posts. */
7856          (0,external_wp_i18n_namespaceObject.__)('%d pages have been restored.'), posts.length);
7857        } else {
7858          successMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The number of posts. */
7859          (0,external_wp_i18n_namespaceObject.__)('%d posts have been restored.'), posts.length);
7860        }
7861        createSuccessNotice(successMessage, {
7862          type: 'snackbar',
7863          id: 'restore-post-action'
7864        });
7865        if (onActionPerformed) {
7866          onActionPerformed(posts);
7867        }
7868      } else {
7869        // If there was at lease one failure.
7870        let errorMessage;
7871        // If we were trying to move a single post to the trash.
7872        if (promiseResult.length === 1) {
7873          const typedError = promiseResult[0];
7874          if (typedError.reason?.message) {
7875            errorMessage = typedError.reason.message;
7876          } else {
7877            errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while restoring the post.');
7878          }
7879          // If we were trying to move multiple posts to the trash
7880        } else {
7881          const errorMessages = new Set();
7882          const failedPromises = promiseResult.filter(({
7883            status
7884          }) => status === 'rejected');
7885          for (const failedPromise of failedPromises) {
7886            const typedError = failedPromise;
7887            if (typedError.reason?.message) {
7888              errorMessages.add(typedError.reason.message);
7889            }
7890          }
7891          if (errorMessages.size === 0) {
7892            errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while restoring the posts.');
7893          } else if (errorMessages.size === 1) {
7894            errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: an error message */
7895            (0,external_wp_i18n_namespaceObject.__)('An error occurred while restoring the posts: %s'), [...errorMessages][0]);
7896          } else {
7897            errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: a list of comma separated error messages */
7898            (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while restoring the posts: %s'), [...errorMessages].join(','));
7899          }
7900        }
7901        createErrorNotice(errorMessage, {
7902          type: 'snackbar'
7903        });
7904      }
7905    }
7906  };
7907  
7908  /**
7909   * Restore action for PostWithPermissions.
7910   */
7911  /* harmony default export */ const restore_post = (restorePost);
7912  
7913  ;// ./node_modules/@wordpress/fields/build-module/actions/reset-post.js
7914  /**
7915   * WordPress dependencies
7916   */
7917  
7918  
7919  
7920  
7921  
7922  
7923  // @ts-ignore
7924  
7925  
7926  
7927  
7928  
7929  /**
7930   * Internal dependencies
7931   */
7932  
7933  
7934  const reset_post_isTemplateRevertable = templateOrTemplatePart => {
7935    if (!templateOrTemplatePart) {
7936      return false;
7937    }
7938    return templateOrTemplatePart.source === 'custom' && (Boolean(templateOrTemplatePart?.plugin) || templateOrTemplatePart?.has_theme_file);
7939  };
7940  
7941  /**
7942   *  Copied - pasted from https://github.com/WordPress/gutenberg/blob/bf1462ad37d4637ebbf63270b9c244b23c69e2a8/packages/editor/src/store/private-actions.js#L233-L365
7943   *
7944   * @param {Object}  template            The template to revert.
7945   * @param {Object}  [options]
7946   * @param {boolean} [options.allowUndo] Whether to allow the user to undo
7947   *                                      reverting the template. Default true.
7948   */
7949  const revertTemplate = async (template, {
7950    allowUndo = true
7951  } = {}) => {
7952    const noticeId = 'edit-site-template-reverted';
7953    (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store).removeNotice(noticeId);
7954    if (!reset_post_isTemplateRevertable(template)) {
7955      (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('This template is not revertable.'), {
7956        type: 'snackbar'
7957      });
7958      return;
7959    }
7960    try {
7961      const templateEntityConfig = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEntityConfig('postType', template.type);
7962      if (!templateEntityConfig) {
7963        (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error. Please reload.'), {
7964          type: 'snackbar'
7965        });
7966        return;
7967      }
7968      const fileTemplatePath = (0,external_wp_url_namespaceObject.addQueryArgs)(`$templateEntityConfig.baseURL}/$template.id}`, {
7969        context: 'edit',
7970        source: template.origin
7971      });
7972      const fileTemplate = await external_wp_apiFetch_default()({
7973        path: fileTemplatePath
7974      });
7975      if (!fileTemplate) {
7976        (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error. Please reload.'), {
7977          type: 'snackbar'
7978        });
7979        return;
7980      }
7981      const serializeBlocks = ({
7982        blocks: blocksForSerialization = []
7983      }) => (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization);
7984      const edited = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', template.type, template.id);
7985  
7986      // We are fixing up the undo level here to make sure we can undo
7987      // the revert in the header toolbar correctly.
7988      (0,external_wp_data_namespaceObject.dispatch)(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, template.id, {
7989        content: serializeBlocks,
7990        // Required to make the `undo` behave correctly.
7991        blocks: edited.blocks,
7992        // Required to revert the blocks in the editor.
7993        source: 'custom' // required to avoid turning the editor into a dirty state
7994      }, {
7995        undoIgnore: true // Required to merge this edit with the last undo level.
7996      });
7997      const blocks = (0,external_wp_blocks_namespaceObject.parse)(fileTemplate?.content?.raw);
7998      (0,external_wp_data_namespaceObject.dispatch)(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, fileTemplate.id, {
7999        content: serializeBlocks,
8000        blocks,
8001        source: 'theme'
8002      });
8003      if (allowUndo) {
8004        const undoRevert = () => {
8005          (0,external_wp_data_namespaceObject.dispatch)(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, edited.id, {
8006            content: serializeBlocks,
8007            blocks: edited.blocks,
8008            source: 'custom'
8009          });
8010        };
8011        (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Template reset.'), {
8012          type: 'snackbar',
8013          id: noticeId,
8014          actions: [{
8015            label: (0,external_wp_i18n_namespaceObject.__)('Undo'),
8016            onClick: undoRevert
8017          }]
8018        });
8019      }
8020    } catch (error) {
8021      const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('Template revert failed. Please reload.');
8022      (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store).createErrorNotice(errorMessage, {
8023        type: 'snackbar'
8024      });
8025    }
8026  };
8027  const resetPostAction = {
8028    id: 'reset-post',
8029    label: (0,external_wp_i18n_namespaceObject.__)('Reset'),
8030    isEligible: item => {
8031      return isTemplateOrTemplatePart(item) && item?.source === 'custom' && (Boolean(item.type === 'wp_template' && item?.plugin) || item?.has_theme_file);
8032    },
8033    icon: library_backup,
8034    supportsBulk: true,
8035    hideModalHeader: true,
8036    RenderModal: ({
8037      items,
8038      closeModal,
8039      onActionPerformed
8040    }) => {
8041      const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false);
8042      const {
8043        saveEditedEntityRecord
8044      } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
8045      const {
8046        createSuccessNotice,
8047        createErrorNotice
8048      } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
8049      const onConfirm = async () => {
8050        try {
8051          for (const template of items) {
8052            await revertTemplate(template, {
8053              allowUndo: false
8054            });
8055            await saveEditedEntityRecord('postType', template.type, template.id);
8056          }
8057          createSuccessNotice(items.length > 1 ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The number of items. */
8058          (0,external_wp_i18n_namespaceObject.__)('%s items reset.'), items.length) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The template/part's name. */
8059          (0,external_wp_i18n_namespaceObject.__)('"%s" reset.'), getItemTitle(items[0])), {
8060            type: 'snackbar',
8061            id: 'revert-template-action'
8062          });
8063        } catch (error) {
8064          let fallbackErrorMessage;
8065          if (items[0].type === 'wp_template') {
8066            fallbackErrorMessage = items.length === 1 ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the template.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the templates.');
8067          } else {
8068            fallbackErrorMessage = items.length === 1 ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the template part.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the template parts.');
8069          }
8070          const typedError = error;
8071          const errorMessage = typedError.message && typedError.code !== 'unknown_error' ? typedError.message : fallbackErrorMessage;
8072          createErrorNotice(errorMessage, {
8073            type: 'snackbar'
8074          });
8075        }
8076      };
8077      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
8078        spacing: "5",
8079        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
8080          children: (0,external_wp_i18n_namespaceObject.__)('Reset to default and clear all customizations?')
8081        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
8082          justify: "right",
8083          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
8084            __next40pxDefaultSize: true,
8085            variant: "tertiary",
8086            onClick: closeModal,
8087            disabled: isBusy,
8088            accessibleWhenDisabled: true,
8089            children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
8090          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
8091            __next40pxDefaultSize: true,
8092            variant: "primary",
8093            onClick: async () => {
8094              setIsBusy(true);
8095              await onConfirm();
8096              onActionPerformed?.(items);
8097              setIsBusy(false);
8098              closeModal?.();
8099            },
8100            isBusy: isBusy,
8101            disabled: isBusy,
8102            accessibleWhenDisabled: true,
8103            children: (0,external_wp_i18n_namespaceObject.__)('Reset')
8104          })]
8105        })]
8106      });
8107    }
8108  };
8109  
8110  /**
8111   * Reset action for Template and TemplatePart.
8112   */
8113  /* harmony default export */ const reset_post = (resetPostAction);
8114  
8115  ;// ./node_modules/@wordpress/icons/build-module/library/trash.js
8116  /**
8117   * WordPress dependencies
8118   */
8119  
8120  
8121  const trash = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
8122    xmlns: "http://www.w3.org/2000/svg",
8123    viewBox: "0 0 24 24",
8124    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
8125      fillRule: "evenodd",
8126      clipRule: "evenodd",
8127      d: "M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"
8128    })
8129  });
8130  /* harmony default export */ const library_trash = (trash);
8131  
8132  ;// ./node_modules/@wordpress/fields/build-module/mutation/index.js
8133  /**
8134   * WordPress dependencies
8135   */
8136  
8137  
8138  
8139  
8140  /**
8141   * Internal dependencies
8142   */
8143  
8144  function getErrorMessagesFromPromises(allSettledResults) {
8145    const errorMessages = new Set();
8146    // If there was at lease one failure.
8147    if (allSettledResults.length === 1) {
8148      const typedError = allSettledResults[0];
8149      if (typedError.reason?.message) {
8150        errorMessages.add(typedError.reason.message);
8151      }
8152    } else {
8153      const failedPromises = allSettledResults.filter(({
8154        status
8155      }) => status === 'rejected');
8156      for (const failedPromise of failedPromises) {
8157        const typedError = failedPromise;
8158        if (typedError.reason?.message) {
8159          errorMessages.add(typedError.reason.message);
8160        }
8161      }
8162    }
8163    return errorMessages;
8164  }
8165  const deletePostWithNotices = async (posts, notice, callbacks) => {
8166    const {
8167      createSuccessNotice,
8168      createErrorNotice
8169    } = (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store);
8170    const {
8171      deleteEntityRecord
8172    } = (0,external_wp_data_namespaceObject.dispatch)(external_wp_coreData_namespaceObject.store);
8173    const allSettledResults = await Promise.allSettled(posts.map(post => {
8174      return deleteEntityRecord('postType', post.type, post.id, {
8175        force: true
8176      }, {
8177        throwOnError: true
8178      });
8179    }));
8180    // If all the promises were fulfilled with success.
8181    if (allSettledResults.every(({
8182      status
8183    }) => status === 'fulfilled')) {
8184      var _notice$success$type;
8185      let successMessage;
8186      if (allSettledResults.length === 1) {
8187        successMessage = notice.success.messages.getMessage(posts[0]);
8188      } else {
8189        successMessage = notice.success.messages.getBatchMessage(posts);
8190      }
8191      createSuccessNotice(successMessage, {
8192        type: (_notice$success$type = notice.success.type) !== null && _notice$success$type !== void 0 ? _notice$success$type : 'snackbar',
8193        id: notice.success.id
8194      });
8195      callbacks.onActionPerformed?.(posts);
8196    } else {
8197      var _notice$error$type;
8198      const errorMessages = getErrorMessagesFromPromises(allSettledResults);
8199      let errorMessage = '';
8200      if (allSettledResults.length === 1) {
8201        errorMessage = notice.error.messages.getMessage(errorMessages);
8202      } else {
8203        errorMessage = notice.error.messages.getBatchMessage(errorMessages);
8204      }
8205      createErrorNotice(errorMessage, {
8206        type: (_notice$error$type = notice.error.type) !== null && _notice$error$type !== void 0 ? _notice$error$type : 'snackbar',
8207        id: notice.error.id
8208      });
8209      callbacks.onActionError?.();
8210    }
8211  };
8212  const editPostWithNotices = async (postsWithUpdates, notice, callbacks) => {
8213    const {
8214      createSuccessNotice,
8215      createErrorNotice
8216    } = dispatch(noticesStore);
8217    const {
8218      editEntityRecord,
8219      saveEditedEntityRecord
8220    } = dispatch(coreStore);
8221    await Promise.allSettled(postsWithUpdates.map(post => {
8222      return editEntityRecord('postType', post.originalPost.type, post.originalPost.id, {
8223        ...post.changes
8224      });
8225    }));
8226    const allSettledResults = await Promise.allSettled(postsWithUpdates.map(post => {
8227      return saveEditedEntityRecord('postType', post.originalPost.type, post.originalPost.id, {
8228        throwOnError: true
8229      });
8230    }));
8231    // If all the promises were fulfilled with success.
8232    if (allSettledResults.every(({
8233      status
8234    }) => status === 'fulfilled')) {
8235      var _notice$success$type2;
8236      let successMessage;
8237      if (allSettledResults.length === 1) {
8238        successMessage = notice.success.messages.getMessage(postsWithUpdates[0].originalPost);
8239      } else {
8240        successMessage = notice.success.messages.getBatchMessage(postsWithUpdates.map(post => post.originalPost));
8241      }
8242      createSuccessNotice(successMessage, {
8243        type: (_notice$success$type2 = notice.success.type) !== null && _notice$success$type2 !== void 0 ? _notice$success$type2 : 'snackbar',
8244        id: notice.success.id
8245      });
8246      callbacks.onActionPerformed?.(postsWithUpdates.map(post => post.originalPost));
8247    } else {
8248      var _notice$error$type2;
8249      const errorMessages = getErrorMessagesFromPromises(allSettledResults);
8250      let errorMessage = '';
8251      if (allSettledResults.length === 1) {
8252        errorMessage = notice.error.messages.getMessage(errorMessages);
8253      } else {
8254        errorMessage = notice.error.messages.getBatchMessage(errorMessages);
8255      }
8256      createErrorNotice(errorMessage, {
8257        type: (_notice$error$type2 = notice.error.type) !== null && _notice$error$type2 !== void 0 ? _notice$error$type2 : 'snackbar',
8258        id: notice.error.id
8259      });
8260      callbacks.onActionError?.();
8261    }
8262  };
8263  
8264  ;// ./node_modules/@wordpress/fields/build-module/actions/delete-post.js
8265  /**
8266   * WordPress dependencies
8267   */
8268  
8269  
8270  
8271  
8272  // @ts-ignore
8273  
8274  
8275  
8276  /**
8277   * Internal dependencies
8278   */
8279  
8280  
8281  
8282  
8283  const {
8284    PATTERN_TYPES: delete_post_PATTERN_TYPES
8285  } = lock_unlock_unlock(external_wp_patterns_namespaceObject.privateApis);
8286  
8287  // This action is used for templates, patterns and template parts.
8288  // Every other post type uses the similar `trashPostAction` which
8289  // moves the post to trash.
8290  const deletePostAction = {
8291    id: 'delete-post',
8292    label: (0,external_wp_i18n_namespaceObject.__)('Delete'),
8293    isPrimary: true,
8294    icon: library_trash,
8295    isEligible(post) {
8296      if (isTemplateOrTemplatePart(post)) {
8297        return isTemplateRemovable(post);
8298      }
8299      // We can only remove user patterns.
8300      return post.type === delete_post_PATTERN_TYPES.user;
8301    },
8302    supportsBulk: true,
8303    hideModalHeader: true,
8304    RenderModal: ({
8305      items,
8306      closeModal,
8307      onActionPerformed
8308    }) => {
8309      const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false);
8310      const isResetting = items.every(item => isTemplateOrTemplatePart(item) && item?.has_theme_file);
8311      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
8312        spacing: "5",
8313        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
8314          children: items.length > 1 ? (0,external_wp_i18n_namespaceObject.sprintf)(
8315          // translators: %d: number of items to delete.
8316          (0,external_wp_i18n_namespaceObject._n)('Delete %d item?', 'Delete %d items?', items.length), items.length) : (0,external_wp_i18n_namespaceObject.sprintf)(
8317          // translators: %s: The template or template part's title
8318          (0,external_wp_i18n_namespaceObject._x)('Delete "%s"?', 'template part'), getItemTitle(items[0]))
8319        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
8320          justify: "right",
8321          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
8322            variant: "tertiary",
8323            onClick: closeModal,
8324            disabled: isBusy,
8325            accessibleWhenDisabled: true,
8326            __next40pxDefaultSize: true,
8327            children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
8328          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
8329            variant: "primary",
8330            onClick: async () => {
8331              setIsBusy(true);
8332              const notice = {
8333                success: {
8334                  messages: {
8335                    getMessage: item => {
8336                      return isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The template/part's name. */
8337                      (0,external_wp_i18n_namespaceObject.__)('"%s" reset.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(getItemTitle(item))) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: The template/part's name. */
8338                      (0,external_wp_i18n_namespaceObject._x)('"%s" deleted.', 'template part'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(getItemTitle(item)));
8339                    },
8340                    getBatchMessage: () => {
8341                      return isResetting ? (0,external_wp_i18n_namespaceObject.__)('Items reset.') : (0,external_wp_i18n_namespaceObject.__)('Items deleted.');
8342                    }
8343                  }
8344                },
8345                error: {
8346                  messages: {
8347                    getMessage: error => {
8348                      if (error.size === 1) {
8349                        return [...error][0];
8350                      }
8351                      return isResetting ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the item.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the item.');
8352                    },
8353                    getBatchMessage: errors => {
8354                      if (errors.size === 0) {
8355                        return isResetting ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the items.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the items.');
8356                      }
8357                      if (errors.size === 1) {
8358                        return isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: an error message */
8359                        (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the items: %s'), [...errors][0]) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: an error message */
8360                        (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the items: %s'), [...errors][0]);
8361                      }
8362                      return isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: a list of comma separated error messages */
8363                      (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while reverting the items: %s'), [...errors].join(',')) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: a list of comma separated error messages */
8364                      (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while deleting the items: %s'), [...errors].join(','));
8365                    }
8366                  }
8367                }
8368              };
8369              await deletePostWithNotices(items, notice, {
8370                onActionPerformed
8371              });
8372              setIsBusy(false);
8373              closeModal?.();
8374            },
8375            isBusy: isBusy,
8376            disabled: isBusy,
8377            accessibleWhenDisabled: true,
8378            __next40pxDefaultSize: true,
8379            children: (0,external_wp_i18n_namespaceObject.__)('Delete')
8380          })]
8381        })]
8382      });
8383    }
8384  };
8385  
8386  /**
8387   * Delete action for Templates, Patterns and Template Parts.
8388   */
8389  /* harmony default export */ const delete_post = (deletePostAction);
8390  
8391  ;// ./node_modules/@wordpress/fields/build-module/actions/trash-post.js
8392  /**
8393   * WordPress dependencies
8394   */
8395  
8396  
8397  
8398  
8399  
8400  
8401  
8402  /**
8403   * Internal dependencies
8404   */
8405  
8406  
8407  const trash_post_trashPost = {
8408    id: 'move-to-trash',
8409    label: (0,external_wp_i18n_namespaceObject.__)('Move to trash'),
8410    isPrimary: true,
8411    icon: library_trash,
8412    isEligible(item) {
8413      if (isTemplateOrTemplatePart(item) || item.type === 'wp_block') {
8414        return false;
8415      }
8416      return !!item.status && !['auto-draft', 'trash'].includes(item.status) && item.permissions?.delete;
8417    },
8418    supportsBulk: true,
8419    hideModalHeader: true,
8420    RenderModal: ({
8421      items,
8422      closeModal,
8423      onActionPerformed
8424    }) => {
8425      const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false);
8426      const {
8427        createSuccessNotice,
8428        createErrorNotice
8429      } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
8430      const {
8431        deleteEntityRecord
8432      } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
8433      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
8434        spacing: "5",
8435        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
8436          children: items.length === 1 ? (0,external_wp_i18n_namespaceObject.sprintf)(
8437          // translators: %s: The item's title.
8438          (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to move "%s" to the trash?'), getItemTitle(items[0])) : (0,external_wp_i18n_namespaceObject.sprintf)(
8439          // translators: %d: The number of items (2 or more).
8440          (0,external_wp_i18n_namespaceObject._n)('Are you sure you want to move %d item to the trash ?', 'Are you sure you want to move %d items to the trash ?', items.length), items.length)
8441        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
8442          justify: "right",
8443          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
8444            __next40pxDefaultSize: true,
8445            variant: "tertiary",
8446            onClick: closeModal,
8447            disabled: isBusy,
8448            accessibleWhenDisabled: true,
8449            children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
8450          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
8451            __next40pxDefaultSize: true,
8452            variant: "primary",
8453            onClick: async () => {
8454              setIsBusy(true);
8455              const promiseResult = await Promise.allSettled(items.map(item => deleteEntityRecord('postType', item.type, item.id.toString(), {}, {
8456                throwOnError: true
8457              })));
8458              // If all the promises were fulfilled with success.
8459              if (promiseResult.every(({
8460                status
8461              }) => status === 'fulfilled')) {
8462                let successMessage;
8463                if (promiseResult.length === 1) {
8464                  successMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The item's title. */
8465                  (0,external_wp_i18n_namespaceObject.__)('"%s" moved to the trash.'), getItemTitle(items[0]));
8466                } else {
8467                  successMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The number of items. */
8468                  (0,external_wp_i18n_namespaceObject._n)('%s item moved to the trash.', '%s items moved to the trash.', items.length), items.length);
8469                }
8470                createSuccessNotice(successMessage, {
8471                  type: 'snackbar',
8472                  id: 'move-to-trash-action'
8473                });
8474              } else {
8475                // If there was at least one failure.
8476                let errorMessage;
8477                // If we were trying to delete a single item.
8478                if (promiseResult.length === 1) {
8479                  const typedError = promiseResult[0];
8480                  if (typedError.reason?.message) {
8481                    errorMessage = typedError.reason.message;
8482                  } else {
8483                    errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while moving the item to the trash.');
8484                  }
8485                  // If we were trying to delete multiple items.
8486                } else {
8487                  const errorMessages = new Set();
8488                  const failedPromises = promiseResult.filter(({
8489                    status
8490                  }) => status === 'rejected');
8491                  for (const failedPromise of failedPromises) {
8492                    const typedError = failedPromise;
8493                    if (typedError.reason?.message) {
8494                      errorMessages.add(typedError.reason.message);
8495                    }
8496                  }
8497                  if (errorMessages.size === 0) {
8498                    errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while moving the items to the trash.');
8499                  } else if (errorMessages.size === 1) {
8500                    errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: an error message */
8501                    (0,external_wp_i18n_namespaceObject.__)('An error occurred while moving the item to the trash: %s'), [...errorMessages][0]);
8502                  } else {
8503                    errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: a list of comma separated error messages */
8504                    (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while moving the items to the trash: %s'), [...errorMessages].join(','));
8505                  }
8506                }
8507                createErrorNotice(errorMessage, {
8508                  type: 'snackbar'
8509                });
8510              }
8511              if (onActionPerformed) {
8512                onActionPerformed(items);
8513              }
8514              setIsBusy(false);
8515              closeModal?.();
8516            },
8517            isBusy: isBusy,
8518            disabled: isBusy,
8519            accessibleWhenDisabled: true,
8520            children: (0,external_wp_i18n_namespaceObject._x)('Trash', 'verb')
8521          })]
8522        })]
8523      });
8524    }
8525  };
8526  
8527  /**
8528   * Trash action for PostWithPermissions.
8529   */
8530  /* harmony default export */ const trash_post = (trash_post_trashPost);
8531  
8532  ;// ./node_modules/@wordpress/fields/build-module/actions/permanently-delete-post.js
8533  /**
8534   * WordPress dependencies
8535   */
8536  
8537  
8538  
8539  
8540  
8541  
8542  
8543  
8544  
8545  /**
8546   * Internal dependencies
8547   */
8548  
8549  
8550  const permanentlyDeletePost = {
8551    id: 'permanently-delete',
8552    label: (0,external_wp_i18n_namespaceObject.__)('Permanently delete'),
8553    supportsBulk: true,
8554    icon: library_trash,
8555    isEligible(item) {
8556      if (isTemplateOrTemplatePart(item) || item.type === 'wp_block') {
8557        return false;
8558      }
8559      const {
8560        status,
8561        permissions
8562      } = item;
8563      return status === 'trash' && permissions?.delete;
8564    },
8565    hideModalHeader: true,
8566    RenderModal: ({
8567      items,
8568      closeModal,
8569      onActionPerformed
8570    }) => {
8571      const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false);
8572      const {
8573        createSuccessNotice,
8574        createErrorNotice
8575      } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
8576      const {
8577        deleteEntityRecord
8578      } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
8579      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
8580        spacing: "5",
8581        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
8582          children: items.length > 1 ? (0,external_wp_i18n_namespaceObject.sprintf)(
8583          // translators: %d: number of items to delete.
8584          (0,external_wp_i18n_namespaceObject._n)('Are you sure you want to permanently delete %d item?', 'Are you sure you want to permanently delete %d items?', items.length), items.length) : (0,external_wp_i18n_namespaceObject.sprintf)(
8585          // translators: %s: The post's title
8586          (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to permanently delete "%s"?'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(getItemTitle(items[0])))
8587        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
8588          justify: "right",
8589          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
8590            variant: "tertiary",
8591            onClick: closeModal,
8592            disabled: isBusy,
8593            accessibleWhenDisabled: true,
8594            __next40pxDefaultSize: true,
8595            children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
8596          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
8597            variant: "primary",
8598            onClick: async () => {
8599              setIsBusy(true);
8600              const promiseResult = await Promise.allSettled(items.map(post => deleteEntityRecord('postType', post.type, post.id, {
8601                force: true
8602              }, {
8603                throwOnError: true
8604              })));
8605  
8606              // If all the promises were fulfilled with success.
8607              if (promiseResult.every(({
8608                status
8609              }) => status === 'fulfilled')) {
8610                let successMessage;
8611                if (promiseResult.length === 1) {
8612                  successMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The posts's title. */
8613                  (0,external_wp_i18n_namespaceObject.__)('"%s" permanently deleted.'), getItemTitle(items[0]));
8614                } else {
8615                  successMessage = (0,external_wp_i18n_namespaceObject.__)('The items were permanently deleted.');
8616                }
8617                createSuccessNotice(successMessage, {
8618                  type: 'snackbar',
8619                  id: 'permanently-delete-post-action'
8620                });
8621                onActionPerformed?.(items);
8622              } else {
8623                // If there was at lease one failure.
8624                let errorMessage;
8625                // If we were trying to permanently delete a single post.
8626                if (promiseResult.length === 1) {
8627                  const typedError = promiseResult[0];
8628                  if (typedError.reason?.message) {
8629                    errorMessage = typedError.reason.message;
8630                  } else {
8631                    errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while permanently deleting the item.');
8632                  }
8633                  // If we were trying to permanently delete multiple posts
8634                } else {
8635                  const errorMessages = new Set();
8636                  const failedPromises = promiseResult.filter(({
8637                    status
8638                  }) => status === 'rejected');
8639                  for (const failedPromise of failedPromises) {
8640                    const typedError = failedPromise;
8641                    if (typedError.reason?.message) {
8642                      errorMessages.add(typedError.reason.message);
8643                    }
8644                  }
8645                  if (errorMessages.size === 0) {
8646                    errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while permanently deleting the items.');
8647                  } else if (errorMessages.size === 1) {
8648                    errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: an error message */
8649                    (0,external_wp_i18n_namespaceObject.__)('An error occurred while permanently deleting the items: %s'), [...errorMessages][0]);
8650                  } else {
8651                    errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: a list of comma separated error messages */
8652                    (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while permanently deleting the items: %s'), [...errorMessages].join(','));
8653                  }
8654                }
8655                createErrorNotice(errorMessage, {
8656                  type: 'snackbar'
8657                });
8658              }
8659              setIsBusy(false);
8660              closeModal?.();
8661            },
8662            isBusy: isBusy,
8663            disabled: isBusy,
8664            accessibleWhenDisabled: true,
8665            __next40pxDefaultSize: true,
8666            children: (0,external_wp_i18n_namespaceObject.__)('Delete permanently')
8667          })]
8668        })]
8669      });
8670    }
8671  };
8672  
8673  /**
8674   * Delete action for PostWithPermissions.
8675   */
8676  /* harmony default export */ const permanently_delete_post = (permanentlyDeletePost);
8677  
8678  ;// external ["wp","mediaUtils"]
8679  const external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"];
8680  ;// ./node_modules/@wordpress/icons/build-module/library/line-solid.js
8681  /**
8682   * WordPress dependencies
8683   */
8684  
8685  
8686  const lineSolid = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
8687    xmlns: "http://www.w3.org/2000/svg",
8688    viewBox: "0 0 24 24",
8689    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
8690      d: "M5 11.25h14v1.5H5z"
8691    })
8692  });
8693  /* harmony default export */ const line_solid = (lineSolid);
8694  
8695  ;// ./node_modules/@wordpress/fields/build-module/fields/featured-image/featured-image-edit.js
8696  /**
8697   * WordPress dependencies
8698   */
8699  
8700  
8701  
8702  // @ts-ignore
8703  
8704  
8705  
8706  
8707  
8708  /**
8709   * Internal dependencies
8710   */
8711  
8712  const FeaturedImageEdit = ({
8713    data,
8714    field,
8715    onChange
8716  }) => {
8717    const {
8718      id
8719    } = field;
8720    const value = field.getValue({
8721      item: data
8722    });
8723    const media = (0,external_wp_data_namespaceObject.useSelect)(select => {
8724      const {
8725        getEntityRecord
8726      } = select(external_wp_coreData_namespaceObject.store);
8727      return getEntityRecord('root', 'media', value);
8728    }, [value]);
8729    const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({
8730      [id]: newValue
8731    }), [id, onChange]);
8732    const url = media?.source_url;
8733    const title = media?.title?.rendered;
8734    const ref = (0,external_wp_element_namespaceObject.useRef)(null);
8735    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("fieldset", {
8736      className: "fields-controls__featured-image",
8737      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
8738        className: "fields-controls__featured-image-container",
8739        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_mediaUtils_namespaceObject.MediaUpload, {
8740          onSelect: selectedMedia => {
8741            onChangeControl(selectedMedia.id);
8742          },
8743          allowedTypes: ['image'],
8744          render: ({
8745            open
8746          }) => {
8747            return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
8748              ref: ref,
8749              role: "button",
8750              tabIndex: -1,
8751              onClick: () => {
8752                open();
8753              },
8754              onKeyDown: open,
8755              children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalGrid, {
8756                rowGap: 0,
8757                columnGap: 8,
8758                templateColumns: "24px 1fr 24px",
8759                children: [url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
8760                  children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
8761                    className: "fields-controls__featured-image-image",
8762                    alt: "",
8763                    width: 24,
8764                    height: 24,
8765                    src: url
8766                  }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
8767                    className: "fields-controls__featured-image-title",
8768                    children: title
8769                  })]
8770                }), !url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
8771                  children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
8772                    className: "fields-controls__featured-image-placeholder",
8773                    style: {
8774                      width: '24px',
8775                      height: '24px'
8776                    }
8777                  }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
8778                    className: "fields-controls__featured-image-title",
8779                    children: (0,external_wp_i18n_namespaceObject.__)('Choose an image…')
8780                  })]
8781                }), url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
8782                  children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
8783                    size: "small",
8784                    className: "fields-controls__featured-image-remove-button",
8785                    icon: line_solid,
8786                    onClick: event => {
8787                      event.stopPropagation();
8788                      onChangeControl(0);
8789                    }
8790                  })
8791                })]
8792              })
8793            });
8794          }
8795        })
8796      })
8797    });
8798  };
8799  
8800  ;// ./node_modules/@wordpress/fields/build-module/fields/featured-image/featured-image-view.js
8801  /**
8802   * WordPress dependencies
8803   */
8804  
8805  
8806  
8807  /**
8808   * Internal dependencies
8809   */
8810  
8811  const FeaturedImageView = ({
8812    item
8813  }) => {
8814    const mediaId = item.featured_media;
8815    const media = (0,external_wp_data_namespaceObject.useSelect)(select => {
8816      const {
8817        getEntityRecord
8818      } = select(external_wp_coreData_namespaceObject.store);
8819      return mediaId ? getEntityRecord('root', 'media', mediaId) : null;
8820    }, [mediaId]);
8821    const url = media?.source_url;
8822    if (url) {
8823      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
8824        className: "fields-controls__featured-image-image",
8825        src: url,
8826        alt: ""
8827      });
8828    }
8829    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
8830      className: "fields-controls__featured-image-placeholder"
8831    });
8832  };
8833  
8834  ;// ./node_modules/@wordpress/fields/build-module/fields/featured-image/index.js
8835  /**
8836   * WordPress dependencies
8837   */
8838  
8839  
8840  
8841  /**
8842   * Internal dependencies
8843   */
8844  
8845  
8846  
8847  const featuredImageField = {
8848    id: 'featured_media',
8849    type: 'media',
8850    label: (0,external_wp_i18n_namespaceObject.__)('Featured Image'),
8851    Edit: FeaturedImageEdit,
8852    render: FeaturedImageView,
8853    enableSorting: false
8854  };
8855  
8856  /**
8857   * Featured Image field for BasePost.
8858   */
8859  /* harmony default export */ const featured_image = (featuredImageField);
8860  
8861  ;// ./node_modules/clsx/dist/clsx.mjs
8862  function clsx_r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=clsx_r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=clsx_r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx);
8863  ;// ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js
8864  /**
8865   * WordPress dependencies
8866   */
8867  
8868  
8869  const commentAuthorAvatar = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
8870    xmlns: "http://www.w3.org/2000/svg",
8871    viewBox: "0 0 24 24",
8872    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
8873      fillRule: "evenodd",
8874      d: "M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",
8875      clipRule: "evenodd"
8876    })
8877  });
8878  /* harmony default export */ const comment_author_avatar = (commentAuthorAvatar);
8879  
8880  ;// ./node_modules/@wordpress/fields/build-module/fields/author/author-view.js
8881  /**
8882   * External dependencies
8883   */
8884  
8885  
8886  /**
8887   * WordPress dependencies
8888   */
8889  
8890  
8891  
8892  
8893  
8894  
8895  
8896  /**
8897   * Internal dependencies
8898   */
8899  
8900  function AuthorView({
8901    item
8902  }) {
8903    const {
8904      text,
8905      imageUrl
8906    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
8907      const {
8908        getEntityRecord
8909      } = select(external_wp_coreData_namespaceObject.store);
8910      let user;
8911      if (!!item.author) {
8912        user = getEntityRecord('root', 'user', item.author);
8913      }
8914      return {
8915        imageUrl: user?.avatar_urls?.[48],
8916        text: user?.name
8917      };
8918    }, [item]);
8919    const [isImageLoaded, setIsImageLoaded] = (0,external_wp_element_namespaceObject.useState)(false);
8920    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
8921      alignment: "left",
8922      spacing: 0,
8923      children: [!!imageUrl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
8924        className: dist_clsx('page-templates-author-field__avatar', {
8925          'is-loaded': isImageLoaded
8926        }),
8927        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
8928          onLoad: () => setIsImageLoaded(true),
8929          alt: (0,external_wp_i18n_namespaceObject.__)('Author avatar'),
8930          src: imageUrl
8931        })
8932      }), !imageUrl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
8933        className: "page-templates-author-field__icon",
8934        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
8935          icon: comment_author_avatar
8936        })
8937      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
8938        className: "page-templates-author-field__name",
8939        children: text
8940      })]
8941    });
8942  }
8943  /* harmony default export */ const author_view = (AuthorView);
8944  
8945  ;// ./node_modules/@wordpress/fields/build-module/fields/author/index.js
8946  /**
8947   * WordPress dependencies
8948   */
8949  
8950  
8951  
8952  /**
8953   * Internal dependencies
8954   */
8955  
8956  
8957  const authorField = {
8958    label: (0,external_wp_i18n_namespaceObject.__)('Author'),
8959    id: 'author',
8960    type: 'integer',
8961    elements: [],
8962    render: author_view,
8963    sort: (a, b, direction) => {
8964      const nameA = a._embedded?.author?.[0]?.name || '';
8965      const nameB = b._embedded?.author?.[0]?.name || '';
8966      return direction === 'asc' ? nameA.localeCompare(nameB) : nameB.localeCompare(nameA);
8967    }
8968  };
8969  
8970  /**
8971   * Author field for BasePost.
8972   */
8973  /* harmony default export */ const author = (authorField);
8974  
8975  ;// ./node_modules/@wordpress/icons/build-module/library/drafts.js
8976  /**
8977   * WordPress dependencies
8978   */
8979  
8980  
8981  const drafts = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
8982    xmlns: "http://www.w3.org/2000/svg",
8983    viewBox: "0 0 24 24",
8984    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
8985      fillRule: "evenodd",
8986      clipRule: "evenodd",
8987      d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z"
8988    })
8989  });
8990  /* harmony default export */ const library_drafts = (drafts);
8991  
8992  ;// ./node_modules/@wordpress/icons/build-module/library/scheduled.js
8993  /**
8994   * WordPress dependencies
8995   */
8996  
8997  
8998  const scheduled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
8999    xmlns: "http://www.w3.org/2000/svg",
9000    viewBox: "0 0 24 24",
9001    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
9002      fillRule: "evenodd",
9003      clipRule: "evenodd",
9004      d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z"
9005    })
9006  });
9007  /* harmony default export */ const library_scheduled = (scheduled);
9008  
9009  ;// ./node_modules/@wordpress/icons/build-module/library/pending.js
9010  /**
9011   * WordPress dependencies
9012   */
9013  
9014  
9015  const pending = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
9016    xmlns: "http://www.w3.org/2000/svg",
9017    viewBox: "0 0 24 24",
9018    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
9019      fillRule: "evenodd",
9020      clipRule: "evenodd",
9021      d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z"
9022    })
9023  });
9024  /* harmony default export */ const library_pending = (pending);
9025  
9026  ;// ./node_modules/@wordpress/icons/build-module/library/not-allowed.js
9027  /**
9028   * WordPress dependencies
9029   */
9030  
9031  
9032  const notAllowed = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
9033    xmlns: "http://www.w3.org/2000/svg",
9034    viewBox: "0 0 24 24",
9035    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
9036      fillRule: "evenodd",
9037      clipRule: "evenodd",
9038      d: "M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z"
9039    })
9040  });
9041  /* harmony default export */ const not_allowed = (notAllowed);
9042  
9043  ;// ./node_modules/@wordpress/icons/build-module/library/published.js
9044  /**
9045   * WordPress dependencies
9046   */
9047  
9048  
9049  const published = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
9050    xmlns: "http://www.w3.org/2000/svg",
9051    viewBox: "0 0 24 24",
9052    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
9053      fillRule: "evenodd",
9054      clipRule: "evenodd",
9055      d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z"
9056    })
9057  });
9058  /* harmony default export */ const library_published = (published);
9059  
9060  ;// ./node_modules/@wordpress/fields/build-module/fields/status/status-elements.js
9061  /**
9062   * WordPress dependencies
9063   */
9064  
9065  
9066  
9067  // See https://github.com/WordPress/gutenberg/issues/55886
9068  // We do not support custom statutes at the moment.
9069  const STATUSES = [{
9070    value: 'draft',
9071    label: (0,external_wp_i18n_namespaceObject.__)('Draft'),
9072    icon: library_drafts,
9073    description: (0,external_wp_i18n_namespaceObject.__)('Not ready to publish.')
9074  }, {
9075    value: 'future',
9076    label: (0,external_wp_i18n_namespaceObject.__)('Scheduled'),
9077    icon: library_scheduled,
9078    description: (0,external_wp_i18n_namespaceObject.__)('Publish automatically on a chosen date.')
9079  }, {
9080    value: 'pending',
9081    label: (0,external_wp_i18n_namespaceObject.__)('Pending Review'),
9082    icon: library_pending,
9083    description: (0,external_wp_i18n_namespaceObject.__)('Waiting for review before publishing.')
9084  }, {
9085    value: 'private',
9086    label: (0,external_wp_i18n_namespaceObject.__)('Private'),
9087    icon: not_allowed,
9088    description: (0,external_wp_i18n_namespaceObject.__)('Only visible to site admins and editors.')
9089  }, {
9090    value: 'publish',
9091    label: (0,external_wp_i18n_namespaceObject.__)('Published'),
9092    icon: library_published,
9093    description: (0,external_wp_i18n_namespaceObject.__)('Visible to everyone.')
9094  }, {
9095    value: 'trash',
9096    label: (0,external_wp_i18n_namespaceObject.__)('Trash'),
9097    icon: library_trash
9098  }];
9099  /* harmony default export */ const status_elements = (STATUSES);
9100  
9101  ;// ./node_modules/@wordpress/fields/build-module/fields/status/status-view.js
9102  /**
9103   * WordPress dependencies
9104   */
9105  
9106  
9107  /**
9108   * Internal dependencies
9109   */
9110  
9111  
9112  
9113  function StatusView({
9114    item
9115  }) {
9116    const status = status_elements.find(({
9117      value
9118    }) => value === item.status);
9119    const label = status?.label || item.status;
9120    const icon = status?.icon;
9121    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
9122      alignment: "left",
9123      spacing: 0,
9124      children: [icon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
9125        className: "edit-site-post-list__status-icon",
9126        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
9127          icon: icon
9128        })
9129      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
9130        children: label
9131      })]
9132    });
9133  }
9134  /* harmony default export */ const status_view = (StatusView);
9135  
9136  ;// ./node_modules/@wordpress/fields/build-module/fields/status/index.js
9137  /**
9138   * WordPress dependencies
9139   */
9140  
9141  
9142  
9143  /**
9144   * Internal dependencies
9145   */
9146  
9147  
9148  
9149  const OPERATOR_IS_ANY = 'isAny';
9150  const statusField = {
9151    label: (0,external_wp_i18n_namespaceObject.__)('Status'),
9152    id: 'status',
9153    type: 'text',
9154    elements: status_elements,
9155    render: status_view,
9156    Edit: 'radio',
9157    enableSorting: false,
9158    filterBy: {
9159      operators: [OPERATOR_IS_ANY]
9160    }
9161  };
9162  
9163  /**
9164   * Status field for BasePost.
9165   */
9166  /* harmony default export */ const fields_status = (statusField);
9167  
9168  ;// ./node_modules/@wordpress/fields/build-module/fields/date/date-view.js
9169  /**
9170   * WordPress dependencies
9171   */
9172  
9173  
9174  
9175  
9176  /**
9177   * Internal dependencies
9178   */
9179  
9180  const getFormattedDate = dateToDisplay => (0,external_wp_date_namespaceObject.dateI18n)((0,external_wp_date_namespaceObject.getSettings)().formats.datetimeAbbreviated, (0,external_wp_date_namespaceObject.getDate)(dateToDisplay));
9181  const DateView = ({
9182    item
9183  }) => {
9184    var _item$status, _item$modified, _item$date4, _item$date5;
9185    const isDraftOrPrivate = ['draft', 'private'].includes((_item$status = item.status) !== null && _item$status !== void 0 ? _item$status : '');
9186    if (isDraftOrPrivate) {
9187      var _item$date;
9188      return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: page creation or modification date. */
9189      (0,external_wp_i18n_namespaceObject.__)('<span>Modified: <time>%s</time></span>'), getFormattedDate((_item$date = item.date) !== null && _item$date !== void 0 ? _item$date : null)), {
9190        span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}),
9191        time: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {})
9192      });
9193    }
9194    const isScheduled = item.status === 'future';
9195    if (isScheduled) {
9196      var _item$date2;
9197      return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: page creation date */
9198      (0,external_wp_i18n_namespaceObject.__)('<span>Scheduled: <time>%s</time></span>'), getFormattedDate((_item$date2 = item.date) !== null && _item$date2 !== void 0 ? _item$date2 : null)), {
9199        span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}),
9200        time: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {})
9201      });
9202    }
9203    const isPublished = item.status === 'publish';
9204    if (isPublished) {
9205      var _item$date3;
9206      return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: page creation time */
9207      (0,external_wp_i18n_namespaceObject.__)('<span>Published: <time>%s</time></span>'), getFormattedDate((_item$date3 = item.date) !== null && _item$date3 !== void 0 ? _item$date3 : null)), {
9208        span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}),
9209        time: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {})
9210      });
9211    }
9212  
9213    // Pending posts show the modified date if it's newer.
9214    const dateToDisplay = (0,external_wp_date_namespaceObject.getDate)((_item$modified = item.modified) !== null && _item$modified !== void 0 ? _item$modified : null) > (0,external_wp_date_namespaceObject.getDate)((_item$date4 = item.date) !== null && _item$date4 !== void 0 ? _item$date4 : null) ? item.modified : item.date;
9215    const isPending = item.status === 'pending';
9216    if (isPending) {
9217      return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: page creation or modification date. */
9218      (0,external_wp_i18n_namespaceObject.__)('<span>Modified: <time>%s</time></span>'), getFormattedDate(dateToDisplay !== null && dateToDisplay !== void 0 ? dateToDisplay : null)), {
9219        span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}),
9220        time: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {})
9221      });
9222    }
9223  
9224    // Unknow status.
9225    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {
9226      children: getFormattedDate((_item$date5 = item.date) !== null && _item$date5 !== void 0 ? _item$date5 : null)
9227    });
9228  };
9229  /* harmony default export */ const date_view = (DateView);
9230  
9231  ;// ./node_modules/@wordpress/fields/build-module/fields/date/index.js
9232  /**
9233   * WordPress dependencies
9234   */
9235  
9236  
9237  
9238  /**
9239   * Internal dependencies
9240   */
9241  
9242  
9243  const dateField = {
9244    id: 'date',
9245    type: 'datetime',
9246    label: (0,external_wp_i18n_namespaceObject.__)('Date'),
9247    render: date_view
9248  };
9249  
9250  /**
9251   * Date field for BasePost.
9252   */
9253  /* harmony default export */ const date = (dateField);
9254  
9255  ;// ./node_modules/@wordpress/icons/build-module/library/copy-small.js
9256  /**
9257   * WordPress dependencies
9258   */
9259  
9260  
9261  const copySmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
9262    xmlns: "http://www.w3.org/2000/svg",
9263    viewBox: "0 0 24 24",
9264    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
9265      fillRule: "evenodd",
9266      clipRule: "evenodd",
9267      d: "M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z"
9268    })
9269  });
9270  /* harmony default export */ const copy_small = (copySmall);
9271  
9272  ;// ./node_modules/@wordpress/fields/build-module/fields/slug/utils.js
9273  /**
9274   * WordPress dependencies
9275   */
9276  
9277  /**
9278   * Internal dependencies
9279   */
9280  
9281  
9282  const getSlug = item => {
9283    if (typeof item !== 'object') {
9284      return '';
9285    }
9286    return item.slug || (0,external_wp_url_namespaceObject.cleanForSlug)(getItemTitle(item)) || item.id.toString();
9287  };
9288  
9289  ;// ./node_modules/@wordpress/fields/build-module/fields/slug/slug-edit.js
9290  /**
9291   * WordPress dependencies
9292   */
9293  
9294  
9295  
9296  
9297  
9298  
9299  
9300  
9301  
9302  /**
9303   * Internal dependencies
9304   */
9305  
9306  
9307  
9308  const SlugEdit = ({
9309    field,
9310    onChange,
9311    data
9312  }) => {
9313    const {
9314      id
9315    } = field;
9316    const slug = field.getValue({
9317      item: data
9318    }) || getSlug(data);
9319    const permalinkTemplate = data.permalink_template || '';
9320    const PERMALINK_POSTNAME_REGEX = /%(?:postname|pagename)%/;
9321    const [prefix, suffix] = permalinkTemplate.split(PERMALINK_POSTNAME_REGEX);
9322    const permalinkPrefix = prefix;
9323    const permalinkSuffix = suffix;
9324    const isEditable = PERMALINK_POSTNAME_REGEX.test(permalinkTemplate);
9325    const originalSlugRef = (0,external_wp_element_namespaceObject.useRef)(slug);
9326    const slugToDisplay = slug || originalSlugRef.current;
9327    const permalink = isEditable ? `$permalinkPrefix}$slugToDisplay}$permalinkSuffix}` : (0,external_wp_url_namespaceObject.safeDecodeURIComponent)(data.link || '');
9328    (0,external_wp_element_namespaceObject.useEffect)(() => {
9329      if (slug && originalSlugRef.current === undefined) {
9330        originalSlugRef.current = slug;
9331      }
9332    }, [slug]);
9333    const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({
9334      [id]: newValue
9335    }), [id, onChange]);
9336    const {
9337      createNotice
9338    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
9339    const copyButtonRef = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(permalink, () => {
9340      createNotice('info', (0,external_wp_i18n_namespaceObject.__)('Copied Permalink to clipboard.'), {
9341        isDismissible: true,
9342        type: 'snackbar'
9343      });
9344    });
9345    const postUrlSlugDescriptionId = 'editor-post-url__slug-description-' + (0,external_wp_compose_namespaceObject.useInstanceId)(SlugEdit);
9346    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", {
9347      className: "fields-controls__slug",
9348      children: [isEditable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
9349        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
9350          spacing: "0px",
9351          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
9352            children: (0,external_wp_i18n_namespaceObject.__)('Customize the last part of the Permalink.')
9353          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
9354            href: "https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink",
9355            children: (0,external_wp_i18n_namespaceObject.__)('Learn more')
9356          })]
9357        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, {
9358          __next40pxDefaultSize: true,
9359          prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, {
9360            children: "/"
9361          }),
9362          suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
9363            __next40pxDefaultSize: true,
9364            icon: copy_small,
9365            ref: copyButtonRef,
9366            label: (0,external_wp_i18n_namespaceObject.__)('Copy')
9367          }),
9368          label: (0,external_wp_i18n_namespaceObject.__)('Link'),
9369          hideLabelFromVision: true,
9370          value: slug,
9371          autoComplete: "off",
9372          spellCheck: "false",
9373          type: "text",
9374          className: "fields-controls__slug-input",
9375          onChange: newValue => {
9376            onChangeControl(newValue);
9377          },
9378          onBlur: () => {
9379            if (slug === '') {
9380              onChangeControl(originalSlugRef.current);
9381            }
9382          },
9383          "aria-describedby": postUrlSlugDescriptionId
9384        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
9385          className: "fields-controls__slug-help",
9386          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
9387            className: "fields-controls__slug-help-visual-label",
9388            children: (0,external_wp_i18n_namespaceObject.__)('Permalink:')
9389          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ExternalLink, {
9390            className: "fields-controls__slug-help-link",
9391            href: permalink,
9392            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
9393              className: "fields-controls__slug-help-prefix",
9394              children: permalinkPrefix
9395            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
9396              className: "fields-controls__slug-help-slug",
9397              children: slugToDisplay
9398            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
9399              className: "fields-controls__slug-help-suffix",
9400              children: permalinkSuffix
9401            })]
9402          })]
9403        })]
9404      }), !isEditable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
9405        className: "fields-controls__slug-help",
9406        href: permalink,
9407        children: permalink
9408      })]
9409    });
9410  };
9411  /* harmony default export */ const slug_edit = (SlugEdit);
9412  
9413  ;// ./node_modules/@wordpress/fields/build-module/fields/slug/slug-view.js
9414  /**
9415   * WordPress dependencies
9416   */
9417  
9418  
9419  /**
9420   * Internal dependencies
9421   */
9422  
9423  
9424  const SlugView = ({
9425    item
9426  }) => {
9427    const slug = getSlug(item);
9428    const originalSlugRef = (0,external_wp_element_namespaceObject.useRef)(slug);
9429    (0,external_wp_element_namespaceObject.useEffect)(() => {
9430      if (slug && originalSlugRef.current === undefined) {
9431        originalSlugRef.current = slug;
9432      }
9433    }, [slug]);
9434    const slugToDisplay = slug || originalSlugRef.current;
9435    return `$slugToDisplay}`;
9436  };
9437  /* harmony default export */ const slug_view = (SlugView);
9438  
9439  ;// ./node_modules/@wordpress/fields/build-module/fields/slug/index.js
9440  /**
9441   * WordPress dependencies
9442   */
9443  
9444  
9445  
9446  /**
9447   * Internal dependencies
9448   */
9449  
9450  
9451  
9452  const slugField = {
9453    id: 'slug',
9454    type: 'text',
9455    label: (0,external_wp_i18n_namespaceObject.__)('Slug'),
9456    Edit: slug_edit,
9457    render: slug_view
9458  };
9459  
9460  /**
9461   * Slug field for BasePost.
9462   */
9463  /* harmony default export */ const slug = (slugField);
9464  
9465  // EXTERNAL MODULE: ./node_modules/remove-accents/index.js
9466  var remove_accents = __webpack_require__(9681);
9467  var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
9468  ;// ./node_modules/@wordpress/fields/build-module/fields/parent/utils.js
9469  /**
9470   * WordPress dependencies
9471   */
9472  
9473  
9474  
9475  /**
9476   * Internal dependencies
9477   */
9478  
9479  function getTitleWithFallbackName(post) {
9480    return typeof post.title === 'object' && 'rendered' in post.title && post.title.rendered ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(post.title.rendered) : `#$post?.id} (${(0,external_wp_i18n_namespaceObject.__)('no title')})`;
9481  }
9482  
9483  ;// ./node_modules/@wordpress/fields/build-module/fields/parent/parent-edit.js
9484  /**
9485   * External dependencies
9486   */
9487  
9488  
9489  /**
9490   * WordPress dependencies
9491   */
9492  
9493  
9494  
9495  // @ts-ignore
9496  
9497  
9498  
9499  
9500  
9501  
9502  /**
9503   * Internal dependencies
9504   */
9505  
9506  
9507  
9508  function buildTermsTree(flatTerms) {
9509    const flatTermsWithParentAndChildren = flatTerms.map(term => {
9510      return {
9511        children: [],
9512        ...term
9513      };
9514    });
9515  
9516    // All terms should have a `parent` because we're about to index them by it.
9517    if (flatTermsWithParentAndChildren.some(({
9518      parent
9519    }) => parent === null || parent === undefined)) {
9520      return flatTermsWithParentAndChildren;
9521    }
9522    const termsByParent = flatTermsWithParentAndChildren.reduce((acc, term) => {
9523      const {
9524        parent
9525      } = term;
9526      if (!acc[parent]) {
9527        acc[parent] = [];
9528      }
9529      acc[parent].push(term);
9530      return acc;
9531    }, {});
9532    const fillWithChildren = terms => {
9533      return terms.map(term => {
9534        const children = termsByParent[term.id];
9535        return {
9536          ...term,
9537          children: children && children.length ? fillWithChildren(children) : []
9538        };
9539      });
9540    };
9541    return fillWithChildren(termsByParent['0'] || []);
9542  }
9543  const getItemPriority = (name, searchValue) => {
9544    const normalizedName = remove_accents_default()(name || '').toLowerCase();
9545    const normalizedSearch = remove_accents_default()(searchValue || '').toLowerCase();
9546    if (normalizedName === normalizedSearch) {
9547      return 0;
9548    }
9549    if (normalizedName.startsWith(normalizedSearch)) {
9550      return normalizedName.length;
9551    }
9552    return Infinity;
9553  };
9554  function PageAttributesParent({
9555    data,
9556    onChangeControl
9557  }) {
9558    const [fieldValue, setFieldValue] = (0,external_wp_element_namespaceObject.useState)(null);
9559    const pageId = data.parent;
9560    const postId = data.id;
9561    const postTypeSlug = data.type;
9562    const {
9563      parentPostTitle,
9564      pageItems,
9565      isHierarchical
9566    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
9567      const {
9568        getEntityRecord,
9569        getEntityRecords,
9570        getPostType
9571      } = select(external_wp_coreData_namespaceObject.store);
9572      const postTypeInfo = getPostType(postTypeSlug);
9573      const postIsHierarchical = postTypeInfo?.hierarchical && postTypeInfo.viewable;
9574      const parentPost = pageId ? getEntityRecord('postType', postTypeSlug, pageId) : null;
9575      const query = {
9576        per_page: 100,
9577        exclude: postId,
9578        parent_exclude: postId,
9579        orderby: 'menu_order',
9580        order: 'asc',
9581        _fields: 'id,title,parent',
9582        ...(fieldValue !== null && {
9583          search: fieldValue
9584        })
9585      };
9586      return {
9587        isHierarchical: postIsHierarchical,
9588        parentPostTitle: parentPost ? getTitleWithFallbackName(parentPost) : '',
9589        pageItems: postIsHierarchical ? getEntityRecords('postType', postTypeSlug, query) : null
9590      };
9591    }, [fieldValue, pageId, postId, postTypeSlug]);
9592  
9593    /**
9594     * This logic has been copied from https://github.com/WordPress/gutenberg/blob/0249771b519d5646171fb9fae422006c8ab773f2/packages/editor/src/components/page-attributes/parent.js#L106.
9595     */
9596    const parentOptions = (0,external_wp_element_namespaceObject.useMemo)(() => {
9597      const getOptionsFromTree = (tree, level = 0) => {
9598        const mappedNodes = tree.map(treeNode => [{
9599          value: treeNode.id,
9600          label: '— '.repeat(level) + (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(treeNode.name),
9601          rawName: treeNode.name
9602        }, ...getOptionsFromTree(treeNode.children || [], level + 1)]);
9603        const sortedNodes = mappedNodes.sort(([a], [b]) => {
9604          const priorityA = getItemPriority(a.rawName, fieldValue !== null && fieldValue !== void 0 ? fieldValue : '');
9605          const priorityB = getItemPriority(b.rawName, fieldValue !== null && fieldValue !== void 0 ? fieldValue : '');
9606          return priorityA >= priorityB ? 1 : -1;
9607        });
9608        return sortedNodes.flat();
9609      };
9610      if (!pageItems) {
9611        return [];
9612      }
9613      let tree = pageItems.map(item => {
9614        var _item$parent;
9615        return {
9616          id: item.id,
9617          parent: (_item$parent = item.parent) !== null && _item$parent !== void 0 ? _item$parent : null,
9618          name: getTitleWithFallbackName(item)
9619        };
9620      });
9621  
9622      // Only build a hierarchical tree when not searching.
9623      if (!fieldValue) {
9624        tree = buildTermsTree(tree);
9625      }
9626      const opts = getOptionsFromTree(tree);
9627  
9628      // Ensure the current parent is in the options list.
9629      const optsHasParent = opts.find(item => item.value === pageId);
9630      if (pageId && parentPostTitle && !optsHasParent) {
9631        opts.unshift({
9632          value: pageId,
9633          label: parentPostTitle,
9634          rawName: ''
9635        });
9636      }
9637      return opts.map(option => ({
9638        ...option,
9639        value: option.value.toString()
9640      }));
9641    }, [pageItems, fieldValue, parentPostTitle, pageId]);
9642    if (!isHierarchical) {
9643      return null;
9644    }
9645  
9646    /**
9647     * Handle user input.
9648     *
9649     * @param {string} inputValue The current value of the input field.
9650     */
9651    const handleKeydown = inputValue => {
9652      setFieldValue(inputValue);
9653    };
9654  
9655    /**
9656     * Handle author selection.
9657     *
9658     * @param {Object} selectedPostId The selected Author.
9659     */
9660    const handleChange = selectedPostId => {
9661      if (selectedPostId) {
9662        var _parseInt;
9663        return onChangeControl((_parseInt = parseInt(selectedPostId, 10)) !== null && _parseInt !== void 0 ? _parseInt : 0);
9664      }
9665      onChangeControl(0);
9666    };
9667    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ComboboxControl, {
9668      __nextHasNoMarginBottom: true,
9669      __next40pxDefaultSize: true,
9670      label: (0,external_wp_i18n_namespaceObject.__)('Parent'),
9671      help: (0,external_wp_i18n_namespaceObject.__)('Choose a parent page.'),
9672      value: pageId?.toString(),
9673      options: parentOptions,
9674      onFilterValueChange: (0,external_wp_compose_namespaceObject.debounce)(value => handleKeydown(value), 300),
9675      onChange: handleChange,
9676      hideLabelFromVision: true
9677    });
9678  }
9679  const ParentEdit = ({
9680    data,
9681    field,
9682    onChange
9683  }) => {
9684    const {
9685      id
9686    } = field;
9687    const homeUrl = (0,external_wp_data_namespaceObject.useSelect)(select => {
9688      return select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.home;
9689    }, []);
9690    const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({
9691      [id]: newValue
9692    }), [id, onChange]);
9693    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("fieldset", {
9694      className: "fields-controls__parent",
9695      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
9696        children: [(0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %1$s The home URL of the WordPress installation without the scheme. */
9697        (0,external_wp_i18n_namespaceObject.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %1$s<wbr />/services<wbr />/pricing.'), (0,external_wp_url_namespaceObject.filterURLForDisplay)(homeUrl).replace(/([/.])/g, '<wbr />$1')), {
9698          wbr: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("wbr", {})
9699        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
9700          children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('They also show up as sub-items in the default navigation menu. <a>Learn more.</a>'), {
9701            a: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
9702              href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes'),
9703              children: undefined
9704            })
9705          })
9706        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PageAttributesParent, {
9707          data: data,
9708          onChangeControl: onChangeControl
9709        })]
9710      })
9711    });
9712  };
9713  
9714  ;// ./node_modules/@wordpress/fields/build-module/fields/parent/parent-view.js
9715  /**
9716   * WordPress dependencies
9717   */
9718  
9719  
9720  
9721  
9722  /**
9723   * Internal dependencies
9724   */
9725  
9726  
9727  
9728  const ParentView = ({
9729    item
9730  }) => {
9731    const parent = (0,external_wp_data_namespaceObject.useSelect)(select => {
9732      const {
9733        getEntityRecord
9734      } = select(external_wp_coreData_namespaceObject.store);
9735      return item?.parent ? getEntityRecord('postType', item.type, item.parent) : null;
9736    }, [item.parent, item.type]);
9737    if (parent) {
9738      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
9739        children: getTitleWithFallbackName(parent)
9740      });
9741    }
9742    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
9743      children: (0,external_wp_i18n_namespaceObject.__)('None')
9744    });
9745  };
9746  
9747  ;// ./node_modules/@wordpress/fields/build-module/fields/parent/index.js
9748  /**
9749   * WordPress dependencies
9750   */
9751  
9752  
9753  
9754  /**
9755   * Internal dependencies
9756   */
9757  
9758  
9759  
9760  const parentField = {
9761    id: 'parent',
9762    type: 'text',
9763    label: (0,external_wp_i18n_namespaceObject.__)('Parent'),
9764    Edit: ParentEdit,
9765    render: ParentView,
9766    enableSorting: true
9767  };
9768  
9769  /**
9770   * Parent field for BasePost.
9771   */
9772  /* harmony default export */ const fields_parent = (parentField);
9773  
9774  ;// ./node_modules/@wordpress/fields/build-module/fields/comment-status/index.js
9775  /**
9776   * WordPress dependencies
9777   */
9778  
9779  
9780  
9781  /**
9782   * Internal dependencies
9783   */
9784  
9785  const commentStatusField = {
9786    id: 'comment_status',
9787    label: (0,external_wp_i18n_namespaceObject.__)('Discussion'),
9788    type: 'text',
9789    Edit: 'radio',
9790    enableSorting: false,
9791    filterBy: {
9792      operators: []
9793    },
9794    elements: [{
9795      value: 'open',
9796      label: (0,external_wp_i18n_namespaceObject.__)('Open'),
9797      description: (0,external_wp_i18n_namespaceObject.__)('Visitors can add new comments and replies.')
9798    }, {
9799      value: 'closed',
9800      label: (0,external_wp_i18n_namespaceObject.__)('Closed'),
9801      description: (0,external_wp_i18n_namespaceObject.__)('Visitors cannot add new comments or replies. Existing comments remain visible.')
9802    }]
9803  };
9804  
9805  /**
9806   * Comment status field for BasePost.
9807   */
9808  /* harmony default export */ const comment_status = (commentStatusField);
9809  
9810  ;// ./node_modules/@wordpress/fields/build-module/fields/template/template-edit.js
9811  /**
9812   * WordPress dependencies
9813   */
9814  
9815  // @ts-ignore
9816  
9817  
9818  /**
9819   * Internal dependencies
9820   */
9821  // @ts-expect-error block-editor is not typed correctly.
9822  
9823  
9824  
9825  
9826  
9827  
9828  
9829  
9830  
9831  const EMPTY_ARRAY = [];
9832  const TemplateEdit = ({
9833    data,
9834    field,
9835    onChange
9836  }) => {
9837    const {
9838      id
9839    } = field;
9840    const postType = data.type;
9841    const postId = typeof data.id === 'number' ? data.id : parseInt(data.id, 10);
9842    const slug = data.slug;
9843    const {
9844      canSwitchTemplate,
9845      templates
9846    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
9847      var _select$getEntityReco;
9848      const allTemplates = (_select$getEntityReco = select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', 'wp_template', {
9849        per_page: -1,
9850        post_type: postType
9851      })) !== null && _select$getEntityReco !== void 0 ? _select$getEntityReco : EMPTY_ARRAY;
9852      const {
9853        getHomePage,
9854        getPostsPageId
9855      } = lock_unlock_unlock(select(external_wp_coreData_namespaceObject.store));
9856      const isPostsPage = getPostsPageId() === +postId;
9857      const isFrontPage = postType === 'page' && getHomePage()?.postId === +postId;
9858      const allowSwitchingTemplate = !isPostsPage && !isFrontPage;
9859      return {
9860        templates: allTemplates,
9861        canSwitchTemplate: allowSwitchingTemplate
9862      };
9863    }, [postId, postType]);
9864    const templatesAsPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => {
9865      if (!canSwitchTemplate) {
9866        return [];
9867      }
9868      return templates.filter(template => template.is_custom && template.slug !== data.template &&
9869      // Skip empty templates.
9870      !!template.content.raw).map(template => ({
9871        name: template.slug,
9872        blocks: (0,external_wp_blocks_namespaceObject.parse)(template.content.raw),
9873        title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title.rendered),
9874        id: template.id
9875      }));
9876    }, [canSwitchTemplate, data.template, templates]);
9877    const shownTemplates = (0,external_wp_compose_namespaceObject.useAsyncList)(templatesAsPatterns);
9878    const value = field.getValue({
9879      item: data
9880    });
9881    const foundTemplate = templates.find(template => template.slug === value);
9882    const currentTemplate = (0,external_wp_data_namespaceObject.useSelect)(select => {
9883      if (foundTemplate) {
9884        return foundTemplate;
9885      }
9886      let slugToCheck;
9887      // In `draft` status we might not have a slug available, so we use the `single`
9888      // post type templates slug(ex page, single-post, single-product etc..).
9889      // Pages do not need the `single` prefix in the slug to be prioritized
9890      // through template hierarchy.
9891      if (slug) {
9892        slugToCheck = postType === 'page' ? `$postType}-$slug}` : `single-$postType}-$slug}`;
9893      } else {
9894        slugToCheck = postType === 'page' ? 'page' : `single-$postType}`;
9895      }
9896      if (postType) {
9897        const templateId = select(external_wp_coreData_namespaceObject.store).getDefaultTemplateId({
9898          slug: slugToCheck
9899        });
9900        return select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template', templateId);
9901      }
9902    }, [foundTemplate, postType, slug]);
9903    const [showModal, setShowModal] = (0,external_wp_element_namespaceObject.useState)(false);
9904    const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({
9905      [id]: newValue
9906    }), [id, onChange]);
9907    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", {
9908      className: "fields-controls__template",
9909      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
9910        popoverProps: {
9911          placement: 'bottom-start'
9912        },
9913        renderToggle: ({
9914          onToggle
9915        }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
9916          __next40pxDefaultSize: true,
9917          variant: "tertiary",
9918          size: "compact",
9919          onClick: onToggle,
9920          children: currentTemplate ? getItemTitle(currentTemplate) : ''
9921        }),
9922        renderContent: ({
9923          onToggle
9924        }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, {
9925          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
9926            onClick: () => {
9927              setShowModal(true);
9928              onToggle();
9929            },
9930            children: (0,external_wp_i18n_namespaceObject.__)('Change template')
9931          }),
9932          // The default template in a post is indicated by an empty string
9933          value !== '' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
9934            onClick: () => {
9935              onChangeControl('');
9936              onToggle();
9937            },
9938            children: (0,external_wp_i18n_namespaceObject.__)('Use default template')
9939          })]
9940        })
9941      }), showModal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
9942        title: (0,external_wp_i18n_namespaceObject.__)('Choose a template'),
9943        onRequestClose: () => setShowModal(false),
9944        overlayClassName: "fields-controls__template-modal",
9945        isFullScreen: true,
9946        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
9947          className: "fields-controls__template-content",
9948          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
9949            label: (0,external_wp_i18n_namespaceObject.__)('Templates'),
9950            blockPatterns: templatesAsPatterns,
9951            shownPatterns: shownTemplates,
9952            onClickPattern: template => {
9953              onChangeControl(template.name);
9954              setShowModal(false);
9955            }
9956          })
9957        })
9958      })]
9959    });
9960  };
9961  
9962  ;// ./node_modules/@wordpress/fields/build-module/fields/template/index.js
9963  /**
9964   * WordPress dependencies
9965   */
9966  
9967  /**
9968   * Internal dependencies
9969   */
9970  
9971  
9972  const templateField = {
9973    id: 'template',
9974    type: 'text',
9975    label: (0,external_wp_i18n_namespaceObject.__)('Template'),
9976    Edit: TemplateEdit,
9977    enableSorting: false
9978  };
9979  
9980  /**
9981   * Template field for BasePost.
9982   */
9983  /* harmony default export */ const fields_template = (templateField);
9984  
9985  ;// ./node_modules/@wordpress/fields/build-module/fields/password/edit.js
9986  /**
9987   * WordPress dependencies
9988   */
9989  
9990  
9991  
9992  
9993  /**
9994   * Internal dependencies
9995   */
9996  
9997  function PasswordEdit({
9998    data,
9999    onChange,
10000    field
10001  }) {
10002    const [showPassword, setShowPassword] = (0,external_wp_element_namespaceObject.useState)(!!field.getValue({
10003      item: data
10004    }));
10005    const handleTogglePassword = value => {
10006      setShowPassword(value);
10007      if (!value) {
10008        onChange({
10009          password: ''
10010        });
10011      }
10012    };
10013    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
10014      as: "fieldset",
10015      spacing: 4,
10016      className: "fields-controls__password",
10017      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, {
10018        __nextHasNoMarginBottom: true,
10019        label: (0,external_wp_i18n_namespaceObject.__)('Password protected'),
10020        help: (0,external_wp_i18n_namespaceObject.__)('Only visible to those who know the password'),
10021        checked: showPassword,
10022        onChange: handleTogglePassword
10023      }), showPassword && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
10024        className: "fields-controls__password-input",
10025        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
10026          label: (0,external_wp_i18n_namespaceObject.__)('Password'),
10027          onChange: value => onChange({
10028            password: value
10029          }),
10030          value: field.getValue({
10031            item: data
10032          }) || '',
10033          placeholder: (0,external_wp_i18n_namespaceObject.__)('Use a secure password'),
10034          type: "text",
10035          __next40pxDefaultSize: true,
10036          __nextHasNoMarginBottom: true,
10037          maxLength: 255
10038        })
10039      })]
10040    });
10041  }
10042  /* harmony default export */ const edit = (PasswordEdit);
10043  
10044  ;// ./node_modules/@wordpress/fields/build-module/fields/password/index.js
10045  /**
10046   * WordPress dependencies
10047   */
10048  
10049  /**
10050   * Internal dependencies
10051   */
10052  
10053  
10054  const passwordField = {
10055    id: 'password',
10056    type: 'text',
10057    Edit: edit,
10058    enableSorting: false,
10059    enableHiding: false,
10060    isVisible: item => item.status !== 'private'
10061  };
10062  
10063  /**
10064   * Password field for BasePost.
10065   */
10066  /* harmony default export */ const fields_password = (passwordField);
10067  
10068  ;// ./node_modules/@wordpress/fields/build-module/fields/title/view.js
10069  /**
10070   * External dependencies
10071   */
10072  
10073  /**
10074   * WordPress dependencies
10075   */
10076  
10077  
10078  
10079  /**
10080   * Internal dependencies
10081   */
10082  
10083  
10084  
10085  function BaseTitleView({
10086    item,
10087    className,
10088    children
10089  }) {
10090    const renderedTitle = getItemTitle(item);
10091    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
10092      className: dist_clsx('fields-field__title', className),
10093      alignment: "center",
10094      justify: "flex-start",
10095      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
10096        children: renderedTitle || (0,external_wp_i18n_namespaceObject.__)('(no title)')
10097      }), children]
10098    });
10099  }
10100  function TitleView({
10101    item
10102  }) {
10103    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BaseTitleView, {
10104      item: item
10105    });
10106  }
10107  
10108  ;// ./node_modules/@wordpress/fields/build-module/fields/page-title/view.js
10109  /**
10110   * WordPress dependencies
10111   */
10112  
10113  
10114  
10115  
10116  
10117  /**
10118   * Internal dependencies
10119   */
10120  
10121  
10122  
10123  
10124  const {
10125    Badge
10126  } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis);
10127  function PageTitleView({
10128    item
10129  }) {
10130    const {
10131      frontPageId,
10132      postsPageId
10133    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
10134      const {
10135        getEntityRecord
10136      } = select(external_wp_coreData_namespaceObject.store);
10137      const siteSettings = getEntityRecord('root', 'site');
10138      return {
10139        frontPageId: siteSettings?.page_on_front,
10140        postsPageId: siteSettings?.page_for_posts
10141      };
10142    }, []);
10143    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BaseTitleView, {
10144      item: item,
10145      className: "fields-field__page-title",
10146      children: [frontPageId, postsPageId].includes(item.id) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Badge, {
10147        children: item.id === frontPageId ? (0,external_wp_i18n_namespaceObject.__)('Homepage') : (0,external_wp_i18n_namespaceObject.__)('Posts Page')
10148      })
10149    });
10150  }
10151  
10152  ;// ./node_modules/@wordpress/fields/build-module/fields/page-title/index.js
10153  /**
10154   * WordPress dependencies
10155   */
10156  
10157  
10158  
10159  /**
10160   * Internal dependencies
10161   */
10162  
10163  
10164  
10165  const pageTitleField = {
10166    type: 'text',
10167    id: 'title',
10168    label: (0,external_wp_i18n_namespaceObject.__)('Title'),
10169    placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'),
10170    getValue: ({
10171      item
10172    }) => getItemTitle(item),
10173    render: PageTitleView,
10174    enableHiding: false,
10175    enableGlobalSearch: true
10176  };
10177  
10178  /**
10179   * Title for the page entity.
10180   */
10181  /* harmony default export */ const page_title = (pageTitleField);
10182  
10183  ;// ./node_modules/@wordpress/fields/build-module/fields/template-title/index.js
10184  /**
10185   * WordPress dependencies
10186   */
10187  
10188  
10189  
10190  /**
10191   * Internal dependencies
10192   */
10193  
10194  
10195  
10196  const templateTitleField = {
10197    type: 'text',
10198    label: (0,external_wp_i18n_namespaceObject.__)('Template'),
10199    placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'),
10200    id: 'title',
10201    getValue: ({
10202      item
10203    }) => getItemTitle(item),
10204    render: TitleView,
10205    enableHiding: false,
10206    enableGlobalSearch: true
10207  };
10208  
10209  /**
10210   * Title for the template entity.
10211   */
10212  /* harmony default export */ const template_title = (templateTitleField);
10213  
10214  ;// ./node_modules/@wordpress/icons/build-module/icon/index.js
10215  /**
10216   * WordPress dependencies
10217   */
10218  
10219  
10220  /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
10221  
10222  /**
10223   * Return an SVG icon.
10224   *
10225   * @param {IconProps}                                 props icon is the SVG component to render
10226   *                                                          size is a number specifying the icon size in pixels
10227   *                                                          Other props will be passed to wrapped SVG component
10228   * @param {import('react').ForwardedRef<HTMLElement>} ref   The forwarded ref to the SVG element.
10229   *
10230   * @return {JSX.Element}  Icon component
10231   */
10232  function Icon({
10233    icon,
10234    size = 24,
10235    ...props
10236  }, ref) {
10237    return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
10238      width: size,
10239      height: size,
10240      ...props,
10241      ref
10242    });
10243  }
10244  /* harmony default export */ const icon = ((0,external_wp_element_namespaceObject.forwardRef)(Icon));
10245  
10246  ;// ./node_modules/@wordpress/icons/build-module/library/lock-small.js
10247  /**
10248   * WordPress dependencies
10249   */
10250  
10251  
10252  const lockSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
10253    viewBox: "0 0 24 24",
10254    xmlns: "http://www.w3.org/2000/svg",
10255    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
10256      fillRule: "evenodd",
10257      clipRule: "evenodd",
10258      d: "M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"
10259    })
10260  });
10261  /* harmony default export */ const lock_small = (lockSmall);
10262  
10263  ;// ./node_modules/@wordpress/fields/build-module/fields/pattern-title/view.js
10264  /**
10265   * WordPress dependencies
10266   */
10267  
10268  
10269  
10270  // @ts-ignore
10271  
10272  
10273  /**
10274   * Internal dependencies
10275   */
10276  
10277  
10278  
10279  
10280  const {
10281    PATTERN_TYPES: view_PATTERN_TYPES
10282  } = lock_unlock_unlock(external_wp_patterns_namespaceObject.privateApis);
10283  function PatternTitleView({
10284    item
10285  }) {
10286    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BaseTitleView, {
10287      item: item,
10288      className: "fields-field__pattern-title",
10289      children: item.type === view_PATTERN_TYPES.theme && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, {
10290        placement: "top",
10291        text: (0,external_wp_i18n_namespaceObject.__)('This pattern cannot be edited.'),
10292        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icon, {
10293          icon: lock_small,
10294          size: 24
10295        })
10296      })
10297    });
10298  }
10299  
10300  ;// ./node_modules/@wordpress/fields/build-module/fields/pattern-title/index.js
10301  /**
10302   * WordPress dependencies
10303   */
10304  
10305  
10306  
10307  /**
10308   * Internal dependencies
10309   */
10310  
10311  
10312  
10313  const patternTitleField = {
10314    type: 'text',
10315    id: 'title',
10316    label: (0,external_wp_i18n_namespaceObject.__)('Title'),
10317    placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'),
10318    getValue: ({
10319      item
10320    }) => getItemTitle(item),
10321    render: PatternTitleView,
10322    enableHiding: false,
10323    enableGlobalSearch: true
10324  };
10325  
10326  /**
10327   * Title for the pattern entity.
10328   */
10329  /* harmony default export */ const pattern_title = (patternTitleField);
10330  
10331  ;// ./node_modules/@wordpress/fields/build-module/fields/title/index.js
10332  /**
10333   * WordPress dependencies
10334   */
10335  
10336  
10337  
10338  /**
10339   * Internal dependencies
10340   */
10341  
10342  
10343  
10344  const titleField = {
10345    type: 'text',
10346    id: 'title',
10347    label: (0,external_wp_i18n_namespaceObject.__)('Title'),
10348    placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'),
10349    getValue: ({
10350      item
10351    }) => getItemTitle(item),
10352    render: TitleView,
10353    enableHiding: false,
10354    enableGlobalSearch: true
10355  };
10356  
10357  /**
10358   * Title for the any entity with a `title` property.
10359   * For patterns, pages or templates you should use the respective field
10360   * because there are some differences in the rendering, labels, etc.
10361   */
10362  /* harmony default export */ const title = (titleField);
10363  
10364  ;// ./node_modules/@wordpress/editor/build-module/components/provider/with-registry-provider.js
10365  /**
10366   * WordPress dependencies
10367   */
10368  
10369  
10370  
10371  
10372  
10373  /**
10374   * Internal dependencies
10375   */
10376  
10377  
10378  function getSubRegistry(subRegistries, registry, useSubRegistry) {
10379    if (!useSubRegistry) {
10380      return registry;
10381    }
10382    let subRegistry = subRegistries.get(registry);
10383    if (!subRegistry) {
10384      subRegistry = (0,external_wp_data_namespaceObject.createRegistry)({
10385        'core/block-editor': external_wp_blockEditor_namespaceObject.storeConfig
10386      }, registry);
10387      // Todo: The interface store should also be created per instance.
10388      subRegistry.registerStore('core/editor', storeConfig);
10389      subRegistries.set(registry, subRegistry);
10390    }
10391    return subRegistry;
10392  }
10393  const withRegistryProvider = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => ({
10394    useSubRegistry = true,
10395    ...props
10396  }) => {
10397    const registry = (0,external_wp_data_namespaceObject.useRegistry)();
10398    const [subRegistries] = (0,external_wp_element_namespaceObject.useState)(() => new WeakMap());
10399    const subRegistry = getSubRegistry(subRegistries, registry, useSubRegistry);
10400    if (subRegistry === registry) {
10401      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
10402        registry: registry,
10403        ...props
10404      });
10405    }
10406    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_data_namespaceObject.RegistryProvider, {
10407      value: subRegistry,
10408      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
10409        registry: subRegistry,
10410        ...props
10411      })
10412    });
10413  }, 'withRegistryProvider');
10414  /* harmony default export */ const with_registry_provider = (withRegistryProvider);
10415  
10416  ;// ./node_modules/@wordpress/editor/build-module/components/media-categories/index.js
10417  /* wp:polyfill */
10418  /**
10419   * The `editor` settings here need to be in sync with the corresponding ones in `editor` package.
10420   * See `packages/editor/src/components/media-categories/index.js`.
10421   *
10422   * In the future we could consider creating an Openvese package that can be used in both `editor` and `site-editor`.
10423   * The rest of the settings would still need to be in sync though.
10424   */
10425  
10426  /**
10427   * WordPress dependencies
10428   */
10429  
10430  
10431  
10432  
10433  /**
10434   * Internal dependencies
10435   */
10436  
10437  
10438  /** @typedef {import('@wordpress/block-editor').InserterMediaRequest} InserterMediaRequest */
10439  /** @typedef {import('@wordpress/block-editor').InserterMediaItem} InserterMediaItem */
10440  /** @typedef {import('@wordpress/block-editor').InserterMediaCategory} InserterMediaCategory */
10441  
10442  const getExternalLink = (url, text) => `<a $getExternalLinkAttributes(url)}>$text}</a>`;
10443  const getExternalLinkAttributes = url => `href="$url}" target="_blank" rel="noreferrer noopener"`;
10444  const getOpenverseLicense = (license, licenseVersion) => {
10445    let licenseName = license.trim();
10446    // PDM has no abbreviation
10447    if (license !== 'pdm') {
10448      licenseName = license.toUpperCase().replace('SAMPLING', 'Sampling');
10449    }
10450    // If version is known, append version to the name.
10451    // The license has to have a version to be valid. Only
10452    // PDM (public domain mark) doesn't have a version.
10453    if (licenseVersion) {
10454      licenseName += ` $licenseVersion}`;
10455    }
10456    // For licenses other than public-domain marks, prepend 'CC' to the name.
10457    if (!['pdm', 'cc0'].includes(license)) {
10458      licenseName = `CC $licenseName}`;
10459    }
10460    return licenseName;
10461  };
10462  const getOpenverseCaption = item => {
10463    const {
10464      title,
10465      foreign_landing_url: foreignLandingUrl,
10466      creator,
10467      creator_url: creatorUrl,
10468      license,
10469      license_version: licenseVersion,
10470      license_url: licenseUrl
10471    } = item;
10472    const fullLicense = getOpenverseLicense(license, licenseVersion);
10473    const _creator = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(creator);
10474    let _caption;
10475    if (_creator) {
10476      _caption = title ? (0,external_wp_i18n_namespaceObject.sprintf)(
10477      // translators: %1s: Title of a media work from Openverse; %2s: Name of the work's creator; %3s: Work's licence e.g: "CC0 1.0".
10478      (0,external_wp_i18n_namespaceObject._x)('"%1$s" by %2$s/ %3$s', 'caption'), getExternalLink(foreignLandingUrl, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)), creatorUrl ? getExternalLink(creatorUrl, _creator) : _creator, licenseUrl ? getExternalLink(`$licenseUrl}?ref=openverse`, fullLicense) : fullLicense) : (0,external_wp_i18n_namespaceObject.sprintf)(
10479      // translators: %1s: Link attributes for a given Openverse media work; %2s: Name of the work's creator; %3s: Works's licence e.g: "CC0 1.0".
10480      (0,external_wp_i18n_namespaceObject._x)('<a %1$s>Work</a> by %2$s/ %3$s', 'caption'), getExternalLinkAttributes(foreignLandingUrl), creatorUrl ? getExternalLink(creatorUrl, _creator) : _creator, licenseUrl ? getExternalLink(`$licenseUrl}?ref=openverse`, fullLicense) : fullLicense);
10481    } else {
10482      _caption = title ? (0,external_wp_i18n_namespaceObject.sprintf)(
10483      // translators: %1s: Title of a media work from Openverse; %2s: Work's licence e.g: "CC0 1.0".
10484      (0,external_wp_i18n_namespaceObject._x)('"%1$s"/ %2$s', 'caption'), getExternalLink(foreignLandingUrl, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)), licenseUrl ? getExternalLink(`$licenseUrl}?ref=openverse`, fullLicense) : fullLicense) : (0,external_wp_i18n_namespaceObject.sprintf)(
10485      // translators: %1s: Link attributes for a given Openverse media work; %2s: Works's licence e.g: "CC0 1.0".
10486      (0,external_wp_i18n_namespaceObject._x)('<a %1$s>Work</a>/ %2$s', 'caption'), getExternalLinkAttributes(foreignLandingUrl), licenseUrl ? getExternalLink(`$licenseUrl}?ref=openverse`, fullLicense) : fullLicense);
10487    }
10488    return _caption.replace(/\s{2}/g, ' ');
10489  };
10490  const coreMediaFetch = async (query = {}) => {
10491    const mediaItems = await (0,external_wp_data_namespaceObject.resolveSelect)(external_wp_coreData_namespaceObject.store).getMediaItems({
10492      ...query,
10493      orderBy: !!query?.search ? 'relevance' : 'date'
10494    });
10495    return mediaItems.map(mediaItem => ({
10496      ...mediaItem,
10497      alt: mediaItem.alt_text,
10498      url: mediaItem.source_url,
10499      previewUrl: mediaItem.media_details?.sizes?.medium?.source_url,
10500      caption: mediaItem.caption?.raw
10501    }));
10502  };
10503  
10504  /** @type {InserterMediaCategory[]} */
10505  const inserterMediaCategories = [{
10506    name: 'images',
10507    labels: {
10508      name: (0,external_wp_i18n_namespaceObject.__)('Images'),
10509      search_items: (0,external_wp_i18n_namespaceObject.__)('Search images')
10510    },
10511    mediaType: 'image',
10512    async fetch(query = {}) {
10513      return coreMediaFetch({
10514        ...query,
10515        media_type: 'image'
10516      });
10517    }
10518  }, {
10519    name: 'videos',
10520    labels: {
10521      name: (0,external_wp_i18n_namespaceObject.__)('Videos'),
10522      search_items: (0,external_wp_i18n_namespaceObject.__)('Search videos')
10523    },
10524    mediaType: 'video',
10525    async fetch(query = {}) {
10526      return coreMediaFetch({
10527        ...query,
10528        media_type: 'video'
10529      });
10530    }
10531  }, {
10532    name: 'audio',
10533    labels: {
10534      name: (0,external_wp_i18n_namespaceObject.__)('Audio'),
10535      search_items: (0,external_wp_i18n_namespaceObject.__)('Search audio')
10536    },
10537    mediaType: 'audio',
10538    async fetch(query = {}) {
10539      return coreMediaFetch({
10540        ...query,
10541        media_type: 'audio'
10542      });
10543    }
10544  }, {
10545    name: 'openverse',
10546    labels: {
10547      name: (0,external_wp_i18n_namespaceObject.__)('Openverse'),
10548      search_items: (0,external_wp_i18n_namespaceObject.__)('Search Openverse')
10549    },
10550    mediaType: 'image',
10551    async fetch(query = {}) {
10552      const defaultArgs = {
10553        mature: false,
10554        excluded_source: 'flickr,inaturalist,wikimedia',
10555        license: 'pdm,cc0'
10556      };
10557      const finalQuery = {
10558        ...query,
10559        ...defaultArgs
10560      };
10561      const mapFromInserterMediaRequest = {
10562        per_page: 'page_size',
10563        search: 'q'
10564      };
10565      const url = new URL('https://api.openverse.org/v1/images/');
10566      Object.entries(finalQuery).forEach(([key, value]) => {
10567        const queryKey = mapFromInserterMediaRequest[key] || key;
10568        url.searchParams.set(queryKey, value);
10569      });
10570      const response = await window.fetch(url, {
10571        headers: {
10572          'User-Agent': 'WordPress/inserter-media-fetch'
10573        }
10574      });
10575      const jsonResponse = await response.json();
10576      const results = jsonResponse.results;
10577      return results.map(result => ({
10578        ...result,
10579        // This is a temp solution for better titles, until Openverse API
10580        // completes the cleaning up of some titles of their upstream data.
10581        title: result.title?.toLowerCase().startsWith('file:') ? result.title.slice(5) : result.title,
10582        sourceId: result.id,
10583        id: undefined,
10584        caption: getOpenverseCaption(result),
10585        previewUrl: result.thumbnail
10586      }));
10587    },
10588    getReportUrl: ({
10589      sourceId
10590    }) => `https://wordpress.org/openverse/image/$sourceId}/report/`,
10591    isExternalResource: true
10592  }];
10593  /* harmony default export */ const media_categories = (inserterMediaCategories);
10594  
10595  ;// ./node_modules/@wordpress/editor/node_modules/uuid/dist/esm-browser/native.js
10596  const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
10597  /* harmony default export */ const esm_browser_native = ({
10598    randomUUID
10599  });
10600  ;// ./node_modules/@wordpress/editor/node_modules/uuid/dist/esm-browser/rng.js
10601  // Unique ID creation requires a high quality random # generator. In the browser we therefore
10602  // require the crypto API and do not support built-in fallback to lower quality random number
10603  // generators (like Math.random()).
10604  let getRandomValues;
10605  const rnds8 = new Uint8Array(16);
10606  function rng() {
10607    // lazy load so that environments that need to polyfill have a chance to do so
10608    if (!getRandomValues) {
10609      // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
10610      getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
10611  
10612      if (!getRandomValues) {
10613        throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
10614      }
10615    }
10616  
10617    return getRandomValues(rnds8);
10618  }
10619  ;// ./node_modules/@wordpress/editor/node_modules/uuid/dist/esm-browser/stringify.js
10620  
10621  /**
10622   * Convert array of 16 byte values to UUID string format of the form:
10623   * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
10624   */
10625  
10626  const byteToHex = [];
10627  
10628  for (let i = 0; i < 256; ++i) {
10629    byteToHex.push((i + 0x100).toString(16).slice(1));
10630  }
10631  
10632  function unsafeStringify(arr, offset = 0) {
10633    // Note: Be careful editing this code!  It's been tuned for performance
10634    // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
10635    return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
10636  }
10637  
10638  function stringify(arr, offset = 0) {
10639    const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID.  If this throws, it's likely due to one
10640    // of the following:
10641    // - One or more input array values don't map to a hex octet (leading to
10642    // "undefined" in the uuid)
10643    // - Invalid input values for the RFC `version` or `variant` fields
10644  
10645    if (!validate(uuid)) {
10646      throw TypeError('Stringified UUID is invalid');
10647    }
10648  
10649    return uuid;
10650  }
10651  
10652  /* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
10653  ;// ./node_modules/@wordpress/editor/node_modules/uuid/dist/esm-browser/v4.js
10654  
10655  
10656  
10657  
10658  function v4(options, buf, offset) {
10659    if (esm_browser_native.randomUUID && !buf && !options) {
10660      return esm_browser_native.randomUUID();
10661    }
10662  
10663    options = options || {};
10664    const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
10665  
10666    rnds[6] = rnds[6] & 0x0f | 0x40;
10667    rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
10668  
10669    if (buf) {
10670      offset = offset || 0;
10671  
10672      for (let i = 0; i < 16; ++i) {
10673        buf[offset + i] = rnds[i];
10674      }
10675  
10676      return buf;
10677    }
10678  
10679    return unsafeStringify(rnds);
10680  }
10681  
10682  /* harmony default export */ const esm_browser_v4 = (v4);
10683  ;// ./node_modules/@wordpress/editor/build-module/utils/media-upload/index.js
10684  /**
10685   * External dependencies
10686   */
10687  
10688  
10689  /**
10690   * WordPress dependencies
10691   */
10692  
10693  
10694  
10695  /**
10696   * Internal dependencies
10697   */
10698  
10699  const noop = () => {};
10700  
10701  /**
10702   * Upload a media file when the file upload button is activated.
10703   * Wrapper around mediaUpload() that injects the current post ID.
10704   *
10705   * @param {Object}   $0                   Parameters object passed to the function.
10706   * @param {?Object}  $0.additionalData    Additional data to include in the request.
10707   * @param {string}   $0.allowedTypes      Array with the types of media that can be uploaded, if unset all types are allowed.
10708   * @param {Array}    $0.filesList         List of files.
10709   * @param {?number}  $0.maxUploadFileSize Maximum upload size in bytes allowed for the site.
10710   * @param {Function} $0.onError           Function called when an error happens.
10711   * @param {Function} $0.onFileChange      Function called each time a file or a temporary representation of the file is available.
10712   * @param {Function} $0.onSuccess         Function called after the final representation of the file is available.
10713   * @param {boolean}  $0.multiple          Whether to allow multiple files to be uploaded.
10714   */
10715  function mediaUpload({
10716    additionalData = {},
10717    allowedTypes,
10718    filesList,
10719    maxUploadFileSize,
10720    onError = noop,
10721    onFileChange,
10722    onSuccess,
10723    multiple = true
10724  }) {
10725    const {
10726      getCurrentPost,
10727      getEditorSettings
10728    } = (0,external_wp_data_namespaceObject.select)(store_store);
10729    const {
10730      lockPostAutosaving,
10731      unlockPostAutosaving,
10732      lockPostSaving,
10733      unlockPostSaving
10734    } = (0,external_wp_data_namespaceObject.dispatch)(store_store);
10735    const wpAllowedMimeTypes = getEditorSettings().allowedMimeTypes;
10736    const lockKey = `image-upload-$esm_browser_v4()}`;
10737    let imageIsUploading = false;
10738    maxUploadFileSize = maxUploadFileSize || getEditorSettings().maxUploadFileSize;
10739    const currentPost = getCurrentPost();
10740    // Templates and template parts' numerical ID is stored in `wp_id`.
10741    const currentPostId = typeof currentPost?.id === 'number' ? currentPost.id : currentPost?.wp_id;
10742    const setSaveLock = () => {
10743      lockPostSaving(lockKey);
10744      lockPostAutosaving(lockKey);
10745      imageIsUploading = true;
10746    };
10747    const postData = currentPostId ? {
10748      post: currentPostId
10749    } : {};
10750    const clearSaveLock = () => {
10751      unlockPostSaving(lockKey);
10752      unlockPostAutosaving(lockKey);
10753      imageIsUploading = false;
10754    };
10755    (0,external_wp_mediaUtils_namespaceObject.uploadMedia)({
10756      allowedTypes,
10757      filesList,
10758      onFileChange: file => {
10759        if (!imageIsUploading) {
10760          setSaveLock();
10761        } else {
10762          clearSaveLock();
10763        }
10764        onFileChange?.(file);
10765      },
10766      onSuccess,
10767      additionalData: {
10768        ...postData,
10769        ...additionalData
10770      },
10771      maxUploadFileSize,
10772      onError: ({
10773        message
10774      }) => {
10775        clearSaveLock();
10776        onError(message);
10777      },
10778      wpAllowedMimeTypes,
10779      multiple
10780    });
10781  }
10782  
10783  ;// ./node_modules/@wordpress/editor/build-module/utils/media-sideload/index.js
10784  /**
10785   * WordPress dependencies
10786   */
10787  
10788  
10789  /**
10790   * Internal dependencies
10791   */
10792  
10793  const {
10794    sideloadMedia: mediaSideload
10795  } = unlock(external_wp_mediaUtils_namespaceObject.privateApis);
10796  /* harmony default export */ const media_sideload = (mediaSideload);
10797  
10798  // EXTERNAL MODULE: ./node_modules/deepmerge/dist/cjs.js
10799  var cjs = __webpack_require__(66);
10800  var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
10801  ;// ./node_modules/is-plain-object/dist/is-plain-object.mjs
10802  /*!
10803   * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
10804   *
10805   * Copyright (c) 2014-2017, Jon Schlinkert.
10806   * Released under the MIT License.
10807   */
10808  
10809  function isObject(o) {
10810    return Object.prototype.toString.call(o) === '[object Object]';
10811  }
10812  
10813  function isPlainObject(o) {
10814    var ctor,prot;
10815  
10816    if (isObject(o) === false) return false;
10817  
10818    // If has modified constructor
10819    ctor = o.constructor;
10820    if (ctor === undefined) return true;
10821  
10822    // If has modified prototype
10823    prot = ctor.prototype;
10824    if (isObject(prot) === false) return false;
10825  
10826    // If constructor does not have an Object-specific method
10827    if (prot.hasOwnProperty('isPrototypeOf') === false) {
10828      return false;
10829    }
10830  
10831    // Most likely a plain Object
10832    return true;
10833  }
10834  
10835  
10836  
10837  ;// ./node_modules/@wordpress/editor/build-module/components/global-styles-provider/index.js
10838  /**
10839   * External dependencies
10840   */
10841  
10842  
10843  
10844  /**
10845   * WordPress dependencies
10846   */
10847  
10848  
10849  
10850  
10851  
10852  /**
10853   * Internal dependencies
10854   */
10855  
10856  
10857  const {
10858    GlobalStylesContext,
10859    cleanEmptyObject
10860  } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
10861  function mergeBaseAndUserConfigs(base, user) {
10862    return cjs_default()(base, user, {
10863      /*
10864       * We only pass as arrays the presets,
10865       * in which case we want the new array of values
10866       * to override the old array (no merging).
10867       */
10868      isMergeableObject: isPlainObject,
10869      /*
10870       * Exceptions to the above rule.
10871       * Background images should be replaced, not merged,
10872       * as they themselves are specific object definitions for the style.
10873       */
10874      customMerge: key => {
10875        if (key === 'backgroundImage') {
10876          return (baseConfig, userConfig) => userConfig;
10877        }
10878        return undefined;
10879      }
10880    });
10881  }
10882  function useGlobalStylesUserConfig() {
10883    const {
10884      globalStylesId,
10885      isReady,
10886      settings,
10887      styles,
10888      _links
10889    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
10890      const {
10891        getEntityRecord,
10892        getEditedEntityRecord,
10893        hasFinishedResolution,
10894        canUser
10895      } = select(external_wp_coreData_namespaceObject.store);
10896      const _globalStylesId = select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentGlobalStylesId();
10897      let record;
10898  
10899      /*
10900       * Ensure that the global styles ID request is complete by testing `_globalStylesId`,
10901       * before firing off the `canUser` OPTIONS request for user capabilities, otherwise it will
10902       * fetch `/wp/v2/global-styles` instead of `/wp/v2/global-styles/{id}`.
10903       * NOTE: Please keep in sync any preload paths sent to `block_editor_rest_api_preload()`,
10904       * or set using the `block_editor_rest_api_preload_paths` filter, if this changes.
10905       */
10906      const userCanEditGlobalStyles = _globalStylesId ? canUser('update', {
10907        kind: 'root',
10908        name: 'globalStyles',
10909        id: _globalStylesId
10910      }) : null;
10911      if (_globalStylesId &&
10912      /*
10913       * Test that the OPTIONS request for user capabilities is complete
10914       * before fetching the global styles entity record.
10915       * This is to avoid fetching the global styles entity unnecessarily.
10916       */
10917      typeof userCanEditGlobalStyles === 'boolean') {
10918        /*
10919         * Fetch the global styles entity record based on the user's capabilities.
10920         * The default context is `edit` for users who can edit global styles.
10921         * Otherwise, the context is `view`.
10922         * NOTE: There is an equivalent conditional check using `current_user_can()` in the backend
10923         * to preload the global styles entity. Please keep in sync any preload paths sent to `block_editor_rest_api_preload()`,
10924         * or set using `block_editor_rest_api_preload_paths` filter, if this changes.
10925         */
10926        if (userCanEditGlobalStyles) {
10927          record = getEditedEntityRecord('root', 'globalStyles', _globalStylesId);
10928        } else {
10929          record = getEntityRecord('root', 'globalStyles', _globalStylesId, {
10930            context: 'view'
10931          });
10932        }
10933      }
10934      let hasResolved = false;
10935      if (hasFinishedResolution('__experimentalGetCurrentGlobalStylesId')) {
10936        if (_globalStylesId) {
10937          hasResolved = userCanEditGlobalStyles ? hasFinishedResolution('getEditedEntityRecord', ['root', 'globalStyles', _globalStylesId]) : hasFinishedResolution('getEntityRecord', ['root', 'globalStyles', _globalStylesId, {
10938            context: 'view'
10939          }]);
10940        } else {
10941          hasResolved = true;
10942        }
10943      }
10944      return {
10945        globalStylesId: _globalStylesId,
10946        isReady: hasResolved,
10947        settings: record?.settings,
10948        styles: record?.styles,
10949        _links: record?._links
10950      };
10951    }, []);
10952    const {
10953      getEditedEntityRecord
10954    } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store);
10955    const {
10956      editEntityRecord
10957    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
10958    const config = (0,external_wp_element_namespaceObject.useMemo)(() => {
10959      return {
10960        settings: settings !== null && settings !== void 0 ? settings : {},
10961        styles: styles !== null && styles !== void 0 ? styles : {},
10962        _links: _links !== null && _links !== void 0 ? _links : {}
10963      };
10964    }, [settings, styles, _links]);
10965    const setConfig = (0,external_wp_element_namespaceObject.useCallback)(
10966    /**
10967     * Set the global styles config.
10968     * @param {Function|Object} callbackOrObject If the callbackOrObject is a function, pass the current config to the callback so the consumer can merge values.
10969     *                                           Otherwise, overwrite the current config with the incoming object.
10970     * @param {Object}          options          Options for editEntityRecord Core selector.
10971     */
10972    (callbackOrObject, options = {}) => {
10973      var _record$styles, _record$settings, _record$_links;
10974      const record = getEditedEntityRecord('root', 'globalStyles', globalStylesId);
10975      const currentConfig = {
10976        styles: (_record$styles = record?.styles) !== null && _record$styles !== void 0 ? _record$styles : {},
10977        settings: (_record$settings = record?.settings) !== null && _record$settings !== void 0 ? _record$settings : {},
10978        _links: (_record$_links = record?._links) !== null && _record$_links !== void 0 ? _record$_links : {}
10979      };
10980      const updatedConfig = typeof callbackOrObject === 'function' ? callbackOrObject(currentConfig) : callbackOrObject;
10981      editEntityRecord('root', 'globalStyles', globalStylesId, {
10982        styles: cleanEmptyObject(updatedConfig.styles) || {},
10983        settings: cleanEmptyObject(updatedConfig.settings) || {},
10984        _links: cleanEmptyObject(updatedConfig._links) || {}
10985      }, options);
10986    }, [globalStylesId, editEntityRecord, getEditedEntityRecord]);
10987    return [isReady, config, setConfig];
10988  }
10989  function useGlobalStylesBaseConfig() {
10990    const baseConfig = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentThemeBaseGlobalStyles(), []);
10991    return [!!baseConfig, baseConfig];
10992  }
10993  function useGlobalStylesContext() {
10994    const [isUserConfigReady, userConfig, setUserConfig] = useGlobalStylesUserConfig();
10995    const [isBaseConfigReady, baseConfig] = useGlobalStylesBaseConfig();
10996    const mergedConfig = (0,external_wp_element_namespaceObject.useMemo)(() => {
10997      if (!baseConfig || !userConfig) {
10998        return {};
10999      }
11000      return mergeBaseAndUserConfigs(baseConfig, userConfig);
11001    }, [userConfig, baseConfig]);
11002    const context = (0,external_wp_element_namespaceObject.useMemo)(() => {
11003      return {
11004        isReady: isUserConfigReady && isBaseConfigReady,
11005        user: userConfig,
11006        base: baseConfig,
11007        merged: mergedConfig,
11008        setUserConfig
11009      };
11010    }, [mergedConfig, userConfig, baseConfig, setUserConfig, isUserConfigReady, isBaseConfigReady]);
11011    return context;
11012  }
11013  function GlobalStylesProvider({
11014    children
11015  }) {
11016    const context = useGlobalStylesContext();
11017    if (!context.isReady) {
11018      return null;
11019    }
11020    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesContext.Provider, {
11021      value: context,
11022      children: children
11023    });
11024  }
11025  
11026  ;// ./node_modules/@wordpress/editor/build-module/components/provider/use-block-editor-settings.js
11027  /**
11028   * WordPress dependencies
11029   */
11030  
11031  
11032  
11033  
11034  
11035  
11036  
11037  
11038  
11039  /**
11040   * Internal dependencies
11041   */
11042  
11043  
11044  
11045  
11046  
11047  
11048  const use_block_editor_settings_EMPTY_OBJECT = {};
11049  function __experimentalReusableBlocksSelect(select) {
11050    const {
11051      RECEIVE_INTERMEDIATE_RESULTS
11052    } = unlock(external_wp_coreData_namespaceObject.privateApis);
11053    const {
11054      getEntityRecords
11055    } = select(external_wp_coreData_namespaceObject.store);
11056    return getEntityRecords('postType', 'wp_block', {
11057      per_page: -1,
11058      [RECEIVE_INTERMEDIATE_RESULTS]: true
11059    });
11060  }
11061  const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', 'alignWide', 'blockInspectorTabs', 'maxUploadFileSize', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'canUpdateBlockBindings', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'fontSizes', 'gradients', 'generateAnchors', 'onNavigateToEntityRecord', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isPreviewMode', 'isRTL', 'locale', 'maxWidth', 'postContentAttributes', 'postsPerPage', 'readOnly', 'styles', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableResolvedAssets', '__unstableIsBlockBasedTheme'];
11062  const {
11063    globalStylesDataKey,
11064    globalStylesLinksDataKey,
11065    selectBlockPatternsKey,
11066    reusableBlocksSelectKey,
11067    sectionRootClientIdKey
11068  } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
11069  
11070  /**
11071   * React hook used to compute the block editor settings to use for the post editor.
11072   *
11073   * @param {Object} settings      EditorProvider settings prop.
11074   * @param {string} postType      Editor root level post type.
11075   * @param {string} postId        Editor root level post ID.
11076   * @param {string} renderingMode Editor rendering mode.
11077   *
11078   * @return {Object} Block Editor Settings.
11079   */
11080  function useBlockEditorSettings(settings, postType, postId, renderingMode) {
11081    var _mergedGlobalStyles$s, _mergedGlobalStyles$_, _settings$__experimen, _settings$__experimen2;
11082    const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
11083    const {
11084      allowRightClickOverrides,
11085      blockTypes,
11086      focusMode,
11087      hasFixedToolbar,
11088      isDistractionFree,
11089      keepCaretInsideBlock,
11090      hasUploadPermissions,
11091      hiddenBlockTypes,
11092      canUseUnfilteredHTML,
11093      userCanCreatePages,
11094      pageOnFront,
11095      pageForPosts,
11096      userPatternCategories,
11097      restBlockPatternCategories,
11098      sectionRootClientId
11099    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
11100      var _canUser;
11101      const {
11102        canUser,
11103        getRawEntityRecord,
11104        getEntityRecord,
11105        getUserPatternCategories,
11106        getBlockPatternCategories
11107      } = select(external_wp_coreData_namespaceObject.store);
11108      const {
11109        get
11110      } = select(external_wp_preferences_namespaceObject.store);
11111      const {
11112        getBlockTypes
11113      } = select(external_wp_blocks_namespaceObject.store);
11114      const {
11115        getBlocksByName,
11116        getBlockAttributes
11117      } = select(external_wp_blockEditor_namespaceObject.store);
11118      const siteSettings = canUser('read', {
11119        kind: 'root',
11120        name: 'site'
11121      }) ? getEntityRecord('root', 'site') : undefined;
11122      function getSectionRootBlock() {
11123        var _getBlocksByName$find;
11124        if (renderingMode === 'template-locked') {
11125          var _getBlocksByName$;
11126          return (_getBlocksByName$ = getBlocksByName('core/post-content')?.[0]) !== null && _getBlocksByName$ !== void 0 ? _getBlocksByName$ : '';
11127        }
11128        return (_getBlocksByName$find = getBlocksByName('core/group').find(clientId => getBlockAttributes(clientId)?.tagName === 'main')) !== null && _getBlocksByName$find !== void 0 ? _getBlocksByName$find : '';
11129      }
11130      return {
11131        allowRightClickOverrides: get('core', 'allowRightClickOverrides'),
11132        blockTypes: getBlockTypes(),
11133        canUseUnfilteredHTML: getRawEntityRecord('postType', postType, postId)?._links?.hasOwnProperty('wp:action-unfiltered-html'),
11134        focusMode: get('core', 'focusMode'),
11135        hasFixedToolbar: get('core', 'fixedToolbar') || !isLargeViewport,
11136        hiddenBlockTypes: get('core', 'hiddenBlockTypes'),
11137        isDistractionFree: get('core', 'distractionFree'),
11138        keepCaretInsideBlock: get('core', 'keepCaretInsideBlock'),
11139        hasUploadPermissions: (_canUser = canUser('create', {
11140          kind: 'root',
11141          name: 'media'
11142        })) !== null && _canUser !== void 0 ? _canUser : true,
11143        userCanCreatePages: canUser('create', {
11144          kind: 'postType',
11145          name: 'page'
11146        }),
11147        pageOnFront: siteSettings?.page_on_front,
11148        pageForPosts: siteSettings?.page_for_posts,
11149        userPatternCategories: getUserPatternCategories(),
11150        restBlockPatternCategories: getBlockPatternCategories(),
11151        sectionRootClientId: getSectionRootBlock()
11152      };
11153    }, [postType, postId, isLargeViewport, renderingMode]);
11154    const {
11155      merged: mergedGlobalStyles
11156    } = useGlobalStylesContext();
11157    const globalStylesData = (_mergedGlobalStyles$s = mergedGlobalStyles.styles) !== null && _mergedGlobalStyles$s !== void 0 ? _mergedGlobalStyles$s : use_block_editor_settings_EMPTY_OBJECT;
11158    const globalStylesLinksData = (_mergedGlobalStyles$_ = mergedGlobalStyles._links) !== null && _mergedGlobalStyles$_ !== void 0 ? _mergedGlobalStyles$_ : use_block_editor_settings_EMPTY_OBJECT;
11159    const settingsBlockPatterns = (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen :
11160    // WP 6.0
11161    settings.__experimentalBlockPatterns; // WP 5.9
11162    const settingsBlockPatternCategories = (_settings$__experimen2 = settings.__experimentalAdditionalBlockPatternCategories) !== null && _settings$__experimen2 !== void 0 ? _settings$__experimen2 :
11163    // WP 6.0
11164    settings.__experimentalBlockPatternCategories; // WP 5.9
11165  
11166    const blockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => [...(settingsBlockPatterns || [])].filter(({
11167      postTypes
11168    }) => {
11169      return !postTypes || Array.isArray(postTypes) && postTypes.includes(postType);
11170    }), [settingsBlockPatterns, postType]);
11171    const blockPatternCategories = (0,external_wp_element_namespaceObject.useMemo)(() => [...(settingsBlockPatternCategories || []), ...(restBlockPatternCategories || [])].filter((x, index, arr) => index === arr.findIndex(y => x.name === y.name)), [settingsBlockPatternCategories, restBlockPatternCategories]);
11172    const {
11173      undo,
11174      setIsInserterOpened
11175    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
11176    const {
11177      saveEntityRecord
11178    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
11179  
11180    /**
11181     * Creates a Post entity.
11182     * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.
11183     *
11184     * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.
11185     * @return {Object} the post type object that was created.
11186     */
11187    const createPageEntity = (0,external_wp_element_namespaceObject.useCallback)(options => {
11188      if (!userCanCreatePages) {
11189        return Promise.reject({
11190          message: (0,external_wp_i18n_namespaceObject.__)('You do not have permission to create Pages.')
11191        });
11192      }
11193      return saveEntityRecord('postType', 'page', options);
11194    }, [saveEntityRecord, userCanCreatePages]);
11195    const allowedBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(() => {
11196      // Omit hidden block types if exists and non-empty.
11197      if (hiddenBlockTypes && hiddenBlockTypes.length > 0) {
11198        // Defer to passed setting for `allowedBlockTypes` if provided as
11199        // anything other than `true` (where `true` is equivalent to allow
11200        // all block types).
11201        const defaultAllowedBlockTypes = true === settings.allowedBlockTypes ? blockTypes.map(({
11202          name
11203        }) => name) : settings.allowedBlockTypes || [];
11204        return defaultAllowedBlockTypes.filter(type => !hiddenBlockTypes.includes(type));
11205      }
11206      return settings.allowedBlockTypes;
11207    }, [settings.allowedBlockTypes, hiddenBlockTypes, blockTypes]);
11208    const forceDisableFocusMode = settings.focusMode === false;
11209    return (0,external_wp_element_namespaceObject.useMemo)(() => {
11210      const blockEditorSettings = {
11211        ...Object.fromEntries(Object.entries(settings).filter(([key]) => BLOCK_EDITOR_SETTINGS.includes(key))),
11212        [globalStylesDataKey]: globalStylesData,
11213        [globalStylesLinksDataKey]: globalStylesLinksData,
11214        allowedBlockTypes,
11215        allowRightClickOverrides,
11216        focusMode: focusMode && !forceDisableFocusMode,
11217        hasFixedToolbar,
11218        isDistractionFree,
11219        keepCaretInsideBlock,
11220        mediaUpload: hasUploadPermissions ? mediaUpload : undefined,
11221        mediaSideload: hasUploadPermissions ? media_sideload : undefined,
11222        __experimentalBlockPatterns: blockPatterns,
11223        [selectBlockPatternsKey]: select => {
11224          const {
11225            hasFinishedResolution,
11226            getBlockPatternsForPostType
11227          } = unlock(select(external_wp_coreData_namespaceObject.store));
11228          const patterns = getBlockPatternsForPostType(postType);
11229          return hasFinishedResolution('getBlockPatterns') ? patterns : undefined;
11230        },
11231        [reusableBlocksSelectKey]: __experimentalReusableBlocksSelect,
11232        __experimentalBlockPatternCategories: blockPatternCategories,
11233        __experimentalUserPatternCategories: userPatternCategories,
11234        __experimentalFetchLinkSuggestions: (search, searchOptions) => (0,external_wp_coreData_namespaceObject.__experimentalFetchLinkSuggestions)(search, searchOptions, settings),
11235        inserterMediaCategories: media_categories,
11236        __experimentalFetchRichUrlData: external_wp_coreData_namespaceObject.__experimentalFetchUrlData,
11237        // Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.
11238        // This might be better as a generic "canUser" selector.
11239        __experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,
11240        //Todo: this is only needed for native and should probably be removed.
11241        __experimentalUndo: undo,
11242        // Check whether we want all site editor frames to have outlines
11243        // including the navigation / pattern / parts editors.
11244        outlineMode: !isDistractionFree && postType === 'wp_template',
11245        // Check these two properties: they were not present in the site editor.
11246        __experimentalCreatePageEntity: createPageEntity,
11247        __experimentalUserCanCreatePages: userCanCreatePages,
11248        pageOnFront,
11249        pageForPosts,
11250        __experimentalPreferPatternsOnRoot: postType === 'wp_template',
11251        templateLock: postType === 'wp_navigation' ? 'insert' : settings.templateLock,
11252        template: postType === 'wp_navigation' ? [['core/navigation', {}, []]] : settings.template,
11253        __experimentalSetIsInserterOpened: setIsInserterOpened,
11254        [sectionRootClientIdKey]: sectionRootClientId,
11255        editorTool: renderingMode === 'post-only' && postType !== 'wp_template' ? 'edit' : undefined
11256      };
11257      return blockEditorSettings;
11258    }, [allowedBlockTypes, allowRightClickOverrides, focusMode, forceDisableFocusMode, hasFixedToolbar, isDistractionFree, keepCaretInsideBlock, settings, hasUploadPermissions, userPatternCategories, blockPatterns, blockPatternCategories, canUseUnfilteredHTML, undo, createPageEntity, userCanCreatePages, pageOnFront, pageForPosts, postType, setIsInserterOpened, sectionRootClientId, globalStylesData, globalStylesLinksData, renderingMode]);
11259  }
11260  /* harmony default export */ const use_block_editor_settings = (useBlockEditorSettings);
11261  
11262  ;// ./node_modules/@wordpress/editor/build-module/components/provider/use-post-content-blocks.js
11263  /**
11264   * WordPress dependencies
11265   */
11266  
11267  
11268  
11269  
11270  /**
11271   * Internal dependencies
11272   */
11273  
11274  
11275  const POST_CONTENT_BLOCK_TYPES = ['core/post-title', 'core/post-featured-image', 'core/post-content'];
11276  function usePostContentBlocks() {
11277    const contentOnlyBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(() => [...(0,external_wp_hooks_namespaceObject.applyFilters)('editor.postContentBlockTypes', POST_CONTENT_BLOCK_TYPES)], []);
11278  
11279    // Note that there are two separate subscriptions because the result for each
11280    // returns a new array.
11281    const contentOnlyIds = (0,external_wp_data_namespaceObject.useSelect)(select => {
11282      const {
11283        getPostBlocksByName
11284      } = unlock(select(store_store));
11285      return getPostBlocksByName(contentOnlyBlockTypes);
11286    }, [contentOnlyBlockTypes]);
11287    return contentOnlyIds;
11288  }
11289  
11290  ;// ./node_modules/@wordpress/editor/build-module/components/provider/disable-non-page-content-blocks.js
11291  /**
11292   * WordPress dependencies
11293   */
11294  
11295  
11296  
11297  
11298  /**
11299   * Internal dependencies
11300   */
11301  
11302  
11303  /**
11304   * Component that when rendered, makes it so that the site editor allows only
11305   * page content to be edited.
11306   */
11307  function DisableNonPageContentBlocks() {
11308    const contentOnlyIds = usePostContentBlocks();
11309    const {
11310      templateParts,
11311      isNavigationMode
11312    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
11313      const {
11314        getBlocksByName,
11315        isNavigationMode: _isNavigationMode
11316      } = select(external_wp_blockEditor_namespaceObject.store);
11317      return {
11318        templateParts: getBlocksByName('core/template-part'),
11319        isNavigationMode: _isNavigationMode()
11320      };
11321    }, []);
11322    const disabledIds = (0,external_wp_data_namespaceObject.useSelect)(select => {
11323      const {
11324        getBlockOrder
11325      } = select(external_wp_blockEditor_namespaceObject.store);
11326      return templateParts.flatMap(clientId => getBlockOrder(clientId));
11327    }, [templateParts]);
11328    const registry = (0,external_wp_data_namespaceObject.useRegistry)();
11329  
11330    // The code here is split into multiple `useEffects` calls.
11331    // This is done to avoid setting/unsetting block editing modes multiple times unnecessarily.
11332    //
11333    // For example, the block editing mode of the root block (clientId: '') only
11334    // needs to be set once, not when `contentOnlyIds` or `disabledIds` change.
11335    //
11336    // It's also unlikely that these different types of blocks are being inserted
11337    // or removed at the same time, so using different effects reflects that.
11338    (0,external_wp_element_namespaceObject.useEffect)(() => {
11339      const {
11340        setBlockEditingMode,
11341        unsetBlockEditingMode
11342      } = registry.dispatch(external_wp_blockEditor_namespaceObject.store);
11343      setBlockEditingMode('', 'disabled');
11344      return () => {
11345        unsetBlockEditingMode('');
11346      };
11347    }, [registry]);
11348    (0,external_wp_element_namespaceObject.useEffect)(() => {
11349      const {
11350        setBlockEditingMode,
11351        unsetBlockEditingMode
11352      } = registry.dispatch(external_wp_blockEditor_namespaceObject.store);
11353      registry.batch(() => {
11354        for (const clientId of contentOnlyIds) {
11355          setBlockEditingMode(clientId, 'contentOnly');
11356        }
11357      });
11358      return () => {
11359        registry.batch(() => {
11360          for (const clientId of contentOnlyIds) {
11361            unsetBlockEditingMode(clientId);
11362          }
11363        });
11364      };
11365    }, [contentOnlyIds, registry]);
11366    (0,external_wp_element_namespaceObject.useEffect)(() => {
11367      const {
11368        setBlockEditingMode,
11369        unsetBlockEditingMode
11370      } = registry.dispatch(external_wp_blockEditor_namespaceObject.store);
11371      registry.batch(() => {
11372        if (!isNavigationMode) {
11373          for (const clientId of templateParts) {
11374            setBlockEditingMode(clientId, 'contentOnly');
11375          }
11376        }
11377      });
11378      return () => {
11379        registry.batch(() => {
11380          if (!isNavigationMode) {
11381            for (const clientId of templateParts) {
11382              unsetBlockEditingMode(clientId);
11383            }
11384          }
11385        });
11386      };
11387    }, [templateParts, isNavigationMode, registry]);
11388    (0,external_wp_element_namespaceObject.useEffect)(() => {
11389      const {
11390        setBlockEditingMode,
11391        unsetBlockEditingMode
11392      } = registry.dispatch(external_wp_blockEditor_namespaceObject.store);
11393      registry.batch(() => {
11394        for (const clientId of disabledIds) {
11395          setBlockEditingMode(clientId, 'disabled');
11396        }
11397      });
11398      return () => {
11399        registry.batch(() => {
11400          for (const clientId of disabledIds) {
11401            unsetBlockEditingMode(clientId);
11402          }
11403        });
11404      };
11405    }, [disabledIds, registry]);
11406    return null;
11407  }
11408  
11409  ;// ./node_modules/@wordpress/editor/build-module/components/provider/navigation-block-editing-mode.js
11410  /**
11411   * WordPress dependencies
11412   */
11413  
11414  
11415  
11416  
11417  /**
11418   * For the Navigation block editor, we need to force the block editor to contentOnly for that block.
11419   *
11420   * Set block editing mode to contentOnly when entering Navigation focus mode.
11421   * this ensures that non-content controls on the block will be hidden and thus
11422   * the user can focus on editing the Navigation Menu content only.
11423   */
11424  
11425  function NavigationBlockEditingMode() {
11426    // In the navigation block editor,
11427    // the navigation block is the only root block.
11428    const blockClientId = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlockOrder()?.[0], []);
11429    const {
11430      setBlockEditingMode,
11431      unsetBlockEditingMode
11432    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
11433    (0,external_wp_element_namespaceObject.useEffect)(() => {
11434      if (!blockClientId) {
11435        return;
11436      }
11437      setBlockEditingMode(blockClientId, 'contentOnly');
11438      return () => {
11439        unsetBlockEditingMode(blockClientId);
11440      };
11441    }, [blockClientId, unsetBlockEditingMode, setBlockEditingMode]);
11442  }
11443  
11444  ;// ./node_modules/@wordpress/editor/build-module/components/provider/use-hide-blocks-from-inserter.js
11445  /**
11446   * WordPress dependencies
11447   */
11448  
11449  
11450  
11451  // These post types are "structural" block lists.
11452  // We should be allowed to use
11453  // the post content and template parts blocks within them.
11454  const POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART = ['wp_block', 'wp_template', 'wp_template_part'];
11455  
11456  /**
11457   * In some specific contexts,
11458   * the template part and post content blocks need to be hidden.
11459   *
11460   * @param {string} postType Post Type
11461   * @param {string} mode     Rendering mode
11462   */
11463  function useHideBlocksFromInserter(postType, mode) {
11464    (0,external_wp_element_namespaceObject.useEffect)(() => {
11465      /*
11466       * Prevent adding template part in the editor.
11467       */
11468      (0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromInserter', (canInsert, blockType) => {
11469        if (!POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART.includes(postType) && blockType.name === 'core/template-part' && mode === 'post-only') {
11470          return false;
11471        }
11472        return canInsert;
11473      });
11474  
11475      /*
11476       * Prevent adding post content block (except in query block) in the editor.
11477       */
11478      (0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'removePostContentFromInserter', (canInsert, blockType, rootClientId, {
11479        getBlockParentsByBlockName
11480      }) => {
11481        if (!POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART.includes(postType) && blockType.name === 'core/post-content') {
11482          return getBlockParentsByBlockName(rootClientId, 'core/query').length > 0;
11483        }
11484        return canInsert;
11485      });
11486      return () => {
11487        (0,external_wp_hooks_namespaceObject.removeFilter)('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromInserter');
11488        (0,external_wp_hooks_namespaceObject.removeFilter)('blockEditor.__unstableCanInsertBlockType', 'removePostContentFromInserter');
11489      };
11490    }, [postType, mode]);
11491  }
11492  
11493  ;// ./node_modules/@wordpress/icons/build-module/library/keyboard.js
11494  /**
11495   * WordPress dependencies
11496   */
11497  
11498  
11499  const keyboard = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, {
11500    xmlns: "http://www.w3.org/2000/svg",
11501    viewBox: "0 0 24 24",
11502    children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
11503      d: "m16 15.5h-8v-1.5h8zm-7.5-2.5h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm-9-3h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2z"
11504    }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
11505      d: "m18.5 6.5h-13a.5.5 0 0 0 -.5.5v9.5a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9.5a.5.5 0 0 0 -.5-.5zm-13-1.5h13a2 2 0 0 1 2 2v9.5a2 2 0 0 1 -2 2h-13a2 2 0 0 1 -2-2v-9.5a2 2 0 0 1 2-2z"
11506    })]
11507  });
11508  /* harmony default export */ const library_keyboard = (keyboard);
11509  
11510  ;// ./node_modules/@wordpress/icons/build-module/library/list-view.js
11511  /**
11512   * WordPress dependencies
11513   */
11514  
11515  
11516  const listView = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
11517    viewBox: "0 0 24 24",
11518    xmlns: "http://www.w3.org/2000/svg",
11519    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
11520      d: "M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"
11521    })
11522  });
11523  /* harmony default export */ const list_view = (listView);
11524  
11525  ;// ./node_modules/@wordpress/icons/build-module/library/code.js
11526  /**
11527   * WordPress dependencies
11528   */
11529  
11530  
11531  const code = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
11532    viewBox: "0 0 24 24",
11533    xmlns: "http://www.w3.org/2000/svg",
11534    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
11535      d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"
11536    })
11537  });
11538  /* harmony default export */ const library_code = (code);
11539  
11540  ;// ./node_modules/@wordpress/icons/build-module/library/drawer-left.js
11541  /**
11542   * WordPress dependencies
11543   */
11544  
11545  
11546  const drawerLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
11547    width: "24",
11548    height: "24",
11549    xmlns: "http://www.w3.org/2000/svg",
11550    viewBox: "0 0 24 24",
11551    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
11552      fillRule: "evenodd",
11553      clipRule: "evenodd",
11554      d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"
11555    })
11556  });
11557  /* harmony default export */ const drawer_left = (drawerLeft);
11558  
11559  ;// ./node_modules/@wordpress/icons/build-module/library/drawer-right.js
11560  /**
11561   * WordPress dependencies
11562   */
11563  
11564  
11565  const drawerRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
11566    width: "24",
11567    height: "24",
11568    xmlns: "http://www.w3.org/2000/svg",
11569    viewBox: "0 0 24 24",
11570    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
11571      fillRule: "evenodd",
11572      clipRule: "evenodd",
11573      d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"
11574    })
11575  });
11576  /* harmony default export */ const drawer_right = (drawerRight);
11577  
11578  ;// ./node_modules/@wordpress/icons/build-module/library/block-default.js
11579  /**
11580   * WordPress dependencies
11581   */
11582  
11583  
11584  const blockDefault = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
11585    xmlns: "http://www.w3.org/2000/svg",
11586    viewBox: "0 0 24 24",
11587    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
11588      d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"
11589    })
11590  });
11591  /* harmony default export */ const block_default = (blockDefault);
11592  
11593  ;// ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js
11594  /**
11595   * WordPress dependencies
11596   */
11597  
11598  
11599  const formatListBullets = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
11600    xmlns: "http://www.w3.org/2000/svg",
11601    viewBox: "0 0 24 24",
11602    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
11603      d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
11604    })
11605  });
11606  /* harmony default export */ const format_list_bullets = (formatListBullets);
11607  
11608  ;// ./node_modules/@wordpress/icons/build-module/library/pencil.js
11609  /**
11610   * WordPress dependencies
11611   */
11612  
11613  
11614  const pencil = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
11615    xmlns: "http://www.w3.org/2000/svg",
11616    viewBox: "0 0 24 24",
11617    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
11618      d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"
11619    })
11620  });
11621  /* harmony default export */ const library_pencil = (pencil);
11622  
11623  ;// ./node_modules/@wordpress/icons/build-module/library/edit.js
11624  /**
11625   * Internal dependencies
11626   */
11627  
11628  
11629  /* harmony default export */ const library_edit = (library_pencil);
11630  
11631  ;// ./node_modules/@wordpress/icons/build-module/library/symbol.js
11632  /**
11633   * WordPress dependencies
11634   */
11635  
11636  
11637  const symbol = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
11638    xmlns: "http://www.w3.org/2000/svg",
11639    viewBox: "0 0 24 24",
11640    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
11641      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"
11642    })
11643  });
11644  /* harmony default export */ const library_symbol = (symbol);
11645  
11646  ;// ./node_modules/@wordpress/icons/build-module/library/page.js
11647  /**
11648   * WordPress dependencies
11649   */
11650  
11651  
11652  const page = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, {
11653    xmlns: "http://www.w3.org/2000/svg",
11654    viewBox: "0 0 24 24",
11655    children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
11656      d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"
11657    }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
11658      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"
11659    })]
11660  });
11661  /* harmony default export */ const library_page = (page);
11662  
11663  ;// ./node_modules/@wordpress/icons/build-module/library/rotate-right.js
11664  /**
11665   * WordPress dependencies
11666   */
11667  
11668  
11669  const rotateRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
11670    xmlns: "http://www.w3.org/2000/svg",
11671    viewBox: "0 0 24 24",
11672    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
11673      d: "M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"
11674    })
11675  });
11676  /* harmony default export */ const rotate_right = (rotateRight);
11677  
11678  ;// ./node_modules/@wordpress/icons/build-module/library/rotate-left.js
11679  /**
11680   * WordPress dependencies
11681   */
11682  
11683  
11684  const rotateLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
11685    xmlns: "http://www.w3.org/2000/svg",
11686    viewBox: "0 0 24 24",
11687    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
11688      d: "M12 4V2.2L9 4.8l3 2.5V5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.9-1.9 5.3-4.5 6.2v.2l-.1-.2c-.4.1-.7.2-1.1.2l.2 1.5c.3 0 .6-.1 1-.2 3.5-.9 6-4 6-7.7 0-4.4-3.6-8-8-8zm-7.9 7l1.5.2c.1-1.2.5-2.3 1.2-3.2l-1.1-.9C4.8 8.2 4.3 9.6 4.1 11zm1.5 1.8l-1.5.2c.1.7.3 1.4.5 2 .3.7.6 1.3 1 1.8l1.2-.8c-.3-.5-.6-1-.8-1.5s-.4-1.1-.4-1.7zm1.5 5.5c1.1.9 2.4 1.4 3.8 1.6l.2-1.5c-1.1-.1-2.2-.5-3.1-1.2l-.9 1.1z"
11689    })
11690  });
11691  /* harmony default export */ const rotate_left = (rotateLeft);
11692  
11693  ;// external ["wp","commands"]
11694  const external_wp_commands_namespaceObject = window["wp"]["commands"];
11695  ;// ./node_modules/@wordpress/icons/build-module/library/star-filled.js
11696  /**
11697   * WordPress dependencies
11698   */
11699  
11700  
11701  const starFilled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
11702    xmlns: "http://www.w3.org/2000/svg",
11703    viewBox: "0 0 24 24",
11704    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
11705      d: "M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"
11706    })
11707  });
11708  /* harmony default export */ const star_filled = (starFilled);
11709  
11710  ;// ./node_modules/@wordpress/icons/build-module/library/star-empty.js
11711  /**
11712   * WordPress dependencies
11713   */
11714  
11715  
11716  const starEmpty = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
11717    xmlns: "http://www.w3.org/2000/svg",
11718    viewBox: "0 0 24 24",
11719    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
11720      fillRule: "evenodd",
11721      d: "M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",
11722      clipRule: "evenodd"
11723    })
11724  });
11725  /* harmony default export */ const star_empty = (starEmpty);
11726  
11727  ;// external ["wp","viewport"]
11728  const external_wp_viewport_namespaceObject = window["wp"]["viewport"];
11729  ;// external ["wp","plugins"]
11730  const external_wp_plugins_namespaceObject = window["wp"]["plugins"];
11731  ;// ./node_modules/@wordpress/interface/build-module/store/deprecated.js
11732  /**
11733   * WordPress dependencies
11734   */
11735  
11736  function normalizeComplementaryAreaScope(scope) {
11737    if (['core/edit-post', 'core/edit-site'].includes(scope)) {
11738      external_wp_deprecated_default()(`$scope} interface scope`, {
11739        alternative: 'core interface scope',
11740        hint: 'core/edit-post and core/edit-site are merging.',
11741        version: '6.6'
11742      });
11743      return 'core';
11744    }
11745    return scope;
11746  }
11747  function normalizeComplementaryAreaName(scope, name) {
11748    if (scope === 'core' && name === 'edit-site/template') {
11749      external_wp_deprecated_default()(`edit-site/template sidebar`, {
11750        alternative: 'edit-post/document',
11751        version: '6.6'
11752      });
11753      return 'edit-post/document';
11754    }
11755    if (scope === 'core' && name === 'edit-site/block-inspector') {
11756      external_wp_deprecated_default()(`edit-site/block-inspector sidebar`, {
11757        alternative: 'edit-post/block',
11758        version: '6.6'
11759      });
11760      return 'edit-post/block';
11761    }
11762    return name;
11763  }
11764  
11765  ;// ./node_modules/@wordpress/interface/build-module/store/actions.js
11766  /**
11767   * WordPress dependencies
11768   */
11769  
11770  
11771  
11772  /**
11773   * Internal dependencies
11774   */
11775  
11776  
11777  /**
11778   * Set a default complementary area.
11779   *
11780   * @param {string} scope Complementary area scope.
11781   * @param {string} area  Area identifier.
11782   *
11783   * @return {Object} Action object.
11784   */
11785  const setDefaultComplementaryArea = (scope, area) => {
11786    scope = normalizeComplementaryAreaScope(scope);
11787    area = normalizeComplementaryAreaName(scope, area);
11788    return {
11789      type: 'SET_DEFAULT_COMPLEMENTARY_AREA',
11790      scope,
11791      area
11792    };
11793  };
11794  
11795  /**
11796   * Enable the complementary area.
11797   *
11798   * @param {string} scope Complementary area scope.
11799   * @param {string} area  Area identifier.
11800   */
11801  const enableComplementaryArea = (scope, area) => ({
11802    registry,
11803    dispatch
11804  }) => {
11805    // Return early if there's no area.
11806    if (!area) {
11807      return;
11808    }
11809    scope = normalizeComplementaryAreaScope(scope);
11810    area = normalizeComplementaryAreaName(scope, area);
11811    const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible');
11812    if (!isComplementaryAreaVisible) {
11813      registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'isComplementaryAreaVisible', true);
11814    }
11815    dispatch({
11816      type: 'ENABLE_COMPLEMENTARY_AREA',
11817      scope,
11818      area
11819    });
11820  };
11821  
11822  /**
11823   * Disable the complementary area.
11824   *
11825   * @param {string} scope Complementary area scope.
11826   */
11827  const disableComplementaryArea = scope => ({
11828    registry
11829  }) => {
11830    scope = normalizeComplementaryAreaScope(scope);
11831    const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible');
11832    if (isComplementaryAreaVisible) {
11833      registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'isComplementaryAreaVisible', false);
11834    }
11835  };
11836  
11837  /**
11838   * Pins an item.
11839   *
11840   * @param {string} scope Item scope.
11841   * @param {string} item  Item identifier.
11842   *
11843   * @return {Object} Action object.
11844   */
11845  const pinItem = (scope, item) => ({
11846    registry
11847  }) => {
11848    // Return early if there's no item.
11849    if (!item) {
11850      return;
11851    }
11852    scope = normalizeComplementaryAreaScope(scope);
11853    item = normalizeComplementaryAreaName(scope, item);
11854    const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems');
11855  
11856    // The item is already pinned, there's nothing to do.
11857    if (pinnedItems?.[item] === true) {
11858      return;
11859    }
11860    registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', {
11861      ...pinnedItems,
11862      [item]: true
11863    });
11864  };
11865  
11866  /**
11867   * Unpins an item.
11868   *
11869   * @param {string} scope Item scope.
11870   * @param {string} item  Item identifier.
11871   */
11872  const unpinItem = (scope, item) => ({
11873    registry
11874  }) => {
11875    // Return early if there's no item.
11876    if (!item) {
11877      return;
11878    }
11879    scope = normalizeComplementaryAreaScope(scope);
11880    item = normalizeComplementaryAreaName(scope, item);
11881    const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems');
11882    registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', {
11883      ...pinnedItems,
11884      [item]: false
11885    });
11886  };
11887  
11888  /**
11889   * Returns an action object used in signalling that a feature should be toggled.
11890   *
11891   * @param {string} scope       The feature scope (e.g. core/edit-post).
11892   * @param {string} featureName The feature name.
11893   */
11894  function toggleFeature(scope, featureName) {
11895    return function ({
11896      registry
11897    }) {
11898      external_wp_deprecated_default()(`dispatch( 'core/interface' ).toggleFeature`, {
11899        since: '6.0',
11900        alternative: `dispatch( 'core/preferences' ).toggle`
11901      });
11902      registry.dispatch(external_wp_preferences_namespaceObject.store).toggle(scope, featureName);
11903    };
11904  }
11905  
11906  /**
11907   * Returns an action object used in signalling that a feature should be set to
11908   * a true or false value
11909   *
11910   * @param {string}  scope       The feature scope (e.g. core/edit-post).
11911   * @param {string}  featureName The feature name.
11912   * @param {boolean} value       The value to set.
11913   *
11914   * @return {Object} Action object.
11915   */
11916  function setFeatureValue(scope, featureName, value) {
11917    return function ({
11918      registry
11919    }) {
11920      external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureValue`, {
11921        since: '6.0',
11922        alternative: `dispatch( 'core/preferences' ).set`
11923      });
11924      registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, featureName, !!value);
11925    };
11926  }
11927  
11928  /**
11929   * Returns an action object used in signalling that defaults should be set for features.
11930   *
11931   * @param {string}                  scope    The feature scope (e.g. core/edit-post).
11932   * @param {Object<string, boolean>} defaults A key/value map of feature names to values.
11933   *
11934   * @return {Object} Action object.
11935   */
11936  function setFeatureDefaults(scope, defaults) {
11937    return function ({
11938      registry
11939    }) {
11940      external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureDefaults`, {
11941        since: '6.0',
11942        alternative: `dispatch( 'core/preferences' ).setDefaults`
11943      });
11944      registry.dispatch(external_wp_preferences_namespaceObject.store).setDefaults(scope, defaults);
11945    };
11946  }
11947  
11948  /**
11949   * Returns an action object used in signalling that the user opened a modal.
11950   *
11951   * @param {string} name A string that uniquely identifies the modal.
11952   *
11953   * @return {Object} Action object.
11954   */
11955  function openModal(name) {
11956    return {
11957      type: 'OPEN_MODAL',
11958      name
11959    };
11960  }
11961  
11962  /**
11963   * Returns an action object signalling that the user closed a modal.
11964   *
11965   * @return {Object} Action object.
11966   */
11967  function closeModal() {
11968    return {
11969      type: 'CLOSE_MODAL'
11970    };
11971  }
11972  
11973  ;// ./node_modules/@wordpress/interface/build-module/store/selectors.js
11974  /**
11975   * WordPress dependencies
11976   */
11977  
11978  
11979  
11980  
11981  /**
11982   * Internal dependencies
11983   */
11984  
11985  
11986  /**
11987   * Returns the complementary area that is active in a given scope.
11988   *
11989   * @param {Object} state Global application state.
11990   * @param {string} scope Item scope.
11991   *
11992   * @return {string | null | undefined} The complementary area that is active in the given scope.
11993   */
11994  const getActiveComplementaryArea = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope) => {
11995    scope = normalizeComplementaryAreaScope(scope);
11996    const isComplementaryAreaVisible = select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible');
11997  
11998    // Return `undefined` to indicate that the user has never toggled
11999    // visibility, this is the vanilla default. Other code relies on this
12000    // nuance in the return value.
12001    if (isComplementaryAreaVisible === undefined) {
12002      return undefined;
12003    }
12004  
12005    // Return `null` to indicate the user hid the complementary area.
12006    if (isComplementaryAreaVisible === false) {
12007      return null;
12008    }
12009    return state?.complementaryAreas?.[scope];
12010  });
12011  const isComplementaryAreaLoading = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope) => {
12012    scope = normalizeComplementaryAreaScope(scope);
12013    const isVisible = select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible');
12014    const identifier = state?.complementaryAreas?.[scope];
12015    return isVisible && identifier === undefined;
12016  });
12017  
12018  /**
12019   * Returns a boolean indicating if an item is pinned or not.
12020   *
12021   * @param {Object} state Global application state.
12022   * @param {string} scope Scope.
12023   * @param {string} item  Item to check.
12024   *
12025   * @return {boolean} True if the item is pinned and false otherwise.
12026   */
12027  const isItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, item) => {
12028    var _pinnedItems$item;
12029    scope = normalizeComplementaryAreaScope(scope);
12030    item = normalizeComplementaryAreaName(scope, item);
12031    const pinnedItems = select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems');
12032    return (_pinnedItems$item = pinnedItems?.[item]) !== null && _pinnedItems$item !== void 0 ? _pinnedItems$item : true;
12033  });
12034  
12035  /**
12036   * Returns a boolean indicating whether a feature is active for a particular
12037   * scope.
12038   *
12039   * @param {Object} state       The store state.
12040   * @param {string} scope       The scope of the feature (e.g. core/edit-post).
12041   * @param {string} featureName The name of the feature.
12042   *
12043   * @return {boolean} Is the feature enabled?
12044   */
12045  const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, featureName) => {
12046    external_wp_deprecated_default()(`select( 'core/interface' ).isFeatureActive( scope, featureName )`, {
12047      since: '6.0',
12048      alternative: `select( 'core/preferences' ).get( scope, featureName )`
12049    });
12050    return !!select(external_wp_preferences_namespaceObject.store).get(scope, featureName);
12051  });
12052  
12053  /**
12054   * Returns true if a modal is active, or false otherwise.
12055   *
12056   * @param {Object} state     Global application state.
12057   * @param {string} modalName A string that uniquely identifies the modal.
12058   *
12059   * @return {boolean} Whether the modal is active.
12060   */
12061  function isModalActive(state, modalName) {
12062    return state.activeModal === modalName;
12063  }
12064  
12065  ;// ./node_modules/@wordpress/interface/build-module/store/reducer.js
12066  /**
12067   * WordPress dependencies
12068   */
12069  
12070  function complementaryAreas(state = {}, action) {
12071    switch (action.type) {
12072      case 'SET_DEFAULT_COMPLEMENTARY_AREA':
12073        {
12074          const {
12075            scope,
12076            area
12077          } = action;
12078  
12079          // If there's already an area, don't overwrite it.
12080          if (state[scope]) {
12081            return state;
12082          }
12083          return {
12084            ...state,
12085            [scope]: area
12086          };
12087        }
12088      case 'ENABLE_COMPLEMENTARY_AREA':
12089        {
12090          const {
12091            scope,
12092            area
12093          } = action;
12094          return {
12095            ...state,
12096            [scope]: area
12097          };
12098        }
12099    }
12100    return state;
12101  }
12102  
12103  /**
12104   * Reducer for storing the name of the open modal, or null if no modal is open.
12105   *
12106   * @param {Object} state  Previous state.
12107   * @param {Object} action Action object containing the `name` of the modal
12108   *
12109   * @return {Object} Updated state
12110   */
12111  function activeModal(state = null, action) {
12112    switch (action.type) {
12113      case 'OPEN_MODAL':
12114        return action.name;
12115      case 'CLOSE_MODAL':
12116        return null;
12117    }
12118    return state;
12119  }
12120  /* harmony default export */ const build_module_store_reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
12121    complementaryAreas,
12122    activeModal
12123  }));
12124  
12125  ;// ./node_modules/@wordpress/interface/build-module/store/constants.js
12126  /**
12127   * The identifier for the data store.
12128   *
12129   * @type {string}
12130   */
12131  const constants_STORE_NAME = 'core/interface';
12132  
12133  ;// ./node_modules/@wordpress/interface/build-module/store/index.js
12134  /**
12135   * WordPress dependencies
12136   */
12137  
12138  
12139  /**
12140   * Internal dependencies
12141   */
12142  
12143  
12144  
12145  
12146  
12147  /**
12148   * Store definition for the interface namespace.
12149   *
12150   * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
12151   *
12152   * @type {Object}
12153   */
12154  const store = (0,external_wp_data_namespaceObject.createReduxStore)(constants_STORE_NAME, {
12155    reducer: build_module_store_reducer,
12156    actions: store_actions_namespaceObject,
12157    selectors: store_selectors_namespaceObject
12158  });
12159  
12160  // Once we build a more generic persistence plugin that works across types of stores
12161  // we'd be able to replace this with a register call.
12162  (0,external_wp_data_namespaceObject.register)(store);
12163  
12164  ;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-toggle/index.js
12165  /**
12166   * WordPress dependencies
12167   */
12168  
12169  
12170  
12171  
12172  /**
12173   * Internal dependencies
12174   */
12175  
12176  
12177  /**
12178   * Whether the role supports checked state.
12179   *
12180   * @see https://www.w3.org/TR/wai-aria-1.1/#aria-checked
12181   * @param {import('react').AriaRole} role Role.
12182   * @return {boolean} Whether the role supports checked state.
12183   */
12184  
12185  function roleSupportsCheckedState(role) {
12186    return ['checkbox', 'option', 'radio', 'switch', 'menuitemcheckbox', 'menuitemradio', 'treeitem'].includes(role);
12187  }
12188  function ComplementaryAreaToggle({
12189    as = external_wp_components_namespaceObject.Button,
12190    scope,
12191    identifier: identifierProp,
12192    icon: iconProp,
12193    selectedIcon,
12194    name,
12195    shortcut,
12196    ...props
12197  }) {
12198    const ComponentToUse = as;
12199    const context = (0,external_wp_plugins_namespaceObject.usePluginContext)();
12200    const icon = iconProp || context.icon;
12201    const identifier = identifierProp || `$context.name}/$name}`;
12202    const isSelected = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getActiveComplementaryArea(scope) === identifier, [identifier, scope]);
12203    const {
12204      enableComplementaryArea,
12205      disableComplementaryArea
12206    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
12207    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComponentToUse, {
12208      icon: selectedIcon && isSelected ? selectedIcon : icon,
12209      "aria-controls": identifier.replace('/', ':')
12210      // Make sure aria-checked matches spec https://www.w3.org/TR/wai-aria-1.1/#aria-checked
12211      ,
12212      "aria-checked": roleSupportsCheckedState(props.role) ? isSelected : undefined,
12213      onClick: () => {
12214        if (isSelected) {
12215          disableComplementaryArea(scope);
12216        } else {
12217          enableComplementaryArea(scope, identifier);
12218        }
12219      },
12220      shortcut: shortcut,
12221      ...props
12222    });
12223  }
12224  
12225  ;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-header/index.js
12226  /**
12227   * External dependencies
12228   */
12229  
12230  
12231  /**
12232   * WordPress dependencies
12233   */
12234  
12235  
12236  /**
12237   * Internal dependencies
12238   */
12239  
12240  
12241  const ComplementaryAreaHeader = ({
12242    children,
12243    className,
12244    toggleButtonProps
12245  }) => {
12246    const toggleButton = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaToggle, {
12247      icon: close_small,
12248      ...toggleButtonProps
12249    });
12250    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
12251      className: dist_clsx('components-panel__header', 'interface-complementary-area-header', className),
12252      tabIndex: -1,
12253      children: [children, toggleButton]
12254    });
12255  };
12256  /* harmony default export */ const complementary_area_header = (ComplementaryAreaHeader);
12257  
12258  ;// ./node_modules/@wordpress/interface/build-module/components/action-item/index.js
12259  /**
12260   * WordPress dependencies
12261   */
12262  
12263  
12264  
12265  const action_item_noop = () => {};
12266  function ActionItemSlot({
12267    name,
12268    as: Component = external_wp_components_namespaceObject.MenuGroup,
12269    fillProps = {},
12270    bubblesVirtually,
12271    ...props
12272  }) {
12273    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Slot, {
12274      name: name,
12275      bubblesVirtually: bubblesVirtually,
12276      fillProps: fillProps,
12277      children: fills => {
12278        if (!external_wp_element_namespaceObject.Children.toArray(fills).length) {
12279          return null;
12280        }
12281  
12282        // Special handling exists for backward compatibility.
12283        // It ensures that menu items created by plugin authors aren't
12284        // duplicated with automatically injected menu items coming
12285        // from pinnable plugin sidebars.
12286        // @see https://github.com/WordPress/gutenberg/issues/14457
12287        const initializedByPlugins = [];
12288        external_wp_element_namespaceObject.Children.forEach(fills, ({
12289          props: {
12290            __unstableExplicitMenuItem,
12291            __unstableTarget
12292          }
12293        }) => {
12294          if (__unstableTarget && __unstableExplicitMenuItem) {
12295            initializedByPlugins.push(__unstableTarget);
12296          }
12297        });
12298        const children = external_wp_element_namespaceObject.Children.map(fills, child => {
12299          if (!child.props.__unstableExplicitMenuItem && initializedByPlugins.includes(child.props.__unstableTarget)) {
12300            return null;
12301          }
12302          return child;
12303        });
12304        return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
12305          ...props,
12306          children: children
12307        });
12308      }
12309    });
12310  }
12311  function ActionItem({
12312    name,
12313    as: Component = external_wp_components_namespaceObject.Button,
12314    onClick,
12315    ...props
12316  }) {
12317    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, {
12318      name: name,
12319      children: ({
12320        onClick: fpOnClick
12321      }) => {
12322        return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
12323          onClick: onClick || fpOnClick ? (...args) => {
12324            (onClick || action_item_noop)(...args);
12325            (fpOnClick || action_item_noop)(...args);
12326          } : undefined,
12327          ...props
12328        });
12329      }
12330    });
12331  }
12332  ActionItem.Slot = ActionItemSlot;
12333  /* harmony default export */ const action_item = (ActionItem);
12334  
12335  ;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-more-menu-item/index.js
12336  /**
12337   * WordPress dependencies
12338   */
12339  
12340  
12341  
12342  /**
12343   * Internal dependencies
12344   */
12345  
12346  
12347  
12348  const PluginsMenuItem = ({
12349    // Menu item is marked with unstable prop for backward compatibility.
12350    // They are removed so they don't leak to DOM elements.
12351    // @see https://github.com/WordPress/gutenberg/issues/14457
12352    __unstableExplicitMenuItem,
12353    __unstableTarget,
12354    ...restProps
12355  }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
12356    ...restProps
12357  });
12358  function ComplementaryAreaMoreMenuItem({
12359    scope,
12360    target,
12361    __unstableExplicitMenuItem,
12362    ...props
12363  }) {
12364    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaToggle, {
12365      as: toggleProps => {
12366        return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action_item, {
12367          __unstableExplicitMenuItem: __unstableExplicitMenuItem,
12368          __unstableTarget: `$scope}/$target}`,
12369          as: PluginsMenuItem,
12370          name: `$scope}/plugin-more-menu`,
12371          ...toggleProps
12372        });
12373      },
12374      role: "menuitemcheckbox",
12375      selectedIcon: library_check,
12376      name: target,
12377      scope: scope,
12378      ...props
12379    });
12380  }
12381  
12382  ;// ./node_modules/@wordpress/interface/build-module/components/pinned-items/index.js
12383  /**
12384   * External dependencies
12385   */
12386  
12387  
12388  /**
12389   * WordPress dependencies
12390   */
12391  
12392  
12393  function PinnedItems({
12394    scope,
12395    ...props
12396  }) {
12397    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, {
12398      name: `PinnedItems/$scope}`,
12399      ...props
12400    });
12401  }
12402  function PinnedItemsSlot({
12403    scope,
12404    className,
12405    ...props
12406  }) {
12407    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Slot, {
12408      name: `PinnedItems/$scope}`,
12409      ...props,
12410      children: fills => fills?.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
12411        className: dist_clsx(className, 'interface-pinned-items'),
12412        children: fills
12413      })
12414    });
12415  }
12416  PinnedItems.Slot = PinnedItemsSlot;
12417  /* harmony default export */ const pinned_items = (PinnedItems);
12418  
12419  ;// ./node_modules/@wordpress/interface/build-module/components/complementary-area/index.js
12420  /**
12421   * External dependencies
12422   */
12423  
12424  
12425  /**
12426   * WordPress dependencies
12427   */
12428  
12429  
12430  
12431  
12432  
12433  
12434  
12435  
12436  
12437  
12438  /**
12439   * Internal dependencies
12440   */
12441  
12442  
12443  
12444  
12445  
12446  
12447  const ANIMATION_DURATION = 0.3;
12448  function ComplementaryAreaSlot({
12449    scope,
12450    ...props
12451  }) {
12452    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Slot, {
12453      name: `ComplementaryArea/$scope}`,
12454      ...props
12455    });
12456  }
12457  const SIDEBAR_WIDTH = 280;
12458  const variants = {
12459    open: {
12460      width: SIDEBAR_WIDTH
12461    },
12462    closed: {
12463      width: 0
12464    },
12465    mobileOpen: {
12466      width: '100vw'
12467    }
12468  };
12469  function ComplementaryAreaFill({
12470    activeArea,
12471    isActive,
12472    scope,
12473    children,
12474    className,
12475    id
12476  }) {
12477    const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
12478    const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
12479    // This is used to delay the exit animation to the next tick.
12480    // The reason this is done is to allow us to apply the right transition properties
12481    // When we switch from an open sidebar to another open sidebar.
12482    // we don't want to animate in this case.
12483    const previousActiveArea = (0,external_wp_compose_namespaceObject.usePrevious)(activeArea);
12484    const previousIsActive = (0,external_wp_compose_namespaceObject.usePrevious)(isActive);
12485    const [, setState] = (0,external_wp_element_namespaceObject.useState)({});
12486    (0,external_wp_element_namespaceObject.useEffect)(() => {
12487      setState({});
12488    }, [isActive]);
12489    const transition = {
12490      type: 'tween',
12491      duration: disableMotion || isMobileViewport || !!previousActiveArea && !!activeArea && activeArea !== previousActiveArea ? 0 : ANIMATION_DURATION,
12492      ease: [0.6, 0, 0.4, 1]
12493    };
12494    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, {
12495      name: `ComplementaryArea/$scope}`,
12496      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, {
12497        initial: false,
12498        children: (previousIsActive || isActive) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, {
12499          variants: variants,
12500          initial: "closed",
12501          animate: isMobileViewport ? 'mobileOpen' : 'open',
12502          exit: "closed",
12503          transition: transition,
12504          className: "interface-complementary-area__fill",
12505          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
12506            id: id,
12507            className: className,
12508            style: {
12509              width: isMobileViewport ? '100vw' : SIDEBAR_WIDTH
12510            },
12511            children: children
12512          })
12513        })
12514      })
12515    });
12516  }
12517  function useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall) {
12518    const previousIsSmallRef = (0,external_wp_element_namespaceObject.useRef)(false);
12519    const shouldOpenWhenNotSmallRef = (0,external_wp_element_namespaceObject.useRef)(false);
12520    const {
12521      enableComplementaryArea,
12522      disableComplementaryArea
12523    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
12524    (0,external_wp_element_namespaceObject.useEffect)(() => {
12525      // If the complementary area is active and the editor is switching from
12526      // a big to a small window size.
12527      if (isActive && isSmall && !previousIsSmallRef.current) {
12528        disableComplementaryArea(scope);
12529        // Flag the complementary area to be reopened when the window size
12530        // goes from small to big.
12531        shouldOpenWhenNotSmallRef.current = true;
12532      } else if (
12533      // If there is a flag indicating the complementary area should be
12534      // enabled when we go from small to big window size and we are going
12535      // from a small to big window size.
12536      shouldOpenWhenNotSmallRef.current && !isSmall && previousIsSmallRef.current) {
12537        // Remove the flag indicating the complementary area should be
12538        // enabled.
12539        shouldOpenWhenNotSmallRef.current = false;
12540        enableComplementaryArea(scope, identifier);
12541      } else if (
12542      // If the flag is indicating the current complementary should be
12543      // reopened but another complementary area becomes active, remove
12544      // the flag.
12545      shouldOpenWhenNotSmallRef.current && activeArea && activeArea !== identifier) {
12546        shouldOpenWhenNotSmallRef.current = false;
12547      }
12548      if (isSmall !== previousIsSmallRef.current) {
12549        previousIsSmallRef.current = isSmall;
12550      }
12551    }, [isActive, isSmall, scope, identifier, activeArea, disableComplementaryArea, enableComplementaryArea]);
12552  }
12553  function ComplementaryArea({
12554    children,
12555    className,
12556    closeLabel = (0,external_wp_i18n_namespaceObject.__)('Close plugin'),
12557    identifier: identifierProp,
12558    header,
12559    headerClassName,
12560    icon: iconProp,
12561    isPinnable = true,
12562    panelClassName,
12563    scope,
12564    name,
12565    title,
12566    toggleShortcut,
12567    isActiveByDefault
12568  }) {
12569    const context = (0,external_wp_plugins_namespaceObject.usePluginContext)();
12570    const icon = iconProp || context.icon;
12571    const identifier = identifierProp || `$context.name}/$name}`;
12572  
12573    // This state is used to delay the rendering of the Fill
12574    // until the initial effect runs.
12575    // This prevents the animation from running on mount if
12576    // the complementary area is active by default.
12577    const [isReady, setIsReady] = (0,external_wp_element_namespaceObject.useState)(false);
12578    const {
12579      isLoading,
12580      isActive,
12581      isPinned,
12582      activeArea,
12583      isSmall,
12584      isLarge,
12585      showIconLabels
12586    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
12587      const {
12588        getActiveComplementaryArea,
12589        isComplementaryAreaLoading,
12590        isItemPinned
12591      } = select(store);
12592      const {
12593        get
12594      } = select(external_wp_preferences_namespaceObject.store);
12595      const _activeArea = getActiveComplementaryArea(scope);
12596      return {
12597        isLoading: isComplementaryAreaLoading(scope),
12598        isActive: _activeArea === identifier,
12599        isPinned: isItemPinned(scope, identifier),
12600        activeArea: _activeArea,
12601        isSmall: select(external_wp_viewport_namespaceObject.store).isViewportMatch('< medium'),
12602        isLarge: select(external_wp_viewport_namespaceObject.store).isViewportMatch('large'),
12603        showIconLabels: get('core', 'showIconLabels')
12604      };
12605    }, [identifier, scope]);
12606    const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
12607    useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall);
12608    const {
12609      enableComplementaryArea,
12610      disableComplementaryArea,
12611      pinItem,
12612      unpinItem
12613    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
12614    (0,external_wp_element_namespaceObject.useEffect)(() => {
12615      // Set initial visibility: For large screens, enable if it's active by
12616      // default. For small screens, always initially disable.
12617      if (isActiveByDefault && activeArea === undefined && !isSmall) {
12618        enableComplementaryArea(scope, identifier);
12619      } else if (activeArea === undefined && isSmall) {
12620        disableComplementaryArea(scope, identifier);
12621      }
12622      setIsReady(true);
12623    }, [activeArea, isActiveByDefault, scope, identifier, isSmall, enableComplementaryArea, disableComplementaryArea]);
12624    if (!isReady) {
12625      return;
12626    }
12627    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
12628      children: [isPinnable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pinned_items, {
12629        scope: scope,
12630        children: isPinned && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaToggle, {
12631          scope: scope,
12632          identifier: identifier,
12633          isPressed: isActive && (!showIconLabels || isLarge),
12634          "aria-expanded": isActive,
12635          "aria-disabled": isLoading,
12636          label: title,
12637          icon: showIconLabels ? library_check : icon,
12638          showTooltip: !showIconLabels,
12639          variant: showIconLabels ? 'tertiary' : undefined,
12640          size: "compact",
12641          shortcut: toggleShortcut
12642        })
12643      }), name && isPinnable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaMoreMenuItem, {
12644        target: name,
12645        scope: scope,
12646        icon: icon,
12647        children: title
12648      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ComplementaryAreaFill, {
12649        activeArea: activeArea,
12650        isActive: isActive,
12651        className: dist_clsx('interface-complementary-area', className),
12652        scope: scope,
12653        id: identifier.replace('/', ':'),
12654        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area_header, {
12655          className: headerClassName,
12656          closeLabel: closeLabel,
12657          onClose: () => disableComplementaryArea(scope),
12658          toggleButtonProps: {
12659            label: closeLabel,
12660            size: 'compact',
12661            shortcut: toggleShortcut,
12662            scope,
12663            identifier
12664          },
12665          children: header || /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
12666            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", {
12667              className: "interface-complementary-area-header__title",
12668              children: title
12669            }), isPinnable && !isMobileViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
12670              className: "interface-complementary-area__pin-unpin-item",
12671              icon: isPinned ? star_filled : star_empty,
12672              label: isPinned ? (0,external_wp_i18n_namespaceObject.__)('Unpin from toolbar') : (0,external_wp_i18n_namespaceObject.__)('Pin to toolbar'),
12673              onClick: () => (isPinned ? unpinItem : pinItem)(scope, identifier),
12674              isPressed: isPinned,
12675              "aria-expanded": isPinned,
12676              size: "compact"
12677            })]
12678          })
12679        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Panel, {
12680          className: panelClassName,
12681          children: children
12682        })]
12683      })]
12684    });
12685  }
12686  ComplementaryArea.Slot = ComplementaryAreaSlot;
12687  /* harmony default export */ const complementary_area = (ComplementaryArea);
12688  
12689  ;// ./node_modules/@wordpress/interface/build-module/components/fullscreen-mode/index.js
12690  /**
12691   * WordPress dependencies
12692   */
12693  
12694  const FullscreenMode = ({
12695    isActive
12696  }) => {
12697    (0,external_wp_element_namespaceObject.useEffect)(() => {
12698      let isSticky = false;
12699      // `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes
12700      // `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled
12701      // even if `is-fullscreen-mode` is then removed. Let's remove `sticky-menu` here as
12702      // a consequence of the FullscreenMode setup.
12703      if (document.body.classList.contains('sticky-menu')) {
12704        isSticky = true;
12705        document.body.classList.remove('sticky-menu');
12706      }
12707      return () => {
12708        if (isSticky) {
12709          document.body.classList.add('sticky-menu');
12710        }
12711      };
12712    }, []);
12713    (0,external_wp_element_namespaceObject.useEffect)(() => {
12714      if (isActive) {
12715        document.body.classList.add('is-fullscreen-mode');
12716      } else {
12717        document.body.classList.remove('is-fullscreen-mode');
12718      }
12719      return () => {
12720        if (isActive) {
12721          document.body.classList.remove('is-fullscreen-mode');
12722        }
12723      };
12724    }, [isActive]);
12725    return null;
12726  };
12727  /* harmony default export */ const fullscreen_mode = (FullscreenMode);
12728  
12729  ;// ./node_modules/@wordpress/interface/build-module/components/navigable-region/index.js
12730  /**
12731   * WordPress dependencies
12732   */
12733  
12734  
12735  /**
12736   * External dependencies
12737   */
12738  
12739  
12740  const NavigableRegion = (0,external_wp_element_namespaceObject.forwardRef)(({
12741    children,
12742    className,
12743    ariaLabel,
12744    as: Tag = 'div',
12745    ...props
12746  }, ref) => {
12747    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, {
12748      ref: ref,
12749      className: dist_clsx('interface-navigable-region', className),
12750      "aria-label": ariaLabel,
12751      role: "region",
12752      tabIndex: "-1",
12753      ...props,
12754      children: children
12755    });
12756  });
12757  NavigableRegion.displayName = 'NavigableRegion';
12758  /* harmony default export */ const navigable_region = (NavigableRegion);
12759  
12760  ;// ./node_modules/@wordpress/interface/build-module/components/interface-skeleton/index.js
12761  /**
12762   * External dependencies
12763   */
12764  
12765  
12766  /**
12767   * WordPress dependencies
12768   */
12769  
12770  
12771  
12772  
12773  
12774  /**
12775   * Internal dependencies
12776   */
12777  
12778  
12779  const interface_skeleton_ANIMATION_DURATION = 0.25;
12780  const commonTransition = {
12781    type: 'tween',
12782    duration: interface_skeleton_ANIMATION_DURATION,
12783    ease: [0.6, 0, 0.4, 1]
12784  };
12785  function useHTMLClass(className) {
12786    (0,external_wp_element_namespaceObject.useEffect)(() => {
12787      const element = document && document.querySelector(`html:not(.$className})`);
12788      if (!element) {
12789        return;
12790      }
12791      element.classList.toggle(className);
12792      return () => {
12793        element.classList.toggle(className);
12794      };
12795    }, [className]);
12796  }
12797  const headerVariants = {
12798    hidden: {
12799      opacity: 1,
12800      marginTop: -60
12801    },
12802    visible: {
12803      opacity: 1,
12804      marginTop: 0
12805    },
12806    distractionFreeHover: {
12807      opacity: 1,
12808      marginTop: 0,
12809      transition: {
12810        ...commonTransition,
12811        delay: 0.2,
12812        delayChildren: 0.2
12813      }
12814    },
12815    distractionFreeHidden: {
12816      opacity: 0,
12817      marginTop: -60
12818    },
12819    distractionFreeDisabled: {
12820      opacity: 0,
12821      marginTop: 0,
12822      transition: {
12823        ...commonTransition,
12824        delay: 0.8,
12825        delayChildren: 0.8
12826      }
12827    }
12828  };
12829  function InterfaceSkeleton({
12830    isDistractionFree,
12831    footer,
12832    header,
12833    editorNotices,
12834    sidebar,
12835    secondarySidebar,
12836    content,
12837    actions,
12838    labels,
12839    className
12840  }, ref) {
12841    const [secondarySidebarResizeListener, secondarySidebarSize] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
12842    const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
12843    const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
12844    const defaultTransition = {
12845      type: 'tween',
12846      duration: disableMotion ? 0 : interface_skeleton_ANIMATION_DURATION,
12847      ease: [0.6, 0, 0.4, 1]
12848    };
12849    useHTMLClass('interface-interface-skeleton__html-container');
12850    const defaultLabels = {
12851      /* translators: accessibility text for the top bar landmark region. */
12852      header: (0,external_wp_i18n_namespaceObject._x)('Header', 'header landmark area'),
12853      /* translators: accessibility text for the content landmark region. */
12854      body: (0,external_wp_i18n_namespaceObject.__)('Content'),
12855      /* translators: accessibility text for the secondary sidebar landmark region. */
12856      secondarySidebar: (0,external_wp_i18n_namespaceObject.__)('Block Library'),
12857      /* translators: accessibility text for the settings landmark region. */
12858      sidebar: (0,external_wp_i18n_namespaceObject._x)('Settings', 'settings landmark area'),
12859      /* translators: accessibility text for the publish landmark region. */
12860      actions: (0,external_wp_i18n_namespaceObject.__)('Publish'),
12861      /* translators: accessibility text for the footer landmark region. */
12862      footer: (0,external_wp_i18n_namespaceObject.__)('Footer')
12863    };
12864    const mergedLabels = {
12865      ...defaultLabels,
12866      ...labels
12867    };
12868    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
12869      ref: ref,
12870      className: dist_clsx(className, 'interface-interface-skeleton', !!footer && 'has-footer'),
12871      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
12872        className: "interface-interface-skeleton__editor",
12873        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, {
12874          initial: false,
12875          children: !!header && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(navigable_region, {
12876            as: external_wp_components_namespaceObject.__unstableMotion.div,
12877            className: "interface-interface-skeleton__header",
12878            "aria-label": mergedLabels.header,
12879            initial: isDistractionFree && !isMobileViewport ? 'distractionFreeHidden' : 'hidden',
12880            whileHover: isDistractionFree && !isMobileViewport ? 'distractionFreeHover' : 'visible',
12881            animate: isDistractionFree && !isMobileViewport ? 'distractionFreeDisabled' : 'visible',
12882            exit: isDistractionFree && !isMobileViewport ? 'distractionFreeHidden' : 'hidden',
12883            variants: headerVariants,
12884            transition: defaultTransition,
12885            children: header
12886          })
12887        }), isDistractionFree && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
12888          className: "interface-interface-skeleton__header",
12889          children: editorNotices
12890        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
12891          className: "interface-interface-skeleton__body",
12892          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, {
12893            initial: false,
12894            children: !!secondarySidebar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(navigable_region, {
12895              className: "interface-interface-skeleton__secondary-sidebar",
12896              ariaLabel: mergedLabels.secondarySidebar,
12897              as: external_wp_components_namespaceObject.__unstableMotion.div,
12898              initial: "closed",
12899              animate: "open",
12900              exit: "closed",
12901              variants: {
12902                open: {
12903                  width: secondarySidebarSize.width
12904                },
12905                closed: {
12906                  width: 0
12907                }
12908              },
12909              transition: defaultTransition,
12910              children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__unstableMotion.div, {
12911                style: {
12912                  position: 'absolute',
12913                  width: isMobileViewport ? '100vw' : 'fit-content',
12914                  height: '100%',
12915                  left: 0
12916                },
12917                variants: {
12918                  open: {
12919                    x: 0
12920                  },
12921                  closed: {
12922                    x: '-100%'
12923                  }
12924                },
12925                transition: defaultTransition,
12926                children: [secondarySidebarResizeListener, secondarySidebar]
12927              })
12928            })
12929          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(navigable_region, {
12930            className: "interface-interface-skeleton__content",
12931            ariaLabel: mergedLabels.body,
12932            children: content
12933          }), !!sidebar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(navigable_region, {
12934            className: "interface-interface-skeleton__sidebar",
12935            ariaLabel: mergedLabels.sidebar,
12936            children: sidebar
12937          }), !!actions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(navigable_region, {
12938            className: "interface-interface-skeleton__actions",
12939            ariaLabel: mergedLabels.actions,
12940            children: actions
12941          })]
12942        })]
12943      }), !!footer && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(navigable_region, {
12944        className: "interface-interface-skeleton__footer",
12945        ariaLabel: mergedLabels.footer,
12946        children: footer
12947      })]
12948    });
12949  }
12950  /* harmony default export */ const interface_skeleton = ((0,external_wp_element_namespaceObject.forwardRef)(InterfaceSkeleton));
12951  
12952  ;// ./node_modules/@wordpress/interface/build-module/components/index.js
12953  
12954  
12955  
12956  
12957  
12958  
12959  
12960  
12961  ;// ./node_modules/@wordpress/interface/build-module/index.js
12962  
12963  
12964  
12965  ;// ./node_modules/@wordpress/editor/build-module/components/pattern-rename-modal/index.js
12966  /**
12967   * WordPress dependencies
12968   */
12969  
12970  
12971  
12972  
12973  
12974  /**
12975   * Internal dependencies
12976   */
12977  
12978  
12979  
12980  
12981  const {
12982    RenamePatternModal
12983  } = unlock(external_wp_patterns_namespaceObject.privateApis);
12984  const modalName = 'editor/pattern-rename';
12985  function PatternRenameModal() {
12986    const {
12987      record,
12988      postType
12989    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
12990      const {
12991        getCurrentPostType,
12992        getCurrentPostId
12993      } = select(store_store);
12994      const {
12995        getEditedEntityRecord
12996      } = select(external_wp_coreData_namespaceObject.store);
12997      const _postType = getCurrentPostType();
12998      return {
12999        record: getEditedEntityRecord('postType', _postType, getCurrentPostId()),
13000        postType: _postType
13001      };
13002    }, []);
13003    const {
13004      closeModal
13005    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
13006    const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isModalActive(modalName));
13007    if (!isActive || postType !== PATTERN_POST_TYPE) {
13008      return null;
13009    }
13010    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RenamePatternModal, {
13011      onClose: closeModal,
13012      pattern: record
13013    });
13014  }
13015  
13016  ;// ./node_modules/@wordpress/editor/build-module/components/pattern-duplicate-modal/index.js
13017  /**
13018   * WordPress dependencies
13019   */
13020  
13021  
13022  
13023  
13024  
13025  /**
13026   * Internal dependencies
13027   */
13028  
13029  
13030  
13031  
13032  const {
13033    DuplicatePatternModal
13034  } = unlock(external_wp_patterns_namespaceObject.privateApis);
13035  const pattern_duplicate_modal_modalName = 'editor/pattern-duplicate';
13036  function PatternDuplicateModal() {
13037    const {
13038      record,
13039      postType
13040    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
13041      const {
13042        getCurrentPostType,
13043        getCurrentPostId
13044      } = select(store_store);
13045      const {
13046        getEditedEntityRecord
13047      } = select(external_wp_coreData_namespaceObject.store);
13048      const _postType = getCurrentPostType();
13049      return {
13050        record: getEditedEntityRecord('postType', _postType, getCurrentPostId()),
13051        postType: _postType
13052      };
13053    }, []);
13054    const {
13055      closeModal
13056    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
13057    const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isModalActive(pattern_duplicate_modal_modalName));
13058    if (!isActive || postType !== PATTERN_POST_TYPE) {
13059      return null;
13060    }
13061    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DuplicatePatternModal, {
13062      onClose: closeModal,
13063      onSuccess: () => closeModal(),
13064      pattern: record
13065    });
13066  }
13067  
13068  ;// ./node_modules/@wordpress/editor/build-module/components/commands/index.js
13069  /**
13070   * WordPress dependencies
13071   */
13072  
13073  
13074  
13075  
13076  
13077  
13078  
13079  
13080  
13081  
13082  
13083  
13084  /**
13085   * Internal dependencies
13086   */
13087  
13088  
13089  
13090  
13091  
13092  
13093  const getEditorCommandLoader = () => function useEditorCommandLoader() {
13094    const {
13095      editorMode,
13096      isListViewOpen,
13097      showBlockBreadcrumbs,
13098      isDistractionFree,
13099      isFocusMode,
13100      isPreviewMode,
13101      isViewable,
13102      isCodeEditingEnabled,
13103      isRichEditingEnabled,
13104      isPublishSidebarEnabled
13105    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
13106      var _get, _getPostType$viewable;
13107      const {
13108        get
13109      } = select(external_wp_preferences_namespaceObject.store);
13110      const {
13111        isListViewOpened,
13112        getCurrentPostType,
13113        getEditorSettings
13114      } = select(store_store);
13115      const {
13116        getSettings
13117      } = select(external_wp_blockEditor_namespaceObject.store);
13118      const {
13119        getPostType
13120      } = select(external_wp_coreData_namespaceObject.store);
13121      return {
13122        editorMode: (_get = get('core', 'editorMode')) !== null && _get !== void 0 ? _get : 'visual',
13123        isListViewOpen: isListViewOpened(),
13124        showBlockBreadcrumbs: get('core', 'showBlockBreadcrumbs'),
13125        isDistractionFree: get('core', 'distractionFree'),
13126        isFocusMode: get('core', 'focusMode'),
13127        isPreviewMode: getSettings().isPreviewMode,
13128        isViewable: (_getPostType$viewable = getPostType(getCurrentPostType())?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false,
13129        isCodeEditingEnabled: getEditorSettings().codeEditingEnabled,
13130        isRichEditingEnabled: getEditorSettings().richEditingEnabled,
13131        isPublishSidebarEnabled: select(store_store).isPublishSidebarEnabled()
13132      };
13133    }, []);
13134    const {
13135      getActiveComplementaryArea
13136    } = (0,external_wp_data_namespaceObject.useSelect)(store);
13137    const {
13138      toggle
13139    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
13140    const {
13141      createInfoNotice
13142    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
13143    const {
13144      __unstableSaveForPreview,
13145      setIsListViewOpened,
13146      switchEditorMode,
13147      toggleDistractionFree,
13148      toggleSpotlightMode,
13149      toggleTopToolbar
13150    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
13151    const {
13152      openModal,
13153      enableComplementaryArea,
13154      disableComplementaryArea
13155    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
13156    const {
13157      getCurrentPostId
13158    } = (0,external_wp_data_namespaceObject.useSelect)(store_store);
13159    const {
13160      isBlockBasedTheme,
13161      canCreateTemplate
13162    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
13163      return {
13164        isBlockBasedTheme: select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.is_block_theme,
13165        canCreateTemplate: select(external_wp_coreData_namespaceObject.store).canUser('create', {
13166          kind: 'postType',
13167          name: 'wp_template'
13168        })
13169      };
13170    }, []);
13171    const allowSwitchEditorMode = isCodeEditingEnabled && isRichEditingEnabled;
13172    if (isPreviewMode) {
13173      return {
13174        commands: [],
13175        isLoading: false
13176      };
13177    }
13178    const commands = [];
13179    commands.push({
13180      name: 'core/open-shortcut-help',
13181      label: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts'),
13182      icon: library_keyboard,
13183      callback: ({
13184        close
13185      }) => {
13186        close();
13187        openModal('editor/keyboard-shortcut-help');
13188      }
13189    });
13190    commands.push({
13191      name: 'core/toggle-distraction-free',
13192      label: isDistractionFree ? (0,external_wp_i18n_namespaceObject.__)('Exit Distraction free') : (0,external_wp_i18n_namespaceObject.__)('Enter Distraction free'),
13193      callback: ({
13194        close
13195      }) => {
13196        toggleDistractionFree();
13197        close();
13198      }
13199    });
13200    commands.push({
13201      name: 'core/open-preferences',
13202      label: (0,external_wp_i18n_namespaceObject.__)('Editor preferences'),
13203      callback: ({
13204        close
13205      }) => {
13206        close();
13207        openModal('editor/preferences');
13208      }
13209    });
13210    commands.push({
13211      name: 'core/toggle-spotlight-mode',
13212      label: isFocusMode ? (0,external_wp_i18n_namespaceObject.__)('Exit Spotlight mode') : (0,external_wp_i18n_namespaceObject.__)('Enter Spotlight mode'),
13213      callback: ({
13214        close
13215      }) => {
13216        toggleSpotlightMode();
13217        close();
13218      }
13219    });
13220    commands.push({
13221      name: 'core/toggle-list-view',
13222      label: isListViewOpen ? (0,external_wp_i18n_namespaceObject.__)('Close List View') : (0,external_wp_i18n_namespaceObject.__)('Open List View'),
13223      icon: list_view,
13224      callback: ({
13225        close
13226      }) => {
13227        setIsListViewOpened(!isListViewOpen);
13228        close();
13229        createInfoNotice(isListViewOpen ? (0,external_wp_i18n_namespaceObject.__)('List View off.') : (0,external_wp_i18n_namespaceObject.__)('List View on.'), {
13230          id: 'core/editor/toggle-list-view/notice',
13231          type: 'snackbar'
13232        });
13233      }
13234    });
13235    commands.push({
13236      name: 'core/toggle-top-toolbar',
13237      label: (0,external_wp_i18n_namespaceObject.__)('Top toolbar'),
13238      callback: ({
13239        close
13240      }) => {
13241        toggleTopToolbar();
13242        close();
13243      }
13244    });
13245    if (allowSwitchEditorMode) {
13246      commands.push({
13247        name: 'core/toggle-code-editor',
13248        label: editorMode === 'visual' ? (0,external_wp_i18n_namespaceObject.__)('Open code editor') : (0,external_wp_i18n_namespaceObject.__)('Exit code editor'),
13249        icon: library_code,
13250        callback: ({
13251          close
13252        }) => {
13253          switchEditorMode(editorMode === 'visual' ? 'text' : 'visual');
13254          close();
13255        }
13256      });
13257    }
13258    commands.push({
13259      name: 'core/toggle-breadcrumbs',
13260      label: showBlockBreadcrumbs ? (0,external_wp_i18n_namespaceObject.__)('Hide block breadcrumbs') : (0,external_wp_i18n_namespaceObject.__)('Show block breadcrumbs'),
13261      callback: ({
13262        close
13263      }) => {
13264        toggle('core', 'showBlockBreadcrumbs');
13265        close();
13266        createInfoNotice(showBlockBreadcrumbs ? (0,external_wp_i18n_namespaceObject.__)('Breadcrumbs hidden.') : (0,external_wp_i18n_namespaceObject.__)('Breadcrumbs visible.'), {
13267          id: 'core/editor/toggle-breadcrumbs/notice',
13268          type: 'snackbar'
13269        });
13270      }
13271    });
13272    commands.push({
13273      name: 'core/open-settings-sidebar',
13274      label: (0,external_wp_i18n_namespaceObject.__)('Show or hide the Settings panel.'),
13275      icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? drawer_left : drawer_right,
13276      callback: ({
13277        close
13278      }) => {
13279        const activeSidebar = getActiveComplementaryArea('core');
13280        close();
13281        if (activeSidebar === 'edit-post/document') {
13282          disableComplementaryArea('core');
13283        } else {
13284          enableComplementaryArea('core', 'edit-post/document');
13285        }
13286      }
13287    });
13288    commands.push({
13289      name: 'core/open-block-inspector',
13290      label: (0,external_wp_i18n_namespaceObject.__)('Show or hide the Block settings panel'),
13291      icon: block_default,
13292      callback: ({
13293        close
13294      }) => {
13295        const activeSidebar = getActiveComplementaryArea('core');
13296        close();
13297        if (activeSidebar === 'edit-post/block') {
13298          disableComplementaryArea('core');
13299        } else {
13300          enableComplementaryArea('core', 'edit-post/block');
13301        }
13302      }
13303    });
13304    commands.push({
13305      name: 'core/toggle-publish-sidebar',
13306      label: isPublishSidebarEnabled ? (0,external_wp_i18n_namespaceObject.__)('Disable pre-publish checks') : (0,external_wp_i18n_namespaceObject.__)('Enable pre-publish checks'),
13307      icon: format_list_bullets,
13308      callback: ({
13309        close
13310      }) => {
13311        close();
13312        toggle('core', 'isPublishSidebarEnabled');
13313        createInfoNotice(isPublishSidebarEnabled ? (0,external_wp_i18n_namespaceObject.__)('Pre-publish checks disabled.') : (0,external_wp_i18n_namespaceObject.__)('Pre-publish checks enabled.'), {
13314          id: 'core/editor/publish-sidebar/notice',
13315          type: 'snackbar'
13316        });
13317      }
13318    });
13319    if (isViewable) {
13320      commands.push({
13321        name: 'core/preview-link',
13322        label: (0,external_wp_i18n_namespaceObject.__)('Preview in a new tab'),
13323        icon: library_external,
13324        callback: async ({
13325          close
13326        }) => {
13327          close();
13328          const postId = getCurrentPostId();
13329          const link = await __unstableSaveForPreview();
13330          window.open(link, `wp-preview-$postId}`);
13331        }
13332      });
13333    }
13334    if (canCreateTemplate && isBlockBasedTheme) {
13335      const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes('site-editor.php');
13336      if (!isSiteEditor) {
13337        commands.push({
13338          name: 'core/go-to-site-editor',
13339          label: (0,external_wp_i18n_namespaceObject.__)('Open Site Editor'),
13340          callback: ({
13341            close
13342          }) => {
13343            close();
13344            document.location = 'site-editor.php';
13345          }
13346        });
13347      }
13348    }
13349    return {
13350      commands,
13351      isLoading: false
13352    };
13353  };
13354  const getEditedEntityContextualCommands = () => function useEditedEntityContextualCommands() {
13355    const {
13356      postType
13357    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
13358      const {
13359        getCurrentPostType
13360      } = select(store_store);
13361      return {
13362        postType: getCurrentPostType()
13363      };
13364    }, []);
13365    const {
13366      openModal
13367    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
13368    const commands = [];
13369    if (postType === PATTERN_POST_TYPE) {
13370      commands.push({
13371        name: 'core/rename-pattern',
13372        label: (0,external_wp_i18n_namespaceObject.__)('Rename pattern'),
13373        icon: library_edit,
13374        callback: ({
13375          close
13376        }) => {
13377          openModal(modalName);
13378          close();
13379        }
13380      });
13381      commands.push({
13382        name: 'core/duplicate-pattern',
13383        label: (0,external_wp_i18n_namespaceObject.__)('Duplicate pattern'),
13384        icon: library_symbol,
13385        callback: ({
13386          close
13387        }) => {
13388          openModal(pattern_duplicate_modal_modalName);
13389          close();
13390        }
13391      });
13392    }
13393    return {
13394      isLoading: false,
13395      commands
13396    };
13397  };
13398  const getPageContentFocusCommands = () => function usePageContentFocusCommands() {
13399    const {
13400      onNavigateToEntityRecord,
13401      goBack,
13402      templateId,
13403      isPreviewMode
13404    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
13405      const {
13406        getRenderingMode,
13407        getEditorSettings: _getEditorSettings,
13408        getCurrentTemplateId
13409      } = unlock(select(store_store));
13410      const editorSettings = _getEditorSettings();
13411      return {
13412        isTemplateHidden: getRenderingMode() === 'post-only',
13413        onNavigateToEntityRecord: editorSettings.onNavigateToEntityRecord,
13414        getEditorSettings: _getEditorSettings,
13415        goBack: editorSettings.onNavigateToPreviousEntityRecord,
13416        templateId: getCurrentTemplateId(),
13417        isPreviewMode: editorSettings.isPreviewMode
13418      };
13419    }, []);
13420    const {
13421      editedRecord: template,
13422      hasResolved
13423    } = (0,external_wp_coreData_namespaceObject.useEntityRecord)('postType', 'wp_template', templateId);
13424    if (isPreviewMode) {
13425      return {
13426        isLoading: false,
13427        commands: []
13428      };
13429    }
13430    const commands = [];
13431    if (templateId && hasResolved) {
13432      commands.push({
13433        name: 'core/switch-to-template-focus',
13434        label: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: template title */
13435        (0,external_wp_i18n_namespaceObject.__)('Edit template: %s'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title)),
13436        icon: library_layout,
13437        callback: ({
13438          close
13439        }) => {
13440          onNavigateToEntityRecord({
13441            postId: templateId,
13442            postType: 'wp_template'
13443          });
13444          close();
13445        }
13446      });
13447    }
13448    if (!!goBack) {
13449      commands.push({
13450        name: 'core/switch-to-previous-entity',
13451        label: (0,external_wp_i18n_namespaceObject.__)('Go back'),
13452        icon: library_page,
13453        callback: ({
13454          close
13455        }) => {
13456          goBack();
13457          close();
13458        }
13459      });
13460    }
13461    return {
13462      isLoading: false,
13463      commands
13464    };
13465  };
13466  const getManipulateDocumentCommands = () => function useManipulateDocumentCommands() {
13467    const {
13468      postType,
13469      postId
13470    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
13471      const {
13472        getCurrentPostId,
13473        getCurrentPostType
13474      } = select(store_store);
13475      return {
13476        postType: getCurrentPostType(),
13477        postId: getCurrentPostId()
13478      };
13479    }, []);
13480    const {
13481      editedRecord: template,
13482      hasResolved
13483    } = (0,external_wp_coreData_namespaceObject.useEntityRecord)('postType', postType, postId);
13484    // eslint-disable-next-line @wordpress/no-unused-vars-before-return
13485    const {
13486      revertTemplate
13487    } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
13488    if (!hasResolved || ![TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE].includes(postType)) {
13489      return {
13490        isLoading: true,
13491        commands: []
13492      };
13493    }
13494    const commands = [];
13495    if (isTemplateRevertable(template)) {
13496      const label = template.type === TEMPLATE_POST_TYPE ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: template title */
13497      (0,external_wp_i18n_namespaceObject.__)('Reset template: %s'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title)) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: template part title */
13498      (0,external_wp_i18n_namespaceObject.__)('Reset template part: %s'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title));
13499      commands.push({
13500        name: 'core/reset-template',
13501        label,
13502        icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? rotate_right : rotate_left,
13503        callback: ({
13504          close
13505        }) => {
13506          revertTemplate(template);
13507          close();
13508        }
13509      });
13510    }
13511    return {
13512      isLoading: !hasResolved,
13513      commands
13514    };
13515  };
13516  function useCommands() {
13517    (0,external_wp_commands_namespaceObject.useCommandLoader)({
13518      name: 'core/editor/edit-ui',
13519      hook: getEditorCommandLoader()
13520    });
13521    (0,external_wp_commands_namespaceObject.useCommandLoader)({
13522      name: 'core/editor/contextual-commands',
13523      hook: getEditedEntityContextualCommands(),
13524      context: 'entity-edit'
13525    });
13526    (0,external_wp_commands_namespaceObject.useCommandLoader)({
13527      name: 'core/editor/page-content-focus',
13528      hook: getPageContentFocusCommands(),
13529      context: 'entity-edit'
13530    });
13531    (0,external_wp_commands_namespaceObject.useCommandLoader)({
13532      name: 'core/edit-site/manipulate-document',
13533      hook: getManipulateDocumentCommands()
13534    });
13535  }
13536  
13537  ;// ./node_modules/@wordpress/editor/build-module/components/block-removal-warnings/index.js
13538  /**
13539   * WordPress dependencies
13540   */
13541  
13542  
13543  
13544  
13545  
13546  
13547  /**
13548   * Internal dependencies
13549   */
13550  
13551  
13552  
13553  const {
13554    BlockRemovalWarningModal
13555  } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
13556  
13557  // Prevent accidental removal of certain blocks, asking the user for confirmation first.
13558  const TEMPLATE_BLOCKS = ['core/post-content', 'core/post-template', 'core/query'];
13559  const BLOCK_REMOVAL_RULES = [{
13560    // Template blocks.
13561    // The warning is only shown when a user manipulates templates or template parts.
13562    postTypes: ['wp_template', 'wp_template_part'],
13563    callback(removedBlocks) {
13564      const removedTemplateBlocks = removedBlocks.filter(({
13565        name
13566      }) => TEMPLATE_BLOCKS.includes(name));
13567      if (removedTemplateBlocks.length) {
13568        return (0,external_wp_i18n_namespaceObject._n)('Deleting this block will stop your post or page content from displaying on this template. It is not recommended.', 'Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.', removedBlocks.length);
13569      }
13570    }
13571  }, {
13572    // Pattern overrides.
13573    // The warning is only shown when the user edits a pattern.
13574    postTypes: ['wp_block'],
13575    callback(removedBlocks) {
13576      const removedBlocksWithOverrides = removedBlocks.filter(({
13577        attributes
13578      }) => attributes?.metadata?.bindings && Object.values(attributes.metadata.bindings).some(binding => binding.source === 'core/pattern-overrides'));
13579      if (removedBlocksWithOverrides.length) {
13580        return (0,external_wp_i18n_namespaceObject._n)('The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?', 'Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?', removedBlocks.length);
13581      }
13582    }
13583  }];
13584  function BlockRemovalWarnings() {
13585    const currentPostType = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getCurrentPostType(), []);
13586    const removalRulesForPostType = (0,external_wp_element_namespaceObject.useMemo)(() => BLOCK_REMOVAL_RULES.filter(rule => rule.postTypes.includes(currentPostType)), [currentPostType]);
13587  
13588    // `BlockRemovalWarnings` is rendered in the editor provider, a shared component
13589    // across react native and web. However, `BlockRemovalWarningModal` is web only.
13590    // Check it exists before trying to render it.
13591    if (!BlockRemovalWarningModal) {
13592      return null;
13593    }
13594    if (!removalRulesForPostType) {
13595      return null;
13596    }
13597    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRemovalWarningModal, {
13598      rules: removalRulesForPostType
13599    });
13600  }
13601  
13602  ;// ./node_modules/@wordpress/editor/build-module/components/start-page-options/index.js
13603  /**
13604   * WordPress dependencies
13605   */
13606  
13607  
13608  
13609  
13610  
13611  
13612  
13613  
13614  
13615  
13616  /**
13617   * Internal dependencies
13618   */
13619  
13620  
13621  
13622  function useStartPatterns() {
13623    // A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,
13624    // and it has no postTypes declared and the current post type is page or if
13625    // the current post type is part of the postTypes declared.
13626    const {
13627      blockPatternsWithPostContentBlockType,
13628      postType
13629    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
13630      const {
13631        getPatternsByBlockTypes,
13632        getBlocksByName
13633      } = select(external_wp_blockEditor_namespaceObject.store);
13634      const {
13635        getCurrentPostType,
13636        getRenderingMode
13637      } = select(store_store);
13638      const rootClientId = getRenderingMode() === 'post-only' ? '' : getBlocksByName('core/post-content')?.[0];
13639      return {
13640        blockPatternsWithPostContentBlockType: getPatternsByBlockTypes('core/post-content', rootClientId),
13641        postType: getCurrentPostType()
13642      };
13643    }, []);
13644    return (0,external_wp_element_namespaceObject.useMemo)(() => {
13645      if (!blockPatternsWithPostContentBlockType?.length) {
13646        return [];
13647      }
13648  
13649      /*
13650       * Filter patterns without postTypes declared if the current postType is page
13651       * or patterns that declare the current postType in its post type array.
13652       */
13653      return blockPatternsWithPostContentBlockType.filter(pattern => {
13654        return postType === 'page' && !pattern.postTypes || Array.isArray(pattern.postTypes) && pattern.postTypes.includes(postType);
13655      });
13656    }, [postType, blockPatternsWithPostContentBlockType]);
13657  }
13658  function PatternSelection({
13659    blockPatterns,
13660    onChoosePattern
13661  }) {
13662    const {
13663      editEntityRecord
13664    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
13665    const {
13666      postType,
13667      postId
13668    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
13669      const {
13670        getCurrentPostType,
13671        getCurrentPostId
13672      } = select(store_store);
13673      return {
13674        postType: getCurrentPostType(),
13675        postId: getCurrentPostId()
13676      };
13677    }, []);
13678    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
13679      blockPatterns: blockPatterns,
13680      onClickPattern: (_pattern, blocks) => {
13681        editEntityRecord('postType', postType, postId, {
13682          blocks,
13683          content: ({
13684            blocks: blocksForSerialization = []
13685          }) => (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization)
13686        });
13687        onChoosePattern();
13688      }
13689    });
13690  }
13691  function StartPageOptionsModal({
13692    onClose
13693  }) {
13694    const [showStartPatterns, setShowStartPatterns] = (0,external_wp_element_namespaceObject.useState)(true);
13695    const {
13696      set: setPreference
13697    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
13698    const startPatterns = useStartPatterns();
13699    const hasStartPattern = startPatterns.length > 0;
13700    if (!hasStartPattern) {
13701      return null;
13702    }
13703    function handleClose() {
13704      onClose();
13705      setPreference('core', 'enableChoosePatternModal', showStartPatterns);
13706    }
13707    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, {
13708      className: "editor-start-page-options__modal",
13709      title: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern'),
13710      isFullScreen: true,
13711      onRequestClose: handleClose,
13712      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
13713        className: "editor-start-page-options__modal-content",
13714        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternSelection, {
13715          blockPatterns: startPatterns,
13716          onChoosePattern: handleClose
13717        })
13718      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, {
13719        className: "editor-start-page-options__modal__actions",
13720        justify: "flex-end",
13721        expanded: false,
13722        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
13723          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
13724            __nextHasNoMarginBottom: true,
13725            checked: showStartPatterns,
13726            label: (0,external_wp_i18n_namespaceObject.__)('Show starter patterns'),
13727            help: (0,external_wp_i18n_namespaceObject.__)('Shows starter patterns when creating a new page.'),
13728            onChange: newValue => {
13729              setShowStartPatterns(newValue);
13730            }
13731          })
13732        })
13733      })]
13734    });
13735  }
13736  function StartPageOptions() {
13737    const [isOpen, setIsOpen] = (0,external_wp_element_namespaceObject.useState)(false);
13738    const {
13739      isEditedPostDirty,
13740      isEditedPostEmpty
13741    } = (0,external_wp_data_namespaceObject.useSelect)(store_store);
13742    const {
13743      isModalActive
13744    } = (0,external_wp_data_namespaceObject.useSelect)(store);
13745    const {
13746      enabled,
13747      postId
13748    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
13749      const {
13750        getCurrentPostId,
13751        getCurrentPostType
13752      } = select(store_store);
13753      const choosePatternModalEnabled = select(external_wp_preferences_namespaceObject.store).get('core', 'enableChoosePatternModal');
13754      return {
13755        postId: getCurrentPostId(),
13756        enabled: choosePatternModalEnabled && TEMPLATE_POST_TYPE !== getCurrentPostType()
13757      };
13758    }, []);
13759  
13760    // Note: The `postId` ensures the effect re-runs when pages are switched without remounting the component.
13761    // Examples: changing pages in the List View, creating a new page via Command Palette.
13762    (0,external_wp_element_namespaceObject.useEffect)(() => {
13763      const isFreshPage = !isEditedPostDirty() && isEditedPostEmpty();
13764      // Prevents immediately opening when features is enabled via preferences modal.
13765      const isPreferencesModalActive = isModalActive('editor/preferences');
13766      if (!enabled || !isFreshPage || isPreferencesModalActive) {
13767        return;
13768      }
13769  
13770      // Open the modal after the initial render for a new page.
13771      setIsOpen(true);
13772    }, [enabled, postId, isEditedPostDirty, isEditedPostEmpty, isModalActive]);
13773    if (!isOpen) {
13774      return null;
13775    }
13776    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StartPageOptionsModal, {
13777      onClose: () => setIsOpen(false)
13778    });
13779  }
13780  
13781  ;// external ["wp","keyboardShortcuts"]
13782  const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"];
13783  ;// ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/config.js
13784  /**
13785   * WordPress dependencies
13786   */
13787  
13788  const textFormattingShortcuts = [{
13789    keyCombination: {
13790      modifier: 'primary',
13791      character: 'b'
13792    },
13793    description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text bold.')
13794  }, {
13795    keyCombination: {
13796      modifier: 'primary',
13797      character: 'i'
13798    },
13799    description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text italic.')
13800  }, {
13801    keyCombination: {
13802      modifier: 'primary',
13803      character: 'k'
13804    },
13805    description: (0,external_wp_i18n_namespaceObject.__)('Convert the selected text into a link.')
13806  }, {
13807    keyCombination: {
13808      modifier: 'primaryShift',
13809      character: 'k'
13810    },
13811    description: (0,external_wp_i18n_namespaceObject.__)('Remove a link.')
13812  }, {
13813    keyCombination: {
13814      character: '[['
13815    },
13816    description: (0,external_wp_i18n_namespaceObject.__)('Insert a link to a post or page.')
13817  }, {
13818    keyCombination: {
13819      modifier: 'primary',
13820      character: 'u'
13821    },
13822    description: (0,external_wp_i18n_namespaceObject.__)('Underline the selected text.')
13823  }, {
13824    keyCombination: {
13825      modifier: 'access',
13826      character: 'd'
13827    },
13828    description: (0,external_wp_i18n_namespaceObject.__)('Strikethrough the selected text.')
13829  }, {
13830    keyCombination: {
13831      modifier: 'access',
13832      character: 'x'
13833    },
13834    description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text inline code.')
13835  }, {
13836    keyCombination: {
13837      modifier: 'access',
13838      character: '0'
13839    },
13840    aliases: [{
13841      modifier: 'access',
13842      character: '7'
13843    }],
13844    description: (0,external_wp_i18n_namespaceObject.__)('Convert the current heading to a paragraph.')
13845  }, {
13846    keyCombination: {
13847      modifier: 'access',
13848      character: '1-6'
13849    },
13850    description: (0,external_wp_i18n_namespaceObject.__)('Convert the current paragraph or heading to a heading of level 1 to 6.')
13851  }, {
13852    keyCombination: {
13853      modifier: 'primaryShift',
13854      character: 'SPACE'
13855    },
13856    description: (0,external_wp_i18n_namespaceObject.__)('Add non breaking space.')
13857  }];
13858  
13859  ;// external ["wp","keycodes"]
13860  const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
13861  ;// ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/shortcut.js
13862  /**
13863   * WordPress dependencies
13864   */
13865  
13866  
13867  
13868  function KeyCombination({
13869    keyCombination,
13870    forceAriaLabel
13871  }) {
13872    const shortcut = keyCombination.modifier ? external_wp_keycodes_namespaceObject.displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character;
13873    const ariaLabel = keyCombination.modifier ? external_wp_keycodes_namespaceObject.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character;
13874    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("kbd", {
13875      className: "editor-keyboard-shortcut-help-modal__shortcut-key-combination",
13876      "aria-label": forceAriaLabel || ariaLabel,
13877      children: (Array.isArray(shortcut) ? shortcut : [shortcut]).map((character, index) => {
13878        if (character === '+') {
13879          return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.Fragment, {
13880            children: character
13881          }, index);
13882        }
13883        return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("kbd", {
13884          className: "editor-keyboard-shortcut-help-modal__shortcut-key",
13885          children: character
13886        }, index);
13887      })
13888    });
13889  }
13890  function Shortcut({
13891    description,
13892    keyCombination,
13893    aliases = [],
13894    ariaLabel
13895  }) {
13896    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
13897      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
13898        className: "editor-keyboard-shortcut-help-modal__shortcut-description",
13899        children: description
13900      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
13901        className: "editor-keyboard-shortcut-help-modal__shortcut-term",
13902        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(KeyCombination, {
13903          keyCombination: keyCombination,
13904          forceAriaLabel: ariaLabel
13905        }), aliases.map((alias, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(KeyCombination, {
13906          keyCombination: alias,
13907          forceAriaLabel: ariaLabel
13908        }, index))]
13909      })]
13910    });
13911  }
13912  /* harmony default export */ const keyboard_shortcut_help_modal_shortcut = (Shortcut);
13913  
13914  ;// ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js
13915  /**
13916   * WordPress dependencies
13917   */
13918  
13919  
13920  
13921  /**
13922   * Internal dependencies
13923   */
13924  
13925  
13926  function DynamicShortcut({
13927    name
13928  }) {
13929    const {
13930      keyCombination,
13931      description,
13932      aliases
13933    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
13934      const {
13935        getShortcutKeyCombination,
13936        getShortcutDescription,
13937        getShortcutAliases
13938      } = select(external_wp_keyboardShortcuts_namespaceObject.store);
13939      return {
13940        keyCombination: getShortcutKeyCombination(name),
13941        aliases: getShortcutAliases(name),
13942        description: getShortcutDescription(name)
13943      };
13944    }, [name]);
13945    if (!keyCombination) {
13946      return null;
13947    }
13948    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcut_help_modal_shortcut, {
13949      keyCombination: keyCombination,
13950      description: description,
13951      aliases: aliases
13952    });
13953  }
13954  /* harmony default export */ const dynamic_shortcut = (DynamicShortcut);
13955  
13956  ;// ./node_modules/@wordpress/editor/build-module/components/keyboard-shortcut-help-modal/index.js
13957  /**
13958   * External dependencies
13959   */
13960  
13961  
13962  /**
13963   * WordPress dependencies
13964   */
13965  
13966  
13967  
13968  
13969  
13970  
13971  /**
13972   * Internal dependencies
13973   */
13974  
13975  
13976  
13977  
13978  const KEYBOARD_SHORTCUT_HELP_MODAL_NAME = 'editor/keyboard-shortcut-help';
13979  const ShortcutList = ({
13980    shortcuts
13981  }) =>
13982  /*#__PURE__*/
13983  /*
13984   * Disable reason: The `list` ARIA role is redundant but
13985   * Safari+VoiceOver won't announce the list otherwise.
13986   */
13987  /* eslint-disable jsx-a11y/no-redundant-roles */
13988  (0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", {
13989    className: "editor-keyboard-shortcut-help-modal__shortcut-list",
13990    role: "list",
13991    children: shortcuts.map((shortcut, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", {
13992      className: "editor-keyboard-shortcut-help-modal__shortcut",
13993      children: typeof shortcut === 'string' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dynamic_shortcut, {
13994        name: shortcut
13995      }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcut_help_modal_shortcut, {
13996        ...shortcut
13997      })
13998    }, index))
13999  })
14000  /* eslint-enable jsx-a11y/no-redundant-roles */;
14001  const ShortcutSection = ({
14002    title,
14003    shortcuts,
14004    className
14005  }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("section", {
14006    className: dist_clsx('editor-keyboard-shortcut-help-modal__section', className),
14007    children: [!!title && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", {
14008      className: "editor-keyboard-shortcut-help-modal__section-title",
14009      children: title
14010    }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutList, {
14011      shortcuts: shortcuts
14012    })]
14013  });
14014  const ShortcutCategorySection = ({
14015    title,
14016    categoryName,
14017    additionalShortcuts = []
14018  }) => {
14019    const categoryShortcuts = (0,external_wp_data_namespaceObject.useSelect)(select => {
14020      return select(external_wp_keyboardShortcuts_namespaceObject.store).getCategoryShortcuts(categoryName);
14021    }, [categoryName]);
14022    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutSection, {
14023      title: title,
14024      shortcuts: categoryShortcuts.concat(additionalShortcuts)
14025    });
14026  };
14027  function KeyboardShortcutHelpModal() {
14028    const isModalActive = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isModalActive(KEYBOARD_SHORTCUT_HELP_MODAL_NAME), []);
14029    const {
14030      openModal,
14031      closeModal
14032    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
14033    const toggleModal = () => {
14034      if (isModalActive) {
14035        closeModal();
14036      } else {
14037        openModal(KEYBOARD_SHORTCUT_HELP_MODAL_NAME);
14038      }
14039    };
14040    (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/keyboard-shortcuts', toggleModal);
14041    if (!isModalActive) {
14042      return null;
14043    }
14044    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, {
14045      className: "editor-keyboard-shortcut-help-modal",
14046      title: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts'),
14047      closeButtonLabel: (0,external_wp_i18n_namespaceObject.__)('Close'),
14048      onRequestClose: toggleModal,
14049      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutSection, {
14050        className: "editor-keyboard-shortcut-help-modal__main-shortcuts",
14051        shortcuts: ['core/editor/keyboard-shortcuts']
14052      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, {
14053        title: (0,external_wp_i18n_namespaceObject.__)('Global shortcuts'),
14054        categoryName: "global"
14055      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, {
14056        title: (0,external_wp_i18n_namespaceObject.__)('Selection shortcuts'),
14057        categoryName: "selection"
14058      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, {
14059        title: (0,external_wp_i18n_namespaceObject.__)('Block shortcuts'),
14060        categoryName: "block",
14061        additionalShortcuts: [{
14062          keyCombination: {
14063            character: '/'
14064          },
14065          description: (0,external_wp_i18n_namespaceObject.__)('Change the block type after adding a new paragraph.'),
14066          /* translators: The forward-slash character. e.g. '/'. */
14067          ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Forward-slash')
14068        }]
14069      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutSection, {
14070        title: (0,external_wp_i18n_namespaceObject.__)('Text formatting'),
14071        shortcuts: textFormattingShortcuts
14072      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, {
14073        title: (0,external_wp_i18n_namespaceObject.__)('List View shortcuts'),
14074        categoryName: "list-view"
14075      })]
14076    });
14077  }
14078  /* harmony default export */ const keyboard_shortcut_help_modal = (KeyboardShortcutHelpModal);
14079  
14080  ;// ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/content-only-settings-menu.js
14081  /**
14082   * WordPress dependencies
14083   */
14084  
14085  
14086  
14087  
14088  
14089  
14090  /**
14091   * Internal dependencies
14092   */
14093  
14094  
14095  
14096  
14097  function ContentOnlySettingsMenuItems({
14098    clientId,
14099    onClose
14100  }) {
14101    const postContentBlocks = usePostContentBlocks();
14102    const {
14103      entity,
14104      onNavigateToEntityRecord,
14105      canEditTemplates
14106    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
14107      const {
14108        getBlockParentsByBlockName,
14109        getSettings,
14110        getBlockAttributes,
14111        getBlockParents
14112      } = select(external_wp_blockEditor_namespaceObject.store);
14113      const {
14114        getCurrentTemplateId,
14115        getRenderingMode
14116      } = select(store_store);
14117      const patternParent = getBlockParentsByBlockName(clientId, 'core/block', true)[0];
14118      let record;
14119      if (patternParent) {
14120        record = select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_block', getBlockAttributes(patternParent).ref);
14121      } else if (getRenderingMode() === 'template-locked' && !getBlockParents(clientId).some(parent => postContentBlocks.includes(parent))) {
14122        record = select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template', getCurrentTemplateId());
14123      }
14124      if (!record) {
14125        return {};
14126      }
14127      const _canEditTemplates = select(external_wp_coreData_namespaceObject.store).canUser('create', {
14128        kind: 'postType',
14129        name: 'wp_template'
14130      });
14131      return {
14132        canEditTemplates: _canEditTemplates,
14133        entity: record,
14134        onNavigateToEntityRecord: getSettings().onNavigateToEntityRecord
14135      };
14136    }, [clientId, postContentBlocks]);
14137    if (!entity) {
14138      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateLockContentOnlyMenuItems, {
14139        clientId: clientId,
14140        onClose: onClose
14141      });
14142    }
14143    const isPattern = entity.type === 'wp_block';
14144    let helpText = isPattern ? (0,external_wp_i18n_namespaceObject.__)('Edit the pattern to move, delete, or make further changes to this block.') : (0,external_wp_i18n_namespaceObject.__)('Edit the template to move, delete, or make further changes to this block.');
14145    if (!canEditTemplates) {
14146      helpText = (0,external_wp_i18n_namespaceObject.__)('Only users with permissions to edit the template can move or delete this block');
14147    }
14148    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
14149      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableBlockSettingsMenuFirstItem, {
14150        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
14151          onClick: () => {
14152            onNavigateToEntityRecord({
14153              postId: entity.id,
14154              postType: entity.type
14155            });
14156          },
14157          disabled: !canEditTemplates,
14158          children: isPattern ? (0,external_wp_i18n_namespaceObject.__)('Edit pattern') : (0,external_wp_i18n_namespaceObject.__)('Edit template')
14159        })
14160      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
14161        variant: "muted",
14162        as: "p",
14163        className: "editor-content-only-settings-menu__description",
14164        children: helpText
14165      })]
14166    });
14167  }
14168  function TemplateLockContentOnlyMenuItems({
14169    clientId,
14170    onClose
14171  }) {
14172    const {
14173      contentLockingParent
14174    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
14175      const {
14176        getContentLockingParent
14177      } = unlock(select(external_wp_blockEditor_namespaceObject.store));
14178      return {
14179        contentLockingParent: getContentLockingParent(clientId)
14180      };
14181    }, [clientId]);
14182    const blockDisplayInformation = (0,external_wp_blockEditor_namespaceObject.useBlockDisplayInformation)(contentLockingParent);
14183    const blockEditorActions = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
14184    if (!blockDisplayInformation?.title) {
14185      return null;
14186    }
14187    const {
14188      modifyContentLockBlock
14189    } = unlock(blockEditorActions);
14190    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
14191      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableBlockSettingsMenuFirstItem, {
14192        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
14193          onClick: () => {
14194            modifyContentLockBlock(contentLockingParent);
14195            onClose();
14196          },
14197          children: (0,external_wp_i18n_namespaceObject._x)('Unlock', 'Unlock content locked blocks')
14198        })
14199      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
14200        variant: "muted",
14201        as: "p",
14202        className: "editor-content-only-settings-menu__description",
14203        children: (0,external_wp_i18n_namespaceObject.__)('Temporarily unlock the parent block to edit, delete or make further changes to this block.')
14204      })]
14205    });
14206  }
14207  function ContentOnlySettingsMenu() {
14208    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, {
14209      children: ({
14210        selectedClientIds,
14211        onClose
14212      }) => selectedClientIds.length === 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ContentOnlySettingsMenuItems, {
14213        clientId: selectedClientIds[0],
14214        onClose: onClose
14215      })
14216    });
14217  }
14218  
14219  ;// ./node_modules/@wordpress/editor/build-module/components/start-template-options/index.js
14220  /**
14221   * WordPress dependencies
14222   */
14223  
14224  
14225  
14226  
14227  
14228  
14229  
14230  
14231  /**
14232   * Internal dependencies
14233   */
14234  
14235  
14236  
14237  function useFallbackTemplateContent(slug, isCustom = false) {
14238    return (0,external_wp_data_namespaceObject.useSelect)(select => {
14239      const {
14240        getEntityRecord,
14241        getDefaultTemplateId
14242      } = select(external_wp_coreData_namespaceObject.store);
14243      const templateId = getDefaultTemplateId({
14244        slug,
14245        is_custom: isCustom,
14246        ignore_empty: true
14247      });
14248      return templateId ? getEntityRecord('postType', TEMPLATE_POST_TYPE, templateId)?.content?.raw : undefined;
14249    }, [slug, isCustom]);
14250  }
14251  function start_template_options_useStartPatterns(fallbackContent) {
14252    const {
14253      slug,
14254      patterns
14255    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
14256      const {
14257        getCurrentPostType,
14258        getCurrentPostId
14259      } = select(store_store);
14260      const {
14261        getEntityRecord,
14262        getBlockPatterns
14263      } = select(external_wp_coreData_namespaceObject.store);
14264      const postId = getCurrentPostId();
14265      const postType = getCurrentPostType();
14266      const record = getEntityRecord('postType', postType, postId);
14267      return {
14268        slug: record.slug,
14269        patterns: getBlockPatterns()
14270      };
14271    }, []);
14272    const currentThemeStylesheet = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme().stylesheet);
14273  
14274    // Duplicated from packages/block-library/src/pattern/edit.js.
14275    function injectThemeAttributeInBlockTemplateContent(block) {
14276      if (block.innerBlocks.find(innerBlock => innerBlock.name === 'core/template-part')) {
14277        block.innerBlocks = block.innerBlocks.map(innerBlock => {
14278          if (innerBlock.name === 'core/template-part' && innerBlock.attributes.theme === undefined) {
14279            innerBlock.attributes.theme = currentThemeStylesheet;
14280          }
14281          return innerBlock;
14282        });
14283      }
14284      if (block.name === 'core/template-part' && block.attributes.theme === undefined) {
14285        block.attributes.theme = currentThemeStylesheet;
14286      }
14287      return block;
14288    }
14289    return (0,external_wp_element_namespaceObject.useMemo)(() => {
14290      // filter patterns that are supposed to be used in the current template being edited.
14291      return [{
14292        name: 'fallback',
14293        blocks: (0,external_wp_blocks_namespaceObject.parse)(fallbackContent),
14294        title: (0,external_wp_i18n_namespaceObject.__)('Fallback content')
14295      }, ...patterns.filter(pattern => {
14296        return Array.isArray(pattern.templateTypes) && pattern.templateTypes.some(templateType => slug.startsWith(templateType));
14297      }).map(pattern => {
14298        return {
14299          ...pattern,
14300          blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content).map(block => injectThemeAttributeInBlockTemplateContent(block))
14301        };
14302      })];
14303    }, [fallbackContent, slug, patterns]);
14304  }
14305  function start_template_options_PatternSelection({
14306    fallbackContent,
14307    onChoosePattern,
14308    postType
14309  }) {
14310    const [,, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType);
14311    const blockPatterns = start_template_options_useStartPatterns(fallbackContent);
14312    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
14313      blockPatterns: blockPatterns,
14314      onClickPattern: (pattern, blocks) => {
14315        onChange(blocks, {
14316          selection: undefined
14317        });
14318        onChoosePattern();
14319      }
14320    });
14321  }
14322  function StartModal({
14323    slug,
14324    isCustom,
14325    onClose,
14326    postType
14327  }) {
14328    const fallbackContent = useFallbackTemplateContent(slug, isCustom);
14329    if (!fallbackContent) {
14330      return null;
14331    }
14332    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, {
14333      className: "editor-start-template-options__modal",
14334      title: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern'),
14335      closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
14336      focusOnMount: "firstElement",
14337      onRequestClose: onClose,
14338      isFullScreen: true,
14339      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
14340        className: "editor-start-template-options__modal-content",
14341        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(start_template_options_PatternSelection, {
14342          fallbackContent: fallbackContent,
14343          slug: slug,
14344          isCustom: isCustom,
14345          postType: postType,
14346          onChoosePattern: () => {
14347            onClose();
14348          }
14349        })
14350      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, {
14351        className: "editor-start-template-options__modal__actions",
14352        justify: "flex-end",
14353        expanded: false,
14354        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
14355          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
14356            __next40pxDefaultSize: true,
14357            variant: "tertiary",
14358            onClick: onClose,
14359            children: (0,external_wp_i18n_namespaceObject.__)('Skip')
14360          })
14361        })
14362      })]
14363    });
14364  }
14365  function StartTemplateOptions() {
14366    const [isClosed, setIsClosed] = (0,external_wp_element_namespaceObject.useState)(false);
14367    const {
14368      shouldOpenModal,
14369      slug,
14370      isCustom,
14371      postType,
14372      postId
14373    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
14374      const {
14375        getCurrentPostType,
14376        getCurrentPostId
14377      } = select(store_store);
14378      const _postType = getCurrentPostType();
14379      const _postId = getCurrentPostId();
14380      const {
14381        getEditedEntityRecord,
14382        hasEditsForEntityRecord
14383      } = select(external_wp_coreData_namespaceObject.store);
14384      const templateRecord = getEditedEntityRecord('postType', _postType, _postId);
14385      const hasEdits = hasEditsForEntityRecord('postType', _postType, _postId);
14386      return {
14387        shouldOpenModal: !hasEdits && '' === templateRecord.content && TEMPLATE_POST_TYPE === _postType,
14388        slug: templateRecord.slug,
14389        isCustom: templateRecord.is_custom,
14390        postType: _postType,
14391        postId: _postId
14392      };
14393    }, []);
14394    (0,external_wp_element_namespaceObject.useEffect)(() => {
14395      // Should reset the modal state when navigating to a new page/post.
14396      setIsClosed(false);
14397    }, [postType, postId]);
14398    if (!shouldOpenModal || isClosed) {
14399      return null;
14400    }
14401    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StartModal, {
14402      slug: slug,
14403      isCustom: isCustom,
14404      postType: postType,
14405      onClose: () => setIsClosed(true)
14406    });
14407  }
14408  
14409  ;// ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/index.js
14410  /**
14411   * WordPress dependencies
14412   */
14413  
14414  
14415  
14416  
14417  
14418  /**
14419   * Internal dependencies
14420   */
14421  
14422  
14423  /**
14424   * Handles the keyboard shortcuts for the editor.
14425   *
14426   * It provides functionality for various keyboard shortcuts such as toggling editor mode,
14427   * toggling distraction-free mode, undo/redo, saving the post, toggling list view,
14428   * and toggling the sidebar.
14429   */
14430  function EditorKeyboardShortcuts() {
14431    const isModeToggleDisabled = (0,external_wp_data_namespaceObject.useSelect)(select => {
14432      const {
14433        richEditingEnabled,
14434        codeEditingEnabled
14435      } = select(store_store).getEditorSettings();
14436      return !richEditingEnabled || !codeEditingEnabled;
14437    }, []);
14438    const {
14439      getBlockSelectionStart
14440    } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
14441    const {
14442      getActiveComplementaryArea
14443    } = (0,external_wp_data_namespaceObject.useSelect)(store);
14444    const {
14445      enableComplementaryArea,
14446      disableComplementaryArea
14447    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
14448    const {
14449      redo,
14450      undo,
14451      savePost,
14452      setIsListViewOpened,
14453      switchEditorMode,
14454      toggleDistractionFree
14455    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
14456    const {
14457      isEditedPostDirty,
14458      isPostSavingLocked,
14459      isListViewOpened,
14460      getEditorMode
14461    } = (0,external_wp_data_namespaceObject.useSelect)(store_store);
14462    (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/toggle-mode', () => {
14463      switchEditorMode(getEditorMode() === 'visual' ? 'text' : 'visual');
14464    }, {
14465      isDisabled: isModeToggleDisabled
14466    });
14467    (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/toggle-distraction-free', () => {
14468      toggleDistractionFree();
14469    });
14470    (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/undo', event => {
14471      undo();
14472      event.preventDefault();
14473    });
14474    (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/redo', event => {
14475      redo();
14476      event.preventDefault();
14477    });
14478    (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/save', event => {
14479      event.preventDefault();
14480  
14481      /**
14482       * Do not save the post if post saving is locked.
14483       */
14484      if (isPostSavingLocked()) {
14485        return;
14486      }
14487  
14488      // TODO: This should be handled in the `savePost` effect in
14489      // considering `isSaveable`. See note on `isEditedPostSaveable`
14490      // selector about dirtiness and meta-boxes.
14491      //
14492      // See: `isEditedPostSaveable`
14493      if (!isEditedPostDirty()) {
14494        return;
14495      }
14496      savePost();
14497    });
14498  
14499    // Only opens the list view. Other functionality for this shortcut happens in the rendered sidebar.
14500    (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/toggle-list-view', event => {
14501      if (!isListViewOpened()) {
14502        event.preventDefault();
14503        setIsListViewOpened(true);
14504      }
14505    });
14506    (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/toggle-sidebar', event => {
14507      // This shortcut has no known clashes, but use preventDefault to prevent any
14508      // obscure shortcuts from triggering.
14509      event.preventDefault();
14510      const isEditorSidebarOpened = ['edit-post/document', 'edit-post/block'].includes(getActiveComplementaryArea('core'));
14511      if (isEditorSidebarOpened) {
14512        disableComplementaryArea('core');
14513      } else {
14514        const sidebarToOpen = getBlockSelectionStart() ? 'edit-post/block' : 'edit-post/document';
14515        enableComplementaryArea('core', sidebarToOpen);
14516      }
14517    });
14518    return null;
14519  }
14520  
14521  ;// ./node_modules/@wordpress/editor/build-module/components/template-part-menu-items/convert-to-regular.js
14522  /**
14523   * WordPress dependencies
14524   */
14525  
14526  
14527  
14528  
14529  
14530  function ConvertToRegularBlocks({
14531    clientId,
14532    onClose
14533  }) {
14534    const {
14535      getBlocks
14536    } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
14537    const {
14538      replaceBlocks
14539    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
14540    const canRemove = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).canRemoveBlock(clientId), [clientId]);
14541    if (!canRemove) {
14542      return null;
14543    }
14544    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
14545      onClick: () => {
14546        replaceBlocks(clientId, getBlocks(clientId));
14547        onClose();
14548      },
14549      children: (0,external_wp_i18n_namespaceObject.__)('Detach')
14550    });
14551  }
14552  
14553  ;// ./node_modules/@wordpress/editor/build-module/components/template-part-menu-items/convert-to-template-part.js
14554  /**
14555   * WordPress dependencies
14556   */
14557  
14558  
14559  
14560  
14561  
14562  
14563  
14564  
14565  
14566  /**
14567   * Internal dependencies
14568   */
14569  
14570  
14571  function ConvertToTemplatePart({
14572    clientIds,
14573    blocks
14574  }) {
14575    const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
14576    const {
14577      replaceBlocks
14578    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
14579    const {
14580      createSuccessNotice
14581    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
14582    const {
14583      canCreate
14584    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
14585      return {
14586        canCreate: select(external_wp_blockEditor_namespaceObject.store).canInsertBlockType('core/template-part')
14587      };
14588    }, []);
14589    if (!canCreate) {
14590      return null;
14591    }
14592    const onConvert = async templatePart => {
14593      replaceBlocks(clientIds, (0,external_wp_blocks_namespaceObject.createBlock)('core/template-part', {
14594        slug: templatePart.slug,
14595        theme: templatePart.theme
14596      }));
14597      createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Template part created.'), {
14598        type: 'snackbar'
14599      });
14600  
14601      // The modal and this component will be unmounted because of `replaceBlocks` above,
14602      // so no need to call `closeModal` or `onClose`.
14603    };
14604    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
14605      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
14606        icon: symbol_filled,
14607        onClick: () => {
14608          setIsModalOpen(true);
14609        },
14610        "aria-expanded": isModalOpen,
14611        "aria-haspopup": "dialog",
14612        children: (0,external_wp_i18n_namespaceObject.__)('Create template part')
14613      }), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreateTemplatePartModal, {
14614        closeModal: () => {
14615          setIsModalOpen(false);
14616        },
14617        blocks: blocks,
14618        onCreate: onConvert
14619      })]
14620    });
14621  }
14622  
14623  ;// ./node_modules/@wordpress/editor/build-module/components/template-part-menu-items/index.js
14624  /**
14625   * WordPress dependencies
14626   */
14627  
14628  
14629  
14630  /**
14631   * Internal dependencies
14632   */
14633  
14634  
14635  
14636  function TemplatePartMenuItems() {
14637    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, {
14638      children: ({
14639        selectedClientIds,
14640        onClose
14641      }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartConverterMenuItem, {
14642        clientIds: selectedClientIds,
14643        onClose: onClose
14644      })
14645    });
14646  }
14647  function TemplatePartConverterMenuItem({
14648    clientIds,
14649    onClose
14650  }) {
14651    const {
14652      blocks
14653    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
14654      const {
14655        getBlocksByClientId
14656      } = select(external_wp_blockEditor_namespaceObject.store);
14657      return {
14658        blocks: getBlocksByClientId(clientIds)
14659      };
14660    }, [clientIds]);
14661  
14662    // Allow converting a single template part to standard blocks.
14663    if (blocks.length === 1 && blocks[0]?.name === 'core/template-part') {
14664      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ConvertToRegularBlocks, {
14665        clientId: clientIds[0],
14666        onClose: onClose
14667      });
14668    }
14669    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ConvertToTemplatePart, {
14670      clientIds: clientIds,
14671      blocks: blocks
14672    });
14673  }
14674  
14675  ;// ./node_modules/@wordpress/editor/build-module/components/provider/index.js
14676  /**
14677   * WordPress dependencies
14678   */
14679  
14680  
14681  
14682  
14683  
14684  
14685  
14686  
14687  
14688  /**
14689   * Internal dependencies
14690   */
14691  
14692  
14693  
14694  
14695  
14696  
14697  
14698  
14699  
14700  
14701  
14702  
14703  
14704  
14705  
14706  
14707  
14708  
14709  const {
14710    ExperimentalBlockEditorProvider
14711  } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
14712  const {
14713    PatternsMenuItems
14714  } = unlock(external_wp_patterns_namespaceObject.privateApis);
14715  const provider_noop = () => {};
14716  
14717  /**
14718   * These are global entities that are only there to split blocks into logical units
14719   * They don't provide a "context" for the current post/page being rendered.
14720   * So we should not use their ids as post context. This is important to allow post blocks
14721   * (post content, post title) to be used within them without issues.
14722   */
14723  const NON_CONTEXTUAL_POST_TYPES = ['wp_block', 'wp_navigation', 'wp_template_part'];
14724  
14725  /**
14726   * Depending on the post, template and template mode,
14727   * returns the appropriate blocks and change handlers for the block editor provider.
14728   *
14729   * @param {Array}   post     Block list.
14730   * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.
14731   * @param {string}  mode     Rendering mode.
14732   *
14733   * @example
14734   * ```jsx
14735   * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode );
14736   * ```
14737   *
14738   * @return {Array} Block editor props.
14739   */
14740  function useBlockEditorProps(post, template, mode) {
14741    const rootLevelPost = mode === 'template-locked' ? 'template' : 'post';
14742    const [postBlocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', post.type, {
14743      id: post.id
14744    });
14745    const [templateBlocks, onInputTemplate, onChangeTemplate] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', template?.type, {
14746      id: template?.id
14747    });
14748    const maybeNavigationBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => {
14749      if (post.type === 'wp_navigation') {
14750        return [(0,external_wp_blocks_namespaceObject.createBlock)('core/navigation', {
14751          ref: post.id,
14752          // As the parent editor is locked with `templateLock`, the template locking
14753          // must be explicitly "unset" on the block itself to allow the user to modify
14754          // the block's content.
14755          templateLock: false
14756        })];
14757      }
14758    }, [post.type, post.id]);
14759  
14760    // It is important that we don't create a new instance of blocks on every change
14761    // We should only create a new instance if the blocks them selves change, not a dependency of them.
14762    const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => {
14763      if (maybeNavigationBlocks) {
14764        return maybeNavigationBlocks;
14765      }
14766      if (rootLevelPost === 'template') {
14767        return templateBlocks;
14768      }
14769      return postBlocks;
14770    }, [maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks]);
14771  
14772    // Handle fallback to postBlocks outside of the above useMemo, to ensure
14773    // that constructed block templates that call `createBlock` are not generated
14774    // too frequently. This ensures that clientIds are stable.
14775    const disableRootLevelChanges = !!template && mode === 'template-locked' || post.type === 'wp_navigation';
14776    if (disableRootLevelChanges) {
14777      return [blocks, provider_noop, provider_noop];
14778    }
14779    return [blocks, rootLevelPost === 'post' ? onInput : onInputTemplate, rootLevelPost === 'post' ? onChange : onChangeTemplate];
14780  }
14781  
14782  /**
14783   * This component provides the editor context and manages the state of the block editor.
14784   *
14785   * @param {Object}  props                                The component props.
14786   * @param {Object}  props.post                           The post object.
14787   * @param {Object}  props.settings                       The editor settings.
14788   * @param {boolean} props.recovery                       Indicates if the editor is in recovery mode.
14789   * @param {Array}   props.initialEdits                   The initial edits for the editor.
14790   * @param {Object}  props.children                       The child components.
14791   * @param {Object}  [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider.
14792   * @param {Object}  [props.__unstableTemplate]           The template object.
14793   *
14794   * @example
14795   * ```jsx
14796   * <ExperimentalEditorProvider
14797   *   post={ post }
14798   *   settings={ settings }
14799   *   recovery={ recovery }
14800   *   initialEdits={ initialEdits }
14801   *   __unstableTemplate={ template }
14802   * >
14803   *   { children }
14804   * </ExperimentalEditorProvider>
14805   *
14806   * @return {Object} The rendered ExperimentalEditorProvider component.
14807   */
14808  const ExperimentalEditorProvider = with_registry_provider(({
14809    post,
14810    settings,
14811    recovery,
14812    initialEdits,
14813    children,
14814    BlockEditorProviderComponent = ExperimentalBlockEditorProvider,
14815    __unstableTemplate: template
14816  }) => {
14817    const hasTemplate = !!template;
14818    const {
14819      editorSettings,
14820      selection,
14821      isReady,
14822      mode,
14823      defaultMode,
14824      postTypeEntities
14825    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
14826      const {
14827        getEditorSettings,
14828        getEditorSelection,
14829        getRenderingMode,
14830        __unstableIsEditorReady,
14831        getDefaultRenderingMode
14832      } = unlock(select(store_store));
14833      const {
14834        getEntitiesConfig
14835      } = select(external_wp_coreData_namespaceObject.store);
14836      const _mode = getRenderingMode();
14837      const _defaultMode = getDefaultRenderingMode(post.type);
14838      /**
14839       * To avoid content "flash", wait until rendering mode has been resolved.
14840       * This is important for the initial render of the editor.
14841       *
14842       * - Wait for template to be resolved if the default mode is 'template-locked'.
14843       * - Wait for default mode to be resolved otherwise.
14844       */
14845      const hasResolvedDefaultMode = _defaultMode === 'template-locked' ? hasTemplate : _defaultMode !== undefined;
14846      // Wait until the default mode is retrieved and start rendering canvas.
14847      const isRenderingModeReady = _defaultMode !== undefined;
14848      return {
14849        editorSettings: getEditorSettings(),
14850        isReady: __unstableIsEditorReady(),
14851        mode: isRenderingModeReady ? _mode : undefined,
14852        defaultMode: hasResolvedDefaultMode ? _defaultMode : undefined,
14853        selection: getEditorSelection(),
14854        postTypeEntities: post.type === 'wp_template' ? getEntitiesConfig('postType') : null
14855      };
14856    }, [post.type, hasTemplate]);
14857    const shouldRenderTemplate = hasTemplate && mode !== 'post-only';
14858    const rootLevelPost = shouldRenderTemplate ? template : post;
14859    const defaultBlockContext = (0,external_wp_element_namespaceObject.useMemo)(() => {
14860      const postContext = {};
14861      // If it is a template, try to inherit the post type from the name.
14862      if (post.type === 'wp_template') {
14863        if (post.slug === 'page') {
14864          postContext.postType = 'page';
14865        } else if (post.slug === 'single') {
14866          postContext.postType = 'post';
14867        } else if (post.slug.split('-')[0] === 'single') {
14868          // If the slug is single-{postType}, infer the post type from the name.
14869          const postTypeNames = postTypeEntities?.map(entity => entity.name) || [];
14870          const match = post.slug.match(`^single-($postTypeNames.join('|')})(?:-.+)?$`);
14871          if (match) {
14872            postContext.postType = match[1];
14873          }
14874        }
14875      } else if (!NON_CONTEXTUAL_POST_TYPES.includes(rootLevelPost.type) || shouldRenderTemplate) {
14876        postContext.postId = post.id;
14877        postContext.postType = post.type;
14878      }
14879      return {
14880        ...postContext,
14881        templateSlug: rootLevelPost.type === 'wp_template' ? rootLevelPost.slug : undefined
14882      };
14883    }, [shouldRenderTemplate, post.id, post.type, post.slug, rootLevelPost.type, rootLevelPost.slug, postTypeEntities]);
14884    const {
14885      id,
14886      type
14887    } = rootLevelPost;
14888    const blockEditorSettings = use_block_editor_settings(editorSettings, type, id, mode);
14889    const [blocks, onInput, onChange] = useBlockEditorProps(post, template, mode);
14890    const {
14891      updatePostLock,
14892      setupEditor,
14893      updateEditorSettings,
14894      setCurrentTemplateId,
14895      setEditedPost,
14896      setRenderingMode
14897    } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
14898    const {
14899      createWarningNotice
14900    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
14901  
14902    // Ideally this should be synced on each change and not just something you do once.
14903    (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
14904      // Assume that we don't need to initialize in the case of an error recovery.
14905      if (recovery) {
14906        return;
14907      }
14908      updatePostLock(settings.postLock);
14909      setupEditor(post, initialEdits, settings.template);
14910      if (settings.autosave) {
14911        createWarningNotice((0,external_wp_i18n_namespaceObject.__)('There is an autosave of this post that is more recent than the version below.'), {
14912          id: 'autosave-exists',
14913          actions: [{
14914            label: (0,external_wp_i18n_namespaceObject.__)('View the autosave'),
14915            url: settings.autosave.editLink
14916          }]
14917        });
14918      }
14919  
14920      // The dependencies of the hook are omitted deliberately
14921      // We only want to run setupEditor (with initialEdits) only once per post.
14922      // A better solution in the future would be to split this effect into multiple ones.
14923    }, []);
14924  
14925    // Synchronizes the active post with the state
14926    (0,external_wp_element_namespaceObject.useEffect)(() => {
14927      setEditedPost(post.type, post.id);
14928    }, [post.type, post.id, setEditedPost]);
14929  
14930    // Synchronize the editor settings as they change.
14931    (0,external_wp_element_namespaceObject.useEffect)(() => {
14932      updateEditorSettings(settings);
14933    }, [settings, updateEditorSettings]);
14934  
14935    // Synchronizes the active template with the state.
14936    (0,external_wp_element_namespaceObject.useEffect)(() => {
14937      setCurrentTemplateId(template?.id);
14938    }, [template?.id, setCurrentTemplateId]);
14939  
14940    // Sets the right rendering mode when loading the editor.
14941    (0,external_wp_element_namespaceObject.useEffect)(() => {
14942      if (defaultMode) {
14943        setRenderingMode(defaultMode);
14944      }
14945    }, [defaultMode, setRenderingMode]);
14946    useHideBlocksFromInserter(post.type, mode);
14947  
14948    // Register the editor commands.
14949    useCommands();
14950    if (!isReady || !mode) {
14951      return null;
14952    }
14953    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_coreData_namespaceObject.EntityProvider, {
14954      kind: "root",
14955      type: "site",
14956      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_coreData_namespaceObject.EntityProvider, {
14957        kind: "postType",
14958        type: post.type,
14959        id: post.id,
14960        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockContextProvider, {
14961          value: defaultBlockContext,
14962          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(BlockEditorProviderComponent, {
14963            value: blocks,
14964            onChange: onChange,
14965            onInput: onInput,
14966            selection: selection,
14967            settings: blockEditorSettings,
14968            useSubRegistry: false,
14969            children: [children, !settings.isPreviewMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
14970              children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsMenuItems, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartMenuItems, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ContentOnlySettingsMenu, {}), mode === 'template-locked' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DisableNonPageContentBlocks, {}), type === 'wp_navigation' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationBlockEditingMode, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorKeyboardShortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcut_help_modal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRemovalWarnings, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StartPageOptions, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StartTemplateOptions, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternRenameModal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternDuplicateModal, {})]
14971            })]
14972          })
14973        })
14974      })
14975    });
14976  });
14977  
14978  /**
14979   * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).
14980   *
14981   * It supports a large number of post types, including post, page, templates,
14982   * custom post types, patterns, template parts.
14983   *
14984   * All modification and changes are performed to the `@wordpress/core-data` store.
14985   *
14986   * @param {Object}          props                      The component props.
14987   * @param {Object}          [props.post]               The post object to edit. This is required.
14988   * @param {Object}          [props.__unstableTemplate] The template object wrapper the edited post.
14989   *                                                     This is optional and can only be used when the post type supports templates (like posts and pages).
14990   * @param {Object}          [props.settings]           The settings object to use for the editor.
14991   *                                                     This is optional and can be used to override the default settings.
14992   * @param {React.ReactNode} [props.children]           Children elements for which the BlockEditorProvider context should apply.
14993   *                                                     This is optional.
14994   *
14995   * @example
14996   * ```jsx
14997   * <EditorProvider
14998   *   post={ post }
14999   *   settings={ settings }
15000   *   __unstableTemplate={ template }
15001   * >
15002   *   { children }
15003   * </EditorProvider>
15004   * ```
15005   *
15006   * @return {React.ReactNode} The rendered EditorProvider component.
15007   */
15008  function EditorProvider(props) {
15009    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExperimentalEditorProvider, {
15010      ...props,
15011      BlockEditorProviderComponent: external_wp_blockEditor_namespaceObject.BlockEditorProvider,
15012      children: props.children
15013    });
15014  }
15015  /* harmony default export */ const provider = (EditorProvider);
15016  
15017  ;// ./node_modules/@wordpress/editor/build-module/dataviews/fields/content-preview/content-preview-view.js
15018  /**
15019   * WordPress dependencies
15020   */
15021  
15022  
15023  
15024  
15025  
15026  /**
15027   * Internal dependencies
15028   */
15029  
15030  
15031  // @ts-ignore
15032  
15033  
15034  const {
15035    useGlobalStyle
15036  } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
15037  function PostPreviewContainer({
15038    template,
15039    post
15040  }) {
15041    const [backgroundColor = 'white'] = useGlobalStyle('color.background');
15042    const [postBlocks] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', post.type, {
15043      id: post.id
15044    });
15045    const [templateBlocks] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', template?.type, {
15046      id: template?.id
15047    });
15048    const blocks = template && templateBlocks ? templateBlocks : postBlocks;
15049    const isEmpty = !blocks?.length;
15050    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
15051      className: "editor-fields-content-preview",
15052      style: {
15053        backgroundColor
15054      },
15055      children: [isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
15056        className: "editor-fields-content-preview__empty",
15057        children: (0,external_wp_i18n_namespaceObject.__)('Empty content')
15058      }), !isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview.Async, {
15059        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview, {
15060          blocks: blocks
15061        })
15062      })]
15063    });
15064  }
15065  function PostPreviewView({
15066    item
15067  }) {
15068    const {
15069      settings,
15070      template
15071    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
15072      var _getPostType$viewable;
15073      const {
15074        canUser,
15075        getPostType,
15076        getTemplateId,
15077        getEntityRecord
15078      } = unlock(select(external_wp_coreData_namespaceObject.store));
15079      const canViewTemplate = canUser('read', {
15080        kind: 'postType',
15081        name: 'wp_template'
15082      });
15083      const _settings = select(store_store).getEditorSettings();
15084      // @ts-ignore
15085      const supportsTemplateMode = _settings.supportsTemplateMode;
15086      const isViewable = (_getPostType$viewable = getPostType(item.type)?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false;
15087      const templateId = supportsTemplateMode && isViewable && canViewTemplate ? getTemplateId(item.type, item.id) : null;
15088      return {
15089        settings: _settings,
15090        template: templateId ? getEntityRecord('postType', 'wp_template', templateId) : undefined
15091      };
15092    }, [item.type, item.id]);
15093    // Wrap everything in a block editor provider to ensure 'styles' that are needed
15094    // for the previews are synced between the site editor store and the block editor store.
15095    // Additionally we need to have the `__experimentalBlockPatterns` setting in order to
15096    // render patterns inside the previews.
15097    // TODO: Same approach is used in the patterns list and it becomes obvious that some of
15098    // the block editor settings are needed in context where we don't have the block editor.
15099    // Explore how we can solve this in a better way.
15100    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorProvider, {
15101      post: item,
15102      settings: settings,
15103      __unstableTemplate: template,
15104      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPreviewContainer, {
15105        template: template,
15106        post: item
15107      })
15108    });
15109  }
15110  
15111  ;// ./node_modules/@wordpress/editor/build-module/dataviews/fields/content-preview/index.js
15112  /**
15113   * WordPress dependencies
15114   */
15115  
15116  
15117  
15118  /**
15119   * Internal dependencies
15120   */
15121  
15122  const postPreviewField = {
15123    type: 'media',
15124    id: 'content-preview',
15125    label: (0,external_wp_i18n_namespaceObject.__)('Content preview'),
15126    render: PostPreviewView,
15127    enableSorting: false
15128  };
15129  /* harmony default export */ const content_preview = (postPreviewField);
15130  
15131  ;// ./node_modules/@wordpress/editor/build-module/dataviews/store/private-actions.js
15132  /**
15133   * WordPress dependencies
15134   */
15135  
15136  
15137  
15138  
15139  /**
15140   * Internal dependencies
15141   */
15142  
15143  
15144  
15145  function registerEntityAction(kind, name, config) {
15146    return {
15147      type: 'REGISTER_ENTITY_ACTION',
15148      kind,
15149      name,
15150      config
15151    };
15152  }
15153  function unregisterEntityAction(kind, name, actionId) {
15154    return {
15155      type: 'UNREGISTER_ENTITY_ACTION',
15156      kind,
15157      name,
15158      actionId
15159    };
15160  }
15161  function registerEntityField(kind, name, config) {
15162    return {
15163      type: 'REGISTER_ENTITY_FIELD',
15164      kind,
15165      name,
15166      config
15167    };
15168  }
15169  function unregisterEntityField(kind, name, fieldId) {
15170    return {
15171      type: 'UNREGISTER_ENTITY_FIELD',
15172      kind,
15173      name,
15174      fieldId
15175    };
15176  }
15177  function setIsReady(kind, name) {
15178    return {
15179      type: 'SET_IS_READY',
15180      kind,
15181      name
15182    };
15183  }
15184  const registerPostTypeSchema = postType => async ({
15185    registry
15186  }) => {
15187    const isReady = unlock(registry.select(store_store)).isEntityReady('postType', postType);
15188    if (isReady) {
15189      return;
15190    }
15191    unlock(registry.dispatch(store_store)).setIsReady('postType', postType);
15192    const postTypeConfig = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getPostType(postType);
15193    const canCreate = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).canUser('create', {
15194      kind: 'postType',
15195      name: postType
15196    });
15197    const currentTheme = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getCurrentTheme();
15198    const actions = [postTypeConfig.viewable ? view_post : undefined, !!postTypeConfig.supports?.revisions ? view_post_revisions : undefined,
15199    // @ts-ignore
15200     false ? 0 : undefined, postTypeConfig.slug === 'wp_template_part' && canCreate && currentTheme?.is_block_theme ? duplicate_template_part : undefined, canCreate && postTypeConfig.slug === 'wp_block' ? duplicate_pattern : undefined, postTypeConfig.supports?.title ? rename_post : undefined, postTypeConfig.supports?.['page-attributes'] ? reorder_page : undefined, postTypeConfig.slug === 'wp_block' ? export_pattern : undefined, restore_post, reset_post, delete_post, trash_post, permanently_delete_post].filter(Boolean);
15201    const fields = [postTypeConfig.supports?.thumbnail && currentTheme?.theme_supports?.['post-thumbnails'] && featured_image, postTypeConfig.supports?.author && author, fields_status, date, slug, postTypeConfig.supports?.['page-attributes'] && fields_parent, postTypeConfig.supports?.comments && comment_status, fields_template, fields_password, postTypeConfig.supports?.editor && postTypeConfig.viewable && content_preview].filter(Boolean);
15202    if (postTypeConfig.supports?.title) {
15203      let _titleField;
15204      if (postType === 'page') {
15205        _titleField = page_title;
15206      } else if (postType === 'wp_template') {
15207        _titleField = template_title;
15208      } else if (postType === 'wp_block') {
15209        _titleField = pattern_title;
15210      } else {
15211        _titleField = title;
15212      }
15213      fields.push(_titleField);
15214    }
15215    registry.batch(() => {
15216      actions.forEach(action => {
15217        unlock(registry.dispatch(store_store)).registerEntityAction('postType', postType, action);
15218      });
15219      fields.forEach(field => {
15220        unlock(registry.dispatch(store_store)).registerEntityField('postType', postType, field);
15221      });
15222    });
15223    (0,external_wp_hooks_namespaceObject.doAction)('core.registerPostTypeSchema', postType);
15224  };
15225  
15226  ;// ./node_modules/@wordpress/editor/build-module/store/private-actions.js
15227  /**
15228   * WordPress dependencies
15229   */
15230  
15231  
15232  
15233  
15234  
15235  
15236  
15237  
15238  
15239  
15240  /**
15241   * Internal dependencies
15242   */
15243  
15244  
15245  
15246  /**
15247   * Returns an action object used to set which template is currently being used/edited.
15248   *
15249   * @param {string} id Template Id.
15250   *
15251   * @return {Object} Action object.
15252   */
15253  function setCurrentTemplateId(id) {
15254    return {
15255      type: 'SET_CURRENT_TEMPLATE_ID',
15256      id
15257    };
15258  }
15259  
15260  /**
15261   * Create a block based template.
15262   *
15263   * @param {?Object} template Template to create and assign.
15264   */
15265  const createTemplate = template => async ({
15266    select,
15267    dispatch,
15268    registry
15269  }) => {
15270    const savedTemplate = await registry.dispatch(external_wp_coreData_namespaceObject.store).saveEntityRecord('postType', 'wp_template', template);
15271    registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', select.getCurrentPostType(), select.getCurrentPostId(), {
15272      template: savedTemplate.slug
15273    });
15274    registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)("Custom template created. You're in template mode now."), {
15275      type: 'snackbar',
15276      actions: [{
15277        label: (0,external_wp_i18n_namespaceObject.__)('Go back'),
15278        onClick: () => dispatch.setRenderingMode(select.getEditorSettings().defaultRenderingMode)
15279      }]
15280    });
15281    return savedTemplate;
15282  };
15283  
15284  /**
15285   * Update the provided block types to be visible.
15286   *
15287   * @param {string[]} blockNames Names of block types to show.
15288   */
15289  const showBlockTypes = blockNames => ({
15290    registry
15291  }) => {
15292    var _registry$select$get;
15293    const existingBlockNames = (_registry$select$get = registry.select(external_wp_preferences_namespaceObject.store).get('core', 'hiddenBlockTypes')) !== null && _registry$select$get !== void 0 ? _registry$select$get : [];
15294    const newBlockNames = existingBlockNames.filter(type => !(Array.isArray(blockNames) ? blockNames : [blockNames]).includes(type));
15295    registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'hiddenBlockTypes', newBlockNames);
15296  };
15297  
15298  /**
15299   * Update the provided block types to be hidden.
15300   *
15301   * @param {string[]} blockNames Names of block types to hide.
15302   */
15303  const hideBlockTypes = blockNames => ({
15304    registry
15305  }) => {
15306    var _registry$select$get2;
15307    const existingBlockNames = (_registry$select$get2 = registry.select(external_wp_preferences_namespaceObject.store).get('core', 'hiddenBlockTypes')) !== null && _registry$select$get2 !== void 0 ? _registry$select$get2 : [];
15308    const mergedBlockNames = new Set([...existingBlockNames, ...(Array.isArray(blockNames) ? blockNames : [blockNames])]);
15309    registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'hiddenBlockTypes', [...mergedBlockNames]);
15310  };
15311  
15312  /**
15313   * Save entity records marked as dirty.
15314   *
15315   * @param {Object}   options                      Options for the action.
15316   * @param {Function} [options.onSave]             Callback when saving happens.
15317   * @param {object[]} [options.dirtyEntityRecords] Array of dirty entities.
15318   * @param {object[]} [options.entitiesToSkip]     Array of entities to skip saving.
15319   * @param {Function} [options.close]              Callback when the actions is called. It should be consolidated with `onSave`.
15320   */
15321  const saveDirtyEntities = ({
15322    onSave,
15323    dirtyEntityRecords = [],
15324    entitiesToSkip = [],
15325    close
15326  } = {}) => ({
15327    registry
15328  }) => {
15329    const PUBLISH_ON_SAVE_ENTITIES = [{
15330      kind: 'postType',
15331      name: 'wp_navigation'
15332    }];
15333    const saveNoticeId = 'site-editor-save-success';
15334    const homeUrl = registry.select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.home;
15335    registry.dispatch(external_wp_notices_namespaceObject.store).removeNotice(saveNoticeId);
15336    const entitiesToSave = dirtyEntityRecords.filter(({
15337      kind,
15338      name,
15339      key,
15340      property
15341    }) => {
15342      return !entitiesToSkip.some(elt => elt.kind === kind && elt.name === name && elt.key === key && elt.property === property);
15343    });
15344    close?.(entitiesToSave);
15345    const siteItemsToSave = [];
15346    const pendingSavedRecords = [];
15347    entitiesToSave.forEach(({
15348      kind,
15349      name,
15350      key,
15351      property
15352    }) => {
15353      if ('root' === kind && 'site' === name) {
15354        siteItemsToSave.push(property);
15355      } else {
15356        if (PUBLISH_ON_SAVE_ENTITIES.some(typeToPublish => typeToPublish.kind === kind && typeToPublish.name === name)) {
15357          registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord(kind, name, key, {
15358            status: 'publish'
15359          });
15360        }
15361        pendingSavedRecords.push(registry.dispatch(external_wp_coreData_namespaceObject.store).saveEditedEntityRecord(kind, name, key));
15362      }
15363    });
15364    if (siteItemsToSave.length) {
15365      pendingSavedRecords.push(registry.dispatch(external_wp_coreData_namespaceObject.store).__experimentalSaveSpecifiedEntityEdits('root', 'site', undefined, siteItemsToSave));
15366    }
15367    registry.dispatch(external_wp_blockEditor_namespaceObject.store).__unstableMarkLastChangeAsPersistent();
15368    Promise.all(pendingSavedRecords).then(values => {
15369      return onSave ? onSave(values) : values;
15370    }).then(values => {
15371      if (values.some(value => typeof value === 'undefined')) {
15372        registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('Saving failed.'));
15373      } else {
15374        registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Site updated.'), {
15375          type: 'snackbar',
15376          id: saveNoticeId,
15377          actions: [{
15378            label: (0,external_wp_i18n_namespaceObject.__)('View site'),
15379            url: homeUrl
15380          }]
15381        });
15382      }
15383    }).catch(error => registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(`${(0,external_wp_i18n_namespaceObject.__)('Saving failed.')} $error}`));
15384  };
15385  
15386  /**
15387   * Reverts a template to its original theme-provided file.
15388   *
15389   * @param {Object}  template            The template to revert.
15390   * @param {Object}  [options]
15391   * @param {boolean} [options.allowUndo] Whether to allow the user to undo
15392   *                                      reverting the template. Default true.
15393   */
15394  const private_actions_revertTemplate = (template, {
15395    allowUndo = true
15396  } = {}) => async ({
15397    registry
15398  }) => {
15399    const noticeId = 'edit-site-template-reverted';
15400    registry.dispatch(external_wp_notices_namespaceObject.store).removeNotice(noticeId);
15401    if (!isTemplateRevertable(template)) {
15402      registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('This template is not revertable.'), {
15403        type: 'snackbar'
15404      });
15405      return;
15406    }
15407    try {
15408      const templateEntityConfig = registry.select(external_wp_coreData_namespaceObject.store).getEntityConfig('postType', template.type);
15409      if (!templateEntityConfig) {
15410        registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error. Please reload.'), {
15411          type: 'snackbar'
15412        });
15413        return;
15414      }
15415      const fileTemplatePath = (0,external_wp_url_namespaceObject.addQueryArgs)(`$templateEntityConfig.baseURL}/$template.id}`, {
15416        context: 'edit',
15417        source: template.origin
15418      });
15419      const fileTemplate = await external_wp_apiFetch_default()({
15420        path: fileTemplatePath
15421      });
15422      if (!fileTemplate) {
15423        registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error. Please reload.'), {
15424          type: 'snackbar'
15425        });
15426        return;
15427      }
15428      const serializeBlocks = ({
15429        blocks: blocksForSerialization = []
15430      }) => (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization);
15431      const edited = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', template.type, template.id);
15432  
15433      // We are fixing up the undo level here to make sure we can undo
15434      // the revert in the header toolbar correctly.
15435      registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, template.id, {
15436        content: serializeBlocks,
15437        // Required to make the `undo` behave correctly.
15438        blocks: edited.blocks,
15439        // Required to revert the blocks in the editor.
15440        source: 'custom' // required to avoid turning the editor into a dirty state
15441      }, {
15442        undoIgnore: true // Required to merge this edit with the last undo level.
15443      });
15444      const blocks = (0,external_wp_blocks_namespaceObject.parse)(fileTemplate?.content?.raw);
15445      registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, fileTemplate.id, {
15446        content: serializeBlocks,
15447        blocks,
15448        source: 'theme'
15449      });
15450      if (allowUndo) {
15451        const undoRevert = () => {
15452          registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, edited.id, {
15453            content: serializeBlocks,
15454            blocks: edited.blocks,
15455            source: 'custom'
15456          });
15457        };
15458        registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Template reset.'), {
15459          type: 'snackbar',
15460          id: noticeId,
15461          actions: [{
15462            label: (0,external_wp_i18n_namespaceObject.__)('Undo'),
15463            onClick: undoRevert
15464          }]
15465        });
15466      }
15467    } catch (error) {
15468      const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('Template revert failed. Please reload.');
15469      registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(errorMessage, {
15470        type: 'snackbar'
15471      });
15472    }
15473  };
15474  
15475  /**
15476   * Action that removes an array of templates, template parts or patterns.
15477   *
15478   * @param {Array} items An array of template,template part or pattern objects to remove.
15479   */
15480  const removeTemplates = items => async ({
15481    registry
15482  }) => {
15483    const isResetting = items.every(item => item?.has_theme_file);
15484    const promiseResult = await Promise.allSettled(items.map(item => {
15485      return registry.dispatch(external_wp_coreData_namespaceObject.store).deleteEntityRecord('postType', item.type, item.id, {
15486        force: true
15487      }, {
15488        throwOnError: true
15489      });
15490    }));
15491  
15492    // If all the promises were fulfilled with success.
15493    if (promiseResult.every(({
15494      status
15495    }) => status === 'fulfilled')) {
15496      let successMessage;
15497      if (items.length === 1) {
15498        // Depending on how the entity was retrieved its title might be
15499        // an object or simple string.
15500        let title;
15501        if (typeof items[0].title === 'string') {
15502          title = items[0].title;
15503        } else if (typeof items[0].title?.rendered === 'string') {
15504          title = items[0].title?.rendered;
15505        } else if (typeof items[0].title?.raw === 'string') {
15506          title = items[0].title?.raw;
15507        }
15508        successMessage = isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: The template/part's name. */
15509        (0,external_wp_i18n_namespaceObject.__)('"%s" reset.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: The template/part's name. */
15510        (0,external_wp_i18n_namespaceObject._x)('"%s" deleted.', 'template part'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title));
15511      } else {
15512        successMessage = isResetting ? (0,external_wp_i18n_namespaceObject.__)('Items reset.') : (0,external_wp_i18n_namespaceObject.__)('Items deleted.');
15513      }
15514      registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice(successMessage, {
15515        type: 'snackbar',
15516        id: 'editor-template-deleted-success'
15517      });
15518    } else {
15519      // If there was at lease one failure.
15520      let errorMessage;
15521      // If we were trying to delete a single template.
15522      if (promiseResult.length === 1) {
15523        if (promiseResult[0].reason?.message) {
15524          errorMessage = promiseResult[0].reason.message;
15525        } else {
15526          errorMessage = isResetting ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the item.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the item.');
15527        }
15528        // If we were trying to delete a multiple templates
15529      } else {
15530        const errorMessages = new Set();
15531        const failedPromises = promiseResult.filter(({
15532          status
15533        }) => status === 'rejected');
15534        for (const failedPromise of failedPromises) {
15535          if (failedPromise.reason?.message) {
15536            errorMessages.add(failedPromise.reason.message);
15537          }
15538        }
15539        if (errorMessages.size === 0) {
15540          errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the items.');
15541        } else if (errorMessages.size === 1) {
15542          errorMessage = isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: an error message */
15543          (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the items: %s'), [...errorMessages][0]) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: an error message */
15544          (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the items: %s'), [...errorMessages][0]);
15545        } else {
15546          errorMessage = isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: a list of comma separated error messages */
15547          (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while reverting the items: %s'), [...errorMessages].join(',')) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: a list of comma separated error messages */
15548          (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while deleting the items: %s'), [...errorMessages].join(','));
15549        }
15550      }
15551      registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(errorMessage, {
15552        type: 'snackbar'
15553      });
15554    }
15555  };
15556  
15557  /**
15558   * Set the default rendering mode preference for the current post type.
15559   *
15560   * @param {string} mode The rendering mode to set as default.
15561   */
15562  const setDefaultRenderingMode = mode => ({
15563    select,
15564    registry
15565  }) => {
15566    var _registry$select$get$;
15567    const postType = select.getCurrentPostType();
15568    const theme = registry.select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.stylesheet;
15569    const renderingModes = (_registry$select$get$ = registry.select(external_wp_preferences_namespaceObject.store).get('core', 'renderingModes')?.[theme]) !== null && _registry$select$get$ !== void 0 ? _registry$select$get$ : {};
15570    if (renderingModes[postType] === mode) {
15571      return;
15572    }
15573    const newModes = {
15574      [theme]: {
15575        ...renderingModes,
15576        [postType]: mode
15577      }
15578    };
15579    registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'renderingModes', newModes);
15580  };
15581  
15582  // EXTERNAL MODULE: ./node_modules/fast-deep-equal/index.js
15583  var fast_deep_equal = __webpack_require__(5215);
15584  var fast_deep_equal_default = /*#__PURE__*/__webpack_require__.n(fast_deep_equal);
15585  ;// ./node_modules/@wordpress/icons/build-module/library/navigation.js
15586  /**
15587   * WordPress dependencies
15588   */
15589  
15590  
15591  const navigation = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
15592    viewBox: "0 0 24 24",
15593    xmlns: "http://www.w3.org/2000/svg",
15594    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
15595      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"
15596    })
15597  });
15598  /* harmony default export */ const library_navigation = (navigation);
15599  
15600  ;// ./node_modules/@wordpress/icons/build-module/library/verse.js
15601  /**
15602   * WordPress dependencies
15603   */
15604  
15605  
15606  const verse = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
15607    viewBox: "0 0 24 24",
15608    xmlns: "http://www.w3.org/2000/svg",
15609    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
15610      d: "M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"
15611    })
15612  });
15613  /* harmony default export */ const library_verse = (verse);
15614  
15615  ;// ./node_modules/@wordpress/editor/build-module/dataviews/store/private-selectors.js
15616  /**
15617   * Internal dependencies
15618   */
15619  
15620  const private_selectors_EMPTY_ARRAY = [];
15621  function getEntityActions(state, kind, name) {
15622    var _state$actions$kind$n;
15623    return (_state$actions$kind$n = state.actions[kind]?.[name]) !== null && _state$actions$kind$n !== void 0 ? _state$actions$kind$n : private_selectors_EMPTY_ARRAY;
15624  }
15625  function getEntityFields(state, kind, name) {
15626    var _state$fields$kind$na;
15627    return (_state$fields$kind$na = state.fields[kind]?.[name]) !== null && _state$fields$kind$na !== void 0 ? _state$fields$kind$na : private_selectors_EMPTY_ARRAY;
15628  }
15629  function isEntityReady(state, kind, name) {
15630    return state.isReady[kind]?.[name];
15631  }
15632  
15633  ;// ./node_modules/@wordpress/editor/build-module/store/private-selectors.js
15634  /**
15635   * External dependencies
15636   */
15637  
15638  
15639  /**
15640   * WordPress dependencies
15641   */
15642  
15643  
15644  
15645  
15646  
15647  
15648  /**
15649   * Internal dependencies
15650   */
15651  
15652  
15653  
15654  const EMPTY_INSERTION_POINT = {
15655    rootClientId: undefined,
15656    insertionIndex: undefined,
15657    filterValue: undefined
15658  };
15659  
15660  /**
15661   * These are rendering modes that the editor supports.
15662   */
15663  const RENDERING_MODES = ['post-only', 'template-locked'];
15664  
15665  /**
15666   * Get the inserter.
15667   *
15668   * @param {Object} state Global application state.
15669   *
15670   * @return {Object} The root client ID, index to insert at and starting filter value.
15671   */
15672  const getInserter = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)(state => {
15673    if (typeof state.blockInserterPanel === 'object') {
15674      return state.blockInserterPanel;
15675    }
15676    if (getRenderingMode(state) === 'template-locked') {
15677      const [postContentClientId] = select(external_wp_blockEditor_namespaceObject.store).getBlocksByName('core/post-content');
15678      if (postContentClientId) {
15679        return {
15680          rootClientId: postContentClientId,
15681          insertionIndex: undefined,
15682          filterValue: undefined
15683        };
15684      }
15685    }
15686    return EMPTY_INSERTION_POINT;
15687  }, state => {
15688    const [postContentClientId] = select(external_wp_blockEditor_namespaceObject.store).getBlocksByName('core/post-content');
15689    return [state.blockInserterPanel, getRenderingMode(state), postContentClientId];
15690  }));
15691  function getListViewToggleRef(state) {
15692    return state.listViewToggleRef;
15693  }
15694  function getInserterSidebarToggleRef(state) {
15695    return state.inserterSidebarToggleRef;
15696  }
15697  const CARD_ICONS = {
15698    wp_block: library_symbol,
15699    wp_navigation: library_navigation,
15700    page: library_page,
15701    post: library_verse
15702  };
15703  const getPostIcon = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, postType, options) => {
15704    {
15705      if (postType === 'wp_template_part' || postType === 'wp_template') {
15706        const templateAreas = select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_part_areas || [];
15707        const areaData = templateAreas.find(item => options.area === item.area);
15708        if (areaData?.icon) {
15709          return getTemplatePartIcon(areaData.icon);
15710        }
15711        return library_layout;
15712      }
15713      if (CARD_ICONS[postType]) {
15714        return CARD_ICONS[postType];
15715      }
15716      const postTypeEntity = select(external_wp_coreData_namespaceObject.store).getPostType(postType);
15717      // `icon` is the `menu_icon` property of a post type. We
15718      // only handle `dashicons` for now, even if the `menu_icon`
15719      // also supports urls and svg as values.
15720      if (typeof postTypeEntity?.icon === 'string' && postTypeEntity.icon.startsWith('dashicons-')) {
15721        return postTypeEntity.icon.slice(10);
15722      }
15723      return library_page;
15724    }
15725  });
15726  
15727  /**
15728   * Returns true if there are unsaved changes to the
15729   * post's meta fields, and false otherwise.
15730   *
15731   * @param {Object} state    Global application state.
15732   * @param {string} postType The post type of the post.
15733   * @param {number} postId   The ID of the post.
15734   *
15735   * @return {boolean} Whether there are edits or not in the meta fields of the relevant post.
15736   */
15737  const hasPostMetaChanges = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, postType, postId) => {
15738    const {
15739      type: currentPostType,
15740      id: currentPostId
15741    } = getCurrentPost(state);
15742    // If no postType or postId is passed, use the current post.
15743    const edits = select(external_wp_coreData_namespaceObject.store).getEntityRecordNonTransientEdits('postType', postType || currentPostType, postId || currentPostId);
15744    if (!edits?.meta) {
15745      return false;
15746    }
15747  
15748    // Compare if anything apart from `footnotes` has changed.
15749    const originalPostMeta = select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', postType || currentPostType, postId || currentPostId)?.meta;
15750    return !fast_deep_equal_default()({
15751      ...originalPostMeta,
15752      footnotes: undefined
15753    }, {
15754      ...edits.meta,
15755      footnotes: undefined
15756    });
15757  });
15758  function private_selectors_getEntityActions(state, ...args) {
15759    return getEntityActions(state.dataviews, ...args);
15760  }
15761  function private_selectors_isEntityReady(state, ...args) {
15762    return isEntityReady(state.dataviews, ...args);
15763  }
15764  function private_selectors_getEntityFields(state, ...args) {
15765    return getEntityFields(state.dataviews, ...args);
15766  }
15767  
15768  /**
15769   * Similar to getBlocksByName in @wordpress/block-editor, but only returns the top-most
15770   * blocks that aren't descendants of the query block.
15771   *
15772   * @param {Object}       state      Global application state.
15773   * @param {Array|string} blockNames Block names of the blocks to retrieve.
15774   *
15775   * @return {Array} Block client IDs.
15776   */
15777  const getPostBlocksByName = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, blockNames) => {
15778    blockNames = Array.isArray(blockNames) ? blockNames : [blockNames];
15779    const {
15780      getBlocksByName,
15781      getBlockParents,
15782      getBlockName
15783    } = select(external_wp_blockEditor_namespaceObject.store);
15784    return getBlocksByName(blockNames).filter(clientId => getBlockParents(clientId).every(parentClientId => {
15785      const parentBlockName = getBlockName(parentClientId);
15786      return (
15787        // Ignore descendents of the query block.
15788        parentBlockName !== 'core/query' &&
15789        // Enable only the top-most block.
15790        !blockNames.includes(parentBlockName)
15791      );
15792    }));
15793  }, () => [select(external_wp_blockEditor_namespaceObject.store).getBlocks()]));
15794  
15795  /**
15796   * Returns the default rendering mode for a post type by user preference or post type configuration.
15797   *
15798   * @param {Object} state    Global application state.
15799   * @param {string} postType The post type.
15800   *
15801   * @return {string} The default rendering mode. Returns `undefined` while resolving value.
15802   */
15803  const getDefaultRenderingMode = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, postType) => {
15804    const {
15805      getPostType,
15806      getCurrentTheme,
15807      hasFinishedResolution
15808    } = select(external_wp_coreData_namespaceObject.store);
15809  
15810    // This needs to be called before `hasFinishedResolution`.
15811    // eslint-disable-next-line @wordpress/no-unused-vars-before-return
15812    const currentTheme = getCurrentTheme();
15813    // eslint-disable-next-line @wordpress/no-unused-vars-before-return
15814    const postTypeEntity = getPostType(postType);
15815  
15816    // Wait for the post type and theme resolution.
15817    if (!hasFinishedResolution('getPostType', [postType]) || !hasFinishedResolution('getCurrentTheme')) {
15818      return undefined;
15819    }
15820    const theme = currentTheme?.stylesheet;
15821    const defaultModePreference = select(external_wp_preferences_namespaceObject.store).get('core', 'renderingModes')?.[theme]?.[postType];
15822    const postTypeDefaultMode = Array.isArray(postTypeEntity?.supports?.editor) ? postTypeEntity.supports.editor.find(features => 'default-mode' in features)?.['default-mode'] : undefined;
15823    const defaultMode = defaultModePreference || postTypeDefaultMode;
15824  
15825    // Fallback gracefully to 'post-only' when rendering mode is not supported.
15826    if (!RENDERING_MODES.includes(defaultMode)) {
15827      return 'post-only';
15828    }
15829    return defaultMode;
15830  });
15831  
15832  ;// ./node_modules/@wordpress/editor/build-module/store/index.js
15833  /**
15834   * WordPress dependencies
15835   */
15836  
15837  
15838  /**
15839   * Internal dependencies
15840   */
15841  
15842  
15843  
15844  
15845  
15846  
15847  
15848  
15849  /**
15850   * Post editor data store configuration.
15851   *
15852   * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore
15853   */
15854  const storeConfig = {
15855    reducer: store_reducer,
15856    selectors: selectors_namespaceObject,
15857    actions: actions_namespaceObject
15858  };
15859  
15860  /**
15861   * Store definition for the editor namespace.
15862   *
15863   * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
15864   */
15865  const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
15866    ...storeConfig
15867  });
15868  (0,external_wp_data_namespaceObject.register)(store_store);
15869  unlock(store_store).registerPrivateActions(store_private_actions_namespaceObject);
15870  unlock(store_store).registerPrivateSelectors(store_private_selectors_namespaceObject);
15871  
15872  ;// ./node_modules/@wordpress/editor/build-module/hooks/custom-sources-backwards-compatibility.js
15873  /**
15874   * WordPress dependencies
15875   */
15876  
15877  
15878  
15879  
15880  
15881  
15882  /**
15883   * Internal dependencies
15884   */
15885  
15886  
15887  /** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */
15888  /** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */
15889  
15890  /**
15891   * Object whose keys are the names of block attributes, where each value
15892   * represents the meta key to which the block attribute is intended to save.
15893   *
15894   * @see https://developer.wordpress.org/reference/functions/register_meta/
15895   *
15896   * @typedef {Object<string,string>} WPMetaAttributeMapping
15897   */
15898  
15899  /**
15900   * Given a mapping of attribute names (meta source attributes) to their
15901   * associated meta key, returns a higher order component that overrides its
15902   * `attributes` and `setAttributes` props to sync any changes with the edited
15903   * post's meta keys.
15904   *
15905   * @param {WPMetaAttributeMapping} metaAttributes Meta attribute mapping.
15906   *
15907   * @return {WPHigherOrderComponent} Higher-order component.
15908   */
15909  
15910  const createWithMetaAttributeSource = metaAttributes => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => ({
15911    attributes,
15912    setAttributes,
15913    ...props
15914  }) => {
15915    const postType = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getCurrentPostType(), []);
15916    const [meta, setMeta] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'meta');
15917    const mergedAttributes = (0,external_wp_element_namespaceObject.useMemo)(() => ({
15918      ...attributes,
15919      ...Object.fromEntries(Object.entries(metaAttributes).map(([attributeKey, metaKey]) => [attributeKey, meta[metaKey]]))
15920    }), [attributes, meta]);
15921    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, {
15922      attributes: mergedAttributes,
15923      setAttributes: nextAttributes => {
15924        const nextMeta = Object.fromEntries(Object.entries(nextAttributes !== null && nextAttributes !== void 0 ? nextAttributes : {}).filter(
15925        // Filter to intersection of keys between the updated
15926        // attributes and those with an associated meta key.
15927        ([key]) => key in metaAttributes).map(([attributeKey, value]) => [
15928        // Rename the keys to the expected meta key name.
15929        metaAttributes[attributeKey], value]));
15930        if (Object.entries(nextMeta).length) {
15931          setMeta(nextMeta);
15932        }
15933        setAttributes(nextAttributes);
15934      },
15935      ...props
15936    });
15937  }, 'withMetaAttributeSource');
15938  
15939  /**
15940   * Filters a registered block's settings to enhance a block's `edit` component
15941   * to upgrade meta-sourced attributes to use the post's meta entity property.
15942   *
15943   * @param {WPBlockSettings} settings Registered block settings.
15944   *
15945   * @return {WPBlockSettings} Filtered block settings.
15946   */
15947  function shimAttributeSource(settings) {
15948    var _settings$attributes;
15949    /** @type {WPMetaAttributeMapping} */
15950    const metaAttributes = Object.fromEntries(Object.entries((_settings$attributes = settings.attributes) !== null && _settings$attributes !== void 0 ? _settings$attributes : {}).filter(([, {
15951      source
15952    }]) => source === 'meta').map(([attributeKey, {
15953      meta
15954    }]) => [attributeKey, meta]));
15955    if (Object.entries(metaAttributes).length) {
15956      settings.edit = createWithMetaAttributeSource(metaAttributes)(settings.edit);
15957    }
15958    return settings;
15959  }
15960  (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/editor/custom-sources-backwards-compatibility/shim-attribute-source', shimAttributeSource);
15961  
15962  ;// ./node_modules/@wordpress/editor/build-module/components/autocompleters/user.js
15963  /**
15964   * WordPress dependencies
15965   */
15966  
15967  
15968  
15969  
15970  function getUserLabel(user) {
15971    const avatar = user.avatar_urls && user.avatar_urls[24] ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
15972      className: "editor-autocompleters__user-avatar",
15973      alt: "",
15974      src: user.avatar_urls[24]
15975    }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
15976      className: "editor-autocompleters__no-avatar"
15977    });
15978    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
15979      children: [avatar, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
15980        className: "editor-autocompleters__user-name",
15981        children: user.name
15982      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
15983        className: "editor-autocompleters__user-slug",
15984        children: user.slug
15985      })]
15986    });
15987  }
15988  
15989  /**
15990   * A user mentions completer.
15991   *
15992   * @type {Object}
15993   */
15994  /* harmony default export */ const user = ({
15995    name: 'users',
15996    className: 'editor-autocompleters__user',
15997    triggerPrefix: '@',
15998    useItems(filterValue) {
15999      const users = (0,external_wp_data_namespaceObject.useSelect)(select => {
16000        const {
16001          getUsers
16002        } = select(external_wp_coreData_namespaceObject.store);
16003        return getUsers({
16004          context: 'view',
16005          search: encodeURIComponent(filterValue)
16006        });
16007      }, [filterValue]);
16008      const options = (0,external_wp_element_namespaceObject.useMemo)(() => users ? users.map(user => ({
16009        key: `user-$user.slug}`,
16010        value: user,
16011        label: getUserLabel(user)
16012      })) : [], [users]);
16013      return [options];
16014    },
16015    getOptionCompletion(user) {
16016      return `@$user.slug}`;
16017    }
16018  });
16019  
16020  ;// ./node_modules/@wordpress/editor/build-module/hooks/default-autocompleters.js
16021  /**
16022   * WordPress dependencies
16023   */
16024  
16025  
16026  /**
16027   * Internal dependencies
16028   */
16029  
16030  function setDefaultCompleters(completers = []) {
16031    // Provide copies so filters may directly modify them.
16032    completers.push({
16033      ...user
16034    });
16035    return completers;
16036  }
16037  (0,external_wp_hooks_namespaceObject.addFilter)('editor.Autocomplete.completers', 'editor/autocompleters/set-default-completers', setDefaultCompleters);
16038  
16039  ;// ./node_modules/@wordpress/editor/build-module/hooks/media-upload.js
16040  /**
16041   * WordPress dependencies
16042   */
16043  
16044  
16045  (0,external_wp_hooks_namespaceObject.addFilter)('editor.MediaUpload', 'core/editor/components/media-upload', () => external_wp_mediaUtils_namespaceObject.MediaUpload);
16046  
16047  ;// ./node_modules/@wordpress/editor/build-module/hooks/pattern-overrides.js
16048  /**
16049   * WordPress dependencies
16050   */
16051  
16052  
16053  
16054  
16055  
16056  
16057  
16058  /**
16059   * Internal dependencies
16060   */
16061  
16062  
16063  
16064  /** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */
16065  
16066  const {
16067    PatternOverridesControls,
16068    ResetOverridesControl,
16069    PatternOverridesBlockControls,
16070    PATTERN_TYPES: pattern_overrides_PATTERN_TYPES,
16071    PARTIAL_SYNCING_SUPPORTED_BLOCKS,
16072    PATTERN_SYNC_TYPES
16073  } = unlock(external_wp_patterns_namespaceObject.privateApis);
16074  
16075  /**
16076   * Override the default edit UI to include a new block inspector control for
16077   * assigning a partial syncing controls to supported blocks in the pattern editor.
16078   * Currently, only the `core/paragraph` block is supported.
16079   *
16080   * @param {Component} BlockEdit Original component.
16081   *
16082   * @return {Component} Wrapped component.
16083   */
16084  const withPatternOverrideControls = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => {
16085    const isSupportedBlock = !!PARTIAL_SYNCING_SUPPORTED_BLOCKS[props.name];
16086    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
16087      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, {
16088        ...props
16089      }, "edit"), props.isSelected && isSupportedBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ControlsWithStoreSubscription, {
16090        ...props
16091      }), isSupportedBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternOverridesBlockControls, {})]
16092    });
16093  }, 'withPatternOverrideControls');
16094  
16095  // Split into a separate component to avoid a store subscription
16096  // on every block.
16097  function ControlsWithStoreSubscription(props) {
16098    const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)();
16099    const {
16100      hasPatternOverridesSource,
16101      isEditingSyncedPattern
16102    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
16103      const {
16104        getCurrentPostType,
16105        getEditedPostAttribute
16106      } = select(store_store);
16107      return {
16108        // For editing link to the site editor if the theme and user permissions support it.
16109        hasPatternOverridesSource: !!(0,external_wp_blocks_namespaceObject.getBlockBindingsSource)('core/pattern-overrides'),
16110        isEditingSyncedPattern: getCurrentPostType() === pattern_overrides_PATTERN_TYPES.user && getEditedPostAttribute('meta')?.wp_pattern_sync_status !== PATTERN_SYNC_TYPES.unsynced && getEditedPostAttribute('wp_pattern_sync_status') !== PATTERN_SYNC_TYPES.unsynced
16111      };
16112    }, []);
16113    const bindings = props.attributes.metadata?.bindings;
16114    const hasPatternBindings = !!bindings && Object.values(bindings).some(binding => binding.source === 'core/pattern-overrides');
16115    const shouldShowPatternOverridesControls = isEditingSyncedPattern && blockEditingMode === 'default';
16116    const shouldShowResetOverridesControl = !isEditingSyncedPattern && !!props.attributes.metadata?.name && blockEditingMode !== 'disabled' && hasPatternBindings;
16117    if (!hasPatternOverridesSource) {
16118      return null;
16119    }
16120    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
16121      children: [shouldShowPatternOverridesControls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternOverridesControls, {
16122        ...props
16123      }), shouldShowResetOverridesControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResetOverridesControl, {
16124        ...props
16125      })]
16126    });
16127  }
16128  (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/editor/with-pattern-override-controls', withPatternOverrideControls);
16129  
16130  ;// ./node_modules/@wordpress/editor/build-module/hooks/index.js
16131  /**
16132   * Internal dependencies
16133   */
16134  
16135  
16136  
16137  
16138  
16139  ;// ./node_modules/@wordpress/editor/build-module/components/autocompleters/index.js
16140  
16141  
16142  ;// ./node_modules/@wordpress/editor/build-module/components/autosave-monitor/index.js
16143  /**
16144   * WordPress dependencies
16145   */
16146  
16147  
16148  
16149  
16150  
16151  /**
16152   * Internal dependencies
16153   */
16154  
16155  class AutosaveMonitor extends external_wp_element_namespaceObject.Component {
16156    constructor(props) {
16157      super(props);
16158      this.needsAutosave = !!(props.isDirty && props.isAutosaveable);
16159    }
16160    componentDidMount() {
16161      if (!this.props.disableIntervalChecks) {
16162        this.setAutosaveTimer();
16163      }
16164    }
16165    componentDidUpdate(prevProps) {
16166      if (this.props.disableIntervalChecks) {
16167        if (this.props.editsReference !== prevProps.editsReference) {
16168          this.props.autosave();
16169        }
16170        return;
16171      }
16172      if (this.props.interval !== prevProps.interval) {
16173        clearTimeout(this.timerId);
16174        this.setAutosaveTimer();
16175      }
16176      if (!this.props.isDirty) {
16177        this.needsAutosave = false;
16178        return;
16179      }
16180      if (this.props.isAutosaving && !prevProps.isAutosaving) {
16181        this.needsAutosave = false;
16182        return;
16183      }
16184      if (this.props.editsReference !== prevProps.editsReference) {
16185        this.needsAutosave = true;
16186      }
16187    }
16188    componentWillUnmount() {
16189      clearTimeout(this.timerId);
16190    }
16191    setAutosaveTimer(timeout = this.props.interval * 1000) {
16192      this.timerId = setTimeout(() => {
16193        this.autosaveTimerHandler();
16194      }, timeout);
16195    }
16196    autosaveTimerHandler() {
16197      if (!this.props.isAutosaveable) {
16198        this.setAutosaveTimer(1000);
16199        return;
16200      }
16201      if (this.needsAutosave) {
16202        this.needsAutosave = false;
16203        this.props.autosave();
16204      }
16205      this.setAutosaveTimer();
16206    }
16207    render() {
16208      return null;
16209    }
16210  }
16211  
16212  /**
16213   * Monitors the changes made to the edited post and triggers autosave if necessary.
16214   *
16215   * The logic is straightforward: a check is performed every `props.interval` seconds. If any changes are detected, `props.autosave()` is called.
16216   * The time between the change and the autosave varies but is no larger than `props.interval` seconds. Refer to the code below for more details, such as
16217   * the specific way of detecting changes.
16218   *
16219   * There are two caveats:
16220   * * If `props.isAutosaveable` happens to be false at a time of checking for changes, the check is retried every second.
16221   * * The timer may be disabled by setting `props.disableIntervalChecks` to `true`. In that mode, any change will immediately trigger `props.autosave()`.
16222   *
16223   * @param {Object}   props                       - The properties passed to the component.
16224   * @param {Function} props.autosave              - The function to call when changes need to be saved.
16225   * @param {number}   props.interval              - The maximum time in seconds between an unsaved change and an autosave.
16226   * @param {boolean}  props.isAutosaveable        - If false, the check for changes is retried every second.
16227   * @param {boolean}  props.disableIntervalChecks - If true, disables the timer and any change will immediately trigger `props.autosave()`.
16228   * @param {boolean}  props.isDirty               - Indicates if there are unsaved changes.
16229   *
16230   * @example
16231   * ```jsx
16232   * <AutosaveMonitor interval={30000} />
16233   * ```
16234   */
16235  /* harmony default export */ const autosave_monitor = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)((select, ownProps) => {
16236    const {
16237      getReferenceByDistinctEdits
16238    } = select(external_wp_coreData_namespaceObject.store);
16239    const {
16240      isEditedPostDirty,
16241      isEditedPostAutosaveable,
16242      isAutosavingPost,
16243      getEditorSettings
16244    } = select(store_store);
16245    const {
16246      interval = getEditorSettings().autosaveInterval
16247    } = ownProps;
16248    return {
16249      editsReference: getReferenceByDistinctEdits(),
16250      isDirty: isEditedPostDirty(),
16251      isAutosaveable: isEditedPostAutosaveable(),
16252      isAutosaving: isAutosavingPost(),
16253      interval
16254    };
16255  }), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps) => ({
16256    autosave() {
16257      const {
16258        autosave = dispatch(store_store).autosave
16259      } = ownProps;
16260      autosave();
16261    }
16262  }))])(AutosaveMonitor));
16263  
16264  ;// ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js
16265  /**
16266   * WordPress dependencies
16267   */
16268  
16269  
16270  const chevronRightSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
16271    xmlns: "http://www.w3.org/2000/svg",
16272    viewBox: "0 0 24 24",
16273    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
16274      d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"
16275    })
16276  });
16277  /* harmony default export */ const chevron_right_small = (chevronRightSmall);
16278  
16279  ;// ./node_modules/@wordpress/icons/build-module/library/chevron-left-small.js
16280  /**
16281   * WordPress dependencies
16282   */
16283  
16284  
16285  const chevronLeftSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
16286    xmlns: "http://www.w3.org/2000/svg",
16287    viewBox: "0 0 24 24",
16288    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
16289      d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"
16290    })
16291  });
16292  /* harmony default export */ const chevron_left_small = (chevronLeftSmall);
16293  
16294  ;// external ["wp","dom"]
16295  const external_wp_dom_namespaceObject = window["wp"]["dom"];
16296  ;// ./node_modules/@wordpress/editor/build-module/utils/pageTypeBadge.js
16297  /**
16298   * WordPress dependencies
16299   */
16300  
16301  
16302  
16303  
16304  /**
16305   * Custom hook to get the page type badge for the current post on edit site view.
16306   *
16307   * @param {number|string} postId postId of the current post being edited.
16308   */
16309  function usePageTypeBadge(postId) {
16310    const {
16311      isFrontPage,
16312      isPostsPage
16313    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
16314      const {
16315        canUser,
16316        getEditedEntityRecord
16317      } = select(external_wp_coreData_namespaceObject.store);
16318      const siteSettings = canUser('read', {
16319        kind: 'root',
16320        name: 'site'
16321      }) ? getEditedEntityRecord('root', 'site') : undefined;
16322      const _postId = parseInt(postId, 10);
16323      return {
16324        isFrontPage: siteSettings?.page_on_front === _postId,
16325        isPostsPage: siteSettings?.page_for_posts === _postId
16326      };
16327    });
16328    if (isFrontPage) {
16329      return (0,external_wp_i18n_namespaceObject.__)('Homepage');
16330    } else if (isPostsPage) {
16331      return (0,external_wp_i18n_namespaceObject.__)('Posts Page');
16332    }
16333    return false;
16334  }
16335  
16336  ;// ./node_modules/@wordpress/editor/build-module/components/document-bar/index.js
16337  /**
16338   * External dependencies
16339   */
16340  
16341  
16342  /**
16343   * WordPress dependencies
16344   */
16345  
16346  
16347  
16348  
16349  
16350  
16351  
16352  
16353  
16354  
16355  
16356  
16357  
16358  /**
16359   * Internal dependencies
16360   */
16361  
16362  
16363  
16364  
16365  
16366  /** @typedef {import("@wordpress/components").IconType} IconType */
16367  
16368  const MotionButton = (0,external_wp_components_namespaceObject.__unstableMotion)(external_wp_components_namespaceObject.Button);
16369  
16370  /**
16371   * This component renders a navigation bar at the top of the editor. It displays the title of the current document,
16372   * a back button (if applicable), and a command center button. It also handles different states of the document,
16373   * such as "not found" or "unsynced".
16374   *
16375   * @example
16376   * ```jsx
16377   * <DocumentBar />
16378   * ```
16379   * @param {Object}   props       The component props.
16380   * @param {string}   props.title A title for the document, defaulting to the document or
16381   *                               template title currently being edited.
16382   * @param {IconType} props.icon  An icon for the document, no default.
16383   *                               (A default icon indicating the document post type is no longer used.)
16384   *
16385   * @return {React.ReactNode} The rendered DocumentBar component.
16386   */
16387  function DocumentBar(props) {
16388    const {
16389      postId,
16390      postType,
16391      postTypeLabel,
16392      documentTitle,
16393      isNotFound,
16394      templateTitle,
16395      onNavigateToPreviousEntityRecord,
16396      isTemplatePreview
16397    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
16398      var _getCurrentTheme;
16399      const {
16400        getCurrentPostType,
16401        getCurrentPostId,
16402        getEditorSettings,
16403        getRenderingMode
16404      } = select(store_store);
16405      const {
16406        getEditedEntityRecord,
16407        getPostType,
16408        getCurrentTheme,
16409        isResolving: isResolvingSelector
16410      } = select(external_wp_coreData_namespaceObject.store);
16411      const _postType = getCurrentPostType();
16412      const _postId = getCurrentPostId();
16413      const _document = getEditedEntityRecord('postType', _postType, _postId);
16414      const {
16415        default_template_types: templateTypes = []
16416      } = (_getCurrentTheme = getCurrentTheme()) !== null && _getCurrentTheme !== void 0 ? _getCurrentTheme : {};
16417      const _templateInfo = getTemplateInfo({
16418        templateTypes,
16419        template: _document
16420      });
16421      const _postTypeLabel = getPostType(_postType)?.labels?.singular_name;
16422      return {
16423        postId: _postId,
16424        postType: _postType,
16425        postTypeLabel: _postTypeLabel,
16426        documentTitle: _document.title,
16427        isNotFound: !_document && !isResolvingSelector('getEditedEntityRecord', 'postType', _postType, _postId),
16428        templateTitle: _templateInfo.title,
16429        onNavigateToPreviousEntityRecord: getEditorSettings().onNavigateToPreviousEntityRecord,
16430        isTemplatePreview: getRenderingMode() === 'template-locked'
16431      };
16432    }, []);
16433    const {
16434      open: openCommandCenter
16435    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_commands_namespaceObject.store);
16436    const isReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
16437    const isTemplate = TEMPLATE_POST_TYPES.includes(postType);
16438    const hasBackButton = !!onNavigateToPreviousEntityRecord;
16439    const entityTitle = isTemplate ? templateTitle : documentTitle;
16440    const title = props.title || entityTitle;
16441    const icon = props.icon;
16442    const pageTypeBadge = usePageTypeBadge(postId);
16443    const mountedRef = (0,external_wp_element_namespaceObject.useRef)(false);
16444    (0,external_wp_element_namespaceObject.useEffect)(() => {
16445      mountedRef.current = true;
16446    }, []);
16447    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
16448      className: dist_clsx('editor-document-bar', {
16449        'has-back-button': hasBackButton
16450      }),
16451      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, {
16452        children: hasBackButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MotionButton, {
16453          className: "editor-document-bar__back",
16454          icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right_small : chevron_left_small,
16455          onClick: event => {
16456            event.stopPropagation();
16457            onNavigateToPreviousEntityRecord();
16458          },
16459          size: "compact",
16460          initial: mountedRef.current ? {
16461            opacity: 0,
16462            transform: 'translateX(15%)'
16463          } : false // Don't show entry animation when DocumentBar mounts.
16464          ,
16465          animate: {
16466            opacity: 1,
16467            transform: 'translateX(0%)'
16468          },
16469          exit: {
16470            opacity: 0,
16471            transform: 'translateX(15%)'
16472          },
16473          transition: isReducedMotion ? {
16474            duration: 0
16475          } : undefined,
16476          children: (0,external_wp_i18n_namespaceObject.__)('Back')
16477        })
16478      }), !isTemplate && isTemplatePreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, {
16479        icon: library_layout,
16480        className: "editor-document-bar__icon-layout"
16481      }), isNotFound ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
16482        children: (0,external_wp_i18n_namespaceObject.__)('Document not found')
16483      }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, {
16484        className: "editor-document-bar__command",
16485        onClick: () => openCommandCenter(),
16486        size: "compact",
16487        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__unstableMotion.div, {
16488          className: "editor-document-bar__title"
16489          // Force entry animation when the back button is added or removed.
16490          ,
16491  
16492          initial: mountedRef.current ? {
16493            opacity: 0,
16494            transform: hasBackButton ? 'translateX(15%)' : 'translateX(-15%)'
16495          } : false // Don't show entry animation when DocumentBar mounts.
16496          ,
16497          animate: {
16498            opacity: 1,
16499            transform: 'translateX(0%)'
16500          },
16501          transition: isReducedMotion ? {
16502            duration: 0
16503          } : undefined,
16504          children: [icon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, {
16505            icon: icon
16506          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalText, {
16507            size: "body",
16508            as: "h1",
16509            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
16510              className: "editor-document-bar__post-title",
16511              children: title ? (0,external_wp_dom_namespaceObject.__unstableStripHTML)(title) : (0,external_wp_i18n_namespaceObject.__)('No title')
16512            }), pageTypeBadge && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
16513              className: "editor-document-bar__post-type-label",
16514              children: `· $pageTypeBadge}`
16515            }), postTypeLabel && !props.title && !pageTypeBadge && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
16516              className: "editor-document-bar__post-type-label",
16517              children: `· ${(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(postTypeLabel)}`
16518            })]
16519          })]
16520        }, hasBackButton), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
16521          className: "editor-document-bar__shortcut",
16522          children: external_wp_keycodes_namespaceObject.displayShortcut.primary('k')
16523        })]
16524      })]
16525    });
16526  }
16527  
16528  ;// external ["wp","richText"]
16529  const external_wp_richText_namespaceObject = window["wp"]["richText"];
16530  ;// ./node_modules/@wordpress/editor/build-module/components/document-outline/item.js
16531  /**
16532   * External dependencies
16533   */
16534  
16535  
16536  const TableOfContentsItem = ({
16537    children,
16538    isValid,
16539    isDisabled,
16540    level,
16541    href,
16542    onSelect
16543  }) => {
16544    function handleClick(event) {
16545      if (isDisabled) {
16546        event.preventDefault();
16547        return;
16548      }
16549      onSelect();
16550    }
16551    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", {
16552      className: dist_clsx('document-outline__item', `is-$level.toLowerCase()}`, {
16553        'is-invalid': !isValid,
16554        'is-disabled': isDisabled
16555      }),
16556      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", {
16557        href: href,
16558        className: "document-outline__button",
16559        "aria-disabled": isDisabled,
16560        onClick: handleClick,
16561        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
16562          className: "document-outline__emdash",
16563          "aria-hidden": "true"
16564        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {
16565          className: "document-outline__level",
16566          children: level
16567        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
16568          className: "document-outline__item-content",
16569          children: children
16570        })]
16571      })
16572    });
16573  };
16574  /* harmony default export */ const document_outline_item = (TableOfContentsItem);
16575  
16576  ;// ./node_modules/@wordpress/editor/build-module/components/document-outline/index.js
16577  /**
16578   * WordPress dependencies
16579   */
16580  
16581  
16582  
16583  
16584  
16585  
16586  
16587  
16588  /**
16589   * Internal dependencies
16590   */
16591  
16592  
16593  
16594  /**
16595   * Module constants
16596   */
16597  
16598  const emptyHeadingContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("em", {
16599    children: (0,external_wp_i18n_namespaceObject.__)('(Empty heading)')
16600  });
16601  const incorrectLevelContent = [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}, "incorrect-break"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("em", {
16602    children: (0,external_wp_i18n_namespaceObject.__)('(Incorrect heading level)')
16603  }, "incorrect-message")];
16604  const singleH1Headings = [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}, "incorrect-break-h1"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("em", {
16605    children: (0,external_wp_i18n_namespaceObject.__)('(Your theme may already use a H1 for the post title)')
16606  }, "incorrect-message-h1")];
16607  const multipleH1Headings = [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}, "incorrect-break-multiple-h1"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("em", {
16608    children: (0,external_wp_i18n_namespaceObject.__)('(Multiple H1 headings are not recommended)')
16609  }, "incorrect-message-multiple-h1")];
16610  function EmptyOutlineIllustration() {
16611    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, {
16612      width: "138",
16613      height: "148",
16614      viewBox: "0 0 138 148",
16615      fill: "none",
16616      xmlns: "http://www.w3.org/2000/svg",
16617      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, {
16618        width: "138",
16619        height: "148",
16620        rx: "4",
16621        fill: "#F0F6FC"
16622      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Line, {
16623        x1: "44",
16624        y1: "28",
16625        x2: "24",
16626        y2: "28",
16627        stroke: "#DDDDDD"
16628      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, {
16629        x: "48",
16630        y: "16",
16631        width: "27",
16632        height: "23",
16633        rx: "4",
16634        fill: "#DDDDDD"
16635      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
16636        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",
16637        fill: "black"
16638      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Line, {
16639        x1: "55",
16640        y1: "59",
16641        x2: "24",
16642        y2: "59",
16643        stroke: "#DDDDDD"
16644      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, {
16645        x: "59",
16646        y: "47",
16647        width: "29",
16648        height: "23",
16649        rx: "4",
16650        fill: "#DDDDDD"
16651      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
16652        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",
16653        fill: "black"
16654      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Line, {
16655        x1: "80",
16656        y1: "90",
16657        x2: "24",
16658        y2: "90",
16659        stroke: "#DDDDDD"
16660      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, {
16661        x: "84",
16662        y: "78",
16663        width: "30",
16664        height: "23",
16665        rx: "4",
16666        fill: "#F0B849"
16667      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
16668        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",
16669        fill: "black"
16670      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Line, {
16671        x1: "66",
16672        y1: "121",
16673        x2: "24",
16674        y2: "121",
16675        stroke: "#DDDDDD"
16676      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, {
16677        x: "70",
16678        y: "109",
16679        width: "29",
16680        height: "23",
16681        rx: "4",
16682        fill: "#DDDDDD"
16683      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
16684        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",
16685        fill: "black"
16686      })]
16687    });
16688  }
16689  
16690  /**
16691   * Returns an array of heading blocks enhanced with the following properties:
16692   * level   - An integer with the heading level.
16693   * isEmpty - Flag indicating if the heading has no content.
16694   *
16695   * @param {?Array} blocks An array of blocks.
16696   *
16697   * @return {Array} An array of heading blocks enhanced with the properties described above.
16698   */
16699  const computeOutlineHeadings = (blocks = []) => {
16700    return blocks.filter(block => block.name === 'core/heading').map(block => ({
16701      ...block,
16702      level: block.attributes.level,
16703      isEmpty: isEmptyHeading(block)
16704    }));
16705  };
16706  const isEmptyHeading = heading => !heading.attributes.content || heading.attributes.content.trim().length === 0;
16707  
16708  /**
16709   * Renders a document outline component.
16710   *
16711   * @param {Object}   props                         Props.
16712   * @param {Function} props.onSelect                Function to be called when an outline item is selected
16713   * @param {boolean}  props.hasOutlineItemsDisabled Indicates whether the outline items are disabled.
16714   *
16715   * @return {React.ReactNode} The rendered component.
16716   */
16717  function DocumentOutline({
16718    onSelect,
16719    hasOutlineItemsDisabled
16720  }) {
16721    const {
16722      selectBlock
16723    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
16724    const {
16725      title,
16726      isTitleSupported
16727    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
16728      var _postType$supports$ti;
16729      const {
16730        getEditedPostAttribute
16731      } = select(store_store);
16732      const {
16733        getPostType
16734      } = select(external_wp_coreData_namespaceObject.store);
16735      const postType = getPostType(getEditedPostAttribute('type'));
16736      return {
16737        title: getEditedPostAttribute('title'),
16738        isTitleSupported: (_postType$supports$ti = postType?.supports?.title) !== null && _postType$supports$ti !== void 0 ? _postType$supports$ti : false
16739      };
16740    });
16741    const blocks = (0,external_wp_data_namespaceObject.useSelect)(select => {
16742      const {
16743        getClientIdsWithDescendants,
16744        getBlock
16745      } = select(external_wp_blockEditor_namespaceObject.store);
16746      const clientIds = getClientIdsWithDescendants();
16747      // Note: Don't modify data inside the `Array.map` callback,
16748      // all compulations should happen in `computeOutlineHeadings`.
16749      return clientIds.map(id => getBlock(id));
16750    });
16751    const contentBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => {
16752      // When rendering in `post-only` mode all blocks are considered content blocks.
16753      if (select(store_store).getRenderingMode() === 'post-only') {
16754        return undefined;
16755      }
16756      const {
16757        getBlocksByName,
16758        getClientIdsOfDescendants
16759      } = select(external_wp_blockEditor_namespaceObject.store);
16760      const [postContentClientId] = getBlocksByName('core/post-content');
16761  
16762      // Do nothing if there's no post content block.
16763      if (!postContentClientId) {
16764        return undefined;
16765      }
16766      return getClientIdsOfDescendants(postContentClientId);
16767    }, []);
16768    const prevHeadingLevelRef = (0,external_wp_element_namespaceObject.useRef)(1);
16769    const headings = (0,external_wp_element_namespaceObject.useMemo)(() => computeOutlineHeadings(blocks), [blocks]);
16770    if (headings.length < 1) {
16771      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
16772        className: "editor-document-outline has-no-headings",
16773        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EmptyOutlineIllustration, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
16774          children: (0,external_wp_i18n_namespaceObject.__)('Navigate the structure of your document and address issues like empty or incorrect heading levels.')
16775        })]
16776      });
16777    }
16778  
16779    // Not great but it's the simplest way to locate the title right now.
16780    const titleNode = document.querySelector('.editor-post-title__input');
16781    const hasTitle = isTitleSupported && title && titleNode;
16782    const countByLevel = headings.reduce((acc, heading) => ({
16783      ...acc,
16784      [heading.level]: (acc[heading.level] || 0) + 1
16785    }), {});
16786    const hasMultipleH1 = countByLevel[1] > 1;
16787    function isContentBlock(clientId) {
16788      return Array.isArray(contentBlocks) ? contentBlocks.includes(clientId) : true;
16789    }
16790    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
16791      className: "document-outline",
16792      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("ul", {
16793        children: [hasTitle && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(document_outline_item, {
16794          level: (0,external_wp_i18n_namespaceObject.__)('Title'),
16795          isValid: true,
16796          onSelect: onSelect,
16797          href: `#$titleNode.id}`,
16798          isDisabled: hasOutlineItemsDisabled,
16799          children: title
16800        }), headings.map(item => {
16801          // Headings remain the same, go up by one, or down by any amount.
16802          // Otherwise there are missing levels.
16803          const isIncorrectLevel = item.level > prevHeadingLevelRef.current + 1;
16804          const isValid = !item.isEmpty && !isIncorrectLevel && !!item.level && (item.level !== 1 || !hasMultipleH1 && !hasTitle);
16805          prevHeadingLevelRef.current = item.level;
16806          return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(document_outline_item, {
16807            level: `H$item.level}`,
16808            isValid: isValid,
16809            isDisabled: hasOutlineItemsDisabled || !isContentBlock(item.clientId),
16810            href: `#block-$item.clientId}`,
16811            onSelect: () => {
16812              selectBlock(item.clientId);
16813              onSelect?.();
16814            },
16815            children: [item.isEmpty ? emptyHeadingContent : (0,external_wp_richText_namespaceObject.getTextContent)((0,external_wp_richText_namespaceObject.create)({
16816              html: item.attributes.content
16817            })), isIncorrectLevel && incorrectLevelContent, item.level === 1 && hasMultipleH1 && multipleH1Headings, hasTitle && item.level === 1 && !hasMultipleH1 && singleH1Headings]
16818          }, item.clientId);
16819        })]
16820      })
16821    });
16822  }
16823  
16824  ;// ./node_modules/@wordpress/editor/build-module/components/document-outline/check.js
16825  /**
16826   * WordPress dependencies
16827   */
16828  
16829  
16830  
16831  /**
16832   * Component check if there are any headings (core/heading blocks) present in the document.
16833   *
16834   * @param {Object}          props          Props.
16835   * @param {React.ReactNode} props.children Children to be rendered.
16836   *
16837   * @return {React.ReactNode} The component to be rendered or null if there are headings.
16838   */
16839  function DocumentOutlineCheck({
16840    children
16841  }) {
16842    const hasHeadings = (0,external_wp_data_namespaceObject.useSelect)(select => {
16843      const {
16844        getGlobalBlockCount
16845      } = select(external_wp_blockEditor_namespaceObject.store);
16846      return getGlobalBlockCount('core/heading') > 0;
16847    });
16848    if (!hasHeadings) {
16849      return null;
16850    }
16851    return children;
16852  }
16853  
16854  ;// ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/register-shortcuts.js
16855  /**
16856   * WordPress dependencies
16857   */
16858  
16859  
16860  
16861  
16862  
16863  
16864  
16865  /**
16866   * Component for registering editor keyboard shortcuts.
16867   *
16868   * @return {Element} The component to be rendered.
16869   */
16870  
16871  function EditorKeyboardShortcutsRegister() {
16872    // Registering the shortcuts.
16873    const {
16874      registerShortcut
16875    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store);
16876    (0,external_wp_element_namespaceObject.useEffect)(() => {
16877      registerShortcut({
16878        name: 'core/editor/toggle-mode',
16879        category: 'global',
16880        description: (0,external_wp_i18n_namespaceObject.__)('Switch between visual editor and code editor.'),
16881        keyCombination: {
16882          modifier: 'secondary',
16883          character: 'm'
16884        }
16885      });
16886      registerShortcut({
16887        name: 'core/editor/save',
16888        category: 'global',
16889        description: (0,external_wp_i18n_namespaceObject.__)('Save your changes.'),
16890        keyCombination: {
16891          modifier: 'primary',
16892          character: 's'
16893        }
16894      });
16895      registerShortcut({
16896        name: 'core/editor/undo',
16897        category: 'global',
16898        description: (0,external_wp_i18n_namespaceObject.__)('Undo your last changes.'),
16899        keyCombination: {
16900          modifier: 'primary',
16901          character: 'z'
16902        }
16903      });
16904      registerShortcut({
16905        name: 'core/editor/redo',
16906        category: 'global',
16907        description: (0,external_wp_i18n_namespaceObject.__)('Redo your last undo.'),
16908        keyCombination: {
16909          modifier: 'primaryShift',
16910          character: 'z'
16911        },
16912        // Disable on Apple OS because it conflicts with the browser's
16913        // history shortcut. It's a fine alias for both Windows and Linux.
16914        // Since there's no conflict for Ctrl+Shift+Z on both Windows and
16915        // Linux, we keep it as the default for consistency.
16916        aliases: (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? [] : [{
16917          modifier: 'primary',
16918          character: 'y'
16919        }]
16920      });
16921      registerShortcut({
16922        name: 'core/editor/toggle-list-view',
16923        category: 'global',
16924        description: (0,external_wp_i18n_namespaceObject.__)('Show or hide the List View.'),
16925        keyCombination: {
16926          modifier: 'access',
16927          character: 'o'
16928        }
16929      });
16930      registerShortcut({
16931        name: 'core/editor/toggle-distraction-free',
16932        category: 'global',
16933        description: (0,external_wp_i18n_namespaceObject.__)('Enter or exit distraction free mode.'),
16934        keyCombination: {
16935          modifier: 'primaryShift',
16936          character: '\\'
16937        }
16938      });
16939      registerShortcut({
16940        name: 'core/editor/toggle-sidebar',
16941        category: 'global',
16942        description: (0,external_wp_i18n_namespaceObject.__)('Show or hide the Settings panel.'),
16943        keyCombination: {
16944          modifier: 'primaryShift',
16945          character: ','
16946        }
16947      });
16948      registerShortcut({
16949        name: 'core/editor/keyboard-shortcuts',
16950        category: 'main',
16951        description: (0,external_wp_i18n_namespaceObject.__)('Display these keyboard shortcuts.'),
16952        keyCombination: {
16953          modifier: 'access',
16954          character: 'h'
16955        }
16956      });
16957      registerShortcut({
16958        name: 'core/editor/next-region',
16959        category: 'global',
16960        description: (0,external_wp_i18n_namespaceObject.__)('Navigate to the next part of the editor.'),
16961        keyCombination: {
16962          modifier: 'ctrl',
16963          character: '`'
16964        },
16965        aliases: [{
16966          modifier: 'access',
16967          character: 'n'
16968        }]
16969      });
16970      registerShortcut({
16971        name: 'core/editor/previous-region',
16972        category: 'global',
16973        description: (0,external_wp_i18n_namespaceObject.__)('Navigate to the previous part of the editor.'),
16974        keyCombination: {
16975          modifier: 'ctrlShift',
16976          character: '`'
16977        },
16978        aliases: [{
16979          modifier: 'access',
16980          character: 'p'
16981        }, {
16982          modifier: 'ctrlShift',
16983          character: '~'
16984        }]
16985      });
16986    }, [registerShortcut]);
16987    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockEditorKeyboardShortcuts.Register, {});
16988  }
16989  /* harmony default export */ const register_shortcuts = (EditorKeyboardShortcutsRegister);
16990  
16991  ;// ./node_modules/@wordpress/icons/build-module/library/redo.js
16992  /**
16993   * WordPress dependencies
16994   */
16995  
16996  
16997  const redo_redo = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
16998    xmlns: "http://www.w3.org/2000/svg",
16999    viewBox: "0 0 24 24",
17000    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
17001      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"
17002    })
17003  });
17004  /* harmony default export */ const library_redo = (redo_redo);
17005  
17006  ;// ./node_modules/@wordpress/icons/build-module/library/undo.js
17007  /**
17008   * WordPress dependencies
17009   */
17010  
17011  
17012  const undo_undo = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
17013    xmlns: "http://www.w3.org/2000/svg",
17014    viewBox: "0 0 24 24",
17015    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
17016      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"
17017    })
17018  });
17019  /* harmony default export */ const library_undo = (undo_undo);
17020  
17021  ;// ./node_modules/@wordpress/editor/build-module/components/editor-history/redo.js
17022  /**
17023   * WordPress dependencies
17024   */
17025  
17026  
17027  
17028  
17029  
17030  
17031  
17032  /**
17033   * Internal dependencies
17034   */
17035  
17036  
17037  function EditorHistoryRedo(props, ref) {
17038    const shortcut = (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('z') : external_wp_keycodes_namespaceObject.displayShortcut.primary('y');
17039    const hasRedo = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).hasEditorRedo(), []);
17040    const {
17041      redo
17042    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
17043    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
17044      __next40pxDefaultSize: true,
17045      ...props,
17046      ref: ref,
17047      icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_redo : library_undo
17048      /* translators: button label text should, if possible, be under 16 characters. */,
17049      label: (0,external_wp_i18n_namespaceObject.__)('Redo'),
17050      shortcut: shortcut
17051      // If there are no redo levels we don't want to actually disable this
17052      // button, because it will remove focus for keyboard users.
17053      // See: https://github.com/WordPress/gutenberg/issues/3486
17054      ,
17055      "aria-disabled": !hasRedo,
17056      onClick: hasRedo ? redo : undefined,
17057      className: "editor-history__redo"
17058    });
17059  }
17060  
17061  /** @typedef {import('react').Ref<HTMLElement>} Ref */
17062  
17063  /**
17064   * Renders the redo button for the editor history.
17065   *
17066   * @param {Object} props - Props.
17067   * @param {Ref}    ref   - Forwarded ref.
17068   *
17069   * @return {React.ReactNode} The rendered component.
17070   */
17071  /* harmony default export */ const editor_history_redo = ((0,external_wp_element_namespaceObject.forwardRef)(EditorHistoryRedo));
17072  
17073  ;// ./node_modules/@wordpress/editor/build-module/components/editor-history/undo.js
17074  /**
17075   * WordPress dependencies
17076   */
17077  
17078  
17079  
17080  
17081  
17082  
17083  
17084  /**
17085   * Internal dependencies
17086   */
17087  
17088  
17089  function EditorHistoryUndo(props, ref) {
17090    const hasUndo = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).hasEditorUndo(), []);
17091    const {
17092      undo
17093    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
17094    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
17095      __next40pxDefaultSize: true,
17096      ...props,
17097      ref: ref,
17098      icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_undo : library_redo
17099      /* translators: button label text should, if possible, be under 16 characters. */,
17100      label: (0,external_wp_i18n_namespaceObject.__)('Undo'),
17101      shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('z')
17102      // If there are no undo levels we don't want to actually disable this
17103      // button, because it will remove focus for keyboard users.
17104      // See: https://github.com/WordPress/gutenberg/issues/3486
17105      ,
17106      "aria-disabled": !hasUndo,
17107      onClick: hasUndo ? undo : undefined,
17108      className: "editor-history__undo"
17109    });
17110  }
17111  
17112  /** @typedef {import('react').Ref<HTMLElement>} Ref */
17113  
17114  /**
17115   * Renders the undo button for the editor history.
17116   *
17117   * @param {Object} props - Props.
17118   * @param {Ref}    ref   - Forwarded ref.
17119   *
17120   * @return {React.ReactNode} The rendered component.
17121   */
17122  /* harmony default export */ const editor_history_undo = ((0,external_wp_element_namespaceObject.forwardRef)(EditorHistoryUndo));
17123  
17124  ;// ./node_modules/@wordpress/editor/build-module/components/template-validation-notice/index.js
17125  /**
17126   * WordPress dependencies
17127   */
17128  
17129  
17130  
17131  
17132  
17133  
17134  function TemplateValidationNotice() {
17135    const [showConfirmDialog, setShowConfirmDialog] = (0,external_wp_element_namespaceObject.useState)(false);
17136    const isValid = (0,external_wp_data_namespaceObject.useSelect)(select => {
17137      return select(external_wp_blockEditor_namespaceObject.store).isValidTemplate();
17138    }, []);
17139    const {
17140      setTemplateValidity,
17141      synchronizeTemplate
17142    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
17143    if (isValid) {
17144      return null;
17145    }
17146    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
17147      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, {
17148        className: "editor-template-validation-notice",
17149        isDismissible: false,
17150        status: "warning",
17151        actions: [{
17152          label: (0,external_wp_i18n_namespaceObject.__)('Keep it as is'),
17153          onClick: () => setTemplateValidity(true)
17154        }, {
17155          label: (0,external_wp_i18n_namespaceObject.__)('Reset the template'),
17156          onClick: () => setShowConfirmDialog(true)
17157        }],
17158        children: (0,external_wp_i18n_namespaceObject.__)('The content of your post doesn’t match the template assigned to your post type.')
17159      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, {
17160        isOpen: showConfirmDialog,
17161        confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Reset'),
17162        onConfirm: () => {
17163          setShowConfirmDialog(false);
17164          synchronizeTemplate();
17165        },
17166        onCancel: () => setShowConfirmDialog(false),
17167        size: "medium",
17168        children: (0,external_wp_i18n_namespaceObject.__)('Resetting the template may result in loss of content, do you want to continue?')
17169      })]
17170    });
17171  }
17172  
17173  ;// ./node_modules/@wordpress/editor/build-module/components/editor-notices/index.js
17174  /**
17175   * WordPress dependencies
17176   */
17177  
17178  
17179  
17180  
17181  /**
17182   * Internal dependencies
17183   */
17184  
17185  
17186  /**
17187   * This component renders the notices displayed in the editor. It displays pinned notices first, followed by dismissible
17188   *
17189   * @example
17190   * ```jsx
17191   * <EditorNotices />
17192   * ```
17193   *
17194   * @return {React.ReactNode} The rendered EditorNotices component.
17195   */
17196  
17197  function EditorNotices() {
17198    const {
17199      notices
17200    } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
17201      notices: select(external_wp_notices_namespaceObject.store).getNotices()
17202    }), []);
17203    const {
17204      removeNotice
17205    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
17206    const dismissibleNotices = notices.filter(({
17207      isDismissible,
17208      type
17209    }) => isDismissible && type === 'default');
17210    const nonDismissibleNotices = notices.filter(({
17211      isDismissible,
17212      type
17213    }) => !isDismissible && type === 'default');
17214    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
17215      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.NoticeList, {
17216        notices: nonDismissibleNotices,
17217        className: "components-editor-notices__pinned"
17218      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.NoticeList, {
17219        notices: dismissibleNotices,
17220        className: "components-editor-notices__dismissible",
17221        onRemove: removeNotice,
17222        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateValidationNotice, {})
17223      })]
17224    });
17225  }
17226  /* harmony default export */ const editor_notices = (EditorNotices);
17227  
17228  ;// ./node_modules/@wordpress/editor/build-module/components/editor-snackbars/index.js
17229  /**
17230   * WordPress dependencies
17231   */
17232  
17233  
17234  
17235  
17236  // Last three notices. Slices from the tail end of the list.
17237  
17238  const MAX_VISIBLE_NOTICES = -3;
17239  
17240  /**
17241   * Renders the editor snackbars component.
17242   *
17243   * @return {React.ReactNode} The rendered component.
17244   */
17245  function EditorSnackbars() {
17246    const notices = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_notices_namespaceObject.store).getNotices(), []);
17247    const {
17248      removeNotice
17249    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
17250    const snackbarNotices = notices.filter(({
17251      type
17252    }) => type === 'snackbar').slice(MAX_VISIBLE_NOTICES);
17253    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SnackbarList, {
17254      notices: snackbarNotices,
17255      className: "components-editor-notices__snackbar",
17256      onRemove: removeNotice
17257    });
17258  }
17259  
17260  ;// ./node_modules/@wordpress/editor/build-module/components/entities-saved-states/entity-record-item.js
17261  /**
17262   * WordPress dependencies
17263   */
17264  
17265  
17266  
17267  
17268  
17269  
17270  /**
17271   * Internal dependencies
17272   */
17273  
17274  
17275  
17276  
17277  function EntityRecordItem({
17278    record,
17279    checked,
17280    onChange
17281  }) {
17282    const {
17283      name,
17284      kind,
17285      title,
17286      key
17287    } = record;
17288  
17289    // Handle templates that might use default descriptive titles.
17290    const {
17291      entityRecordTitle,
17292      hasPostMetaChanges
17293    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
17294      var _select$getCurrentThe;
17295      if ('postType' !== kind || 'wp_template' !== name) {
17296        return {
17297          entityRecordTitle: title,
17298          hasPostMetaChanges: unlock(select(store_store)).hasPostMetaChanges(name, key)
17299        };
17300      }
17301      const template = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(kind, name, key);
17302      const {
17303        default_template_types: templateTypes = []
17304      } = (_select$getCurrentThe = select(external_wp_coreData_namespaceObject.store).getCurrentTheme()) !== null && _select$getCurrentThe !== void 0 ? _select$getCurrentThe : {};
17305      return {
17306        entityRecordTitle: getTemplateInfo({
17307          template,
17308          templateTypes
17309        }).title,
17310        hasPostMetaChanges: unlock(select(store_store)).hasPostMetaChanges(name, key)
17311      };
17312    }, [name, kind, title, key]);
17313    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
17314      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelRow, {
17315        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, {
17316          __nextHasNoMarginBottom: true,
17317          label: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(entityRecordTitle) || (0,external_wp_i18n_namespaceObject.__)('Untitled'),
17318          checked: checked,
17319          onChange: onChange,
17320          className: "entities-saved-states__change-control"
17321        })
17322      }), hasPostMetaChanges && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", {
17323        className: "entities-saved-states__changes",
17324        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", {
17325          children: (0,external_wp_i18n_namespaceObject.__)('Post Meta.')
17326        })
17327      })]
17328    });
17329  }
17330  
17331  ;// ./node_modules/@wordpress/editor/build-module/components/entities-saved-states/entity-type-list.js
17332  /**
17333   * WordPress dependencies
17334   */
17335  
17336  
17337  
17338  
17339  
17340  
17341  
17342  /**
17343   * Internal dependencies
17344   */
17345  
17346  
17347  
17348  const {
17349    getGlobalStylesChanges,
17350    GlobalStylesContext: entity_type_list_GlobalStylesContext
17351  } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
17352  function getEntityDescription(entity, count) {
17353    switch (entity) {
17354      case 'site':
17355        return 1 === count ? (0,external_wp_i18n_namespaceObject.__)('This change will affect your whole site.') : (0,external_wp_i18n_namespaceObject.__)('These changes will affect your whole site.');
17356      case 'wp_template':
17357        return (0,external_wp_i18n_namespaceObject.__)('This change will affect other parts of your site that use this template.');
17358      case 'page':
17359      case 'post':
17360        return (0,external_wp_i18n_namespaceObject.__)('The following has been modified.');
17361    }
17362  }
17363  function GlobalStylesDescription({
17364    record
17365  }) {
17366    const {
17367      user: currentEditorGlobalStyles
17368    } = (0,external_wp_element_namespaceObject.useContext)(entity_type_list_GlobalStylesContext);
17369    const savedRecord = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecord(record.kind, record.name, record.key), [record.kind, record.name, record.key]);
17370    const globalStylesChanges = getGlobalStylesChanges(currentEditorGlobalStyles, savedRecord, {
17371      maxResults: 10
17372    });
17373    return globalStylesChanges.length ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", {
17374      className: "entities-saved-states__changes",
17375      children: globalStylesChanges.map(change => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", {
17376        children: change
17377      }, change))
17378    }) : null;
17379  }
17380  function EntityDescription({
17381    record,
17382    count
17383  }) {
17384    if ('globalStyles' === record?.name) {
17385      return null;
17386    }
17387    const description = getEntityDescription(record?.name, count);
17388    return description ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelRow, {
17389      children: description
17390    }) : null;
17391  }
17392  function EntityTypeList({
17393    list,
17394    unselectedEntities,
17395    setUnselectedEntities
17396  }) {
17397    const count = list.length;
17398    const firstRecord = list[0];
17399    const entityConfig = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityConfig(firstRecord.kind, firstRecord.name), [firstRecord.kind, firstRecord.name]);
17400    let entityLabel = entityConfig.label;
17401    if (firstRecord?.name === 'wp_template_part') {
17402      entityLabel = 1 === count ? (0,external_wp_i18n_namespaceObject.__)('Template Part') : (0,external_wp_i18n_namespaceObject.__)('Template Parts');
17403    }
17404    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, {
17405      title: entityLabel,
17406      initialOpen: true,
17407      className: "entities-saved-states__panel-body",
17408      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EntityDescription, {
17409        record: firstRecord,
17410        count: count
17411      }), list.map(record => {
17412        return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EntityRecordItem, {
17413          record: record,
17414          checked: !unselectedEntities.some(elt => elt.kind === record.kind && elt.name === record.name && elt.key === record.key && elt.property === record.property),
17415          onChange: value => setUnselectedEntities(record, value)
17416        }, record.key || record.property);
17417      }), 'globalStyles' === firstRecord?.name && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesDescription, {
17418        record: firstRecord
17419      })]
17420    });
17421  }
17422  
17423  ;// ./node_modules/@wordpress/editor/build-module/components/entities-saved-states/hooks/use-is-dirty.js
17424  /**
17425   * WordPress dependencies
17426   */
17427  
17428  
17429  
17430  
17431  /**
17432   * Custom hook that determines if any entities are dirty (edited) and provides a way to manage selected/unselected entities.
17433   *
17434   * @return {Object} An object containing the following properties:
17435   *   - dirtyEntityRecords: An array of dirty entity records.
17436   *   - isDirty: A boolean indicating if there are any dirty entity records.
17437   *   - setUnselectedEntities: A function to set the unselected entities.
17438   *   - unselectedEntities: An array of unselected entities.
17439   */
17440  const useIsDirty = () => {
17441    const {
17442      editedEntities,
17443      siteEdits,
17444      siteEntityConfig
17445    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
17446      const {
17447        __experimentalGetDirtyEntityRecords,
17448        getEntityRecordEdits,
17449        getEntityConfig
17450      } = select(external_wp_coreData_namespaceObject.store);
17451      return {
17452        editedEntities: __experimentalGetDirtyEntityRecords(),
17453        siteEdits: getEntityRecordEdits('root', 'site'),
17454        siteEntityConfig: getEntityConfig('root', 'site')
17455      };
17456    }, []);
17457    const dirtyEntityRecords = (0,external_wp_element_namespaceObject.useMemo)(() => {
17458      var _siteEntityConfig$met;
17459      // Remove site object and decouple into its edited pieces.
17460      const editedEntitiesWithoutSite = editedEntities.filter(record => !(record.kind === 'root' && record.name === 'site'));
17461      const siteEntityLabels = (_siteEntityConfig$met = siteEntityConfig?.meta?.labels) !== null && _siteEntityConfig$met !== void 0 ? _siteEntityConfig$met : {};
17462      const editedSiteEntities = [];
17463      for (const property in siteEdits) {
17464        editedSiteEntities.push({
17465          kind: 'root',
17466          name: 'site',
17467          title: siteEntityLabels[property] || property,
17468          property
17469        });
17470      }
17471      return [...editedEntitiesWithoutSite, ...editedSiteEntities];
17472    }, [editedEntities, siteEdits, siteEntityConfig]);
17473  
17474    // Unchecked entities to be ignored by save function.
17475    const [unselectedEntities, _setUnselectedEntities] = (0,external_wp_element_namespaceObject.useState)([]);
17476    const setUnselectedEntities = ({
17477      kind,
17478      name,
17479      key,
17480      property
17481    }, checked) => {
17482      if (checked) {
17483        _setUnselectedEntities(unselectedEntities.filter(elt => elt.kind !== kind || elt.name !== name || elt.key !== key || elt.property !== property));
17484      } else {
17485        _setUnselectedEntities([...unselectedEntities, {
17486          kind,
17487          name,
17488          key,
17489          property
17490        }]);
17491      }
17492    };
17493    const isDirty = dirtyEntityRecords.length - unselectedEntities.length > 0;
17494    return {
17495      dirtyEntityRecords,
17496      isDirty,
17497      setUnselectedEntities,
17498      unselectedEntities
17499    };
17500  };
17501  
17502  ;// ./node_modules/@wordpress/editor/build-module/components/entities-saved-states/index.js
17503  /**
17504   * External dependencies
17505   */
17506  
17507  
17508  /**
17509   * WordPress dependencies
17510   */
17511  
17512  
17513  
17514  
17515  
17516  
17517  /**
17518   * Internal dependencies
17519   */
17520  
17521  
17522  
17523  
17524  
17525  function identity(values) {
17526    return values;
17527  }
17528  
17529  /**
17530   * Renders the component for managing saved states of entities.
17531   *
17532   * @param {Object}   props              The component props.
17533   * @param {Function} props.close        The function to close the dialog.
17534   * @param {boolean}  props.renderDialog Whether to render the component with modal dialog behavior.
17535   * @param {string}   props.variant      Changes the layout of the component. When an `inline` value is provided, the action buttons are rendered at the end of the component instead of at the start.
17536   *
17537   * @return {React.ReactNode} The rendered component.
17538   */
17539  function EntitiesSavedStates({
17540    close,
17541    renderDialog,
17542    variant
17543  }) {
17544    const isDirtyProps = useIsDirty();
17545    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EntitiesSavedStatesExtensible, {
17546      close: close,
17547      renderDialog: renderDialog,
17548      variant: variant,
17549      ...isDirtyProps
17550    });
17551  }
17552  
17553  /**
17554   * Renders a panel for saving entities with dirty records.
17555   *
17556   * @param {Object}   props                       The component props.
17557   * @param {string}   props.additionalPrompt      Additional prompt to display.
17558   * @param {Function} props.close                 Function to close the panel.
17559   * @param {Function} props.onSave                Function to call when saving entities.
17560   * @param {boolean}  props.saveEnabled           Flag indicating if save is enabled.
17561   * @param {string}   props.saveLabel             Label for the save button.
17562   * @param {boolean}  props.renderDialog          Whether to render the component with modal dialog behavior.
17563   * @param {Array}    props.dirtyEntityRecords    Array of dirty entity records.
17564   * @param {boolean}  props.isDirty               Flag indicating if there are dirty entities.
17565   * @param {Function} props.setUnselectedEntities Function to set unselected entities.
17566   * @param {Array}    props.unselectedEntities    Array of unselected entities.
17567   * @param {string}   props.variant               Changes the layout of the component. When an `inline` value is provided, the action buttons are rendered at the end of the component instead of at the start.
17568   *
17569   * @return {React.ReactNode} The rendered component.
17570   */
17571  function EntitiesSavedStatesExtensible({
17572    additionalPrompt = undefined,
17573    close,
17574    onSave = identity,
17575    saveEnabled: saveEnabledProp = undefined,
17576    saveLabel = (0,external_wp_i18n_namespaceObject.__)('Save'),
17577    renderDialog,
17578    dirtyEntityRecords,
17579    isDirty,
17580    setUnselectedEntities,
17581    unselectedEntities,
17582    variant = 'default'
17583  }) {
17584    const saveButtonRef = (0,external_wp_element_namespaceObject.useRef)();
17585    const {
17586      saveDirtyEntities
17587    } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
17588    // To group entities by type.
17589    const partitionedSavables = dirtyEntityRecords.reduce((acc, record) => {
17590      const {
17591        name
17592      } = record;
17593      if (!acc[name]) {
17594        acc[name] = [];
17595      }
17596      acc[name].push(record);
17597      return acc;
17598    }, {});
17599  
17600    // Sort entity groups.
17601    const {
17602      site: siteSavables,
17603      wp_template: templateSavables,
17604      wp_template_part: templatePartSavables,
17605      ...contentSavables
17606    } = partitionedSavables;
17607    const sortedPartitionedSavables = [siteSavables, templateSavables, templatePartSavables, ...Object.values(contentSavables)].filter(Array.isArray);
17608    const saveEnabled = saveEnabledProp !== null && saveEnabledProp !== void 0 ? saveEnabledProp : isDirty;
17609    // Explicitly define this with no argument passed.  Using `close` on
17610    // its own will use the event object in place of the expected saved entities.
17611    const dismissPanel = (0,external_wp_element_namespaceObject.useCallback)(() => close(), [close]);
17612    const [saveDialogRef, saveDialogProps] = (0,external_wp_compose_namespaceObject.__experimentalUseDialog)({
17613      onClose: () => dismissPanel()
17614    });
17615    const dialogLabelId = (0,external_wp_compose_namespaceObject.useInstanceId)(EntitiesSavedStatesExtensible, 'entities-saved-states__panel-label');
17616    const dialogDescriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(EntitiesSavedStatesExtensible, 'entities-saved-states__panel-description');
17617    const selectItemsToSaveDescription = !!dirtyEntityRecords.length ? (0,external_wp_i18n_namespaceObject.__)('Select the items you want to save.') : undefined;
17618    const isInline = variant === 'inline';
17619    const actionButtons = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
17620      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
17621        isBlock: isInline ? false : true,
17622        as: external_wp_components_namespaceObject.Button,
17623        variant: isInline ? 'tertiary' : 'secondary',
17624        size: isInline ? undefined : 'compact',
17625        onClick: dismissPanel,
17626        children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
17627      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
17628        isBlock: isInline ? false : true,
17629        as: external_wp_components_namespaceObject.Button,
17630        ref: saveButtonRef,
17631        variant: "primary",
17632        size: isInline ? undefined : 'compact',
17633        disabled: !saveEnabled,
17634        accessibleWhenDisabled: true,
17635        onClick: () => saveDirtyEntities({
17636          onSave,
17637          dirtyEntityRecords,
17638          entitiesToSkip: unselectedEntities,
17639          close
17640        }),
17641        className: "editor-entities-saved-states__save-button",
17642        children: saveLabel
17643      })]
17644    });
17645    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
17646      ref: renderDialog ? saveDialogRef : undefined,
17647      ...(renderDialog && saveDialogProps),
17648      className: dist_clsx('entities-saved-states__panel', {
17649        'is-inline': isInline
17650      }),
17651      role: renderDialog ? 'dialog' : undefined,
17652      "aria-labelledby": renderDialog ? dialogLabelId : undefined,
17653      "aria-describedby": renderDialog ? dialogDescriptionId : undefined,
17654      children: [!isInline && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, {
17655        className: "entities-saved-states__panel-header",
17656        gap: 2,
17657        children: actionButtons
17658      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
17659        className: "entities-saved-states__text-prompt",
17660        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
17661          className: "entities-saved-states__text-prompt--header-wrapper",
17662          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {
17663            id: renderDialog ? dialogLabelId : undefined,
17664            className: "entities-saved-states__text-prompt--header",
17665            children: (0,external_wp_i18n_namespaceObject.__)('Are you ready to save?')
17666          })
17667        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
17668          id: renderDialog ? dialogDescriptionId : undefined,
17669          children: [additionalPrompt, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
17670            className: "entities-saved-states__text-prompt--changes-count",
17671            children: isDirty ? (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of site changes waiting to be saved. */
17672            (0,external_wp_i18n_namespaceObject._n)('There is <strong>%d site change</strong> waiting to be saved.', 'There are <strong>%d site changes</strong> waiting to be saved.', dirtyEntityRecords.length), dirtyEntityRecords.length), {
17673              strong: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {})
17674            }) : selectItemsToSaveDescription
17675          })]
17676        })]
17677      }), sortedPartitionedSavables.map(list => {
17678        return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EntityTypeList, {
17679          list: list,
17680          unselectedEntities: unselectedEntities,
17681          setUnselectedEntities: setUnselectedEntities
17682        }, list[0].name);
17683      }), isInline && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, {
17684        direction: "row",
17685        justify: "flex-end",
17686        className: "entities-saved-states__panel-footer",
17687        children: actionButtons
17688      })]
17689    });
17690  }
17691  
17692  ;// ./node_modules/@wordpress/editor/build-module/components/error-boundary/index.js
17693  /**
17694   * WordPress dependencies
17695   */
17696  
17697  
17698  
17699  
17700  
17701  
17702  
17703  /**
17704   * Internal dependencies
17705   */
17706  
17707  
17708  function getContent() {
17709    try {
17710      // While `select` in a component is generally discouraged, it is
17711      // used here because it (a) reduces the chance of data loss in the
17712      // case of additional errors by performing a direct retrieval and
17713      // (b) avoids the performance cost associated with unnecessary
17714      // content serialization throughout the lifetime of a non-erroring
17715      // application.
17716      return (0,external_wp_data_namespaceObject.select)(store_store).getEditedPostContent();
17717    } catch (error) {}
17718  }
17719  function CopyButton({
17720    text,
17721    children,
17722    variant = 'secondary'
17723  }) {
17724    const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text);
17725    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
17726      __next40pxDefaultSize: true,
17727      variant: variant,
17728      ref: ref,
17729      children: children
17730    });
17731  }
17732  class ErrorBoundary extends external_wp_element_namespaceObject.Component {
17733    constructor() {
17734      super(...arguments);
17735      this.state = {
17736        error: null
17737      };
17738    }
17739    componentDidCatch(error) {
17740      (0,external_wp_hooks_namespaceObject.doAction)('editor.ErrorBoundary.errorLogged', error);
17741    }
17742    static getDerivedStateFromError(error) {
17743      return {
17744        error
17745      };
17746    }
17747    render() {
17748      const {
17749        error
17750      } = this.state;
17751      const {
17752        canCopyContent = false
17753      } = this.props;
17754      if (!error) {
17755        return this.props.children;
17756      }
17757      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
17758        className: "editor-error-boundary",
17759        alignment: "baseline",
17760        spacing: 4,
17761        justify: "space-between",
17762        expanded: false,
17763        wrap: true,
17764        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
17765          as: "p",
17766          children: (0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error.')
17767        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
17768          expanded: false,
17769          children: [canCopyContent && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyButton, {
17770            text: getContent,
17771            children: (0,external_wp_i18n_namespaceObject.__)('Copy contents')
17772          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyButton, {
17773            variant: "primary",
17774            text: error?.stack,
17775            children: (0,external_wp_i18n_namespaceObject.__)('Copy error')
17776          })]
17777        })]
17778      });
17779    }
17780  }
17781  
17782  /**
17783   * ErrorBoundary is used to catch JavaScript errors anywhere in a child component tree, log those errors, and display a fallback UI.
17784   *
17785   * It uses the lifecycle methods getDerivedStateFromError and componentDidCatch to catch errors in a child component tree.
17786   *
17787   * getDerivedStateFromError is used to render a fallback UI after an error has been thrown, and componentDidCatch is used to log error information.
17788   *
17789   * @class ErrorBoundary
17790   * @augments Component
17791   */
17792  /* harmony default export */ const error_boundary = (ErrorBoundary);
17793  
17794  ;// ./node_modules/@wordpress/editor/build-module/components/local-autosave-monitor/index.js
17795  /**
17796   * WordPress dependencies
17797   */
17798  
17799  
17800  
17801  
17802  
17803  
17804  
17805  /**
17806   * Internal dependencies
17807   */
17808  
17809  
17810  
17811  
17812  const requestIdleCallback = window.requestIdleCallback ? window.requestIdleCallback : window.requestAnimationFrame;
17813  let hasStorageSupport;
17814  
17815  /**
17816   * Function which returns true if the current environment supports browser
17817   * sessionStorage, or false otherwise. The result of this function is cached and
17818   * reused in subsequent invocations.
17819   */
17820  const hasSessionStorageSupport = () => {
17821    if (hasStorageSupport !== undefined) {
17822      return hasStorageSupport;
17823    }
17824    try {
17825      // Private Browsing in Safari 10 and earlier will throw an error when
17826      // attempting to set into sessionStorage. The test here is intentional in
17827      // causing a thrown error as condition bailing from local autosave.
17828      window.sessionStorage.setItem('__wpEditorTestSessionStorage', '');
17829      window.sessionStorage.removeItem('__wpEditorTestSessionStorage');
17830      hasStorageSupport = true;
17831    } catch {
17832      hasStorageSupport = false;
17833    }
17834    return hasStorageSupport;
17835  };
17836  
17837  /**
17838   * Custom hook which manages the creation of a notice prompting the user to
17839   * restore a local autosave, if one exists.
17840   */
17841  function useAutosaveNotice() {
17842    const {
17843      postId,
17844      isEditedPostNew,
17845      hasRemoteAutosave
17846    } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
17847      postId: select(store_store).getCurrentPostId(),
17848      isEditedPostNew: select(store_store).isEditedPostNew(),
17849      hasRemoteAutosave: !!select(store_store).getEditorSettings().autosave
17850    }), []);
17851    const {
17852      getEditedPostAttribute
17853    } = (0,external_wp_data_namespaceObject.useSelect)(store_store);
17854    const {
17855      createWarningNotice,
17856      removeNotice
17857    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
17858    const {
17859      editPost,
17860      resetEditorBlocks
17861    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
17862    (0,external_wp_element_namespaceObject.useEffect)(() => {
17863      let localAutosave = localAutosaveGet(postId, isEditedPostNew);
17864      if (!localAutosave) {
17865        return;
17866      }
17867      try {
17868        localAutosave = JSON.parse(localAutosave);
17869      } catch {
17870        // Not usable if it can't be parsed.
17871        return;
17872      }
17873      const {
17874        post_title: title,
17875        content,
17876        excerpt
17877      } = localAutosave;
17878      const edits = {
17879        title,
17880        content,
17881        excerpt
17882      };
17883      {
17884        // Only display a notice if there is a difference between what has been
17885        // saved and that which is stored in sessionStorage.
17886        const hasDifference = Object.keys(edits).some(key => {
17887          return edits[key] !== getEditedPostAttribute(key);
17888        });
17889        if (!hasDifference) {
17890          // If there is no difference, it can be safely ejected from storage.
17891          localAutosaveClear(postId, isEditedPostNew);
17892          return;
17893        }
17894      }
17895      if (hasRemoteAutosave) {
17896        return;
17897      }
17898      const id = 'wpEditorAutosaveRestore';
17899      createWarningNotice((0,external_wp_i18n_namespaceObject.__)('The backup of this post in your browser is different from the version below.'), {
17900        id,
17901        actions: [{
17902          label: (0,external_wp_i18n_namespaceObject.__)('Restore the backup'),
17903          onClick() {
17904            const {
17905              content: editsContent,
17906              ...editsWithoutContent
17907            } = edits;
17908            editPost(editsWithoutContent);
17909            resetEditorBlocks((0,external_wp_blocks_namespaceObject.parse)(edits.content));
17910            removeNotice(id);
17911          }
17912        }]
17913      });
17914    }, [isEditedPostNew, postId]);
17915  }
17916  
17917  /**
17918   * Custom hook which ejects a local autosave after a successful save occurs.
17919   */
17920  function useAutosavePurge() {
17921    const {
17922      postId,
17923      isEditedPostNew,
17924      isDirty,
17925      isAutosaving,
17926      didError
17927    } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
17928      postId: select(store_store).getCurrentPostId(),
17929      isEditedPostNew: select(store_store).isEditedPostNew(),
17930      isDirty: select(store_store).isEditedPostDirty(),
17931      isAutosaving: select(store_store).isAutosavingPost(),
17932      didError: select(store_store).didPostSaveRequestFail()
17933    }), []);
17934    const lastIsDirtyRef = (0,external_wp_element_namespaceObject.useRef)(isDirty);
17935    const lastIsAutosavingRef = (0,external_wp_element_namespaceObject.useRef)(isAutosaving);
17936    (0,external_wp_element_namespaceObject.useEffect)(() => {
17937      if (!didError && (lastIsAutosavingRef.current && !isAutosaving || lastIsDirtyRef.current && !isDirty)) {
17938        localAutosaveClear(postId, isEditedPostNew);
17939      }
17940      lastIsDirtyRef.current = isDirty;
17941      lastIsAutosavingRef.current = isAutosaving;
17942    }, [isDirty, isAutosaving, didError]);
17943  
17944    // Once the isEditedPostNew changes from true to false, let's clear the auto-draft autosave.
17945    const wasEditedPostNew = (0,external_wp_compose_namespaceObject.usePrevious)(isEditedPostNew);
17946    const prevPostId = (0,external_wp_compose_namespaceObject.usePrevious)(postId);
17947    (0,external_wp_element_namespaceObject.useEffect)(() => {
17948      if (prevPostId === postId && wasEditedPostNew && !isEditedPostNew) {
17949        localAutosaveClear(postId, true);
17950      }
17951    }, [isEditedPostNew, postId]);
17952  }
17953  function LocalAutosaveMonitor() {
17954    const {
17955      autosave
17956    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
17957    const deferredAutosave = (0,external_wp_element_namespaceObject.useCallback)(() => {
17958      requestIdleCallback(() => autosave({
17959        local: true
17960      }));
17961    }, []);
17962    useAutosaveNotice();
17963    useAutosavePurge();
17964    const localAutosaveInterval = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getEditorSettings().localAutosaveInterval, []);
17965    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(autosave_monitor, {
17966      interval: localAutosaveInterval,
17967      autosave: deferredAutosave
17968    });
17969  }
17970  
17971  /**
17972   * Monitors local autosaves of a post in the editor.
17973   * It uses several hooks and functions to manage autosave behavior:
17974   * - `useAutosaveNotice` hook: Manages the creation of a notice prompting the user to restore a local autosave, if one exists.
17975   * - `useAutosavePurge` hook: Ejects a local autosave after a successful save occurs.
17976   * - `hasSessionStorageSupport` function: Checks if the current environment supports browser sessionStorage.
17977   * - `LocalAutosaveMonitor` component: Uses the `AutosaveMonitor` component to perform autosaves at a specified interval.
17978   *
17979   * The module also checks for sessionStorage support and conditionally exports the `LocalAutosaveMonitor` component based on that.
17980   *
17981   * @module LocalAutosaveMonitor
17982   */
17983  /* harmony default export */ const local_autosave_monitor = ((0,external_wp_compose_namespaceObject.ifCondition)(hasSessionStorageSupport)(LocalAutosaveMonitor));
17984  
17985  ;// ./node_modules/@wordpress/editor/build-module/components/page-attributes/check.js
17986  /**
17987   * WordPress dependencies
17988   */
17989  
17990  
17991  
17992  /**
17993   * Internal dependencies
17994   */
17995  
17996  
17997  /**
17998   * Wrapper component that renders its children only if the post type supports page attributes.
17999   *
18000   * @param {Object}          props          - The component props.
18001   * @param {React.ReactNode} props.children - The child components to render.
18002   *
18003   * @return {React.ReactNode} The rendered child components or null if page attributes are not supported.
18004   */
18005  function PageAttributesCheck({
18006    children
18007  }) {
18008    const supportsPageAttributes = (0,external_wp_data_namespaceObject.useSelect)(select => {
18009      const {
18010        getEditedPostAttribute
18011      } = select(store_store);
18012      const {
18013        getPostType
18014      } = select(external_wp_coreData_namespaceObject.store);
18015      const postType = getPostType(getEditedPostAttribute('type'));
18016      return !!postType?.supports?.['page-attributes'];
18017    }, []);
18018  
18019    // Only render fields if post type supports page attributes or available templates exist.
18020    if (!supportsPageAttributes) {
18021      return null;
18022    }
18023    return children;
18024  }
18025  /* harmony default export */ const page_attributes_check = (PageAttributesCheck);
18026  
18027  ;// ./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js
18028  /**
18029   * WordPress dependencies
18030   */
18031  
18032  
18033  
18034  /**
18035   * Internal dependencies
18036   */
18037  
18038  
18039  /**
18040   * A component which renders its own children only if the current editor post
18041   * type supports one of the given `supportKeys` prop.
18042   *
18043   * @param {Object}            props             Props.
18044   * @param {React.ReactNode}   props.children    Children to be rendered if post
18045   *                                              type supports.
18046   * @param {(string|string[])} props.supportKeys String or string array of keys
18047   *                                              to test.
18048   *
18049   * @return {React.ReactNode} The component to be rendered.
18050   */
18051  function PostTypeSupportCheck({
18052    children,
18053    supportKeys
18054  }) {
18055    const postType = (0,external_wp_data_namespaceObject.useSelect)(select => {
18056      const {
18057        getEditedPostAttribute
18058      } = select(store_store);
18059      const {
18060        getPostType
18061      } = select(external_wp_coreData_namespaceObject.store);
18062      return getPostType(getEditedPostAttribute('type'));
18063    }, []);
18064    let isSupported = !!postType;
18065    if (postType) {
18066      isSupported = (Array.isArray(supportKeys) ? supportKeys : [supportKeys]).some(key => !!postType.supports[key]);
18067    }
18068    if (!isSupported) {
18069      return null;
18070    }
18071    return children;
18072  }
18073  /* harmony default export */ const post_type_support_check = (PostTypeSupportCheck);
18074  
18075  ;// ./node_modules/@wordpress/editor/build-module/components/page-attributes/order.js
18076  /**
18077   * WordPress dependencies
18078   */
18079  
18080  
18081  
18082  
18083  
18084  /**
18085   * Internal dependencies
18086   */
18087  
18088  
18089  
18090  function PageAttributesOrder() {
18091    const order = (0,external_wp_data_namespaceObject.useSelect)(select => {
18092      var _select$getEditedPost;
18093      return (_select$getEditedPost = select(store_store).getEditedPostAttribute('menu_order')) !== null && _select$getEditedPost !== void 0 ? _select$getEditedPost : 0;
18094    }, []);
18095    const {
18096      editPost
18097    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
18098    const [orderInput, setOrderInput] = (0,external_wp_element_namespaceObject.useState)(null);
18099    const setUpdatedOrder = value => {
18100      setOrderInput(value);
18101      const newOrder = Number(value);
18102      if (Number.isInteger(newOrder) && value.trim?.() !== '') {
18103        editPost({
18104          menu_order: newOrder
18105        });
18106      }
18107    };
18108    const value = orderInput !== null && orderInput !== void 0 ? orderInput : order;
18109    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, {
18110      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, {
18111        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, {
18112          __next40pxDefaultSize: true,
18113          label: (0,external_wp_i18n_namespaceObject.__)('Order'),
18114          help: (0,external_wp_i18n_namespaceObject.__)('Set the page order.'),
18115          value: value,
18116          onChange: setUpdatedOrder,
18117          hideLabelFromVision: true,
18118          onBlur: () => {
18119            setOrderInput(null);
18120          }
18121        })
18122      })
18123    });
18124  }
18125  
18126  /**
18127   * Renders the Page Attributes Order component. A number input in an editor interface
18128   * for setting the order of a given page.
18129   * The component is now not used in core but was kept for backward compatibility.
18130   *
18131   * @return {React.ReactNode} The rendered component.
18132   */
18133  function PageAttributesOrderWithChecks() {
18134    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, {
18135      supportKeys: "page-attributes",
18136      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PageAttributesOrder, {})
18137    });
18138  }
18139  
18140  ;// ./node_modules/@wordpress/editor/build-module/components/post-panel-row/index.js
18141  /**
18142   * External dependencies
18143   */
18144  
18145  
18146  /**
18147   * WordPress dependencies
18148   */
18149  
18150  
18151  
18152  const PostPanelRow = (0,external_wp_element_namespaceObject.forwardRef)(({
18153    className,
18154    label,
18155    children
18156  }, ref) => {
18157    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
18158      className: dist_clsx('editor-post-panel__row', className),
18159      ref: ref,
18160      children: [label && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
18161        className: "editor-post-panel__row-label",
18162        children: label
18163      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
18164        className: "editor-post-panel__row-control",
18165        children: children
18166      })]
18167    });
18168  });
18169  /* harmony default export */ const post_panel_row = (PostPanelRow);
18170  
18171  ;// ./node_modules/@wordpress/editor/build-module/utils/terms.js
18172  /**
18173   * WordPress dependencies
18174   */
18175  
18176  
18177  /**
18178   * Returns terms in a tree form.
18179   *
18180   * @param {Array} flatTerms Array of terms in flat format.
18181   *
18182   * @return {Array} Array of terms in tree format.
18183   */
18184  function terms_buildTermsTree(flatTerms) {
18185    const flatTermsWithParentAndChildren = flatTerms.map(term => {
18186      return {
18187        children: [],
18188        parent: undefined,
18189        ...term
18190      };
18191    });
18192  
18193    // All terms should have a `parent` because we're about to index them by it.
18194    if (flatTermsWithParentAndChildren.some(({
18195      parent
18196    }) => parent === undefined)) {
18197      return flatTermsWithParentAndChildren;
18198    }
18199    const termsByParent = flatTermsWithParentAndChildren.reduce((acc, term) => {
18200      const {
18201        parent
18202      } = term;
18203      if (!acc[parent]) {
18204        acc[parent] = [];
18205      }
18206      acc[parent].push(term);
18207      return acc;
18208    }, {});
18209    const fillWithChildren = terms => {
18210      return terms.map(term => {
18211        const children = termsByParent[term.id];
18212        return {
18213          ...term,
18214          children: children && children.length ? fillWithChildren(children) : []
18215        };
18216      });
18217    };
18218    return fillWithChildren(termsByParent['0'] || []);
18219  }
18220  const unescapeString = arg => {
18221    return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(arg);
18222  };
18223  
18224  /**
18225   * Returns a term object with name unescaped.
18226   *
18227   * @param {Object} term The term object to unescape.
18228   *
18229   * @return {Object} Term object with name property unescaped.
18230   */
18231  const unescapeTerm = term => {
18232    return {
18233      ...term,
18234      name: unescapeString(term.name)
18235    };
18236  };
18237  
18238  /**
18239   * Returns an array of term objects with names unescaped.
18240   * The unescape of each term is performed using the unescapeTerm function.
18241   *
18242   * @param {Object[]} terms Array of term objects to unescape.
18243   *
18244   * @return {Object[]} Array of term objects unescaped.
18245   */
18246  const unescapeTerms = terms => {
18247    return (terms !== null && terms !== void 0 ? terms : []).map(unescapeTerm);
18248  };
18249  
18250  ;// ./node_modules/@wordpress/editor/build-module/components/page-attributes/parent.js
18251  /**
18252   * External dependencies
18253   */
18254  
18255  
18256  /**
18257   * WordPress dependencies
18258   */
18259  
18260  
18261  
18262  
18263  
18264  
18265  
18266  
18267  
18268  
18269  /**
18270   * Internal dependencies
18271   */
18272  
18273  
18274  
18275  
18276  function getTitle(post) {
18277    return post?.title?.rendered ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(post.title.rendered) : `#$post.id} (${(0,external_wp_i18n_namespaceObject.__)('no title')})`;
18278  }
18279  const parent_getItemPriority = (name, searchValue) => {
18280    const normalizedName = remove_accents_default()(name || '').toLowerCase();
18281    const normalizedSearch = remove_accents_default()(searchValue || '').toLowerCase();
18282    if (normalizedName === normalizedSearch) {
18283      return 0;
18284    }
18285    if (normalizedName.startsWith(normalizedSearch)) {
18286      return normalizedName.length;
18287    }
18288    return Infinity;
18289  };
18290  
18291  /**
18292   * Renders the Page Attributes Parent component. A dropdown menu in an editor interface
18293   * for selecting the parent page of a given page.
18294   *
18295   * @return {React.ReactNode} The component to be rendered. Return null if post type is not hierarchical.
18296   */
18297  function parent_PageAttributesParent() {
18298    const {
18299      editPost
18300    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
18301    const [fieldValue, setFieldValue] = (0,external_wp_element_namespaceObject.useState)(false);
18302    const {
18303      isHierarchical,
18304      parentPostId,
18305      parentPostTitle,
18306      pageItems,
18307      isLoading
18308    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
18309      var _pType$hierarchical;
18310      const {
18311        getPostType,
18312        getEntityRecords,
18313        getEntityRecord,
18314        isResolving
18315      } = select(external_wp_coreData_namespaceObject.store);
18316      const {
18317        getCurrentPostId,
18318        getEditedPostAttribute
18319      } = select(store_store);
18320      const postTypeSlug = getEditedPostAttribute('type');
18321      const pageId = getEditedPostAttribute('parent');
18322      const pType = getPostType(postTypeSlug);
18323      const postId = getCurrentPostId();
18324      const postIsHierarchical = (_pType$hierarchical = pType?.hierarchical) !== null && _pType$hierarchical !== void 0 ? _pType$hierarchical : false;
18325      const query = {
18326        per_page: 100,
18327        exclude: postId,
18328        parent_exclude: postId,
18329        orderby: 'menu_order',
18330        order: 'asc',
18331        _fields: 'id,title,parent'
18332      };
18333  
18334      // Perform a search when the field is changed.
18335      if (!!fieldValue) {
18336        query.search = fieldValue;
18337      }
18338      const parentPost = pageId ? getEntityRecord('postType', postTypeSlug, pageId) : null;
18339      return {
18340        isHierarchical: postIsHierarchical,
18341        parentPostId: pageId,
18342        parentPostTitle: parentPost ? getTitle(parentPost) : '',
18343        pageItems: postIsHierarchical ? getEntityRecords('postType', postTypeSlug, query) : null,
18344        isLoading: postIsHierarchical ? isResolving('getEntityRecords', ['postType', postTypeSlug, query]) : false
18345      };
18346    }, [fieldValue]);
18347    const parentOptions = (0,external_wp_element_namespaceObject.useMemo)(() => {
18348      const getOptionsFromTree = (tree, level = 0) => {
18349        const mappedNodes = tree.map(treeNode => [{
18350          value: treeNode.id,
18351          label: '— '.repeat(level) + (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(treeNode.name),
18352          rawName: treeNode.name
18353        }, ...getOptionsFromTree(treeNode.children || [], level + 1)]);
18354        const sortedNodes = mappedNodes.sort(([a], [b]) => {
18355          const priorityA = parent_getItemPriority(a.rawName, fieldValue);
18356          const priorityB = parent_getItemPriority(b.rawName, fieldValue);
18357          return priorityA >= priorityB ? 1 : -1;
18358        });
18359        return sortedNodes.flat();
18360      };
18361      if (!pageItems) {
18362        return [];
18363      }
18364      let tree = pageItems.map(item => ({
18365        id: item.id,
18366        parent: item.parent,
18367        name: getTitle(item)
18368      }));
18369  
18370      // Only build a hierarchical tree when not searching.
18371      if (!fieldValue) {
18372        tree = terms_buildTermsTree(tree);
18373      }
18374      const opts = getOptionsFromTree(tree);
18375  
18376      // Ensure the current parent is in the options list.
18377      const optsHasParent = opts.find(item => item.value === parentPostId);
18378      if (parentPostTitle && !optsHasParent) {
18379        opts.unshift({
18380          value: parentPostId,
18381          label: parentPostTitle
18382        });
18383      }
18384      return opts;
18385    }, [pageItems, fieldValue, parentPostTitle, parentPostId]);
18386    if (!isHierarchical) {
18387      return null;
18388    }
18389    /**
18390     * Handle user input.
18391     *
18392     * @param {string} inputValue The current value of the input field.
18393     */
18394    const handleKeydown = inputValue => {
18395      setFieldValue(inputValue);
18396    };
18397  
18398    /**
18399     * Handle author selection.
18400     *
18401     * @param {Object} selectedPostId The selected Author.
18402     */
18403    const handleChange = selectedPostId => {
18404      editPost({
18405        parent: selectedPostId
18406      });
18407    };
18408    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ComboboxControl, {
18409      __nextHasNoMarginBottom: true,
18410      __next40pxDefaultSize: true,
18411      className: "editor-page-attributes__parent",
18412      label: (0,external_wp_i18n_namespaceObject.__)('Parent'),
18413      help: (0,external_wp_i18n_namespaceObject.__)('Choose a parent page.'),
18414      value: parentPostId,
18415      options: parentOptions,
18416      onFilterValueChange: (0,external_wp_compose_namespaceObject.debounce)(handleKeydown, 300),
18417      onChange: handleChange,
18418      hideLabelFromVision: true,
18419      isLoading: isLoading
18420    });
18421  }
18422  function PostParentToggle({
18423    isOpen,
18424    onClick
18425  }) {
18426    const parentPost = (0,external_wp_data_namespaceObject.useSelect)(select => {
18427      const {
18428        getEditedPostAttribute
18429      } = select(store_store);
18430      const parentPostId = getEditedPostAttribute('parent');
18431      if (!parentPostId) {
18432        return null;
18433      }
18434      const {
18435        getEntityRecord
18436      } = select(external_wp_coreData_namespaceObject.store);
18437      const postTypeSlug = getEditedPostAttribute('type');
18438      return getEntityRecord('postType', postTypeSlug, parentPostId);
18439    }, []);
18440    const parentTitle = (0,external_wp_element_namespaceObject.useMemo)(() => !parentPost ? (0,external_wp_i18n_namespaceObject.__)('None') : getTitle(parentPost), [parentPost]);
18441    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
18442      size: "compact",
18443      className: "editor-post-parent__panel-toggle",
18444      variant: "tertiary",
18445      "aria-expanded": isOpen,
18446      "aria-label":
18447      // translators: %s: Current post parent.
18448      (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Change parent: %s'), parentTitle),
18449      onClick: onClick,
18450      children: parentTitle
18451    });
18452  }
18453  function ParentRow() {
18454    const homeUrl = (0,external_wp_data_namespaceObject.useSelect)(select => {
18455      // Site index.
18456      return select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.home;
18457    }, []);
18458    // Use internal state instead of a ref to make sure that the component
18459    // re-renders when the popover's anchor updates.
18460    const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
18461    // Memoize popoverProps to avoid returning a new object every time.
18462    const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
18463      // Anchor the popover to the middle of the entire row so that it doesn't
18464      // move around when the label changes.
18465      anchor: popoverAnchor,
18466      placement: 'left-start',
18467      offset: 36,
18468      shift: true
18469    }), [popoverAnchor]);
18470    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
18471      label: (0,external_wp_i18n_namespaceObject.__)('Parent'),
18472      ref: setPopoverAnchor,
18473      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
18474        popoverProps: popoverProps,
18475        className: "editor-post-parent__panel-dropdown",
18476        contentClassName: "editor-post-parent__panel-dialog",
18477        focusOnMount: true,
18478        renderToggle: ({
18479          isOpen,
18480          onToggle
18481        }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostParentToggle, {
18482          isOpen: isOpen,
18483          onClick: onToggle
18484        }),
18485        renderContent: ({
18486          onClose
18487        }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
18488          className: "editor-post-parent",
18489          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
18490            title: (0,external_wp_i18n_namespaceObject.__)('Parent'),
18491            onClose: onClose
18492          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
18493            children: [(0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: The home URL of the WordPress installation without the scheme. */
18494            (0,external_wp_i18n_namespaceObject.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %s<wbr />/services<wbr />/pricing.'), (0,external_wp_url_namespaceObject.filterURLForDisplay)(homeUrl).replace(/([/.])/g, '<wbr />$1')), {
18495              wbr: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("wbr", {})
18496            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
18497              children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('They also show up as sub-items in the default navigation menu. <a>Learn more.</a>'), {
18498                a: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
18499                  href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes')
18500                })
18501              })
18502            })]
18503          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(parent_PageAttributesParent, {})]
18504        })
18505      })
18506    });
18507  }
18508  /* harmony default export */ const page_attributes_parent = (parent_PageAttributesParent);
18509  
18510  ;// ./node_modules/@wordpress/editor/build-module/components/page-attributes/panel.js
18511  /**
18512   * WordPress dependencies
18513   */
18514  
18515  
18516  /**
18517   * Internal dependencies
18518   */
18519  
18520  
18521  
18522  
18523  const PANEL_NAME = 'page-attributes';
18524  function AttributesPanel() {
18525    const {
18526      isEnabled,
18527      postType
18528    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
18529      const {
18530        getEditedPostAttribute,
18531        isEditorPanelEnabled
18532      } = select(store_store);
18533      const {
18534        getPostType
18535      } = select(external_wp_coreData_namespaceObject.store);
18536      return {
18537        isEnabled: isEditorPanelEnabled(PANEL_NAME),
18538        postType: getPostType(getEditedPostAttribute('type'))
18539      };
18540    }, []);
18541    if (!isEnabled || !postType) {
18542      return null;
18543    }
18544    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ParentRow, {});
18545  }
18546  
18547  /**
18548   * Renders the Page Attributes Panel component.
18549   *
18550   * @return {React.ReactNode} The rendered component.
18551   */
18552  function PageAttributesPanel() {
18553    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(page_attributes_check, {
18554      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AttributesPanel, {})
18555    });
18556  }
18557  
18558  ;// ./node_modules/@wordpress/icons/build-module/library/add-template.js
18559  /**
18560   * WordPress dependencies
18561   */
18562  
18563  
18564  const addTemplate = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
18565    viewBox: "0 0 24 24",
18566    xmlns: "http://www.w3.org/2000/svg",
18567    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
18568      fillRule: "evenodd",
18569      clipRule: "evenodd",
18570      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"
18571    })
18572  });
18573  /* harmony default export */ const add_template = (addTemplate);
18574  
18575  ;// ./node_modules/@wordpress/editor/build-module/components/post-template/create-new-template-modal.js
18576  /**
18577   * WordPress dependencies
18578   */
18579  
18580  
18581  
18582  
18583  
18584  
18585  
18586  /**
18587   * Internal dependencies
18588   */
18589  
18590  
18591  
18592  const DEFAULT_TITLE = (0,external_wp_i18n_namespaceObject.__)('Custom Template');
18593  function CreateNewTemplateModal({
18594    onClose
18595  }) {
18596    const {
18597      defaultBlockTemplate,
18598      onNavigateToEntityRecord
18599    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
18600      const {
18601        getEditorSettings,
18602        getCurrentTemplateId
18603      } = select(store_store);
18604      return {
18605        defaultBlockTemplate: getEditorSettings().defaultBlockTemplate,
18606        onNavigateToEntityRecord: getEditorSettings().onNavigateToEntityRecord,
18607        getTemplateId: getCurrentTemplateId
18608      };
18609    });
18610    const {
18611      createTemplate
18612    } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
18613    const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)('');
18614    const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false);
18615    const cancel = () => {
18616      setTitle('');
18617      onClose();
18618    };
18619    const submit = async event => {
18620      event.preventDefault();
18621      if (isBusy) {
18622        return;
18623      }
18624      setIsBusy(true);
18625      const newTemplateContent = defaultBlockTemplate !== null && defaultBlockTemplate !== void 0 ? defaultBlockTemplate : (0,external_wp_blocks_namespaceObject.serialize)([(0,external_wp_blocks_namespaceObject.createBlock)('core/group', {
18626        tagName: 'header',
18627        layout: {
18628          inherit: true
18629        }
18630      }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/site-title'), (0,external_wp_blocks_namespaceObject.createBlock)('core/site-tagline')]), (0,external_wp_blocks_namespaceObject.createBlock)('core/separator'), (0,external_wp_blocks_namespaceObject.createBlock)('core/group', {
18631        tagName: 'main'
18632      }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/group', {
18633        layout: {
18634          inherit: true
18635        }
18636      }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/post-title')]), (0,external_wp_blocks_namespaceObject.createBlock)('core/post-content', {
18637        layout: {
18638          inherit: true
18639        }
18640      })])]);
18641      const newTemplate = await createTemplate({
18642        slug: (0,external_wp_url_namespaceObject.cleanForSlug)(title || DEFAULT_TITLE),
18643        content: newTemplateContent,
18644        title: title || DEFAULT_TITLE
18645      });
18646      setIsBusy(false);
18647      onNavigateToEntityRecord({
18648        postId: newTemplate.id,
18649        postType: 'wp_template'
18650      });
18651      cancel();
18652    };
18653    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
18654      title: (0,external_wp_i18n_namespaceObject.__)('Create custom template'),
18655      onRequestClose: cancel,
18656      focusOnMount: "firstContentElement",
18657      size: "small",
18658      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
18659        className: "editor-post-template__create-form",
18660        onSubmit: submit,
18661        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
18662          spacing: "3",
18663          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
18664            __next40pxDefaultSize: true,
18665            __nextHasNoMarginBottom: true,
18666            label: (0,external_wp_i18n_namespaceObject.__)('Name'),
18667            value: title,
18668            onChange: setTitle,
18669            placeholder: DEFAULT_TITLE,
18670            disabled: isBusy,
18671            help: (0,external_wp_i18n_namespaceObject.__)(
18672            // eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts
18673            'Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')
18674          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
18675            justify: "right",
18676            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
18677              __next40pxDefaultSize: true,
18678              variant: "tertiary",
18679              onClick: cancel,
18680              children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
18681            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
18682              __next40pxDefaultSize: true,
18683              variant: "primary",
18684              type: "submit",
18685              isBusy: isBusy,
18686              "aria-disabled": isBusy,
18687              children: (0,external_wp_i18n_namespaceObject.__)('Create')
18688            })]
18689          })]
18690        })
18691      })
18692    });
18693  }
18694  
18695  ;// ./node_modules/@wordpress/editor/build-module/components/post-template/hooks.js
18696  /**
18697   * WordPress dependencies
18698   */
18699  
18700  
18701  
18702  
18703  /**
18704   * Internal dependencies
18705   */
18706  
18707  function useEditedPostContext() {
18708    return (0,external_wp_data_namespaceObject.useSelect)(select => {
18709      const {
18710        getCurrentPostId,
18711        getCurrentPostType
18712      } = select(store_store);
18713      return {
18714        postId: getCurrentPostId(),
18715        postType: getCurrentPostType()
18716      };
18717    }, []);
18718  }
18719  function useAllowSwitchingTemplates() {
18720    const {
18721      postType,
18722      postId
18723    } = useEditedPostContext();
18724    return (0,external_wp_data_namespaceObject.useSelect)(select => {
18725      const {
18726        canUser,
18727        getEntityRecord,
18728        getEntityRecords
18729      } = select(external_wp_coreData_namespaceObject.store);
18730      const siteSettings = canUser('read', {
18731        kind: 'root',
18732        name: 'site'
18733      }) ? getEntityRecord('root', 'site') : undefined;
18734      const templates = getEntityRecords('postType', 'wp_template', {
18735        per_page: -1
18736      });
18737      const isPostsPage = +postId === siteSettings?.page_for_posts;
18738      // If current page is set front page or posts page, we also need
18739      // to check if the current theme has a template for it. If not
18740      const isFrontPage = postType === 'page' && +postId === siteSettings?.page_on_front && templates?.some(({
18741        slug
18742      }) => slug === 'front-page');
18743      return !isPostsPage && !isFrontPage;
18744    }, [postId, postType]);
18745  }
18746  function useTemplates(postType) {
18747    return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', 'wp_template', {
18748      per_page: -1,
18749      post_type: postType
18750    }), [postType]);
18751  }
18752  function useAvailableTemplates(postType) {
18753    const currentTemplateSlug = useCurrentTemplateSlug();
18754    const allowSwitchingTemplate = useAllowSwitchingTemplates();
18755    const templates = useTemplates(postType);
18756    return (0,external_wp_element_namespaceObject.useMemo)(() => allowSwitchingTemplate && templates?.filter(template => template.is_custom && template.slug !== currentTemplateSlug && !!template.content.raw // Skip empty templates.
18757    ), [templates, currentTemplateSlug, allowSwitchingTemplate]);
18758  }
18759  function useCurrentTemplateSlug() {
18760    const {
18761      postType,
18762      postId
18763    } = useEditedPostContext();
18764    const templates = useTemplates(postType);
18765    const entityTemplate = (0,external_wp_data_namespaceObject.useSelect)(select => {
18766      const post = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', postType, postId);
18767      return post?.template;
18768    }, [postType, postId]);
18769    if (!entityTemplate) {
18770      return;
18771    }
18772    // If a page has a `template` set and is not included in the list
18773    // of the theme's templates, do not return it, in order to resolve
18774    // to the current theme's default template.
18775    return templates?.find(template => template.slug === entityTemplate)?.slug;
18776  }
18777  
18778  ;// ./node_modules/@wordpress/editor/build-module/components/post-template/classic-theme.js
18779  /**
18780   * WordPress dependencies
18781   */
18782  
18783  
18784  
18785  
18786  
18787  
18788  
18789  
18790  
18791  /**
18792   * Internal dependencies
18793   */
18794  
18795  
18796  
18797  
18798  
18799  function PostTemplateToggle({
18800    isOpen,
18801    onClick
18802  }) {
18803    const templateTitle = (0,external_wp_data_namespaceObject.useSelect)(select => {
18804      const templateSlug = select(store_store).getEditedPostAttribute('template');
18805      const {
18806        supportsTemplateMode,
18807        availableTemplates
18808      } = select(store_store).getEditorSettings();
18809      if (!supportsTemplateMode && availableTemplates[templateSlug]) {
18810        return availableTemplates[templateSlug];
18811      }
18812      const template = select(external_wp_coreData_namespaceObject.store).canUser('create', {
18813        kind: 'postType',
18814        name: 'wp_template'
18815      }) && select(store_store).getCurrentTemplateId();
18816      return template?.title || template?.slug || availableTemplates?.[templateSlug];
18817    }, []);
18818    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
18819      __next40pxDefaultSize: true,
18820      variant: "tertiary",
18821      "aria-expanded": isOpen,
18822      "aria-label": (0,external_wp_i18n_namespaceObject.__)('Template options'),
18823      onClick: onClick,
18824      children: templateTitle !== null && templateTitle !== void 0 ? templateTitle : (0,external_wp_i18n_namespaceObject.__)('Default template')
18825    });
18826  }
18827  
18828  /**
18829   * Renders the dropdown content for selecting a post template.
18830   *
18831   * @param {Object}   props         The component props.
18832   * @param {Function} props.onClose The function to close the dropdown.
18833   *
18834   * @return {React.ReactNode} The rendered dropdown content.
18835   */
18836  function PostTemplateDropdownContent({
18837    onClose
18838  }) {
18839    var _options$find, _selectedOption$value;
18840    const allowSwitchingTemplate = useAllowSwitchingTemplates();
18841    const {
18842      availableTemplates,
18843      fetchedTemplates,
18844      selectedTemplateSlug,
18845      canCreate,
18846      canEdit,
18847      currentTemplateId,
18848      onNavigateToEntityRecord,
18849      getEditorSettings
18850    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
18851      const {
18852        canUser,
18853        getEntityRecords
18854      } = select(external_wp_coreData_namespaceObject.store);
18855      const editorSettings = select(store_store).getEditorSettings();
18856      const canCreateTemplates = canUser('create', {
18857        kind: 'postType',
18858        name: 'wp_template'
18859      });
18860      const _currentTemplateId = select(store_store).getCurrentTemplateId();
18861      return {
18862        availableTemplates: editorSettings.availableTemplates,
18863        fetchedTemplates: canCreateTemplates ? getEntityRecords('postType', 'wp_template', {
18864          post_type: select(store_store).getCurrentPostType(),
18865          per_page: -1
18866        }) : undefined,
18867        selectedTemplateSlug: select(store_store).getEditedPostAttribute('template'),
18868        canCreate: allowSwitchingTemplate && canCreateTemplates && editorSettings.supportsTemplateMode,
18869        canEdit: allowSwitchingTemplate && canCreateTemplates && editorSettings.supportsTemplateMode && !!_currentTemplateId,
18870        currentTemplateId: _currentTemplateId,
18871        onNavigateToEntityRecord: editorSettings.onNavigateToEntityRecord,
18872        getEditorSettings: select(store_store).getEditorSettings
18873      };
18874    }, [allowSwitchingTemplate]);
18875    const options = (0,external_wp_element_namespaceObject.useMemo)(() => Object.entries({
18876      ...availableTemplates,
18877      ...Object.fromEntries((fetchedTemplates !== null && fetchedTemplates !== void 0 ? fetchedTemplates : []).map(({
18878        slug,
18879        title
18880      }) => [slug, title.rendered]))
18881    }).map(([slug, title]) => ({
18882      value: slug,
18883      label: title
18884    })), [availableTemplates, fetchedTemplates]);
18885    const selectedOption = (_options$find = options.find(option => option.value === selectedTemplateSlug)) !== null && _options$find !== void 0 ? _options$find : options.find(option => !option.value); // The default option has '' value.
18886  
18887    const {
18888      editPost
18889    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
18890    const {
18891      createSuccessNotice
18892    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
18893    const [isCreateModalOpen, setIsCreateModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
18894    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
18895      className: "editor-post-template__classic-theme-dropdown",
18896      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
18897        title: (0,external_wp_i18n_namespaceObject.__)('Template'),
18898        help: (0,external_wp_i18n_namespaceObject.__)('Templates define the way content is displayed when viewing your site.'),
18899        actions: canCreate ? [{
18900          icon: add_template,
18901          label: (0,external_wp_i18n_namespaceObject.__)('Add template'),
18902          onClick: () => setIsCreateModalOpen(true)
18903        }] : [],
18904        onClose: onClose
18905      }), !allowSwitchingTemplate ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, {
18906        status: "warning",
18907        isDismissible: false,
18908        children: (0,external_wp_i18n_namespaceObject.__)('The posts page template cannot be changed.')
18909      }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, {
18910        __next40pxDefaultSize: true,
18911        __nextHasNoMarginBottom: true,
18912        hideLabelFromVision: true,
18913        label: (0,external_wp_i18n_namespaceObject.__)('Template'),
18914        value: (_selectedOption$value = selectedOption?.value) !== null && _selectedOption$value !== void 0 ? _selectedOption$value : '',
18915        options: options,
18916        onChange: slug => editPost({
18917          template: slug || ''
18918        })
18919      }), canEdit && onNavigateToEntityRecord && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
18920        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
18921          __next40pxDefaultSize: true,
18922          variant: "link",
18923          onClick: () => {
18924            onNavigateToEntityRecord({
18925              postId: currentTemplateId,
18926              postType: 'wp_template'
18927            });
18928            onClose();
18929            createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Editing template. Changes made here affect all posts and pages that use the template.'), {
18930              type: 'snackbar',
18931              actions: [{
18932                label: (0,external_wp_i18n_namespaceObject.__)('Go back'),
18933                onClick: () => getEditorSettings().onNavigateToPreviousEntityRecord()
18934              }]
18935            });
18936          },
18937          children: (0,external_wp_i18n_namespaceObject.__)('Edit template')
18938        })
18939      }), isCreateModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreateNewTemplateModal, {
18940        onClose: () => setIsCreateModalOpen(false)
18941      })]
18942    });
18943  }
18944  function ClassicThemeControl() {
18945    const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
18946    // Memoize popoverProps to avoid returning a new object every time.
18947    const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
18948      // Anchor the popover to the middle of the entire row so that it doesn't
18949      // move around when the label changes.
18950      anchor: popoverAnchor,
18951      className: 'editor-post-template__dropdown',
18952      placement: 'left-start',
18953      offset: 36,
18954      shift: true
18955    }), [popoverAnchor]);
18956    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
18957      label: (0,external_wp_i18n_namespaceObject.__)('Template'),
18958      ref: setPopoverAnchor,
18959      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
18960        popoverProps: popoverProps,
18961        focusOnMount: true,
18962        renderToggle: ({
18963          isOpen,
18964          onToggle
18965        }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTemplateToggle, {
18966          isOpen: isOpen,
18967          onClick: onToggle
18968        }),
18969        renderContent: ({
18970          onClose
18971        }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTemplateDropdownContent, {
18972          onClose: onClose
18973        })
18974      })
18975    });
18976  }
18977  
18978  /**
18979   * Provides a dropdown menu for selecting and managing post templates.
18980   *
18981   * The dropdown menu includes a button for toggling the menu, a list of available templates, and options for creating and editing templates.
18982   *
18983   * @return {React.ReactNode} The rendered ClassicThemeControl component.
18984   */
18985  /* harmony default export */ const classic_theme = (ClassicThemeControl);
18986  
18987  ;// external ["wp","warning"]
18988  const external_wp_warning_namespaceObject = window["wp"]["warning"];
18989  var external_wp_warning_default = /*#__PURE__*/__webpack_require__.n(external_wp_warning_namespaceObject);
18990  ;// ./node_modules/@wordpress/editor/build-module/components/preferences-modal/enable-panel.js
18991  /**
18992   * WordPress dependencies
18993   */
18994  
18995  
18996  
18997  /**
18998   * Internal dependencies
18999   */
19000  
19001  
19002  
19003  const {
19004    PreferenceBaseOption
19005  } = unlock(external_wp_preferences_namespaceObject.privateApis);
19006  function EnablePanelOption(props) {
19007    const {
19008      toggleEditorPanelEnabled
19009    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
19010    const {
19011      isChecked,
19012      isRemoved
19013    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
19014      const {
19015        isEditorPanelEnabled,
19016        isEditorPanelRemoved
19017      } = select(store_store);
19018      return {
19019        isChecked: isEditorPanelEnabled(props.panelName),
19020        isRemoved: isEditorPanelRemoved(props.panelName)
19021      };
19022    }, [props.panelName]);
19023    if (isRemoved) {
19024      return null;
19025    }
19026    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceBaseOption, {
19027      isChecked: isChecked,
19028      onChange: () => toggleEditorPanelEnabled(props.panelName),
19029      ...props
19030    });
19031  }
19032  
19033  ;// ./node_modules/@wordpress/editor/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js
19034  /**
19035   * WordPress dependencies
19036   */
19037  
19038  
19039  /**
19040   * Internal dependencies
19041   */
19042  
19043  
19044  const {
19045    Fill,
19046    Slot
19047  } = (0,external_wp_components_namespaceObject.createSlotFill)('EnablePluginDocumentSettingPanelOption');
19048  const EnablePluginDocumentSettingPanelOption = ({
19049    label,
19050    panelName
19051  }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Fill, {
19052    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePanelOption, {
19053      label: label,
19054      panelName: panelName
19055    })
19056  });
19057  EnablePluginDocumentSettingPanelOption.Slot = Slot;
19058  /* harmony default export */ const enable_plugin_document_setting_panel = (EnablePluginDocumentSettingPanelOption);
19059  
19060  ;// ./node_modules/@wordpress/editor/build-module/components/plugin-document-setting-panel/index.js
19061  /**
19062   * WordPress dependencies
19063   */
19064  
19065  
19066  
19067  
19068  
19069  /**
19070   * Internal dependencies
19071   */
19072  
19073  
19074  
19075  const {
19076    Fill: plugin_document_setting_panel_Fill,
19077    Slot: plugin_document_setting_panel_Slot
19078  } = (0,external_wp_components_namespaceObject.createSlotFill)('PluginDocumentSettingPanel');
19079  
19080  /**
19081   * Renders items below the Status & Availability panel in the Document Sidebar.
19082   *
19083   * @param {Object}                props                                 Component properties.
19084   * @param {string}                props.name                            Required. A machine-friendly name for the panel.
19085   * @param {string}                [props.className]                     An optional class name added to the row.
19086   * @param {string}                [props.title]                         The title of the panel
19087   * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
19088   * @param {React.ReactNode}       props.children                        Children to be rendered
19089   *
19090   * @example
19091   * ```js
19092   * // Using ES5 syntax
19093   * var el = React.createElement;
19094   * var __ = wp.i18n.__;
19095   * var registerPlugin = wp.plugins.registerPlugin;
19096   * var PluginDocumentSettingPanel = wp.editor.PluginDocumentSettingPanel;
19097   *
19098   * function MyDocumentSettingPlugin() {
19099   *     return el(
19100   *         PluginDocumentSettingPanel,
19101   *         {
19102   *             className: 'my-document-setting-plugin',
19103   *             title: 'My Panel',
19104   *             name: 'my-panel',
19105   *         },
19106   *         __( 'My Document Setting Panel' )
19107   *     );
19108   * }
19109   *
19110   * registerPlugin( 'my-document-setting-plugin', {
19111   *         render: MyDocumentSettingPlugin
19112   * } );
19113   * ```
19114   *
19115   * @example
19116   * ```jsx
19117   * // Using ESNext syntax
19118   * import { registerPlugin } from '@wordpress/plugins';
19119   * import { PluginDocumentSettingPanel } from '@wordpress/editor';
19120   *
19121   * const MyDocumentSettingTest = () => (
19122   *         <PluginDocumentSettingPanel className="my-document-setting-plugin" title="My Panel" name="my-panel">
19123   *            <p>My Document Setting Panel</p>
19124   *        </PluginDocumentSettingPanel>
19125   *    );
19126   *
19127   *  registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );
19128   * ```
19129   *
19130   * @return {React.ReactNode} The component to be rendered.
19131   */
19132  const PluginDocumentSettingPanel = ({
19133    name,
19134    className,
19135    title,
19136    icon,
19137    children
19138  }) => {
19139    const {
19140      name: pluginName
19141    } = (0,external_wp_plugins_namespaceObject.usePluginContext)();
19142    const panelName = `$pluginName}/$name}`;
19143    const {
19144      opened,
19145      isEnabled
19146    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
19147      const {
19148        isEditorPanelOpened,
19149        isEditorPanelEnabled
19150      } = select(store_store);
19151      return {
19152        opened: isEditorPanelOpened(panelName),
19153        isEnabled: isEditorPanelEnabled(panelName)
19154      };
19155    }, [panelName]);
19156    const {
19157      toggleEditorPanelOpened
19158    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
19159    if (undefined === name) {
19160       true ? external_wp_warning_default()('PluginDocumentSettingPanel requires a name property.') : 0;
19161    }
19162    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
19163      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_plugin_document_setting_panel, {
19164        label: title,
19165        panelName: panelName
19166      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_document_setting_panel_Fill, {
19167        children: isEnabled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
19168          className: className,
19169          title: title,
19170          icon: icon,
19171          opened: opened,
19172          onToggle: () => toggleEditorPanelOpened(panelName),
19173          children: children
19174        })
19175      })]
19176    });
19177  };
19178  PluginDocumentSettingPanel.Slot = plugin_document_setting_panel_Slot;
19179  /* harmony default export */ const plugin_document_setting_panel = (PluginDocumentSettingPanel);
19180  
19181  ;// ./node_modules/@wordpress/editor/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js
19182  /**
19183   * WordPress dependencies
19184   */
19185  
19186  
19187  
19188  
19189  const isEverySelectedBlockAllowed = (selected, allowed) => selected.filter(id => !allowed.includes(id)).length === 0;
19190  
19191  /**
19192   * Plugins may want to add an item to the menu either for every block
19193   * or only for the specific ones provided in the `allowedBlocks` component property.
19194   *
19195   * If there are multiple blocks selected the item will be rendered if every block
19196   * is of one allowed type (not necessarily the same).
19197   *
19198   * @param {string[]} selectedBlocks Array containing the names of the blocks selected
19199   * @param {string[]} allowedBlocks  Array containing the names of the blocks allowed
19200   * @return {boolean} Whether the item will be rendered or not.
19201   */
19202  const shouldRenderItem = (selectedBlocks, allowedBlocks) => !Array.isArray(allowedBlocks) || isEverySelectedBlockAllowed(selectedBlocks, allowedBlocks);
19203  
19204  /**
19205   * Renders a new item in the block settings menu.
19206   *
19207   * @param {Object}                props                 Component props.
19208   * @param {Array}                 [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.
19209   * @param {WPBlockTypeIconRender} [props.icon]          The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.
19210   * @param {string}                props.label           The menu item text.
19211   * @param {Function}              props.onClick         Callback function to be executed when the user click the menu item.
19212   * @param {boolean}               [props.small]         Whether to render the label or not.
19213   * @param {string}                [props.role]          The ARIA role for the menu item.
19214   *
19215   * @example
19216   * ```js
19217   * // Using ES5 syntax
19218   * var __ = wp.i18n.__;
19219   * var PluginBlockSettingsMenuItem = wp.editor.PluginBlockSettingsMenuItem;
19220   *
19221   * function doOnClick(){
19222   *     // To be called when the user clicks the menu item.
19223   * }
19224   *
19225   * function MyPluginBlockSettingsMenuItem() {
19226   *     return React.createElement(
19227   *         PluginBlockSettingsMenuItem,
19228   *         {
19229   *             allowedBlocks: [ 'core/paragraph' ],
19230   *             icon: 'dashicon-name',
19231   *             label: __( 'Menu item text' ),
19232   *             onClick: doOnClick,
19233   *         }
19234   *     );
19235   * }
19236   * ```
19237   *
19238   * @example
19239   * ```jsx
19240   * // Using ESNext syntax
19241   * import { __ } from '@wordpress/i18n';
19242   * import { PluginBlockSettingsMenuItem } from '@wordpress/editor';
19243   *
19244   * const doOnClick = ( ) => {
19245   *     // To be called when the user clicks the menu item.
19246   * };
19247   *
19248   * const MyPluginBlockSettingsMenuItem = () => (
19249   *     <PluginBlockSettingsMenuItem
19250   *         allowedBlocks={ [ 'core/paragraph' ] }
19251   *         icon='dashicon-name'
19252   *         label={ __( 'Menu item text' ) }
19253   *         onClick={ doOnClick } />
19254   * );
19255   * ```
19256   *
19257   * @return {React.ReactNode} The rendered component.
19258   */
19259  const PluginBlockSettingsMenuItem = ({
19260    allowedBlocks,
19261    icon,
19262    label,
19263    onClick,
19264    small,
19265    role
19266  }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, {
19267    children: ({
19268      selectedBlocks,
19269      onClose
19270    }) => {
19271      if (!shouldRenderItem(selectedBlocks, allowedBlocks)) {
19272        return null;
19273      }
19274      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
19275        onClick: (0,external_wp_compose_namespaceObject.compose)(onClick, onClose),
19276        icon: icon,
19277        label: small ? label : undefined,
19278        role: role,
19279        children: !small && label
19280      });
19281    }
19282  });
19283  /* harmony default export */ const plugin_block_settings_menu_item = (PluginBlockSettingsMenuItem);
19284  
19285  ;// ./node_modules/@wordpress/editor/build-module/components/plugin-more-menu-item/index.js
19286  /**
19287   * WordPress dependencies
19288   */
19289  
19290  
19291  
19292  
19293  /**
19294   * Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to as a button or link depending on the props provided.
19295   * The text within the component appears as the menu item label.
19296   *
19297   * @param {Object}                props                                 Component properties.
19298   * @param {React.ReactNode}       [props.children]                      Children to be rendered.
19299   * @param {string}                [props.href]                          When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor.
19300   * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
19301   * @param {Function}              [props.onClick=noop]                  The callback function to be executed when the user clicks the menu item.
19302   * @param {...*}                  [props.other]                         Any additional props are passed through to the underlying [Button](/packages/components/src/button/README.md) component.
19303   *
19304   * @example
19305   * ```js
19306   * // Using ES5 syntax
19307   * var __ = wp.i18n.__;
19308   * var PluginMoreMenuItem = wp.editor.PluginMoreMenuItem;
19309   * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.
19310   *
19311   * function onButtonClick() {
19312   *     alert( 'Button clicked.' );
19313   * }
19314   *
19315   * function MyButtonMoreMenuItem() {
19316   *     return wp.element.createElement(
19317   *         PluginMoreMenuItem,
19318   *         {
19319   *             icon: moreIcon,
19320   *             onClick: onButtonClick,
19321   *         },
19322   *         __( 'My button title' )
19323   *     );
19324   * }
19325   * ```
19326   *
19327   * @example
19328   * ```jsx
19329   * // Using ESNext syntax
19330   * import { __ } from '@wordpress/i18n';
19331   * import { PluginMoreMenuItem } from '@wordpress/editor';
19332   * import { more } from '@wordpress/icons';
19333   *
19334   * function onButtonClick() {
19335   *     alert( 'Button clicked.' );
19336   * }
19337   *
19338   * const MyButtonMoreMenuItem = () => (
19339   *     <PluginMoreMenuItem
19340   *         icon={ more }
19341   *         onClick={ onButtonClick }
19342   *     >
19343   *         { __( 'My button title' ) }
19344   *     </PluginMoreMenuItem>
19345   * );
19346   * ```
19347   *
19348   * @return {React.ReactNode} The rendered component.
19349   */
19350  
19351  function PluginMoreMenuItem(props) {
19352    var _props$as;
19353    const context = (0,external_wp_plugins_namespaceObject.usePluginContext)();
19354    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action_item, {
19355      name: "core/plugin-more-menu",
19356      as: (_props$as = props.as) !== null && _props$as !== void 0 ? _props$as : external_wp_components_namespaceObject.MenuItem,
19357      icon: props.icon || context.icon,
19358      ...props
19359    });
19360  }
19361  
19362  ;// ./node_modules/@wordpress/editor/build-module/components/plugin-post-publish-panel/index.js
19363  /**
19364   * WordPress dependencies
19365   */
19366  
19367  
19368  
19369  const {
19370    Fill: plugin_post_publish_panel_Fill,
19371    Slot: plugin_post_publish_panel_Slot
19372  } = (0,external_wp_components_namespaceObject.createSlotFill)('PluginPostPublishPanel');
19373  
19374  /**
19375   * Renders provided content to the post-publish panel in the publish flow
19376   * (side panel that opens after a user publishes the post).
19377   *
19378   * @param {Object}                props                                 Component properties.
19379   * @param {string}                [props.className]                     An optional class name added to the panel.
19380   * @param {string}                [props.title]                         Title displayed at the top of the panel.
19381   * @param {boolean}               [props.initialOpen=false]             Whether to have the panel initially opened. When no title is provided it is always opened.
19382   * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
19383   * @param {React.ReactNode}       props.children                        Children to be rendered
19384   *
19385   * @example
19386   * ```jsx
19387   * // Using ESNext syntax
19388   * import { __ } from '@wordpress/i18n';
19389   * import { PluginPostPublishPanel } from '@wordpress/editor';
19390   *
19391   * const MyPluginPostPublishPanel = () => (
19392   *     <PluginPostPublishPanel
19393   *         className="my-plugin-post-publish-panel"
19394   *         title={ __( 'My panel title' ) }
19395   *         initialOpen={ true }
19396   *     >
19397   *         { __( 'My panel content' ) }
19398   *     </PluginPostPublishPanel>
19399   * );
19400   * ```
19401   *
19402   * @return {React.ReactNode} The rendered component.
19403   */
19404  const PluginPostPublishPanel = ({
19405    children,
19406    className,
19407    title,
19408    initialOpen = false,
19409    icon
19410  }) => {
19411    const {
19412      icon: pluginIcon
19413    } = (0,external_wp_plugins_namespaceObject.usePluginContext)();
19414    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_post_publish_panel_Fill, {
19415      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
19416        className: className,
19417        initialOpen: initialOpen || !title,
19418        title: title,
19419        icon: icon !== null && icon !== void 0 ? icon : pluginIcon,
19420        children: children
19421      })
19422    });
19423  };
19424  PluginPostPublishPanel.Slot = plugin_post_publish_panel_Slot;
19425  /* harmony default export */ const plugin_post_publish_panel = (PluginPostPublishPanel);
19426  
19427  ;// ./node_modules/@wordpress/editor/build-module/components/plugin-post-status-info/index.js
19428  /**
19429   * Defines as extensibility slot for the Summary panel.
19430   */
19431  
19432  /**
19433   * WordPress dependencies
19434   */
19435  
19436  
19437  const {
19438    Fill: plugin_post_status_info_Fill,
19439    Slot: plugin_post_status_info_Slot
19440  } = (0,external_wp_components_namespaceObject.createSlotFill)('PluginPostStatusInfo');
19441  
19442  /**
19443   * Renders a row in the Summary panel of the Document sidebar.
19444   * It should be noted that this is named and implemented around the function it serves
19445   * and not its location, which may change in future iterations.
19446   *
19447   * @param {Object}          props             Component properties.
19448   * @param {string}          [props.className] An optional class name added to the row.
19449   * @param {React.ReactNode} props.children    Children to be rendered.
19450   *
19451   * @example
19452   * ```js
19453   * // Using ES5 syntax
19454   * var __ = wp.i18n.__;
19455   * var PluginPostStatusInfo = wp.editor.PluginPostStatusInfo;
19456   *
19457   * function MyPluginPostStatusInfo() {
19458   *     return React.createElement(
19459   *         PluginPostStatusInfo,
19460   *         {
19461   *             className: 'my-plugin-post-status-info',
19462   *         },
19463   *         __( 'My post status info' )
19464   *     )
19465   * }
19466   * ```
19467   *
19468   * @example
19469   * ```jsx
19470   * // Using ESNext syntax
19471   * import { __ } from '@wordpress/i18n';
19472   * import { PluginPostStatusInfo } from '@wordpress/editor';
19473   *
19474   * const MyPluginPostStatusInfo = () => (
19475   *     <PluginPostStatusInfo
19476   *         className="my-plugin-post-status-info"
19477   *     >
19478   *         { __( 'My post status info' ) }
19479   *     </PluginPostStatusInfo>
19480   * );
19481   * ```
19482   *
19483   * @return {React.ReactNode} The rendered component.
19484   */
19485  const PluginPostStatusInfo = ({
19486    children,
19487    className
19488  }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_post_status_info_Fill, {
19489    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelRow, {
19490      className: className,
19491      children: children
19492    })
19493  });
19494  PluginPostStatusInfo.Slot = plugin_post_status_info_Slot;
19495  /* harmony default export */ const plugin_post_status_info = (PluginPostStatusInfo);
19496  
19497  ;// ./node_modules/@wordpress/editor/build-module/components/plugin-pre-publish-panel/index.js
19498  /**
19499   * WordPress dependencies
19500   */
19501  
19502  
19503  
19504  const {
19505    Fill: plugin_pre_publish_panel_Fill,
19506    Slot: plugin_pre_publish_panel_Slot
19507  } = (0,external_wp_components_namespaceObject.createSlotFill)('PluginPrePublishPanel');
19508  
19509  /**
19510   * Renders provided content to the pre-publish side panel in the publish flow
19511   * (side panel that opens when a user first pushes "Publish" from the main editor).
19512   *
19513   * @param {Object}                props                                 Component props.
19514   * @param {string}                [props.className]                     An optional class name added to the panel.
19515   * @param {string}                [props.title]                         Title displayed at the top of the panel.
19516   * @param {boolean}               [props.initialOpen=false]             Whether to have the panel initially opened.
19517   *                                                                      When no title is provided it is always opened.
19518   * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/)
19519   *                                                                      icon slug string, or an SVG WP element, to be rendered when
19520   *                                                                      the sidebar is pinned to toolbar.
19521   * @param {React.ReactNode}       props.children                        Children to be rendered
19522   *
19523   * @example
19524   * ```jsx
19525   * // Using ESNext syntax
19526   * import { __ } from '@wordpress/i18n';
19527   * import { PluginPrePublishPanel } from '@wordpress/editor';
19528   *
19529   * const MyPluginPrePublishPanel = () => (
19530   *     <PluginPrePublishPanel
19531   *         className="my-plugin-pre-publish-panel"
19532   *         title={ __( 'My panel title' ) }
19533   *         initialOpen={ true }
19534   *     >
19535   *         { __( 'My panel content' ) }
19536   *     </PluginPrePublishPanel>
19537   * );
19538   * ```
19539   *
19540   * @return {React.ReactNode} The rendered component.
19541   */
19542  const PluginPrePublishPanel = ({
19543    children,
19544    className,
19545    title,
19546    initialOpen = false,
19547    icon
19548  }) => {
19549    const {
19550      icon: pluginIcon
19551    } = (0,external_wp_plugins_namespaceObject.usePluginContext)();
19552    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_pre_publish_panel_Fill, {
19553      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
19554        className: className,
19555        initialOpen: initialOpen || !title,
19556        title: title,
19557        icon: icon !== null && icon !== void 0 ? icon : pluginIcon,
19558        children: children
19559      })
19560    });
19561  };
19562  PluginPrePublishPanel.Slot = plugin_pre_publish_panel_Slot;
19563  /* harmony default export */ const plugin_pre_publish_panel = (PluginPrePublishPanel);
19564  
19565  ;// ./node_modules/@wordpress/editor/build-module/components/plugin-preview-menu-item/index.js
19566  /**
19567   * WordPress dependencies
19568   */
19569  
19570  
19571  
19572  
19573  /**
19574   * Renders a menu item in the Preview dropdown, which can be used as a button or link depending on the props provided.
19575   * The text within the component appears as the menu item label.
19576   *
19577   * @param {Object}                props                                 Component properties.
19578   * @param {React.ReactNode}       [props.children]                      Children to be rendered.
19579   * @param {string}                [props.href]                          When `href` is provided, the menu item is rendered as an anchor instead of a button. It corresponds to the `href` attribute of the anchor.
19580   * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The icon to be rendered to the left of the menu item label. Can be a Dashicon slug or an SVG WP element.
19581   * @param {Function}              [props.onClick]                       The callback function to be executed when the user clicks the menu item.
19582   * @param {...*}                  [props.other]                         Any additional props are passed through to the underlying MenuItem component.
19583   *
19584   * @example
19585   * ```jsx
19586   * import { __ } from '@wordpress/i18n';
19587   * import { PluginPreviewMenuItem } from '@wordpress/editor';
19588   * import { external } from '@wordpress/icons';
19589   *
19590   * function onPreviewClick() {
19591   *   // Handle preview action
19592   * }
19593   *
19594   * const ExternalPreviewMenuItem = () => (
19595   *   <PluginPreviewMenuItem
19596   *     icon={ external }
19597   *     onClick={ onPreviewClick }
19598   *   >
19599   *     { __( 'Preview in new tab' ) }
19600   *   </PluginPreviewMenuItem>
19601   * );
19602   * registerPlugin( 'external-preview-menu-item', {
19603   *     render: ExternalPreviewMenuItem,
19604   * } );
19605   * ```
19606   *
19607   * @return {React.ReactNode} The rendered menu item component.
19608   */
19609  
19610  function PluginPreviewMenuItem(props) {
19611    var _props$as;
19612    const context = (0,external_wp_plugins_namespaceObject.usePluginContext)();
19613    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action_item, {
19614      name: "core/plugin-preview-menu",
19615      as: (_props$as = props.as) !== null && _props$as !== void 0 ? _props$as : external_wp_components_namespaceObject.MenuItem,
19616      icon: props.icon || context.icon,
19617      ...props
19618    });
19619  }
19620  
19621  ;// ./node_modules/@wordpress/editor/build-module/components/plugin-sidebar/index.js
19622  /**
19623   * WordPress dependencies
19624   */
19625  
19626  
19627  /**
19628   * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.
19629   * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.
19630   * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:
19631   *
19632   * ```js
19633   * wp.data.dispatch( 'core/edit-post' ).openGeneralSidebar( 'plugin-name/sidebar-name' );
19634   * ```
19635   *
19636   * @see PluginSidebarMoreMenuItem
19637   *
19638   * @param {Object}                props                                 Element props.
19639   * @param {string}                props.name                            A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.
19640   * @param {React.ReactNode}       [props.children]                      Children to be rendered.
19641   * @param {string}                [props.className]                     An optional class name added to the sidebar body.
19642   * @param {string}                props.title                           Title displayed at the top of the sidebar.
19643   * @param {boolean}               [props.isPinnable=true]               Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.
19644   * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
19645   *
19646   * @example
19647   * ```js
19648   * // Using ES5 syntax
19649   * var __ = wp.i18n.__;
19650   * var el = React.createElement;
19651   * var PanelBody = wp.components.PanelBody;
19652   * var PluginSidebar = wp.editor.PluginSidebar;
19653   * var moreIcon = React.createElement( 'svg' ); //... svg element.
19654   *
19655   * function MyPluginSidebar() {
19656   *     return el(
19657   *             PluginSidebar,
19658   *             {
19659   *                 name: 'my-sidebar',
19660   *                 title: 'My sidebar title',
19661   *                 icon: moreIcon,
19662   *             },
19663   *             el(
19664   *                 PanelBody,
19665   *                 {},
19666   *                 __( 'My sidebar content' )
19667   *             )
19668   *     );
19669   * }
19670   * ```
19671   *
19672   * @example
19673   * ```jsx
19674   * // Using ESNext syntax
19675   * import { __ } from '@wordpress/i18n';
19676   * import { PanelBody } from '@wordpress/components';
19677   * import { PluginSidebar } from '@wordpress/editor';
19678   * import { more } from '@wordpress/icons';
19679   *
19680   * const MyPluginSidebar = () => (
19681   *     <PluginSidebar
19682   *         name="my-sidebar"
19683   *         title="My sidebar title"
19684   *         icon={ more }
19685   *     >
19686   *         <PanelBody>
19687   *             { __( 'My sidebar content' ) }
19688   *         </PanelBody>
19689   *     </PluginSidebar>
19690   * );
19691   * ```
19692   */
19693  
19694  function PluginSidebar({
19695    className,
19696    ...props
19697  }) {
19698    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area, {
19699      panelClassName: className,
19700      className: "editor-sidebar",
19701      scope: "core",
19702      ...props
19703    });
19704  }
19705  
19706  ;// ./node_modules/@wordpress/editor/build-module/components/plugin-sidebar-more-menu-item/index.js
19707  /**
19708   * WordPress dependencies
19709   */
19710  
19711  
19712  /**
19713   * Renders a menu item in `Plugins` group in `More Menu` drop down,
19714   * and can be used to activate the corresponding `PluginSidebar` component.
19715   * The text within the component appears as the menu item label.
19716   *
19717   * @param {Object}                props                                 Component props.
19718   * @param {string}                props.target                          A string identifying the target sidebar you wish to be activated by this menu item. Must be the same as the `name` prop you have given to that sidebar.
19719   * @param {React.ReactNode}       [props.children]                      Children to be rendered.
19720   * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
19721   *
19722   * @example
19723   * ```js
19724   * // Using ES5 syntax
19725   * var __ = wp.i18n.__;
19726   * var PluginSidebarMoreMenuItem = wp.editor.PluginSidebarMoreMenuItem;
19727   * var moreIcon = React.createElement( 'svg' ); //... svg element.
19728   *
19729   * function MySidebarMoreMenuItem() {
19730   *     return React.createElement(
19731   *         PluginSidebarMoreMenuItem,
19732   *         {
19733   *             target: 'my-sidebar',
19734   *             icon: moreIcon,
19735   *         },
19736   *         __( 'My sidebar title' )
19737   *     )
19738   * }
19739   * ```
19740   *
19741   * @example
19742   * ```jsx
19743   * // Using ESNext syntax
19744   * import { __ } from '@wordpress/i18n';
19745   * import { PluginSidebarMoreMenuItem } from '@wordpress/editor';
19746   * import { more } from '@wordpress/icons';
19747   *
19748   * const MySidebarMoreMenuItem = () => (
19749   *     <PluginSidebarMoreMenuItem
19750   *         target="my-sidebar"
19751   *         icon={ more }
19752   *     >
19753   *         { __( 'My sidebar title' ) }
19754   *     </PluginSidebarMoreMenuItem>
19755   * );
19756   * ```
19757   *
19758   * @return {React.ReactNode} The rendered component.
19759   */
19760  
19761  function PluginSidebarMoreMenuItem(props) {
19762    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaMoreMenuItem
19763    // Menu item is marked with unstable prop for backward compatibility.
19764    // @see https://github.com/WordPress/gutenberg/issues/14457
19765    , {
19766      __unstableExplicitMenuItem: true,
19767      scope: "core",
19768      ...props
19769    });
19770  }
19771  
19772  ;// ./node_modules/@wordpress/editor/build-module/components/post-template/swap-template-button.js
19773  /**
19774   * WordPress dependencies
19775   */
19776  
19777  
19778  
19779  
19780  
19781  
19782  
19783  
19784  
19785  /**
19786   * Internal dependencies
19787   */
19788  
19789  
19790  function SwapTemplateButton({
19791    onClick
19792  }) {
19793    const [showModal, setShowModal] = (0,external_wp_element_namespaceObject.useState)(false);
19794    const {
19795      postType,
19796      postId
19797    } = useEditedPostContext();
19798    const availableTemplates = useAvailableTemplates(postType);
19799    const {
19800      editEntityRecord
19801    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
19802    if (!availableTemplates?.length) {
19803      return null;
19804    }
19805    const onTemplateSelect = async template => {
19806      editEntityRecord('postType', postType, postId, {
19807        template: template.name
19808      }, {
19809        undoIgnore: true
19810      });
19811      setShowModal(false); // Close the template suggestions modal first.
19812      onClick();
19813    };
19814    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
19815      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
19816        onClick: () => setShowModal(true),
19817        children: (0,external_wp_i18n_namespaceObject.__)('Change template')
19818      }), showModal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
19819        title: (0,external_wp_i18n_namespaceObject.__)('Choose a template'),
19820        onRequestClose: () => setShowModal(false),
19821        overlayClassName: "editor-post-template__swap-template-modal",
19822        isFullScreen: true,
19823        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
19824          className: "editor-post-template__swap-template-modal-content",
19825          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatesList, {
19826            postType: postType,
19827            onSelect: onTemplateSelect
19828          })
19829        })
19830      })]
19831    });
19832  }
19833  function TemplatesList({
19834    postType,
19835    onSelect
19836  }) {
19837    const availableTemplates = useAvailableTemplates(postType);
19838    const templatesAsPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => availableTemplates.map(template => ({
19839      name: template.slug,
19840      blocks: (0,external_wp_blocks_namespaceObject.parse)(template.content.raw),
19841      title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title.rendered),
19842      id: template.id
19843    })), [availableTemplates]);
19844    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
19845      label: (0,external_wp_i18n_namespaceObject.__)('Templates'),
19846      blockPatterns: templatesAsPatterns,
19847      onClickPattern: onSelect
19848    });
19849  }
19850  
19851  ;// ./node_modules/@wordpress/editor/build-module/components/post-template/reset-default-template.js
19852  /**
19853   * WordPress dependencies
19854   */
19855  
19856  
19857  
19858  
19859  
19860  /**
19861   * Internal dependencies
19862   */
19863  
19864  
19865  function ResetDefaultTemplate({
19866    onClick
19867  }) {
19868    const currentTemplateSlug = useCurrentTemplateSlug();
19869    const allowSwitchingTemplate = useAllowSwitchingTemplates();
19870    const {
19871      postType,
19872      postId
19873    } = useEditedPostContext();
19874    const {
19875      editEntityRecord
19876    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
19877    // The default template in a post is indicated by an empty string.
19878    if (!currentTemplateSlug || !allowSwitchingTemplate) {
19879      return null;
19880    }
19881    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
19882      onClick: () => {
19883        editEntityRecord('postType', postType, postId, {
19884          template: ''
19885        }, {
19886          undoIgnore: true
19887        });
19888        onClick();
19889      },
19890      children: (0,external_wp_i18n_namespaceObject.__)('Use default template')
19891    });
19892  }
19893  
19894  ;// ./node_modules/@wordpress/editor/build-module/components/post-template/create-new-template.js
19895  /**
19896   * WordPress dependencies
19897   */
19898  
19899  
19900  
19901  
19902  
19903  
19904  /**
19905   * Internal dependencies
19906   */
19907  
19908  
19909  
19910  function CreateNewTemplate({
19911    onClick
19912  }) {
19913    const {
19914      canCreateTemplates
19915    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
19916      const {
19917        canUser
19918      } = select(external_wp_coreData_namespaceObject.store);
19919      return {
19920        canCreateTemplates: canUser('create', {
19921          kind: 'postType',
19922          name: 'wp_template'
19923        })
19924      };
19925    }, []);
19926    const [isCreateModalOpen, setIsCreateModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
19927    const allowSwitchingTemplate = useAllowSwitchingTemplates();
19928  
19929    // The default template in a post is indicated by an empty string.
19930    if (!canCreateTemplates || !allowSwitchingTemplate) {
19931      return null;
19932    }
19933    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
19934      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
19935        onClick: () => {
19936          setIsCreateModalOpen(true);
19937        },
19938        children: (0,external_wp_i18n_namespaceObject.__)('Create new template')
19939      }), isCreateModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreateNewTemplateModal, {
19940        onClose: () => {
19941          setIsCreateModalOpen(false);
19942          onClick();
19943        }
19944      })]
19945    });
19946  }
19947  
19948  ;// ./node_modules/@wordpress/editor/build-module/components/post-template/block-theme.js
19949  /**
19950   * WordPress dependencies
19951   */
19952  
19953  
19954  
19955  
19956  
19957  
19958  
19959  
19960  
19961  
19962  /**
19963   * Internal dependencies
19964   */
19965  
19966  
19967  /**
19968   * Internal dependencies
19969   */
19970  
19971  
19972  
19973  
19974  
19975  
19976  function BlockThemeControl({
19977    id
19978  }) {
19979    const {
19980      isTemplateHidden,
19981      onNavigateToEntityRecord,
19982      getEditorSettings,
19983      hasGoBack
19984    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
19985      const {
19986        getRenderingMode,
19987        getEditorSettings: _getEditorSettings
19988      } = unlock(select(store_store));
19989      const editorSettings = _getEditorSettings();
19990      return {
19991        isTemplateHidden: getRenderingMode() === 'post-only',
19992        onNavigateToEntityRecord: editorSettings.onNavigateToEntityRecord,
19993        getEditorSettings: _getEditorSettings,
19994        hasGoBack: editorSettings.hasOwnProperty('onNavigateToPreviousEntityRecord')
19995      };
19996    }, []);
19997    const {
19998      get: getPreference
19999    } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_preferences_namespaceObject.store);
20000    const {
20001      editedRecord: template,
20002      hasResolved
20003    } = (0,external_wp_coreData_namespaceObject.useEntityRecord)('postType', 'wp_template', id);
20004    const {
20005      createSuccessNotice
20006    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
20007    const {
20008      setRenderingMode,
20009      setDefaultRenderingMode
20010    } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
20011    const canCreateTemplate = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_coreData_namespaceObject.store).canUser('create', {
20012      kind: 'postType',
20013      name: 'wp_template'
20014    }), []);
20015    const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
20016    // Memoize popoverProps to avoid returning a new object every time.
20017    const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
20018      // Anchor the popover to the middle of the entire row so that it doesn't
20019      // move around when the label changes.
20020      anchor: popoverAnchor,
20021      className: 'editor-post-template__dropdown',
20022      placement: 'left-start',
20023      offset: 36,
20024      shift: true
20025    }), [popoverAnchor]);
20026    if (!hasResolved) {
20027      return null;
20028    }
20029  
20030    // The site editor does not have a `onNavigateToPreviousEntityRecord` setting as it uses its own routing
20031    // and assigns its own backlink to focusMode pages.
20032    const notificationAction = hasGoBack ? [{
20033      label: (0,external_wp_i18n_namespaceObject.__)('Go back'),
20034      onClick: () => getEditorSettings().onNavigateToPreviousEntityRecord()
20035    }] : undefined;
20036    const mayShowTemplateEditNotice = () => {
20037      if (!getPreference('core/edit-site', 'welcomeGuideTemplate')) {
20038        createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Editing template. Changes made here affect all posts and pages that use the template.'), {
20039          type: 'snackbar',
20040          actions: notificationAction
20041        });
20042      }
20043    };
20044    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
20045      label: (0,external_wp_i18n_namespaceObject.__)('Template'),
20046      ref: setPopoverAnchor,
20047      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, {
20048        popoverProps: popoverProps,
20049        focusOnMount: true,
20050        toggleProps: {
20051          size: 'compact',
20052          variant: 'tertiary',
20053          tooltipPosition: 'middle left'
20054        },
20055        label: (0,external_wp_i18n_namespaceObject.__)('Template options'),
20056        text: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title),
20057        icon: null,
20058        children: ({
20059          onClose
20060        }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
20061          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, {
20062            children: [canCreateTemplate && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
20063              onClick: () => {
20064                onNavigateToEntityRecord({
20065                  postId: template.id,
20066                  postType: 'wp_template'
20067                });
20068                onClose();
20069                mayShowTemplateEditNotice();
20070              },
20071              children: (0,external_wp_i18n_namespaceObject.__)('Edit template')
20072            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SwapTemplateButton, {
20073              onClick: onClose
20074            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResetDefaultTemplate, {
20075              onClick: onClose
20076            }), canCreateTemplate && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreateNewTemplate, {
20077              onClick: onClose
20078            })]
20079          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, {
20080            children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
20081              icon: !isTemplateHidden ? library_check : undefined,
20082              isSelected: !isTemplateHidden,
20083              role: "menuitemcheckbox",
20084              onClick: () => {
20085                const newRenderingMode = isTemplateHidden ? 'template-locked' : 'post-only';
20086                setRenderingMode(newRenderingMode);
20087                setDefaultRenderingMode(newRenderingMode);
20088              },
20089              children: (0,external_wp_i18n_namespaceObject.__)('Show template')
20090            })
20091          })]
20092        })
20093      })
20094    });
20095  }
20096  
20097  ;// ./node_modules/@wordpress/editor/build-module/components/post-template/panel.js
20098  /**
20099   * WordPress dependencies
20100   */
20101  
20102  
20103  
20104  /**
20105   * Internal dependencies
20106   */
20107  
20108  
20109  
20110  
20111  /**
20112   * Displays the template controls based on the current editor settings and user permissions.
20113   *
20114   * @return {React.ReactNode} The rendered PostTemplatePanel component.
20115   */
20116  
20117  function PostTemplatePanel() {
20118    const {
20119      templateId,
20120      isBlockTheme
20121    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
20122      const {
20123        getCurrentTemplateId,
20124        getEditorSettings
20125      } = select(store_store);
20126      return {
20127        templateId: getCurrentTemplateId(),
20128        isBlockTheme: getEditorSettings().__unstableIsBlockBasedTheme
20129      };
20130    }, []);
20131    const isVisible = (0,external_wp_data_namespaceObject.useSelect)(select => {
20132      var _select$canUser;
20133      const postTypeSlug = select(store_store).getCurrentPostType();
20134      const postType = select(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug);
20135      if (!postType?.viewable) {
20136        return false;
20137      }
20138      const settings = select(store_store).getEditorSettings();
20139      const hasTemplates = !!settings.availableTemplates && Object.keys(settings.availableTemplates).length > 0;
20140      if (hasTemplates) {
20141        return true;
20142      }
20143      if (!settings.supportsTemplateMode) {
20144        return false;
20145      }
20146      const canCreateTemplates = (_select$canUser = select(external_wp_coreData_namespaceObject.store).canUser('create', {
20147        kind: 'postType',
20148        name: 'wp_template'
20149      })) !== null && _select$canUser !== void 0 ? _select$canUser : false;
20150      return canCreateTemplates;
20151    }, []);
20152    const canViewTemplates = (0,external_wp_data_namespaceObject.useSelect)(select => {
20153      var _select$canUser2;
20154      return (_select$canUser2 = select(external_wp_coreData_namespaceObject.store).canUser('read', {
20155        kind: 'postType',
20156        name: 'wp_template'
20157      })) !== null && _select$canUser2 !== void 0 ? _select$canUser2 : false;
20158    }, []);
20159    if ((!isBlockTheme || !canViewTemplates) && isVisible) {
20160      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(classic_theme, {});
20161    }
20162    if (isBlockTheme && !!templateId) {
20163      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockThemeControl, {
20164        id: templateId
20165      });
20166    }
20167    return null;
20168  }
20169  
20170  ;// ./node_modules/@wordpress/editor/build-module/components/post-author/constants.js
20171  const BASE_QUERY = {
20172    _fields: 'id,name',
20173    context: 'view' // Allows non-admins to perform requests.
20174  };
20175  const AUTHORS_QUERY = {
20176    who: 'authors',
20177    per_page: 100,
20178    ...BASE_QUERY
20179  };
20180  
20181  ;// ./node_modules/@wordpress/editor/build-module/components/post-author/hook.js
20182  /**
20183   * WordPress dependencies
20184   */
20185  
20186  
20187  
20188  
20189  
20190  
20191  /**
20192   * Internal dependencies
20193   */
20194  
20195  
20196  function useAuthorsQuery(search) {
20197    const {
20198      authorId,
20199      authors,
20200      postAuthor,
20201      isLoading
20202    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
20203      const {
20204        getUser,
20205        getUsers,
20206        isResolving
20207      } = select(external_wp_coreData_namespaceObject.store);
20208      const {
20209        getEditedPostAttribute
20210      } = select(store_store);
20211      const _authorId = getEditedPostAttribute('author');
20212      const query = {
20213        ...AUTHORS_QUERY
20214      };
20215      if (search) {
20216        query.search = search;
20217        query.search_columns = ['name'];
20218      }
20219      return {
20220        authorId: _authorId,
20221        authors: getUsers(query),
20222        postAuthor: getUser(_authorId, BASE_QUERY),
20223        isLoading: isResolving('getUsers', [query])
20224      };
20225    }, [search]);
20226    const authorOptions = (0,external_wp_element_namespaceObject.useMemo)(() => {
20227      const fetchedAuthors = (authors !== null && authors !== void 0 ? authors : []).map(author => {
20228        return {
20229          value: author.id,
20230          label: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(author.name)
20231        };
20232      });
20233  
20234      // Ensure the current author is included in the dropdown list.
20235      const foundAuthor = fetchedAuthors.findIndex(({
20236        value
20237      }) => postAuthor?.id === value);
20238      let currentAuthor = [];
20239      if (foundAuthor < 0 && postAuthor) {
20240        currentAuthor = [{
20241          value: postAuthor.id,
20242          label: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(postAuthor.name)
20243        }];
20244      } else if (foundAuthor < 0 && !postAuthor) {
20245        currentAuthor = [{
20246          value: 0,
20247          label: (0,external_wp_i18n_namespaceObject.__)('(No author)')
20248        }];
20249      }
20250      return [...currentAuthor, ...fetchedAuthors];
20251    }, [authors, postAuthor]);
20252    return {
20253      authorId,
20254      authorOptions,
20255      postAuthor,
20256      isLoading
20257    };
20258  }
20259  
20260  ;// ./node_modules/@wordpress/editor/build-module/components/post-author/combobox.js
20261  /**
20262   * WordPress dependencies
20263   */
20264  
20265  
20266  
20267  
20268  
20269  
20270  /**
20271   * Internal dependencies
20272   */
20273  
20274  
20275  
20276  function PostAuthorCombobox() {
20277    const [fieldValue, setFieldValue] = (0,external_wp_element_namespaceObject.useState)();
20278    const {
20279      editPost
20280    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
20281    const {
20282      authorId,
20283      authorOptions,
20284      isLoading
20285    } = useAuthorsQuery(fieldValue);
20286  
20287    /**
20288     * Handle author selection.
20289     *
20290     * @param {number} postAuthorId The selected Author.
20291     */
20292    const handleSelect = postAuthorId => {
20293      if (!postAuthorId) {
20294        return;
20295      }
20296      editPost({
20297        author: postAuthorId
20298      });
20299    };
20300  
20301    /**
20302     * Handle user input.
20303     *
20304     * @param {string} inputValue The current value of the input field.
20305     */
20306    const handleKeydown = inputValue => {
20307      setFieldValue(inputValue);
20308    };
20309    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ComboboxControl, {
20310      __nextHasNoMarginBottom: true,
20311      __next40pxDefaultSize: true,
20312      label: (0,external_wp_i18n_namespaceObject.__)('Author'),
20313      options: authorOptions,
20314      value: authorId,
20315      onFilterValueChange: (0,external_wp_compose_namespaceObject.debounce)(handleKeydown, 300),
20316      onChange: handleSelect,
20317      allowReset: false,
20318      hideLabelFromVision: true,
20319      isLoading: isLoading
20320    });
20321  }
20322  
20323  ;// ./node_modules/@wordpress/editor/build-module/components/post-author/select.js
20324  /**
20325   * WordPress dependencies
20326   */
20327  
20328  
20329  
20330  
20331  /**
20332   * Internal dependencies
20333   */
20334  
20335  
20336  
20337  function PostAuthorSelect() {
20338    const {
20339      editPost
20340    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
20341    const {
20342      authorId,
20343      authorOptions
20344    } = useAuthorsQuery();
20345    const setAuthorId = value => {
20346      const author = Number(value);
20347      editPost({
20348        author
20349      });
20350    };
20351    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, {
20352      __next40pxDefaultSize: true,
20353      __nextHasNoMarginBottom: true,
20354      className: "post-author-selector",
20355      label: (0,external_wp_i18n_namespaceObject.__)('Author'),
20356      options: authorOptions,
20357      onChange: setAuthorId,
20358      value: authorId,
20359      hideLabelFromVision: true
20360    });
20361  }
20362  
20363  ;// ./node_modules/@wordpress/editor/build-module/components/post-author/index.js
20364  /**
20365   * WordPress dependencies
20366   */
20367  
20368  
20369  
20370  /**
20371   * Internal dependencies
20372   */
20373  
20374  
20375  
20376  
20377  const minimumUsersForCombobox = 25;
20378  
20379  /**
20380   * Renders the component for selecting the post author.
20381   *
20382   * @return {React.ReactNode} The rendered component.
20383   */
20384  function PostAuthor() {
20385    const showCombobox = (0,external_wp_data_namespaceObject.useSelect)(select => {
20386      const authors = select(external_wp_coreData_namespaceObject.store).getUsers(AUTHORS_QUERY);
20387      return authors?.length >= minimumUsersForCombobox;
20388    }, []);
20389    if (showCombobox) {
20390      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostAuthorCombobox, {});
20391    }
20392    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostAuthorSelect, {});
20393  }
20394  /* harmony default export */ const post_author = (PostAuthor);
20395  
20396  ;// ./node_modules/@wordpress/editor/build-module/components/post-author/check.js
20397  /**
20398   * WordPress dependencies
20399   */
20400  
20401  
20402  
20403  /**
20404   * Internal dependencies
20405   */
20406  
20407  
20408  
20409  
20410  /**
20411   * Wrapper component that renders its children only if the post type supports the author.
20412   *
20413   * @param {Object}          props          The component props.
20414   * @param {React.ReactNode} props.children Children to be rendered.
20415   *
20416   * @return {React.ReactNode} The component to be rendered. Return `null` if the post type doesn't
20417   * supports the author or if there are no authors available.
20418   */
20419  
20420  function PostAuthorCheck({
20421    children
20422  }) {
20423    const {
20424      hasAssignAuthorAction,
20425      hasAuthors
20426    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
20427      const post = select(store_store).getCurrentPost();
20428      const canAssignAuthor = post?._links?.['wp:action-assign-author'] ? true : false;
20429      return {
20430        hasAssignAuthorAction: canAssignAuthor,
20431        hasAuthors: canAssignAuthor ? select(external_wp_coreData_namespaceObject.store).getUsers(AUTHORS_QUERY)?.length >= 1 : false
20432      };
20433    }, []);
20434    if (!hasAssignAuthorAction || !hasAuthors) {
20435      return null;
20436    }
20437    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, {
20438      supportKeys: "author",
20439      children: children
20440    });
20441  }
20442  
20443  ;// ./node_modules/@wordpress/editor/build-module/components/post-author/panel.js
20444  /**
20445   * WordPress dependencies
20446   */
20447  
20448  
20449  
20450  
20451  
20452  
20453  /**
20454   * Internal dependencies
20455   */
20456  
20457  
20458  
20459  
20460  
20461  function PostAuthorToggle({
20462    isOpen,
20463    onClick
20464  }) {
20465    const {
20466      postAuthor
20467    } = useAuthorsQuery();
20468    const authorName = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(postAuthor?.name) || (0,external_wp_i18n_namespaceObject.__)('(No author)');
20469    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
20470      size: "compact",
20471      className: "editor-post-author__panel-toggle",
20472      variant: "tertiary",
20473      "aria-expanded": isOpen,
20474      "aria-label":
20475      // translators: %s: Author name.
20476      (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Change author: %s'), authorName),
20477      onClick: onClick,
20478      children: authorName
20479    });
20480  }
20481  
20482  /**
20483   * Renders the Post Author Panel component.
20484   *
20485   * @return {React.ReactNode} The rendered component.
20486   */
20487  function panel_PostAuthor() {
20488    // Use internal state instead of a ref to make sure that the component
20489    // re-renders when the popover's anchor updates.
20490    const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
20491    // Memoize popoverProps to avoid returning a new object every time.
20492    const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
20493      // Anchor the popover to the middle of the entire row so that it doesn't
20494      // move around when the label changes.
20495      anchor: popoverAnchor,
20496      placement: 'left-start',
20497      offset: 36,
20498      shift: true
20499    }), [popoverAnchor]);
20500    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostAuthorCheck, {
20501      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
20502        label: (0,external_wp_i18n_namespaceObject.__)('Author'),
20503        ref: setPopoverAnchor,
20504        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
20505          popoverProps: popoverProps,
20506          contentClassName: "editor-post-author__panel-dialog",
20507          focusOnMount: true,
20508          renderToggle: ({
20509            isOpen,
20510            onToggle
20511          }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostAuthorToggle, {
20512            isOpen: isOpen,
20513            onClick: onToggle
20514          }),
20515          renderContent: ({
20516            onClose
20517          }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
20518            className: "editor-post-author",
20519            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
20520              title: (0,external_wp_i18n_namespaceObject.__)('Author'),
20521              onClose: onClose
20522            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_author, {
20523              onClose: onClose
20524            })]
20525          })
20526        })
20527      })
20528    });
20529  }
20530  /* harmony default export */ const panel = (panel_PostAuthor);
20531  
20532  ;// ./node_modules/@wordpress/editor/build-module/components/post-comments/index.js
20533  /**
20534   * WordPress dependencies
20535   */
20536  
20537  
20538  
20539  
20540  /**
20541   * Internal dependencies
20542   */
20543  
20544  
20545  const COMMENT_OPTIONS = [{
20546    label: (0,external_wp_i18n_namespaceObject._x)('Open', 'Adjective: e.g. "Comments are open"'),
20547    value: 'open',
20548    description: (0,external_wp_i18n_namespaceObject.__)('Visitors can add new comments and replies.')
20549  }, {
20550    label: (0,external_wp_i18n_namespaceObject.__)('Closed'),
20551    value: 'closed',
20552    description: [(0,external_wp_i18n_namespaceObject.__)('Visitors cannot add new comments or replies.'), (0,external_wp_i18n_namespaceObject.__)('Existing comments remain visible.')].join(' ')
20553  }];
20554  function PostComments() {
20555    const commentStatus = (0,external_wp_data_namespaceObject.useSelect)(select => {
20556      var _select$getEditedPost;
20557      return (_select$getEditedPost = select(store_store).getEditedPostAttribute('comment_status')) !== null && _select$getEditedPost !== void 0 ? _select$getEditedPost : 'open';
20558    }, []);
20559    const {
20560      editPost
20561    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
20562    const handleStatus = newCommentStatus => editPost({
20563      comment_status: newCommentStatus
20564    });
20565    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
20566      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, {
20567        spacing: 4,
20568        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RadioControl, {
20569          className: "editor-change-status__options",
20570          hideLabelFromVision: true,
20571          label: (0,external_wp_i18n_namespaceObject.__)('Comment status'),
20572          options: COMMENT_OPTIONS,
20573          onChange: handleStatus,
20574          selected: commentStatus
20575        })
20576      })
20577    });
20578  }
20579  
20580  /**
20581   * A form for managing comment status.
20582   *
20583   * @return {React.ReactNode} The rendered PostComments component.
20584   */
20585  /* harmony default export */ const post_comments = (PostComments);
20586  
20587  ;// ./node_modules/@wordpress/editor/build-module/components/post-pingbacks/index.js
20588  /**
20589   * WordPress dependencies
20590   */
20591  
20592  
20593  
20594  
20595  /**
20596   * Internal dependencies
20597   */
20598  
20599  
20600  function PostPingbacks() {
20601    const pingStatus = (0,external_wp_data_namespaceObject.useSelect)(select => {
20602      var _select$getEditedPost;
20603      return (_select$getEditedPost = select(store_store).getEditedPostAttribute('ping_status')) !== null && _select$getEditedPost !== void 0 ? _select$getEditedPost : 'open';
20604    }, []);
20605    const {
20606      editPost
20607    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
20608    const onTogglePingback = () => editPost({
20609      ping_status: pingStatus === 'open' ? 'closed' : 'open'
20610    });
20611    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, {
20612      __nextHasNoMarginBottom: true,
20613      label: (0,external_wp_i18n_namespaceObject.__)('Enable pingbacks & trackbacks'),
20614      checked: pingStatus === 'open',
20615      onChange: onTogglePingback,
20616      help: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
20617        href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/trackbacks-and-pingbacks/'),
20618        children: (0,external_wp_i18n_namespaceObject.__)('Learn more about pingbacks & trackbacks')
20619      })
20620    });
20621  }
20622  
20623  /**
20624   * Renders a control for enabling or disabling pingbacks and trackbacks
20625   * in a WordPress post.
20626   *
20627   * @module PostPingbacks
20628   */
20629  /* harmony default export */ const post_pingbacks = (PostPingbacks);
20630  
20631  ;// ./node_modules/@wordpress/editor/build-module/components/post-discussion/panel.js
20632  /**
20633   * WordPress dependencies
20634   */
20635  
20636  
20637  
20638  
20639  
20640  
20641  
20642  /**
20643   * Internal dependencies
20644   */
20645  
20646  
20647  
20648  
20649  
20650  
20651  const panel_PANEL_NAME = 'discussion-panel';
20652  function ModalContents({
20653    onClose
20654  }) {
20655    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
20656      className: "editor-post-discussion",
20657      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
20658        title: (0,external_wp_i18n_namespaceObject.__)('Discussion'),
20659        onClose: onClose
20660      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
20661        spacing: 4,
20662        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, {
20663          supportKeys: "comments",
20664          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_comments, {})
20665        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, {
20666          supportKeys: "trackbacks",
20667          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_pingbacks, {})
20668        })]
20669      })]
20670    });
20671  }
20672  function PostDiscussionToggle({
20673    isOpen,
20674    onClick
20675  }) {
20676    const {
20677      commentStatus,
20678      pingStatus,
20679      commentsSupported,
20680      trackbacksSupported
20681    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
20682      var _getEditedPostAttribu, _getEditedPostAttribu2;
20683      const {
20684        getEditedPostAttribute
20685      } = select(store_store);
20686      const {
20687        getPostType
20688      } = select(external_wp_coreData_namespaceObject.store);
20689      const postType = getPostType(getEditedPostAttribute('type'));
20690      return {
20691        commentStatus: (_getEditedPostAttribu = getEditedPostAttribute('comment_status')) !== null && _getEditedPostAttribu !== void 0 ? _getEditedPostAttribu : 'open',
20692        pingStatus: (_getEditedPostAttribu2 = getEditedPostAttribute('ping_status')) !== null && _getEditedPostAttribu2 !== void 0 ? _getEditedPostAttribu2 : 'open',
20693        commentsSupported: !!postType.supports.comments,
20694        trackbacksSupported: !!postType.supports.trackbacks
20695      };
20696    }, []);
20697    let label;
20698    if (commentStatus === 'open') {
20699      if (pingStatus === 'open') {
20700        label = (0,external_wp_i18n_namespaceObject._x)('Open', 'Adjective: e.g. "Comments are open"');
20701      } else {
20702        label = trackbacksSupported ? (0,external_wp_i18n_namespaceObject.__)('Comments only') : (0,external_wp_i18n_namespaceObject._x)('Open', 'Adjective: e.g. "Comments are open"');
20703      }
20704    } else if (pingStatus === 'open') {
20705      label = commentsSupported ? (0,external_wp_i18n_namespaceObject.__)('Pings only') : (0,external_wp_i18n_namespaceObject.__)('Pings enabled');
20706    } else {
20707      label = (0,external_wp_i18n_namespaceObject.__)('Closed');
20708    }
20709    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
20710      size: "compact",
20711      className: "editor-post-discussion__panel-toggle",
20712      variant: "tertiary",
20713      "aria-label": (0,external_wp_i18n_namespaceObject.__)('Change discussion options'),
20714      "aria-expanded": isOpen,
20715      onClick: onClick,
20716      children: label
20717    });
20718  }
20719  
20720  /**
20721   * This component allows to update comment and pingback
20722   * settings for the current post. Internally there are
20723   * checks whether the current post has support for the
20724   * above and if the `discussion-panel` panel is enabled.
20725   *
20726   * @return {React.ReactNode} The rendered PostDiscussionPanel component.
20727   */
20728  function PostDiscussionPanel() {
20729    const {
20730      isEnabled
20731    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
20732      const {
20733        isEditorPanelEnabled
20734      } = select(store_store);
20735      return {
20736        isEnabled: isEditorPanelEnabled(panel_PANEL_NAME)
20737      };
20738    }, []);
20739  
20740    // Use internal state instead of a ref to make sure that the component
20741    // re-renders when the popover's anchor updates.
20742    const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
20743    // Memoize popoverProps to avoid returning a new object every time.
20744    const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
20745      // Anchor the popover to the middle of the entire row so that it doesn't
20746      // move around when the label changes.
20747      anchor: popoverAnchor,
20748      placement: 'left-start',
20749      offset: 36,
20750      shift: true
20751    }), [popoverAnchor]);
20752    if (!isEnabled) {
20753      return null;
20754    }
20755    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, {
20756      supportKeys: ['comments', 'trackbacks'],
20757      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
20758        label: (0,external_wp_i18n_namespaceObject.__)('Discussion'),
20759        ref: setPopoverAnchor,
20760        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
20761          popoverProps: popoverProps,
20762          className: "editor-post-discussion__panel-dropdown",
20763          contentClassName: "editor-post-discussion__panel-dialog",
20764          focusOnMount: true,
20765          renderToggle: ({
20766            isOpen,
20767            onToggle
20768          }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostDiscussionToggle, {
20769            isOpen: isOpen,
20770            onClick: onToggle
20771          }),
20772          renderContent: ({
20773            onClose
20774          }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ModalContents, {
20775            onClose: onClose
20776          })
20777        })
20778      })
20779    });
20780  }
20781  
20782  ;// ./node_modules/@wordpress/editor/build-module/components/post-excerpt/index.js
20783  /**
20784   * WordPress dependencies
20785   */
20786  
20787  
20788  
20789  
20790  
20791  
20792  /**
20793   * Internal dependencies
20794   */
20795  
20796  
20797  /**
20798   * Renders an editable textarea for the post excerpt.
20799   * Templates, template parts and patterns use the `excerpt` field as a description semantically.
20800   * Additionally templates and template parts override the `excerpt` field as `description` in
20801   * REST API. So this component handles proper labeling and updating the edited entity.
20802   *
20803   * @param {Object}  props                             - Component props.
20804   * @param {boolean} [props.hideLabelFromVision=false] - Whether to visually hide the textarea's label.
20805   * @param {boolean} [props.updateOnBlur=false]        - Whether to update the post on change or use local state and update on blur.
20806   */
20807  
20808  function PostExcerpt({
20809    hideLabelFromVision = false,
20810    updateOnBlur = false
20811  }) {
20812    const {
20813      excerpt,
20814      shouldUseDescriptionLabel,
20815      usedAttribute
20816    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
20817      const {
20818        getCurrentPostType,
20819        getEditedPostAttribute
20820      } = select(store_store);
20821      const postType = getCurrentPostType();
20822      // This special case is unfortunate, but the REST API of wp_template and wp_template_part
20823      // support the excerpt field through the "description" field rather than "excerpt".
20824      const _usedAttribute = ['wp_template', 'wp_template_part'].includes(postType) ? 'description' : 'excerpt';
20825      return {
20826        excerpt: getEditedPostAttribute(_usedAttribute),
20827        // There are special cases where we want to label the excerpt as a description.
20828        shouldUseDescriptionLabel: ['wp_template', 'wp_template_part', 'wp_block'].includes(postType),
20829        usedAttribute: _usedAttribute
20830      };
20831    }, []);
20832    const {
20833      editPost
20834    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
20835    const [localExcerpt, setLocalExcerpt] = (0,external_wp_element_namespaceObject.useState)((0,external_wp_htmlEntities_namespaceObject.decodeEntities)(excerpt));
20836    const updatePost = value => {
20837      editPost({
20838        [usedAttribute]: value
20839      });
20840    };
20841    const label = shouldUseDescriptionLabel ? (0,external_wp_i18n_namespaceObject.__)('Write a description (optional)') : (0,external_wp_i18n_namespaceObject.__)('Write an excerpt (optional)');
20842    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
20843      className: "editor-post-excerpt",
20844      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, {
20845        __nextHasNoMarginBottom: true,
20846        label: label,
20847        hideLabelFromVision: hideLabelFromVision,
20848        className: "editor-post-excerpt__textarea",
20849        onChange: updateOnBlur ? setLocalExcerpt : updatePost,
20850        onBlur: updateOnBlur ? () => updatePost(localExcerpt) : undefined,
20851        value: updateOnBlur ? localExcerpt : excerpt,
20852        help: !shouldUseDescriptionLabel ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
20853          href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt'),
20854          children: (0,external_wp_i18n_namespaceObject.__)('Learn more about manual excerpts')
20855        }) : (0,external_wp_i18n_namespaceObject.__)('Write a description')
20856      })
20857    });
20858  }
20859  
20860  ;// ./node_modules/@wordpress/editor/build-module/components/post-excerpt/check.js
20861  /**
20862   * Internal dependencies
20863   */
20864  
20865  
20866  /**
20867   * Component for checking if the post type supports the excerpt field.
20868   *
20869   * @param {Object}          props          Props.
20870   * @param {React.ReactNode} props.children Children to be rendered.
20871   *
20872   * @return {React.ReactNode} The rendered component.
20873   */
20874  
20875  function PostExcerptCheck({
20876    children
20877  }) {
20878    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, {
20879      supportKeys: "excerpt",
20880      children: children
20881    });
20882  }
20883  /* harmony default export */ const post_excerpt_check = (PostExcerptCheck);
20884  
20885  ;// ./node_modules/@wordpress/editor/build-module/components/post-excerpt/plugin.js
20886  /**
20887   * Defines as extensibility slot for the Excerpt panel.
20888   */
20889  
20890  /**
20891   * WordPress dependencies
20892   */
20893  
20894  
20895  const {
20896    Fill: plugin_Fill,
20897    Slot: plugin_Slot
20898  } = (0,external_wp_components_namespaceObject.createSlotFill)('PluginPostExcerpt');
20899  
20900  /**
20901   * Renders a post excerpt panel in the post sidebar.
20902   *
20903   * @param {Object}          props             Component properties.
20904   * @param {string}          [props.className] An optional class name added to the row.
20905   * @param {React.ReactNode} props.children    Children to be rendered.
20906   *
20907   * @example
20908   * ```js
20909   * // Using ES5 syntax
20910   * var __ = wp.i18n.__;
20911   * var PluginPostExcerpt = wp.editPost.__experimentalPluginPostExcerpt;
20912   *
20913   * function MyPluginPostExcerpt() {
20914   *     return React.createElement(
20915   *         PluginPostExcerpt,
20916   *         {
20917   *             className: 'my-plugin-post-excerpt',
20918   *         },
20919   *         __( 'Post excerpt custom content' )
20920   *     )
20921   * }
20922   * ```
20923   *
20924   * @example
20925   * ```jsx
20926   * // Using ESNext syntax
20927   * import { __ } from '@wordpress/i18n';
20928   * import { __experimentalPluginPostExcerpt as PluginPostExcerpt } from '@wordpress/edit-post';
20929   *
20930   * const MyPluginPostExcerpt = () => (
20931   *     <PluginPostExcerpt className="my-plugin-post-excerpt">
20932   *         { __( 'Post excerpt custom content' ) }
20933   *     </PluginPostExcerpt>
20934   * );
20935   * ```
20936   *
20937   * @return {React.ReactNode} The rendered component.
20938   */
20939  const PluginPostExcerpt = ({
20940    children,
20941    className
20942  }) => {
20943    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_Fill, {
20944      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelRow, {
20945        className: className,
20946        children: children
20947      })
20948    });
20949  };
20950  PluginPostExcerpt.Slot = plugin_Slot;
20951  /* harmony default export */ const post_excerpt_plugin = (PluginPostExcerpt);
20952  
20953  ;// ./node_modules/@wordpress/editor/build-module/components/post-excerpt/panel.js
20954  /**
20955   * WordPress dependencies
20956   */
20957  
20958  
20959  
20960  
20961  
20962  
20963  
20964  
20965  /**
20966   * Internal dependencies
20967   */
20968  
20969  
20970  
20971  
20972  
20973  
20974  /**
20975   * Module Constants
20976   */
20977  
20978  const post_excerpt_panel_PANEL_NAME = 'post-excerpt';
20979  function ExcerptPanel() {
20980    const {
20981      isOpened,
20982      isEnabled,
20983      postType
20984    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
20985      const {
20986        isEditorPanelOpened,
20987        isEditorPanelEnabled,
20988        getCurrentPostType
20989      } = select(store_store);
20990      return {
20991        isOpened: isEditorPanelOpened(post_excerpt_panel_PANEL_NAME),
20992        isEnabled: isEditorPanelEnabled(post_excerpt_panel_PANEL_NAME),
20993        postType: getCurrentPostType()
20994      };
20995    }, []);
20996    const {
20997      toggleEditorPanelOpened
20998    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
20999    const toggleExcerptPanel = () => toggleEditorPanelOpened(post_excerpt_panel_PANEL_NAME);
21000    if (!isEnabled) {
21001      return null;
21002    }
21003  
21004    // There are special cases where we want to label the excerpt as a description.
21005    const shouldUseDescriptionLabel = ['wp_template', 'wp_template_part', 'wp_block'].includes(postType);
21006    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
21007      title: shouldUseDescriptionLabel ? (0,external_wp_i18n_namespaceObject.__)('Description') : (0,external_wp_i18n_namespaceObject.__)('Excerpt'),
21008      opened: isOpened,
21009      onToggle: toggleExcerptPanel,
21010      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_excerpt_plugin.Slot, {
21011        children: fills => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
21012          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostExcerpt, {}), fills]
21013        })
21014      })
21015    });
21016  }
21017  
21018  /**
21019   * Is rendered if the post type supports excerpts and allows editing the excerpt.
21020   *
21021   * @return {React.ReactNode} The rendered PostExcerptPanel component.
21022   */
21023  function PostExcerptPanel() {
21024    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_excerpt_check, {
21025      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExcerptPanel, {})
21026    });
21027  }
21028  function PrivatePostExcerptPanel() {
21029    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_excerpt_check, {
21030      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateExcerpt, {})
21031    });
21032  }
21033  function PrivateExcerpt() {
21034    const {
21035      shouldRender,
21036      excerpt,
21037      shouldBeUsedAsDescription,
21038      allowEditing
21039    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
21040      const {
21041        getCurrentPostType,
21042        getCurrentPostId,
21043        getEditedPostAttribute,
21044        isEditorPanelEnabled
21045      } = select(store_store);
21046      const postType = getCurrentPostType();
21047      const isTemplateOrTemplatePart = ['wp_template', 'wp_template_part'].includes(postType);
21048      const isPattern = postType === 'wp_block';
21049      // These post types use the `excerpt` field as a description semantically, so we need to
21050      // handle proper labeling and some flows where we should always render them as text.
21051      const _shouldBeUsedAsDescription = isTemplateOrTemplatePart || isPattern;
21052      const _usedAttribute = isTemplateOrTemplatePart ? 'description' : 'excerpt';
21053      // We need to fetch the entity in this case to check if we'll allow editing.
21054      const template = isTemplateOrTemplatePart && select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', postType, getCurrentPostId());
21055      // For post types that use excerpt as description, we do not abide
21056      // by the `isEnabled` panel flag in order to render them as text.
21057      const _shouldRender = isEditorPanelEnabled(post_excerpt_panel_PANEL_NAME) || _shouldBeUsedAsDescription;
21058      return {
21059        excerpt: getEditedPostAttribute(_usedAttribute),
21060        shouldRender: _shouldRender,
21061        shouldBeUsedAsDescription: _shouldBeUsedAsDescription,
21062        // If we should render, allow editing for all post types that are not used as description.
21063        // For the rest allow editing only for user generated entities.
21064        allowEditing: _shouldRender && (!_shouldBeUsedAsDescription || isPattern || template && template.source === TEMPLATE_ORIGINS.custom && !template.has_theme_file && template.is_custom)
21065      };
21066    }, []);
21067    const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
21068    const label = shouldBeUsedAsDescription ? (0,external_wp_i18n_namespaceObject.__)('Description') : (0,external_wp_i18n_namespaceObject.__)('Excerpt');
21069    // Memoize popoverProps to avoid returning a new object every time.
21070    const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
21071      // Anchor the popover to the middle of the entire row so that it doesn't
21072      // move around when the label changes.
21073      anchor: popoverAnchor,
21074      'aria-label': label,
21075      headerTitle: label,
21076      placement: 'left-start',
21077      offset: 36,
21078      shift: true
21079    }), [popoverAnchor, label]);
21080    if (!shouldRender) {
21081      return false;
21082    }
21083    const excerptText = !!excerpt && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
21084      align: "left",
21085      numberOfLines: 4,
21086      truncate: allowEditing,
21087      children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(excerpt)
21088    });
21089    if (!allowEditing) {
21090      return excerptText;
21091    }
21092    const excerptPlaceholder = shouldBeUsedAsDescription ? (0,external_wp_i18n_namespaceObject.__)('Add a description…') : (0,external_wp_i18n_namespaceObject.__)('Add an excerpt…');
21093    const triggerEditLabel = shouldBeUsedAsDescription ? (0,external_wp_i18n_namespaceObject.__)('Edit description') : (0,external_wp_i18n_namespaceObject.__)('Edit excerpt');
21094    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
21095      children: [excerptText, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
21096        className: "editor-post-excerpt__dropdown",
21097        contentClassName: "editor-post-excerpt__dropdown__content",
21098        popoverProps: popoverProps,
21099        focusOnMount: true,
21100        ref: setPopoverAnchor,
21101        renderToggle: ({
21102          onToggle
21103        }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
21104          __next40pxDefaultSize: true,
21105          onClick: onToggle,
21106          variant: "link",
21107          children: excerptText ? triggerEditLabel : excerptPlaceholder
21108        }),
21109        renderContent: ({
21110          onClose
21111        }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
21112          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
21113            title: label,
21114            onClose: onClose
21115          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, {
21116            spacing: 4,
21117            children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_excerpt_plugin.Slot, {
21118              children: fills => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
21119                children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostExcerpt, {
21120                  hideLabelFromVision: true,
21121                  updateOnBlur: true
21122                }), fills]
21123              })
21124            })
21125          })]
21126        })
21127      })]
21128    });
21129  }
21130  
21131  ;// ./node_modules/@wordpress/editor/build-module/components/theme-support-check/index.js
21132  /**
21133   * WordPress dependencies
21134   */
21135  
21136  
21137  
21138  /**
21139   * Internal dependencies
21140   */
21141  
21142  
21143  /**
21144   * Checks if the current theme supports specific features and renders the children if supported.
21145   *
21146   * @param {Object}          props             The component props.
21147   * @param {React.ReactNode} props.children    The children to render if the theme supports the specified features.
21148   * @param {string|string[]} props.supportKeys The key(s) of the theme support(s) to check.
21149   *
21150   * @return {React.ReactNode} The rendered children if the theme supports the specified features, otherwise null.
21151   */
21152  function ThemeSupportCheck({
21153    children,
21154    supportKeys
21155  }) {
21156    const {
21157      postType,
21158      themeSupports
21159    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
21160      return {
21161        postType: select(store_store).getEditedPostAttribute('type'),
21162        themeSupports: select(external_wp_coreData_namespaceObject.store).getThemeSupports()
21163      };
21164    }, []);
21165    const isSupported = (Array.isArray(supportKeys) ? supportKeys : [supportKeys]).some(key => {
21166      var _themeSupports$key;
21167      const supported = (_themeSupports$key = themeSupports?.[key]) !== null && _themeSupports$key !== void 0 ? _themeSupports$key : false;
21168      // 'post-thumbnails' can be boolean or an array of post types.
21169      // In the latter case, we need to verify `postType` exists
21170      // within `supported`. If `postType` isn't passed, then the check
21171      // should fail.
21172      if ('post-thumbnails' === key && Array.isArray(supported)) {
21173        return supported.includes(postType);
21174      }
21175      return supported;
21176    });
21177    if (!isSupported) {
21178      return null;
21179    }
21180    return children;
21181  }
21182  
21183  ;// ./node_modules/@wordpress/editor/build-module/components/post-featured-image/check.js
21184  /**
21185   * Internal dependencies
21186   */
21187  
21188  
21189  
21190  /**
21191   * Wrapper component that renders its children only if the post type supports a featured image
21192   * and the theme supports post thumbnails.
21193   *
21194   * @param {Object}          props          Props.
21195   * @param {React.ReactNode} props.children Children to be rendered.
21196   *
21197   * @return {React.ReactNode} The rendered component.
21198   */
21199  
21200  function PostFeaturedImageCheck({
21201    children
21202  }) {
21203    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ThemeSupportCheck, {
21204      supportKeys: "post-thumbnails",
21205      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, {
21206        supportKeys: "thumbnail",
21207        children: children
21208      })
21209    });
21210  }
21211  /* harmony default export */ const post_featured_image_check = (PostFeaturedImageCheck);
21212  
21213  ;// ./node_modules/@wordpress/editor/build-module/components/post-featured-image/index.js
21214  /**
21215   * External dependencies
21216   */
21217  
21218  
21219  /**
21220   * WordPress dependencies
21221   */
21222  
21223  
21224  
21225  
21226  
21227  
21228  
21229  
21230  
21231  
21232  /**
21233   * Internal dependencies
21234   */
21235  
21236  
21237  
21238  const ALLOWED_MEDIA_TYPES = ['image'];
21239  
21240  // Used when labels from post type were not yet loaded or when they are not present.
21241  const DEFAULT_FEATURE_IMAGE_LABEL = (0,external_wp_i18n_namespaceObject.__)('Featured image');
21242  const DEFAULT_SET_FEATURE_IMAGE_LABEL = (0,external_wp_i18n_namespaceObject.__)('Add a featured image');
21243  const instructions = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
21244    children: (0,external_wp_i18n_namespaceObject.__)('To edit the featured image, you need permission to upload media.')
21245  });
21246  function getMediaDetails(media, postId) {
21247    var _media$media_details$, _media$media_details$2;
21248    if (!media) {
21249      return {};
21250    }
21251    const defaultSize = (0,external_wp_hooks_namespaceObject.applyFilters)('editor.PostFeaturedImage.imageSize', 'large', media.id, postId);
21252    if (defaultSize in ((_media$media_details$ = media?.media_details?.sizes) !== null && _media$media_details$ !== void 0 ? _media$media_details$ : {})) {
21253      return {
21254        mediaWidth: media.media_details.sizes[defaultSize].width,
21255        mediaHeight: media.media_details.sizes[defaultSize].height,
21256        mediaSourceUrl: media.media_details.sizes[defaultSize].source_url
21257      };
21258    }
21259  
21260    // Use fallbackSize when defaultSize is not available.
21261    const fallbackSize = (0,external_wp_hooks_namespaceObject.applyFilters)('editor.PostFeaturedImage.imageSize', 'thumbnail', media.id, postId);
21262    if (fallbackSize in ((_media$media_details$2 = media?.media_details?.sizes) !== null && _media$media_details$2 !== void 0 ? _media$media_details$2 : {})) {
21263      return {
21264        mediaWidth: media.media_details.sizes[fallbackSize].width,
21265        mediaHeight: media.media_details.sizes[fallbackSize].height,
21266        mediaSourceUrl: media.media_details.sizes[fallbackSize].source_url
21267      };
21268    }
21269  
21270    // Use full image size when fallbackSize and defaultSize are not available.
21271    return {
21272      mediaWidth: media.media_details.width,
21273      mediaHeight: media.media_details.height,
21274      mediaSourceUrl: media.source_url
21275    };
21276  }
21277  function PostFeaturedImage({
21278    currentPostId,
21279    featuredImageId,
21280    onUpdateImage,
21281    onRemoveImage,
21282    media,
21283    postType,
21284    noticeUI,
21285    noticeOperations,
21286    isRequestingFeaturedImageMedia
21287  }) {
21288    const returnsFocusRef = (0,external_wp_element_namespaceObject.useRef)(false);
21289    const [isLoading, setIsLoading] = (0,external_wp_element_namespaceObject.useState)(false);
21290    const {
21291      getSettings
21292    } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
21293    const {
21294      mediaSourceUrl
21295    } = getMediaDetails(media, currentPostId);
21296    function onDropFiles(filesList) {
21297      getSettings().mediaUpload({
21298        allowedTypes: ALLOWED_MEDIA_TYPES,
21299        filesList,
21300        onFileChange([image]) {
21301          if ((0,external_wp_blob_namespaceObject.isBlobURL)(image?.url)) {
21302            setIsLoading(true);
21303            return;
21304          }
21305          if (image) {
21306            onUpdateImage(image);
21307          }
21308          setIsLoading(false);
21309        },
21310        onError(message) {
21311          noticeOperations.removeAllNotices();
21312          noticeOperations.createErrorNotice(message);
21313        },
21314        multiple: false
21315      });
21316    }
21317  
21318    /**
21319     * Generates the featured image alt text for this editing context.
21320     *
21321     * @param {Object} imageMedia                               The image media object.
21322     * @param {string} imageMedia.alt_text                      The alternative text of the image.
21323     * @param {Object} imageMedia.media_details                 The media details of the image.
21324     * @param {Object} imageMedia.media_details.sizes           The sizes of the image.
21325     * @param {Object} imageMedia.media_details.sizes.full      The full size details of the image.
21326     * @param {string} imageMedia.media_details.sizes.full.file The file name of the full size image.
21327     * @param {string} imageMedia.slug                          The slug of the image.
21328     * @return {string} The featured image alt text.
21329     */
21330    function getImageDescription(imageMedia) {
21331      if (imageMedia.alt_text) {
21332        return (0,external_wp_i18n_namespaceObject.sprintf)(
21333        // Translators: %s: The selected image alt text.
21334        (0,external_wp_i18n_namespaceObject.__)('Current image: %s'), imageMedia.alt_text);
21335      }
21336      return (0,external_wp_i18n_namespaceObject.sprintf)(
21337      // Translators: %s: The selected image filename.
21338      (0,external_wp_i18n_namespaceObject.__)('The current image has no alternative text. The file name is: %s'), imageMedia.media_details.sizes?.full?.file || imageMedia.slug);
21339    }
21340    function returnFocus(node) {
21341      if (returnsFocusRef.current && node) {
21342        node.focus();
21343        returnsFocusRef.current = false;
21344      }
21345    }
21346    const isMissingMedia = !isRequestingFeaturedImageMedia && !!featuredImageId && !media;
21347    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(post_featured_image_check, {
21348      children: [noticeUI, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
21349        className: "editor-post-featured-image",
21350        children: [media && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
21351          id: `editor-post-featured-image-$featuredImageId}-describedby`,
21352          className: "hidden",
21353          children: getImageDescription(media)
21354        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, {
21355          fallback: instructions,
21356          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUpload, {
21357            title: postType?.labels?.featured_image || DEFAULT_FEATURE_IMAGE_LABEL,
21358            onSelect: onUpdateImage,
21359            unstableFeaturedImageFlow: true,
21360            allowedTypes: ALLOWED_MEDIA_TYPES,
21361            modalClass: "editor-post-featured-image__media-modal",
21362            render: ({
21363              open
21364            }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
21365              className: "editor-post-featured-image__container",
21366              children: [isMissingMedia ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, {
21367                status: "warning",
21368                isDismissible: false,
21369                children: (0,external_wp_i18n_namespaceObject.__)('Could not retrieve the featured image data.')
21370              }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, {
21371                __next40pxDefaultSize: true,
21372                ref: returnFocus,
21373                className: !featuredImageId ? 'editor-post-featured-image__toggle' : 'editor-post-featured-image__preview',
21374                onClick: open,
21375                "aria-label": !featuredImageId ? null : (0,external_wp_i18n_namespaceObject.__)('Edit or replace the featured image'),
21376                "aria-describedby": !featuredImageId ? null : `editor-post-featured-image-$featuredImageId}-describedby`,
21377                "aria-haspopup": "dialog",
21378                disabled: isLoading,
21379                accessibleWhenDisabled: true,
21380                children: [!!featuredImageId && media && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
21381                  className: "editor-post-featured-image__preview-image",
21382                  src: mediaSourceUrl,
21383                  alt: getImageDescription(media)
21384                }), (isLoading || isRequestingFeaturedImageMedia) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), !featuredImageId && !isLoading && (postType?.labels?.set_featured_image || DEFAULT_SET_FEATURE_IMAGE_LABEL)]
21385              }), !!featuredImageId && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
21386                className: dist_clsx('editor-post-featured-image__actions', {
21387                  'editor-post-featured-image__actions-missing-image': isMissingMedia,
21388                  'editor-post-featured-image__actions-is-requesting-image': isRequestingFeaturedImageMedia
21389                }),
21390                children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
21391                  __next40pxDefaultSize: true,
21392                  className: "editor-post-featured-image__action",
21393                  onClick: open,
21394                  "aria-haspopup": "dialog",
21395                  variant: isMissingMedia ? 'secondary' : undefined,
21396                  children: (0,external_wp_i18n_namespaceObject.__)('Replace')
21397                }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
21398                  __next40pxDefaultSize: true,
21399                  className: "editor-post-featured-image__action",
21400                  onClick: () => {
21401                    onRemoveImage();
21402                    // Signal that the toggle button should be focused,
21403                    // when it is rendered. Can't focus it directly here
21404                    // because it's rendered conditionally.
21405                    returnsFocusRef.current = true;
21406                  },
21407                  variant: isMissingMedia ? 'secondary' : undefined,
21408                  isDestructive: isMissingMedia,
21409                  children: (0,external_wp_i18n_namespaceObject.__)('Remove')
21410                })]
21411              }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropZone, {
21412                onFilesDrop: onDropFiles
21413              })]
21414            }),
21415            value: featuredImageId
21416          })
21417        })]
21418      })]
21419    });
21420  }
21421  const applyWithSelect = (0,external_wp_data_namespaceObject.withSelect)(select => {
21422    const {
21423      getMedia,
21424      getPostType,
21425      hasFinishedResolution
21426    } = select(external_wp_coreData_namespaceObject.store);
21427    const {
21428      getCurrentPostId,
21429      getEditedPostAttribute
21430    } = select(store_store);
21431    const featuredImageId = getEditedPostAttribute('featured_media');
21432    return {
21433      media: featuredImageId ? getMedia(featuredImageId, {
21434        context: 'view'
21435      }) : null,
21436      currentPostId: getCurrentPostId(),
21437      postType: getPostType(getEditedPostAttribute('type')),
21438      featuredImageId,
21439      isRequestingFeaturedImageMedia: !!featuredImageId && !hasFinishedResolution('getMedia', [featuredImageId, {
21440        context: 'view'
21441      }])
21442    };
21443  });
21444  const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, {
21445    noticeOperations
21446  }, {
21447    select
21448  }) => {
21449    const {
21450      editPost
21451    } = dispatch(store_store);
21452    return {
21453      onUpdateImage(image) {
21454        editPost({
21455          featured_media: image.id
21456        });
21457      },
21458      onDropImage(filesList) {
21459        select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload({
21460          allowedTypes: ['image'],
21461          filesList,
21462          onFileChange([image]) {
21463            editPost({
21464              featured_media: image.id
21465            });
21466          },
21467          onError(message) {
21468            noticeOperations.removeAllNotices();
21469            noticeOperations.createErrorNotice(message);
21470          },
21471          multiple: false
21472        });
21473      },
21474      onRemoveImage() {
21475        editPost({
21476          featured_media: 0
21477        });
21478      }
21479    };
21480  });
21481  
21482  /**
21483   * Renders the component for managing the featured image of a post.
21484   *
21485   * @param {Object}   props                  Props.
21486   * @param {number}   props.currentPostId    ID of the current post.
21487   * @param {number}   props.featuredImageId  ID of the featured image.
21488   * @param {Function} props.onUpdateImage    Function to call when the image is updated.
21489   * @param {Function} props.onRemoveImage    Function to call when the image is removed.
21490   * @param {Object}   props.media            The media object representing the featured image.
21491   * @param {string}   props.postType         Post type.
21492   * @param {Element}  props.noticeUI         UI for displaying notices.
21493   * @param {Object}   props.noticeOperations Operations for managing notices.
21494   *
21495   * @return {Element} Component to be rendered .
21496   */
21497  /* harmony default export */ const post_featured_image = ((0,external_wp_compose_namespaceObject.compose)(external_wp_components_namespaceObject.withNotices, applyWithSelect, applyWithDispatch, (0,external_wp_components_namespaceObject.withFilters)('editor.PostFeaturedImage'))(PostFeaturedImage));
21498  
21499  ;// ./node_modules/@wordpress/editor/build-module/components/post-featured-image/panel.js
21500  /**
21501   * WordPress dependencies
21502   */
21503  
21504  
21505  
21506  
21507  
21508  /**
21509   * Internal dependencies
21510   */
21511  
21512  
21513  
21514  
21515  const post_featured_image_panel_PANEL_NAME = 'featured-image';
21516  
21517  /**
21518   * Renders the panel for the post featured image.
21519   *
21520   * @param {Object}  props               Props.
21521   * @param {boolean} props.withPanelBody Whether to include the panel body. Default true.
21522   *
21523   * @return {React.ReactNode} The component to be rendered.
21524   * Return Null if the editor panel is disabled for featured image.
21525   */
21526  function PostFeaturedImagePanel({
21527    withPanelBody = true
21528  }) {
21529    var _postType$labels$feat;
21530    const {
21531      postType,
21532      isEnabled,
21533      isOpened
21534    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
21535      const {
21536        getEditedPostAttribute,
21537        isEditorPanelEnabled,
21538        isEditorPanelOpened
21539      } = select(store_store);
21540      const {
21541        getPostType
21542      } = select(external_wp_coreData_namespaceObject.store);
21543      return {
21544        postType: getPostType(getEditedPostAttribute('type')),
21545        isEnabled: isEditorPanelEnabled(post_featured_image_panel_PANEL_NAME),
21546        isOpened: isEditorPanelOpened(post_featured_image_panel_PANEL_NAME)
21547      };
21548    }, []);
21549    const {
21550      toggleEditorPanelOpened
21551    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
21552    if (!isEnabled) {
21553      return null;
21554    }
21555    if (!withPanelBody) {
21556      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_featured_image_check, {
21557        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_featured_image, {})
21558      });
21559    }
21560    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_featured_image_check, {
21561      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
21562        title: (_postType$labels$feat = postType?.labels?.featured_image) !== null && _postType$labels$feat !== void 0 ? _postType$labels$feat : (0,external_wp_i18n_namespaceObject.__)('Featured image'),
21563        opened: isOpened,
21564        onToggle: () => toggleEditorPanelOpened(post_featured_image_panel_PANEL_NAME),
21565        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_featured_image, {})
21566      })
21567    });
21568  }
21569  
21570  ;// ./node_modules/@wordpress/editor/build-module/components/post-format/check.js
21571  /**
21572   * WordPress dependencies
21573   */
21574  
21575  
21576  /**
21577   * Internal dependencies
21578   */
21579  
21580  
21581  
21582  /**
21583   * Component check if there are any post formats.
21584   *
21585   * @param {Object}          props          The component props.
21586   * @param {React.ReactNode} props.children The child elements to render.
21587   *
21588   * @return {React.ReactNode} The rendered component or null if post formats are disabled.
21589   */
21590  
21591  function PostFormatCheck({
21592    children
21593  }) {
21594    const disablePostFormats = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getEditorSettings().disablePostFormats, []);
21595    if (disablePostFormats) {
21596      return null;
21597    }
21598    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, {
21599      supportKeys: "post-formats",
21600      children: children
21601    });
21602  }
21603  
21604  ;// ./node_modules/@wordpress/editor/build-module/components/post-format/index.js
21605  /**
21606   * WordPress dependencies
21607   */
21608  
21609  
21610  
21611  
21612  
21613  
21614  /**
21615   * Internal dependencies
21616   */
21617  
21618  
21619  
21620  // All WP post formats, sorted alphabetically by translated name.
21621  
21622  const POST_FORMATS = [{
21623    id: 'aside',
21624    caption: (0,external_wp_i18n_namespaceObject.__)('Aside')
21625  }, {
21626    id: 'audio',
21627    caption: (0,external_wp_i18n_namespaceObject.__)('Audio')
21628  }, {
21629    id: 'chat',
21630    caption: (0,external_wp_i18n_namespaceObject.__)('Chat')
21631  }, {
21632    id: 'gallery',
21633    caption: (0,external_wp_i18n_namespaceObject.__)('Gallery')
21634  }, {
21635    id: 'image',
21636    caption: (0,external_wp_i18n_namespaceObject.__)('Image')
21637  }, {
21638    id: 'link',
21639    caption: (0,external_wp_i18n_namespaceObject.__)('Link')
21640  }, {
21641    id: 'quote',
21642    caption: (0,external_wp_i18n_namespaceObject.__)('Quote')
21643  }, {
21644    id: 'standard',
21645    caption: (0,external_wp_i18n_namespaceObject.__)('Standard')
21646  }, {
21647    id: 'status',
21648    caption: (0,external_wp_i18n_namespaceObject.__)('Status')
21649  }, {
21650    id: 'video',
21651    caption: (0,external_wp_i18n_namespaceObject.__)('Video')
21652  }].sort((a, b) => {
21653    const normalizedA = a.caption.toUpperCase();
21654    const normalizedB = b.caption.toUpperCase();
21655    if (normalizedA < normalizedB) {
21656      return -1;
21657    }
21658    if (normalizedA > normalizedB) {
21659      return 1;
21660    }
21661    return 0;
21662  });
21663  
21664  /**
21665   * `PostFormat` a component that allows changing the post format while also providing a suggestion for the current post.
21666   *
21667   * @example
21668   * ```jsx
21669   * <PostFormat />
21670   * ```
21671   *
21672   * @return {React.ReactNode} The rendered PostFormat component.
21673   */
21674  function PostFormat() {
21675    const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostFormat);
21676    const postFormatSelectorId = `post-format-selector-$instanceId}`;
21677    const {
21678      postFormat,
21679      suggestedFormat,
21680      supportedFormats
21681    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
21682      const {
21683        getEditedPostAttribute,
21684        getSuggestedPostFormat
21685      } = select(store_store);
21686      const _postFormat = getEditedPostAttribute('format');
21687      const themeSupports = select(external_wp_coreData_namespaceObject.store).getThemeSupports();
21688      return {
21689        postFormat: _postFormat !== null && _postFormat !== void 0 ? _postFormat : 'standard',
21690        suggestedFormat: getSuggestedPostFormat(),
21691        supportedFormats: themeSupports.formats
21692      };
21693    }, []);
21694    const formats = POST_FORMATS.filter(format => {
21695      // Ensure current format is always in the set.
21696      // The current format may not be a format supported by the theme.
21697      return supportedFormats?.includes(format.id) || postFormat === format.id;
21698    });
21699    const suggestion = formats.find(format => format.id === suggestedFormat);
21700    const {
21701      editPost
21702    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
21703    const onUpdatePostFormat = format => editPost({
21704      format
21705    });
21706    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostFormatCheck, {
21707      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
21708        className: "editor-post-format",
21709        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RadioControl, {
21710          className: "editor-post-format__options",
21711          label: (0,external_wp_i18n_namespaceObject.__)('Post Format'),
21712          selected: postFormat,
21713          onChange: format => onUpdatePostFormat(format),
21714          id: postFormatSelectorId,
21715          options: formats.map(format => ({
21716            label: format.caption,
21717            value: format.id
21718          })),
21719          hideLabelFromVision: true
21720        }), suggestion && suggestion.id !== postFormat && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
21721          className: "editor-post-format__suggestion",
21722          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
21723            __next40pxDefaultSize: true,
21724            variant: "link",
21725            onClick: () => onUpdatePostFormat(suggestion.id),
21726            children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: post format */
21727            (0,external_wp_i18n_namespaceObject.__)('Apply suggested format: %s'), suggestion.caption)
21728          })
21729        })]
21730      })
21731    });
21732  }
21733  
21734  ;// ./node_modules/@wordpress/editor/build-module/components/post-last-revision/check.js
21735  /**
21736   * WordPress dependencies
21737   */
21738  
21739  
21740  /**
21741   * Internal dependencies
21742   */
21743  
21744  
21745  
21746  /**
21747   * Wrapper component that renders its children if the post has more than one revision.
21748   *
21749   * @param {Object}          props          Props.
21750   * @param {React.ReactNode} props.children Children to be rendered.
21751   *
21752   * @return {React.ReactNode} Rendered child components if post has more than one revision, otherwise null.
21753   */
21754  
21755  function PostLastRevisionCheck({
21756    children
21757  }) {
21758    const {
21759      lastRevisionId,
21760      revisionsCount
21761    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
21762      const {
21763        getCurrentPostLastRevisionId,
21764        getCurrentPostRevisionsCount
21765      } = select(store_store);
21766      return {
21767        lastRevisionId: getCurrentPostLastRevisionId(),
21768        revisionsCount: getCurrentPostRevisionsCount()
21769      };
21770    }, []);
21771    if (!lastRevisionId || revisionsCount < 2) {
21772      return null;
21773    }
21774    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, {
21775      supportKeys: "revisions",
21776      children: children
21777    });
21778  }
21779  /* harmony default export */ const post_last_revision_check = (PostLastRevisionCheck);
21780  
21781  ;// ./node_modules/@wordpress/editor/build-module/components/post-last-revision/index.js
21782  /**
21783   * WordPress dependencies
21784   */
21785  
21786  
21787  
21788  
21789  
21790  
21791  /**
21792   * Internal dependencies
21793   */
21794  
21795  
21796  
21797  
21798  function usePostLastRevisionInfo() {
21799    return (0,external_wp_data_namespaceObject.useSelect)(select => {
21800      const {
21801        getCurrentPostLastRevisionId,
21802        getCurrentPostRevisionsCount
21803      } = select(store_store);
21804      return {
21805        lastRevisionId: getCurrentPostLastRevisionId(),
21806        revisionsCount: getCurrentPostRevisionsCount()
21807      };
21808    }, []);
21809  }
21810  
21811  /**
21812   * Renders the component for displaying the last revision of a post.
21813   *
21814   * @return {React.ReactNode} The rendered component.
21815   */
21816  function PostLastRevision() {
21817    const {
21818      lastRevisionId,
21819      revisionsCount
21820    } = usePostLastRevisionInfo();
21821    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_last_revision_check, {
21822      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
21823        __next40pxDefaultSize: true,
21824        href: (0,external_wp_url_namespaceObject.addQueryArgs)('revision.php', {
21825          revision: lastRevisionId
21826        }),
21827        className: "editor-post-last-revision__title",
21828        icon: library_backup,
21829        iconPosition: "right",
21830        text: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: number of revisions. */
21831        (0,external_wp_i18n_namespaceObject.__)('Revisions (%s)'), revisionsCount)
21832      })
21833    });
21834  }
21835  function PrivatePostLastRevision() {
21836    const {
21837      lastRevisionId,
21838      revisionsCount
21839    } = usePostLastRevisionInfo();
21840    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_last_revision_check, {
21841      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
21842        label: (0,external_wp_i18n_namespaceObject.__)('Revisions'),
21843        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
21844          href: (0,external_wp_url_namespaceObject.addQueryArgs)('revision.php', {
21845            revision: lastRevisionId
21846          }),
21847          className: "editor-private-post-last-revision__button",
21848          text: revisionsCount,
21849          variant: "tertiary",
21850          size: "compact"
21851        })
21852      })
21853    });
21854  }
21855  /* harmony default export */ const post_last_revision = (PostLastRevision);
21856  
21857  ;// ./node_modules/@wordpress/editor/build-module/components/post-last-revision/panel.js
21858  /**
21859   * WordPress dependencies
21860   */
21861  
21862  
21863  /**
21864   * Internal dependencies
21865   */
21866  
21867  
21868  
21869  /**
21870   * Renders the panel for displaying the last revision of a post.
21871   *
21872   * @return {React.ReactNode} The rendered component.
21873   */
21874  
21875  function PostLastRevisionPanel() {
21876    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_last_revision_check, {
21877      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
21878        className: "editor-post-last-revision__panel",
21879        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_last_revision, {})
21880      })
21881    });
21882  }
21883  /* harmony default export */ const post_last_revision_panel = (PostLastRevisionPanel);
21884  
21885  ;// ./node_modules/@wordpress/editor/build-module/components/post-locked-modal/index.js
21886  /**
21887   * WordPress dependencies
21888   */
21889  
21890  
21891  
21892  
21893  
21894  
21895  
21896  
21897  
21898  /**
21899   * Internal dependencies
21900   */
21901  
21902  
21903  /**
21904   * A modal component that is displayed when a post is locked for editing by another user.
21905   * The modal provides information about the lock status and options to take over or exit the editor.
21906   *
21907   * @return {React.ReactNode} The rendered PostLockedModal component.
21908   */
21909  
21910  function PostLockedModal() {
21911    const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostLockedModal);
21912    const hookName = 'core/editor/post-locked-modal-' + instanceId;
21913    const {
21914      autosave,
21915      updatePostLock
21916    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
21917    const {
21918      isLocked,
21919      isTakeover,
21920      user,
21921      postId,
21922      postLockUtils,
21923      activePostLock,
21924      postType,
21925      previewLink
21926    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
21927      const {
21928        isPostLocked,
21929        isPostLockTakeover,
21930        getPostLockUser,
21931        getCurrentPostId,
21932        getActivePostLock,
21933        getEditedPostAttribute,
21934        getEditedPostPreviewLink,
21935        getEditorSettings
21936      } = select(store_store);
21937      const {
21938        getPostType
21939      } = select(external_wp_coreData_namespaceObject.store);
21940      return {
21941        isLocked: isPostLocked(),
21942        isTakeover: isPostLockTakeover(),
21943        user: getPostLockUser(),
21944        postId: getCurrentPostId(),
21945        postLockUtils: getEditorSettings().postLockUtils,
21946        activePostLock: getActivePostLock(),
21947        postType: getPostType(getEditedPostAttribute('type')),
21948        previewLink: getEditedPostPreviewLink()
21949      };
21950    }, []);
21951    (0,external_wp_element_namespaceObject.useEffect)(() => {
21952      /**
21953       * Keep the lock refreshed.
21954       *
21955       * When the user does not send a heartbeat in a heartbeat-tick
21956       * the user is no longer editing and another user can start editing.
21957       *
21958       * @param {Object} data Data to send in the heartbeat request.
21959       */
21960      function sendPostLock(data) {
21961        if (isLocked) {
21962          return;
21963        }
21964        data['wp-refresh-post-lock'] = {
21965          lock: activePostLock,
21966          post_id: postId
21967        };
21968      }
21969  
21970      /**
21971       * Refresh post locks: update the lock string or show the dialog if somebody has taken over editing.
21972       *
21973       * @param {Object} data Data received in the heartbeat request
21974       */
21975      function receivePostLock(data) {
21976        if (!data['wp-refresh-post-lock']) {
21977          return;
21978        }
21979        const received = data['wp-refresh-post-lock'];
21980        if (received.lock_error) {
21981          // Auto save and display the takeover modal.
21982          autosave();
21983          updatePostLock({
21984            isLocked: true,
21985            isTakeover: true,
21986            user: {
21987              name: received.lock_error.name,
21988              avatar: received.lock_error.avatar_src_2x
21989            }
21990          });
21991        } else if (received.new_lock) {
21992          updatePostLock({
21993            isLocked: false,
21994            activePostLock: received.new_lock
21995          });
21996        }
21997      }
21998  
21999      /**
22000       * Unlock the post before the window is exited.
22001       */
22002      function releasePostLock() {
22003        if (isLocked || !activePostLock) {
22004          return;
22005        }
22006        const data = new window.FormData();
22007        data.append('action', 'wp-remove-post-lock');
22008        data.append('_wpnonce', postLockUtils.unlockNonce);
22009        data.append('post_ID', postId);
22010        data.append('active_post_lock', activePostLock);
22011        if (window.navigator.sendBeacon) {
22012          window.navigator.sendBeacon(postLockUtils.ajaxUrl, data);
22013        } else {
22014          const xhr = new window.XMLHttpRequest();
22015          xhr.open('POST', postLockUtils.ajaxUrl, false);
22016          xhr.send(data);
22017        }
22018      }
22019  
22020      // Details on these events on the Heartbeat API docs
22021      // https://developer.wordpress.org/plugins/javascript/heartbeat-api/
22022      (0,external_wp_hooks_namespaceObject.addAction)('heartbeat.send', hookName, sendPostLock);
22023      (0,external_wp_hooks_namespaceObject.addAction)('heartbeat.tick', hookName, receivePostLock);
22024      window.addEventListener('beforeunload', releasePostLock);
22025      return () => {
22026        (0,external_wp_hooks_namespaceObject.removeAction)('heartbeat.send', hookName);
22027        (0,external_wp_hooks_namespaceObject.removeAction)('heartbeat.tick', hookName);
22028        window.removeEventListener('beforeunload', releasePostLock);
22029      };
22030    }, []);
22031    if (!isLocked) {
22032      return null;
22033    }
22034    const userDisplayName = user.name;
22035    const userAvatar = user.avatar;
22036    const unlockUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('post.php', {
22037      'get-post-lock': '1',
22038      lockKey: true,
22039      post: postId,
22040      action: 'edit',
22041      _wpnonce: postLockUtils.nonce
22042    });
22043    const allPostsUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', {
22044      post_type: postType?.slug
22045    });
22046    const allPostsLabel = (0,external_wp_i18n_namespaceObject.__)('Exit editor');
22047    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
22048      title: isTakeover ? (0,external_wp_i18n_namespaceObject.__)('Someone else has taken over this post') : (0,external_wp_i18n_namespaceObject.__)('This post is already being edited'),
22049      focusOnMount: true,
22050      shouldCloseOnClickOutside: false,
22051      shouldCloseOnEsc: false,
22052      isDismissible: false
22053      // Do not remove this class, as this class is used by third party plugins.
22054      ,
22055      className: "editor-post-locked-modal",
22056      size: "medium",
22057      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
22058        alignment: "top",
22059        spacing: 6,
22060        children: [!!userAvatar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
22061          src: userAvatar,
22062          alt: (0,external_wp_i18n_namespaceObject.__)('Avatar'),
22063          className: "editor-post-locked-modal__avatar",
22064          width: 64,
22065          height: 64
22066        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
22067          children: [!!isTakeover && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
22068            children: (0,external_wp_element_namespaceObject.createInterpolateElement)(userDisplayName ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: user's display name */
22069            (0,external_wp_i18n_namespaceObject.__)('<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'), userDisplayName) : (0,external_wp_i18n_namespaceObject.__)('Another user now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'), {
22070              strong: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {}),
22071              PreviewLink: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
22072                href: previewLink,
22073                children: (0,external_wp_i18n_namespaceObject.__)('preview')
22074              })
22075            })
22076          }), !isTakeover && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
22077            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
22078              children: (0,external_wp_element_namespaceObject.createInterpolateElement)(userDisplayName ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: user's display name */
22079              (0,external_wp_i18n_namespaceObject.__)('<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'), userDisplayName) : (0,external_wp_i18n_namespaceObject.__)('Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'), {
22080                strong: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {}),
22081                PreviewLink: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
22082                  href: previewLink,
22083                  children: (0,external_wp_i18n_namespaceObject.__)('preview')
22084                })
22085              })
22086            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
22087              children: (0,external_wp_i18n_namespaceObject.__)('If you take over, the other user will lose editing control to the post, but their changes will be saved.')
22088            })]
22089          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
22090            className: "editor-post-locked-modal__buttons",
22091            justify: "flex-end",
22092            children: [!isTakeover && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
22093              __next40pxDefaultSize: true,
22094              variant: "tertiary",
22095              href: unlockUrl,
22096              children: (0,external_wp_i18n_namespaceObject.__)('Take over')
22097            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
22098              __next40pxDefaultSize: true,
22099              variant: "primary",
22100              href: allPostsUrl,
22101              children: allPostsLabel
22102            })]
22103          })]
22104        })]
22105      })
22106    });
22107  }
22108  
22109  ;// ./node_modules/@wordpress/editor/build-module/components/post-pending-status/check.js
22110  /**
22111   * WordPress dependencies
22112   */
22113  
22114  
22115  /**
22116   * Internal dependencies
22117   */
22118  
22119  
22120  /**
22121   * This component checks the publishing status of the current post.
22122   * If the post is already published or the user doesn't have the
22123   * capability to publish, it returns null.
22124   *
22125   * @param {Object}          props          Component properties.
22126   * @param {React.ReactNode} props.children Children to be rendered.
22127   *
22128   * @return {React.ReactNode} The rendered child elements or null if the post is already published or the user doesn't have the capability to publish.
22129   */
22130  function PostPendingStatusCheck({
22131    children
22132  }) {
22133    const {
22134      hasPublishAction,
22135      isPublished
22136    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
22137      var _getCurrentPost$_link;
22138      const {
22139        isCurrentPostPublished,
22140        getCurrentPost
22141      } = select(store_store);
22142      return {
22143        hasPublishAction: (_getCurrentPost$_link = getCurrentPost()._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false,
22144        isPublished: isCurrentPostPublished()
22145      };
22146    }, []);
22147    if (isPublished || !hasPublishAction) {
22148      return null;
22149    }
22150    return children;
22151  }
22152  /* harmony default export */ const post_pending_status_check = (PostPendingStatusCheck);
22153  
22154  ;// ./node_modules/@wordpress/editor/build-module/components/post-pending-status/index.js
22155  /**
22156   * WordPress dependencies
22157   */
22158  
22159  
22160  
22161  
22162  /**
22163   * Internal dependencies
22164   */
22165  
22166  
22167  
22168  /**
22169   * A component for displaying and toggling the pending status of a post.
22170   *
22171   * @return {React.ReactNode} The rendered component.
22172   */
22173  
22174  function PostPendingStatus() {
22175    const status = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getEditedPostAttribute('status'), []);
22176    const {
22177      editPost
22178    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
22179    const togglePendingStatus = () => {
22180      const updatedStatus = status === 'pending' ? 'draft' : 'pending';
22181      editPost({
22182        status: updatedStatus
22183      });
22184    };
22185    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_pending_status_check, {
22186      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, {
22187        __nextHasNoMarginBottom: true,
22188        label: (0,external_wp_i18n_namespaceObject.__)('Pending review'),
22189        checked: status === 'pending',
22190        onChange: togglePendingStatus
22191      })
22192    });
22193  }
22194  /* harmony default export */ const post_pending_status = (PostPendingStatus);
22195  
22196  ;// ./node_modules/@wordpress/editor/build-module/components/post-preview-button/index.js
22197  /**
22198   * WordPress dependencies
22199   */
22200  
22201  
22202  
22203  
22204  
22205  
22206  
22207  /**
22208   * Internal dependencies
22209   */
22210  
22211  
22212  function writeInterstitialMessage(targetDocument) {
22213    let markup = (0,external_wp_element_namespaceObject.renderToString)(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
22214      className: "editor-post-preview-button__interstitial-message",
22215      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, {
22216        xmlns: "http://www.w3.org/2000/svg",
22217        viewBox: "0 0 96 96",
22218        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
22219          className: "outer",
22220          d: "M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",
22221          fill: "none"
22222        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
22223          className: "inner",
22224          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",
22225          fill: "none"
22226        })]
22227      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
22228        children: (0,external_wp_i18n_namespaceObject.__)('Generating preview…')
22229      })]
22230    }));
22231    markup += `
22232          <style>
22233              body {
22234                  margin: 0;
22235              }
22236              .editor-post-preview-button__interstitial-message {
22237                  display: flex;
22238                  flex-direction: column;
22239                  align-items: center;
22240                  justify-content: center;
22241                  height: 100vh;
22242                  width: 100vw;
22243              }
22244              @-webkit-keyframes paint {
22245                  0% {
22246                      stroke-dashoffset: 0;
22247                  }
22248              }
22249              @-moz-keyframes paint {
22250                  0% {
22251                      stroke-dashoffset: 0;
22252                  }
22253              }
22254              @-o-keyframes paint {
22255                  0% {
22256                      stroke-dashoffset: 0;
22257                  }
22258              }
22259              @keyframes paint {
22260                  0% {
22261                      stroke-dashoffset: 0;
22262                  }
22263              }
22264              .editor-post-preview-button__interstitial-message svg {
22265                  width: 192px;
22266                  height: 192px;
22267                  stroke: #555d66;
22268                  stroke-width: 0.75;
22269              }
22270              .editor-post-preview-button__interstitial-message svg .outer,
22271              .editor-post-preview-button__interstitial-message svg .inner {
22272                  stroke-dasharray: 280;
22273                  stroke-dashoffset: 280;
22274                  -webkit-animation: paint 1.5s ease infinite alternate;
22275                  -moz-animation: paint 1.5s ease infinite alternate;
22276                  -o-animation: paint 1.5s ease infinite alternate;
22277                  animation: paint 1.5s ease infinite alternate;
22278              }
22279              p {
22280                  text-align: center;
22281                  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
22282              }
22283          </style>
22284      `;
22285  
22286    /**
22287     * Filters the interstitial message shown when generating previews.
22288     *
22289     * @param {string} markup The preview interstitial markup.
22290     */
22291    markup = (0,external_wp_hooks_namespaceObject.applyFilters)('editor.PostPreview.interstitialMarkup', markup);
22292    targetDocument.write(markup);
22293    targetDocument.title = (0,external_wp_i18n_namespaceObject.__)('Generating preview…');
22294    targetDocument.close();
22295  }
22296  
22297  /**
22298   * Renders a button that opens a new window or tab for the preview,
22299   * writes the interstitial message to this window, and then navigates
22300   * to the actual preview link. The button is not rendered if the post
22301   * is not viewable and disabled if the post is not saveable.
22302   *
22303   * @param {Object}   props                     The component props.
22304   * @param {string}   props.className           The class name for the button.
22305   * @param {string}   props.textContent         The text content for the button.
22306   * @param {boolean}  props.forceIsAutosaveable Whether to force autosave.
22307   * @param {string}   props.role                The role attribute for the button.
22308   * @param {Function} props.onPreview           The callback function for preview event.
22309   *
22310   * @return {React.ReactNode} The rendered button component.
22311   */
22312  function PostPreviewButton({
22313    className,
22314    textContent,
22315    forceIsAutosaveable,
22316    role,
22317    onPreview
22318  }) {
22319    const {
22320      postId,
22321      currentPostLink,
22322      previewLink,
22323      isSaveable,
22324      isViewable
22325    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
22326      var _postType$viewable;
22327      const editor = select(store_store);
22328      const core = select(external_wp_coreData_namespaceObject.store);
22329      const postType = core.getPostType(editor.getCurrentPostType('type'));
22330      const canView = (_postType$viewable = postType?.viewable) !== null && _postType$viewable !== void 0 ? _postType$viewable : false;
22331      if (!canView) {
22332        return {
22333          isViewable: canView
22334        };
22335      }
22336      return {
22337        postId: editor.getCurrentPostId(),
22338        currentPostLink: editor.getCurrentPostAttribute('link'),
22339        previewLink: editor.getEditedPostPreviewLink(),
22340        isSaveable: editor.isEditedPostSaveable(),
22341        isViewable: canView
22342      };
22343    }, []);
22344    const {
22345      __unstableSaveForPreview
22346    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
22347    if (!isViewable) {
22348      return null;
22349    }
22350    const targetId = `wp-preview-$postId}`;
22351    const openPreviewWindow = async event => {
22352      // Our Preview button has its 'href' and 'target' set correctly for a11y
22353      // purposes. Unfortunately, though, we can't rely on the default 'click'
22354      // handler since sometimes it incorrectly opens a new tab instead of reusing
22355      // the existing one.
22356      // https://github.com/WordPress/gutenberg/pull/8330
22357      event.preventDefault();
22358  
22359      // Open up a Preview tab if needed. This is where we'll show the preview.
22360      const previewWindow = window.open('', targetId);
22361  
22362      // Focus the Preview tab. This might not do anything, depending on the browser's
22363      // and user's preferences.
22364      // https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus
22365      previewWindow.focus();
22366      writeInterstitialMessage(previewWindow.document);
22367      const link = await __unstableSaveForPreview({
22368        forceIsAutosaveable
22369      });
22370      previewWindow.location = link;
22371      onPreview?.();
22372    };
22373  
22374    // Link to the `?preview=true` URL if we have it, since this lets us see
22375    // changes that were autosaved since the post was last published. Otherwise,
22376    // just link to the post's URL.
22377    const href = previewLink || currentPostLink;
22378    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
22379      variant: !className ? 'tertiary' : undefined,
22380      className: className || 'editor-post-preview',
22381      href: href,
22382      target: targetId,
22383      accessibleWhenDisabled: true,
22384      disabled: !isSaveable,
22385      onClick: openPreviewWindow,
22386      role: role,
22387      size: "compact",
22388      children: textContent || /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
22389        children: [(0,external_wp_i18n_namespaceObject._x)('Preview', 'imperative verb'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
22390          as: "span",
22391          children: /* translators: accessibility text */
22392          (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)')
22393        })]
22394      })
22395    });
22396  }
22397  
22398  ;// ./node_modules/@wordpress/editor/build-module/components/post-publish-button/label.js
22399  /**
22400   * WordPress dependencies
22401   */
22402  
22403  
22404  
22405  
22406  /**
22407   * Internal dependencies
22408   */
22409  
22410  
22411  /**
22412   * Renders the label for the publish button.
22413   *
22414   * @return {string} The label for the publish button.
22415   */
22416  function PublishButtonLabel() {
22417    const isSmallerThanMediumViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
22418    const {
22419      isPublished,
22420      isBeingScheduled,
22421      isSaving,
22422      isPublishing,
22423      hasPublishAction,
22424      isAutosaving,
22425      hasNonPostEntityChanges,
22426      postStatusHasChanged,
22427      postStatus
22428    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
22429      var _getCurrentPost$_link;
22430      const {
22431        isCurrentPostPublished,
22432        isEditedPostBeingScheduled,
22433        isSavingPost,
22434        isPublishingPost,
22435        getCurrentPost,
22436        getCurrentPostType,
22437        isAutosavingPost,
22438        getPostEdits,
22439        getEditedPostAttribute
22440      } = select(store_store);
22441      return {
22442        isPublished: isCurrentPostPublished(),
22443        isBeingScheduled: isEditedPostBeingScheduled(),
22444        isSaving: isSavingPost(),
22445        isPublishing: isPublishingPost(),
22446        hasPublishAction: (_getCurrentPost$_link = getCurrentPost()._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false,
22447        postType: getCurrentPostType(),
22448        isAutosaving: isAutosavingPost(),
22449        hasNonPostEntityChanges: select(store_store).hasNonPostEntityChanges(),
22450        postStatusHasChanged: !!getPostEdits()?.status,
22451        postStatus: getEditedPostAttribute('status')
22452      };
22453    }, []);
22454    if (isPublishing) {
22455      /* translators: button label text should, if possible, be under 16 characters. */
22456      return (0,external_wp_i18n_namespaceObject.__)('Publishing…');
22457    } else if ((isPublished || isBeingScheduled) && isSaving && !isAutosaving) {
22458      /* translators: button label text should, if possible, be under 16 characters. */
22459      return (0,external_wp_i18n_namespaceObject.__)('Saving…');
22460    }
22461    if (!hasPublishAction) {
22462      // TODO: this is because "Submit for review" string is too long in some languages.
22463      // @see https://github.com/WordPress/gutenberg/issues/10475
22464      return isSmallerThanMediumViewport ? (0,external_wp_i18n_namespaceObject.__)('Publish') : (0,external_wp_i18n_namespaceObject.__)('Submit for Review');
22465    }
22466    if (hasNonPostEntityChanges || isPublished || postStatusHasChanged && !['future', 'publish'].includes(postStatus) || !postStatusHasChanged && postStatus === 'future') {
22467      return (0,external_wp_i18n_namespaceObject.__)('Save');
22468    }
22469    if (isBeingScheduled) {
22470      return (0,external_wp_i18n_namespaceObject.__)('Schedule');
22471    }
22472    return (0,external_wp_i18n_namespaceObject.__)('Publish');
22473  }
22474  
22475  ;// ./node_modules/@wordpress/editor/build-module/components/post-publish-button/index.js
22476  /**
22477   * WordPress dependencies
22478   */
22479  
22480  
22481  
22482  
22483  
22484  /**
22485   * Internal dependencies
22486   */
22487  
22488  
22489  
22490  const post_publish_button_noop = () => {};
22491  class PostPublishButton extends external_wp_element_namespaceObject.Component {
22492    constructor(props) {
22493      super(props);
22494      this.createOnClick = this.createOnClick.bind(this);
22495      this.closeEntitiesSavedStates = this.closeEntitiesSavedStates.bind(this);
22496      this.state = {
22497        entitiesSavedStatesCallback: false
22498      };
22499    }
22500    createOnClick(callback) {
22501      return (...args) => {
22502        const {
22503          hasNonPostEntityChanges,
22504          setEntitiesSavedStatesCallback
22505        } = this.props;
22506        // If a post with non-post entities is published, but the user
22507        // elects to not save changes to the non-post entities, those
22508        // entities will still be dirty when the Publish button is clicked.
22509        // We also need to check that the `setEntitiesSavedStatesCallback`
22510        // prop was passed. See https://github.com/WordPress/gutenberg/pull/37383
22511        if (hasNonPostEntityChanges && setEntitiesSavedStatesCallback) {
22512          // The modal for multiple entity saving will open,
22513          // hold the callback for saving/publishing the post
22514          // so that we can call it if the post entity is checked.
22515          this.setState({
22516            entitiesSavedStatesCallback: () => callback(...args)
22517          });
22518  
22519          // Open the save panel by setting its callback.
22520          // To set a function on the useState hook, we must set it
22521          // with another function (() => myFunction). Passing the
22522          // function on its own will cause an error when called.
22523          setEntitiesSavedStatesCallback(() => this.closeEntitiesSavedStates);
22524          return post_publish_button_noop;
22525        }
22526        return callback(...args);
22527      };
22528    }
22529    closeEntitiesSavedStates(savedEntities) {
22530      const {
22531        postType,
22532        postId
22533      } = this.props;
22534      const {
22535        entitiesSavedStatesCallback
22536      } = this.state;
22537      this.setState({
22538        entitiesSavedStatesCallback: false
22539      }, () => {
22540        if (savedEntities && savedEntities.some(elt => elt.kind === 'postType' && elt.name === postType && elt.key === postId)) {
22541          // The post entity was checked, call the held callback from `createOnClick`.
22542          entitiesSavedStatesCallback();
22543        }
22544      });
22545    }
22546    render() {
22547      const {
22548        forceIsDirty,
22549        hasPublishAction,
22550        isBeingScheduled,
22551        isOpen,
22552        isPostSavingLocked,
22553        isPublishable,
22554        isPublished,
22555        isSaveable,
22556        isSaving,
22557        isAutoSaving,
22558        isToggle,
22559        savePostStatus,
22560        onSubmit = post_publish_button_noop,
22561        onToggle,
22562        visibility,
22563        hasNonPostEntityChanges,
22564        isSavingNonPostEntityChanges,
22565        postStatus,
22566        postStatusHasChanged
22567      } = this.props;
22568      const isButtonDisabled = (isSaving || !isSaveable || isPostSavingLocked || !isPublishable && !forceIsDirty) && (!hasNonPostEntityChanges || isSavingNonPostEntityChanges);
22569      const isToggleDisabled = (isPublished || isSaving || !isSaveable || !isPublishable && !forceIsDirty) && (!hasNonPostEntityChanges || isSavingNonPostEntityChanges);
22570  
22571      // If the new status has not changed explicitly, we derive it from
22572      // other factors, like having a publish action, etc.. We need to preserve
22573      // this because it affects when to show the pre and post publish panels.
22574      // If it has changed though explicitly, we need to respect that.
22575      let publishStatus = 'publish';
22576      if (postStatusHasChanged) {
22577        publishStatus = postStatus;
22578      } else if (!hasPublishAction) {
22579        publishStatus = 'pending';
22580      } else if (visibility === 'private') {
22581        publishStatus = 'private';
22582      } else if (isBeingScheduled) {
22583        publishStatus = 'future';
22584      }
22585      const onClickButton = () => {
22586        if (isButtonDisabled) {
22587          return;
22588        }
22589        onSubmit();
22590        savePostStatus(publishStatus);
22591      };
22592  
22593      // Callback to open the publish panel.
22594      const onClickToggle = () => {
22595        if (isToggleDisabled) {
22596          return;
22597        }
22598        onToggle();
22599      };
22600      const buttonProps = {
22601        'aria-disabled': isButtonDisabled,
22602        className: 'editor-post-publish-button',
22603        isBusy: !isAutoSaving && isSaving,
22604        variant: 'primary',
22605        onClick: this.createOnClick(onClickButton),
22606        'aria-haspopup': hasNonPostEntityChanges ? 'dialog' : undefined
22607      };
22608      const toggleProps = {
22609        'aria-disabled': isToggleDisabled,
22610        'aria-expanded': isOpen,
22611        className: 'editor-post-publish-panel__toggle',
22612        isBusy: isSaving && isPublished,
22613        variant: 'primary',
22614        size: 'compact',
22615        onClick: this.createOnClick(onClickToggle),
22616        'aria-haspopup': hasNonPostEntityChanges ? 'dialog' : undefined
22617      };
22618      const componentProps = isToggle ? toggleProps : buttonProps;
22619      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
22620        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
22621          ...componentProps,
22622          className: `$componentProps.className} editor-post-publish-button__button`,
22623          size: "compact",
22624          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PublishButtonLabel, {})
22625        })
22626      });
22627    }
22628  }
22629  
22630  /**
22631   * Renders the publish button.
22632   */
22633  /* harmony default export */ const post_publish_button = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)(select => {
22634    var _getCurrentPost$_link;
22635    const {
22636      isSavingPost,
22637      isAutosavingPost,
22638      isEditedPostBeingScheduled,
22639      getEditedPostVisibility,
22640      isCurrentPostPublished,
22641      isEditedPostSaveable,
22642      isEditedPostPublishable,
22643      isPostSavingLocked,
22644      getCurrentPost,
22645      getCurrentPostType,
22646      getCurrentPostId,
22647      hasNonPostEntityChanges,
22648      isSavingNonPostEntityChanges,
22649      getEditedPostAttribute,
22650      getPostEdits
22651    } = select(store_store);
22652    return {
22653      isSaving: isSavingPost(),
22654      isAutoSaving: isAutosavingPost(),
22655      isBeingScheduled: isEditedPostBeingScheduled(),
22656      visibility: getEditedPostVisibility(),
22657      isSaveable: isEditedPostSaveable(),
22658      isPostSavingLocked: isPostSavingLocked(),
22659      isPublishable: isEditedPostPublishable(),
22660      isPublished: isCurrentPostPublished(),
22661      hasPublishAction: (_getCurrentPost$_link = getCurrentPost()._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false,
22662      postType: getCurrentPostType(),
22663      postId: getCurrentPostId(),
22664      postStatus: getEditedPostAttribute('status'),
22665      postStatusHasChanged: getPostEdits()?.status,
22666      hasNonPostEntityChanges: hasNonPostEntityChanges(),
22667      isSavingNonPostEntityChanges: isSavingNonPostEntityChanges()
22668    };
22669  }), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => {
22670    const {
22671      editPost,
22672      savePost
22673    } = dispatch(store_store);
22674    return {
22675      savePostStatus: status => {
22676        editPost({
22677          status
22678        }, {
22679          undoIgnore: true
22680        });
22681        savePost();
22682      }
22683    };
22684  })])(PostPublishButton));
22685  
22686  ;// ./node_modules/@wordpress/icons/build-module/library/wordpress.js
22687  /**
22688   * WordPress dependencies
22689   */
22690  
22691  
22692  const wordpress = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
22693    xmlns: "http://www.w3.org/2000/svg",
22694    viewBox: "-2 -2 24 24",
22695    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
22696      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"
22697    })
22698  });
22699  /* harmony default export */ const library_wordpress = (wordpress);
22700  
22701  ;// ./node_modules/@wordpress/editor/build-module/components/post-visibility/utils.js
22702  /**
22703   * WordPress dependencies
22704   */
22705  
22706  const visibilityOptions = {
22707    public: {
22708      label: (0,external_wp_i18n_namespaceObject.__)('Public'),
22709      info: (0,external_wp_i18n_namespaceObject.__)('Visible to everyone.')
22710    },
22711    private: {
22712      label: (0,external_wp_i18n_namespaceObject.__)('Private'),
22713      info: (0,external_wp_i18n_namespaceObject.__)('Only visible to site admins and editors.')
22714    },
22715    password: {
22716      label: (0,external_wp_i18n_namespaceObject.__)('Password protected'),
22717      info: (0,external_wp_i18n_namespaceObject.__)('Only those with the password can view this post.')
22718    }
22719  };
22720  
22721  ;// ./node_modules/@wordpress/editor/build-module/components/post-visibility/index.js
22722  /**
22723   * WordPress dependencies
22724   */
22725  
22726  
22727  
22728  
22729  
22730  
22731  
22732  /**
22733   * Internal dependencies
22734   */
22735  
22736  
22737  
22738  /**
22739   * Allows users to set the visibility of a post.
22740   *
22741   * @param {Object}   props         The component props.
22742   * @param {Function} props.onClose Function to call when the popover is closed.
22743   * @return {React.ReactNode} The rendered component.
22744   */
22745  
22746  function PostVisibility({
22747    onClose
22748  }) {
22749    const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostVisibility);
22750    const {
22751      status,
22752      visibility,
22753      password
22754    } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
22755      status: select(store_store).getEditedPostAttribute('status'),
22756      visibility: select(store_store).getEditedPostVisibility(),
22757      password: select(store_store).getEditedPostAttribute('password')
22758    }));
22759    const {
22760      editPost,
22761      savePost
22762    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
22763    const [hasPassword, setHasPassword] = (0,external_wp_element_namespaceObject.useState)(!!password);
22764    const [showPrivateConfirmDialog, setShowPrivateConfirmDialog] = (0,external_wp_element_namespaceObject.useState)(false);
22765    const setPublic = () => {
22766      editPost({
22767        status: visibility === 'private' ? 'draft' : status,
22768        password: ''
22769      });
22770      setHasPassword(false);
22771    };
22772    const setPrivate = () => {
22773      setShowPrivateConfirmDialog(true);
22774    };
22775    const confirmPrivate = () => {
22776      editPost({
22777        status: 'private',
22778        password: ''
22779      });
22780      setHasPassword(false);
22781      setShowPrivateConfirmDialog(false);
22782      savePost();
22783    };
22784    const handleDialogCancel = () => {
22785      setShowPrivateConfirmDialog(false);
22786    };
22787    const setPasswordProtected = () => {
22788      editPost({
22789        status: visibility === 'private' ? 'draft' : status,
22790        password: password || ''
22791      });
22792      setHasPassword(true);
22793    };
22794    const updatePassword = event => {
22795      editPost({
22796        password: event.target.value
22797      });
22798    };
22799    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
22800      className: "editor-post-visibility",
22801      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
22802        title: (0,external_wp_i18n_namespaceObject.__)('Visibility'),
22803        help: (0,external_wp_i18n_namespaceObject.__)('Control how this post is viewed.'),
22804        onClose: onClose
22805      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", {
22806        className: "editor-post-visibility__fieldset",
22807        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
22808          as: "legend",
22809          children: (0,external_wp_i18n_namespaceObject.__)('Visibility')
22810        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostVisibilityChoice, {
22811          instanceId: instanceId,
22812          value: "public",
22813          label: visibilityOptions.public.label,
22814          info: visibilityOptions.public.info,
22815          checked: visibility === 'public' && !hasPassword,
22816          onChange: setPublic
22817        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostVisibilityChoice, {
22818          instanceId: instanceId,
22819          value: "private",
22820          label: visibilityOptions.private.label,
22821          info: visibilityOptions.private.info,
22822          checked: visibility === 'private',
22823          onChange: setPrivate
22824        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostVisibilityChoice, {
22825          instanceId: instanceId,
22826          value: "password",
22827          label: visibilityOptions.password.label,
22828          info: visibilityOptions.password.info,
22829          checked: hasPassword,
22830          onChange: setPasswordProtected
22831        }), hasPassword && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
22832          className: "editor-post-visibility__password",
22833          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
22834            as: "label",
22835            htmlFor: `editor-post-visibility__password-input-$instanceId}`,
22836            children: (0,external_wp_i18n_namespaceObject.__)('Create password')
22837          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
22838            className: "editor-post-visibility__password-input",
22839            id: `editor-post-visibility__password-input-$instanceId}`,
22840            type: "text",
22841            onChange: updatePassword,
22842            value: password,
22843            placeholder: (0,external_wp_i18n_namespaceObject.__)('Use a secure password')
22844          })]
22845        })]
22846      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, {
22847        isOpen: showPrivateConfirmDialog,
22848        onConfirm: confirmPrivate,
22849        onCancel: handleDialogCancel,
22850        confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Publish'),
22851        size: "medium",
22852        children: (0,external_wp_i18n_namespaceObject.__)('Would you like to privately publish this post now?')
22853      })]
22854    });
22855  }
22856  function PostVisibilityChoice({
22857    instanceId,
22858    value,
22859    label,
22860    info,
22861    ...props
22862  }) {
22863    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
22864      className: "editor-post-visibility__choice",
22865      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
22866        type: "radio",
22867        name: `editor-post-visibility__setting-$instanceId}`,
22868        value: value,
22869        id: `editor-post-$value}-$instanceId}`,
22870        "aria-describedby": `editor-post-$value}-$instanceId}-description`,
22871        className: "editor-post-visibility__radio",
22872        ...props
22873      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("label", {
22874        htmlFor: `editor-post-$value}-$instanceId}`,
22875        className: "editor-post-visibility__label",
22876        children: label
22877      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
22878        id: `editor-post-$value}-$instanceId}-description`,
22879        className: "editor-post-visibility__info",
22880        children: info
22881      })]
22882    });
22883  }
22884  
22885  ;// ./node_modules/@wordpress/editor/build-module/components/post-visibility/label.js
22886  /**
22887   * WordPress dependencies
22888   */
22889  
22890  
22891  /**
22892   * Internal dependencies
22893   */
22894  
22895  
22896  
22897  /**
22898   * Returns the label for the current post visibility setting.
22899   *
22900   * @return {string} Post visibility label.
22901   */
22902  function PostVisibilityLabel() {
22903    return usePostVisibilityLabel();
22904  }
22905  
22906  /**
22907   * Get the label for the current post visibility setting.
22908   *
22909   * @return {string} Post visibility label.
22910   */
22911  function usePostVisibilityLabel() {
22912    const visibility = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getEditedPostVisibility());
22913    return visibilityOptions[visibility]?.label;
22914  }
22915  
22916  ;// ./node_modules/date-fns/toDate.mjs
22917  /**
22918   * @name toDate
22919   * @category Common Helpers
22920   * @summary Convert the given argument to an instance of Date.
22921   *
22922   * @description
22923   * Convert the given argument to an instance of Date.
22924   *
22925   * If the argument is an instance of Date, the function returns its clone.
22926   *
22927   * If the argument is a number, it is treated as a timestamp.
22928   *
22929   * If the argument is none of the above, the function returns Invalid Date.
22930   *
22931   * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
22932   *
22933   * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
22934   *
22935   * @param argument - The value to convert
22936   *
22937   * @returns The parsed date in the local time zone
22938   *
22939   * @example
22940   * // Clone the date:
22941   * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
22942   * //=> Tue Feb 11 2014 11:30:30
22943   *
22944   * @example
22945   * // Convert the timestamp to date:
22946   * const result = toDate(1392098430000)
22947   * //=> Tue Feb 11 2014 11:30:30
22948   */
22949  function toDate(argument) {
22950    const argStr = Object.prototype.toString.call(argument);
22951  
22952    // Clone the date
22953    if (
22954      argument instanceof Date ||
22955      (typeof argument === "object" && argStr === "[object Date]")
22956    ) {
22957      // Prevent the date to lose the milliseconds when passed to new Date() in IE10
22958      return new argument.constructor(+argument);
22959    } else if (
22960      typeof argument === "number" ||
22961      argStr === "[object Number]" ||
22962      typeof argument === "string" ||
22963      argStr === "[object String]"
22964    ) {
22965      // TODO: Can we get rid of as?
22966      return new Date(argument);
22967    } else {
22968      // TODO: Can we get rid of as?
22969      return new Date(NaN);
22970    }
22971  }
22972  
22973  // Fallback for modularized imports:
22974  /* harmony default export */ const date_fns_toDate = ((/* unused pure expression or super */ null && (toDate)));
22975  
22976  ;// ./node_modules/date-fns/startOfMonth.mjs
22977  
22978  
22979  /**
22980   * @name startOfMonth
22981   * @category Month Helpers
22982   * @summary Return the start of a month for the given date.
22983   *
22984   * @description
22985   * Return the start of a month for the given date.
22986   * The result will be in the local timezone.
22987   *
22988   * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
22989   *
22990   * @param date - The original date
22991   *
22992   * @returns The start of a month
22993   *
22994   * @example
22995   * // The start of a month for 2 September 2014 11:55:00:
22996   * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
22997   * //=> Mon Sep 01 2014 00:00:00
22998   */
22999  function startOfMonth(date) {
23000    const _date = toDate(date);
23001    _date.setDate(1);
23002    _date.setHours(0, 0, 0, 0);
23003    return _date;
23004  }
23005  
23006  // Fallback for modularized imports:
23007  /* harmony default export */ const date_fns_startOfMonth = ((/* unused pure expression or super */ null && (startOfMonth)));
23008  
23009  ;// ./node_modules/date-fns/endOfMonth.mjs
23010  
23011  
23012  /**
23013   * @name endOfMonth
23014   * @category Month Helpers
23015   * @summary Return the end of a month for the given date.
23016   *
23017   * @description
23018   * Return the end of a month for the given date.
23019   * The result will be in the local timezone.
23020   *
23021   * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
23022   *
23023   * @param date - The original date
23024   *
23025   * @returns The end of a month
23026   *
23027   * @example
23028   * // The end of a month for 2 September 2014 11:55:00:
23029   * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
23030   * //=> Tue Sep 30 2014 23:59:59.999
23031   */
23032  function endOfMonth(date) {
23033    const _date = toDate(date);
23034    const month = _date.getMonth();
23035    _date.setFullYear(_date.getFullYear(), month + 1, 0);
23036    _date.setHours(23, 59, 59, 999);
23037    return _date;
23038  }
23039  
23040  // Fallback for modularized imports:
23041  /* harmony default export */ const date_fns_endOfMonth = ((/* unused pure expression or super */ null && (endOfMonth)));
23042  
23043  ;// ./node_modules/date-fns/constants.mjs
23044  /**
23045   * @module constants
23046   * @summary Useful constants
23047   * @description
23048   * Collection of useful date constants.
23049   *
23050   * The constants could be imported from `date-fns/constants`:
23051   *
23052   * ```ts
23053   * import { maxTime, minTime } from "./constants/date-fns/constants";
23054   *
23055   * function isAllowedTime(time) {
23056   *   return time <= maxTime && time >= minTime;
23057   * }
23058   * ```
23059   */
23060  
23061  /**
23062   * @constant
23063   * @name daysInWeek
23064   * @summary Days in 1 week.
23065   */
23066  const daysInWeek = 7;
23067  
23068  /**
23069   * @constant
23070   * @name daysInYear
23071   * @summary Days in 1 year.
23072   *
23073   * @description
23074   * How many days in a year.
23075   *
23076   * One years equals 365.2425 days according to the formula:
23077   *
23078   * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.
23079   * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
23080   */
23081  const daysInYear = 365.2425;
23082  
23083  /**
23084   * @constant
23085   * @name maxTime
23086   * @summary Maximum allowed time.
23087   *
23088   * @example
23089   * import { maxTime } from "./constants/date-fns/constants";
23090   *
23091   * const isValid = 8640000000000001 <= maxTime;
23092   * //=> false
23093   *
23094   * new Date(8640000000000001);
23095   * //=> Invalid Date
23096   */
23097  const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;
23098  
23099  /**
23100   * @constant
23101   * @name minTime
23102   * @summary Minimum allowed time.
23103   *
23104   * @example
23105   * import { minTime } from "./constants/date-fns/constants";
23106   *
23107   * const isValid = -8640000000000001 >= minTime;
23108   * //=> false
23109   *
23110   * new Date(-8640000000000001)
23111   * //=> Invalid Date
23112   */
23113  const minTime = -maxTime;
23114  
23115  /**
23116   * @constant
23117   * @name millisecondsInWeek
23118   * @summary Milliseconds in 1 week.
23119   */
23120  const millisecondsInWeek = 604800000;
23121  
23122  /**
23123   * @constant
23124   * @name millisecondsInDay
23125   * @summary Milliseconds in 1 day.
23126   */
23127  const millisecondsInDay = 86400000;
23128  
23129  /**
23130   * @constant
23131   * @name millisecondsInMinute
23132   * @summary Milliseconds in 1 minute
23133   */
23134  const millisecondsInMinute = 60000;
23135  
23136  /**
23137   * @constant
23138   * @name millisecondsInHour
23139   * @summary Milliseconds in 1 hour
23140   */
23141  const millisecondsInHour = 3600000;
23142  
23143  /**
23144   * @constant
23145   * @name millisecondsInSecond
23146   * @summary Milliseconds in 1 second
23147   */
23148  const millisecondsInSecond = 1000;
23149  
23150  /**
23151   * @constant
23152   * @name minutesInYear
23153   * @summary Minutes in 1 year.
23154   */
23155  const minutesInYear = 525600;
23156  
23157  /**
23158   * @constant
23159   * @name minutesInMonth
23160   * @summary Minutes in 1 month.
23161   */
23162  const minutesInMonth = 43200;
23163  
23164  /**
23165   * @constant
23166   * @name minutesInDay
23167   * @summary Minutes in 1 day.
23168   */
23169  const minutesInDay = 1440;
23170  
23171  /**
23172   * @constant
23173   * @name minutesInHour
23174   * @summary Minutes in 1 hour.
23175   */
23176  const minutesInHour = 60;
23177  
23178  /**
23179   * @constant
23180   * @name monthsInQuarter
23181   * @summary Months in 1 quarter.
23182   */
23183  const monthsInQuarter = 3;
23184  
23185  /**
23186   * @constant
23187   * @name monthsInYear
23188   * @summary Months in 1 year.
23189   */
23190  const monthsInYear = 12;
23191  
23192  /**
23193   * @constant
23194   * @name quartersInYear
23195   * @summary Quarters in 1 year
23196   */
23197  const quartersInYear = 4;
23198  
23199  /**
23200   * @constant
23201   * @name secondsInHour
23202   * @summary Seconds in 1 hour.
23203   */
23204  const secondsInHour = 3600;
23205  
23206  /**
23207   * @constant
23208   * @name secondsInMinute
23209   * @summary Seconds in 1 minute.
23210   */
23211  const secondsInMinute = 60;
23212  
23213  /**
23214   * @constant
23215   * @name secondsInDay
23216   * @summary Seconds in 1 day.
23217   */
23218  const secondsInDay = secondsInHour * 24;
23219  
23220  /**
23221   * @constant
23222   * @name secondsInWeek
23223   * @summary Seconds in 1 week.
23224   */
23225  const secondsInWeek = secondsInDay * 7;
23226  
23227  /**
23228   * @constant
23229   * @name secondsInYear
23230   * @summary Seconds in 1 year.
23231   */
23232  const secondsInYear = secondsInDay * daysInYear;
23233  
23234  /**
23235   * @constant
23236   * @name secondsInMonth
23237   * @summary Seconds in 1 month
23238   */
23239  const secondsInMonth = secondsInYear / 12;
23240  
23241  /**
23242   * @constant
23243   * @name secondsInQuarter
23244   * @summary Seconds in 1 quarter.
23245   */
23246  const secondsInQuarter = secondsInMonth * 3;
23247  
23248  ;// ./node_modules/date-fns/parseISO.mjs
23249  
23250  
23251  /**
23252   * The {@link parseISO} function options.
23253   */
23254  
23255  /**
23256   * @name parseISO
23257   * @category Common Helpers
23258   * @summary Parse ISO string
23259   *
23260   * @description
23261   * Parse the given string in ISO 8601 format and return an instance of Date.
23262   *
23263   * Function accepts complete ISO 8601 formats as well as partial implementations.
23264   * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601
23265   *
23266   * If the argument isn't a string, the function cannot parse the string or
23267   * the values are invalid, it returns Invalid Date.
23268   *
23269   * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
23270   *
23271   * @param argument - The value to convert
23272   * @param options - An object with options
23273   *
23274   * @returns The parsed date in the local time zone
23275   *
23276   * @example
23277   * // Convert string '2014-02-11T11:30:30' to date:
23278   * const result = parseISO('2014-02-11T11:30:30')
23279   * //=> Tue Feb 11 2014 11:30:30
23280   *
23281   * @example
23282   * // Convert string '+02014101' to date,
23283   * // if the additional number of digits in the extended year format is 1:
23284   * const result = parseISO('+02014101', { additionalDigits: 1 })
23285   * //=> Fri Apr 11 2014 00:00:00
23286   */
23287  function parseISO(argument, options) {
23288    const additionalDigits = options?.additionalDigits ?? 2;
23289    const dateStrings = splitDateString(argument);
23290  
23291    let date;
23292    if (dateStrings.date) {
23293      const parseYearResult = parseYear(dateStrings.date, additionalDigits);
23294      date = parseDate(parseYearResult.restDateString, parseYearResult.year);
23295    }
23296  
23297    if (!date || isNaN(date.getTime())) {
23298      return new Date(NaN);
23299    }
23300  
23301    const timestamp = date.getTime();
23302    let time = 0;
23303    let offset;
23304  
23305    if (dateStrings.time) {
23306      time = parseTime(dateStrings.time);
23307      if (isNaN(time)) {
23308        return new Date(NaN);
23309      }
23310    }
23311  
23312    if (dateStrings.timezone) {
23313      offset = parseTimezone(dateStrings.timezone);
23314      if (isNaN(offset)) {
23315        return new Date(NaN);
23316      }
23317    } else {
23318      const dirtyDate = new Date(timestamp + time);
23319      // JS parsed string assuming it's in UTC timezone
23320      // but we need it to be parsed in our timezone
23321      // so we use utc values to build date in our timezone.
23322      // Year values from 0 to 99 map to the years 1900 to 1999
23323      // so set year explicitly with setFullYear.
23324      const result = new Date(0);
23325      result.setFullYear(
23326        dirtyDate.getUTCFullYear(),
23327        dirtyDate.getUTCMonth(),
23328        dirtyDate.getUTCDate(),
23329      );
23330      result.setHours(
23331        dirtyDate.getUTCHours(),
23332        dirtyDate.getUTCMinutes(),
23333        dirtyDate.getUTCSeconds(),
23334        dirtyDate.getUTCMilliseconds(),
23335      );
23336      return result;
23337    }
23338  
23339    return new Date(timestamp + time + offset);
23340  }
23341  
23342  const patterns = {
23343    dateTimeDelimiter: /[T ]/,
23344    timeZoneDelimiter: /[Z ]/i,
23345    timezone: /([Z+-].*)$/,
23346  };
23347  
23348  const dateRegex =
23349    /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
23350  const timeRegex =
23351    /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
23352  const timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
23353  
23354  function splitDateString(dateString) {
23355    const dateStrings = {};
23356    const array = dateString.split(patterns.dateTimeDelimiter);
23357    let timeString;
23358  
23359    // The regex match should only return at maximum two array elements.
23360    // [date], [time], or [date, time].
23361    if (array.length > 2) {
23362      return dateStrings;
23363    }
23364  
23365    if (/:/.test(array[0])) {
23366      timeString = array[0];
23367    } else {
23368      dateStrings.date = array[0];
23369      timeString = array[1];
23370      if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
23371        dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
23372        timeString = dateString.substr(
23373          dateStrings.date.length,
23374          dateString.length,
23375        );
23376      }
23377    }
23378  
23379    if (timeString) {
23380      const token = patterns.timezone.exec(timeString);
23381      if (token) {
23382        dateStrings.time = timeString.replace(token[1], "");
23383        dateStrings.timezone = token[1];
23384      } else {
23385        dateStrings.time = timeString;
23386      }
23387    }
23388  
23389    return dateStrings;
23390  }
23391  
23392  function parseYear(dateString, additionalDigits) {
23393    const regex = new RegExp(
23394      "^(?:(\\d{4}|[+-]\\d{" +
23395        (4 + additionalDigits) +
23396        "})|(\\d{2}|[+-]\\d{" +
23397        (2 + additionalDigits) +
23398        "})$)",
23399    );
23400  
23401    const captures = dateString.match(regex);
23402    // Invalid ISO-formatted year
23403    if (!captures) return { year: NaN, restDateString: "" };
23404  
23405    const year = captures[1] ? parseInt(captures[1]) : null;
23406    const century = captures[2] ? parseInt(captures[2]) : null;
23407  
23408    // either year or century is null, not both
23409    return {
23410      year: century === null ? year : century * 100,
23411      restDateString: dateString.slice((captures[1] || captures[2]).length),
23412    };
23413  }
23414  
23415  function parseDate(dateString, year) {
23416    // Invalid ISO-formatted year
23417    if (year === null) return new Date(NaN);
23418  
23419    const captures = dateString.match(dateRegex);
23420    // Invalid ISO-formatted string
23421    if (!captures) return new Date(NaN);
23422  
23423    const isWeekDate = !!captures[4];
23424    const dayOfYear = parseDateUnit(captures[1]);
23425    const month = parseDateUnit(captures[2]) - 1;
23426    const day = parseDateUnit(captures[3]);
23427    const week = parseDateUnit(captures[4]);
23428    const dayOfWeek = parseDateUnit(captures[5]) - 1;
23429  
23430    if (isWeekDate) {
23431      if (!validateWeekDate(year, week, dayOfWeek)) {
23432        return new Date(NaN);
23433      }
23434      return dayOfISOWeekYear(year, week, dayOfWeek);
23435    } else {
23436      const date = new Date(0);
23437      if (
23438        !validateDate(year, month, day) ||
23439        !validateDayOfYearDate(year, dayOfYear)
23440      ) {
23441        return new Date(NaN);
23442      }
23443      date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
23444      return date;
23445    }
23446  }
23447  
23448  function parseDateUnit(value) {
23449    return value ? parseInt(value) : 1;
23450  }
23451  
23452  function parseTime(timeString) {
23453    const captures = timeString.match(timeRegex);
23454    if (!captures) return NaN; // Invalid ISO-formatted time
23455  
23456    const hours = parseTimeUnit(captures[1]);
23457    const minutes = parseTimeUnit(captures[2]);
23458    const seconds = parseTimeUnit(captures[3]);
23459  
23460    if (!validateTime(hours, minutes, seconds)) {
23461      return NaN;
23462    }
23463  
23464    return (
23465      hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000
23466    );
23467  }
23468  
23469  function parseTimeUnit(value) {
23470    return (value && parseFloat(value.replace(",", "."))) || 0;
23471  }
23472  
23473  function parseTimezone(timezoneString) {
23474    if (timezoneString === "Z") return 0;
23475  
23476    const captures = timezoneString.match(timezoneRegex);
23477    if (!captures) return 0;
23478  
23479    const sign = captures[1] === "+" ? -1 : 1;
23480    const hours = parseInt(captures[2]);
23481    const minutes = (captures[3] && parseInt(captures[3])) || 0;
23482  
23483    if (!validateTimezone(hours, minutes)) {
23484      return NaN;
23485    }
23486  
23487    return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);
23488  }
23489  
23490  function dayOfISOWeekYear(isoWeekYear, week, day) {
23491    const date = new Date(0);
23492    date.setUTCFullYear(isoWeekYear, 0, 4);
23493    const fourthOfJanuaryDay = date.getUTCDay() || 7;
23494    const diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
23495    date.setUTCDate(date.getUTCDate() + diff);
23496    return date;
23497  }
23498  
23499  // Validation functions
23500  
23501  // February is null to handle the leap year (using ||)
23502  const daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
23503  
23504  function isLeapYearIndex(year) {
23505    return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);
23506  }
23507  
23508  function validateDate(year, month, date) {
23509    return (
23510      month >= 0 &&
23511      month <= 11 &&
23512      date >= 1 &&
23513      date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28))
23514    );
23515  }
23516  
23517  function validateDayOfYearDate(year, dayOfYear) {
23518    return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);
23519  }
23520  
23521  function validateWeekDate(_year, week, day) {
23522    return week >= 1 && week <= 53 && day >= 0 && day <= 6;
23523  }
23524  
23525  function validateTime(hours, minutes, seconds) {
23526    if (hours === 24) {
23527      return minutes === 0 && seconds === 0;
23528    }
23529  
23530    return (
23531      seconds >= 0 &&
23532      seconds < 60 &&
23533      minutes >= 0 &&
23534      minutes < 60 &&
23535      hours >= 0 &&
23536      hours < 25
23537    );
23538  }
23539  
23540  function validateTimezone(_hours, minutes) {
23541    return minutes >= 0 && minutes <= 59;
23542  }
23543  
23544  // Fallback for modularized imports:
23545  /* harmony default export */ const date_fns_parseISO = ((/* unused pure expression or super */ null && (parseISO)));
23546  
23547  ;// ./node_modules/@wordpress/editor/build-module/components/post-schedule/index.js
23548  /**
23549   * External dependencies
23550   */
23551  
23552  
23553  /**
23554   * WordPress dependencies
23555   */
23556  
23557  
23558  
23559  
23560  
23561  
23562  
23563  /**
23564   * Internal dependencies
23565   */
23566  
23567  
23568  
23569  const {
23570    PrivatePublishDateTimePicker
23571  } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
23572  
23573  /**
23574   * Renders the PostSchedule component. It allows the user to schedule a post.
23575   *
23576   * @param {Object}   props         Props.
23577   * @param {Function} props.onClose Function to close the component.
23578   *
23579   * @return {React.ReactNode} The rendered component.
23580   */
23581  function PostSchedule(props) {
23582    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivatePostSchedule, {
23583      ...props,
23584      showPopoverHeaderActions: true,
23585      isCompact: false
23586    });
23587  }
23588  function PrivatePostSchedule({
23589    onClose,
23590    showPopoverHeaderActions,
23591    isCompact
23592  }) {
23593    const {
23594      postDate,
23595      postType
23596    } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
23597      postDate: select(store_store).getEditedPostAttribute('date'),
23598      postType: select(store_store).getCurrentPostType()
23599    }), []);
23600    const {
23601      editPost
23602    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
23603    const onUpdateDate = date => editPost({
23604      date
23605    });
23606    const [previewedMonth, setPreviewedMonth] = (0,external_wp_element_namespaceObject.useState)(startOfMonth(new Date(postDate)));
23607  
23608    // Pick up published and scheduled site posts.
23609    const eventsByPostType = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', postType, {
23610      status: 'publish,future',
23611      after: startOfMonth(previewedMonth).toISOString(),
23612      before: endOfMonth(previewedMonth).toISOString(),
23613      exclude: [select(store_store).getCurrentPostId()],
23614      per_page: 100,
23615      _fields: 'id,date'
23616    }), [previewedMonth, postType]);
23617    const events = (0,external_wp_element_namespaceObject.useMemo)(() => (eventsByPostType || []).map(({
23618      date: eventDate
23619    }) => ({
23620      date: new Date(eventDate)
23621    })), [eventsByPostType]);
23622    const settings = (0,external_wp_date_namespaceObject.getSettings)();
23623  
23624    // To know if the current timezone is a 12 hour time with look for "a" in the time format
23625    // We also make sure this a is not escaped by a "/"
23626    const is12HourTime = /a(?!\\)/i.test(settings.formats.time.toLowerCase() // Test only the lower case a.
23627    .replace(/\\\\/g, '') // Replace "//" with empty strings.
23628    .split('').reverse().join('') // Reverse the string and test for "a" not followed by a slash.
23629    );
23630    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivatePublishDateTimePicker, {
23631      currentDate: postDate,
23632      onChange: onUpdateDate,
23633      is12Hour: is12HourTime,
23634      dateOrder: /* translators: Order of day, month, and year. Available formats are 'dmy', 'mdy', and 'ymd'. */
23635      (0,external_wp_i18n_namespaceObject._x)('dmy', 'date order'),
23636      events: events,
23637      onMonthPreviewed: date => setPreviewedMonth(parseISO(date)),
23638      onClose: onClose,
23639      isCompact: isCompact,
23640      showPopoverHeaderActions: showPopoverHeaderActions
23641    });
23642  }
23643  
23644  ;// ./node_modules/@wordpress/editor/build-module/components/post-schedule/label.js
23645  /**
23646   * WordPress dependencies
23647   */
23648  
23649  
23650  
23651  
23652  /**
23653   * Internal dependencies
23654   */
23655  
23656  
23657  /**
23658   * Renders the PostScheduleLabel component.
23659   *
23660   * @param {Object} props Props.
23661   *
23662   * @return {React.ReactNode} The rendered component.
23663   */
23664  function PostScheduleLabel(props) {
23665    return usePostScheduleLabel(props);
23666  }
23667  
23668  /**
23669   * Custom hook to get the label for post schedule.
23670   *
23671   * @param {Object}  options      Options for the hook.
23672   * @param {boolean} options.full Whether to get the full label or not. Default is false.
23673   *
23674   * @return {string} The label for post schedule.
23675   */
23676  function usePostScheduleLabel({
23677    full = false
23678  } = {}) {
23679    const {
23680      date,
23681      isFloating
23682    } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
23683      date: select(store_store).getEditedPostAttribute('date'),
23684      isFloating: select(store_store).isEditedPostDateFloating()
23685    }), []);
23686    return full ? getFullPostScheduleLabel(date) : getPostScheduleLabel(date, {
23687      isFloating
23688    });
23689  }
23690  function getFullPostScheduleLabel(dateAttribute) {
23691    const date = (0,external_wp_date_namespaceObject.getDate)(dateAttribute);
23692    const timezoneAbbreviation = getTimezoneAbbreviation();
23693    const formattedDate = (0,external_wp_date_namespaceObject.dateI18n)(
23694    // translators: Use a non-breaking space between 'g:i' and 'a' if appropriate.
23695    (0,external_wp_i18n_namespaceObject._x)('F j, Y g:i\xa0a', 'post schedule full date format'), date);
23696    return (0,external_wp_i18n_namespaceObject.isRTL)() ? `$timezoneAbbreviation} $formattedDate}` : `$formattedDate} $timezoneAbbreviation}`;
23697  }
23698  function getPostScheduleLabel(dateAttribute, {
23699    isFloating = false,
23700    now = new Date()
23701  } = {}) {
23702    if (!dateAttribute || isFloating) {
23703      return (0,external_wp_i18n_namespaceObject.__)('Immediately');
23704    }
23705  
23706    // If the user timezone does not equal the site timezone then using words
23707    // like 'tomorrow' is confusing, so show the full date.
23708    if (!isTimezoneSameAsSiteTimezone(now)) {
23709      return getFullPostScheduleLabel(dateAttribute);
23710    }
23711    const date = (0,external_wp_date_namespaceObject.getDate)(dateAttribute);
23712    if (isSameDay(date, now)) {
23713      return (0,external_wp_i18n_namespaceObject.sprintf)(
23714      // translators: %s: Time of day the post is scheduled for.
23715      (0,external_wp_i18n_namespaceObject.__)('Today at %s'),
23716      // translators: If using a space between 'g:i' and 'a', use a non-breaking space.
23717      (0,external_wp_date_namespaceObject.dateI18n)((0,external_wp_i18n_namespaceObject._x)('g:i\xa0a', 'post schedule time format'), date));
23718    }
23719    const tomorrow = new Date(now);
23720    tomorrow.setDate(tomorrow.getDate() + 1);
23721    if (isSameDay(date, tomorrow)) {
23722      return (0,external_wp_i18n_namespaceObject.sprintf)(
23723      // translators: %s: Time of day the post is scheduled for.
23724      (0,external_wp_i18n_namespaceObject.__)('Tomorrow at %s'),
23725      // translators: If using a space between 'g:i' and 'a', use a non-breaking space.
23726      (0,external_wp_date_namespaceObject.dateI18n)((0,external_wp_i18n_namespaceObject._x)('g:i\xa0a', 'post schedule time format'), date));
23727    }
23728    if (date.getFullYear() === now.getFullYear()) {
23729      return (0,external_wp_date_namespaceObject.dateI18n)(
23730      // translators: If using a space between 'g:i' and 'a', use a non-breaking space.
23731      (0,external_wp_i18n_namespaceObject._x)('F j g:i\xa0a', 'post schedule date format without year'), date);
23732    }
23733    return (0,external_wp_date_namespaceObject.dateI18n)(
23734    // translators: Use a non-breaking space between 'g:i' and 'a' if appropriate.
23735    (0,external_wp_i18n_namespaceObject._x)('F j, Y g:i\xa0a', 'post schedule full date format'), date);
23736  }
23737  function getTimezoneAbbreviation() {
23738    const {
23739      timezone
23740    } = (0,external_wp_date_namespaceObject.getSettings)();
23741    if (timezone.abbr && isNaN(Number(timezone.abbr))) {
23742      return timezone.abbr;
23743    }
23744    const symbol = timezone.offset < 0 ? '' : '+';
23745    return `UTC$symbol}$timezone.offsetFormatted}`;
23746  }
23747  function isTimezoneSameAsSiteTimezone(date) {
23748    const {
23749      timezone
23750    } = (0,external_wp_date_namespaceObject.getSettings)();
23751    const siteOffset = Number(timezone.offset);
23752    const dateOffset = -1 * (date.getTimezoneOffset() / 60);
23753    return siteOffset === dateOffset;
23754  }
23755  function isSameDay(left, right) {
23756    return left.getDate() === right.getDate() && left.getMonth() === right.getMonth() && left.getFullYear() === right.getFullYear();
23757  }
23758  
23759  ;// ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/most-used-terms.js
23760  /**
23761   * WordPress dependencies
23762   */
23763  
23764  
23765  
23766  
23767  /**
23768   * Internal dependencies
23769   */
23770  
23771  
23772  const MIN_MOST_USED_TERMS = 3;
23773  const DEFAULT_QUERY = {
23774    per_page: 10,
23775    orderby: 'count',
23776    order: 'desc',
23777    hide_empty: true,
23778    _fields: 'id,name,count',
23779    context: 'view'
23780  };
23781  function MostUsedTerms({
23782    onSelect,
23783    taxonomy
23784  }) {
23785    const {
23786      _terms,
23787      showTerms
23788    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
23789      const mostUsedTerms = select(external_wp_coreData_namespaceObject.store).getEntityRecords('taxonomy', taxonomy.slug, DEFAULT_QUERY);
23790      return {
23791        _terms: mostUsedTerms,
23792        showTerms: mostUsedTerms?.length >= MIN_MOST_USED_TERMS
23793      };
23794    }, [taxonomy.slug]);
23795    if (!showTerms) {
23796      return null;
23797    }
23798    const terms = unescapeTerms(_terms);
23799    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
23800      className: "editor-post-taxonomies__flat-term-most-used",
23801      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, {
23802        as: "h3",
23803        className: "editor-post-taxonomies__flat-term-most-used-label",
23804        children: taxonomy.labels.most_used
23805      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", {
23806        role: "list",
23807        className: "editor-post-taxonomies__flat-term-most-used-list",
23808        children: terms.map(term => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", {
23809          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
23810            __next40pxDefaultSize: true,
23811            variant: "link",
23812            onClick: () => onSelect(term),
23813            children: term.name
23814          })
23815        }, term.id))
23816      })]
23817    });
23818  }
23819  
23820  ;// ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/flat-term-selector.js
23821  /**
23822   * WordPress dependencies
23823   */
23824  
23825  
23826  
23827  
23828  
23829  
23830  
23831  
23832  
23833  
23834  /**
23835   * Internal dependencies
23836   */
23837  
23838  
23839  
23840  
23841  /**
23842   * Shared reference to an empty array for cases where it is important to avoid
23843   * returning a new array reference on every invocation.
23844   *
23845   * @type {Array<any>}
23846   */
23847  
23848  const flat_term_selector_EMPTY_ARRAY = [];
23849  
23850  /**
23851   * How the max suggestions limit was chosen:
23852   *  - Matches the `per_page` range set by the REST API.
23853   *  - Can't use "unbound" query. The `FormTokenField` needs a fixed number.
23854   *  - Matches default for `FormTokenField`.
23855   */
23856  const MAX_TERMS_SUGGESTIONS = 100;
23857  const flat_term_selector_DEFAULT_QUERY = {
23858    per_page: MAX_TERMS_SUGGESTIONS,
23859    _fields: 'id,name',
23860    context: 'view'
23861  };
23862  const isSameTermName = (termA, termB) => unescapeString(termA).toLowerCase() === unescapeString(termB).toLowerCase();
23863  const termNamesToIds = (names, terms) => {
23864    return names.map(termName => terms.find(term => isSameTermName(term.name, termName))?.id).filter(id => id !== undefined);
23865  };
23866  const Wrapper = ({
23867    children,
23868    __nextHasNoMarginBottom
23869  }) => __nextHasNoMarginBottom ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, {
23870    spacing: 4,
23871    children: children
23872  }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.Fragment, {
23873    children: children
23874  });
23875  
23876  /**
23877   * Renders a flat term selector component.
23878   *
23879   * @param {Object}  props                         The component props.
23880   * @param {string}  props.slug                    The slug of the taxonomy.
23881   * @param {boolean} props.__nextHasNoMarginBottom Start opting into the new margin-free styles that will become the default in a future version, currently scheduled to be WordPress 7.0. (The prop can be safely removed once this happens.)
23882   *
23883   * @return {React.ReactNode} The rendered flat term selector component.
23884   */
23885  function FlatTermSelector({
23886    slug,
23887    __nextHasNoMarginBottom
23888  }) {
23889    var _taxonomy$labels$add_, _taxonomy$labels$sing2;
23890    const [values, setValues] = (0,external_wp_element_namespaceObject.useState)([]);
23891    const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)('');
23892    const debouncedSearch = (0,external_wp_compose_namespaceObject.useDebounce)(setSearch, 500);
23893    if (!__nextHasNoMarginBottom) {
23894      external_wp_deprecated_default()('Bottom margin styles for wp.editor.PostTaxonomiesFlatTermSelector', {
23895        since: '6.7',
23896        version: '7.0',
23897        hint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version.'
23898      });
23899    }
23900    const {
23901      terms,
23902      termIds,
23903      taxonomy,
23904      hasAssignAction,
23905      hasCreateAction,
23906      hasResolvedTerms
23907    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
23908      var _post$_links, _post$_links2;
23909      const {
23910        getCurrentPost,
23911        getEditedPostAttribute
23912      } = select(store_store);
23913      const {
23914        getEntityRecords,
23915        getEntityRecord,
23916        hasFinishedResolution
23917      } = select(external_wp_coreData_namespaceObject.store);
23918      const post = getCurrentPost();
23919      const _taxonomy = getEntityRecord('root', 'taxonomy', slug);
23920      const _termIds = _taxonomy ? getEditedPostAttribute(_taxonomy.rest_base) : flat_term_selector_EMPTY_ARRAY;
23921      const query = {
23922        ...flat_term_selector_DEFAULT_QUERY,
23923        include: _termIds?.join(','),
23924        per_page: -1
23925      };
23926      return {
23927        hasCreateAction: _taxonomy ? (_post$_links = post._links?.['wp:action-create-' + _taxonomy.rest_base]) !== null && _post$_links !== void 0 ? _post$_links : false : false,
23928        hasAssignAction: _taxonomy ? (_post$_links2 = post._links?.['wp:action-assign-' + _taxonomy.rest_base]) !== null && _post$_links2 !== void 0 ? _post$_links2 : false : false,
23929        taxonomy: _taxonomy,
23930        termIds: _termIds,
23931        terms: _termIds?.length ? getEntityRecords('taxonomy', slug, query) : flat_term_selector_EMPTY_ARRAY,
23932        hasResolvedTerms: hasFinishedResolution('getEntityRecords', ['taxonomy', slug, query])
23933      };
23934    }, [slug]);
23935    const {
23936      searchResults
23937    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
23938      const {
23939        getEntityRecords
23940      } = select(external_wp_coreData_namespaceObject.store);
23941      return {
23942        searchResults: !!search ? getEntityRecords('taxonomy', slug, {
23943          ...flat_term_selector_DEFAULT_QUERY,
23944          search
23945        }) : flat_term_selector_EMPTY_ARRAY
23946      };
23947    }, [search, slug]);
23948  
23949    // Update terms state only after the selectors are resolved.
23950    // We're using this to avoid terms temporarily disappearing on slow networks
23951    // while core data makes REST API requests.
23952    (0,external_wp_element_namespaceObject.useEffect)(() => {
23953      if (hasResolvedTerms) {
23954        const newValues = (terms !== null && terms !== void 0 ? terms : []).map(term => unescapeString(term.name));
23955        setValues(newValues);
23956      }
23957    }, [terms, hasResolvedTerms]);
23958    const suggestions = (0,external_wp_element_namespaceObject.useMemo)(() => {
23959      return (searchResults !== null && searchResults !== void 0 ? searchResults : []).map(term => unescapeString(term.name));
23960    }, [searchResults]);
23961    const {
23962      editPost
23963    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
23964    const {
23965      saveEntityRecord
23966    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
23967    const {
23968      createErrorNotice
23969    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
23970    if (!hasAssignAction) {
23971      return null;
23972    }
23973    async function findOrCreateTerm(term) {
23974      try {
23975        const newTerm = await saveEntityRecord('taxonomy', slug, term, {
23976          throwOnError: true
23977        });
23978        return unescapeTerm(newTerm);
23979      } catch (error) {
23980        if (error.code !== 'term_exists') {
23981          throw error;
23982        }
23983        return {
23984          id: error.data.term_id,
23985          name: term.name
23986        };
23987      }
23988    }
23989    function onUpdateTerms(newTermIds) {
23990      editPost({
23991        [taxonomy.rest_base]: newTermIds
23992      });
23993    }
23994    function onChange(termNames) {
23995      const availableTerms = [...(terms !== null && terms !== void 0 ? terms : []), ...(searchResults !== null && searchResults !== void 0 ? searchResults : [])];
23996      const uniqueTerms = termNames.reduce((acc, name) => {
23997        if (!acc.some(n => n.toLowerCase() === name.toLowerCase())) {
23998          acc.push(name);
23999        }
24000        return acc;
24001      }, []);
24002      const newTermNames = uniqueTerms.filter(termName => !availableTerms.find(term => isSameTermName(term.name, termName)));
24003  
24004      // Optimistically update term values.
24005      // The selector will always re-fetch terms later.
24006      setValues(uniqueTerms);
24007      if (newTermNames.length === 0) {
24008        onUpdateTerms(termNamesToIds(uniqueTerms, availableTerms));
24009        return;
24010      }
24011      if (!hasCreateAction) {
24012        return;
24013      }
24014      Promise.all(newTermNames.map(termName => findOrCreateTerm({
24015        name: termName
24016      }))).then(newTerms => {
24017        const newAvailableTerms = availableTerms.concat(newTerms);
24018        onUpdateTerms(termNamesToIds(uniqueTerms, newAvailableTerms));
24019      }).catch(error => {
24020        createErrorNotice(error.message, {
24021          type: 'snackbar'
24022        });
24023        // In case of a failure, try assigning available terms.
24024        // This will invalidate the optimistic update.
24025        onUpdateTerms(termNamesToIds(uniqueTerms, availableTerms));
24026      });
24027    }
24028    function appendTerm(newTerm) {
24029      var _taxonomy$labels$sing;
24030      if (termIds.includes(newTerm.id)) {
24031        return;
24032      }
24033      const newTermIds = [...termIds, newTerm.id];
24034      const defaultName = slug === 'post_tag' ? (0,external_wp_i18n_namespaceObject.__)('Tag') : (0,external_wp_i18n_namespaceObject.__)('Term');
24035      const termAddedMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: term name. */
24036      (0,external_wp_i18n_namespaceObject._x)('%s added', 'term'), (_taxonomy$labels$sing = taxonomy?.labels?.singular_name) !== null && _taxonomy$labels$sing !== void 0 ? _taxonomy$labels$sing : defaultName);
24037      (0,external_wp_a11y_namespaceObject.speak)(termAddedMessage, 'assertive');
24038      onUpdateTerms(newTermIds);
24039    }
24040    const newTermLabel = (_taxonomy$labels$add_ = taxonomy?.labels?.add_new_item) !== null && _taxonomy$labels$add_ !== void 0 ? _taxonomy$labels$add_ : slug === 'post_tag' ? (0,external_wp_i18n_namespaceObject.__)('Add new tag') : (0,external_wp_i18n_namespaceObject.__)('Add new Term');
24041    const singularName = (_taxonomy$labels$sing2 = taxonomy?.labels?.singular_name) !== null && _taxonomy$labels$sing2 !== void 0 ? _taxonomy$labels$sing2 : slug === 'post_tag' ? (0,external_wp_i18n_namespaceObject.__)('Tag') : (0,external_wp_i18n_namespaceObject.__)('Term');
24042    const termAddedLabel = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: term name. */
24043    (0,external_wp_i18n_namespaceObject._x)('%s added', 'term'), singularName);
24044    const termRemovedLabel = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: term name. */
24045    (0,external_wp_i18n_namespaceObject._x)('%s removed', 'term'), singularName);
24046    const removeTermLabel = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: term name. */
24047    (0,external_wp_i18n_namespaceObject._x)('Remove %s', 'term'), singularName);
24048    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Wrapper, {
24049      __nextHasNoMarginBottom: __nextHasNoMarginBottom,
24050      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormTokenField, {
24051        __next40pxDefaultSize: true,
24052        value: values,
24053        suggestions: suggestions,
24054        onChange: onChange,
24055        onInputChange: debouncedSearch,
24056        maxSuggestions: MAX_TERMS_SUGGESTIONS,
24057        label: newTermLabel,
24058        messages: {
24059          added: termAddedLabel,
24060          removed: termRemovedLabel,
24061          remove: removeTermLabel
24062        },
24063        __nextHasNoMarginBottom: __nextHasNoMarginBottom
24064      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MostUsedTerms, {
24065        taxonomy: taxonomy,
24066        onSelect: appendTerm
24067      })]
24068    });
24069  }
24070  /* harmony default export */ const flat_term_selector = ((0,external_wp_components_namespaceObject.withFilters)('editor.PostTaxonomyType')(FlatTermSelector));
24071  
24072  ;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-tags-panel.js
24073  /**
24074   * WordPress dependencies
24075   */
24076  
24077  
24078  
24079  
24080  
24081  
24082  /**
24083   * Internal dependencies
24084   */
24085  
24086  
24087  
24088  const TagsPanel = () => {
24089    const panelBodyTitle = [(0,external_wp_i18n_namespaceObject.__)('Suggestion:'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
24090      className: "editor-post-publish-panel__link",
24091      children: (0,external_wp_i18n_namespaceObject.__)('Add tags')
24092    }, "label")];
24093    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, {
24094      initialOpen: false,
24095      title: panelBodyTitle,
24096      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
24097        children: (0,external_wp_i18n_namespaceObject.__)('Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.')
24098      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(flat_term_selector, {
24099        slug: "post_tag",
24100        __nextHasNoMarginBottom: true
24101      })]
24102    });
24103  };
24104  const MaybeTagsPanel = () => {
24105    const {
24106      hasTags,
24107      isPostTypeSupported
24108    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
24109      const postType = select(store_store).getCurrentPostType();
24110      const tagsTaxonomy = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', 'taxonomy', 'post_tag');
24111      const _isPostTypeSupported = tagsTaxonomy?.types?.includes(postType);
24112      const areTagsFetched = tagsTaxonomy !== undefined;
24113      const tags = tagsTaxonomy && select(store_store).getEditedPostAttribute(tagsTaxonomy.rest_base);
24114      return {
24115        hasTags: !!tags?.length,
24116        isPostTypeSupported: areTagsFetched && _isPostTypeSupported
24117      };
24118    }, []);
24119    const [hadTagsWhenOpeningThePanel] = (0,external_wp_element_namespaceObject.useState)(hasTags);
24120    if (!isPostTypeSupported) {
24121      return null;
24122    }
24123  
24124    /*
24125     * We only want to show the tag panel if the post didn't have
24126     * any tags when the user hit the Publish button.
24127     *
24128     * We can't use the prop.hasTags because it'll change to true
24129     * if the user adds a new tag within the pre-publish panel.
24130     * This would force a re-render and a new prop.hasTags check,
24131     * hiding this panel and keeping the user from adding
24132     * more than one tag.
24133     */
24134    if (!hadTagsWhenOpeningThePanel) {
24135      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagsPanel, {});
24136    }
24137    return null;
24138  };
24139  /* harmony default export */ const maybe_tags_panel = (MaybeTagsPanel);
24140  
24141  ;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-post-format-panel.js
24142  /**
24143   * WordPress dependencies
24144   */
24145  
24146  
24147  
24148  
24149  
24150  /**
24151   * Internal dependencies
24152   */
24153  
24154  
24155  
24156  const getSuggestion = (supportedFormats, suggestedPostFormat) => {
24157    const formats = POST_FORMATS.filter(format => supportedFormats?.includes(format.id));
24158    return formats.find(format => format.id === suggestedPostFormat);
24159  };
24160  const PostFormatSuggestion = ({
24161    suggestedPostFormat,
24162    suggestionText,
24163    onUpdatePostFormat
24164  }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
24165    __next40pxDefaultSize: true,
24166    variant: "link",
24167    onClick: () => onUpdatePostFormat(suggestedPostFormat),
24168    children: suggestionText
24169  });
24170  function PostFormatPanel() {
24171    const {
24172      currentPostFormat,
24173      suggestion
24174    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
24175      var _select$getThemeSuppo;
24176      const {
24177        getEditedPostAttribute,
24178        getSuggestedPostFormat
24179      } = select(store_store);
24180      const supportedFormats = (_select$getThemeSuppo = select(external_wp_coreData_namespaceObject.store).getThemeSupports().formats) !== null && _select$getThemeSuppo !== void 0 ? _select$getThemeSuppo : [];
24181      return {
24182        currentPostFormat: getEditedPostAttribute('format'),
24183        suggestion: getSuggestion(supportedFormats, getSuggestedPostFormat())
24184      };
24185    }, []);
24186    const {
24187      editPost
24188    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
24189    const onUpdatePostFormat = format => editPost({
24190      format
24191    });
24192    const panelBodyTitle = [(0,external_wp_i18n_namespaceObject.__)('Suggestion:'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
24193      className: "editor-post-publish-panel__link",
24194      children: (0,external_wp_i18n_namespaceObject.__)('Use a post format')
24195    }, "label")];
24196    if (!suggestion || suggestion.id === currentPostFormat) {
24197      return null;
24198    }
24199    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, {
24200      initialOpen: false,
24201      title: panelBodyTitle,
24202      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
24203        children: (0,external_wp_i18n_namespaceObject.__)('Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.')
24204      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
24205        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostFormatSuggestion, {
24206          onUpdatePostFormat: onUpdatePostFormat,
24207          suggestedPostFormat: suggestion.id,
24208          suggestionText: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: post format */
24209          (0,external_wp_i18n_namespaceObject.__)('Apply the "%1$s" format.'), suggestion.caption)
24210        })
24211      })]
24212    });
24213  }
24214  
24215  ;// ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/hierarchical-term-selector.js
24216  /**
24217   * WordPress dependencies
24218   */
24219  
24220  
24221  
24222  
24223  
24224  
24225  
24226  
24227  
24228  
24229  /**
24230   * Internal dependencies
24231   */
24232  
24233  
24234  
24235  /**
24236   * Module Constants
24237   */
24238  
24239  const hierarchical_term_selector_DEFAULT_QUERY = {
24240    per_page: -1,
24241    orderby: 'name',
24242    order: 'asc',
24243    _fields: 'id,name,parent',
24244    context: 'view'
24245  };
24246  const MIN_TERMS_COUNT_FOR_FILTER = 8;
24247  const hierarchical_term_selector_EMPTY_ARRAY = [];
24248  
24249  /**
24250   * Sort Terms by Selected.
24251   *
24252   * @param {Object[]} termsTree Array of terms in tree format.
24253   * @param {number[]} terms     Selected terms.
24254   *
24255   * @return {Object[]} Sorted array of terms.
24256   */
24257  function sortBySelected(termsTree, terms) {
24258    const treeHasSelection = termTree => {
24259      if (terms.indexOf(termTree.id) !== -1) {
24260        return true;
24261      }
24262      if (undefined === termTree.children) {
24263        return false;
24264      }
24265      return termTree.children.map(treeHasSelection).filter(child => child).length > 0;
24266    };
24267    const termOrChildIsSelected = (termA, termB) => {
24268      const termASelected = treeHasSelection(termA);
24269      const termBSelected = treeHasSelection(termB);
24270      if (termASelected === termBSelected) {
24271        return 0;
24272      }
24273      if (termASelected && !termBSelected) {
24274        return -1;
24275      }
24276      if (!termASelected && termBSelected) {
24277        return 1;
24278      }
24279      return 0;
24280    };
24281    const newTermTree = [...termsTree];
24282    newTermTree.sort(termOrChildIsSelected);
24283    return newTermTree;
24284  }
24285  
24286  /**
24287   * Find term by parent id or name.
24288   *
24289   * @param {Object[]}      terms  Array of Terms.
24290   * @param {number|string} parent id.
24291   * @param {string}        name   Term name.
24292   * @return {Object} Term object.
24293   */
24294  function findTerm(terms, parent, name) {
24295    return terms.find(term => {
24296      return (!term.parent && !parent || parseInt(term.parent) === parseInt(parent)) && term.name.toLowerCase() === name.toLowerCase();
24297    });
24298  }
24299  
24300  /**
24301   * Get filter matcher function.
24302   *
24303   * @param {string} filterValue Filter value.
24304   * @return {(function(Object): (Object|boolean))} Matcher function.
24305   */
24306  function getFilterMatcher(filterValue) {
24307    const matchTermsForFilter = originalTerm => {
24308      if ('' === filterValue) {
24309        return originalTerm;
24310      }
24311  
24312      // Shallow clone, because we'll be filtering the term's children and
24313      // don't want to modify the original term.
24314      const term = {
24315        ...originalTerm
24316      };
24317  
24318      // Map and filter the children, recursive so we deal with grandchildren
24319      // and any deeper levels.
24320      if (term.children.length > 0) {
24321        term.children = term.children.map(matchTermsForFilter).filter(child => child);
24322      }
24323  
24324      // If the term's name contains the filterValue, or it has children
24325      // (i.e. some child matched at some point in the tree) then return it.
24326      if (-1 !== term.name.toLowerCase().indexOf(filterValue.toLowerCase()) || term.children.length > 0) {
24327        return term;
24328      }
24329  
24330      // Otherwise, return false. After mapping, the list of terms will need
24331      // to have false values filtered out.
24332      return false;
24333    };
24334    return matchTermsForFilter;
24335  }
24336  
24337  /**
24338   * Hierarchical term selector.
24339   *
24340   * @param {Object} props      Component props.
24341   * @param {string} props.slug Taxonomy slug.
24342   * @return {Element}        Hierarchical term selector component.
24343   */
24344  function HierarchicalTermSelector({
24345    slug
24346  }) {
24347    var _taxonomy$labels$sear, _taxonomy$name;
24348    const [adding, setAdding] = (0,external_wp_element_namespaceObject.useState)(false);
24349    const [formName, setFormName] = (0,external_wp_element_namespaceObject.useState)('');
24350    /**
24351     * @type {[number|'', Function]}
24352     */
24353    const [formParent, setFormParent] = (0,external_wp_element_namespaceObject.useState)('');
24354    const [showForm, setShowForm] = (0,external_wp_element_namespaceObject.useState)(false);
24355    const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)('');
24356    const [filteredTermsTree, setFilteredTermsTree] = (0,external_wp_element_namespaceObject.useState)([]);
24357    const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500);
24358    const {
24359      hasCreateAction,
24360      hasAssignAction,
24361      terms,
24362      loading,
24363      availableTerms,
24364      taxonomy
24365    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
24366      var _post$_links, _post$_links2;
24367      const {
24368        getCurrentPost,
24369        getEditedPostAttribute
24370      } = select(store_store);
24371      const {
24372        getEntityRecord,
24373        getEntityRecords,
24374        isResolving
24375      } = select(external_wp_coreData_namespaceObject.store);
24376      const _taxonomy = getEntityRecord('root', 'taxonomy', slug);
24377      const post = getCurrentPost();
24378      return {
24379        hasCreateAction: _taxonomy ? (_post$_links = post._links?.['wp:action-create-' + _taxonomy.rest_base]) !== null && _post$_links !== void 0 ? _post$_links : false : false,
24380        hasAssignAction: _taxonomy ? (_post$_links2 = post._links?.['wp:action-assign-' + _taxonomy.rest_base]) !== null && _post$_links2 !== void 0 ? _post$_links2 : false : false,
24381        terms: _taxonomy ? getEditedPostAttribute(_taxonomy.rest_base) : hierarchical_term_selector_EMPTY_ARRAY,
24382        loading: isResolving('getEntityRecords', ['taxonomy', slug, hierarchical_term_selector_DEFAULT_QUERY]),
24383        availableTerms: getEntityRecords('taxonomy', slug, hierarchical_term_selector_DEFAULT_QUERY) || hierarchical_term_selector_EMPTY_ARRAY,
24384        taxonomy: _taxonomy
24385      };
24386    }, [slug]);
24387    const {
24388      editPost
24389    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
24390    const {
24391      saveEntityRecord
24392    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
24393    const availableTermsTree = (0,external_wp_element_namespaceObject.useMemo)(() => sortBySelected(terms_buildTermsTree(availableTerms), terms),
24394    // Remove `terms` from the dependency list to avoid reordering every time
24395    // checking or unchecking a term.
24396    [availableTerms]);
24397    const {
24398      createErrorNotice
24399    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
24400    if (!hasAssignAction) {
24401      return null;
24402    }
24403  
24404    /**
24405     * Append new term.
24406     *
24407     * @param {Object} term Term object.
24408     * @return {Promise} A promise that resolves to save term object.
24409     */
24410    const addTerm = term => {
24411      return saveEntityRecord('taxonomy', slug, term, {
24412        throwOnError: true
24413      });
24414    };
24415  
24416    /**
24417     * Update terms for post.
24418     *
24419     * @param {number[]} termIds Term ids.
24420     */
24421    const onUpdateTerms = termIds => {
24422      editPost({
24423        [taxonomy.rest_base]: termIds
24424      });
24425    };
24426  
24427    /**
24428     * Handler for checking term.
24429     *
24430     * @param {number} termId
24431     */
24432    const onChange = termId => {
24433      const hasTerm = terms.includes(termId);
24434      const newTerms = hasTerm ? terms.filter(id => id !== termId) : [...terms, termId];
24435      onUpdateTerms(newTerms);
24436    };
24437    const onChangeFormName = value => {
24438      setFormName(value);
24439    };
24440  
24441    /**
24442     * Handler for changing form parent.
24443     *
24444     * @param {number|''} parentId Parent post id.
24445     */
24446    const onChangeFormParent = parentId => {
24447      setFormParent(parentId);
24448    };
24449    const onToggleForm = () => {
24450      setShowForm(!showForm);
24451    };
24452    const onAddTerm = async event => {
24453      var _taxonomy$labels$sing;
24454      event.preventDefault();
24455      if (formName === '' || adding) {
24456        return;
24457      }
24458  
24459      // Check if the term we are adding already exists.
24460      const existingTerm = findTerm(availableTerms, formParent, formName);
24461      if (existingTerm) {
24462        // If the term we are adding exists but is not selected select it.
24463        if (!terms.some(term => term === existingTerm.id)) {
24464          onUpdateTerms([...terms, existingTerm.id]);
24465        }
24466        setFormName('');
24467        setFormParent('');
24468        return;
24469      }
24470      setAdding(true);
24471      let newTerm;
24472      try {
24473        newTerm = await addTerm({
24474          name: formName,
24475          parent: formParent ? formParent : undefined
24476        });
24477      } catch (error) {
24478        createErrorNotice(error.message, {
24479          type: 'snackbar'
24480        });
24481        return;
24482      }
24483      const defaultName = slug === 'category' ? (0,external_wp_i18n_namespaceObject.__)('Category') : (0,external_wp_i18n_namespaceObject.__)('Term');
24484      const termAddedMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: term name. */
24485      (0,external_wp_i18n_namespaceObject._x)('%s added', 'term'), (_taxonomy$labels$sing = taxonomy?.labels?.singular_name) !== null && _taxonomy$labels$sing !== void 0 ? _taxonomy$labels$sing : defaultName);
24486      (0,external_wp_a11y_namespaceObject.speak)(termAddedMessage, 'assertive');
24487      setAdding(false);
24488      setFormName('');
24489      setFormParent('');
24490      onUpdateTerms([...terms, newTerm.id]);
24491    };
24492    const setFilter = value => {
24493      const newFilteredTermsTree = availableTermsTree.map(getFilterMatcher(value)).filter(term => term);
24494      const getResultCount = termsTree => {
24495        let count = 0;
24496        for (let i = 0; i < termsTree.length; i++) {
24497          count++;
24498          if (undefined !== termsTree[i].children) {
24499            count += getResultCount(termsTree[i].children);
24500          }
24501        }
24502        return count;
24503      };
24504      setFilterValue(value);
24505      setFilteredTermsTree(newFilteredTermsTree);
24506      const resultCount = getResultCount(newFilteredTermsTree);
24507      const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of results. */
24508      (0,external_wp_i18n_namespaceObject._n)('%d result found.', '%d results found.', resultCount), resultCount);
24509      debouncedSpeak(resultsFoundMessage, 'assertive');
24510    };
24511    const renderTerms = renderedTerms => {
24512      return renderedTerms.map(term => {
24513        return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
24514          className: "editor-post-taxonomies__hierarchical-terms-choice",
24515          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, {
24516            __nextHasNoMarginBottom: true,
24517            checked: terms.indexOf(term.id) !== -1,
24518            onChange: () => {
24519              const termId = parseInt(term.id, 10);
24520              onChange(termId);
24521            },
24522            label: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(term.name)
24523          }), !!term.children.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
24524            className: "editor-post-taxonomies__hierarchical-terms-subchoices",
24525            children: renderTerms(term.children)
24526          })]
24527        }, term.id);
24528      });
24529    };
24530    const labelWithFallback = (labelProperty, fallbackIsCategory, fallbackIsNotCategory) => {
24531      var _taxonomy$labels$labe;
24532      return (_taxonomy$labels$labe = taxonomy?.labels?.[labelProperty]) !== null && _taxonomy$labels$labe !== void 0 ? _taxonomy$labels$labe : slug === 'category' ? fallbackIsCategory : fallbackIsNotCategory;
24533    };
24534    const newTermButtonLabel = labelWithFallback('add_new_item', (0,external_wp_i18n_namespaceObject.__)('Add new category'), (0,external_wp_i18n_namespaceObject.__)('Add new term'));
24535    const newTermLabel = labelWithFallback('new_item_name', (0,external_wp_i18n_namespaceObject.__)('Add new category'), (0,external_wp_i18n_namespaceObject.__)('Add new term'));
24536    const parentSelectLabel = labelWithFallback('parent_item', (0,external_wp_i18n_namespaceObject.__)('Parent Category'), (0,external_wp_i18n_namespaceObject.__)('Parent Term'));
24537    const noParentOption = `— $parentSelectLabel} —`;
24538    const newTermSubmitLabel = newTermButtonLabel;
24539    const filterLabel = (_taxonomy$labels$sear = taxonomy?.labels?.search_items) !== null && _taxonomy$labels$sear !== void 0 ? _taxonomy$labels$sear : (0,external_wp_i18n_namespaceObject.__)('Search Terms');
24540    const groupLabel = (_taxonomy$name = taxonomy?.name) !== null && _taxonomy$name !== void 0 ? _taxonomy$name : (0,external_wp_i18n_namespaceObject.__)('Terms');
24541    const showFilter = availableTerms.length >= MIN_TERMS_COUNT_FOR_FILTER;
24542    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, {
24543      direction: "column",
24544      gap: "4",
24545      children: [showFilter && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SearchControl, {
24546        __next40pxDefaultSize: true,
24547        __nextHasNoMarginBottom: true,
24548        label: filterLabel,
24549        placeholder: filterLabel,
24550        value: filterValue,
24551        onChange: setFilter
24552      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
24553        className: "editor-post-taxonomies__hierarchical-terms-list",
24554        tabIndex: "0",
24555        role: "group",
24556        "aria-label": groupLabel,
24557        children: renderTerms('' !== filterValue ? filteredTermsTree : availableTermsTree)
24558      }), !loading && hasCreateAction && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
24559        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
24560          __next40pxDefaultSize: true,
24561          onClick: onToggleForm,
24562          className: "editor-post-taxonomies__hierarchical-terms-add",
24563          "aria-expanded": showForm,
24564          variant: "link",
24565          children: newTermButtonLabel
24566        })
24567      }), showForm && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
24568        onSubmit: onAddTerm,
24569        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, {
24570          direction: "column",
24571          gap: "4",
24572          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
24573            __next40pxDefaultSize: true,
24574            __nextHasNoMarginBottom: true,
24575            className: "editor-post-taxonomies__hierarchical-terms-input",
24576            label: newTermLabel,
24577            value: formName,
24578            onChange: onChangeFormName,
24579            required: true
24580          }), !!availableTerms.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TreeSelect, {
24581            __next40pxDefaultSize: true,
24582            __nextHasNoMarginBottom: true,
24583            label: parentSelectLabel,
24584            noOptionLabel: noParentOption,
24585            onChange: onChangeFormParent,
24586            selectedId: formParent,
24587            tree: availableTermsTree
24588          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
24589            children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
24590              __next40pxDefaultSize: true,
24591              variant: "secondary",
24592              type: "submit",
24593              className: "editor-post-taxonomies__hierarchical-terms-submit",
24594              children: newTermSubmitLabel
24595            })
24596          })]
24597        })
24598      })]
24599    });
24600  }
24601  /* harmony default export */ const hierarchical_term_selector = ((0,external_wp_components_namespaceObject.withFilters)('editor.PostTaxonomyType')(HierarchicalTermSelector));
24602  
24603  ;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-category-panel.js
24604  /**
24605   * WordPress dependencies
24606   */
24607  
24608  
24609  
24610  
24611  
24612  
24613  /**
24614   * Internal dependencies
24615   */
24616  
24617  
24618  
24619  function MaybeCategoryPanel() {
24620    const hasNoCategory = (0,external_wp_data_namespaceObject.useSelect)(select => {
24621      const postType = select(store_store).getCurrentPostType();
24622      const {
24623        canUser,
24624        getEntityRecord
24625      } = select(external_wp_coreData_namespaceObject.store);
24626      const categoriesTaxonomy = getEntityRecord('root', 'taxonomy', 'category');
24627      const defaultCategoryId = canUser('read', {
24628        kind: 'root',
24629        name: 'site'
24630      }) ? getEntityRecord('root', 'site')?.default_category : undefined;
24631      const defaultCategory = defaultCategoryId ? getEntityRecord('taxonomy', 'category', defaultCategoryId) : undefined;
24632      const postTypeSupportsCategories = categoriesTaxonomy && categoriesTaxonomy.types.some(type => type === postType);
24633      const categories = categoriesTaxonomy && select(store_store).getEditedPostAttribute(categoriesTaxonomy.rest_base);
24634  
24635      // This boolean should return true if everything is loaded
24636      // ( categoriesTaxonomy, defaultCategory )
24637      // and the post has not been assigned a category different than "uncategorized".
24638      return !!categoriesTaxonomy && !!defaultCategory && postTypeSupportsCategories && (categories?.length === 0 || categories?.length === 1 && defaultCategory?.id === categories[0]);
24639    }, []);
24640    const [shouldShowPanel, setShouldShowPanel] = (0,external_wp_element_namespaceObject.useState)(false);
24641    (0,external_wp_element_namespaceObject.useEffect)(() => {
24642      // We use state to avoid hiding the panel if the user edits the categories
24643      // and adds one within the panel itself (while visible).
24644      if (hasNoCategory) {
24645        setShouldShowPanel(true);
24646      }
24647    }, [hasNoCategory]);
24648    if (!shouldShowPanel) {
24649      return null;
24650    }
24651    const panelBodyTitle = [(0,external_wp_i18n_namespaceObject.__)('Suggestion:'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
24652      className: "editor-post-publish-panel__link",
24653      children: (0,external_wp_i18n_namespaceObject.__)('Assign a category')
24654    }, "label")];
24655    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, {
24656      initialOpen: false,
24657      title: panelBodyTitle,
24658      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
24659        children: (0,external_wp_i18n_namespaceObject.__)('Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.')
24660      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(hierarchical_term_selector, {
24661        slug: "category"
24662      })]
24663    });
24664  }
24665  /* harmony default export */ const maybe_category_panel = (MaybeCategoryPanel);
24666  
24667  ;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/media-util.js
24668  /**
24669   * External dependencies
24670   */
24671  
24672  
24673  /**
24674   * WordPress dependencies
24675   */
24676  
24677  
24678  /**
24679   * Generate a list of unique basenames given a list of URLs.
24680   *
24681   * We want all basenames to be unique, since sometimes the extension
24682   * doesn't reflect the mime type, and may end up getting changed by
24683   * the server, on upload.
24684   *
24685   * @param {string[]} urls The list of URLs
24686   * @return {Record< string, string >} A URL => basename record.
24687   */
24688  function generateUniqueBasenames(urls) {
24689    const basenames = new Set();
24690    return Object.fromEntries(urls.map(url => {
24691      // We prefer to match the remote filename, if possible.
24692      const filename = (0,external_wp_url_namespaceObject.getFilename)(url);
24693      let basename = '';
24694      if (filename) {
24695        const parts = filename.split('.');
24696        if (parts.length > 1) {
24697          // Assume the last part is the extension.
24698          parts.pop();
24699        }
24700        basename = parts.join('.');
24701      }
24702      if (!basename) {
24703        // It looks like we don't have a basename, so let's use a UUID.
24704        basename = esm_browser_v4();
24705      }
24706      if (basenames.has(basename)) {
24707        // Append a UUID to deduplicate the basename.
24708        // The server will try to deduplicate on its own if we don't do this,
24709        // but it may run into a race condition
24710        // (see https://github.com/WordPress/gutenberg/issues/64899).
24711        // Deduplicating the filenames before uploading is safer.
24712        basename = `$basename}-$esm_browser_v4()}`;
24713      }
24714      basenames.add(basename);
24715      return [url, basename];
24716    }));
24717  }
24718  
24719  /**
24720   * Fetch a list of URLs, turning those into promises for files with
24721   * unique filenames.
24722   *
24723   * @param {string[]} urls The list of URLs
24724   * @return {Record< string, Promise< File > >} A URL => File promise record.
24725   */
24726  function fetchMedia(urls) {
24727    return Object.fromEntries(Object.entries(generateUniqueBasenames(urls)).map(([url, basename]) => {
24728      const filePromise = window.fetch(url.includes('?') ? url : url + '?').then(response => response.blob()).then(blob => {
24729        // The server will reject the upload if it doesn't have an extension,
24730        // even though it'll rewrite the file name to match the mime type.
24731        // Here we provide it with a safe extension to get it past that check.
24732        return new File([blob], `$basename}.png`, {
24733          type: blob.type
24734        });
24735      });
24736      return [url, filePromise];
24737    }));
24738  }
24739  
24740  ;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-upload-media.js
24741  /**
24742   * WordPress dependencies
24743   */
24744  
24745  
24746  
24747  
24748  
24749  
24750  
24751  /**
24752   * Internal dependencies
24753   */
24754  
24755  
24756  function flattenBlocks(blocks) {
24757    const result = [];
24758    blocks.forEach(block => {
24759      result.push(block);
24760      result.push(...flattenBlocks(block.innerBlocks));
24761    });
24762    return result;
24763  }
24764  
24765  /**
24766   * Determine whether a block has external media.
24767   *
24768   * Different blocks use different attribute names (and potentially
24769   * different logic as well) in determining whether the media is
24770   * present, and whether it's external.
24771   *
24772   * @param {{name: string, attributes: Object}} block The block.
24773   * @return {boolean?} Whether the block has external media
24774   */
24775  function hasExternalMedia(block) {
24776    if (block.name === 'core/image' || block.name === 'core/cover') {
24777      return block.attributes.url && !block.attributes.id;
24778    }
24779    if (block.name === 'core/media-text') {
24780      return block.attributes.mediaUrl && !block.attributes.mediaId;
24781    }
24782    return undefined;
24783  }
24784  
24785  /**
24786   * Retrieve media info from a block.
24787   *
24788   * Different blocks use different attribute names, so we need this
24789   * function to normalize things into a consistent naming scheme.
24790   *
24791   * @param {{name: string, attributes: Object}} block The block.
24792   * @return {{url: ?string, alt: ?string, id: ?number}} The media info for the block.
24793   */
24794  function getMediaInfo(block) {
24795    if (block.name === 'core/image' || block.name === 'core/cover') {
24796      const {
24797        url,
24798        alt,
24799        id
24800      } = block.attributes;
24801      return {
24802        url,
24803        alt,
24804        id
24805      };
24806    }
24807    if (block.name === 'core/media-text') {
24808      const {
24809        mediaUrl: url,
24810        mediaAlt: alt,
24811        mediaId: id
24812      } = block.attributes;
24813      return {
24814        url,
24815        alt,
24816        id
24817      };
24818    }
24819    return {};
24820  }
24821  
24822  // Image component to represent a single image in the upload dialog.
24823  function Image({
24824    clientId,
24825    alt,
24826    url
24827  }) {
24828    const {
24829      selectBlock
24830    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
24831    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.img, {
24832      tabIndex: 0,
24833      role: "button",
24834      "aria-label": (0,external_wp_i18n_namespaceObject.__)('Select image block.'),
24835      onClick: () => {
24836        selectBlock(clientId);
24837      },
24838      onKeyDown: event => {
24839        if (event.key === 'Enter' || event.key === ' ') {
24840          selectBlock(clientId);
24841          event.preventDefault();
24842        }
24843      },
24844      alt: alt,
24845      src: url,
24846      animate: {
24847        opacity: 1
24848      },
24849      exit: {
24850        opacity: 0,
24851        scale: 0
24852      },
24853      style: {
24854        width: '32px',
24855        height: '32px',
24856        objectFit: 'cover',
24857        borderRadius: '2px',
24858        cursor: 'pointer'
24859      },
24860      whileHover: {
24861        scale: 1.08
24862      }
24863    }, clientId);
24864  }
24865  function MaybeUploadMediaPanel() {
24866    const [isUploading, setIsUploading] = (0,external_wp_element_namespaceObject.useState)(false);
24867    const [isAnimating, setIsAnimating] = (0,external_wp_element_namespaceObject.useState)(false);
24868    const [hadUploadError, setHadUploadError] = (0,external_wp_element_namespaceObject.useState)(false);
24869    const {
24870      editorBlocks,
24871      mediaUpload
24872    } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
24873      editorBlocks: select(external_wp_blockEditor_namespaceObject.store).getBlocks(),
24874      mediaUpload: select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload
24875    }), []);
24876  
24877    // Get a list of blocks with external media.
24878    const blocksWithExternalMedia = flattenBlocks(editorBlocks).filter(block => hasExternalMedia(block));
24879    const {
24880      updateBlockAttributes
24881    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
24882    if (!mediaUpload || !blocksWithExternalMedia.length) {
24883      return null;
24884    }
24885    const panelBodyTitle = [(0,external_wp_i18n_namespaceObject.__)('Suggestion:'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
24886      className: "editor-post-publish-panel__link",
24887      children: (0,external_wp_i18n_namespaceObject.__)('External media')
24888    }, "label")];
24889  
24890    /**
24891     * Update an individual block to point to newly-added library media.
24892     *
24893     * Different blocks use different attribute names, so we need this
24894     * function to ensure we modify the correct attributes for each type.
24895     *
24896     * @param {{name: string, attributes: Object}} block The block.
24897     * @param {{id: number, url: string}}          media Media library file info.
24898     */
24899    function updateBlockWithUploadedMedia(block, media) {
24900      if (block.name === 'core/image' || block.name === 'core/cover') {
24901        updateBlockAttributes(block.clientId, {
24902          id: media.id,
24903          url: media.url
24904        });
24905      }
24906      if (block.name === 'core/media-text') {
24907        updateBlockAttributes(block.clientId, {
24908          mediaId: media.id,
24909          mediaUrl: media.url
24910        });
24911      }
24912    }
24913  
24914    // Handle fetching and uploading all external media in the post.
24915    function uploadImages() {
24916      setIsUploading(true);
24917      setHadUploadError(false);
24918  
24919      // Multiple blocks can be using the same URL, so we
24920      // should ensure we only fetch and upload each of them once.
24921      const mediaUrls = new Set(blocksWithExternalMedia.map(block => {
24922        const {
24923          url
24924        } = getMediaInfo(block);
24925        return url;
24926      }));
24927  
24928      // Create an upload promise for each URL, that we can wait for in all
24929      // blocks that make use of that media.
24930      const uploadPromises = Object.fromEntries(Object.entries(fetchMedia([...mediaUrls])).map(([url, filePromise]) => {
24931        const uploadPromise = filePromise.then(blob => new Promise((resolve, reject) => {
24932          mediaUpload({
24933            filesList: [blob],
24934            onFileChange: ([media]) => {
24935              if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
24936                return;
24937              }
24938              resolve(media);
24939            },
24940            onError() {
24941              reject();
24942            }
24943          });
24944        }));
24945        return [url, uploadPromise];
24946      }));
24947  
24948      // Wait for all blocks to be updated with library media.
24949      Promise.allSettled(blocksWithExternalMedia.map(block => {
24950        const {
24951          url
24952        } = getMediaInfo(block);
24953        return uploadPromises[url].then(media => updateBlockWithUploadedMedia(block, media)).then(() => setIsAnimating(true)).catch(() => setHadUploadError(true));
24954      })).finally(() => {
24955        setIsUploading(false);
24956      });
24957    }
24958    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, {
24959      initialOpen: true,
24960      title: panelBodyTitle,
24961      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
24962        children: (0,external_wp_i18n_namespaceObject.__)('Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.')
24963      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
24964        style: {
24965          display: 'inline-flex',
24966          flexWrap: 'wrap',
24967          gap: '8px'
24968        },
24969        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, {
24970          onExitComplete: () => setIsAnimating(false),
24971          children: blocksWithExternalMedia.map(block => {
24972            const {
24973              url,
24974              alt
24975            } = getMediaInfo(block);
24976            return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Image, {
24977              clientId: block.clientId,
24978              url: url,
24979              alt: alt
24980            }, block.clientId);
24981          })
24982        }), isUploading || isAnimating ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
24983          size: "compact",
24984          variant: "primary",
24985          onClick: uploadImages,
24986          children: (0,external_wp_i18n_namespaceObject._x)('Upload', 'verb')
24987        })]
24988      }), hadUploadError && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
24989        children: (0,external_wp_i18n_namespaceObject.__)('Upload failed, try again.')
24990      })]
24991    });
24992  }
24993  
24994  ;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/prepublish.js
24995  /**
24996   * WordPress dependencies
24997   */
24998  
24999  
25000  
25001  
25002  
25003  
25004  
25005  
25006  /**
25007   * Internal dependencies
25008   */
25009  
25010  
25011  
25012  
25013  
25014  
25015  
25016  
25017  
25018  
25019  function PostPublishPanelPrepublish({
25020    children
25021  }) {
25022    const {
25023      isBeingScheduled,
25024      isRequestingSiteIcon,
25025      hasPublishAction,
25026      siteIconUrl,
25027      siteTitle,
25028      siteHome
25029    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
25030      var _getCurrentPost$_link;
25031      const {
25032        getCurrentPost,
25033        isEditedPostBeingScheduled
25034      } = select(store_store);
25035      const {
25036        getEntityRecord,
25037        isResolving
25038      } = select(external_wp_coreData_namespaceObject.store);
25039      const siteData = getEntityRecord('root', '__unstableBase', undefined) || {};
25040      return {
25041        hasPublishAction: (_getCurrentPost$_link = getCurrentPost()._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false,
25042        isBeingScheduled: isEditedPostBeingScheduled(),
25043        isRequestingSiteIcon: isResolving('getEntityRecord', ['root', '__unstableBase', undefined]),
25044        siteIconUrl: siteData.site_icon_url,
25045        siteTitle: siteData.name,
25046        siteHome: siteData.home && (0,external_wp_url_namespaceObject.filterURLForDisplay)(siteData.home)
25047      };
25048    }, []);
25049    let siteIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
25050      className: "components-site-icon",
25051      size: "36px",
25052      icon: library_wordpress
25053    });
25054    if (siteIconUrl) {
25055      siteIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
25056        alt: (0,external_wp_i18n_namespaceObject.__)('Site Icon'),
25057        className: "components-site-icon",
25058        src: siteIconUrl
25059      });
25060    }
25061    if (isRequestingSiteIcon) {
25062      siteIcon = null;
25063    }
25064    let prePublishTitle, prePublishBodyText;
25065    if (!hasPublishAction) {
25066      prePublishTitle = (0,external_wp_i18n_namespaceObject.__)('Are you ready to submit for review?');
25067      prePublishBodyText = (0,external_wp_i18n_namespaceObject.__)('Your work will be reviewed and then approved.');
25068    } else if (isBeingScheduled) {
25069      prePublishTitle = (0,external_wp_i18n_namespaceObject.__)('Are you ready to schedule?');
25070      prePublishBodyText = (0,external_wp_i18n_namespaceObject.__)('Your work will be published at the specified date and time.');
25071    } else {
25072      prePublishTitle = (0,external_wp_i18n_namespaceObject.__)('Are you ready to publish?');
25073      prePublishBodyText = (0,external_wp_i18n_namespaceObject.__)('Double-check your settings before publishing.');
25074    }
25075    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
25076      className: "editor-post-publish-panel__prepublish",
25077      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
25078        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {
25079          children: prePublishTitle
25080        })
25081      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
25082        children: prePublishBodyText
25083      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
25084        className: "components-site-card",
25085        children: [siteIcon, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
25086          className: "components-site-info",
25087          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
25088            className: "components-site-name",
25089            children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteTitle) || (0,external_wp_i18n_namespaceObject.__)('(Untitled)')
25090          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
25091            className: "components-site-home",
25092            children: siteHome
25093          })]
25094        })]
25095      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MaybeUploadMediaPanel, {}), hasPublishAction && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
25096        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
25097          initialOpen: false,
25098          title: [(0,external_wp_i18n_namespaceObject.__)('Visibility:'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
25099            className: "editor-post-publish-panel__link",
25100            children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostVisibilityLabel, {})
25101          }, "label")],
25102          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostVisibility, {})
25103        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
25104          initialOpen: false,
25105          title: [(0,external_wp_i18n_namespaceObject.__)('Publish:'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
25106            className: "editor-post-publish-panel__link",
25107            children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostScheduleLabel, {})
25108          }, "label")],
25109          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSchedule, {})
25110        })]
25111      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostFormatPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(maybe_tags_panel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(maybe_category_panel, {}), children]
25112    });
25113  }
25114  /* harmony default export */ const prepublish = (PostPublishPanelPrepublish);
25115  
25116  ;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/postpublish.js
25117  /**
25118   * WordPress dependencies
25119   */
25120  
25121  
25122  
25123  
25124  
25125  
25126  
25127  
25128  
25129  /**
25130   * Internal dependencies
25131   */
25132  
25133  
25134  
25135  const POSTNAME = '%postname%';
25136  const PAGENAME = '%pagename%';
25137  
25138  /**
25139   * Returns URL for a future post.
25140   *
25141   * @param {Object} post Post object.
25142   *
25143   * @return {string} PostPublish URL.
25144   */
25145  
25146  const getFuturePostUrl = post => {
25147    const {
25148      slug
25149    } = post;
25150    if (post.permalink_template.includes(POSTNAME)) {
25151      return post.permalink_template.replace(POSTNAME, slug);
25152    }
25153    if (post.permalink_template.includes(PAGENAME)) {
25154      return post.permalink_template.replace(PAGENAME, slug);
25155    }
25156    return post.permalink_template;
25157  };
25158  function postpublish_CopyButton({
25159    text
25160  }) {
25161    const [showCopyConfirmation, setShowCopyConfirmation] = (0,external_wp_element_namespaceObject.useState)(false);
25162    const timeoutIdRef = (0,external_wp_element_namespaceObject.useRef)();
25163    const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text, () => {
25164      setShowCopyConfirmation(true);
25165      if (timeoutIdRef.current) {
25166        clearTimeout(timeoutIdRef.current);
25167      }
25168      timeoutIdRef.current = setTimeout(() => {
25169        setShowCopyConfirmation(false);
25170      }, 4000);
25171    });
25172    (0,external_wp_element_namespaceObject.useEffect)(() => {
25173      return () => {
25174        if (timeoutIdRef.current) {
25175          clearTimeout(timeoutIdRef.current);
25176        }
25177      };
25178    }, []);
25179    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
25180      __next40pxDefaultSize: true,
25181      variant: "secondary",
25182      ref: ref,
25183      children: showCopyConfirmation ? (0,external_wp_i18n_namespaceObject.__)('Copied!') : (0,external_wp_i18n_namespaceObject.__)('Copy')
25184    });
25185  }
25186  function PostPublishPanelPostpublish({
25187    focusOnMount,
25188    children
25189  }) {
25190    const {
25191      post,
25192      postType,
25193      isScheduled
25194    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
25195      const {
25196        getEditedPostAttribute,
25197        getCurrentPost,
25198        isCurrentPostScheduled
25199      } = select(store_store);
25200      const {
25201        getPostType
25202      } = select(external_wp_coreData_namespaceObject.store);
25203      return {
25204        post: getCurrentPost(),
25205        postType: getPostType(getEditedPostAttribute('type')),
25206        isScheduled: isCurrentPostScheduled()
25207      };
25208    }, []);
25209    const postLabel = postType?.labels?.singular_name;
25210    const viewPostLabel = postType?.labels?.view_item;
25211    const addNewPostLabel = postType?.labels?.add_new_item;
25212    const link = post.status === 'future' ? getFuturePostUrl(post) : post.link;
25213    const addLink = (0,external_wp_url_namespaceObject.addQueryArgs)('post-new.php', {
25214      post_type: post.type
25215    });
25216    const postLinkRef = (0,external_wp_element_namespaceObject.useCallback)(node => {
25217      if (focusOnMount && node) {
25218        node.focus();
25219      }
25220    }, [focusOnMount]);
25221    const postPublishNonLinkHeader = isScheduled ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
25222      children: [(0,external_wp_i18n_namespaceObject.__)('is now scheduled. It will go live on'), ' ', /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostScheduleLabel, {}), "."]
25223    }) : (0,external_wp_i18n_namespaceObject.__)('is now live.');
25224    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
25225      className: "post-publish-panel__postpublish",
25226      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, {
25227        className: "post-publish-panel__postpublish-header",
25228        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", {
25229          ref: postLinkRef,
25230          href: link,
25231          children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(post.title) || (0,external_wp_i18n_namespaceObject.__)('(no title)')
25232        }), ' ', postPublishNonLinkHeader]
25233      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, {
25234        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
25235          className: "post-publish-panel__postpublish-subheader",
25236          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {
25237            children: (0,external_wp_i18n_namespaceObject.__)('What’s next?')
25238          })
25239        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
25240          className: "post-publish-panel__postpublish-post-address-container",
25241          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
25242            __next40pxDefaultSize: true,
25243            __nextHasNoMarginBottom: true,
25244            className: "post-publish-panel__postpublish-post-address",
25245            readOnly: true,
25246            label: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: post type singular name */
25247            (0,external_wp_i18n_namespaceObject.__)('%s address'), postLabel),
25248            value: (0,external_wp_url_namespaceObject.safeDecodeURIComponent)(link),
25249            onFocus: event => event.target.select()
25250          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
25251            className: "post-publish-panel__postpublish-post-address__copy-button-wrap",
25252            children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(postpublish_CopyButton, {
25253              text: link
25254            })
25255          })]
25256        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
25257          className: "post-publish-panel__postpublish-buttons",
25258          children: [!isScheduled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
25259            variant: "primary",
25260            href: link,
25261            __next40pxDefaultSize: true,
25262            children: viewPostLabel
25263          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
25264            variant: isScheduled ? 'primary' : 'secondary',
25265            __next40pxDefaultSize: true,
25266            href: addLink,
25267            children: addNewPostLabel
25268          })]
25269        })]
25270      }), children]
25271    });
25272  }
25273  
25274  ;// ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/index.js
25275  /**
25276   * WordPress dependencies
25277   */
25278  
25279  
25280  
25281  
25282  
25283  
25284  
25285  
25286  /**
25287   * Internal dependencies
25288   */
25289  
25290  
25291  
25292  
25293  
25294  class PostPublishPanel extends external_wp_element_namespaceObject.Component {
25295    constructor() {
25296      super(...arguments);
25297      this.onSubmit = this.onSubmit.bind(this);
25298      this.cancelButtonNode = (0,external_wp_element_namespaceObject.createRef)();
25299    }
25300    componentDidMount() {
25301      // This timeout is necessary to make sure the `useEffect` hook of
25302      // `useFocusReturn` gets the correct element (the button that opens the
25303      // PostPublishPanel) otherwise it will get this button.
25304      this.timeoutID = setTimeout(() => {
25305        this.cancelButtonNode.current.focus();
25306      }, 0);
25307    }
25308    componentWillUnmount() {
25309      clearTimeout(this.timeoutID);
25310    }
25311    componentDidUpdate(prevProps) {
25312      // Automatically collapse the publish sidebar when a post
25313      // is published and the user makes an edit.
25314      if (prevProps.isPublished && !this.props.isSaving && this.props.isDirty || this.props.currentPostId !== prevProps.currentPostId) {
25315        this.props.onClose();
25316      }
25317    }
25318    onSubmit() {
25319      const {
25320        onClose,
25321        hasPublishAction,
25322        isPostTypeViewable
25323      } = this.props;
25324      if (!hasPublishAction || !isPostTypeViewable) {
25325        onClose();
25326      }
25327    }
25328    render() {
25329      const {
25330        forceIsDirty,
25331        isBeingScheduled,
25332        isPublished,
25333        isPublishSidebarEnabled,
25334        isScheduled,
25335        isSaving,
25336        isSavingNonPostEntityChanges,
25337        onClose,
25338        onTogglePublishSidebar,
25339        PostPublishExtension,
25340        PrePublishExtension,
25341        currentPostId,
25342        ...additionalProps
25343      } = this.props;
25344      const {
25345        hasPublishAction,
25346        isDirty,
25347        isPostTypeViewable,
25348        ...propsForPanel
25349      } = additionalProps;
25350      const isPublishedOrScheduled = isPublished || isScheduled && isBeingScheduled;
25351      const isPrePublish = !isPublishedOrScheduled && !isSaving;
25352      const isPostPublish = isPublishedOrScheduled && !isSaving;
25353      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
25354        className: "editor-post-publish-panel",
25355        ...propsForPanel,
25356        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
25357          className: "editor-post-publish-panel__header",
25358          children: isPostPublish ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
25359            size: "compact",
25360            onClick: onClose,
25361            icon: close_small,
25362            label: (0,external_wp_i18n_namespaceObject.__)('Close panel')
25363          }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
25364            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
25365              className: "editor-post-publish-panel__header-cancel-button",
25366              children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
25367                ref: this.cancelButtonNode,
25368                accessibleWhenDisabled: true,
25369                disabled: isSavingNonPostEntityChanges,
25370                onClick: onClose,
25371                variant: "secondary",
25372                size: "compact",
25373                children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
25374              })
25375            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
25376              className: "editor-post-publish-panel__header-publish-button",
25377              children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_publish_button, {
25378                onSubmit: this.onSubmit,
25379                forceIsDirty: forceIsDirty
25380              })
25381            })]
25382          })
25383        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
25384          className: "editor-post-publish-panel__content",
25385          children: [isPrePublish && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(prepublish, {
25386            children: PrePublishExtension && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrePublishExtension, {})
25387          }), isPostPublish && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPublishPanelPostpublish, {
25388            focusOnMount: true,
25389            children: PostPublishExtension && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPublishExtension, {})
25390          }), isSaving && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})]
25391        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
25392          className: "editor-post-publish-panel__footer",
25393          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, {
25394            __nextHasNoMarginBottom: true,
25395            label: (0,external_wp_i18n_namespaceObject.__)('Always show pre-publish checks.'),
25396            checked: isPublishSidebarEnabled,
25397            onChange: onTogglePublishSidebar
25398          })
25399        })]
25400      });
25401    }
25402  }
25403  
25404  /**
25405   * Renders a panel for publishing a post.
25406   */
25407  /* harmony default export */ const post_publish_panel = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)(select => {
25408    var _getCurrentPost$_link;
25409    const {
25410      getPostType
25411    } = select(external_wp_coreData_namespaceObject.store);
25412    const {
25413      getCurrentPost,
25414      getCurrentPostId,
25415      getEditedPostAttribute,
25416      isCurrentPostPublished,
25417      isCurrentPostScheduled,
25418      isEditedPostBeingScheduled,
25419      isEditedPostDirty,
25420      isAutosavingPost,
25421      isSavingPost,
25422      isSavingNonPostEntityChanges
25423    } = select(store_store);
25424    const {
25425      isPublishSidebarEnabled
25426    } = select(store_store);
25427    const postType = getPostType(getEditedPostAttribute('type'));
25428    return {
25429      hasPublishAction: (_getCurrentPost$_link = getCurrentPost()._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false,
25430      isPostTypeViewable: postType?.viewable,
25431      isBeingScheduled: isEditedPostBeingScheduled(),
25432      isDirty: isEditedPostDirty(),
25433      isPublished: isCurrentPostPublished(),
25434      isPublishSidebarEnabled: isPublishSidebarEnabled(),
25435      isSaving: isSavingPost() && !isAutosavingPost(),
25436      isSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),
25437      isScheduled: isCurrentPostScheduled(),
25438      currentPostId: getCurrentPostId()
25439    };
25440  }), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, {
25441    isPublishSidebarEnabled
25442  }) => {
25443    const {
25444      disablePublishSidebar,
25445      enablePublishSidebar
25446    } = dispatch(store_store);
25447    return {
25448      onTogglePublishSidebar: () => {
25449        if (isPublishSidebarEnabled) {
25450          disablePublishSidebar();
25451        } else {
25452          enablePublishSidebar();
25453        }
25454      }
25455    };
25456  }), external_wp_components_namespaceObject.withFocusReturn, external_wp_components_namespaceObject.withConstrainedTabbing])(PostPublishPanel));
25457  
25458  ;// ./node_modules/@wordpress/icons/build-module/library/cloud-upload.js
25459  /**
25460   * WordPress dependencies
25461   */
25462  
25463  
25464  const cloudUpload = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
25465    xmlns: "http://www.w3.org/2000/svg",
25466    viewBox: "0 0 24 24",
25467    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
25468      d: "M17.3 10.1C17.3 7.60001 15.2 5.70001 12.5 5.70001C10.3 5.70001 8.4 7.10001 7.9 9.00001H7.7C5.7 9.00001 4 10.7 4 12.8C4 14.9 5.7 16.6 7.7 16.6H9.5V15.2H7.7C6.5 15.2 5.5 14.1 5.5 12.9C5.5 11.7 6.5 10.5 7.7 10.5H9L9.3 9.40001C9.7 8.10001 11 7.20001 12.5 7.20001C14.3 7.20001 15.8 8.50001 15.8 10.1V11.4L17.1 11.6C17.9 11.7 18.5 12.5 18.5 13.4C18.5 14.4 17.7 15.2 16.8 15.2H14.5V16.6H16.7C18.5 16.6 19.9 15.1 19.9 13.3C20 11.7 18.8 10.4 17.3 10.1Z M14.1245 14.2426L15.1852 13.182L12.0032 10L8.82007 13.1831L9.88072 14.2438L11.25 12.8745V18H12.75V12.8681L14.1245 14.2426Z"
25469    })
25470  });
25471  /* harmony default export */ const cloud_upload = (cloudUpload);
25472  
25473  ;// ./node_modules/@wordpress/icons/build-module/library/cloud.js
25474  /**
25475   * WordPress dependencies
25476   */
25477  
25478  
25479  const cloud = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
25480    xmlns: "http://www.w3.org/2000/svg",
25481    viewBox: "0 0 24 24",
25482    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
25483      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"
25484    })
25485  });
25486  /* harmony default export */ const library_cloud = (cloud);
25487  
25488  ;// ./node_modules/@wordpress/editor/build-module/components/post-sticky/check.js
25489  /**
25490   * WordPress dependencies
25491   */
25492  
25493  
25494  /**
25495   * Internal dependencies
25496   */
25497  
25498  
25499  /**
25500   * Wrapper component that renders its children only if post has a sticky action.
25501   *
25502   * @param {Object}          props          Props.
25503   * @param {React.ReactNode} props.children Children to be rendered.
25504   *
25505   * @return {React.ReactNode} The component to be rendered or null if post type is not 'post' or hasStickyAction is false.
25506   */
25507  function PostStickyCheck({
25508    children
25509  }) {
25510    const {
25511      hasStickyAction,
25512      postType
25513    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
25514      var _post$_links$wpActio;
25515      const post = select(store_store).getCurrentPost();
25516      return {
25517        hasStickyAction: (_post$_links$wpActio = post._links?.['wp:action-sticky']) !== null && _post$_links$wpActio !== void 0 ? _post$_links$wpActio : false,
25518        postType: select(store_store).getCurrentPostType()
25519      };
25520    }, []);
25521    if (postType !== 'post' || !hasStickyAction) {
25522      return null;
25523    }
25524    return children;
25525  }
25526  
25527  ;// ./node_modules/@wordpress/editor/build-module/components/post-sticky/index.js
25528  /**
25529   * WordPress dependencies
25530   */
25531  
25532  
25533  
25534  
25535  /**
25536   * Internal dependencies
25537   */
25538  
25539  
25540  
25541  /**
25542   * Renders the PostSticky component. It provides a checkbox control for the sticky post feature.
25543   *
25544   * @return {React.ReactNode} The rendered component.
25545   */
25546  
25547  function PostSticky() {
25548    const postSticky = (0,external_wp_data_namespaceObject.useSelect)(select => {
25549      var _select$getEditedPost;
25550      return (_select$getEditedPost = select(store_store).getEditedPostAttribute('sticky')) !== null && _select$getEditedPost !== void 0 ? _select$getEditedPost : false;
25551    }, []);
25552    const {
25553      editPost
25554    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
25555    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostStickyCheck, {
25556      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, {
25557        className: "editor-post-sticky__checkbox-control",
25558        label: (0,external_wp_i18n_namespaceObject.__)('Sticky'),
25559        help: (0,external_wp_i18n_namespaceObject.__)('Pin this post to the top of the blog'),
25560        checked: postSticky,
25561        onChange: () => editPost({
25562          sticky: !postSticky
25563        }),
25564        __nextHasNoMarginBottom: true
25565      })
25566    });
25567  }
25568  
25569  ;// ./node_modules/@wordpress/editor/build-module/components/post-status/index.js
25570  /**
25571   * WordPress dependencies
25572   */
25573  
25574  
25575  
25576  
25577  
25578  
25579  
25580  
25581  
25582  /**
25583   * Internal dependencies
25584   */
25585  
25586  
25587  
25588  
25589  
25590  
25591  const postStatusesInfo = {
25592    'auto-draft': {
25593      label: (0,external_wp_i18n_namespaceObject.__)('Draft'),
25594      icon: library_drafts
25595    },
25596    draft: {
25597      label: (0,external_wp_i18n_namespaceObject.__)('Draft'),
25598      icon: library_drafts
25599    },
25600    pending: {
25601      label: (0,external_wp_i18n_namespaceObject.__)('Pending'),
25602      icon: library_pending
25603    },
25604    private: {
25605      label: (0,external_wp_i18n_namespaceObject.__)('Private'),
25606      icon: not_allowed
25607    },
25608    future: {
25609      label: (0,external_wp_i18n_namespaceObject.__)('Scheduled'),
25610      icon: library_scheduled
25611    },
25612    publish: {
25613      label: (0,external_wp_i18n_namespaceObject.__)('Published'),
25614      icon: library_published
25615    }
25616  };
25617  const STATUS_OPTIONS = [{
25618    label: (0,external_wp_i18n_namespaceObject.__)('Draft'),
25619    value: 'draft',
25620    description: (0,external_wp_i18n_namespaceObject.__)('Not ready to publish.')
25621  }, {
25622    label: (0,external_wp_i18n_namespaceObject.__)('Pending'),
25623    value: 'pending',
25624    description: (0,external_wp_i18n_namespaceObject.__)('Waiting for review before publishing.')
25625  }, {
25626    label: (0,external_wp_i18n_namespaceObject.__)('Private'),
25627    value: 'private',
25628    description: (0,external_wp_i18n_namespaceObject.__)('Only visible to site admins and editors.')
25629  }, {
25630    label: (0,external_wp_i18n_namespaceObject.__)('Scheduled'),
25631    value: 'future',
25632    description: (0,external_wp_i18n_namespaceObject.__)('Publish automatically on a chosen date.')
25633  }, {
25634    label: (0,external_wp_i18n_namespaceObject.__)('Published'),
25635    value: 'publish',
25636    description: (0,external_wp_i18n_namespaceObject.__)('Visible to everyone.')
25637  }];
25638  const DESIGN_POST_TYPES = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, PATTERN_POST_TYPE, NAVIGATION_POST_TYPE];
25639  function PostStatus() {
25640    const {
25641      status,
25642      date,
25643      password,
25644      postId,
25645      postType,
25646      canEdit
25647    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
25648      var _getCurrentPost$_link;
25649      const {
25650        getEditedPostAttribute,
25651        getCurrentPostId,
25652        getCurrentPostType,
25653        getCurrentPost
25654      } = select(store_store);
25655      return {
25656        status: getEditedPostAttribute('status'),
25657        date: getEditedPostAttribute('date'),
25658        password: getEditedPostAttribute('password'),
25659        postId: getCurrentPostId(),
25660        postType: getCurrentPostType(),
25661        canEdit: (_getCurrentPost$_link = getCurrentPost()._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false
25662      };
25663    }, []);
25664    const [showPassword, setShowPassword] = (0,external_wp_element_namespaceObject.useState)(!!password);
25665    const passwordInputId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostStatus, 'editor-change-status__password-input');
25666    const {
25667      editEntityRecord
25668    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
25669    const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
25670    // Memoize popoverProps to avoid returning a new object every time.
25671    const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
25672      // Anchor the popover to the middle of the entire row so that it doesn't
25673      // move around when the label changes.
25674      anchor: popoverAnchor,
25675      'aria-label': (0,external_wp_i18n_namespaceObject.__)('Status & visibility'),
25676      headerTitle: (0,external_wp_i18n_namespaceObject.__)('Status & visibility'),
25677      placement: 'left-start',
25678      offset: 36,
25679      shift: true
25680    }), [popoverAnchor]);
25681    if (DESIGN_POST_TYPES.includes(postType)) {
25682      return null;
25683    }
25684    const updatePost = ({
25685      status: newStatus = status,
25686      password: newPassword = password,
25687      date: newDate = date
25688    }) => {
25689      editEntityRecord('postType', postType, postId, {
25690        status: newStatus,
25691        date: newDate,
25692        password: newPassword
25693      });
25694    };
25695    const handleTogglePassword = value => {
25696      setShowPassword(value);
25697      if (!value) {
25698        updatePost({
25699          password: ''
25700        });
25701      }
25702    };
25703    const handleStatus = value => {
25704      let newDate = date;
25705      let newPassword = password;
25706      if (status === 'future' && new Date(date) > new Date()) {
25707        newDate = null;
25708      }
25709      if (value === 'private' && password) {
25710        newPassword = '';
25711      }
25712      updatePost({
25713        status: value,
25714        date: newDate,
25715        password: newPassword
25716      });
25717    };
25718    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
25719      label: (0,external_wp_i18n_namespaceObject.__)('Status'),
25720      ref: setPopoverAnchor,
25721      children: canEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
25722        className: "editor-post-status",
25723        contentClassName: "editor-change-status__content",
25724        popoverProps: popoverProps,
25725        focusOnMount: true,
25726        renderToggle: ({
25727          onToggle,
25728          isOpen
25729        }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
25730          className: "editor-post-status__toggle",
25731          variant: "tertiary",
25732          size: "compact",
25733          onClick: onToggle,
25734          icon: postStatusesInfo[status]?.icon,
25735          "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
25736          // translators: %s: Current post status.
25737          (0,external_wp_i18n_namespaceObject.__)('Change status: %s'), postStatusesInfo[status]?.label),
25738          "aria-expanded": isOpen,
25739          children: postStatusesInfo[status]?.label
25740        }),
25741        renderContent: ({
25742          onClose
25743        }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
25744          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
25745            title: (0,external_wp_i18n_namespaceObject.__)('Status & visibility'),
25746            onClose: onClose
25747          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
25748            children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
25749              spacing: 4,
25750              children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RadioControl, {
25751                className: "editor-change-status__options",
25752                hideLabelFromVision: true,
25753                label: (0,external_wp_i18n_namespaceObject.__)('Status'),
25754                options: STATUS_OPTIONS,
25755                onChange: handleStatus,
25756                selected: status === 'auto-draft' ? 'draft' : status
25757              }), status === 'future' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
25758                className: "editor-change-status__publish-date-wrapper",
25759                children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivatePostSchedule, {
25760                  showPopoverHeaderActions: false,
25761                  isCompact: true
25762                })
25763              }), status !== 'private' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
25764                as: "fieldset",
25765                spacing: 4,
25766                className: "editor-change-status__password-fieldset",
25767                children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, {
25768                  __nextHasNoMarginBottom: true,
25769                  label: (0,external_wp_i18n_namespaceObject.__)('Password protected'),
25770                  help: (0,external_wp_i18n_namespaceObject.__)('Only visible to those who know the password'),
25771                  checked: showPassword,
25772                  onChange: handleTogglePassword
25773                }), showPassword && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
25774                  className: "editor-change-status__password-input",
25775                  children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
25776                    label: (0,external_wp_i18n_namespaceObject.__)('Password'),
25777                    onChange: value => updatePost({
25778                      password: value
25779                    }),
25780                    value: password,
25781                    placeholder: (0,external_wp_i18n_namespaceObject.__)('Use a secure password'),
25782                    type: "text",
25783                    id: passwordInputId,
25784                    __next40pxDefaultSize: true,
25785                    __nextHasNoMarginBottom: true,
25786                    maxLength: 255
25787                  })
25788                })]
25789              }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSticky, {})]
25790            })
25791          })]
25792        })
25793      }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
25794        className: "editor-post-status is-read-only",
25795        children: postStatusesInfo[status]?.label
25796      })
25797    });
25798  }
25799  
25800  ;// ./node_modules/@wordpress/editor/build-module/components/post-saved-state/index.js
25801  /**
25802   * External dependencies
25803   */
25804  
25805  
25806  /**
25807   * WordPress dependencies
25808   */
25809  
25810  
25811  
25812  
25813  
25814  
25815  
25816  
25817  
25818  /**
25819   * Internal dependencies
25820   */
25821  
25822  
25823  
25824  /**
25825   * Component showing whether the post is saved or not and providing save
25826   * buttons.
25827   *
25828   * @param {Object}   props              Component props.
25829   * @param {?boolean} props.forceIsDirty Whether to force the post to be marked
25830   *                                      as dirty.
25831   * @return {import('react').ComponentType} The component.
25832   */
25833  
25834  function PostSavedState({
25835    forceIsDirty
25836  }) {
25837    const [forceSavedMessage, setForceSavedMessage] = (0,external_wp_element_namespaceObject.useState)(false);
25838    const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('small');
25839    const {
25840      isAutosaving,
25841      isDirty,
25842      isNew,
25843      isPublished,
25844      isSaveable,
25845      isSaving,
25846      isScheduled,
25847      hasPublishAction,
25848      showIconLabels,
25849      postStatus,
25850      postStatusHasChanged
25851    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
25852      var _getCurrentPost$_link;
25853      const {
25854        isEditedPostNew,
25855        isCurrentPostPublished,
25856        isCurrentPostScheduled,
25857        isEditedPostDirty,
25858        isSavingPost,
25859        isEditedPostSaveable,
25860        getCurrentPost,
25861        isAutosavingPost,
25862        getEditedPostAttribute,
25863        getPostEdits
25864      } = select(store_store);
25865      const {
25866        get
25867      } = select(external_wp_preferences_namespaceObject.store);
25868      return {
25869        isAutosaving: isAutosavingPost(),
25870        isDirty: forceIsDirty || isEditedPostDirty(),
25871        isNew: isEditedPostNew(),
25872        isPublished: isCurrentPostPublished(),
25873        isSaving: isSavingPost(),
25874        isSaveable: isEditedPostSaveable(),
25875        isScheduled: isCurrentPostScheduled(),
25876        hasPublishAction: (_getCurrentPost$_link = getCurrentPost()?._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false,
25877        showIconLabels: get('core', 'showIconLabels'),
25878        postStatus: getEditedPostAttribute('status'),
25879        postStatusHasChanged: !!getPostEdits()?.status
25880      };
25881    }, [forceIsDirty]);
25882    const isPending = postStatus === 'pending';
25883    const {
25884      savePost
25885    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
25886    const wasSaving = (0,external_wp_compose_namespaceObject.usePrevious)(isSaving);
25887    (0,external_wp_element_namespaceObject.useEffect)(() => {
25888      let timeoutId;
25889      if (wasSaving && !isSaving) {
25890        setForceSavedMessage(true);
25891        timeoutId = setTimeout(() => {
25892          setForceSavedMessage(false);
25893        }, 1000);
25894      }
25895      return () => clearTimeout(timeoutId);
25896    }, [isSaving]);
25897  
25898    // Once the post has been submitted for review this button
25899    // is not needed for the contributor role.
25900    if (!hasPublishAction && isPending) {
25901      return null;
25902    }
25903  
25904    // We shouldn't render the button if the post has not one of the following statuses: pending, draft, auto-draft.
25905    // The reason for this is that this button handles the `save as pending` and `save draft` actions.
25906    // An exception for this is when the post has a custom status and there should be a way to save changes without
25907    // having to publish. This should be handled better in the future when custom statuses have better support.
25908    // @see https://github.com/WordPress/gutenberg/issues/3144.
25909    const isIneligibleStatus = !['pending', 'draft', 'auto-draft'].includes(postStatus) && STATUS_OPTIONS.map(({
25910      value
25911    }) => value).includes(postStatus);
25912    if (isPublished || isScheduled || isIneligibleStatus || postStatusHasChanged && ['pending', 'draft'].includes(postStatus)) {
25913      return null;
25914    }
25915  
25916    /* translators: button label text should, if possible, be under 16 characters. */
25917    const label = isPending ? (0,external_wp_i18n_namespaceObject.__)('Save as pending') : (0,external_wp_i18n_namespaceObject.__)('Save draft');
25918  
25919    /* translators: button label text should, if possible, be under 16 characters. */
25920    const shortLabel = (0,external_wp_i18n_namespaceObject.__)('Save');
25921    const isSaved = forceSavedMessage || !isNew && !isDirty;
25922    const isSavedState = isSaving || isSaved;
25923    const isDisabled = isSaving || isSaved || !isSaveable;
25924    let text;
25925    if (isSaving) {
25926      text = isAutosaving ? (0,external_wp_i18n_namespaceObject.__)('Autosaving') : (0,external_wp_i18n_namespaceObject.__)('Saving');
25927    } else if (isSaved) {
25928      text = (0,external_wp_i18n_namespaceObject.__)('Saved');
25929    } else if (isLargeViewport) {
25930      text = label;
25931    } else if (showIconLabels) {
25932      text = shortLabel;
25933    }
25934  
25935    // Use common Button instance for all saved states so that focus is not
25936    // lost.
25937    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, {
25938      className: isSaveable || isSaving ? dist_clsx({
25939        'editor-post-save-draft': !isSavedState,
25940        'editor-post-saved-state': isSavedState,
25941        'is-saving': isSaving,
25942        'is-autosaving': isAutosaving,
25943        'is-saved': isSaved,
25944        [(0,external_wp_components_namespaceObject.__unstableGetAnimateClassName)({
25945          type: 'loading'
25946        })]: isSaving
25947      }) : undefined,
25948      onClick: isDisabled ? undefined : () => savePost()
25949      /*
25950       * We want the tooltip to show the keyboard shortcut only when the
25951       * button does something, i.e. when it's not disabled.
25952       */,
25953      shortcut: isDisabled ? undefined : external_wp_keycodes_namespaceObject.displayShortcut.primary('s'),
25954      variant: "tertiary",
25955      size: "compact",
25956      icon: isLargeViewport ? undefined : cloud_upload,
25957      label: text || label,
25958      "aria-disabled": isDisabled,
25959      children: [isSavedState && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icon, {
25960        icon: isSaved ? library_check : library_cloud
25961      }), text]
25962    });
25963  }
25964  
25965  ;// ./node_modules/@wordpress/editor/build-module/components/post-schedule/check.js
25966  /**
25967   * WordPress dependencies
25968   */
25969  
25970  
25971  /**
25972   * Internal dependencies
25973   */
25974  
25975  
25976  /**
25977   * Wrapper component that renders its children only if post has a publish action.
25978   *
25979   * @param {Object}          props          Props.
25980   * @param {React.ReactNode} props.children Children to be rendered.
25981   *
25982   * @return {React.ReactNode} - The component to be rendered or null if there is no publish action.
25983   */
25984  function PostScheduleCheck({
25985    children
25986  }) {
25987    const hasPublishAction = (0,external_wp_data_namespaceObject.useSelect)(select => {
25988      var _select$getCurrentPos;
25989      return (_select$getCurrentPos = select(store_store).getCurrentPost()._links?.['wp:action-publish']) !== null && _select$getCurrentPos !== void 0 ? _select$getCurrentPos : false;
25990    }, []);
25991    if (!hasPublishAction) {
25992      return null;
25993    }
25994    return children;
25995  }
25996  
25997  ;// ./node_modules/@wordpress/editor/build-module/components/post-schedule/panel.js
25998  /**
25999   * WordPress dependencies
26000   */
26001  
26002  
26003  
26004  
26005  
26006  /**
26007   * Internal dependencies
26008   */
26009  
26010  
26011  
26012  
26013  
26014  
26015  
26016  const panel_DESIGN_POST_TYPES = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, PATTERN_POST_TYPE, NAVIGATION_POST_TYPE];
26017  
26018  /**
26019   * Renders the Post Schedule Panel component.
26020   *
26021   * @return {React.ReactNode} The rendered component.
26022   */
26023  function PostSchedulePanel() {
26024    const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
26025    const postType = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getCurrentPostType(), []);
26026    // Memoize popoverProps to avoid returning a new object every time.
26027    const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
26028      // Anchor the popover to the middle of the entire row so that it doesn't
26029      // move around when the label changes.
26030      anchor: popoverAnchor,
26031      'aria-label': (0,external_wp_i18n_namespaceObject.__)('Change publish date'),
26032      placement: 'left-start',
26033      offset: 36,
26034      shift: true
26035    }), [popoverAnchor]);
26036    const label = usePostScheduleLabel();
26037    const fullLabel = usePostScheduleLabel({
26038      full: true
26039    });
26040    if (panel_DESIGN_POST_TYPES.includes(postType)) {
26041      return null;
26042    }
26043    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostScheduleCheck, {
26044      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
26045        label: (0,external_wp_i18n_namespaceObject.__)('Publish'),
26046        ref: setPopoverAnchor,
26047        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
26048          popoverProps: popoverProps,
26049          focusOnMount: true,
26050          className: "editor-post-schedule__panel-dropdown",
26051          contentClassName: "editor-post-schedule__dialog",
26052          renderToggle: ({
26053            onToggle,
26054            isOpen
26055          }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
26056            size: "compact",
26057            className: "editor-post-schedule__dialog-toggle",
26058            variant: "tertiary",
26059            tooltipPosition: "middle left",
26060            onClick: onToggle,
26061            "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
26062            // translators: %s: Current post date.
26063            (0,external_wp_i18n_namespaceObject.__)('Change date: %s'), label),
26064            label: fullLabel,
26065            showTooltip: label !== fullLabel,
26066            "aria-expanded": isOpen,
26067            children: label
26068          }),
26069          renderContent: ({
26070            onClose
26071          }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSchedule, {
26072            onClose: onClose
26073          })
26074        })
26075      })
26076    });
26077  }
26078  
26079  ;// ./node_modules/@wordpress/editor/build-module/components/post-switch-to-draft-button/index.js
26080  /**
26081   * WordPress dependencies
26082   */
26083  
26084  
26085  
26086  
26087  
26088  
26089  /**
26090   * Internal dependencies
26091   */
26092  
26093  
26094  /**
26095   * Renders a button component that allows the user to switch a post to draft status.
26096   *
26097   * @return {React.ReactNode} The rendered component.
26098   */
26099  
26100  function PostSwitchToDraftButton() {
26101    external_wp_deprecated_default()('wp.editor.PostSwitchToDraftButton', {
26102      since: '6.7',
26103      version: '6.9'
26104    });
26105    const [showConfirmDialog, setShowConfirmDialog] = (0,external_wp_element_namespaceObject.useState)(false);
26106    const {
26107      editPost,
26108      savePost
26109    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
26110    const {
26111      isSaving,
26112      isPublished,
26113      isScheduled
26114    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
26115      const {
26116        isSavingPost,
26117        isCurrentPostPublished,
26118        isCurrentPostScheduled
26119      } = select(store_store);
26120      return {
26121        isSaving: isSavingPost(),
26122        isPublished: isCurrentPostPublished(),
26123        isScheduled: isCurrentPostScheduled()
26124      };
26125    }, []);
26126    const isDisabled = isSaving || !isPublished && !isScheduled;
26127    let alertMessage;
26128    let confirmButtonText;
26129    if (isPublished) {
26130      alertMessage = (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to unpublish this post?');
26131      confirmButtonText = (0,external_wp_i18n_namespaceObject.__)('Unpublish');
26132    } else if (isScheduled) {
26133      alertMessage = (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to unschedule this post?');
26134      confirmButtonText = (0,external_wp_i18n_namespaceObject.__)('Unschedule');
26135    }
26136    const handleConfirm = () => {
26137      setShowConfirmDialog(false);
26138      editPost({
26139        status: 'draft'
26140      });
26141      savePost();
26142    };
26143    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
26144      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
26145        __next40pxDefaultSize: true,
26146        className: "editor-post-switch-to-draft",
26147        onClick: () => {
26148          if (!isDisabled) {
26149            setShowConfirmDialog(true);
26150          }
26151        },
26152        "aria-disabled": isDisabled,
26153        variant: "secondary",
26154        style: {
26155          flexGrow: '1',
26156          justifyContent: 'center'
26157        },
26158        children: (0,external_wp_i18n_namespaceObject.__)('Switch to draft')
26159      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, {
26160        isOpen: showConfirmDialog,
26161        onConfirm: handleConfirm,
26162        onCancel: () => setShowConfirmDialog(false),
26163        confirmButtonText: confirmButtonText,
26164        children: alertMessage
26165      })]
26166    });
26167  }
26168  
26169  ;// ./node_modules/@wordpress/editor/build-module/components/post-sync-status/index.js
26170  /**
26171   * WordPress dependencies
26172   */
26173  
26174  
26175  
26176  /**
26177   * Internal dependencies
26178   */
26179  
26180  
26181  
26182  /**
26183   * Renders the sync status of a post.
26184   *
26185   * @return {React.ReactNode} The rendered sync status component.
26186   */
26187  
26188  function PostSyncStatus() {
26189    const {
26190      syncStatus,
26191      postType
26192    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
26193      const {
26194        getEditedPostAttribute
26195      } = select(store_store);
26196      const meta = getEditedPostAttribute('meta');
26197  
26198      // When the post is first created, the top level wp_pattern_sync_status is not set so get meta value instead.
26199      const currentSyncStatus = meta?.wp_pattern_sync_status === 'unsynced' ? 'unsynced' : getEditedPostAttribute('wp_pattern_sync_status');
26200      return {
26201        syncStatus: currentSyncStatus,
26202        postType: getEditedPostAttribute('type')
26203      };
26204    });
26205    if (postType !== 'wp_block') {
26206      return null;
26207    }
26208    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
26209      label: (0,external_wp_i18n_namespaceObject.__)('Sync status'),
26210      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
26211        className: "editor-post-sync-status__value",
26212        children: syncStatus === 'unsynced' ? (0,external_wp_i18n_namespaceObject._x)('Not synced', 'pattern (singular)') : (0,external_wp_i18n_namespaceObject._x)('Synced', 'pattern (singular)')
26213      })
26214    });
26215  }
26216  
26217  ;// ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/index.js
26218  /**
26219   * WordPress dependencies
26220   */
26221  
26222  
26223  
26224  
26225  /**
26226   * Internal dependencies
26227   */
26228  
26229  
26230  
26231  
26232  const post_taxonomies_identity = x => x;
26233  function PostTaxonomies({
26234    taxonomyWrapper = post_taxonomies_identity
26235  }) {
26236    const {
26237      postType,
26238      taxonomies
26239    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
26240      return {
26241        postType: select(store_store).getCurrentPostType(),
26242        taxonomies: select(external_wp_coreData_namespaceObject.store).getEntityRecords('root', 'taxonomy', {
26243          per_page: -1
26244        })
26245      };
26246    }, []);
26247    const visibleTaxonomies = (taxonomies !== null && taxonomies !== void 0 ? taxonomies : []).filter(taxonomy =>
26248    // In some circumstances .visibility can end up as undefined so optional chaining operator required.
26249    // https://github.com/WordPress/gutenberg/issues/40326
26250    taxonomy.types.includes(postType) && taxonomy.visibility?.show_ui);
26251    return visibleTaxonomies.map(taxonomy => {
26252      const TaxonomyComponent = taxonomy.hierarchical ? hierarchical_term_selector : flat_term_selector;
26253      const taxonomyComponentProps = {
26254        slug: taxonomy.slug,
26255        ...(taxonomy.hierarchical ? {} : {
26256          __nextHasNoMarginBottom: true
26257        })
26258      };
26259      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.Fragment, {
26260        children: taxonomyWrapper(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TaxonomyComponent, {
26261          ...taxonomyComponentProps
26262        }), taxonomy)
26263      }, `taxonomy-$taxonomy.slug}`);
26264    });
26265  }
26266  
26267  /**
26268   * Renders the taxonomies associated with a post.
26269   *
26270   * @param {Object}   props                 The component props.
26271   * @param {Function} props.taxonomyWrapper The wrapper function for each taxonomy component.
26272   *
26273   * @return {Array} An array of JSX elements representing the visible taxonomies.
26274   */
26275  /* harmony default export */ const post_taxonomies = (PostTaxonomies);
26276  
26277  ;// ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/check.js
26278  /**
26279   * WordPress dependencies
26280   */
26281  
26282  
26283  
26284  /**
26285   * Internal dependencies
26286   */
26287  
26288  
26289  /**
26290   * Renders the children components only if the current post type has taxonomies.
26291   *
26292   * @param {Object}          props          The component props.
26293   * @param {React.ReactNode} props.children The children components to render.
26294   *
26295   * @return {React.ReactNode} The rendered children components or null if the current post type has no taxonomies.
26296   */
26297  function PostTaxonomiesCheck({
26298    children
26299  }) {
26300    const hasTaxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => {
26301      const postType = select(store_store).getCurrentPostType();
26302      const taxonomies = select(external_wp_coreData_namespaceObject.store).getEntityRecords('root', 'taxonomy', {
26303        per_page: -1
26304      });
26305      return taxonomies?.some(taxonomy => taxonomy.types.includes(postType));
26306    }, []);
26307    if (!hasTaxonomies) {
26308      return null;
26309    }
26310    return children;
26311  }
26312  
26313  ;// ./node_modules/@wordpress/editor/build-module/components/post-taxonomies/panel.js
26314  /**
26315   * WordPress dependencies
26316   */
26317  
26318  
26319  
26320  /**
26321   * Internal dependencies
26322   */
26323  
26324  
26325  
26326  
26327  /**
26328   * Renders a panel for a specific taxonomy.
26329   *
26330   * @param {Object}          props          The component props.
26331   * @param {Object}          props.taxonomy The taxonomy object.
26332   * @param {React.ReactNode} props.children The child components.
26333   *
26334   * @return {React.ReactNode} The rendered taxonomy panel.
26335   */
26336  
26337  function TaxonomyPanel({
26338    taxonomy,
26339    children
26340  }) {
26341    const slug = taxonomy?.slug;
26342    const panelName = slug ? `taxonomy-panel-$slug}` : '';
26343    const {
26344      isEnabled,
26345      isOpened
26346    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
26347      const {
26348        isEditorPanelEnabled,
26349        isEditorPanelOpened
26350      } = select(store_store);
26351      return {
26352        isEnabled: slug ? isEditorPanelEnabled(panelName) : false,
26353        isOpened: slug ? isEditorPanelOpened(panelName) : false
26354      };
26355    }, [panelName, slug]);
26356    const {
26357      toggleEditorPanelOpened
26358    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
26359    if (!isEnabled) {
26360      return null;
26361    }
26362    const taxonomyMenuName = taxonomy?.labels?.menu_name;
26363    if (!taxonomyMenuName) {
26364      return null;
26365    }
26366    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
26367      title: taxonomyMenuName,
26368      opened: isOpened,
26369      onToggle: () => toggleEditorPanelOpened(panelName),
26370      children: children
26371    });
26372  }
26373  
26374  /**
26375   * Component that renders the post taxonomies panel.
26376   *
26377   * @return {React.ReactNode} The rendered component.
26378   */
26379  function panel_PostTaxonomies() {
26380    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTaxonomiesCheck, {
26381      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_taxonomies, {
26382        taxonomyWrapper: (content, taxonomy) => {
26383          return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TaxonomyPanel, {
26384            taxonomy: taxonomy,
26385            children: content
26386          });
26387        }
26388      })
26389    });
26390  }
26391  
26392  // EXTERNAL MODULE: ./node_modules/react-autosize-textarea/lib/index.js
26393  var lib = __webpack_require__(4132);
26394  ;// ./node_modules/@wordpress/editor/build-module/components/post-text-editor/index.js
26395  /**
26396   * External dependencies
26397   */
26398  
26399  
26400  /**
26401   * WordPress dependencies
26402   */
26403  
26404  
26405  
26406  
26407  
26408  
26409  
26410  
26411  /**
26412   * Internal dependencies
26413   */
26414  
26415  
26416  /**
26417   * Displays the Post Text Editor along with content in Visual and Text mode.
26418   *
26419   * @return {React.ReactNode} The rendered PostTextEditor component.
26420   */
26421  
26422  function PostTextEditor() {
26423    const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostTextEditor);
26424    const {
26425      content,
26426      blocks,
26427      type,
26428      id
26429    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
26430      const {
26431        getEditedEntityRecord
26432      } = select(external_wp_coreData_namespaceObject.store);
26433      const {
26434        getCurrentPostType,
26435        getCurrentPostId
26436      } = select(store_store);
26437      const _type = getCurrentPostType();
26438      const _id = getCurrentPostId();
26439      const editedRecord = getEditedEntityRecord('postType', _type, _id);
26440      return {
26441        content: editedRecord?.content,
26442        blocks: editedRecord?.blocks,
26443        type: _type,
26444        id: _id
26445      };
26446    }, []);
26447    const {
26448      editEntityRecord
26449    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
26450    // Replicates the logic found in getEditedPostContent().
26451    const value = (0,external_wp_element_namespaceObject.useMemo)(() => {
26452      if (content instanceof Function) {
26453        return content({
26454          blocks
26455        });
26456      } else if (blocks) {
26457        // If we have parsed blocks already, they should be our source of truth.
26458        // Parsing applies block deprecations and legacy block conversions that
26459        // unparsed content will not have.
26460        return (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocks);
26461      }
26462      return content;
26463    }, [content, blocks]);
26464    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
26465      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
26466        as: "label",
26467        htmlFor: `post-content-$instanceId}`,
26468        children: (0,external_wp_i18n_namespaceObject.__)('Type text or HTML')
26469      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(lib/* default */.A, {
26470        autoComplete: "off",
26471        dir: "auto",
26472        value: value,
26473        onChange: event => {
26474          editEntityRecord('postType', type, id, {
26475            content: event.target.value,
26476            blocks: undefined,
26477            selection: undefined
26478          });
26479        },
26480        className: "editor-post-text-editor",
26481        id: `post-content-$instanceId}`,
26482        placeholder: (0,external_wp_i18n_namespaceObject.__)('Start writing with text or HTML')
26483      })]
26484    });
26485  }
26486  
26487  ;// ./node_modules/@wordpress/editor/build-module/components/post-title/constants.js
26488  const DEFAULT_CLASSNAMES = 'wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text';
26489  const REGEXP_NEWLINES = /[\r\n]+/g;
26490  
26491  ;// ./node_modules/@wordpress/editor/build-module/components/post-title/use-post-title-focus.js
26492  /**
26493   * WordPress dependencies
26494   */
26495  
26496  
26497  
26498  /**
26499   * Internal dependencies
26500   */
26501  
26502  
26503  /**
26504   * Custom hook that manages the focus behavior of the post title input field.
26505   *
26506   * @param {Element} forwardedRef - The forwarded ref for the input field.
26507   *
26508   * @return {Object} - The ref object.
26509   */
26510  function usePostTitleFocus(forwardedRef) {
26511    const ref = (0,external_wp_element_namespaceObject.useRef)();
26512    const {
26513      isCleanNewPost
26514    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
26515      const {
26516        isCleanNewPost: _isCleanNewPost
26517      } = select(store_store);
26518      return {
26519        isCleanNewPost: _isCleanNewPost()
26520      };
26521    }, []);
26522    (0,external_wp_element_namespaceObject.useImperativeHandle)(forwardedRef, () => ({
26523      focus: () => {
26524        ref?.current?.focus();
26525      }
26526    }));
26527    (0,external_wp_element_namespaceObject.useEffect)(() => {
26528      if (!ref.current) {
26529        return;
26530      }
26531      const {
26532        defaultView
26533      } = ref.current.ownerDocument;
26534      const {
26535        name,
26536        parent
26537      } = defaultView;
26538      const ownerDocument = name === 'editor-canvas' ? parent.document : defaultView.document;
26539      const {
26540        activeElement,
26541        body
26542      } = ownerDocument;
26543  
26544      // Only autofocus the title when the post is entirely empty. This should
26545      // only happen for a new post, which means we focus the title on new
26546      // post so the author can start typing right away, without needing to
26547      // click anything.
26548      if (isCleanNewPost && (!activeElement || body === activeElement)) {
26549        ref.current.focus();
26550      }
26551    }, [isCleanNewPost]);
26552    return {
26553      ref
26554    };
26555  }
26556  
26557  ;// ./node_modules/@wordpress/editor/build-module/components/post-title/use-post-title.js
26558  /**
26559   * WordPress dependencies
26560   */
26561  
26562  /**
26563   * Internal dependencies
26564   */
26565  
26566  
26567  /**
26568   * Custom hook for managing the post title in the editor.
26569   *
26570   * @return {Object} An object containing the current title and a function to update the title.
26571   */
26572  function usePostTitle() {
26573    const {
26574      editPost
26575    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
26576    const {
26577      title
26578    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
26579      const {
26580        getEditedPostAttribute
26581      } = select(store_store);
26582      return {
26583        title: getEditedPostAttribute('title')
26584      };
26585    }, []);
26586    function updateTitle(newTitle) {
26587      editPost({
26588        title: newTitle
26589      });
26590    }
26591    return {
26592      title,
26593      setTitle: updateTitle
26594    };
26595  }
26596  
26597  ;// ./node_modules/@wordpress/editor/build-module/components/post-title/index.js
26598  /**
26599   * External dependencies
26600   */
26601  
26602  /**
26603   * WordPress dependencies
26604   */
26605  
26606  
26607  
26608  
26609  
26610  
26611  
26612  
26613  
26614  
26615  
26616  /**
26617   * Internal dependencies
26618   */
26619  
26620  
26621  
26622  
26623  
26624  const PostTitle = (0,external_wp_element_namespaceObject.forwardRef)((_, forwardedRef) => {
26625    const {
26626      placeholder
26627    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
26628      const {
26629        getSettings
26630      } = select(external_wp_blockEditor_namespaceObject.store);
26631      const {
26632        titlePlaceholder
26633      } = getSettings();
26634      return {
26635        placeholder: titlePlaceholder
26636      };
26637    }, []);
26638    const [isSelected, setIsSelected] = (0,external_wp_element_namespaceObject.useState)(false);
26639    const {
26640      ref: focusRef
26641    } = usePostTitleFocus(forwardedRef);
26642    const {
26643      title,
26644      setTitle: onUpdate
26645    } = usePostTitle();
26646    const [selection, setSelection] = (0,external_wp_element_namespaceObject.useState)({});
26647    const {
26648      clearSelectedBlock,
26649      insertBlocks,
26650      insertDefaultBlock
26651    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
26652    const decodedPlaceholder = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(placeholder) || (0,external_wp_i18n_namespaceObject.__)('Add title');
26653    const {
26654      value,
26655      onChange,
26656      ref: richTextRef
26657    } = (0,external_wp_richText_namespaceObject.__unstableUseRichText)({
26658      value: title,
26659      onChange(newValue) {
26660        onUpdate(newValue.replace(REGEXP_NEWLINES, ' '));
26661      },
26662      placeholder: decodedPlaceholder,
26663      selectionStart: selection.start,
26664      selectionEnd: selection.end,
26665      onSelectionChange(newStart, newEnd) {
26666        setSelection(sel => {
26667          const {
26668            start,
26669            end
26670          } = sel;
26671          if (start === newStart && end === newEnd) {
26672            return sel;
26673          }
26674          return {
26675            start: newStart,
26676            end: newEnd
26677          };
26678        });
26679      },
26680      __unstableDisableFormats: false
26681    });
26682    function onInsertBlockAfter(blocks) {
26683      insertBlocks(blocks, 0);
26684    }
26685    function onSelect() {
26686      setIsSelected(true);
26687      clearSelectedBlock();
26688    }
26689    function onUnselect() {
26690      setIsSelected(false);
26691      setSelection({});
26692    }
26693    function onEnterPress() {
26694      insertDefaultBlock(undefined, undefined, 0);
26695    }
26696    function onKeyDown(event) {
26697      if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER) {
26698        event.preventDefault();
26699        onEnterPress();
26700      }
26701    }
26702    function onPaste(event) {
26703      const clipboardData = event.clipboardData;
26704      let plainText = '';
26705      let html = '';
26706      try {
26707        plainText = clipboardData.getData('text/plain');
26708        html = clipboardData.getData('text/html');
26709      } catch (error) {
26710        // Some browsers like UC Browser paste plain text by default and
26711        // don't support clipboardData at all, so allow default
26712        // behaviour.
26713        return;
26714      }
26715  
26716      // Allows us to ask for this information when we get a report.
26717      window.console.log('Received HTML:\n\n', html);
26718      window.console.log('Received plain text:\n\n', plainText);
26719      const content = (0,external_wp_blocks_namespaceObject.pasteHandler)({
26720        HTML: html,
26721        plainText
26722      });
26723      event.preventDefault();
26724      if (!content.length) {
26725        return;
26726      }
26727      if (typeof content !== 'string') {
26728        const [firstBlock] = content;
26729        if (!title && (firstBlock.name === 'core/heading' || firstBlock.name === 'core/paragraph')) {
26730          // Strip HTML to avoid unwanted HTML being added to the title.
26731          // In the majority of cases it is assumed that HTML in the title
26732          // is undesirable.
26733          const contentNoHTML = (0,external_wp_dom_namespaceObject.__unstableStripHTML)(firstBlock.attributes.content);
26734          onUpdate(contentNoHTML);
26735          onInsertBlockAfter(content.slice(1));
26736        } else {
26737          onInsertBlockAfter(content);
26738        }
26739      } else {
26740        // Strip HTML to avoid unwanted HTML being added to the title.
26741        // In the majority of cases it is assumed that HTML in the title
26742        // is undesirable.
26743        const contentNoHTML = (0,external_wp_dom_namespaceObject.__unstableStripHTML)(content);
26744        onChange((0,external_wp_richText_namespaceObject.insert)(value, (0,external_wp_richText_namespaceObject.create)({
26745          html: contentNoHTML
26746        })));
26747      }
26748    }
26749  
26750    // The wp-block className is important for editor styles.
26751    // This same block is used in both the visual and the code editor.
26752    const className = dist_clsx(DEFAULT_CLASSNAMES, {
26753      'is-selected': isSelected
26754    });
26755    return /*#__PURE__*/ /* eslint-disable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", {
26756      ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([richTextRef, focusRef]),
26757      contentEditable: true,
26758      className: className,
26759      "aria-label": decodedPlaceholder,
26760      role: "textbox",
26761      "aria-multiline": "true",
26762      onFocus: onSelect,
26763      onBlur: onUnselect,
26764      onKeyDown: onKeyDown,
26765      onPaste: onPaste
26766    })
26767    /* eslint-enable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */;
26768  });
26769  
26770  /**
26771   * Renders the `PostTitle` component.
26772   *
26773   * @param {Object}  _            Unused parameter.
26774   * @param {Element} forwardedRef Forwarded ref for the component.
26775   *
26776   * @return {React.ReactNode} The rendered PostTitle component.
26777   */
26778  /* harmony default export */ const post_title = ((0,external_wp_element_namespaceObject.forwardRef)((_, forwardedRef) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, {
26779    supportKeys: "title",
26780    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTitle, {
26781      ref: forwardedRef
26782    })
26783  })));
26784  
26785  ;// ./node_modules/@wordpress/editor/build-module/components/post-title/post-title-raw.js
26786  /**
26787   * External dependencies
26788   */
26789  
26790  
26791  /**
26792   * WordPress dependencies
26793   */
26794  
26795  
26796  
26797  
26798  
26799  
26800  
26801  /**
26802   * Internal dependencies
26803   */
26804  
26805  
26806  
26807  
26808  /**
26809   * Renders a raw post title input field.
26810   *
26811   * @param {Object}  _            Unused parameter.
26812   * @param {Element} forwardedRef Reference to the component's DOM node.
26813   *
26814   * @return {React.ReactNode} The rendered component.
26815   */
26816  
26817  function PostTitleRaw(_, forwardedRef) {
26818    const {
26819      placeholder
26820    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
26821      const {
26822        getSettings
26823      } = select(external_wp_blockEditor_namespaceObject.store);
26824      const {
26825        titlePlaceholder
26826      } = getSettings();
26827      return {
26828        placeholder: titlePlaceholder
26829      };
26830    }, []);
26831    const [isSelected, setIsSelected] = (0,external_wp_element_namespaceObject.useState)(false);
26832    const {
26833      title,
26834      setTitle: onUpdate
26835    } = usePostTitle();
26836    const {
26837      ref: focusRef
26838    } = usePostTitleFocus(forwardedRef);
26839    function onChange(value) {
26840      onUpdate(value.replace(REGEXP_NEWLINES, ' '));
26841    }
26842    function onSelect() {
26843      setIsSelected(true);
26844    }
26845    function onUnselect() {
26846      setIsSelected(false);
26847    }
26848  
26849    // The wp-block className is important for editor styles.
26850    // This same block is used in both the visual and the code editor.
26851    const className = dist_clsx(DEFAULT_CLASSNAMES, {
26852      'is-selected': isSelected,
26853      'is-raw-text': true
26854    });
26855    const decodedPlaceholder = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(placeholder) || (0,external_wp_i18n_namespaceObject.__)('Add title');
26856    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, {
26857      ref: focusRef,
26858      value: title,
26859      onChange: onChange,
26860      onFocus: onSelect,
26861      onBlur: onUnselect,
26862      label: placeholder,
26863      className: className,
26864      placeholder: decodedPlaceholder,
26865      hideLabelFromVision: true,
26866      autoComplete: "off",
26867      dir: "auto",
26868      rows: 1,
26869      __nextHasNoMarginBottom: true
26870    });
26871  }
26872  /* harmony default export */ const post_title_raw = ((0,external_wp_element_namespaceObject.forwardRef)(PostTitleRaw));
26873  
26874  ;// ./node_modules/@wordpress/editor/build-module/components/post-trash/check.js
26875  /**
26876   * WordPress dependencies
26877   */
26878  
26879  
26880  
26881  /**
26882   * Internal dependencies
26883   */
26884  
26885  
26886  
26887  /**
26888   * Wrapper component that renders its children only if the post can be trashed.
26889   *
26890   * @param {Object}          props          The component props.
26891   * @param {React.ReactNode} props.children The child components.
26892   *
26893   * @return {React.ReactNode} The rendered child components or null if the post can't be trashed.
26894   */
26895  function PostTrashCheck({
26896    children
26897  }) {
26898    const {
26899      canTrashPost
26900    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
26901      const {
26902        isEditedPostNew,
26903        getCurrentPostId,
26904        getCurrentPostType
26905      } = select(store_store);
26906      const {
26907        canUser
26908      } = select(external_wp_coreData_namespaceObject.store);
26909      const postType = getCurrentPostType();
26910      const postId = getCurrentPostId();
26911      const isNew = isEditedPostNew();
26912      const canUserDelete = !!postId ? canUser('delete', {
26913        kind: 'postType',
26914        name: postType,
26915        id: postId
26916      }) : false;
26917      return {
26918        canTrashPost: (!isNew || postId) && canUserDelete && !GLOBAL_POST_TYPES.includes(postType)
26919      };
26920    }, []);
26921    if (!canTrashPost) {
26922      return null;
26923    }
26924    return children;
26925  }
26926  
26927  ;// ./node_modules/@wordpress/editor/build-module/components/post-trash/index.js
26928  /**
26929   * WordPress dependencies
26930   */
26931  
26932  
26933  
26934  
26935  
26936  /**
26937   * Internal dependencies
26938   */
26939  
26940  
26941  
26942  /**
26943   * Displays the Post Trash Button and Confirm Dialog in the Editor.
26944   *
26945   * @param {?{onActionPerformed: Object}} An object containing the onActionPerformed function.
26946   * @return {React.ReactNode} The rendered PostTrash component.
26947   */
26948  
26949  function PostTrash({
26950    onActionPerformed
26951  }) {
26952    const registry = (0,external_wp_data_namespaceObject.useRegistry)();
26953    const {
26954      isNew,
26955      isDeleting,
26956      postId,
26957      title
26958    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
26959      const store = select(store_store);
26960      return {
26961        isNew: store.isEditedPostNew(),
26962        isDeleting: store.isDeletingPost(),
26963        postId: store.getCurrentPostId(),
26964        title: store.getCurrentPostAttribute('title')
26965      };
26966    }, []);
26967    const {
26968      trashPost
26969    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
26970    const [showConfirmDialog, setShowConfirmDialog] = (0,external_wp_element_namespaceObject.useState)(false);
26971    if (isNew || !postId) {
26972      return null;
26973    }
26974    const handleConfirm = async () => {
26975      setShowConfirmDialog(false);
26976      await trashPost();
26977      const item = await registry.resolveSelect(store_store).getCurrentPost();
26978      // After the post is trashed, we want to trigger the onActionPerformed callback, so the user is redirect
26979      // to the post view depending on if the user is on post editor or site editor.
26980      onActionPerformed?.('move-to-trash', [item]);
26981    };
26982    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PostTrashCheck, {
26983      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
26984        __next40pxDefaultSize: true,
26985        className: "editor-post-trash",
26986        isDestructive: true,
26987        variant: "secondary",
26988        isBusy: isDeleting,
26989        "aria-disabled": isDeleting,
26990        onClick: isDeleting ? undefined : () => setShowConfirmDialog(true),
26991        children: (0,external_wp_i18n_namespaceObject.__)('Move to trash')
26992      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, {
26993        isOpen: showConfirmDialog,
26994        onConfirm: handleConfirm,
26995        onCancel: () => setShowConfirmDialog(false),
26996        confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Move to trash'),
26997        size: "small",
26998        children: (0,external_wp_i18n_namespaceObject.sprintf)(
26999        // translators: %s: The item's title.
27000        (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to move "%s" to the trash?'), title)
27001      })]
27002    });
27003  }
27004  
27005  ;// ./node_modules/@wordpress/editor/build-module/components/post-url/index.js
27006  /**
27007   * WordPress dependencies
27008   */
27009  
27010  
27011  
27012  
27013  
27014  
27015  
27016  
27017  
27018  
27019  
27020  /**
27021   * Internal dependencies
27022   */
27023  
27024  
27025  /**
27026   * Renders the `PostURL` component.
27027   *
27028   * @example
27029   * ```jsx
27030   * <PostURL />
27031   * ```
27032   *
27033   * @param {{ onClose: () => void }} props         The props for the component.
27034   * @param {() => void}              props.onClose Callback function to be executed when the popover is closed.
27035   *
27036   * @return {React.ReactNode} The rendered PostURL component.
27037   */
27038  
27039  function PostURL({
27040    onClose
27041  }) {
27042    const {
27043      isEditable,
27044      postSlug,
27045      postLink,
27046      permalinkPrefix,
27047      permalinkSuffix,
27048      permalink
27049    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
27050      var _post$_links$wpActio;
27051      const post = select(store_store).getCurrentPost();
27052      const postTypeSlug = select(store_store).getCurrentPostType();
27053      const postType = select(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug);
27054      const permalinkParts = select(store_store).getPermalinkParts();
27055      const hasPublishAction = (_post$_links$wpActio = post?._links?.['wp:action-publish']) !== null && _post$_links$wpActio !== void 0 ? _post$_links$wpActio : false;
27056      return {
27057        isEditable: select(store_store).isPermalinkEditable() && hasPublishAction,
27058        postSlug: (0,external_wp_url_namespaceObject.safeDecodeURIComponent)(select(store_store).getEditedPostSlug()),
27059        viewPostLabel: postType?.labels.view_item,
27060        postLink: post.link,
27061        permalinkPrefix: permalinkParts?.prefix,
27062        permalinkSuffix: permalinkParts?.suffix,
27063        permalink: (0,external_wp_url_namespaceObject.safeDecodeURIComponent)(select(store_store).getPermalink())
27064      };
27065    }, []);
27066    const {
27067      editPost
27068    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
27069    const {
27070      createNotice
27071    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
27072    const [forceEmptyField, setForceEmptyField] = (0,external_wp_element_namespaceObject.useState)(false);
27073    const copyButtonRef = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(permalink, () => {
27074      createNotice('info', (0,external_wp_i18n_namespaceObject.__)('Copied Permalink to clipboard.'), {
27075        isDismissible: true,
27076        type: 'snackbar'
27077      });
27078    });
27079    const postUrlSlugDescriptionId = 'editor-post-url__slug-description-' + (0,external_wp_compose_namespaceObject.useInstanceId)(PostURL);
27080    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
27081      className: "editor-post-url",
27082      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
27083        title: (0,external_wp_i18n_namespaceObject.__)('Slug'),
27084        onClose: onClose
27085      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
27086        spacing: 3,
27087        children: [isEditable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
27088          className: "editor-post-url__intro",
27089          children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('<span>Customize the last part of the Permalink.</span> <a>Learn more.</a>'), {
27090            span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
27091              id: postUrlSlugDescriptionId
27092            }),
27093            a: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
27094              href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink')
27095            })
27096          })
27097        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
27098          children: [isEditable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
27099            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, {
27100              __next40pxDefaultSize: true,
27101              prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, {
27102                children: "/"
27103              }),
27104              suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlSuffixWrapper, {
27105                variant: "control",
27106                children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
27107                  icon: copy_small,
27108                  ref: copyButtonRef,
27109                  size: "small",
27110                  label: "Copy"
27111                })
27112              }),
27113              label: (0,external_wp_i18n_namespaceObject.__)('Slug'),
27114              hideLabelFromVision: true,
27115              value: forceEmptyField ? '' : postSlug,
27116              autoComplete: "off",
27117              spellCheck: "false",
27118              type: "text",
27119              className: "editor-post-url__input",
27120              onChange: newValue => {
27121                editPost({
27122                  slug: newValue
27123                });
27124                // When we delete the field the permalink gets
27125                // reverted to the original value.
27126                // The forceEmptyField logic allows the user to have
27127                // the field temporarily empty while typing.
27128                if (!newValue) {
27129                  if (!forceEmptyField) {
27130                    setForceEmptyField(true);
27131                  }
27132                  return;
27133                }
27134                if (forceEmptyField) {
27135                  setForceEmptyField(false);
27136                }
27137              },
27138              onBlur: event => {
27139                editPost({
27140                  slug: (0,external_wp_url_namespaceObject.cleanForSlug)(event.target.value)
27141                });
27142                if (forceEmptyField) {
27143                  setForceEmptyField(false);
27144                }
27145              },
27146              "aria-describedby": postUrlSlugDescriptionId
27147            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", {
27148              className: "editor-post-url__permalink",
27149              children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
27150                className: "editor-post-url__permalink-visual-label",
27151                children: (0,external_wp_i18n_namespaceObject.__)('Permalink:')
27152              }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ExternalLink, {
27153                className: "editor-post-url__link",
27154                href: postLink,
27155                target: "_blank",
27156                children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
27157                  className: "editor-post-url__link-prefix",
27158                  children: permalinkPrefix
27159                }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
27160                  className: "editor-post-url__link-slug",
27161                  children: postSlug
27162                }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
27163                  className: "editor-post-url__link-suffix",
27164                  children: permalinkSuffix
27165                })]
27166              })]
27167            })]
27168          }), !isEditable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
27169            className: "editor-post-url__link",
27170            href: postLink,
27171            target: "_blank",
27172            children: postLink
27173          })]
27174        })]
27175      })]
27176    });
27177  }
27178  
27179  ;// ./node_modules/@wordpress/editor/build-module/components/post-url/check.js
27180  /**
27181   * WordPress dependencies
27182   */
27183  
27184  
27185  
27186  /**
27187   * Internal dependencies
27188   */
27189  
27190  
27191  /**
27192   * Check if the post URL is valid and visible.
27193   *
27194   * @param {Object}          props          The component props.
27195   * @param {React.ReactNode} props.children The child components.
27196   *
27197   * @return {React.ReactNode} The child components if the post URL is valid and visible, otherwise null.
27198   */
27199  function PostURLCheck({
27200    children
27201  }) {
27202    const isVisible = (0,external_wp_data_namespaceObject.useSelect)(select => {
27203      const postTypeSlug = select(store_store).getCurrentPostType();
27204      const postType = select(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug);
27205      if (!postType?.viewable) {
27206        return false;
27207      }
27208      const post = select(store_store).getCurrentPost();
27209      if (!post.link) {
27210        return false;
27211      }
27212      const permalinkParts = select(store_store).getPermalinkParts();
27213      if (!permalinkParts) {
27214        return false;
27215      }
27216      return true;
27217    }, []);
27218    if (!isVisible) {
27219      return null;
27220    }
27221    return children;
27222  }
27223  
27224  ;// ./node_modules/@wordpress/editor/build-module/components/post-url/label.js
27225  /**
27226   * WordPress dependencies
27227   */
27228  
27229  
27230  
27231  /**
27232   * Internal dependencies
27233   */
27234  
27235  
27236  /**
27237   * Represents a label component for a post URL.
27238   *
27239   * @return {React.ReactNode} The PostURLLabel component.
27240   */
27241  function PostURLLabel() {
27242    return usePostURLLabel();
27243  }
27244  
27245  /**
27246   * Custom hook to get the label for the post URL.
27247   *
27248   * @return {string} The filtered and decoded post URL label.
27249   */
27250  function usePostURLLabel() {
27251    const postLink = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getPermalink(), []);
27252    return (0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURIComponent)(postLink));
27253  }
27254  
27255  ;// ./node_modules/@wordpress/editor/build-module/components/post-url/panel.js
27256  /**
27257   * WordPress dependencies
27258   */
27259  
27260  
27261  
27262  
27263  
27264  
27265  
27266  /**
27267   * Internal dependencies
27268   */
27269  
27270  
27271  
27272  
27273  
27274  /**
27275   * Renders the `PostURLPanel` component.
27276   *
27277   * @return {React.ReactNode} The rendered PostURLPanel component.
27278   */
27279  
27280  function PostURLPanel() {
27281    const {
27282      isFrontPage
27283    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
27284      const {
27285        getCurrentPostId
27286      } = select(store_store);
27287      const {
27288        getEditedEntityRecord,
27289        canUser
27290      } = select(external_wp_coreData_namespaceObject.store);
27291      const siteSettings = canUser('read', {
27292        kind: 'root',
27293        name: 'site'
27294      }) ? getEditedEntityRecord('root', 'site') : undefined;
27295      const _id = getCurrentPostId();
27296      return {
27297        isFrontPage: siteSettings?.page_on_front === _id
27298      };
27299    }, []);
27300    // Use internal state instead of a ref to make sure that the component
27301    // re-renders when the popover's anchor updates.
27302    const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
27303    // Memoize popoverProps to avoid returning a new object every time.
27304    const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
27305      // Anchor the popover to the middle of the entire row so that it doesn't
27306      // move around when the label changes.
27307      anchor: popoverAnchor,
27308      placement: 'left-start',
27309      offset: 36,
27310      shift: true
27311    }), [popoverAnchor]);
27312    const label = isFrontPage ? (0,external_wp_i18n_namespaceObject.__)('Link') : (0,external_wp_i18n_namespaceObject.__)('Slug');
27313    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostURLCheck, {
27314      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(post_panel_row, {
27315        label: label,
27316        ref: setPopoverAnchor,
27317        children: [!isFrontPage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
27318          popoverProps: popoverProps,
27319          className: "editor-post-url__panel-dropdown",
27320          contentClassName: "editor-post-url__panel-dialog",
27321          focusOnMount: true,
27322          renderToggle: ({
27323            isOpen,
27324            onToggle
27325          }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostURLToggle, {
27326            isOpen: isOpen,
27327            onClick: onToggle
27328          }),
27329          renderContent: ({
27330            onClose
27331          }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostURL, {
27332            onClose: onClose
27333          })
27334        }), isFrontPage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FrontPageLink, {})]
27335      })
27336    });
27337  }
27338  function PostURLToggle({
27339    isOpen,
27340    onClick
27341  }) {
27342    const {
27343      slug
27344    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
27345      return {
27346        slug: select(store_store).getEditedPostSlug()
27347      };
27348    }, []);
27349    const decodedSlug = (0,external_wp_url_namespaceObject.safeDecodeURIComponent)(slug);
27350    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
27351      size: "compact",
27352      className: "editor-post-url__panel-toggle",
27353      variant: "tertiary",
27354      "aria-expanded": isOpen,
27355      "aria-label":
27356      // translators: %s: Current post link.
27357      (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Change link: %s'), decodedSlug),
27358      onClick: onClick,
27359      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
27360        children: decodedSlug
27361      })
27362    });
27363  }
27364  function FrontPageLink() {
27365    const {
27366      postLink
27367    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
27368      const {
27369        getCurrentPost
27370      } = select(store_store);
27371      return {
27372        postLink: getCurrentPost()?.link
27373      };
27374    }, []);
27375    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
27376      className: "editor-post-url__front-page-link",
27377      href: postLink,
27378      target: "_blank",
27379      children: postLink
27380    });
27381  }
27382  
27383  ;// ./node_modules/@wordpress/editor/build-module/components/post-visibility/check.js
27384  /**
27385   * WordPress dependencies
27386   */
27387  
27388  
27389  /**
27390   * Internal dependencies
27391   */
27392  
27393  
27394  /**
27395   * Determines if the current post can be edited (published)
27396   * and passes this information to the provided render function.
27397   *
27398   * @param {Object}   props        The component props.
27399   * @param {Function} props.render Function to render the component.
27400   *                                Receives an object with a `canEdit` property.
27401   * @return {React.ReactNode} The rendered component.
27402   */
27403  function PostVisibilityCheck({
27404    render
27405  }) {
27406    const canEdit = (0,external_wp_data_namespaceObject.useSelect)(select => {
27407      var _select$getCurrentPos;
27408      return (_select$getCurrentPos = select(store_store).getCurrentPost()._links?.['wp:action-publish']) !== null && _select$getCurrentPos !== void 0 ? _select$getCurrentPos : false;
27409    });
27410    return render({
27411      canEdit
27412    });
27413  }
27414  
27415  ;// ./node_modules/@wordpress/icons/build-module/library/info.js
27416  /**
27417   * WordPress dependencies
27418   */
27419  
27420  
27421  const info = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
27422    viewBox: "0 0 24 24",
27423    xmlns: "http://www.w3.org/2000/svg",
27424    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
27425      fillRule: "evenodd",
27426      clipRule: "evenodd",
27427      d: "M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"
27428    })
27429  });
27430  /* harmony default export */ const library_info = (info);
27431  
27432  ;// external ["wp","wordcount"]
27433  const external_wp_wordcount_namespaceObject = window["wp"]["wordcount"];
27434  ;// ./node_modules/@wordpress/editor/build-module/components/word-count/index.js
27435  /**
27436   * WordPress dependencies
27437   */
27438  
27439  
27440  
27441  
27442  /**
27443   * Internal dependencies
27444   */
27445  
27446  
27447  /**
27448   * Renders the word count of the post content.
27449   *
27450   * @return {React.ReactNode} The rendered WordCount component.
27451   */
27452  
27453  function WordCount() {
27454    const content = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getEditedPostAttribute('content'), []);
27455  
27456    /*
27457     * translators: If your word count is based on single characters (e.g. East Asian characters),
27458     * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
27459     * Do not translate into your own language.
27460     */
27461    const wordCountType = (0,external_wp_i18n_namespaceObject._x)('words', 'Word count type. Do not translate!');
27462    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
27463      className: "word-count",
27464      children: (0,external_wp_wordcount_namespaceObject.count)(content, wordCountType)
27465    });
27466  }
27467  
27468  ;// ./node_modules/@wordpress/editor/build-module/components/time-to-read/index.js
27469  /**
27470   * WordPress dependencies
27471   */
27472  
27473  
27474  
27475  
27476  
27477  /**
27478   * Internal dependencies
27479   */
27480  
27481  
27482  /**
27483   * Average reading rate - based on average taken from
27484   * https://irisreading.com/average-reading-speed-in-various-languages/
27485   * (Characters/minute used for Chinese rather than words).
27486   *
27487   * @type {number} A rough estimate of the average reading rate across multiple languages.
27488   */
27489  
27490  const AVERAGE_READING_RATE = 189;
27491  
27492  /**
27493   * Component for showing Time To Read in Content.
27494   *
27495   * @return {React.ReactNode} The rendered TimeToRead component.
27496   */
27497  function TimeToRead() {
27498    const content = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getEditedPostAttribute('content'), []);
27499  
27500    /*
27501     * translators: If your word count is based on single characters (e.g. East Asian characters),
27502     * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
27503     * Do not translate into your own language.
27504     */
27505    const wordCountType = (0,external_wp_i18n_namespaceObject._x)('words', 'Word count type. Do not translate!');
27506    const minutesToRead = Math.round((0,external_wp_wordcount_namespaceObject.count)(content, wordCountType) / AVERAGE_READING_RATE);
27507    const minutesToReadString = minutesToRead === 0 ? (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('<span>< 1</span> minute'), {
27508      span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {})
27509    }) : (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: the number of minutes to read the post. */
27510    (0,external_wp_i18n_namespaceObject._n)('<span>%s</span> minute', '<span>%s</span> minutes', minutesToRead), minutesToRead), {
27511      span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {})
27512    });
27513    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
27514      className: "time-to-read",
27515      children: minutesToReadString
27516    });
27517  }
27518  
27519  ;// ./node_modules/@wordpress/editor/build-module/components/character-count/index.js
27520  /**
27521   * WordPress dependencies
27522   */
27523  
27524  
27525  
27526  /**
27527   * Internal dependencies
27528   */
27529  
27530  
27531  /**
27532   * Renders the character count of the post content.
27533   *
27534   * @return {number} The character count.
27535   */
27536  function CharacterCount() {
27537    const content = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getEditedPostAttribute('content'), []);
27538    return (0,external_wp_wordcount_namespaceObject.count)(content, 'characters_including_spaces');
27539  }
27540  
27541  ;// ./node_modules/@wordpress/editor/build-module/components/table-of-contents/panel.js
27542  /**
27543   * WordPress dependencies
27544   */
27545  
27546  
27547  
27548  
27549  /**
27550   * Internal dependencies
27551   */
27552  
27553  
27554  
27555  
27556  
27557  function TableOfContentsPanel({
27558    hasOutlineItemsDisabled,
27559    onRequestClose
27560  }) {
27561    const {
27562      headingCount,
27563      paragraphCount,
27564      numberOfBlocks
27565    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
27566      const {
27567        getGlobalBlockCount
27568      } = select(external_wp_blockEditor_namespaceObject.store);
27569      return {
27570        headingCount: getGlobalBlockCount('core/heading'),
27571        paragraphCount: getGlobalBlockCount('core/paragraph'),
27572        numberOfBlocks: getGlobalBlockCount()
27573      };
27574    }, []);
27575    return (
27576      /*#__PURE__*/
27577      /*
27578       * Disable reason: The `list` ARIA role is redundant but
27579       * Safari+VoiceOver won't announce the list otherwise.
27580       */
27581      /* eslint-disable jsx-a11y/no-redundant-roles */
27582      (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
27583        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
27584          className: "table-of-contents__wrapper",
27585          role: "note",
27586          "aria-label": (0,external_wp_i18n_namespaceObject.__)('Document Statistics'),
27587          tabIndex: "0",
27588          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("ul", {
27589            role: "list",
27590            className: "table-of-contents__counts",
27591            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", {
27592              className: "table-of-contents__count",
27593              children: [(0,external_wp_i18n_namespaceObject.__)('Words'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WordCount, {})]
27594            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", {
27595              className: "table-of-contents__count",
27596              children: [(0,external_wp_i18n_namespaceObject.__)('Characters'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
27597                className: "table-of-contents__number",
27598                children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CharacterCount, {})
27599              })]
27600            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", {
27601              className: "table-of-contents__count",
27602              children: [(0,external_wp_i18n_namespaceObject.__)('Time to read'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TimeToRead, {})]
27603            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", {
27604              className: "table-of-contents__count",
27605              children: [(0,external_wp_i18n_namespaceObject.__)('Headings'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
27606                className: "table-of-contents__number",
27607                children: headingCount
27608              })]
27609            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", {
27610              className: "table-of-contents__count",
27611              children: [(0,external_wp_i18n_namespaceObject.__)('Paragraphs'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
27612                className: "table-of-contents__number",
27613                children: paragraphCount
27614              })]
27615            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", {
27616              className: "table-of-contents__count",
27617              children: [(0,external_wp_i18n_namespaceObject.__)('Blocks'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
27618                className: "table-of-contents__number",
27619                children: numberOfBlocks
27620              })]
27621            })]
27622          })
27623        }), headingCount > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
27624          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("hr", {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", {
27625            className: "table-of-contents__title",
27626            children: (0,external_wp_i18n_namespaceObject.__)('Document Outline')
27627          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DocumentOutline, {
27628            onSelect: onRequestClose,
27629            hasOutlineItemsDisabled: hasOutlineItemsDisabled
27630          })]
27631        })]
27632      })
27633      /* eslint-enable jsx-a11y/no-redundant-roles */
27634    );
27635  }
27636  /* harmony default export */ const table_of_contents_panel = (TableOfContentsPanel);
27637  
27638  ;// ./node_modules/@wordpress/editor/build-module/components/table-of-contents/index.js
27639  /**
27640   * WordPress dependencies
27641   */
27642  
27643  
27644  
27645  
27646  
27647  
27648  
27649  /**
27650   * Internal dependencies
27651   */
27652  
27653  
27654  function TableOfContents({
27655    hasOutlineItemsDisabled,
27656    repositionDropdown,
27657    ...props
27658  }, ref) {
27659    const hasBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_blockEditor_namespaceObject.store).getBlockCount(), []);
27660    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
27661      popoverProps: {
27662        placement: repositionDropdown ? 'right' : 'bottom'
27663      },
27664      className: "table-of-contents",
27665      contentClassName: "table-of-contents__popover",
27666      renderToggle: ({
27667        isOpen,
27668        onToggle
27669      }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
27670        __next40pxDefaultSize: true,
27671        ...props,
27672        ref: ref,
27673        onClick: hasBlocks ? onToggle : undefined,
27674        icon: library_info,
27675        "aria-expanded": isOpen,
27676        "aria-haspopup": "true"
27677        /* translators: button label text should, if possible, be under 16 characters. */,
27678        label: (0,external_wp_i18n_namespaceObject.__)('Details'),
27679        tooltipPosition: "bottom",
27680        "aria-disabled": !hasBlocks
27681      }),
27682      renderContent: ({
27683        onClose
27684      }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(table_of_contents_panel, {
27685        onRequestClose: onClose,
27686        hasOutlineItemsDisabled: hasOutlineItemsDisabled
27687      })
27688    });
27689  }
27690  
27691  /**
27692   * Renders a table of contents component.
27693   *
27694   * @param {Object}      props                         The component props.
27695   * @param {boolean}     props.hasOutlineItemsDisabled Whether outline items are disabled.
27696   * @param {boolean}     props.repositionDropdown      Whether to reposition the dropdown.
27697   * @param {Element.ref} ref                           The component's ref.
27698   *
27699   * @return {React.ReactNode} The rendered table of contents component.
27700   */
27701  /* harmony default export */ const table_of_contents = ((0,external_wp_element_namespaceObject.forwardRef)(TableOfContents));
27702  
27703  ;// ./node_modules/@wordpress/editor/build-module/components/unsaved-changes-warning/index.js
27704  /**
27705   * WordPress dependencies
27706   */
27707  
27708  
27709  
27710  
27711  
27712  /**
27713   * Warns the user if there are unsaved changes before leaving the editor.
27714   * Compatible with Post Editor and Site Editor.
27715   *
27716   * @return {React.ReactNode} The component.
27717   */
27718  function UnsavedChangesWarning() {
27719    const {
27720      __experimentalGetDirtyEntityRecords
27721    } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store);
27722    (0,external_wp_element_namespaceObject.useEffect)(() => {
27723      /**
27724       * Warns the user if there are unsaved changes before leaving the editor.
27725       *
27726       * @param {Event} event `beforeunload` event.
27727       *
27728       * @return {string | undefined} Warning prompt message, if unsaved changes exist.
27729       */
27730      const warnIfUnsavedChanges = event => {
27731        // We need to call the selector directly in the listener to avoid race
27732        // conditions with `BrowserURL` where `componentDidUpdate` gets the
27733        // new value of `isEditedPostDirty` before this component does,
27734        // causing this component to incorrectly think a trashed post is still dirty.
27735        const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
27736        if (dirtyEntityRecords.length > 0) {
27737          event.returnValue = (0,external_wp_i18n_namespaceObject.__)('You have unsaved changes. If you proceed, they will be lost.');
27738          return event.returnValue;
27739        }
27740      };
27741      window.addEventListener('beforeunload', warnIfUnsavedChanges);
27742      return () => {
27743        window.removeEventListener('beforeunload', warnIfUnsavedChanges);
27744      };
27745    }, [__experimentalGetDirtyEntityRecords]);
27746    return null;
27747  }
27748  
27749  ;// external ["wp","serverSideRender"]
27750  const external_wp_serverSideRender_namespaceObject = window["wp"]["serverSideRender"];
27751  var external_wp_serverSideRender_default = /*#__PURE__*/__webpack_require__.n(external_wp_serverSideRender_namespaceObject);
27752  ;// ./node_modules/@wordpress/editor/build-module/components/deprecated.js
27753  // Block Creation Components.
27754  /**
27755   * WordPress dependencies
27756   */
27757  
27758  
27759  
27760  
27761  
27762  function deprecateComponent(name, Wrapped, staticsToHoist = []) {
27763    const Component = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
27764      external_wp_deprecated_default()('wp.editor.' + name, {
27765        since: '5.3',
27766        alternative: 'wp.blockEditor.' + name,
27767        version: '6.2'
27768      });
27769      return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Wrapped, {
27770        ref: ref,
27771        ...props
27772      });
27773    });
27774    staticsToHoist.forEach(staticName => {
27775      Component[staticName] = deprecateComponent(name + '.' + staticName, Wrapped[staticName]);
27776    });
27777    return Component;
27778  }
27779  function deprecateFunction(name, func) {
27780    return (...args) => {
27781      external_wp_deprecated_default()('wp.editor.' + name, {
27782        since: '5.3',
27783        alternative: 'wp.blockEditor.' + name,
27784        version: '6.2'
27785      });
27786      return func(...args);
27787    };
27788  }
27789  
27790  /**
27791   * @deprecated since 5.3, use `wp.blockEditor.RichText` instead.
27792   */
27793  const RichText = deprecateComponent('RichText', external_wp_blockEditor_namespaceObject.RichText, ['Content']);
27794  RichText.isEmpty = deprecateFunction('RichText.isEmpty', external_wp_blockEditor_namespaceObject.RichText.isEmpty);
27795  
27796  
27797  /**
27798   * @deprecated since 5.3, use `wp.blockEditor.Autocomplete` instead.
27799   */
27800  const Autocomplete = deprecateComponent('Autocomplete', external_wp_blockEditor_namespaceObject.Autocomplete);
27801  /**
27802   * @deprecated since 5.3, use `wp.blockEditor.AlignmentToolbar` instead.
27803   */
27804  const AlignmentToolbar = deprecateComponent('AlignmentToolbar', external_wp_blockEditor_namespaceObject.AlignmentToolbar);
27805  /**
27806   * @deprecated since 5.3, use `wp.blockEditor.BlockAlignmentToolbar` instead.
27807   */
27808  const BlockAlignmentToolbar = deprecateComponent('BlockAlignmentToolbar', external_wp_blockEditor_namespaceObject.BlockAlignmentToolbar);
27809  /**
27810   * @deprecated since 5.3, use `wp.blockEditor.BlockControls` instead.
27811   */
27812  const BlockControls = deprecateComponent('BlockControls', external_wp_blockEditor_namespaceObject.BlockControls, ['Slot']);
27813  /**
27814   * @deprecated since 5.3, use `wp.blockEditor.BlockEdit` instead.
27815   */
27816  const BlockEdit = deprecateComponent('BlockEdit', external_wp_blockEditor_namespaceObject.BlockEdit);
27817  /**
27818   * @deprecated since 5.3, use `wp.blockEditor.BlockEditorKeyboardShortcuts` instead.
27819   */
27820  const BlockEditorKeyboardShortcuts = deprecateComponent('BlockEditorKeyboardShortcuts', external_wp_blockEditor_namespaceObject.BlockEditorKeyboardShortcuts);
27821  /**
27822   * @deprecated since 5.3, use `wp.blockEditor.BlockFormatControls` instead.
27823   */
27824  const BlockFormatControls = deprecateComponent('BlockFormatControls', external_wp_blockEditor_namespaceObject.BlockFormatControls, ['Slot']);
27825  /**
27826   * @deprecated since 5.3, use `wp.blockEditor.BlockIcon` instead.
27827   */
27828  const BlockIcon = deprecateComponent('BlockIcon', external_wp_blockEditor_namespaceObject.BlockIcon);
27829  /**
27830   * @deprecated since 5.3, use `wp.blockEditor.BlockInspector` instead.
27831   */
27832  const BlockInspector = deprecateComponent('BlockInspector', external_wp_blockEditor_namespaceObject.BlockInspector);
27833  /**
27834   * @deprecated since 5.3, use `wp.blockEditor.BlockList` instead.
27835   */
27836  const BlockList = deprecateComponent('BlockList', external_wp_blockEditor_namespaceObject.BlockList);
27837  /**
27838   * @deprecated since 5.3, use `wp.blockEditor.BlockMover` instead.
27839   */
27840  const BlockMover = deprecateComponent('BlockMover', external_wp_blockEditor_namespaceObject.BlockMover);
27841  /**
27842   * @deprecated since 5.3, use `wp.blockEditor.BlockNavigationDropdown` instead.
27843   */
27844  const BlockNavigationDropdown = deprecateComponent('BlockNavigationDropdown', external_wp_blockEditor_namespaceObject.BlockNavigationDropdown);
27845  /**
27846   * @deprecated since 5.3, use `wp.blockEditor.BlockSelectionClearer` instead.
27847   */
27848  const BlockSelectionClearer = deprecateComponent('BlockSelectionClearer', external_wp_blockEditor_namespaceObject.BlockSelectionClearer);
27849  /**
27850   * @deprecated since 5.3, use `wp.blockEditor.BlockSettingsMenu` instead.
27851   */
27852  const BlockSettingsMenu = deprecateComponent('BlockSettingsMenu', external_wp_blockEditor_namespaceObject.BlockSettingsMenu);
27853  /**
27854   * @deprecated since 5.3, use `wp.blockEditor.BlockTitle` instead.
27855   */
27856  const BlockTitle = deprecateComponent('BlockTitle', external_wp_blockEditor_namespaceObject.BlockTitle);
27857  /**
27858   * @deprecated since 5.3, use `wp.blockEditor.BlockToolbar` instead.
27859   */
27860  const BlockToolbar = deprecateComponent('BlockToolbar', external_wp_blockEditor_namespaceObject.BlockToolbar);
27861  /**
27862   * @deprecated since 5.3, use `wp.blockEditor.ColorPalette` instead.
27863   */
27864  const ColorPalette = deprecateComponent('ColorPalette', external_wp_blockEditor_namespaceObject.ColorPalette);
27865  /**
27866   * @deprecated since 5.3, use `wp.blockEditor.ContrastChecker` instead.
27867   */
27868  const ContrastChecker = deprecateComponent('ContrastChecker', external_wp_blockEditor_namespaceObject.ContrastChecker);
27869  /**
27870   * @deprecated since 5.3, use `wp.blockEditor.CopyHandler` instead.
27871   */
27872  const CopyHandler = deprecateComponent('CopyHandler', external_wp_blockEditor_namespaceObject.CopyHandler);
27873  /**
27874   * @deprecated since 5.3, use `wp.blockEditor.DefaultBlockAppender` instead.
27875   */
27876  const DefaultBlockAppender = deprecateComponent('DefaultBlockAppender', external_wp_blockEditor_namespaceObject.DefaultBlockAppender);
27877  /**
27878   * @deprecated since 5.3, use `wp.blockEditor.FontSizePicker` instead.
27879   */
27880  const FontSizePicker = deprecateComponent('FontSizePicker', external_wp_blockEditor_namespaceObject.FontSizePicker);
27881  /**
27882   * @deprecated since 5.3, use `wp.blockEditor.Inserter` instead.
27883   */
27884  const Inserter = deprecateComponent('Inserter', external_wp_blockEditor_namespaceObject.Inserter);
27885  /**
27886   * @deprecated since 5.3, use `wp.blockEditor.InnerBlocks` instead.
27887   */
27888  const InnerBlocks = deprecateComponent('InnerBlocks', external_wp_blockEditor_namespaceObject.InnerBlocks, ['ButtonBlockAppender', 'DefaultBlockAppender', 'Content']);
27889  /**
27890   * @deprecated since 5.3, use `wp.blockEditor.InspectorAdvancedControls` instead.
27891   */
27892  const InspectorAdvancedControls = deprecateComponent('InspectorAdvancedControls', external_wp_blockEditor_namespaceObject.InspectorAdvancedControls, ['Slot']);
27893  /**
27894   * @deprecated since 5.3, use `wp.blockEditor.InspectorControls` instead.
27895   */
27896  const InspectorControls = deprecateComponent('InspectorControls', external_wp_blockEditor_namespaceObject.InspectorControls, ['Slot']);
27897  /**
27898   * @deprecated since 5.3, use `wp.blockEditor.PanelColorSettings` instead.
27899   */
27900  const PanelColorSettings = deprecateComponent('PanelColorSettings', external_wp_blockEditor_namespaceObject.PanelColorSettings);
27901  /**
27902   * @deprecated since 5.3, use `wp.blockEditor.PlainText` instead.
27903   */
27904  const PlainText = deprecateComponent('PlainText', external_wp_blockEditor_namespaceObject.PlainText);
27905  /**
27906   * @deprecated since 5.3, use `wp.blockEditor.RichTextShortcut` instead.
27907   */
27908  const RichTextShortcut = deprecateComponent('RichTextShortcut', external_wp_blockEditor_namespaceObject.RichTextShortcut);
27909  /**
27910   * @deprecated since 5.3, use `wp.blockEditor.RichTextToolbarButton` instead.
27911   */
27912  const RichTextToolbarButton = deprecateComponent('RichTextToolbarButton', external_wp_blockEditor_namespaceObject.RichTextToolbarButton);
27913  /**
27914   * @deprecated since 5.3, use `wp.blockEditor.__unstableRichTextInputEvent` instead.
27915   */
27916  const __unstableRichTextInputEvent = deprecateComponent('__unstableRichTextInputEvent', external_wp_blockEditor_namespaceObject.__unstableRichTextInputEvent);
27917  /**
27918   * @deprecated since 5.3, use `wp.blockEditor.MediaPlaceholder` instead.
27919   */
27920  const MediaPlaceholder = deprecateComponent('MediaPlaceholder', external_wp_blockEditor_namespaceObject.MediaPlaceholder);
27921  /**
27922   * @deprecated since 5.3, use `wp.blockEditor.MediaUpload` instead.
27923   */
27924  const MediaUpload = deprecateComponent('MediaUpload', external_wp_blockEditor_namespaceObject.MediaUpload);
27925  /**
27926   * @deprecated since 5.3, use `wp.blockEditor.MediaUploadCheck` instead.
27927   */
27928  const MediaUploadCheck = deprecateComponent('MediaUploadCheck', external_wp_blockEditor_namespaceObject.MediaUploadCheck);
27929  /**
27930   * @deprecated since 5.3, use `wp.blockEditor.MultiSelectScrollIntoView` instead.
27931   */
27932  const MultiSelectScrollIntoView = deprecateComponent('MultiSelectScrollIntoView', external_wp_blockEditor_namespaceObject.MultiSelectScrollIntoView);
27933  /**
27934   * @deprecated since 5.3, use `wp.blockEditor.NavigableToolbar` instead.
27935   */
27936  const NavigableToolbar = deprecateComponent('NavigableToolbar', external_wp_blockEditor_namespaceObject.NavigableToolbar);
27937  /**
27938   * @deprecated since 5.3, use `wp.blockEditor.ObserveTyping` instead.
27939   */
27940  const ObserveTyping = deprecateComponent('ObserveTyping', external_wp_blockEditor_namespaceObject.ObserveTyping);
27941  /**
27942   * @deprecated since 5.3, use `wp.blockEditor.SkipToSelectedBlock` instead.
27943   */
27944  const SkipToSelectedBlock = deprecateComponent('SkipToSelectedBlock', external_wp_blockEditor_namespaceObject.SkipToSelectedBlock);
27945  /**
27946   * @deprecated since 5.3, use `wp.blockEditor.URLInput` instead.
27947   */
27948  const URLInput = deprecateComponent('URLInput', external_wp_blockEditor_namespaceObject.URLInput);
27949  /**
27950   * @deprecated since 5.3, use `wp.blockEditor.URLInputButton` instead.
27951   */
27952  const URLInputButton = deprecateComponent('URLInputButton', external_wp_blockEditor_namespaceObject.URLInputButton);
27953  /**
27954   * @deprecated since 5.3, use `wp.blockEditor.URLPopover` instead.
27955   */
27956  const URLPopover = deprecateComponent('URLPopover', external_wp_blockEditor_namespaceObject.URLPopover);
27957  /**
27958   * @deprecated since 5.3, use `wp.blockEditor.Warning` instead.
27959   */
27960  const Warning = deprecateComponent('Warning', external_wp_blockEditor_namespaceObject.Warning);
27961  /**
27962   * @deprecated since 5.3, use `wp.blockEditor.WritingFlow` instead.
27963   */
27964  const WritingFlow = deprecateComponent('WritingFlow', external_wp_blockEditor_namespaceObject.WritingFlow);
27965  
27966  /**
27967   * @deprecated since 5.3, use `wp.blockEditor.createCustomColorsHOC` instead.
27968   */
27969  const createCustomColorsHOC = deprecateFunction('createCustomColorsHOC', external_wp_blockEditor_namespaceObject.createCustomColorsHOC);
27970  /**
27971   * @deprecated since 5.3, use `wp.blockEditor.getColorClassName` instead.
27972   */
27973  const getColorClassName = deprecateFunction('getColorClassName', external_wp_blockEditor_namespaceObject.getColorClassName);
27974  /**
27975   * @deprecated since 5.3, use `wp.blockEditor.getColorObjectByAttributeValues` instead.
27976   */
27977  const getColorObjectByAttributeValues = deprecateFunction('getColorObjectByAttributeValues', external_wp_blockEditor_namespaceObject.getColorObjectByAttributeValues);
27978  /**
27979   * @deprecated since 5.3, use `wp.blockEditor.getColorObjectByColorValue` instead.
27980   */
27981  const getColorObjectByColorValue = deprecateFunction('getColorObjectByColorValue', external_wp_blockEditor_namespaceObject.getColorObjectByColorValue);
27982  /**
27983   * @deprecated since 5.3, use `wp.blockEditor.getFontSize` instead.
27984   */
27985  const getFontSize = deprecateFunction('getFontSize', external_wp_blockEditor_namespaceObject.getFontSize);
27986  /**
27987   * @deprecated since 5.3, use `wp.blockEditor.getFontSizeClass` instead.
27988   */
27989  const getFontSizeClass = deprecateFunction('getFontSizeClass', external_wp_blockEditor_namespaceObject.getFontSizeClass);
27990  /**
27991   * @deprecated since 5.3, use `wp.blockEditor.createCustomColorsHOC` instead.
27992   */
27993  const withColorContext = deprecateFunction('withColorContext', external_wp_blockEditor_namespaceObject.withColorContext);
27994  /**
27995   * @deprecated since 5.3, use `wp.blockEditor.withColors` instead.
27996   */
27997  const withColors = deprecateFunction('withColors', external_wp_blockEditor_namespaceObject.withColors);
27998  /**
27999   * @deprecated since 5.3, use `wp.blockEditor.withFontSizes` instead.
28000   */
28001  const withFontSizes = deprecateFunction('withFontSizes', external_wp_blockEditor_namespaceObject.withFontSizes);
28002  
28003  ;// ./node_modules/@wordpress/editor/build-module/components/index.js
28004  /**
28005   * Internal dependencies
28006   */
28007  
28008  
28009  // Block Creation Components.
28010  
28011  
28012  // Post Related Components.
28013  
28014  
28015  
28016  
28017  
28018  
28019  
28020  
28021  
28022  
28023  
28024  
28025  
28026  
28027  
28028  
28029  
28030  
28031  
28032  
28033  
28034  
28035  
28036  
28037  
28038  
28039  
28040  
28041  
28042  
28043  
28044  
28045  
28046  
28047  
28048  
28049  
28050  
28051  
28052  
28053  
28054  
28055  
28056  
28057  
28058  
28059  
28060  
28061  
28062  
28063  
28064  
28065  
28066  
28067  
28068  
28069  
28070  
28071  
28072  
28073  
28074  
28075  
28076  
28077  
28078  
28079  
28080  
28081  
28082  
28083  
28084  
28085  
28086  
28087  
28088  
28089  
28090  
28091  
28092  
28093  
28094  
28095  
28096  
28097  
28098  
28099  
28100  // State Related Components.
28101  
28102  
28103  
28104  /**
28105   * Handles the keyboard shortcuts for the editor.
28106   *
28107   * It provides functionality for various keyboard shortcuts such as toggling editor mode,
28108   * toggling distraction-free mode, undo/redo, saving the post, toggling list view,
28109   * and toggling the sidebar.
28110   */
28111  const VisualEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;
28112  
28113  /**
28114   * Handles the keyboard shortcuts for the editor.
28115   *
28116   * It provides functionality for various keyboard shortcuts such as toggling editor mode,
28117   * toggling distraction-free mode, undo/redo, saving the post, toggling list view,
28118   * and toggling the sidebar.
28119   */
28120  const TextEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;
28121  
28122  ;// ./node_modules/@wordpress/editor/build-module/utils/url.js
28123  /**
28124   * WordPress dependencies
28125   */
28126  
28127  
28128  
28129  /**
28130   * Performs some basic cleanup of a string for use as a post slug
28131   *
28132   * This replicates some of what sanitize_title() does in WordPress core, but
28133   * is only designed to approximate what the slug will be.
28134   *
28135   * Converts Latin-1 Supplement and Latin Extended-A letters to basic Latin letters.
28136   * Removes combining diacritical marks. Converts whitespace, periods,
28137   * and forward slashes to hyphens. Removes any remaining non-word characters
28138   * except hyphens and underscores. Converts remaining string to lowercase.
28139   * It does not account for octets, HTML entities, or other encoded characters.
28140   *
28141   * @param {string} string Title or slug to be processed
28142   *
28143   * @return {string} Processed string
28144   */
28145  function cleanForSlug(string) {
28146    external_wp_deprecated_default()('wp.editor.cleanForSlug', {
28147      since: '12.7',
28148      plugin: 'Gutenberg',
28149      alternative: 'wp.url.cleanForSlug'
28150    });
28151    return (0,external_wp_url_namespaceObject.cleanForSlug)(string);
28152  }
28153  
28154  ;// ./node_modules/@wordpress/editor/build-module/utils/index.js
28155  /**
28156   * Internal dependencies
28157   */
28158  
28159  
28160  
28161  
28162  
28163  ;// ./node_modules/@wordpress/editor/build-module/components/editor-interface/content-slot-fill.js
28164  /**
28165   * WordPress dependencies
28166   */
28167  
28168  const EditorContentSlotFill = (0,external_wp_components_namespaceObject.createSlotFill)(Symbol('EditCanvasContainerSlot'));
28169  /* harmony default export */ const content_slot_fill = (EditorContentSlotFill);
28170  
28171  ;// ./node_modules/@wordpress/editor/build-module/components/header/back-button.js
28172  /**
28173   * WordPress dependencies
28174   */
28175  
28176  
28177  // Keeping an old name for backward compatibility.
28178  
28179  const slotName = '__experimentalMainDashboardButton';
28180  const useHasBackButton = () => {
28181    const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(slotName);
28182    return Boolean(fills && fills.length);
28183  };
28184  const {
28185    Fill: back_button_Fill,
28186    Slot: back_button_Slot
28187  } = (0,external_wp_components_namespaceObject.createSlotFill)(slotName);
28188  const BackButton = back_button_Fill;
28189  const BackButtonSlot = () => {
28190    const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(slotName);
28191    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(back_button_Slot, {
28192      bubblesVirtually: true,
28193      fillProps: {
28194        length: !fills ? 0 : fills.length
28195      }
28196    });
28197  };
28198  BackButton.Slot = BackButtonSlot;
28199  /* harmony default export */ const back_button = (BackButton);
28200  
28201  ;// ./node_modules/@wordpress/icons/build-module/library/comment.js
28202  /**
28203   * WordPress dependencies
28204   */
28205  
28206  
28207  const comment = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
28208    viewBox: "0 0 24 24",
28209    xmlns: "http://www.w3.org/2000/svg",
28210    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
28211      d: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"
28212    })
28213  });
28214  /* harmony default export */ const library_comment = (comment);
28215  
28216  ;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/constants.js
28217  const collabHistorySidebarName = 'edit-post/collab-history-sidebar';
28218  const collabSidebarName = 'edit-post/collab-sidebar';
28219  
28220  ;// ./node_modules/@wordpress/icons/build-module/library/more-vertical.js
28221  /**
28222   * WordPress dependencies
28223   */
28224  
28225  
28226  const moreVertical = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
28227    xmlns: "http://www.w3.org/2000/svg",
28228    viewBox: "0 0 24 24",
28229    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
28230      d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"
28231    })
28232  });
28233  /* harmony default export */ const more_vertical = (moreVertical);
28234  
28235  ;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/comment-author-info.js
28236  /**
28237   * WordPress dependencies
28238   */
28239  
28240  
28241  
28242  
28243  
28244  
28245  
28246  /**
28247   * Render author information for a comment.
28248   *
28249   * @param {Object} props        - Component properties.
28250   * @param {string} props.avatar - URL of the author's avatar.
28251   * @param {string} props.name   - Name of the author.
28252   * @param {string} props.date   - Date of the comment.
28253   *
28254   * @return {React.ReactNode} The JSX element representing the author's information.
28255   */
28256  
28257  function CommentAuthorInfo({
28258    avatar,
28259    name,
28260    date
28261  }) {
28262    const dateSettings = (0,external_wp_date_namespaceObject.getSettings)();
28263    const [dateTimeFormat = dateSettings.formats.time] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'time_format');
28264    const {
28265      currentUserAvatar,
28266      currentUserName
28267    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
28268      var _userData$avatar_urls;
28269      const userData = select(external_wp_coreData_namespaceObject.store).getCurrentUser();
28270      const {
28271        getSettings
28272      } = select(external_wp_blockEditor_namespaceObject.store);
28273      const {
28274        __experimentalDiscussionSettings
28275      } = getSettings();
28276      const defaultAvatar = __experimentalDiscussionSettings?.avatarURL;
28277      return {
28278        currentUserAvatar: (_userData$avatar_urls = userData?.avatar_urls[48]) !== null && _userData$avatar_urls !== void 0 ? _userData$avatar_urls : defaultAvatar,
28279        currentUserName: userData?.name
28280      };
28281    }, []);
28282    const currentDate = new Date();
28283    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
28284      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
28285        src: avatar !== null && avatar !== void 0 ? avatar : currentUserAvatar,
28286        className: "editor-collab-sidebar-panel__user-avatar"
28287        // translators: alt text for user avatar image
28288        ,
28289        alt: (0,external_wp_i18n_namespaceObject.__)('User avatar'),
28290        width: 32,
28291        height: 32
28292      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
28293        spacing: "0",
28294        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
28295          className: "editor-collab-sidebar-panel__user-name",
28296          children: name !== null && name !== void 0 ? name : currentUserName
28297        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {
28298          dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date !== null && date !== void 0 ? date : currentDate),
28299          className: "editor-collab-sidebar-panel__user-time",
28300          children: (0,external_wp_date_namespaceObject.dateI18n)(dateTimeFormat, date !== null && date !== void 0 ? date : currentDate)
28301        })]
28302      })]
28303    });
28304  }
28305  /* harmony default export */ const comment_author_info = (CommentAuthorInfo);
28306  
28307  ;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/utils.js
28308  /**
28309   * Sanitizes a comment string by removing non-printable ASCII characters.
28310   *
28311   * @param {string} str - The comment string to sanitize.
28312   * @return {string} - The sanitized comment string.
28313   */
28314  function sanitizeCommentString(str) {
28315    return str.trim();
28316  }
28317  
28318  /**
28319   * Extracts comment IDs from an array of blocks.
28320   *
28321   * This function recursively traverses the blocks and their inner blocks to
28322   * collect all comment IDs found in the block attributes.
28323   *
28324   * @param {Array} blocks - The array of blocks to extract comment IDs from.
28325   * @return {Array} An array of comment IDs extracted from the blocks.
28326   */
28327  function getCommentIdsFromBlocks(blocks) {
28328    // Recursive function to extract comment IDs from blocks
28329    const extractCommentIds = items => {
28330      return items.reduce((commentIds, block) => {
28331        // Check for comment IDs in the current block's attributes
28332        if (block.attributes && block.attributes.blockCommentId && !commentIds.includes(block.attributes.blockCommentId)) {
28333          commentIds.push(block.attributes.blockCommentId);
28334        }
28335  
28336        // Recursively check inner blocks
28337        if (block.innerBlocks && block.innerBlocks.length > 0) {
28338          const innerCommentIds = extractCommentIds(block.innerBlocks);
28339          commentIds.push(...innerCommentIds);
28340        }
28341        return commentIds;
28342      }, []);
28343    };
28344  
28345    // Extract all comment IDs recursively
28346    return extractCommentIds(blocks);
28347  }
28348  
28349  ;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/comment-form.js
28350  /**
28351   * WordPress dependencies
28352   */
28353  
28354  
28355  
28356  
28357  /**
28358   * Internal dependencies
28359   */
28360  
28361  
28362  /**
28363   * EditComment component.
28364   *
28365   * @param {Object}   props                  - The component props.
28366   * @param {Function} props.onSubmit         - The function to call when updating the comment.
28367   * @param {Function} props.onCancel         - The function to call when canceling the comment update.
28368   * @param {Object}   props.thread           - The comment thread object.
28369   * @param {string}   props.submitButtonText - The text to display on the submit button.
28370   * @return {React.ReactNode} The CommentForm component.
28371   */
28372  
28373  function CommentForm({
28374    onSubmit,
28375    onCancel,
28376    thread,
28377    submitButtonText
28378  }) {
28379    var _thread$content$raw;
28380    const [inputComment, setInputComment] = (0,external_wp_element_namespaceObject.useState)((_thread$content$raw = thread?.content?.raw) !== null && _thread$content$raw !== void 0 ? _thread$content$raw : '');
28381    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
28382      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, {
28383        __next40pxDefaultSize: true,
28384        __nextHasNoMarginBottom: true,
28385        value: inputComment !== null && inputComment !== void 0 ? inputComment : '',
28386        onChange: setInputComment
28387      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
28388        alignment: "left",
28389        spacing: "3",
28390        justify: "flex-start",
28391        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
28392          __next40pxDefaultSize: true,
28393          accessibleWhenDisabled: true,
28394          variant: "primary",
28395          onClick: () => {
28396            onSubmit(inputComment);
28397            setInputComment('');
28398          },
28399          disabled: 0 === sanitizeCommentString(inputComment).length,
28400          text: submitButtonText
28401        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
28402          __next40pxDefaultSize: true,
28403          variant: "tertiary",
28404          onClick: onCancel,
28405          text: (0,external_wp_i18n_namespaceObject._x)('Cancel', 'Cancel comment button')
28406        })]
28407      })]
28408    });
28409  }
28410  /* harmony default export */ const comment_form = (CommentForm);
28411  
28412  ;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/comments.js
28413  /**
28414   * External dependencies
28415   */
28416  
28417  
28418  /**
28419   * WordPress dependencies
28420   */
28421  
28422  
28423  
28424  
28425  
28426  
28427  
28428  /**
28429   * Internal dependencies
28430   */
28431  
28432  
28433  
28434  /**
28435   * Renders the Comments component.
28436   *
28437   * @param {Object}   props                     - The component props.
28438   * @param {Array}    props.threads             - The array of comment threads.
28439   * @param {Function} props.onEditComment       - The function to handle comment editing.
28440   * @param {Function} props.onAddReply          - The function to add a reply to a comment.
28441   * @param {Function} props.onCommentDelete     - The function to delete a comment.
28442   * @param {Function} props.onCommentResolve    - The function to mark a comment as resolved.
28443   * @param {boolean}  props.showCommentBoard    - Whether to show the comment board.
28444   * @param {Function} props.setShowCommentBoard - The function to set the comment board visibility.
28445   * @return {React.ReactNode} The rendered Comments component.
28446   */
28447  
28448  function Comments({
28449    threads,
28450    onEditComment,
28451    onAddReply,
28452    onCommentDelete,
28453    onCommentResolve,
28454    showCommentBoard,
28455    setShowCommentBoard
28456  }) {
28457    const {
28458      blockCommentId
28459    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
28460      const {
28461        getBlockAttributes,
28462        getSelectedBlockClientId
28463      } = select(external_wp_blockEditor_namespaceObject.store);
28464      const _clientId = getSelectedBlockClientId();
28465      return {
28466        blockCommentId: _clientId ? getBlockAttributes(_clientId)?.blockCommentId : null
28467      };
28468    }, []);
28469    const [focusThread, setFocusThread] = (0,external_wp_element_namespaceObject.useState)(showCommentBoard && blockCommentId ? blockCommentId : null);
28470    const clearThreadFocus = () => {
28471      setFocusThread(null);
28472      setShowCommentBoard(false);
28473    };
28474    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
28475      children: [
28476      // If there are no comments, show a message indicating no comments are available.
28477      (!Array.isArray(threads) || threads.length === 0) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, {
28478        alignment: "left",
28479        className: "editor-collab-sidebar-panel__thread",
28480        justify: "flex-start",
28481        spacing: "3",
28482        children:
28483        // translators: message displayed when there are no comments available
28484        (0,external_wp_i18n_namespaceObject.__)('No comments available')
28485      }), Array.isArray(threads) && threads.length > 0 && threads.map(thread => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, {
28486        className: dist_clsx('editor-collab-sidebar-panel__thread', {
28487          'editor-collab-sidebar-panel__active-thread': blockCommentId && blockCommentId === thread.id,
28488          'editor-collab-sidebar-panel__focus-thread': focusThread && focusThread === thread.id
28489        }),
28490        id: thread.id,
28491        spacing: "3",
28492        onClick: () => setFocusThread(thread.id),
28493        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Thread, {
28494          thread: thread,
28495          onAddReply: onAddReply,
28496          onCommentDelete: onCommentDelete,
28497          onCommentResolve: onCommentResolve,
28498          onEditComment: onEditComment,
28499          isFocused: focusThread === thread.id,
28500          clearThreadFocus: clearThreadFocus
28501        })
28502      }, thread.id))]
28503    });
28504  }
28505  function Thread({
28506    thread,
28507    onEditComment,
28508    onAddReply,
28509    onCommentDelete,
28510    onCommentResolve,
28511    isFocused,
28512    clearThreadFocus
28513  }) {
28514    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
28515      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentBoard, {
28516        thread: thread,
28517        onResolve: onCommentResolve,
28518        onEdit: onEditComment,
28519        onDelete: onCommentDelete,
28520        status: thread.status
28521      }), 0 < thread?.reply?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
28522        children: [!isFocused && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, {
28523          className: "editor-collab-sidebar-panel__show-more-reply",
28524          children: (0,external_wp_i18n_namespaceObject.sprintf)(
28525          // translators: 1: number of replies.
28526          (0,external_wp_i18n_namespaceObject._x)('%s more replies..', 'Show replies button'), thread?.reply?.length)
28527        }), isFocused && thread.reply.map(reply => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
28528          className: "editor-collab-sidebar-panel__child-thread",
28529          id: reply.id,
28530          spacing: "2",
28531          children: ['approved' !== thread.status && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentBoard, {
28532            thread: reply,
28533            onEdit: onEditComment,
28534            onDelete: onCommentDelete
28535          }), 'approved' === thread.status && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentBoard, {
28536            thread: reply
28537          })]
28538        }, reply.id))]
28539      }), 'approved' !== thread.status && isFocused && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
28540        className: "editor-collab-sidebar-panel__child-thread",
28541        spacing: "2",
28542        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, {
28543          alignment: "left",
28544          spacing: "3",
28545          justify: "flex-start",
28546          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(comment_author_info, {})
28547        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, {
28548          spacing: "3",
28549          className: "editor-collab-sidebar-panel__comment-field",
28550          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(comment_form, {
28551            onSubmit: inputComment => {
28552              onAddReply(inputComment, thread.id);
28553            },
28554            onCancel: event => {
28555              event.stopPropagation(); // Prevent the parent onClick from being triggered
28556              clearThreadFocus();
28557            },
28558            submitButtonText: (0,external_wp_i18n_namespaceObject._x)('Reply', 'Add reply comment')
28559          })
28560        })]
28561      })]
28562    });
28563  }
28564  const CommentBoard = ({
28565    thread,
28566    onResolve,
28567    onEdit,
28568    onDelete,
28569    status
28570  }) => {
28571    const [actionState, setActionState] = (0,external_wp_element_namespaceObject.useState)(false);
28572    const [showConfirmDialog, setShowConfirmDialog] = (0,external_wp_element_namespaceObject.useState)(false);
28573    const handleConfirmDelete = () => {
28574      onDelete(thread.id);
28575      setActionState(false);
28576      setShowConfirmDialog(false);
28577    };
28578    const handleConfirmResolve = () => {
28579      onResolve(thread.id);
28580      setActionState(false);
28581      setShowConfirmDialog(false);
28582    };
28583    const handleCancel = () => {
28584      setActionState(false);
28585      setShowConfirmDialog(false);
28586    };
28587    const actions = [onEdit && {
28588      title: (0,external_wp_i18n_namespaceObject._x)('Edit', 'Edit comment'),
28589      onClick: () => {
28590        setActionState('edit');
28591      }
28592    }, onDelete && {
28593      title: (0,external_wp_i18n_namespaceObject._x)('Delete', 'Delete comment'),
28594      onClick: () => {
28595        setActionState('delete');
28596        setShowConfirmDialog(true);
28597      }
28598    }];
28599    const moreActions = actions.filter(item => item?.onClick);
28600    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
28601      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
28602        alignment: "left",
28603        spacing: "3",
28604        justify: "flex-start",
28605        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(comment_author_info, {
28606          avatar: thread?.author_avatar_urls?.[48],
28607          name: thread?.author_name,
28608          date: thread?.date
28609        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", {
28610          className: "editor-collab-sidebar-panel__comment-status",
28611          children: [status !== 'approved' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
28612            alignment: "right",
28613            justify: "flex-end",
28614            spacing: "0",
28615            children: [0 === thread?.parent && onResolve && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
28616              label: (0,external_wp_i18n_namespaceObject._x)('Resolve', 'Mark comment as resolved'),
28617              __next40pxDefaultSize: true,
28618              icon: library_published,
28619              onClick: () => {
28620                setActionState('resolve');
28621                setShowConfirmDialog(true);
28622              },
28623              showTooltip: true
28624            }), 0 < moreActions.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, {
28625              icon: more_vertical,
28626              label: (0,external_wp_i18n_namespaceObject._x)('Select an action', 'Select comment action'),
28627              className: "editor-collab-sidebar-panel__comment-dropdown-menu",
28628              controls: moreActions
28629            })]
28630          }), status === 'approved' &&
28631          /*#__PURE__*/
28632          // translators: tooltip for resolved comment
28633          (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, {
28634            text: (0,external_wp_i18n_namespaceObject.__)('Resolved'),
28635            children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icon, {
28636              icon: library_check
28637            })
28638          })]
28639        })]
28640      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, {
28641        alignment: "left",
28642        spacing: "3",
28643        justify: "flex-start",
28644        className: "editor-collab-sidebar-panel__user-comment",
28645        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
28646          spacing: "3",
28647          className: "editor-collab-sidebar-panel__comment-field",
28648          children: ['edit' === actionState && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(comment_form, {
28649            onSubmit: value => {
28650              onEdit(thread.id, value);
28651              setActionState(false);
28652            },
28653            onCancel: () => handleCancel(),
28654            thread: thread,
28655            submitButtonText: (0,external_wp_i18n_namespaceObject._x)('Update', 'verb')
28656          }), 'edit' !== actionState && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, {
28657            children: thread?.content?.raw
28658          })]
28659        })
28660      }), 'resolve' === actionState && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, {
28661        isOpen: showConfirmDialog,
28662        onConfirm: handleConfirmResolve,
28663        onCancel: handleCancel,
28664        confirmButtonText: "Yes",
28665        cancelButtonText: "No",
28666        children:
28667        // translators: message displayed when confirming an action
28668        (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to mark this comment as resolved?')
28669      }), 'delete' === actionState && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, {
28670        isOpen: showConfirmDialog,
28671        onConfirm: handleConfirmDelete,
28672        onCancel: handleCancel,
28673        confirmButtonText: "Yes",
28674        cancelButtonText: "No",
28675        children:
28676        // translators: message displayed when confirming an action
28677        (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete this comment?')
28678      })]
28679    });
28680  };
28681  
28682  ;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/add-comment.js
28683  /**
28684   * WordPress dependencies
28685   */
28686  
28687  
28688  
28689  
28690  
28691  /**
28692   * Internal dependencies
28693   */
28694  
28695  
28696  
28697  /**
28698   * Renders the UI for adding a comment in the Gutenberg editor's collaboration sidebar.
28699   *
28700   * @param {Object}   props                     - The component props.
28701   * @param {Function} props.onSubmit            - A callback function to be called when the user submits a comment.
28702   * @param {boolean}  props.showCommentBoard    - The function to edit the comment.
28703   * @param {Function} props.setShowCommentBoard - The function to delete the comment.
28704   * @return {React.ReactNode} The rendered comment input UI.
28705   */
28706  
28707  function AddComment({
28708    onSubmit,
28709    showCommentBoard,
28710    setShowCommentBoard
28711  }) {
28712    const {
28713      clientId,
28714      blockCommentId
28715    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
28716      const {
28717        getSelectedBlock
28718      } = select(external_wp_blockEditor_namespaceObject.store);
28719      const selectedBlock = getSelectedBlock();
28720      return {
28721        clientId: selectedBlock?.clientId,
28722        blockCommentId: selectedBlock?.attributes?.blockCommentId
28723      };
28724    });
28725    if (!showCommentBoard || !clientId || undefined !== blockCommentId) {
28726      return null;
28727    }
28728    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
28729      spacing: "3",
28730      className: "editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread editor-collab-sidebar-panel__focus-thread",
28731      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, {
28732        alignment: "left",
28733        spacing: "3",
28734        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(comment_author_info, {})
28735      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(comment_form, {
28736        onSubmit: inputComment => {
28737          onSubmit(inputComment);
28738        },
28739        onCancel: () => {
28740          setShowCommentBoard(false);
28741        },
28742        submitButtonText: (0,external_wp_i18n_namespaceObject._x)('Comment', 'Add comment button')
28743      })]
28744    });
28745  }
28746  
28747  ;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/comment-button.js
28748  /**
28749   * WordPress dependencies
28750   */
28751  
28752  
28753  
28754  
28755  
28756  /**
28757   * Internal dependencies
28758   */
28759  
28760  
28761  const {
28762    CommentIconSlotFill
28763  } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
28764  const AddCommentButton = ({
28765    onClick
28766  }) => {
28767    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentIconSlotFill.Fill, {
28768      children: ({
28769        onClose
28770      }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
28771        icon: library_comment,
28772        onClick: () => {
28773          onClick();
28774          onClose();
28775        },
28776        "aria-haspopup": "dialog",
28777        children: (0,external_wp_i18n_namespaceObject._x)('Comment', 'Add comment button')
28778      })
28779    });
28780  };
28781  /* harmony default export */ const comment_button = (AddCommentButton);
28782  
28783  ;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/comment-button-toolbar.js
28784  /**
28785   * WordPress dependencies
28786   */
28787  
28788  
28789  
28790  
28791  
28792  /**
28793   * Internal dependencies
28794   */
28795  
28796  
28797  const {
28798    CommentIconToolbarSlotFill
28799  } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
28800  const AddCommentToolbarButton = ({
28801    onClick
28802  }) => {
28803    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentIconToolbarSlotFill.Fill, {
28804      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
28805        accessibleWhenDisabled: true,
28806        icon: library_comment,
28807        label: (0,external_wp_i18n_namespaceObject._x)('Comment', 'View comment'),
28808        onClick: onClick
28809      })
28810    });
28811  };
28812  /* harmony default export */ const comment_button_toolbar = (AddCommentToolbarButton);
28813  
28814  ;// ./node_modules/@wordpress/editor/build-module/components/collab-sidebar/index.js
28815  /**
28816   * WordPress dependencies
28817   */
28818  
28819  
28820  
28821  
28822  
28823  
28824  
28825  
28826  
28827  
28828  /**
28829   * Internal dependencies
28830   */
28831  
28832  
28833  
28834  
28835  
28836  
28837  
28838  
28839  
28840  
28841  const modifyBlockCommentAttributes = settings => {
28842    if (!settings.attributes.blockCommentId) {
28843      settings.attributes = {
28844        ...settings.attributes,
28845        blockCommentId: {
28846          type: 'number'
28847        }
28848      };
28849    }
28850    return settings;
28851  };
28852  
28853  // Apply the filter to all core blocks
28854  (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'block-comment/modify-core-block-attributes', modifyBlockCommentAttributes);
28855  function CollabSidebarContent({
28856    showCommentBoard,
28857    setShowCommentBoard,
28858    styles,
28859    comments
28860  }) {
28861    const {
28862      createNotice
28863    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
28864    const {
28865      saveEntityRecord,
28866      deleteEntityRecord
28867    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
28868    const {
28869      getEntityRecord
28870    } = (0,external_wp_data_namespaceObject.resolveSelect)(external_wp_coreData_namespaceObject.store);
28871    const {
28872      postId
28873    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
28874      const {
28875        getCurrentPostId
28876      } = select(store_store);
28877      const _postId = getCurrentPostId();
28878      return {
28879        postId: _postId
28880      };
28881    }, []);
28882    const {
28883      getSelectedBlockClientId
28884    } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
28885    const {
28886      updateBlockAttributes
28887    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
28888  
28889    // Function to save the comment.
28890    const addNewComment = async (comment, parentCommentId) => {
28891      const args = {
28892        post: postId,
28893        content: comment,
28894        comment_type: 'block_comment',
28895        comment_approved: 0
28896      };
28897  
28898      // Create a new object, conditionally including the parent property
28899      const updatedArgs = {
28900        ...args,
28901        ...(parentCommentId ? {
28902          parent: parentCommentId
28903        } : {})
28904      };
28905      const savedRecord = await saveEntityRecord('root', 'comment', updatedArgs);
28906      if (savedRecord) {
28907        // If it's a main comment, update the block attributes with the comment id.
28908        if (!parentCommentId) {
28909          updateBlockAttributes(getSelectedBlockClientId(), {
28910            blockCommentId: savedRecord?.id
28911          });
28912        }
28913        createNotice('snackbar', parentCommentId ?
28914        // translators: Reply added successfully
28915        (0,external_wp_i18n_namespaceObject.__)('Reply added successfully.') :
28916        // translators: Comment added successfully
28917        (0,external_wp_i18n_namespaceObject.__)('Comment added successfully.'), {
28918          type: 'snackbar',
28919          isDismissible: true
28920        });
28921      } else {
28922        onError();
28923      }
28924    };
28925    const onCommentResolve = async commentId => {
28926      const savedRecord = await saveEntityRecord('root', 'comment', {
28927        id: commentId,
28928        status: 'approved'
28929      });
28930      if (savedRecord) {
28931        // translators: Comment resolved successfully
28932        createNotice('snackbar', (0,external_wp_i18n_namespaceObject.__)('Comment marked as resolved.'), {
28933          type: 'snackbar',
28934          isDismissible: true
28935        });
28936      } else {
28937        onError();
28938      }
28939    };
28940    const onEditComment = async (commentId, comment) => {
28941      const savedRecord = await saveEntityRecord('root', 'comment', {
28942        id: commentId,
28943        content: comment
28944      });
28945      if (savedRecord) {
28946        createNotice('snackbar',
28947        // translators: Comment edited successfully
28948        (0,external_wp_i18n_namespaceObject.__)('Comment edited successfully.'), {
28949          type: 'snackbar',
28950          isDismissible: true
28951        });
28952      } else {
28953        onError();
28954      }
28955    };
28956    const onError = () => {
28957      createNotice('error',
28958      // translators: Error message when comment submission fails
28959      (0,external_wp_i18n_namespaceObject.__)('Something went wrong. Please try publishing the post, or you may have already submitted your comment earlier.'), {
28960        isDismissible: true
28961      });
28962    };
28963    const onCommentDelete = async commentId => {
28964      const childComment = await getEntityRecord('root', 'comment', commentId);
28965      await deleteEntityRecord('root', 'comment', commentId);
28966      if (childComment && !childComment.parent) {
28967        updateBlockAttributes(getSelectedBlockClientId(), {
28968          blockCommentId: undefined
28969        });
28970      }
28971      createNotice('snackbar',
28972      // translators: Comment deleted successfully
28973      (0,external_wp_i18n_namespaceObject.__)('Comment deleted successfully.'), {
28974        type: 'snackbar',
28975        isDismissible: true
28976      });
28977    };
28978    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
28979      className: "editor-collab-sidebar-panel",
28980      style: styles,
28981      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AddComment, {
28982        onSubmit: addNewComment,
28983        showCommentBoard: showCommentBoard,
28984        setShowCommentBoard: setShowCommentBoard
28985      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Comments, {
28986        threads: comments,
28987        onEditComment: onEditComment,
28988        onAddReply: addNewComment,
28989        onCommentDelete: onCommentDelete,
28990        onCommentResolve: onCommentResolve,
28991        showCommentBoard: showCommentBoard,
28992        setShowCommentBoard: setShowCommentBoard
28993      }, getSelectedBlockClientId())]
28994    });
28995  }
28996  
28997  /**
28998   * Renders the Collab sidebar.
28999   */
29000  function CollabSidebar() {
29001    const [showCommentBoard, setShowCommentBoard] = (0,external_wp_element_namespaceObject.useState)(false);
29002    const {
29003      enableComplementaryArea
29004    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
29005    const {
29006      getActiveComplementaryArea
29007    } = (0,external_wp_data_namespaceObject.useSelect)(store);
29008    const {
29009      postId,
29010      postType,
29011      postStatus,
29012      threads
29013    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
29014      const {
29015        getCurrentPostId,
29016        getCurrentPostType
29017      } = select(store_store);
29018      const _postId = getCurrentPostId();
29019      const data = !!_postId && typeof _postId === 'number' ? select(external_wp_coreData_namespaceObject.store).getEntityRecords('root', 'comment', {
29020        post: _postId,
29021        type: 'block_comment',
29022        status: 'any',
29023        per_page: 100
29024      }) : null;
29025      return {
29026        postId: _postId,
29027        postType: getCurrentPostType(),
29028        postStatus: select(store_store).getEditedPostAttribute('status'),
29029        threads: data
29030      };
29031    }, []);
29032    const {
29033      blockCommentId
29034    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
29035      const {
29036        getBlockAttributes,
29037        getSelectedBlockClientId
29038      } = select(external_wp_blockEditor_namespaceObject.store);
29039      const _clientId = getSelectedBlockClientId();
29040      return {
29041        blockCommentId: _clientId ? getBlockAttributes(_clientId)?.blockCommentId : null
29042      };
29043    }, []);
29044    const openCollabBoard = () => {
29045      setShowCommentBoard(true);
29046      enableComplementaryArea('core', 'edit-post/collab-sidebar');
29047    };
29048    const [blocks] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType, {
29049      id: postId
29050    });
29051  
29052    // Process comments to build the tree structure
29053    const {
29054      resultComments,
29055      sortedThreads
29056    } = (0,external_wp_element_namespaceObject.useMemo)(() => {
29057      // Create a compare to store the references to all objects by id
29058      const compare = {};
29059      const result = [];
29060      const filteredComments = (threads !== null && threads !== void 0 ? threads : []).filter(comment => comment.status !== 'trash');
29061  
29062      // Initialize each object with an empty `reply` array
29063      filteredComments.forEach(item => {
29064        compare[item.id] = {
29065          ...item,
29066          reply: []
29067        };
29068      });
29069  
29070      // Iterate over the data to build the tree structure
29071      filteredComments.forEach(item => {
29072        if (item.parent === 0) {
29073          // If parent is 0, it's a root item, push it to the result array
29074          result.push(compare[item.id]);
29075        } else if (compare[item.parent]) {
29076          // Otherwise, find its parent and push it to the parent's `reply` array
29077          compare[item.parent].reply.push(compare[item.id]);
29078        }
29079      });
29080      if (0 === result?.length) {
29081        return {
29082          resultComments: [],
29083          sortedThreads: []
29084        };
29085      }
29086      const updatedResult = result.map(item => ({
29087        ...item,
29088        reply: [...item.reply].reverse()
29089      }));
29090      const blockCommentIds = getCommentIdsFromBlocks(blocks);
29091      const threadIdMap = new Map(updatedResult.map(thread => [thread.id, thread]));
29092      const sortedComments = blockCommentIds.map(id => threadIdMap.get(id)).filter(thread => thread !== undefined);
29093      return {
29094        resultComments: updatedResult,
29095        sortedThreads: sortedComments
29096      };
29097    }, [threads, blocks]);
29098  
29099    // Get the global styles to set the background color of the sidebar.
29100    const {
29101      merged: GlobalStyles
29102    } = useGlobalStylesContext();
29103    const backgroundColor = GlobalStyles?.styles?.color?.background;
29104    if (0 < resultComments.length) {
29105      const unsubscribe = (0,external_wp_data_namespaceObject.subscribe)(() => {
29106        const activeSidebar = getActiveComplementaryArea('core');
29107        if (!activeSidebar) {
29108          enableComplementaryArea('core', collabSidebarName);
29109          unsubscribe();
29110        }
29111      });
29112    }
29113    if (postStatus === 'publish') {
29114      return null; // or maybe return some message indicating no threads are available.
29115    }
29116    const AddCommentComponent = blockCommentId ? comment_button_toolbar : comment_button;
29117    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
29118      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AddCommentComponent, {
29119        onClick: openCollabBoard
29120      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PluginSidebar, {
29121        identifier: collabHistorySidebarName
29122        // translators: Comments sidebar title
29123        ,
29124        title: (0,external_wp_i18n_namespaceObject.__)('Comments'),
29125        icon: library_comment,
29126        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CollabSidebarContent, {
29127          comments: resultComments,
29128          showCommentBoard: showCommentBoard,
29129          setShowCommentBoard: setShowCommentBoard
29130        })
29131      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PluginSidebar, {
29132        isPinnable: false,
29133        header: false,
29134        identifier: collabSidebarName,
29135        className: "editor-collab-sidebar",
29136        headerClassName: "editor-collab-sidebar__header",
29137        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CollabSidebarContent, {
29138          comments: sortedThreads,
29139          showCommentBoard: showCommentBoard,
29140          setShowCommentBoard: setShowCommentBoard,
29141          styles: {
29142            backgroundColor
29143          }
29144        })
29145      })]
29146    });
29147  }
29148  
29149  ;// ./node_modules/@wordpress/icons/build-module/library/next.js
29150  /**
29151   * WordPress dependencies
29152   */
29153  
29154  
29155  const next = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
29156    xmlns: "http://www.w3.org/2000/svg",
29157    viewBox: "0 0 24 24",
29158    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
29159      d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"
29160    })
29161  });
29162  /* harmony default export */ const library_next = (next);
29163  
29164  ;// ./node_modules/@wordpress/icons/build-module/library/previous.js
29165  /**
29166   * WordPress dependencies
29167   */
29168  
29169  
29170  const previous = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
29171    xmlns: "http://www.w3.org/2000/svg",
29172    viewBox: "0 0 24 24",
29173    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
29174      d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"
29175    })
29176  });
29177  /* harmony default export */ const library_previous = (previous);
29178  
29179  ;// ./node_modules/@wordpress/editor/build-module/components/collapsible-block-toolbar/index.js
29180  /**
29181   * External dependencies
29182   */
29183  
29184  
29185  /**
29186   * WordPress dependencies
29187   */
29188  
29189  
29190  
29191  
29192  
29193  
29194  
29195  /**
29196   * Internal dependencies
29197   */
29198  
29199  
29200  const {
29201    useHasBlockToolbar
29202  } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
29203  function CollapsibleBlockToolbar({
29204    isCollapsed,
29205    onToggle
29206  }) {
29207    const {
29208      blockSelectionStart
29209    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
29210      return {
29211        blockSelectionStart: select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart()
29212      };
29213    }, []);
29214    const hasBlockToolbar = useHasBlockToolbar();
29215    const hasBlockSelection = !!blockSelectionStart;
29216    (0,external_wp_element_namespaceObject.useEffect)(() => {
29217      // If we have a new block selection, show the block tools
29218      if (blockSelectionStart) {
29219        onToggle(false);
29220      }
29221    }, [blockSelectionStart, onToggle]);
29222    if (!hasBlockToolbar) {
29223      return null;
29224    }
29225    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
29226      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
29227        className: dist_clsx('editor-collapsible-block-toolbar', {
29228          'is-collapsed': isCollapsed || !hasBlockSelection
29229        }),
29230        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockToolbar, {
29231          hideDragHandle: true
29232        })
29233      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover.Slot, {
29234        name: "block-toolbar"
29235      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
29236        className: "editor-collapsible-block-toolbar__toggle",
29237        icon: isCollapsed ? library_next : library_previous,
29238        onClick: () => {
29239          onToggle(!isCollapsed);
29240        },
29241        label: isCollapsed ? (0,external_wp_i18n_namespaceObject.__)('Show block tools') : (0,external_wp_i18n_namespaceObject.__)('Hide block tools'),
29242        size: "compact"
29243      })]
29244    });
29245  }
29246  
29247  ;// ./node_modules/@wordpress/icons/build-module/library/plus.js
29248  /**
29249   * WordPress dependencies
29250   */
29251  
29252  
29253  const plus = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
29254    xmlns: "http://www.w3.org/2000/svg",
29255    viewBox: "0 0 24 24",
29256    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
29257      d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"
29258    })
29259  });
29260  /* harmony default export */ const library_plus = (plus);
29261  
29262  ;// ./node_modules/@wordpress/editor/build-module/components/document-tools/index.js
29263  /**
29264   * External dependencies
29265   */
29266  
29267  
29268  /**
29269   * WordPress dependencies
29270   */
29271  
29272  
29273  
29274  
29275  
29276  
29277  
29278  
29279  
29280  
29281  /**
29282   * Internal dependencies
29283   */
29284  
29285  
29286  
29287  
29288  
29289  function DocumentTools({
29290    className,
29291    disableBlockTools = false
29292  }) {
29293    const {
29294      setIsInserterOpened,
29295      setIsListViewOpened
29296    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
29297    const {
29298      isDistractionFree,
29299      isInserterOpened,
29300      isListViewOpen,
29301      listViewShortcut,
29302      inserterSidebarToggleRef,
29303      listViewToggleRef,
29304      showIconLabels,
29305      showTools
29306    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
29307      const {
29308        get
29309      } = select(external_wp_preferences_namespaceObject.store);
29310      const {
29311        isListViewOpened,
29312        getEditorMode,
29313        getInserterSidebarToggleRef,
29314        getListViewToggleRef,
29315        getRenderingMode,
29316        getCurrentPostType
29317      } = unlock(select(store_store));
29318      const {
29319        getShortcutRepresentation
29320      } = select(external_wp_keyboardShortcuts_namespaceObject.store);
29321      return {
29322        isInserterOpened: select(store_store).isInserterOpened(),
29323        isListViewOpen: isListViewOpened(),
29324        listViewShortcut: getShortcutRepresentation('core/editor/toggle-list-view'),
29325        inserterSidebarToggleRef: getInserterSidebarToggleRef(),
29326        listViewToggleRef: getListViewToggleRef(),
29327        showIconLabels: get('core', 'showIconLabels'),
29328        isDistractionFree: get('core', 'distractionFree'),
29329        isVisualMode: getEditorMode() === 'visual',
29330        showTools: !!window?.__experimentalEditorWriteMode && (getRenderingMode() !== 'post-only' || getCurrentPostType() === 'wp_template')
29331      };
29332    }, []);
29333    const preventDefault = event => {
29334      // Because the inserter behaves like a dialog,
29335      // if the inserter is opened already then when we click on the toggle button
29336      // then the initial click event will close the inserter and then be propagated
29337      // to the inserter toggle and it will open it again.
29338      // To prevent this we need to stop the propagation of the event.
29339      // This won't be necessary when the inserter no longer behaves like a dialog.
29340  
29341      if (isInserterOpened) {
29342        event.preventDefault();
29343      }
29344    };
29345    const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
29346    const isWideViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('wide');
29347  
29348    /* translators: accessibility text for the editor toolbar */
29349    const toolbarAriaLabel = (0,external_wp_i18n_namespaceObject.__)('Document tools');
29350    const toggleListView = (0,external_wp_element_namespaceObject.useCallback)(() => setIsListViewOpened(!isListViewOpen), [setIsListViewOpened, isListViewOpen]);
29351    const toggleInserter = (0,external_wp_element_namespaceObject.useCallback)(() => setIsInserterOpened(!isInserterOpened), [isInserterOpened, setIsInserterOpened]);
29352  
29353    /* translators: button label text should, if possible, be under 16 characters. */
29354    const longLabel = (0,external_wp_i18n_namespaceObject._x)('Block Inserter', 'Generic label for block inserter button');
29355    const shortLabel = !isInserterOpened ? (0,external_wp_i18n_namespaceObject.__)('Add') : (0,external_wp_i18n_namespaceObject.__)('Close');
29356    return (
29357      /*#__PURE__*/
29358      // Some plugins expect and use the `edit-post-header-toolbar` CSS class to
29359      // find the toolbar and inject UI elements into it. This is not officially
29360      // supported, but we're keeping it in the list of class names for backwards
29361      // compatibility.
29362      (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.NavigableToolbar, {
29363        className: dist_clsx('editor-document-tools', 'edit-post-header-toolbar', className),
29364        "aria-label": toolbarAriaLabel,
29365        variant: "unstyled",
29366        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
29367          className: "editor-document-tools__left",
29368          children: [!isDistractionFree && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
29369            ref: inserterSidebarToggleRef,
29370            className: "editor-document-tools__inserter-toggle",
29371            variant: "primary",
29372            isPressed: isInserterOpened,
29373            onMouseDown: preventDefault,
29374            onClick: toggleInserter,
29375            disabled: disableBlockTools,
29376            icon: library_plus,
29377            label: showIconLabels ? shortLabel : longLabel,
29378            showTooltip: !showIconLabels,
29379            "aria-expanded": isInserterOpened
29380          }), (isWideViewport || !showIconLabels) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
29381            children: [showTools && isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, {
29382              as: external_wp_blockEditor_namespaceObject.ToolSelector,
29383              showTooltip: !showIconLabels,
29384              variant: showIconLabels ? 'tertiary' : undefined,
29385              disabled: disableBlockTools,
29386              size: "compact"
29387            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, {
29388              as: editor_history_undo,
29389              showTooltip: !showIconLabels,
29390              variant: showIconLabels ? 'tertiary' : undefined,
29391              size: "compact"
29392            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, {
29393              as: editor_history_redo,
29394              showTooltip: !showIconLabels,
29395              variant: showIconLabels ? 'tertiary' : undefined,
29396              size: "compact"
29397            }), !isDistractionFree && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
29398              className: "editor-document-tools__document-overview-toggle",
29399              icon: list_view,
29400              disabled: disableBlockTools,
29401              isPressed: isListViewOpen
29402              /* translators: button label text should, if possible, be under 16 characters. */,
29403              label: (0,external_wp_i18n_namespaceObject.__)('Document Overview'),
29404              onClick: toggleListView,
29405              shortcut: listViewShortcut,
29406              showTooltip: !showIconLabels,
29407              variant: showIconLabels ? 'tertiary' : undefined,
29408              "aria-expanded": isListViewOpen,
29409              ref: listViewToggleRef
29410            })]
29411          })]
29412        })
29413      })
29414    );
29415  }
29416  /* harmony default export */ const document_tools = (DocumentTools);
29417  
29418  ;// ./node_modules/@wordpress/editor/build-module/components/more-menu/copy-content-menu-item.js
29419  /**
29420   * WordPress dependencies
29421   */
29422  
29423  
29424  
29425  
29426  
29427  
29428  
29429  
29430  /**
29431   * Internal dependencies
29432   */
29433  
29434  
29435  function CopyContentMenuItem() {
29436    const {
29437      createNotice
29438    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
29439    const {
29440      getCurrentPostId,
29441      getCurrentPostType
29442    } = (0,external_wp_data_namespaceObject.useSelect)(store_store);
29443    const {
29444      getEditedEntityRecord
29445    } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store);
29446    function getText() {
29447      const record = getEditedEntityRecord('postType', getCurrentPostType(), getCurrentPostId());
29448      if (!record) {
29449        return '';
29450      }
29451      if (typeof record.content === 'function') {
29452        return record.content(record);
29453      } else if (record.blocks) {
29454        return (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(record.blocks);
29455      } else if (record.content) {
29456        return record.content;
29457      }
29458    }
29459    function onSuccess() {
29460      createNotice('info', (0,external_wp_i18n_namespaceObject.__)('All content copied.'), {
29461        isDismissible: true,
29462        type: 'snackbar'
29463      });
29464    }
29465    const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(getText, onSuccess);
29466    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
29467      ref: ref,
29468      children: (0,external_wp_i18n_namespaceObject.__)('Copy all blocks')
29469    });
29470  }
29471  
29472  ;// ./node_modules/@wordpress/editor/build-module/components/mode-switcher/index.js
29473  /**
29474   * WordPress dependencies
29475   */
29476  
29477  
29478  
29479  
29480  
29481  /**
29482   * Internal dependencies
29483   */
29484  
29485  
29486  /**
29487   * Set of available mode options.
29488   *
29489   * @type {Array}
29490   */
29491  
29492  const MODES = [{
29493    value: 'visual',
29494    label: (0,external_wp_i18n_namespaceObject.__)('Visual editor')
29495  }, {
29496    value: 'text',
29497    label: (0,external_wp_i18n_namespaceObject.__)('Code editor')
29498  }];
29499  function ModeSwitcher() {
29500    const {
29501      shortcut,
29502      isRichEditingEnabled,
29503      isCodeEditingEnabled,
29504      mode
29505    } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
29506      shortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getShortcutRepresentation('core/editor/toggle-mode'),
29507      isRichEditingEnabled: select(store_store).getEditorSettings().richEditingEnabled,
29508      isCodeEditingEnabled: select(store_store).getEditorSettings().codeEditingEnabled,
29509      mode: select(store_store).getEditorMode()
29510    }), []);
29511    const {
29512      switchEditorMode
29513    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
29514    let selectedMode = mode;
29515    if (!isRichEditingEnabled && mode === 'visual') {
29516      selectedMode = 'text';
29517    }
29518    if (!isCodeEditingEnabled && mode === 'text') {
29519      selectedMode = 'visual';
29520    }
29521    const choices = MODES.map(choice => {
29522      if (!isCodeEditingEnabled && choice.value === 'text') {
29523        choice = {
29524          ...choice,
29525          disabled: true
29526        };
29527      }
29528      if (!isRichEditingEnabled && choice.value === 'visual') {
29529        choice = {
29530          ...choice,
29531          disabled: true,
29532          info: (0,external_wp_i18n_namespaceObject.__)('You can enable the visual editor in your profile settings.')
29533        };
29534      }
29535      if (choice.value !== selectedMode && !choice.disabled) {
29536        return {
29537          ...choice,
29538          shortcut
29539        };
29540      }
29541      return choice;
29542    });
29543    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, {
29544      label: (0,external_wp_i18n_namespaceObject.__)('Editor'),
29545      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItemsChoice, {
29546        choices: choices,
29547        value: selectedMode,
29548        onSelect: switchEditorMode
29549      })
29550    });
29551  }
29552  /* harmony default export */ const mode_switcher = (ModeSwitcher);
29553  
29554  ;// ./node_modules/@wordpress/editor/build-module/components/more-menu/tools-more-menu-group.js
29555  /**
29556   * WordPress dependencies
29557   */
29558  
29559  
29560  const {
29561    Fill: ToolsMoreMenuGroup,
29562    Slot: tools_more_menu_group_Slot
29563  } = (0,external_wp_components_namespaceObject.createSlotFill)('ToolsMoreMenuGroup');
29564  ToolsMoreMenuGroup.Slot = ({
29565    fillProps
29566  }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tools_more_menu_group_Slot, {
29567    fillProps: fillProps
29568  });
29569  /* harmony default export */ const tools_more_menu_group = (ToolsMoreMenuGroup);
29570  
29571  ;// ./node_modules/@wordpress/editor/build-module/components/more-menu/view-more-menu-group.js
29572  /**
29573   * WordPress dependencies
29574   */
29575  
29576  
29577  
29578  const {
29579    Fill: ViewMoreMenuGroup,
29580    Slot: view_more_menu_group_Slot
29581  } = (0,external_wp_components_namespaceObject.createSlotFill)(external_wp_element_namespaceObject.Platform.OS === 'web' ? Symbol('ViewMoreMenuGroup') : 'ViewMoreMenuGroup');
29582  ViewMoreMenuGroup.Slot = ({
29583    fillProps
29584  }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_more_menu_group_Slot, {
29585    fillProps: fillProps
29586  });
29587  /* harmony default export */ const view_more_menu_group = (ViewMoreMenuGroup);
29588  
29589  ;// ./node_modules/@wordpress/editor/build-module/components/more-menu/index.js
29590  /**
29591   * WordPress dependencies
29592   */
29593  
29594  
29595  
29596  
29597  
29598  
29599  
29600  
29601  /**
29602   * Internal dependencies
29603   */
29604  
29605  
29606  
29607  
29608  
29609  
29610  function MoreMenu() {
29611    const {
29612      openModal
29613    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
29614    const {
29615      set: setPreference
29616    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
29617    const {
29618      toggleDistractionFree
29619    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
29620    const showIconLabels = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_preferences_namespaceObject.store).get('core', 'showIconLabels'), []);
29621    const turnOffDistractionFree = () => {
29622      setPreference('core', 'distractionFree', false);
29623    };
29624    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
29625      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, {
29626        icon: more_vertical,
29627        label: (0,external_wp_i18n_namespaceObject.__)('Options'),
29628        popoverProps: {
29629          placement: 'bottom-end',
29630          className: 'more-menu-dropdown__content'
29631        },
29632        toggleProps: {
29633          showTooltip: !showIconLabels,
29634          ...(showIconLabels && {
29635            variant: 'tertiary'
29636          }),
29637          tooltipPosition: 'bottom',
29638          size: 'compact'
29639        },
29640        children: ({
29641          onClose
29642        }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
29643          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, {
29644            label: (0,external_wp_i18n_namespaceObject._x)('View', 'noun'),
29645            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
29646              scope: "core",
29647              name: "fixedToolbar",
29648              onToggle: turnOffDistractionFree,
29649              label: (0,external_wp_i18n_namespaceObject.__)('Top toolbar'),
29650              info: (0,external_wp_i18n_namespaceObject.__)('Access all block and document tools in a single place'),
29651              messageActivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar activated.'),
29652              messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar deactivated.')
29653            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
29654              scope: "core",
29655              name: "distractionFree",
29656              label: (0,external_wp_i18n_namespaceObject.__)('Distraction free'),
29657              info: (0,external_wp_i18n_namespaceObject.__)('Write with calmness'),
29658              handleToggling: false,
29659              onToggle: () => toggleDistractionFree({
29660                createNotice: false
29661              }),
29662              messageActivated: (0,external_wp_i18n_namespaceObject.__)('Distraction free mode activated.'),
29663              messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Distraction free mode deactivated.'),
29664              shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('\\')
29665            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
29666              scope: "core",
29667              name: "focusMode",
29668              label: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode'),
29669              info: (0,external_wp_i18n_namespaceObject.__)('Focus on one block at a time'),
29670              messageActivated: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode activated.'),
29671              messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode deactivated.')
29672            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_more_menu_group.Slot, {
29673              fillProps: {
29674                onClose
29675              }
29676            })]
29677          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(mode_switcher, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action_item.Slot, {
29678            name: "core/plugin-more-menu",
29679            label: (0,external_wp_i18n_namespaceObject.__)('Plugins'),
29680            fillProps: {
29681              onClick: onClose
29682            }
29683          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, {
29684            label: (0,external_wp_i18n_namespaceObject.__)('Tools'),
29685            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
29686              onClick: () => openModal('editor/keyboard-shortcut-help'),
29687              shortcut: external_wp_keycodes_namespaceObject.displayShortcut.access('h'),
29688              children: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts')
29689            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyContentMenuItem, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuItem, {
29690              icon: library_external,
29691              href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/wordpress-block-editor/'),
29692              target: "_blank",
29693              rel: "noopener noreferrer",
29694              children: [(0,external_wp_i18n_namespaceObject.__)('Help'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
29695                as: "span",
29696                children: /* translators: accessibility text */
29697                (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)')
29698              })]
29699            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tools_more_menu_group.Slot, {
29700              fillProps: {
29701                onClose
29702              }
29703            })]
29704          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, {
29705            children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
29706              onClick: () => openModal('editor/preferences'),
29707              children: (0,external_wp_i18n_namespaceObject.__)('Preferences')
29708            })
29709          })]
29710        })
29711      })
29712    });
29713  }
29714  
29715  ;// ./node_modules/@wordpress/editor/build-module/components/post-publish-button/post-publish-button-or-toggle.js
29716  /**
29717   * WordPress dependencies
29718   */
29719  
29720  
29721  
29722  /**
29723   * Internal dependencies
29724   */
29725  
29726  
29727  
29728  const IS_TOGGLE = 'toggle';
29729  const IS_BUTTON = 'button';
29730  function PostPublishButtonOrToggle({
29731    forceIsDirty,
29732    setEntitiesSavedStatesCallback
29733  }) {
29734    let component;
29735    const isSmallerThanMediumViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
29736    const {
29737      togglePublishSidebar
29738    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
29739    const {
29740      hasPublishAction,
29741      isBeingScheduled,
29742      isPending,
29743      isPublished,
29744      isPublishSidebarEnabled,
29745      isPublishSidebarOpened,
29746      isScheduled,
29747      postStatus,
29748      postStatusHasChanged
29749    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
29750      var _select$getCurrentPos;
29751      return {
29752        hasPublishAction: (_select$getCurrentPos = !!select(store_store).getCurrentPost()?._links?.['wp:action-publish']) !== null && _select$getCurrentPos !== void 0 ? _select$getCurrentPos : false,
29753        isBeingScheduled: select(store_store).isEditedPostBeingScheduled(),
29754        isPending: select(store_store).isCurrentPostPending(),
29755        isPublished: select(store_store).isCurrentPostPublished(),
29756        isPublishSidebarEnabled: select(store_store).isPublishSidebarEnabled(),
29757        isPublishSidebarOpened: select(store_store).isPublishSidebarOpened(),
29758        isScheduled: select(store_store).isCurrentPostScheduled(),
29759        postStatus: select(store_store).getEditedPostAttribute('status'),
29760        postStatusHasChanged: select(store_store).getPostEdits()?.status
29761      };
29762    }, []);
29763  
29764    /**
29765     * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):
29766     *
29767     * 1) We want to show a BUTTON when the post status is at the _final stage_
29768     * for a particular role (see https://wordpress.org/documentation/article/post-status/):
29769     *
29770     * - is published
29771     * - post status has changed explicitly to something different than 'future' or 'publish'
29772     * - is scheduled to be published
29773     * - is pending and can't be published (but only for viewports >= medium).
29774     *      Originally, we considered showing a button for pending posts that couldn't be published
29775     *      (for example, for an author with the contributor role). Some languages can have
29776     *      long translations for "Submit for review", so given the lack of UI real estate available
29777     *      we decided to take into account the viewport in that case.
29778     *       See: https://github.com/WordPress/gutenberg/issues/10475
29779     *
29780     * 2) Then, in small viewports, we'll show a TOGGLE.
29781     *
29782     * 3) Finally, we'll use the publish sidebar status to decide:
29783     *
29784     * - if it is enabled, we show a TOGGLE
29785     * - if it is disabled, we show a BUTTON
29786     */
29787    if (isPublished || postStatusHasChanged && !['future', 'publish'].includes(postStatus) || isScheduled && isBeingScheduled || isPending && !hasPublishAction && !isSmallerThanMediumViewport) {
29788      component = IS_BUTTON;
29789    } else if (isSmallerThanMediumViewport || isPublishSidebarEnabled) {
29790      component = IS_TOGGLE;
29791    } else {
29792      component = IS_BUTTON;
29793    }
29794    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_publish_button, {
29795      forceIsDirty: forceIsDirty,
29796      isOpen: isPublishSidebarOpened,
29797      isToggle: component === IS_TOGGLE,
29798      onToggle: togglePublishSidebar,
29799      setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
29800    });
29801  }
29802  
29803  ;// ./node_modules/@wordpress/editor/build-module/components/post-view-link/index.js
29804  /**
29805   * WordPress dependencies
29806   */
29807  
29808  
29809  
29810  
29811  
29812  
29813  
29814  /**
29815   * Internal dependencies
29816   */
29817  
29818  
29819  function PostViewLink() {
29820    const {
29821      hasLoaded,
29822      permalink,
29823      isPublished,
29824      label,
29825      showIconLabels
29826    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
29827      // Grab post type to retrieve the view_item label.
29828      const postTypeSlug = select(store_store).getCurrentPostType();
29829      const postType = select(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug);
29830      const {
29831        get
29832      } = select(external_wp_preferences_namespaceObject.store);
29833      return {
29834        permalink: select(store_store).getPermalink(),
29835        isPublished: select(store_store).isCurrentPostPublished(),
29836        label: postType?.labels.view_item,
29837        hasLoaded: !!postType,
29838        showIconLabels: get('core', 'showIconLabels')
29839      };
29840    }, []);
29841  
29842    // Only render the view button if the post is published and has a permalink.
29843    if (!isPublished || !permalink || !hasLoaded) {
29844      return null;
29845    }
29846    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
29847      icon: library_external,
29848      label: label || (0,external_wp_i18n_namespaceObject.__)('View post'),
29849      href: permalink,
29850      target: "_blank",
29851      showTooltip: !showIconLabels,
29852      size: "compact"
29853    });
29854  }
29855  
29856  ;// ./node_modules/@wordpress/icons/build-module/library/desktop.js
29857  /**
29858   * WordPress dependencies
29859   */
29860  
29861  
29862  const desktop = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
29863    xmlns: "http://www.w3.org/2000/svg",
29864    viewBox: "0 0 24 24",
29865    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
29866      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"
29867    })
29868  });
29869  /* harmony default export */ const library_desktop = (desktop);
29870  
29871  ;// ./node_modules/@wordpress/icons/build-module/library/mobile.js
29872  /**
29873   * WordPress dependencies
29874   */
29875  
29876  
29877  const mobile = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
29878    xmlns: "http://www.w3.org/2000/svg",
29879    viewBox: "0 0 24 24",
29880    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
29881      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"
29882    })
29883  });
29884  /* harmony default export */ const library_mobile = (mobile);
29885  
29886  ;// ./node_modules/@wordpress/icons/build-module/library/tablet.js
29887  /**
29888   * WordPress dependencies
29889   */
29890  
29891  
29892  const tablet = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
29893    xmlns: "http://www.w3.org/2000/svg",
29894    viewBox: "0 0 24 24",
29895    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
29896      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"
29897    })
29898  });
29899  /* harmony default export */ const library_tablet = (tablet);
29900  
29901  ;// ./node_modules/@wordpress/editor/build-module/components/preview-dropdown/index.js
29902  /**
29903   * External dependencies
29904   */
29905  
29906  
29907  /**
29908   * WordPress dependencies
29909   */
29910  
29911  
29912  
29913  
29914  
29915  
29916  
29917  
29918  
29919  /**
29920   * Internal dependencies
29921   */
29922  
29923  
29924  
29925  
29926  
29927  function PreviewDropdown({
29928    forceIsAutosaveable,
29929    disabled
29930  }) {
29931    const {
29932      deviceType,
29933      homeUrl,
29934      isTemplate,
29935      isViewable,
29936      showIconLabels,
29937      isTemplateHidden,
29938      templateId
29939    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
29940      var _getPostType$viewable;
29941      const {
29942        getDeviceType,
29943        getCurrentPostType,
29944        getCurrentTemplateId
29945      } = select(store_store);
29946      const {
29947        getRenderingMode
29948      } = unlock(select(store_store));
29949      const {
29950        getEntityRecord,
29951        getPostType
29952      } = select(external_wp_coreData_namespaceObject.store);
29953      const {
29954        get
29955      } = select(external_wp_preferences_namespaceObject.store);
29956      const _currentPostType = getCurrentPostType();
29957      return {
29958        deviceType: getDeviceType(),
29959        homeUrl: getEntityRecord('root', '__unstableBase')?.home,
29960        isTemplate: _currentPostType === 'wp_template',
29961        isViewable: (_getPostType$viewable = getPostType(_currentPostType)?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false,
29962        showIconLabels: get('core', 'showIconLabels'),
29963        isTemplateHidden: getRenderingMode() === 'post-only',
29964        templateId: getCurrentTemplateId()
29965      };
29966    }, []);
29967    const {
29968      setDeviceType,
29969      setRenderingMode,
29970      setDefaultRenderingMode
29971    } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
29972    const {
29973      resetZoomLevel
29974    } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store));
29975    const handleDevicePreviewChange = newDeviceType => {
29976      setDeviceType(newDeviceType);
29977      resetZoomLevel();
29978    };
29979    const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
29980    if (isMobile) {
29981      return null;
29982    }
29983    const popoverProps = {
29984      placement: 'bottom-end'
29985    };
29986    const toggleProps = {
29987      className: 'editor-preview-dropdown__toggle',
29988      iconPosition: 'right',
29989      size: 'compact',
29990      showTooltip: !showIconLabels,
29991      disabled,
29992      accessibleWhenDisabled: disabled
29993    };
29994    const menuProps = {
29995      'aria-label': (0,external_wp_i18n_namespaceObject.__)('View options')
29996    };
29997    const deviceIcons = {
29998      desktop: library_desktop,
29999      mobile: library_mobile,
30000      tablet: library_tablet
30001    };
30002  
30003    /**
30004     * The choices for the device type.
30005     *
30006     * @type {Array}
30007     */
30008    const choices = [{
30009      value: 'Desktop',
30010      label: (0,external_wp_i18n_namespaceObject.__)('Desktop'),
30011      icon: library_desktop
30012    }, {
30013      value: 'Tablet',
30014      label: (0,external_wp_i18n_namespaceObject.__)('Tablet'),
30015      icon: library_tablet
30016    }, {
30017      value: 'Mobile',
30018      label: (0,external_wp_i18n_namespaceObject.__)('Mobile'),
30019      icon: library_mobile
30020    }];
30021    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, {
30022      className: dist_clsx('editor-preview-dropdown', `editor-preview-dropdown--$deviceType.toLowerCase()}`),
30023      popoverProps: popoverProps,
30024      toggleProps: toggleProps,
30025      menuProps: menuProps,
30026      icon: deviceIcons[deviceType.toLowerCase()],
30027      label: (0,external_wp_i18n_namespaceObject.__)('View'),
30028      disableOpenOnArrowDown: disabled,
30029      children: ({
30030        onClose
30031      }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
30032        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, {
30033          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItemsChoice, {
30034            choices: choices,
30035            value: deviceType,
30036            onSelect: handleDevicePreviewChange
30037          })
30038        }), isTemplate && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, {
30039          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuItem, {
30040            href: homeUrl,
30041            target: "_blank",
30042            icon: library_external,
30043            onClick: onClose,
30044            children: [(0,external_wp_i18n_namespaceObject.__)('View site'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
30045              as: "span",
30046              children: /* translators: accessibility text */
30047              (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)')
30048            })]
30049          })
30050        }), !isTemplate && !!templateId && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, {
30051          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
30052            icon: !isTemplateHidden ? library_check : undefined,
30053            isSelected: !isTemplateHidden,
30054            role: "menuitemcheckbox",
30055            onClick: () => {
30056              const newRenderingMode = isTemplateHidden ? 'template-locked' : 'post-only';
30057              setRenderingMode(newRenderingMode);
30058              setDefaultRenderingMode(newRenderingMode);
30059            },
30060            children: (0,external_wp_i18n_namespaceObject.__)('Show template')
30061          })
30062        }), isViewable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, {
30063          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPreviewButton, {
30064            className: "editor-preview-dropdown__button-external",
30065            role: "menuitem",
30066            forceIsAutosaveable: forceIsAutosaveable,
30067            "aria-label": (0,external_wp_i18n_namespaceObject.__)('Preview in new tab'),
30068            textContent: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
30069              children: [(0,external_wp_i18n_namespaceObject.__)('Preview in new tab'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
30070                icon: library_external
30071              })]
30072            }),
30073            onPreview: onClose
30074          })
30075        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action_item.Slot, {
30076          name: "core/plugin-preview-menu",
30077          fillProps: {
30078            onClick: onClose
30079          }
30080        })]
30081      })
30082    });
30083  }
30084  
30085  ;// ./node_modules/@wordpress/icons/build-module/library/square.js
30086  /**
30087   * WordPress dependencies
30088   */
30089  
30090  
30091  const square = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
30092    xmlns: "http://www.w3.org/2000/svg",
30093    viewBox: "0 0 24 24",
30094    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
30095      fill: "none",
30096      d: "M5.75 12.75V18.25H11.25M12.75 5.75H18.25V11.25",
30097      stroke: "currentColor",
30098      strokeWidth: "1.5",
30099      strokeLinecap: "square"
30100    })
30101  });
30102  /* harmony default export */ const library_square = (square);
30103  
30104  ;// ./node_modules/@wordpress/editor/build-module/components/zoom-out-toggle/index.js
30105  /**
30106   * WordPress dependencies
30107   */
30108  
30109  
30110  
30111  
30112  
30113  
30114  
30115  
30116  
30117  
30118  /**
30119   * Internal dependencies
30120   */
30121  
30122  
30123  const ZoomOutToggle = ({
30124    disabled
30125  }) => {
30126    const {
30127      isZoomOut,
30128      showIconLabels,
30129      isDistractionFree
30130    } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
30131      isZoomOut: unlock(select(external_wp_blockEditor_namespaceObject.store)).isZoomOut(),
30132      showIconLabels: select(external_wp_preferences_namespaceObject.store).get('core', 'showIconLabels'),
30133      isDistractionFree: select(external_wp_preferences_namespaceObject.store).get('core', 'distractionFree')
30134    }));
30135    const {
30136      resetZoomLevel,
30137      setZoomLevel
30138    } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store));
30139    const {
30140      registerShortcut,
30141      unregisterShortcut
30142    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store);
30143    (0,external_wp_element_namespaceObject.useEffect)(() => {
30144      registerShortcut({
30145        name: 'core/editor/zoom',
30146        category: 'global',
30147        description: (0,external_wp_i18n_namespaceObject.__)('Enter or exit zoom out.'),
30148        keyCombination: {
30149          // `primaryShift+0` (`ctrl+shift+0`) is the shortcut for switching
30150          // to input mode in Windows, so apply a different key combination.
30151          modifier: (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? 'primaryShift' : 'secondary',
30152          character: '0'
30153        }
30154      });
30155      return () => {
30156        unregisterShortcut('core/editor/zoom');
30157      };
30158    }, [registerShortcut, unregisterShortcut]);
30159    (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/zoom', () => {
30160      if (isZoomOut) {
30161        resetZoomLevel();
30162      } else {
30163        setZoomLevel('auto-scaled');
30164      }
30165    }, {
30166      isDisabled: isDistractionFree
30167    });
30168    const handleZoomOut = () => {
30169      if (isZoomOut) {
30170        resetZoomLevel();
30171      } else {
30172        setZoomLevel('auto-scaled');
30173      }
30174    };
30175    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
30176      accessibleWhenDisabled: true,
30177      disabled: disabled,
30178      onClick: handleZoomOut,
30179      icon: library_square,
30180      label: (0,external_wp_i18n_namespaceObject.__)('Zoom Out'),
30181      isPressed: isZoomOut,
30182      size: "compact",
30183      showTooltip: !showIconLabels,
30184      className: "editor-zoom-out-toggle"
30185    });
30186  };
30187  /* harmony default export */ const zoom_out_toggle = (ZoomOutToggle);
30188  
30189  ;// ./node_modules/@wordpress/editor/build-module/components/header/index.js
30190  /**
30191   * WordPress dependencies
30192   */
30193  
30194  
30195  
30196  
30197  
30198  
30199  
30200  
30201  /**
30202   * Internal dependencies
30203   */
30204  
30205  
30206  
30207  
30208  
30209  
30210  
30211  
30212  
30213  
30214  
30215  
30216  
30217  
30218  
30219  
30220  const isBlockCommentExperimentEnabled = window?.__experimentalEnableBlockComment;
30221  const toolbarVariations = {
30222    distractionFreeDisabled: {
30223      y: '-50px'
30224    },
30225    distractionFreeHover: {
30226      y: 0
30227    },
30228    distractionFreeHidden: {
30229      y: '-50px'
30230    },
30231    visible: {
30232      y: 0
30233    },
30234    hidden: {
30235      y: 0
30236    }
30237  };
30238  const backButtonVariations = {
30239    distractionFreeDisabled: {
30240      x: '-100%'
30241    },
30242    distractionFreeHover: {
30243      x: 0
30244    },
30245    distractionFreeHidden: {
30246      x: '-100%'
30247    },
30248    visible: {
30249      x: 0
30250    },
30251    hidden: {
30252      x: 0
30253    }
30254  };
30255  function header_Header({
30256    customSaveButton,
30257    forceIsDirty,
30258    forceDisableBlockTools,
30259    setEntitiesSavedStatesCallback,
30260    title
30261  }) {
30262    const isWideViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('large');
30263    const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
30264    const isTooNarrowForDocumentBar = (0,external_wp_compose_namespaceObject.useMediaQuery)('(max-width: 403px)');
30265    const {
30266      postType,
30267      isTextEditor,
30268      isPublishSidebarOpened,
30269      showIconLabels,
30270      hasFixedToolbar,
30271      hasBlockSelection,
30272      hasSectionRootClientId
30273    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
30274      const {
30275        get: getPreference
30276      } = select(external_wp_preferences_namespaceObject.store);
30277      const {
30278        getEditorMode,
30279        getCurrentPostType,
30280        isPublishSidebarOpened: _isPublishSidebarOpened
30281      } = select(store_store);
30282      const {
30283        getBlockSelectionStart,
30284        getSectionRootClientId
30285      } = unlock(select(external_wp_blockEditor_namespaceObject.store));
30286      return {
30287        postType: getCurrentPostType(),
30288        isTextEditor: getEditorMode() === 'text',
30289        isPublishSidebarOpened: _isPublishSidebarOpened(),
30290        showIconLabels: getPreference('core', 'showIconLabels'),
30291        hasFixedToolbar: getPreference('core', 'fixedToolbar'),
30292        hasBlockSelection: !!getBlockSelectionStart(),
30293        hasSectionRootClientId: !!getSectionRootClientId()
30294      };
30295    }, []);
30296    const canBeZoomedOut = ['post', 'page', 'wp_template'].includes(postType) && hasSectionRootClientId;
30297    const disablePreviewOption = [NAVIGATION_POST_TYPE, TEMPLATE_PART_POST_TYPE, PATTERN_POST_TYPE].includes(postType) || forceDisableBlockTools;
30298    const [isBlockToolsCollapsed, setIsBlockToolsCollapsed] = (0,external_wp_element_namespaceObject.useState)(true);
30299    const hasCenter = !isTooNarrowForDocumentBar && (!hasFixedToolbar || hasFixedToolbar && (!hasBlockSelection || isBlockToolsCollapsed));
30300    const hasBackButton = useHasBackButton();
30301  
30302    /*
30303     * The edit-post-header classname is only kept for backward compatibility
30304     * as some plugins might be relying on its presence.
30305     */
30306    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
30307      className: "editor-header edit-post-header",
30308      children: [hasBackButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, {
30309        className: "editor-header__back-button",
30310        variants: backButtonVariations,
30311        transition: {
30312          type: 'tween'
30313        },
30314        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(back_button.Slot, {})
30315      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__unstableMotion.div, {
30316        variants: toolbarVariations,
30317        className: "editor-header__toolbar",
30318        transition: {
30319          type: 'tween'
30320        },
30321        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(document_tools, {
30322          disableBlockTools: forceDisableBlockTools || isTextEditor
30323        }), hasFixedToolbar && isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CollapsibleBlockToolbar, {
30324          isCollapsed: isBlockToolsCollapsed,
30325          onToggle: setIsBlockToolsCollapsed
30326        })]
30327      }), hasCenter && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, {
30328        className: "editor-header__center",
30329        variants: toolbarVariations,
30330        transition: {
30331          type: 'tween'
30332        },
30333        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DocumentBar, {
30334          title: title
30335        })
30336      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__unstableMotion.div, {
30337        variants: toolbarVariations,
30338        transition: {
30339          type: 'tween'
30340        },
30341        className: "editor-header__settings",
30342        children: [!customSaveButton && !isPublishSidebarOpened &&
30343        /*#__PURE__*/
30344        /*
30345         * This button isn't completely hidden by the publish sidebar.
30346         * We can't hide the whole toolbar when the publish sidebar is open because
30347         * we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.
30348         * We track that DOM node to return focus to the PostPublishButtonOrToggle
30349         * when the publish sidebar has been closed.
30350         */
30351        (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSavedState, {
30352          forceIsDirty: forceIsDirty
30353        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostViewLink, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewDropdown, {
30354          forceIsAutosaveable: forceIsDirty,
30355          disabled: disablePreviewOption
30356        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPreviewButton, {
30357          className: "editor-header__post-preview-button",
30358          forceIsAutosaveable: forceIsDirty
30359        }), isWideViewport && canBeZoomedOut && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(zoom_out_toggle, {
30360          disabled: forceDisableBlockTools
30361        }), (isWideViewport || !showIconLabels) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pinned_items.Slot, {
30362          scope: "core"
30363        }), !customSaveButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPublishButtonOrToggle, {
30364          forceIsDirty: forceIsDirty,
30365          setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
30366        }), isBlockCommentExperimentEnabled ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CollabSidebar, {}) : undefined, customSaveButton, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MoreMenu, {})]
30367      })]
30368    });
30369  }
30370  /* harmony default export */ const components_header = (header_Header);
30371  
30372  ;// ./node_modules/@wordpress/editor/build-module/components/inserter-sidebar/index.js
30373  /**
30374   * WordPress dependencies
30375   */
30376  
30377  
30378  
30379  
30380  
30381  
30382  
30383  
30384  /**
30385   * Internal dependencies
30386   */
30387  
30388  
30389  
30390  const {
30391    PrivateInserterLibrary
30392  } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
30393  function InserterSidebar() {
30394    const {
30395      blockSectionRootClientId,
30396      inserterSidebarToggleRef,
30397      inserter,
30398      showMostUsedBlocks,
30399      sidebarIsOpened
30400    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
30401      const {
30402        getInserterSidebarToggleRef,
30403        getInserter,
30404        isPublishSidebarOpened
30405      } = unlock(select(store_store));
30406      const {
30407        getBlockRootClientId,
30408        isZoomOut,
30409        getSectionRootClientId
30410      } = unlock(select(external_wp_blockEditor_namespaceObject.store));
30411      const {
30412        get
30413      } = select(external_wp_preferences_namespaceObject.store);
30414      const {
30415        getActiveComplementaryArea
30416      } = select(store);
30417      const getBlockSectionRootClientId = () => {
30418        if (isZoomOut()) {
30419          const sectionRootClientId = getSectionRootClientId();
30420          if (sectionRootClientId) {
30421            return sectionRootClientId;
30422          }
30423        }
30424        return getBlockRootClientId();
30425      };
30426      return {
30427        inserterSidebarToggleRef: getInserterSidebarToggleRef(),
30428        inserter: getInserter(),
30429        showMostUsedBlocks: get('core', 'mostUsedBlocks'),
30430        blockSectionRootClientId: getBlockSectionRootClientId(),
30431        sidebarIsOpened: !!(getActiveComplementaryArea('core') || isPublishSidebarOpened())
30432      };
30433    }, []);
30434    const {
30435      setIsInserterOpened
30436    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
30437    const {
30438      disableComplementaryArea
30439    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
30440    const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
30441    const libraryRef = (0,external_wp_element_namespaceObject.useRef)();
30442  
30443    // When closing the inserter, focus should return to the toggle button.
30444    const closeInserterSidebar = (0,external_wp_element_namespaceObject.useCallback)(() => {
30445      setIsInserterOpened(false);
30446      inserterSidebarToggleRef.current?.focus();
30447    }, [inserterSidebarToggleRef, setIsInserterOpened]);
30448    const closeOnEscape = (0,external_wp_element_namespaceObject.useCallback)(event => {
30449      if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) {
30450        event.preventDefault();
30451        closeInserterSidebar();
30452      }
30453    }, [closeInserterSidebar]);
30454    const inserterContents = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
30455      className: "editor-inserter-sidebar__content",
30456      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateInserterLibrary, {
30457        showMostUsedBlocks: showMostUsedBlocks,
30458        showInserterHelpPanel: true,
30459        shouldFocusBlock: isMobileViewport,
30460        rootClientId: blockSectionRootClientId,
30461        onSelect: inserter.onSelect,
30462        __experimentalInitialTab: inserter.tab,
30463        __experimentalInitialCategory: inserter.category,
30464        __experimentalFilterValue: inserter.filterValue,
30465        onPatternCategorySelection: sidebarIsOpened ? () => disableComplementaryArea('core') : undefined,
30466        ref: libraryRef,
30467        onClose: closeInserterSidebar
30468      })
30469    });
30470    return (
30471      /*#__PURE__*/
30472      // eslint-disable-next-line jsx-a11y/no-static-element-interactions
30473      (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
30474        onKeyDown: closeOnEscape,
30475        className: "editor-inserter-sidebar",
30476        children: inserterContents
30477      })
30478    );
30479  }
30480  
30481  ;// ./node_modules/@wordpress/editor/build-module/components/list-view-sidebar/list-view-outline.js
30482  /**
30483   * WordPress dependencies
30484   */
30485  
30486  
30487  
30488  /**
30489   * Internal dependencies
30490   */
30491  
30492  
30493  
30494  
30495  
30496  function ListViewOutline() {
30497    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
30498      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
30499        className: "editor-list-view-sidebar__outline",
30500        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
30501          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
30502            children: (0,external_wp_i18n_namespaceObject.__)('Characters:')
30503          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
30504            children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CharacterCount, {})
30505          })]
30506        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
30507          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
30508            children: (0,external_wp_i18n_namespaceObject.__)('Words:')
30509          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WordCount, {})]
30510        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
30511          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
30512            children: (0,external_wp_i18n_namespaceObject.__)('Time to read:')
30513          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TimeToRead, {})]
30514        })]
30515      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DocumentOutline, {})]
30516    });
30517  }
30518  
30519  ;// ./node_modules/@wordpress/editor/build-module/components/list-view-sidebar/index.js
30520  /**
30521   * WordPress dependencies
30522   */
30523  
30524  
30525  
30526  
30527  
30528  
30529  
30530  
30531  
30532  /**
30533   * Internal dependencies
30534   */
30535  
30536  
30537  
30538  
30539  const {
30540    TabbedSidebar
30541  } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
30542  function ListViewSidebar() {
30543    const {
30544      setIsListViewOpened
30545    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
30546    const {
30547      getListViewToggleRef
30548    } = unlock((0,external_wp_data_namespaceObject.useSelect)(store_store));
30549  
30550    // This hook handles focus when the sidebar first renders.
30551    const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)('firstElement');
30552  
30553    // When closing the list view, focus should return to the toggle button.
30554    const closeListView = (0,external_wp_element_namespaceObject.useCallback)(() => {
30555      setIsListViewOpened(false);
30556      getListViewToggleRef().current?.focus();
30557    }, [getListViewToggleRef, setIsListViewOpened]);
30558    const closeOnEscape = (0,external_wp_element_namespaceObject.useCallback)(event => {
30559      if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) {
30560        event.preventDefault();
30561        closeListView();
30562      }
30563    }, [closeListView]);
30564  
30565    // Use internal state instead of a ref to make sure that the component
30566    // re-renders when the dropZoneElement updates.
30567    const [dropZoneElement, setDropZoneElement] = (0,external_wp_element_namespaceObject.useState)(null);
30568    // Tracks our current tab.
30569    const [tab, setTab] = (0,external_wp_element_namespaceObject.useState)('list-view');
30570  
30571    // This ref refers to the sidebar as a whole.
30572    const sidebarRef = (0,external_wp_element_namespaceObject.useRef)();
30573    // This ref refers to the tab panel.
30574    const tabsRef = (0,external_wp_element_namespaceObject.useRef)();
30575    // This ref refers to the list view application area.
30576    const listViewRef = (0,external_wp_element_namespaceObject.useRef)();
30577  
30578    // Must merge the refs together so focus can be handled properly in the next function.
30579    const listViewContainerRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([focusOnMountRef, listViewRef, setDropZoneElement]);
30580  
30581    /*
30582     * Callback function to handle list view or outline focus.
30583     *
30584     * @param {string} currentTab The current tab. Either list view or outline.
30585     *
30586     * @return void
30587     */
30588    function handleSidebarFocus(currentTab) {
30589      // Tab panel focus.
30590      const tabPanelFocus = external_wp_dom_namespaceObject.focus.tabbable.find(tabsRef.current)[0];
30591      // List view tab is selected.
30592      if (currentTab === 'list-view') {
30593        // Either focus the list view or the tab panel. Must have a fallback because the list view does not render when there are no blocks.
30594        const listViewApplicationFocus = external_wp_dom_namespaceObject.focus.tabbable.find(listViewRef.current)[0];
30595        const listViewFocusArea = sidebarRef.current.contains(listViewApplicationFocus) ? listViewApplicationFocus : tabPanelFocus;
30596        listViewFocusArea.focus();
30597        // Outline tab is selected.
30598      } else {
30599        tabPanelFocus.focus();
30600      }
30601    }
30602    const handleToggleListViewShortcut = (0,external_wp_element_namespaceObject.useCallback)(() => {
30603      // If the sidebar has focus, it is safe to close.
30604      if (sidebarRef.current.contains(sidebarRef.current.ownerDocument.activeElement)) {
30605        closeListView();
30606      } else {
30607        // If the list view or outline does not have focus, focus should be moved to it.
30608        handleSidebarFocus(tab);
30609      }
30610    }, [closeListView, tab]);
30611  
30612    // This only fires when the sidebar is open because of the conditional rendering.
30613    // It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.
30614    (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/editor/toggle-list-view', handleToggleListViewShortcut);
30615    return (
30616      /*#__PURE__*/
30617      // eslint-disable-next-line jsx-a11y/no-static-element-interactions
30618      (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
30619        className: "editor-list-view-sidebar",
30620        onKeyDown: closeOnEscape,
30621        ref: sidebarRef,
30622        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TabbedSidebar, {
30623          tabs: [{
30624            name: 'list-view',
30625            title: (0,external_wp_i18n_namespaceObject._x)('List View', 'Post overview'),
30626            panel: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
30627              className: "editor-list-view-sidebar__list-view-container",
30628              children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
30629                className: "editor-list-view-sidebar__list-view-panel-content",
30630                children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalListView, {
30631                  dropZoneElement: dropZoneElement
30632                })
30633              })
30634            }),
30635            panelRef: listViewContainerRef
30636          }, {
30637            name: 'outline',
30638            title: (0,external_wp_i18n_namespaceObject._x)('Outline', 'Post overview'),
30639            panel: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
30640              className: "editor-list-view-sidebar__list-view-container",
30641              children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewOutline, {})
30642            })
30643          }],
30644          onClose: closeListView,
30645          onSelect: tabName => setTab(tabName),
30646          defaultTabId: "list-view",
30647          ref: tabsRef,
30648          closeButtonLabel: (0,external_wp_i18n_namespaceObject.__)('Close')
30649        })
30650      })
30651    );
30652  }
30653  
30654  ;// ./node_modules/@wordpress/editor/build-module/components/save-publish-panels/index.js
30655  /**
30656   * WordPress dependencies
30657   */
30658  
30659  
30660  
30661  
30662  
30663  /**
30664   * Internal dependencies
30665   */
30666  
30667  
30668  
30669  
30670  
30671  
30672  const {
30673    Fill: save_publish_panels_Fill,
30674    Slot: save_publish_panels_Slot
30675  } = (0,external_wp_components_namespaceObject.createSlotFill)('ActionsPanel');
30676  const ActionsPanelFill = (/* unused pure expression or super */ null && (save_publish_panels_Fill));
30677  function SavePublishPanels({
30678    setEntitiesSavedStatesCallback,
30679    closeEntitiesSavedStates,
30680    isEntitiesSavedStatesOpen,
30681    forceIsDirtyPublishPanel
30682  }) {
30683    const {
30684      closePublishSidebar,
30685      togglePublishSidebar
30686    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
30687    const {
30688      publishSidebarOpened,
30689      isPublishable,
30690      isDirty,
30691      hasOtherEntitiesChanges
30692    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
30693      const {
30694        isPublishSidebarOpened,
30695        isEditedPostPublishable,
30696        isCurrentPostPublished,
30697        isEditedPostDirty,
30698        hasNonPostEntityChanges
30699      } = select(store_store);
30700      const _hasOtherEntitiesChanges = hasNonPostEntityChanges();
30701      return {
30702        publishSidebarOpened: isPublishSidebarOpened(),
30703        isPublishable: !isCurrentPostPublished() && isEditedPostPublishable(),
30704        isDirty: _hasOtherEntitiesChanges || isEditedPostDirty(),
30705        hasOtherEntitiesChanges: _hasOtherEntitiesChanges
30706      };
30707    }, []);
30708    const openEntitiesSavedStates = (0,external_wp_element_namespaceObject.useCallback)(() => setEntitiesSavedStatesCallback(true), []);
30709  
30710    // It is ok for these components to be unmounted when not in visual use.
30711    // We don't want more than one present at a time, decide which to render.
30712    let unmountableContent;
30713    if (publishSidebarOpened) {
30714      unmountableContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_publish_panel, {
30715        onClose: closePublishSidebar,
30716        forceIsDirty: forceIsDirtyPublishPanel,
30717        PrePublishExtension: plugin_pre_publish_panel.Slot,
30718        PostPublishExtension: plugin_post_publish_panel.Slot
30719      });
30720    } else if (isPublishable && !hasOtherEntitiesChanges) {
30721      unmountableContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
30722        className: "editor-layout__toggle-publish-panel",
30723        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
30724          __next40pxDefaultSize: true,
30725          variant: "secondary",
30726          onClick: togglePublishSidebar,
30727          "aria-expanded": false,
30728          children: (0,external_wp_i18n_namespaceObject.__)('Open publish panel')
30729        })
30730      });
30731    } else {
30732      unmountableContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
30733        className: "editor-layout__toggle-entities-saved-states-panel",
30734        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
30735          __next40pxDefaultSize: true,
30736          variant: "secondary",
30737          onClick: openEntitiesSavedStates,
30738          "aria-expanded": false,
30739          "aria-haspopup": "dialog",
30740          disabled: !isDirty,
30741          accessibleWhenDisabled: true,
30742          children: (0,external_wp_i18n_namespaceObject.__)('Open save panel')
30743        })
30744      });
30745    }
30746  
30747    // Since EntitiesSavedStates controls its own panel, we can keep it
30748    // always mounted to retain its own component state (such as checkboxes).
30749    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
30750      children: [isEntitiesSavedStatesOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EntitiesSavedStates, {
30751        close: closeEntitiesSavedStates,
30752        renderDialog: true
30753      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(save_publish_panels_Slot, {
30754        bubblesVirtually: true
30755      }), !isEntitiesSavedStatesOpen && unmountableContent]
30756    });
30757  }
30758  
30759  ;// ./node_modules/@wordpress/editor/build-module/components/text-editor/index.js
30760  /**
30761   * WordPress dependencies
30762   */
30763  
30764  
30765  
30766  
30767  
30768  
30769  /**
30770   * Internal dependencies
30771   */
30772  
30773  
30774  
30775  
30776  function TextEditor({
30777    autoFocus = false
30778  }) {
30779    const {
30780      switchEditorMode
30781    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
30782    const {
30783      shortcut,
30784      isRichEditingEnabled
30785    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
30786      const {
30787        getEditorSettings
30788      } = select(store_store);
30789      const {
30790        getShortcutRepresentation
30791      } = select(external_wp_keyboardShortcuts_namespaceObject.store);
30792      return {
30793        shortcut: getShortcutRepresentation('core/editor/toggle-mode'),
30794        isRichEditingEnabled: getEditorSettings().richEditingEnabled
30795      };
30796    }, []);
30797    const titleRef = (0,external_wp_element_namespaceObject.useRef)();
30798    (0,external_wp_element_namespaceObject.useEffect)(() => {
30799      if (autoFocus) {
30800        return;
30801      }
30802      titleRef?.current?.focus();
30803    }, [autoFocus]);
30804    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
30805      className: "editor-text-editor",
30806      children: [isRichEditingEnabled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
30807        className: "editor-text-editor__toolbar",
30808        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", {
30809          children: (0,external_wp_i18n_namespaceObject.__)('Editing code')
30810        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
30811          __next40pxDefaultSize: true,
30812          variant: "tertiary",
30813          onClick: () => switchEditorMode('visual'),
30814          shortcut: shortcut,
30815          children: (0,external_wp_i18n_namespaceObject.__)('Exit code editor')
30816        })]
30817      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
30818        className: "editor-text-editor__body",
30819        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_title_raw, {
30820          ref: titleRef
30821        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTextEditor, {})]
30822      })]
30823    });
30824  }
30825  
30826  ;// ./node_modules/@wordpress/editor/build-module/components/visual-editor/edit-template-blocks-notification.js
30827  /**
30828   * WordPress dependencies
30829   */
30830  
30831  
30832  
30833  
30834  
30835  
30836  /**
30837   * Internal dependencies
30838   */
30839  
30840  
30841  /**
30842   * Component that:
30843   *
30844   * - Displays a 'Edit your template to edit this block' notification when the
30845   *   user is focusing on editing page content and clicks on a disabled template
30846   *   block.
30847   * - Displays a 'Edit your template to edit this block' dialog when the user
30848   *   is focusing on editing page content and double clicks on a disabled
30849   *   template block.
30850   *
30851   * @param {Object}                                 props
30852   * @param {import('react').RefObject<HTMLElement>} props.contentRef Ref to the block
30853   *                                                                  editor iframe canvas.
30854   */
30855  
30856  function EditTemplateBlocksNotification({
30857    contentRef
30858  }) {
30859    const {
30860      onNavigateToEntityRecord,
30861      templateId
30862    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
30863      const {
30864        getEditorSettings,
30865        getCurrentTemplateId
30866      } = select(store_store);
30867      return {
30868        onNavigateToEntityRecord: getEditorSettings().onNavigateToEntityRecord,
30869        templateId: getCurrentTemplateId()
30870      };
30871    }, []);
30872    const canEditTemplate = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_coreData_namespaceObject.store).canUser('create', {
30873      kind: 'postType',
30874      name: 'wp_template'
30875    }), []);
30876    const [isDialogOpen, setIsDialogOpen] = (0,external_wp_element_namespaceObject.useState)(false);
30877    (0,external_wp_element_namespaceObject.useEffect)(() => {
30878      const handleDblClick = event => {
30879        if (!canEditTemplate) {
30880          return;
30881        }
30882        if (!event.target.classList.contains('is-root-container') || event.target.dataset?.type === 'core/template-part') {
30883          return;
30884        }
30885        if (!event.defaultPrevented) {
30886          event.preventDefault();
30887          setIsDialogOpen(true);
30888        }
30889      };
30890      const canvas = contentRef.current;
30891      canvas?.addEventListener('dblclick', handleDblClick);
30892      return () => {
30893        canvas?.removeEventListener('dblclick', handleDblClick);
30894      };
30895    }, [contentRef, canEditTemplate]);
30896    if (!canEditTemplate) {
30897      return null;
30898    }
30899    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, {
30900      isOpen: isDialogOpen,
30901      confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Edit template'),
30902      onConfirm: () => {
30903        setIsDialogOpen(false);
30904        onNavigateToEntityRecord({
30905          postId: templateId,
30906          postType: 'wp_template'
30907        });
30908      },
30909      onCancel: () => setIsDialogOpen(false),
30910      size: "medium",
30911      children: (0,external_wp_i18n_namespaceObject.__)('You’ve tried to select a block that is part of a template that may be used elsewhere on your site. Would you like to edit the template?')
30912    });
30913  }
30914  
30915  ;// ./node_modules/@wordpress/editor/build-module/components/resizable-editor/resize-handle.js
30916  /**
30917   * WordPress dependencies
30918   */
30919  
30920  
30921  
30922  
30923  const DELTA_DISTANCE = 20; // The distance to resize per keydown in pixels.
30924  
30925  function ResizeHandle({
30926    direction,
30927    resizeWidthBy
30928  }) {
30929    function handleKeyDown(event) {
30930      const {
30931        keyCode
30932      } = event;
30933      if (keyCode !== external_wp_keycodes_namespaceObject.LEFT && keyCode !== external_wp_keycodes_namespaceObject.RIGHT) {
30934        return;
30935      }
30936      event.preventDefault();
30937      if (direction === 'left' && keyCode === external_wp_keycodes_namespaceObject.LEFT || direction === 'right' && keyCode === external_wp_keycodes_namespaceObject.RIGHT) {
30938        resizeWidthBy(DELTA_DISTANCE);
30939      } else if (direction === 'left' && keyCode === external_wp_keycodes_namespaceObject.RIGHT || direction === 'right' && keyCode === external_wp_keycodes_namespaceObject.LEFT) {
30940        resizeWidthBy(-DELTA_DISTANCE);
30941      }
30942    }
30943    const resizeHandleVariants = {
30944      active: {
30945        opacity: 1,
30946        scaleY: 1.3
30947      }
30948    };
30949    const resizableHandleHelpId = `resizable-editor__resize-help-$direction}`;
30950    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
30951      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, {
30952        text: (0,external_wp_i18n_namespaceObject.__)('Drag to resize'),
30953        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.button, {
30954          className: `editor-resizable-editor__resize-handle is-$direction}`,
30955          "aria-label": (0,external_wp_i18n_namespaceObject.__)('Drag to resize'),
30956          "aria-describedby": resizableHandleHelpId,
30957          onKeyDown: handleKeyDown,
30958          variants: resizeHandleVariants,
30959          whileFocus: "active",
30960          whileHover: "active",
30961          whileTap: "active",
30962          role: "separator",
30963          "aria-orientation": "vertical"
30964        }, "handle")
30965      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
30966        id: resizableHandleHelpId,
30967        children: (0,external_wp_i18n_namespaceObject.__)('Use left and right arrow keys to resize the canvas.')
30968      })]
30969    });
30970  }
30971  
30972  ;// ./node_modules/@wordpress/editor/build-module/components/resizable-editor/index.js
30973  /**
30974   * External dependencies
30975   */
30976  
30977  
30978  /**
30979   * WordPress dependencies
30980   */
30981  
30982  
30983  
30984  /**
30985   * Internal dependencies
30986   */
30987  
30988  
30989  // Removes the inline styles in the drag handles.
30990  
30991  const HANDLE_STYLES_OVERRIDE = {
30992    position: undefined,
30993    userSelect: undefined,
30994    cursor: undefined,
30995    width: undefined,
30996    height: undefined,
30997    top: undefined,
30998    right: undefined,
30999    bottom: undefined,
31000    left: undefined
31001  };
31002  function ResizableEditor({
31003    className,
31004    enableResizing,
31005    height,
31006    children
31007  }) {
31008    const [width, setWidth] = (0,external_wp_element_namespaceObject.useState)('100%');
31009    const resizableRef = (0,external_wp_element_namespaceObject.useRef)();
31010    const resizeWidthBy = (0,external_wp_element_namespaceObject.useCallback)(deltaPixels => {
31011      if (resizableRef.current) {
31012        setWidth(resizableRef.current.offsetWidth + deltaPixels);
31013      }
31014    }, []);
31015    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, {
31016      className: dist_clsx('editor-resizable-editor', className, {
31017        'is-resizable': enableResizing
31018      }),
31019      ref: api => {
31020        resizableRef.current = api?.resizable;
31021      },
31022      size: {
31023        width: enableResizing ? width : '100%',
31024        height: enableResizing && height ? height : '100%'
31025      },
31026      onResizeStop: (event, direction, element) => {
31027        setWidth(element.style.width);
31028      },
31029      minWidth: 300,
31030      maxWidth: "100%",
31031      maxHeight: "100%",
31032      enable: {
31033        left: enableResizing,
31034        right: enableResizing
31035      },
31036      showHandle: enableResizing
31037      // The editor is centered horizontally, resizing it only
31038      // moves half the distance. Hence double the ratio to correctly
31039      // align the cursor to the resizer handle.
31040      ,
31041      resizeRatio: 2,
31042      handleComponent: {
31043        left: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizeHandle, {
31044          direction: "left",
31045          resizeWidthBy: resizeWidthBy
31046        }),
31047        right: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizeHandle, {
31048          direction: "right",
31049          resizeWidthBy: resizeWidthBy
31050        })
31051      },
31052      handleClasses: undefined,
31053      handleStyles: {
31054        left: HANDLE_STYLES_OVERRIDE,
31055        right: HANDLE_STYLES_OVERRIDE
31056      },
31057      children: children
31058    });
31059  }
31060  /* harmony default export */ const resizable_editor = (ResizableEditor);
31061  
31062  ;// ./node_modules/@wordpress/editor/build-module/components/visual-editor/use-select-nearest-editable-block.js
31063  /**
31064   * WordPress dependencies
31065   */
31066  
31067  
31068  
31069  
31070  /**
31071   * Internal dependencies
31072   */
31073  
31074  const DISTANCE_THRESHOLD = 500;
31075  function clamp(value, min, max) {
31076    return Math.min(Math.max(value, min), max);
31077  }
31078  function distanceFromRect(x, y, rect) {
31079    const dx = x - clamp(x, rect.left, rect.right);
31080    const dy = y - clamp(y, rect.top, rect.bottom);
31081    return Math.sqrt(dx * dx + dy * dy);
31082  }
31083  function useSelectNearestEditableBlock({
31084    isEnabled = true
31085  } = {}) {
31086    const {
31087      getEnabledClientIdsTree,
31088      getBlockName,
31089      getBlockOrder
31090    } = unlock((0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store));
31091    const {
31092      selectBlock
31093    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
31094    return (0,external_wp_compose_namespaceObject.useRefEffect)(element => {
31095      if (!isEnabled) {
31096        return;
31097      }
31098      const selectNearestEditableBlock = (x, y) => {
31099        const editableBlockClientIds = getEnabledClientIdsTree().flatMap(({
31100          clientId
31101        }) => {
31102          const blockName = getBlockName(clientId);
31103          if (blockName === 'core/template-part') {
31104            return [];
31105          }
31106          if (blockName === 'core/post-content') {
31107            const innerBlocks = getBlockOrder(clientId);
31108            if (innerBlocks.length) {
31109              return innerBlocks;
31110            }
31111          }
31112          return [clientId];
31113        });
31114        let nearestDistance = Infinity,
31115          nearestClientId = null;
31116        for (const clientId of editableBlockClientIds) {
31117          const block = element.querySelector(`[data-block="$clientId}"]`);
31118          if (!block) {
31119            continue;
31120          }
31121          const rect = block.getBoundingClientRect();
31122          const distance = distanceFromRect(x, y, rect);
31123          if (distance < nearestDistance && distance < DISTANCE_THRESHOLD) {
31124            nearestDistance = distance;
31125            nearestClientId = clientId;
31126          }
31127        }
31128        if (nearestClientId) {
31129          selectBlock(nearestClientId);
31130        }
31131      };
31132      const handleClick = event => {
31133        const shouldSelect = event.target === element || event.target.classList.contains('is-root-container');
31134        if (shouldSelect) {
31135          selectNearestEditableBlock(event.clientX, event.clientY);
31136        }
31137      };
31138      element.addEventListener('click', handleClick);
31139      return () => element.removeEventListener('click', handleClick);
31140    }, [isEnabled]);
31141  }
31142  
31143  ;// ./node_modules/@wordpress/editor/build-module/components/visual-editor/use-zoom-out-mode-exit.js
31144  /**
31145   * WordPress dependencies
31146   */
31147  
31148  
31149  
31150  
31151  /**
31152   * Internal dependencies
31153   */
31154  
31155  
31156  /**
31157   * Allows Zoom Out mode to be exited by double clicking in the selected block.
31158   */
31159  function useZoomOutModeExit() {
31160    const {
31161      getSettings,
31162      isZoomOut
31163    } = unlock((0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store));
31164    const {
31165      resetZoomLevel
31166    } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store));
31167    return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
31168      function onDoubleClick(event) {
31169        if (!isZoomOut()) {
31170          return;
31171        }
31172        if (!event.defaultPrevented) {
31173          event.preventDefault();
31174          const {
31175            __experimentalSetIsInserterOpened
31176          } = getSettings();
31177          if (typeof __experimentalSetIsInserterOpened === 'function') {
31178            __experimentalSetIsInserterOpened(false);
31179          }
31180          resetZoomLevel();
31181        }
31182      }
31183      node.addEventListener('dblclick', onDoubleClick);
31184      return () => {
31185        node.removeEventListener('dblclick', onDoubleClick);
31186      };
31187    }, [getSettings, isZoomOut, resetZoomLevel]);
31188  }
31189  
31190  ;// ./node_modules/@wordpress/editor/build-module/components/visual-editor/index.js
31191  /**
31192   * External dependencies
31193   */
31194  
31195  
31196  /**
31197   * WordPress dependencies
31198   */
31199  
31200  
31201  
31202  
31203  
31204  
31205  
31206  /**
31207   * Internal dependencies
31208   */
31209  
31210  
31211  
31212  
31213  
31214  
31215  
31216  
31217  
31218  const {
31219    LayoutStyle,
31220    useLayoutClasses,
31221    useLayoutStyles,
31222    ExperimentalBlockCanvas: BlockCanvas,
31223    useFlashEditableBlocks
31224  } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
31225  
31226  /**
31227   * These post types have a special editor where they don't allow you to fill the title
31228   * and they don't apply the layout styles.
31229   */
31230  const visual_editor_DESIGN_POST_TYPES = [PATTERN_POST_TYPE, TEMPLATE_POST_TYPE, NAVIGATION_POST_TYPE, TEMPLATE_PART_POST_TYPE];
31231  
31232  /**
31233   * Given an array of nested blocks, find the first Post Content
31234   * block inside it, recursing through any nesting levels,
31235   * and return its attributes.
31236   *
31237   * @param {Array} blocks A list of blocks.
31238   *
31239   * @return {Object | undefined} The Post Content block.
31240   */
31241  function getPostContentAttributes(blocks) {
31242    for (let i = 0; i < blocks.length; i++) {
31243      if (blocks[i].name === 'core/post-content') {
31244        return blocks[i].attributes;
31245      }
31246      if (blocks[i].innerBlocks.length) {
31247        const nestedPostContent = getPostContentAttributes(blocks[i].innerBlocks);
31248        if (nestedPostContent) {
31249          return nestedPostContent;
31250        }
31251      }
31252    }
31253  }
31254  function checkForPostContentAtRootLevel(blocks) {
31255    for (let i = 0; i < blocks.length; i++) {
31256      if (blocks[i].name === 'core/post-content') {
31257        return true;
31258      }
31259    }
31260    return false;
31261  }
31262  function VisualEditor({
31263    // Ideally as we unify post and site editors, we won't need these props.
31264    autoFocus,
31265    styles,
31266    disableIframe = false,
31267    iframeProps,
31268    contentRef,
31269    className
31270  }) {
31271    const [contentHeight, setContentHeight] = (0,external_wp_element_namespaceObject.useState)('');
31272    const effectContentHeight = (0,external_wp_compose_namespaceObject.useResizeObserver)(([entry]) => {
31273      setContentHeight(entry.borderBoxSize[0].blockSize);
31274    });
31275    const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('small', '<');
31276    const {
31277      renderingMode,
31278      postContentAttributes,
31279      editedPostTemplate = {},
31280      wrapperBlockName,
31281      wrapperUniqueId,
31282      deviceType,
31283      isFocusedEntity,
31284      isDesignPostType,
31285      postType,
31286      isPreview
31287    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
31288      const {
31289        getCurrentPostId,
31290        getCurrentPostType,
31291        getCurrentTemplateId,
31292        getEditorSettings,
31293        getRenderingMode,
31294        getDeviceType
31295      } = select(store_store);
31296      const {
31297        getPostType,
31298        getEditedEntityRecord
31299      } = select(external_wp_coreData_namespaceObject.store);
31300      const postTypeSlug = getCurrentPostType();
31301      const _renderingMode = getRenderingMode();
31302      let _wrapperBlockName;
31303      if (postTypeSlug === PATTERN_POST_TYPE) {
31304        _wrapperBlockName = 'core/block';
31305      } else if (_renderingMode === 'post-only') {
31306        _wrapperBlockName = 'core/post-content';
31307      }
31308      const editorSettings = getEditorSettings();
31309      const supportsTemplateMode = editorSettings.supportsTemplateMode;
31310      const postTypeObject = getPostType(postTypeSlug);
31311      const currentTemplateId = getCurrentTemplateId();
31312      const template = currentTemplateId ? getEditedEntityRecord('postType', TEMPLATE_POST_TYPE, currentTemplateId) : undefined;
31313      return {
31314        renderingMode: _renderingMode,
31315        postContentAttributes: editorSettings.postContentAttributes,
31316        isDesignPostType: visual_editor_DESIGN_POST_TYPES.includes(postTypeSlug),
31317        // Post template fetch returns a 404 on classic themes, which
31318        // messes with e2e tests, so check it's a block theme first.
31319        editedPostTemplate: postTypeObject?.viewable && supportsTemplateMode ? template : undefined,
31320        wrapperBlockName: _wrapperBlockName,
31321        wrapperUniqueId: getCurrentPostId(),
31322        deviceType: getDeviceType(),
31323        isFocusedEntity: !!editorSettings.onNavigateToPreviousEntityRecord,
31324        postType: postTypeSlug,
31325        isPreview: editorSettings.isPreviewMode
31326      };
31327    }, []);
31328    const {
31329      isCleanNewPost
31330    } = (0,external_wp_data_namespaceObject.useSelect)(store_store);
31331    const {
31332      hasRootPaddingAwareAlignments,
31333      themeHasDisabledLayoutStyles,
31334      themeSupportsLayout,
31335      isZoomedOut
31336    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
31337      const {
31338        getSettings,
31339        isZoomOut: _isZoomOut
31340      } = unlock(select(external_wp_blockEditor_namespaceObject.store));
31341      const _settings = getSettings();
31342      return {
31343        themeHasDisabledLayoutStyles: _settings.disableLayoutStyles,
31344        themeSupportsLayout: _settings.supportsLayout,
31345        hasRootPaddingAwareAlignments: _settings.__experimentalFeatures?.useRootPaddingAwareAlignments,
31346        isZoomedOut: _isZoomOut()
31347      };
31348    }, []);
31349    const deviceStyles = (0,external_wp_blockEditor_namespaceObject.__experimentalUseResizeCanvas)(deviceType);
31350    const [globalLayoutSettings] = (0,external_wp_blockEditor_namespaceObject.useSettings)('layout');
31351  
31352    // fallbackLayout is used if there is no Post Content,
31353    // and for Post Title.
31354    const fallbackLayout = (0,external_wp_element_namespaceObject.useMemo)(() => {
31355      if (renderingMode !== 'post-only' || isDesignPostType) {
31356        return {
31357          type: 'default'
31358        };
31359      }
31360      if (themeSupportsLayout) {
31361        // We need to ensure support for wide and full alignments,
31362        // so we add the constrained type.
31363        return {
31364          ...globalLayoutSettings,
31365          type: 'constrained'
31366        };
31367      }
31368      // Set default layout for classic themes so all alignments are supported.
31369      return {
31370        type: 'default'
31371      };
31372    }, [renderingMode, themeSupportsLayout, globalLayoutSettings, isDesignPostType]);
31373    const newestPostContentAttributes = (0,external_wp_element_namespaceObject.useMemo)(() => {
31374      if (!editedPostTemplate?.content && !editedPostTemplate?.blocks && postContentAttributes) {
31375        return postContentAttributes;
31376      }
31377      // When in template editing mode, we can access the blocks directly.
31378      if (editedPostTemplate?.blocks) {
31379        return getPostContentAttributes(editedPostTemplate?.blocks);
31380      }
31381      // If there are no blocks, we have to parse the content string.
31382      // Best double-check it's a string otherwise the parse function gets unhappy.
31383      const parseableContent = typeof editedPostTemplate?.content === 'string' ? editedPostTemplate?.content : '';
31384      return getPostContentAttributes((0,external_wp_blocks_namespaceObject.parse)(parseableContent)) || {};
31385    }, [editedPostTemplate?.content, editedPostTemplate?.blocks, postContentAttributes]);
31386    const hasPostContentAtRootLevel = (0,external_wp_element_namespaceObject.useMemo)(() => {
31387      if (!editedPostTemplate?.content && !editedPostTemplate?.blocks) {
31388        return false;
31389      }
31390      // When in template editing mode, we can access the blocks directly.
31391      if (editedPostTemplate?.blocks) {
31392        return checkForPostContentAtRootLevel(editedPostTemplate?.blocks);
31393      }
31394      // If there are no blocks, we have to parse the content string.
31395      // Best double-check it's a string otherwise the parse function gets unhappy.
31396      const parseableContent = typeof editedPostTemplate?.content === 'string' ? editedPostTemplate?.content : '';
31397      return checkForPostContentAtRootLevel((0,external_wp_blocks_namespaceObject.parse)(parseableContent)) || false;
31398    }, [editedPostTemplate?.content, editedPostTemplate?.blocks]);
31399    const {
31400      layout = {},
31401      align = ''
31402    } = newestPostContentAttributes || {};
31403    const postContentLayoutClasses = useLayoutClasses(newestPostContentAttributes, 'core/post-content');
31404    const blockListLayoutClass = dist_clsx({
31405      'is-layout-flow': !themeSupportsLayout
31406    }, themeSupportsLayout && postContentLayoutClasses, align && `align$align}`);
31407    const postContentLayoutStyles = useLayoutStyles(newestPostContentAttributes, 'core/post-content', '.block-editor-block-list__layout.is-root-container');
31408  
31409    // Update type for blocks using legacy layouts.
31410    const postContentLayout = (0,external_wp_element_namespaceObject.useMemo)(() => {
31411      return layout && (layout?.type === 'constrained' || layout?.inherit || layout?.contentSize || layout?.wideSize) ? {
31412        ...globalLayoutSettings,
31413        ...layout,
31414        type: 'constrained'
31415      } : {
31416        ...globalLayoutSettings,
31417        ...layout,
31418        type: 'default'
31419      };
31420    }, [layout?.type, layout?.inherit, layout?.contentSize, layout?.wideSize, globalLayoutSettings]);
31421  
31422    // If there is a Post Content block we use its layout for the block list;
31423    // if not, this must be a classic theme, in which case we use the fallback layout.
31424    const blockListLayout = postContentAttributes ? postContentLayout : fallbackLayout;
31425    const postEditorLayout = blockListLayout?.type === 'default' && !hasPostContentAtRootLevel ? fallbackLayout : blockListLayout;
31426    const observeTypingRef = (0,external_wp_blockEditor_namespaceObject.__unstableUseTypingObserver)();
31427    const titleRef = (0,external_wp_element_namespaceObject.useRef)();
31428    (0,external_wp_element_namespaceObject.useEffect)(() => {
31429      if (!autoFocus || !isCleanNewPost()) {
31430        return;
31431      }
31432      titleRef?.current?.focus();
31433    }, [autoFocus, isCleanNewPost]);
31434  
31435    // Add some styles for alignwide/alignfull Post Content and its children.
31436    const alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}
31437          .is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}
31438          .is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}
31439          .is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;
31440    const forceFullHeight = postType === NAVIGATION_POST_TYPE;
31441    const enableResizing = [NAVIGATION_POST_TYPE, TEMPLATE_PART_POST_TYPE, PATTERN_POST_TYPE].includes(postType) &&
31442    // Disable in previews / view mode.
31443    !isPreview &&
31444    // Disable resizing in mobile viewport.
31445    !isMobileViewport &&
31446    // Disable resizing in zoomed-out mode.
31447    !isZoomedOut;
31448    const iframeStyles = (0,external_wp_element_namespaceObject.useMemo)(() => {
31449      return [...(styles !== null && styles !== void 0 ? styles : []), {
31450        // Ensures margins of children are contained so that the body background paints behind them.
31451        // Otherwise, the background of html (when zoomed out) would show there and appear broken. It’s
31452        // important mostly for post-only views yet conceivably an issue in templated views too.
31453        css: `:where(.block-editor-iframe__body){display:flow-root;}.is-root-container{display:flow-root;${
31454        // Some themes will have `min-height: 100vh` for the root container,
31455        // which isn't a requirement in auto resize mode.
31456        enableResizing ? 'min-height:0!important;' : ''}}`
31457      }];
31458    }, [styles, enableResizing]);
31459    const localRef = (0,external_wp_element_namespaceObject.useRef)();
31460    const typewriterRef = (0,external_wp_blockEditor_namespaceObject.__unstableUseTypewriter)();
31461    contentRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([localRef, contentRef, renderingMode === 'post-only' ? typewriterRef : null, useFlashEditableBlocks({
31462      isEnabled: renderingMode === 'template-locked'
31463    }), useSelectNearestEditableBlock({
31464      isEnabled: renderingMode === 'template-locked'
31465    }), useZoomOutModeExit(),
31466    // Avoid resize listeners when not needed, these will trigger
31467    // unnecessary re-renders when animating the iframe width.
31468    enableResizing ? effectContentHeight : null]);
31469    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
31470      className: dist_clsx('editor-visual-editor',
31471      // this class is here for backward compatibility reasons.
31472      'edit-post-visual-editor', className, {
31473        'has-padding': isFocusedEntity || enableResizing,
31474        'is-resizable': enableResizing,
31475        'is-iframed': !disableIframe,
31476        'is-scrollable': disableIframe || deviceType !== 'Desktop'
31477      }),
31478      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(resizable_editor, {
31479        enableResizing: enableResizing,
31480        height: contentHeight && !forceFullHeight ? contentHeight : '100%',
31481        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(BlockCanvas, {
31482          shouldIframe: !disableIframe,
31483          contentRef: contentRef,
31484          styles: iframeStyles,
31485          height: "100%",
31486          iframeProps: {
31487            ...iframeProps,
31488            style: {
31489              ...iframeProps?.style,
31490              ...deviceStyles
31491            }
31492          },
31493          children: [themeSupportsLayout && !themeHasDisabledLayoutStyles && renderingMode === 'post-only' && !isDesignPostType && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
31494            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutStyle, {
31495              selector: ".editor-visual-editor__post-title-wrapper",
31496              layout: fallbackLayout
31497            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutStyle, {
31498              selector: ".block-editor-block-list__layout.is-root-container",
31499              layout: postEditorLayout
31500            }), align && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutStyle, {
31501              css: alignCSS
31502            }), postContentLayoutStyles && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutStyle, {
31503              layout: postContentLayout,
31504              css: postContentLayoutStyles
31505            })]
31506          }), renderingMode === 'post-only' && !isDesignPostType && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
31507            className: dist_clsx('editor-visual-editor__post-title-wrapper',
31508            // The following class is only here for backward compatibility
31509            // some themes might be using it to style the post title.
31510            'edit-post-visual-editor__post-title-wrapper', {
31511              'has-global-padding': hasRootPaddingAwareAlignments
31512            }),
31513            contentEditable: false,
31514            ref: observeTypingRef,
31515            style: {
31516              // This is using inline styles
31517              // so it's applied for both iframed and non iframed editors.
31518              marginTop: '4rem'
31519            },
31520            children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_title, {
31521              ref: titleRef
31522            })
31523          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.RecursionProvider, {
31524            blockName: wrapperBlockName,
31525            uniqueId: wrapperUniqueId,
31526            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockList, {
31527              className: dist_clsx('is-' + deviceType.toLowerCase() + '-preview', renderingMode !== 'post-only' || isDesignPostType ? 'wp-site-blocks' : `$blockListLayoutClass} wp-block-post-content`,
31528              // Ensure root level blocks receive default/flow blockGap styling rules.
31529              {
31530                'has-global-padding': renderingMode === 'post-only' && !isDesignPostType && hasRootPaddingAwareAlignments
31531              }),
31532              layout: blockListLayout,
31533              dropZoneElement:
31534              // When iframed, pass in the html element of the iframe to
31535              // ensure the drop zone extends to the edges of the iframe.
31536              disableIframe ? localRef.current : localRef.current?.parentNode,
31537              __unstableDisableDropZone:
31538              // In template preview mode, disable drop zones at the root of the template.
31539              renderingMode === 'template-locked' ? true : false
31540            }), renderingMode === 'template-locked' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditTemplateBlocksNotification, {
31541              contentRef: localRef
31542            })]
31543          })]
31544        })
31545      })
31546    });
31547  }
31548  /* harmony default export */ const visual_editor = (VisualEditor);
31549  
31550  ;// ./node_modules/@wordpress/editor/build-module/components/editor-interface/index.js
31551  /**
31552   * External dependencies
31553   */
31554  
31555  
31556  /**
31557   * WordPress dependencies
31558   */
31559  
31560  
31561  
31562  
31563  
31564  
31565  
31566  
31567  /**
31568   * Internal dependencies
31569   */
31570  
31571  
31572  
31573  
31574  
31575  
31576  
31577  
31578  
31579  
31580  const interfaceLabels = {
31581    /* translators: accessibility text for the editor top bar landmark region. */
31582    header: (0,external_wp_i18n_namespaceObject.__)('Editor top bar'),
31583    /* translators: accessibility text for the editor content landmark region. */
31584    body: (0,external_wp_i18n_namespaceObject.__)('Editor content'),
31585    /* translators: accessibility text for the editor settings landmark region. */
31586    sidebar: (0,external_wp_i18n_namespaceObject.__)('Editor settings'),
31587    /* translators: accessibility text for the editor publish landmark region. */
31588    actions: (0,external_wp_i18n_namespaceObject.__)('Editor publish'),
31589    /* translators: accessibility text for the editor footer landmark region. */
31590    footer: (0,external_wp_i18n_namespaceObject.__)('Editor footer')
31591  };
31592  function EditorInterface({
31593    className,
31594    styles,
31595    children,
31596    forceIsDirty,
31597    contentRef,
31598    disableIframe,
31599    autoFocus,
31600    customSaveButton,
31601    customSavePanel,
31602    forceDisableBlockTools,
31603    title,
31604    iframeProps
31605  }) {
31606    const {
31607      mode,
31608      isRichEditingEnabled,
31609      isInserterOpened,
31610      isListViewOpened,
31611      isDistractionFree,
31612      isPreviewMode,
31613      showBlockBreadcrumbs,
31614      documentLabel
31615    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
31616      const {
31617        get
31618      } = select(external_wp_preferences_namespaceObject.store);
31619      const {
31620        getEditorSettings,
31621        getPostTypeLabel
31622      } = select(store_store);
31623      const editorSettings = getEditorSettings();
31624      const postTypeLabel = getPostTypeLabel();
31625      return {
31626        mode: select(store_store).getEditorMode(),
31627        isRichEditingEnabled: editorSettings.richEditingEnabled,
31628        isInserterOpened: select(store_store).isInserterOpened(),
31629        isListViewOpened: select(store_store).isListViewOpened(),
31630        isDistractionFree: get('core', 'distractionFree'),
31631        isPreviewMode: editorSettings.isPreviewMode,
31632        showBlockBreadcrumbs: get('core', 'showBlockBreadcrumbs'),
31633        documentLabel:
31634        // translators: Default label for the Document in the Block Breadcrumb.
31635        postTypeLabel || (0,external_wp_i18n_namespaceObject._x)('Document', 'noun, breadcrumb')
31636      };
31637    }, []);
31638    const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
31639    const secondarySidebarLabel = isListViewOpened ? (0,external_wp_i18n_namespaceObject.__)('Document Overview') : (0,external_wp_i18n_namespaceObject.__)('Block Library');
31640  
31641    // Local state for save panel.
31642    // Note 'truthy' callback implies an open panel.
31643    const [entitiesSavedStatesCallback, setEntitiesSavedStatesCallback] = (0,external_wp_element_namespaceObject.useState)(false);
31644    const closeEntitiesSavedStates = (0,external_wp_element_namespaceObject.useCallback)(arg => {
31645      if (typeof entitiesSavedStatesCallback === 'function') {
31646        entitiesSavedStatesCallback(arg);
31647      }
31648      setEntitiesSavedStatesCallback(false);
31649    }, [entitiesSavedStatesCallback]);
31650    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(interface_skeleton, {
31651      isDistractionFree: isDistractionFree,
31652      className: dist_clsx('editor-editor-interface', className, {
31653        'is-entity-save-view-open': !!entitiesSavedStatesCallback,
31654        'is-distraction-free': isDistractionFree && !isPreviewMode
31655      }),
31656      labels: {
31657        ...interfaceLabels,
31658        secondarySidebar: secondarySidebarLabel
31659      },
31660      header: !isPreviewMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(components_header, {
31661        forceIsDirty: forceIsDirty,
31662        setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback,
31663        customSaveButton: customSaveButton,
31664        forceDisableBlockTools: forceDisableBlockTools,
31665        title: title
31666      }),
31667      editorNotices: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_notices, {}),
31668      secondarySidebar: !isPreviewMode && mode === 'visual' && (isInserterOpened && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InserterSidebar, {}) || isListViewOpened && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewSidebar, {})),
31669      sidebar: !isPreviewMode && !isDistractionFree && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area.Slot, {
31670        scope: "core"
31671      }),
31672      content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
31673        children: [!isDistractionFree && !isPreviewMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_notices, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(content_slot_fill.Slot, {
31674          children: ([editorCanvasView]) => editorCanvasView ? editorCanvasView : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
31675            children: [!isPreviewMode && (mode === 'text' || !isRichEditingEnabled) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TextEditor
31676            // We should auto-focus the canvas (title) on load.
31677            // eslint-disable-next-line jsx-a11y/no-autofocus
31678            , {
31679              autoFocus: autoFocus
31680            }), !isPreviewMode && !isLargeViewport && mode === 'visual' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockToolbar, {
31681              hideDragHandle: true
31682            }), (isPreviewMode || isRichEditingEnabled && mode === 'visual') && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(visual_editor, {
31683              styles: styles,
31684              contentRef: contentRef,
31685              disableIframe: disableIframe
31686              // We should auto-focus the canvas (title) on load.
31687              // eslint-disable-next-line jsx-a11y/no-autofocus
31688              ,
31689              autoFocus: autoFocus,
31690              iframeProps: iframeProps
31691            }), children]
31692          })
31693        })]
31694      }),
31695      footer: !isPreviewMode && !isDistractionFree && isLargeViewport && showBlockBreadcrumbs && isRichEditingEnabled && mode === 'visual' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockBreadcrumb, {
31696        rootLabelText: documentLabel
31697      }),
31698      actions: !isPreviewMode ? customSavePanel || /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SavePublishPanels, {
31699        closeEntitiesSavedStates: closeEntitiesSavedStates,
31700        isEntitiesSavedStatesOpen: entitiesSavedStatesCallback,
31701        setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback,
31702        forceIsDirtyPublishPanel: forceIsDirty
31703      }) : undefined
31704    });
31705  }
31706  
31707  ;// ./node_modules/@wordpress/editor/build-module/components/pattern-overrides-panel/index.js
31708  /**
31709   * WordPress dependencies
31710   */
31711  
31712  
31713  
31714  /**
31715   * Internal dependencies
31716   */
31717  
31718  
31719  
31720  const {
31721    OverridesPanel
31722  } = unlock(external_wp_patterns_namespaceObject.privateApis);
31723  function PatternOverridesPanel() {
31724    const supportsPatternOverridesPanel = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getCurrentPostType() === 'wp_block', []);
31725    if (!supportsPatternOverridesPanel) {
31726      return null;
31727    }
31728    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OverridesPanel, {});
31729  }
31730  
31731  ;// ./node_modules/@wordpress/editor/build-module/utils/get-item-title.js
31732  /**
31733   * WordPress dependencies
31734   */
31735  
31736  
31737  /**
31738   * Helper function to get the title of a post item.
31739   * This is duplicated from the `@wordpress/fields` package.
31740   * `packages/fields/src/actions/utils.ts`
31741   *
31742   * @param {Object} item The post item.
31743   * @return {string} The title of the item, or an empty string if the title is not found.
31744   */
31745  function get_item_title_getItemTitle(item) {
31746    if (typeof item.title === 'string') {
31747      return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title);
31748    }
31749    if (item.title && 'rendered' in item.title) {
31750      return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title.rendered);
31751    }
31752    if (item.title && 'raw' in item.title) {
31753      return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title.raw);
31754    }
31755    return '';
31756  }
31757  
31758  ;// ./node_modules/@wordpress/editor/build-module/components/post-actions/set-as-homepage.js
31759  /**
31760   * WordPress dependencies
31761   */
31762  
31763  
31764  
31765  
31766  
31767  
31768  
31769  /**
31770   * Internal dependencies
31771   */
31772  
31773  
31774  const SetAsHomepageModal = ({
31775    items,
31776    closeModal
31777  }) => {
31778    const [item] = items;
31779    const pageTitle = get_item_title_getItemTitle(item);
31780    const {
31781      showOnFront,
31782      currentHomePage,
31783      isSaving
31784    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
31785      const {
31786        getEntityRecord,
31787        isSavingEntityRecord
31788      } = select(external_wp_coreData_namespaceObject.store);
31789      const siteSettings = getEntityRecord('root', 'site');
31790      const currentHomePageItem = getEntityRecord('postType', 'page', siteSettings?.page_on_front);
31791      return {
31792        showOnFront: siteSettings?.show_on_front,
31793        currentHomePage: currentHomePageItem,
31794        isSaving: isSavingEntityRecord('root', 'site')
31795      };
31796    });
31797    const {
31798      saveEntityRecord
31799    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
31800    const {
31801      createSuccessNotice,
31802      createErrorNotice
31803    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
31804    async function onSetPageAsHomepage(event) {
31805      event.preventDefault();
31806      try {
31807        await saveEntityRecord('root', 'site', {
31808          page_on_front: item.id,
31809          show_on_front: 'page'
31810        });
31811        createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Homepage updated.'), {
31812          type: 'snackbar'
31813        });
31814      } catch (error) {
31815        const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while setting the homepage.');
31816        createErrorNotice(errorMessage, {
31817          type: 'snackbar'
31818        });
31819      } finally {
31820        closeModal?.();
31821      }
31822    }
31823    let modalWarning = '';
31824    if ('posts' === showOnFront) {
31825      modalWarning = (0,external_wp_i18n_namespaceObject.__)('This will replace the current homepage which is set to display latest posts.');
31826    } else if (currentHomePage) {
31827      modalWarning = (0,external_wp_i18n_namespaceObject.sprintf)(
31828      // translators: %s: title of the current home page.
31829      (0,external_wp_i18n_namespaceObject.__)('This will replace the current homepage: "%s"'), get_item_title_getItemTitle(currentHomePage));
31830    }
31831    const modalText = (0,external_wp_i18n_namespaceObject.sprintf)(
31832    // translators: %1$s: title of the page to be set as the homepage, %2$s: homepage replacement warning message.
31833    (0,external_wp_i18n_namespaceObject.__)('Set "%1$s" as the site homepage? %2$s'), pageTitle, modalWarning).trim();
31834  
31835    // translators: Button label to confirm setting the specified page as the homepage.
31836    const modalButtonLabel = (0,external_wp_i18n_namespaceObject.__)('Set homepage');
31837    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
31838      onSubmit: onSetPageAsHomepage,
31839      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
31840        spacing: "5",
31841        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
31842          children: modalText
31843        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
31844          justify: "right",
31845          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
31846            __next40pxDefaultSize: true,
31847            variant: "tertiary",
31848            onClick: () => {
31849              closeModal?.();
31850            },
31851            disabled: isSaving,
31852            accessibleWhenDisabled: true,
31853            children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
31854          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
31855            __next40pxDefaultSize: true,
31856            variant: "primary",
31857            type: "submit",
31858            disabled: isSaving,
31859            accessibleWhenDisabled: true,
31860            children: modalButtonLabel
31861          })]
31862        })]
31863      })
31864    });
31865  };
31866  const useSetAsHomepageAction = () => {
31867    const {
31868      pageOnFront,
31869      pageForPosts
31870    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
31871      const {
31872        getEntityRecord,
31873        canUser
31874      } = select(external_wp_coreData_namespaceObject.store);
31875      const siteSettings = canUser('read', {
31876        kind: 'root',
31877        name: 'site'
31878      }) ? getEntityRecord('root', 'site') : undefined;
31879      return {
31880        pageOnFront: siteSettings?.page_on_front,
31881        pageForPosts: siteSettings?.page_for_posts
31882      };
31883    });
31884    return (0,external_wp_element_namespaceObject.useMemo)(() => ({
31885      id: 'set-as-homepage',
31886      label: (0,external_wp_i18n_namespaceObject.__)('Set as homepage'),
31887      isEligible(post) {
31888        if (post.status !== 'publish') {
31889          return false;
31890        }
31891        if (post.type !== 'page') {
31892          return false;
31893        }
31894  
31895        // Don't show the action if the page is already set as the homepage.
31896        if (pageOnFront === post.id) {
31897          return false;
31898        }
31899  
31900        // Don't show the action if the page is already set as the page for posts.
31901        if (pageForPosts === post.id) {
31902          return false;
31903        }
31904        return true;
31905      },
31906      RenderModal: SetAsHomepageModal
31907    }), [pageForPosts, pageOnFront]);
31908  };
31909  
31910  ;// ./node_modules/@wordpress/editor/build-module/components/post-actions/set-as-posts-page.js
31911  /**
31912   * WordPress dependencies
31913   */
31914  
31915  
31916  
31917  
31918  
31919  
31920  
31921  /**
31922   * Internal dependencies
31923   */
31924  
31925  
31926  const SetAsPostsPageModal = ({
31927    items,
31928    closeModal
31929  }) => {
31930    const [item] = items;
31931    const pageTitle = get_item_title_getItemTitle(item);
31932    const {
31933      currentPostsPage,
31934      isPageForPostsSet,
31935      isSaving
31936    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
31937      const {
31938        getEntityRecord,
31939        isSavingEntityRecord
31940      } = select(external_wp_coreData_namespaceObject.store);
31941      const siteSettings = getEntityRecord('root', 'site');
31942      const currentPostsPageItem = getEntityRecord('postType', 'page', siteSettings?.page_for_posts);
31943      return {
31944        currentPostsPage: currentPostsPageItem,
31945        isPageForPostsSet: siteSettings?.page_for_posts !== 0,
31946        isSaving: isSavingEntityRecord('root', 'site')
31947      };
31948    });
31949    const {
31950      saveEntityRecord
31951    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
31952    const {
31953      createSuccessNotice,
31954      createErrorNotice
31955    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
31956    async function onSetPageAsPostsPage(event) {
31957      event.preventDefault();
31958      try {
31959        await saveEntityRecord('root', 'site', {
31960          page_for_posts: item.id,
31961          show_on_front: 'page'
31962        });
31963        createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Posts page updated.'), {
31964          type: 'snackbar'
31965        });
31966      } catch (error) {
31967        const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while setting the posts page.');
31968        createErrorNotice(errorMessage, {
31969          type: 'snackbar'
31970        });
31971      } finally {
31972        closeModal?.();
31973      }
31974    }
31975    const modalWarning = isPageForPostsSet && currentPostsPage ? (0,external_wp_i18n_namespaceObject.sprintf)(
31976    // translators: %s: title of the current posts page.
31977    (0,external_wp_i18n_namespaceObject.__)('This will replace the current posts page: "%s"'), get_item_title_getItemTitle(currentPostsPage)) : (0,external_wp_i18n_namespaceObject.__)('This page will show the latest posts.');
31978    const modalText = (0,external_wp_i18n_namespaceObject.sprintf)(
31979    // translators: %1$s: title of the page to be set as the posts page, %2$s: posts page replacement warning message.
31980    (0,external_wp_i18n_namespaceObject.__)('Set "%1$s" as the posts page? %2$s'), pageTitle, modalWarning);
31981  
31982    // translators: Button label to confirm setting the specified page as the posts page.
31983    const modalButtonLabel = (0,external_wp_i18n_namespaceObject.__)('Set posts page');
31984    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
31985      onSubmit: onSetPageAsPostsPage,
31986      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
31987        spacing: "5",
31988        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
31989          children: modalText
31990        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
31991          justify: "right",
31992          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
31993            __next40pxDefaultSize: true,
31994            variant: "tertiary",
31995            onClick: () => {
31996              closeModal?.();
31997            },
31998            disabled: isSaving,
31999            accessibleWhenDisabled: true,
32000            children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
32001          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
32002            __next40pxDefaultSize: true,
32003            variant: "primary",
32004            type: "submit",
32005            disabled: isSaving,
32006            accessibleWhenDisabled: true,
32007            children: modalButtonLabel
32008          })]
32009        })]
32010      })
32011    });
32012  };
32013  const useSetAsPostsPageAction = () => {
32014    const {
32015      pageOnFront,
32016      pageForPosts
32017    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
32018      const {
32019        getEntityRecord,
32020        canUser
32021      } = select(external_wp_coreData_namespaceObject.store);
32022      const siteSettings = canUser('read', {
32023        kind: 'root',
32024        name: 'site'
32025      }) ? getEntityRecord('root', 'site') : undefined;
32026      return {
32027        pageOnFront: siteSettings?.page_on_front,
32028        pageForPosts: siteSettings?.page_for_posts
32029      };
32030    });
32031    return (0,external_wp_element_namespaceObject.useMemo)(() => ({
32032      id: 'set-as-posts-page',
32033      label: (0,external_wp_i18n_namespaceObject.__)('Set as posts page'),
32034      isEligible(post) {
32035        if (post.status !== 'publish') {
32036          return false;
32037        }
32038        if (post.type !== 'page') {
32039          return false;
32040        }
32041  
32042        // Don't show the action if the page is already set as the homepage.
32043        if (pageOnFront === post.id) {
32044          return false;
32045        }
32046  
32047        // Don't show the action if the page is already set as the page for posts.
32048        if (pageForPosts === post.id) {
32049          return false;
32050        }
32051        return true;
32052      },
32053      RenderModal: SetAsPostsPageModal
32054    }), [pageForPosts, pageOnFront]);
32055  };
32056  
32057  ;// ./node_modules/@wordpress/editor/build-module/components/post-actions/actions.js
32058  /**
32059   * WordPress dependencies
32060   */
32061  
32062  
32063  
32064  
32065  /**
32066   * Internal dependencies
32067   */
32068  
32069  
32070  
32071  
32072  
32073  function usePostActions({
32074    postType,
32075    onActionPerformed,
32076    context
32077  }) {
32078    const {
32079      defaultActions
32080    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
32081      const {
32082        getEntityActions
32083      } = unlock(select(store_store));
32084      return {
32085        defaultActions: getEntityActions('postType', postType)
32086      };
32087    }, [postType]);
32088    const {
32089      canManageOptions,
32090      hasFrontPageTemplate
32091    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
32092      const {
32093        getEntityRecords
32094      } = select(external_wp_coreData_namespaceObject.store);
32095      const templates = getEntityRecords('postType', 'wp_template', {
32096        per_page: -1
32097      });
32098      return {
32099        canManageOptions: select(external_wp_coreData_namespaceObject.store).canUser('update', {
32100          kind: 'root',
32101          name: 'site'
32102        }),
32103        hasFrontPageTemplate: !!templates?.find(template => template?.slug === 'front-page')
32104      };
32105    });
32106    const setAsHomepageAction = useSetAsHomepageAction();
32107    const setAsPostsPageAction = useSetAsPostsPageAction();
32108    const shouldShowHomepageActions = canManageOptions && !hasFrontPageTemplate;
32109    const {
32110      registerPostTypeSchema
32111    } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
32112    (0,external_wp_element_namespaceObject.useEffect)(() => {
32113      registerPostTypeSchema(postType);
32114    }, [registerPostTypeSchema, postType]);
32115    return (0,external_wp_element_namespaceObject.useMemo)(() => {
32116      let actions = [...defaultActions];
32117      if (shouldShowHomepageActions) {
32118        actions.push(setAsHomepageAction, setAsPostsPageAction);
32119      }
32120  
32121      // Ensure "Move to trash" is always the last action.
32122      actions = actions.sort((a, b) => b.id === 'move-to-trash' ? -1 : 0);
32123  
32124      // Filter actions based on provided context. If not provided
32125      // all actions are returned. We'll have a single entry for getting the actions
32126      // and the consumer should provide the context to filter the actions, if needed.
32127      // Actions should also provide the `context` they support, if it's specific, to
32128      // compare with the provided context to get all the actions.
32129      // Right now the only supported context is `list`.
32130      actions = actions.filter(action => {
32131        if (!action.context) {
32132          return true;
32133        }
32134        return action.context === context;
32135      });
32136      if (onActionPerformed) {
32137        for (let i = 0; i < actions.length; ++i) {
32138          if (actions[i].callback) {
32139            const existingCallback = actions[i].callback;
32140            actions[i] = {
32141              ...actions[i],
32142              callback: (items, argsObject) => {
32143                existingCallback(items, {
32144                  ...argsObject,
32145                  onActionPerformed: _items => {
32146                    if (argsObject?.onActionPerformed) {
32147                      argsObject.onActionPerformed(_items);
32148                    }
32149                    onActionPerformed(actions[i].id, _items);
32150                  }
32151                });
32152              }
32153            };
32154          }
32155          if (actions[i].RenderModal) {
32156            const ExistingRenderModal = actions[i].RenderModal;
32157            actions[i] = {
32158              ...actions[i],
32159              RenderModal: props => {
32160                return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExistingRenderModal, {
32161                  ...props,
32162                  onActionPerformed: _items => {
32163                    if (props.onActionPerformed) {
32164                      props.onActionPerformed(_items);
32165                    }
32166                    onActionPerformed(actions[i].id, _items);
32167                  }
32168                });
32169              }
32170            };
32171          }
32172        }
32173      }
32174      return actions;
32175    }, [context, defaultActions, onActionPerformed, setAsHomepageAction, setAsPostsPageAction, shouldShowHomepageActions]);
32176  }
32177  
32178  ;// ./node_modules/@wordpress/editor/build-module/components/post-actions/index.js
32179  /**
32180   * WordPress dependencies
32181   */
32182  
32183  
32184  
32185  
32186  
32187  
32188  
32189  /**
32190   * Internal dependencies
32191   */
32192  
32193  
32194  
32195  const {
32196    Menu,
32197    kebabCase
32198  } = unlock(external_wp_components_namespaceObject.privateApis);
32199  function PostActions({
32200    postType,
32201    postId,
32202    onActionPerformed
32203  }) {
32204    const [activeModalAction, setActiveModalAction] = (0,external_wp_element_namespaceObject.useState)(null);
32205    const {
32206      item,
32207      permissions
32208    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
32209      const {
32210        getEditedEntityRecord,
32211        getEntityRecordPermissions
32212      } = unlock(select(external_wp_coreData_namespaceObject.store));
32213      return {
32214        item: getEditedEntityRecord('postType', postType, postId),
32215        permissions: getEntityRecordPermissions('postType', postType, postId)
32216      };
32217    }, [postId, postType]);
32218    const itemWithPermissions = (0,external_wp_element_namespaceObject.useMemo)(() => {
32219      return {
32220        ...item,
32221        permissions
32222      };
32223    }, [item, permissions]);
32224    const allActions = usePostActions({
32225      postType,
32226      onActionPerformed
32227    });
32228    const actions = (0,external_wp_element_namespaceObject.useMemo)(() => {
32229      return allActions.filter(action => {
32230        return !action.isEligible || action.isEligible(itemWithPermissions);
32231      });
32232    }, [allActions, itemWithPermissions]);
32233    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
32234      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Menu, {
32235        placement: "bottom-end",
32236        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.TriggerButton, {
32237          render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
32238            size: "small",
32239            icon: more_vertical,
32240            label: (0,external_wp_i18n_namespaceObject.__)('Actions'),
32241            disabled: !actions.length,
32242            accessibleWhenDisabled: true,
32243            className: "editor-all-actions-button"
32244          })
32245        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.Popover, {
32246          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionsDropdownMenuGroup, {
32247            actions: actions,
32248            items: [itemWithPermissions],
32249            setActiveModalAction: setActiveModalAction
32250          })
32251        })]
32252      }), !!activeModalAction && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionModal, {
32253        action: activeModalAction,
32254        items: [itemWithPermissions],
32255        closeModal: () => setActiveModalAction(null)
32256      })]
32257    });
32258  }
32259  
32260  // From now on all the functions on this file are copied as from the dataviews packages,
32261  // The editor packages should not be using the dataviews packages directly,
32262  // and the dataviews package should not be using the editor packages directly,
32263  // so duplicating the code here seems like the least bad option.
32264  
32265  function DropdownMenuItemTrigger({
32266    action,
32267    onClick,
32268    items
32269  }) {
32270    const label = typeof action.label === 'string' ? action.label : action.label(items);
32271    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.Item, {
32272      onClick: onClick,
32273      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.ItemLabel, {
32274        children: label
32275      })
32276    });
32277  }
32278  function ActionModal({
32279    action,
32280    items,
32281    closeModal
32282  }) {
32283    const label = typeof action.label === 'string' ? action.label : action.label(items);
32284    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
32285      title: action.modalHeader || label,
32286      __experimentalHideHeader: !!action.hideModalHeader,
32287      onRequestClose: closeModal !== null && closeModal !== void 0 ? closeModal : () => {},
32288      focusOnMount: "firstContentElement",
32289      size: "medium",
32290      overlayClassName: `editor-action-modal editor-action-modal__$kebabCase(action.id)}`,
32291      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action.RenderModal, {
32292        items: items,
32293        closeModal: closeModal
32294      })
32295    });
32296  }
32297  function ActionsDropdownMenuGroup({
32298    actions,
32299    items,
32300    setActiveModalAction
32301  }) {
32302    const registry = (0,external_wp_data_namespaceObject.useRegistry)();
32303    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.Group, {
32304      children: actions.map(action => {
32305        return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItemTrigger, {
32306          action: action,
32307          onClick: () => {
32308            if ('RenderModal' in action) {
32309              setActiveModalAction(action);
32310              return;
32311            }
32312            action.callback(items, {
32313              registry
32314            });
32315          },
32316          items: items
32317        }, action.id);
32318      })
32319    });
32320  }
32321  
32322  ;// ./node_modules/@wordpress/editor/build-module/components/post-card-panel/index.js
32323  /**
32324   * WordPress dependencies
32325   */
32326  
32327  
32328  
32329  
32330  
32331  
32332  
32333  /**
32334   * Internal dependencies
32335   */
32336  
32337  
32338  
32339  
32340  
32341  
32342  
32343  const {
32344    Badge: post_card_panel_Badge
32345  } = unlock(external_wp_components_namespaceObject.privateApis);
32346  
32347  /**
32348   * Renders a title of the post type and the available quick actions available within a 3-dot dropdown.
32349   *
32350   * @param {Object}          props                     - Component props.
32351   * @param {string}          [props.postType]          - The post type string.
32352   * @param {string|string[]} [props.postId]            - The post id or list of post ids.
32353   * @param {Function}        [props.onActionPerformed] - A callback function for when a quick action is performed.
32354   * @return {React.ReactNode} The rendered component.
32355   */
32356  function PostCardPanel({
32357    postType,
32358    postId,
32359    onActionPerformed
32360  }) {
32361    const postIds = (0,external_wp_element_namespaceObject.useMemo)(() => Array.isArray(postId) ? postId : [postId], [postId]);
32362    const {
32363      postTitle,
32364      icon,
32365      labels
32366    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
32367      const {
32368        getEditedEntityRecord,
32369        getCurrentTheme,
32370        getPostType
32371      } = select(external_wp_coreData_namespaceObject.store);
32372      const {
32373        getPostIcon
32374      } = unlock(select(store_store));
32375      let _title = '';
32376      const _record = getEditedEntityRecord('postType', postType, postIds[0]);
32377      if (postIds.length === 1) {
32378        var _getCurrentTheme;
32379        const {
32380          default_template_types: templateTypes = []
32381        } = (_getCurrentTheme = getCurrentTheme()) !== null && _getCurrentTheme !== void 0 ? _getCurrentTheme : {};
32382        const _templateInfo = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(postType) ? getTemplateInfo({
32383          template: _record,
32384          templateTypes
32385        }) : {};
32386        _title = _templateInfo?.title || _record?.title;
32387      }
32388      return {
32389        postTitle: _title,
32390        icon: getPostIcon(postType, {
32391          area: _record?.area
32392        }),
32393        labels: getPostType(postType)?.labels
32394      };
32395    }, [postIds, postType]);
32396    const pageTypeBadge = usePageTypeBadge(postId);
32397    let title = (0,external_wp_i18n_namespaceObject.__)('No title');
32398    if (labels?.name && postIds.length > 1) {
32399      title = (0,external_wp_i18n_namespaceObject.sprintf)(
32400      // translators: %i number of selected items %s: Name of the plural post type e.g: "Posts".
32401      (0,external_wp_i18n_namespaceObject.__)('%i %s'), postId.length, labels?.name);
32402    } else if (postTitle) {
32403      title = (0,external_wp_dom_namespaceObject.__unstableStripHTML)(postTitle);
32404    }
32405    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
32406      spacing: 1,
32407      className: "editor-post-card-panel",
32408      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
32409        spacing: 2,
32410        className: "editor-post-card-panel__header",
32411        align: "flex-start",
32412        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
32413          className: "editor-post-card-panel__icon",
32414          icon: icon
32415        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalText, {
32416          numberOfLines: 2,
32417          truncate: true,
32418          className: "editor-post-card-panel__title",
32419          as: "h2",
32420          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
32421            className: "editor-post-card-panel__title-name",
32422            children: title
32423          }), pageTypeBadge && postIds.length === 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_card_panel_Badge, {
32424            children: pageTypeBadge
32425          })]
32426        }), postIds.length === 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostActions, {
32427          postType: postType,
32428          postId: postIds[0],
32429          onActionPerformed: onActionPerformed
32430        })]
32431      }), postIds.length > 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
32432        className: "editor-post-card-panel__description",
32433        children: (0,external_wp_i18n_namespaceObject.sprintf)(
32434        // translators: %s: Name of the plural post type e.g: "Posts".
32435        (0,external_wp_i18n_namespaceObject.__)('Changes will be applied to all selected %s.'), labels?.name.toLowerCase())
32436      })]
32437    });
32438  }
32439  
32440  ;// ./node_modules/@wordpress/editor/build-module/components/post-content-information/index.js
32441  /**
32442   * WordPress dependencies
32443   */
32444  
32445  
32446  
32447  
32448  
32449  
32450  
32451  /**
32452   * Internal dependencies
32453   */
32454  
32455  
32456  
32457  // Taken from packages/editor/src/components/time-to-read/index.js.
32458  
32459  const post_content_information_AVERAGE_READING_RATE = 189;
32460  
32461  // This component renders the wordcount and reading time for the post.
32462  function PostContentInformation() {
32463    const {
32464      postContent
32465    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
32466      const {
32467        getEditedPostAttribute,
32468        getCurrentPostType,
32469        getCurrentPostId
32470      } = select(store_store);
32471      const {
32472        canUser
32473      } = select(external_wp_coreData_namespaceObject.store);
32474      const {
32475        getEntityRecord
32476      } = select(external_wp_coreData_namespaceObject.store);
32477      const siteSettings = canUser('read', {
32478        kind: 'root',
32479        name: 'site'
32480      }) ? getEntityRecord('root', 'site') : undefined;
32481      const postType = getCurrentPostType();
32482      const _id = getCurrentPostId();
32483      const isPostsPage = +_id === siteSettings?.page_for_posts;
32484      const showPostContentInfo = !isPostsPage && ![TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(postType);
32485      return {
32486        postContent: showPostContentInfo && getEditedPostAttribute('content')
32487      };
32488    }, []);
32489  
32490    /*
32491     * translators: If your word count is based on single characters (e.g. East Asian characters),
32492     * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
32493     * Do not translate into your own language.
32494     */
32495    const wordCountType = (0,external_wp_i18n_namespaceObject._x)('words', 'Word count type. Do not translate!');
32496    const wordsCounted = (0,external_wp_element_namespaceObject.useMemo)(() => postContent ? (0,external_wp_wordcount_namespaceObject.count)(postContent, wordCountType) : 0, [postContent, wordCountType]);
32497    if (!wordsCounted) {
32498      return null;
32499    }
32500    const readingTime = Math.round(wordsCounted / post_content_information_AVERAGE_READING_RATE);
32501    const wordsCountText = (0,external_wp_i18n_namespaceObject.sprintf)(
32502    // translators: %s: the number of words in the post.
32503    (0,external_wp_i18n_namespaceObject._n)('%s word', '%s words', wordsCounted), wordsCounted.toLocaleString());
32504    const minutesText = readingTime <= 1 ? (0,external_wp_i18n_namespaceObject.__)('1 minute') : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: the number of minutes to read the post. */
32505    (0,external_wp_i18n_namespaceObject._n)('%s minute', '%s minutes', readingTime), readingTime.toLocaleString());
32506    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
32507      className: "editor-post-content-information",
32508      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
32509        children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: How many words a post has. 2: the number of minutes to read the post (e.g. 130 words, 2 minutes read time.) */
32510        (0,external_wp_i18n_namespaceObject.__)('%1$s, %2$s read time.'), wordsCountText, minutesText)
32511      })
32512    });
32513  }
32514  
32515  ;// ./node_modules/@wordpress/editor/build-module/components/post-format/panel.js
32516  /**
32517   * WordPress dependencies
32518   */
32519  
32520  
32521  
32522  
32523  
32524  
32525  /**
32526   * Internal dependencies
32527   */
32528  
32529  
32530  
32531  
32532  
32533  /**
32534   * Renders the Post Author Panel component.
32535   *
32536   * @return {React.ReactNode} The rendered component.
32537   */
32538  
32539  function panel_PostFormat() {
32540    const {
32541      postFormat
32542    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
32543      const {
32544        getEditedPostAttribute
32545      } = select(store_store);
32546      const _postFormat = getEditedPostAttribute('format');
32547      return {
32548        postFormat: _postFormat !== null && _postFormat !== void 0 ? _postFormat : 'standard'
32549      };
32550    }, []);
32551    const activeFormat = POST_FORMATS.find(format => format.id === postFormat);
32552  
32553    // Use internal state instead of a ref to make sure that the component
32554    // re-renders when the popover's anchor updates.
32555    const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
32556    // Memoize popoverProps to avoid returning a new object every time.
32557    const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
32558      // Anchor the popover to the middle of the entire row so that it doesn't
32559      // move around when the label changes.
32560      anchor: popoverAnchor,
32561      placement: 'left-start',
32562      offset: 36,
32563      shift: true
32564    }), [popoverAnchor]);
32565    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostFormatCheck, {
32566      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
32567        label: (0,external_wp_i18n_namespaceObject.__)('Format'),
32568        ref: setPopoverAnchor,
32569        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
32570          popoverProps: popoverProps,
32571          contentClassName: "editor-post-format__dialog",
32572          focusOnMount: true,
32573          renderToggle: ({
32574            isOpen,
32575            onToggle
32576          }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
32577            size: "compact",
32578            variant: "tertiary",
32579            "aria-expanded": isOpen,
32580            "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
32581            // translators: %s: Current post format.
32582            (0,external_wp_i18n_namespaceObject.__)('Change format: %s'), activeFormat?.caption),
32583            onClick: onToggle,
32584            children: activeFormat?.caption
32585          }),
32586          renderContent: ({
32587            onClose
32588          }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
32589            className: "editor-post-format__dialog-content",
32590            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
32591              title: (0,external_wp_i18n_namespaceObject.__)('Format'),
32592              onClose: onClose
32593            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostFormat, {})]
32594          })
32595        })
32596      })
32597    });
32598  }
32599  /* harmony default export */ const post_format_panel = (panel_PostFormat);
32600  
32601  ;// ./node_modules/@wordpress/editor/build-module/components/post-last-edited-panel/index.js
32602  /**
32603   * WordPress dependencies
32604   */
32605  
32606  
32607  
32608  
32609  
32610  /**
32611   * Internal dependencies
32612   */
32613  
32614  
32615  function PostLastEditedPanel() {
32616    const modified = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getEditedPostAttribute('modified'), []);
32617    const lastEditedText = modified && (0,external_wp_i18n_namespaceObject.sprintf)(
32618    // translators: %s: Human-readable time difference, e.g. "2 days ago".
32619    (0,external_wp_i18n_namespaceObject.__)('Last edited %s.'), (0,external_wp_date_namespaceObject.humanTimeDiff)(modified));
32620    if (!lastEditedText) {
32621      return null;
32622    }
32623    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
32624      className: "editor-post-last-edited-panel",
32625      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
32626        children: lastEditedText
32627      })
32628    });
32629  }
32630  
32631  ;// ./node_modules/@wordpress/editor/build-module/components/post-panel-section/index.js
32632  /**
32633   * External dependencies
32634   */
32635  
32636  
32637  /**
32638   * WordPress dependencies
32639   */
32640  
32641  
32642  function PostPanelSection({
32643    className,
32644    children
32645  }) {
32646    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, {
32647      className: dist_clsx('editor-post-panel__section', className),
32648      children: children
32649    });
32650  }
32651  /* harmony default export */ const post_panel_section = (PostPanelSection);
32652  
32653  ;// ./node_modules/@wordpress/editor/build-module/components/blog-title/index.js
32654  /**
32655   * WordPress dependencies
32656   */
32657  
32658  
32659  
32660  
32661  
32662  
32663  
32664  
32665  
32666  /**
32667   * Internal dependencies
32668   */
32669  
32670  
32671  
32672  
32673  const blog_title_EMPTY_OBJECT = {};
32674  function BlogTitle() {
32675    const {
32676      editEntityRecord
32677    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
32678    const {
32679      postsPageTitle,
32680      postsPageId,
32681      isTemplate,
32682      postSlug
32683    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
32684      const {
32685        getEntityRecord,
32686        getEditedEntityRecord,
32687        canUser
32688      } = select(external_wp_coreData_namespaceObject.store);
32689      const siteSettings = canUser('read', {
32690        kind: 'root',
32691        name: 'site'
32692      }) ? getEntityRecord('root', 'site') : undefined;
32693      const _postsPageRecord = siteSettings?.page_for_posts ? getEditedEntityRecord('postType', 'page', siteSettings?.page_for_posts) : blog_title_EMPTY_OBJECT;
32694      const {
32695        getEditedPostAttribute,
32696        getCurrentPostType
32697      } = select(store_store);
32698      return {
32699        postsPageId: _postsPageRecord?.id,
32700        postsPageTitle: _postsPageRecord?.title,
32701        isTemplate: getCurrentPostType() === TEMPLATE_POST_TYPE,
32702        postSlug: getEditedPostAttribute('slug')
32703      };
32704    }, []);
32705    // Use internal state instead of a ref to make sure that the component
32706    // re-renders when the popover's anchor updates.
32707    const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
32708    // Memoize popoverProps to avoid returning a new object every time.
32709    const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
32710      // Anchor the popover to the middle of the entire row so that it doesn't
32711      // move around when the label changes.
32712      anchor: popoverAnchor,
32713      placement: 'left-start',
32714      offset: 36,
32715      shift: true
32716    }), [popoverAnchor]);
32717    if (!isTemplate || !['home', 'index'].includes(postSlug) || !postsPageId) {
32718      return null;
32719    }
32720    const setPostsPageTitle = newValue => {
32721      editEntityRecord('postType', 'page', postsPageId, {
32722        title: newValue
32723      });
32724    };
32725    const decodedTitle = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(postsPageTitle);
32726    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
32727      label: (0,external_wp_i18n_namespaceObject.__)('Blog title'),
32728      ref: setPopoverAnchor,
32729      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
32730        popoverProps: popoverProps,
32731        contentClassName: "editor-blog-title-dropdown__content",
32732        focusOnMount: true,
32733        renderToggle: ({
32734          isOpen,
32735          onToggle
32736        }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
32737          size: "compact",
32738          variant: "tertiary",
32739          "aria-expanded": isOpen,
32740          "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
32741          // translators: %s: Current post link.
32742          (0,external_wp_i18n_namespaceObject.__)('Change blog title: %s'), decodedTitle),
32743          onClick: onToggle,
32744          children: decodedTitle
32745        }),
32746        renderContent: ({
32747          onClose
32748        }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
32749          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
32750            title: (0,external_wp_i18n_namespaceObject.__)('Blog title'),
32751            onClose: onClose
32752          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, {
32753            placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'),
32754            size: "__unstable-large",
32755            value: postsPageTitle,
32756            onChange: (0,external_wp_compose_namespaceObject.debounce)(setPostsPageTitle, 300),
32757            label: (0,external_wp_i18n_namespaceObject.__)('Blog title'),
32758            help: (0,external_wp_i18n_namespaceObject.__)('Set the Posts Page title. Appears in search results, and when the page is shared on social media.'),
32759            hideLabelFromVision: true
32760          })]
32761        })
32762      })
32763    });
32764  }
32765  
32766  ;// ./node_modules/@wordpress/editor/build-module/components/posts-per-page/index.js
32767  /**
32768   * WordPress dependencies
32769   */
32770  
32771  
32772  
32773  
32774  
32775  
32776  
32777  /**
32778   * Internal dependencies
32779   */
32780  
32781  
32782  
32783  
32784  function PostsPerPage() {
32785    const {
32786      editEntityRecord
32787    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
32788    const {
32789      postsPerPage,
32790      isTemplate,
32791      postSlug
32792    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
32793      const {
32794        getEditedPostAttribute,
32795        getCurrentPostType
32796      } = select(store_store);
32797      const {
32798        getEditedEntityRecord,
32799        canUser
32800      } = select(external_wp_coreData_namespaceObject.store);
32801      const siteSettings = canUser('read', {
32802        kind: 'root',
32803        name: 'site'
32804      }) ? getEditedEntityRecord('root', 'site') : undefined;
32805      return {
32806        isTemplate: getCurrentPostType() === TEMPLATE_POST_TYPE,
32807        postSlug: getEditedPostAttribute('slug'),
32808        postsPerPage: siteSettings?.posts_per_page || 1
32809      };
32810    }, []);
32811    // Use internal state instead of a ref to make sure that the component
32812    // re-renders when the popover's anchor updates.
32813    const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
32814    // Memoize popoverProps to avoid returning a new object every time.
32815    const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
32816      // Anchor the popover to the middle of the entire row so that it doesn't
32817      // move around when the label changes.
32818      anchor: popoverAnchor,
32819      placement: 'left-start',
32820      offset: 36,
32821      shift: true
32822    }), [popoverAnchor]);
32823    if (!isTemplate || !['home', 'index'].includes(postSlug)) {
32824      return null;
32825    }
32826    const setPostsPerPage = newValue => {
32827      editEntityRecord('root', 'site', undefined, {
32828        posts_per_page: newValue
32829      });
32830    };
32831    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
32832      label: (0,external_wp_i18n_namespaceObject.__)('Posts per page'),
32833      ref: setPopoverAnchor,
32834      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
32835        popoverProps: popoverProps,
32836        contentClassName: "editor-posts-per-page-dropdown__content",
32837        focusOnMount: true,
32838        renderToggle: ({
32839          isOpen,
32840          onToggle
32841        }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
32842          size: "compact",
32843          variant: "tertiary",
32844          "aria-expanded": isOpen,
32845          "aria-label": (0,external_wp_i18n_namespaceObject.__)('Change posts per page'),
32846          onClick: onToggle,
32847          children: postsPerPage
32848        }),
32849        renderContent: ({
32850          onClose
32851        }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
32852          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
32853            title: (0,external_wp_i18n_namespaceObject.__)('Posts per page'),
32854            onClose: onClose
32855          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, {
32856            placeholder: 0,
32857            value: postsPerPage,
32858            size: "__unstable-large",
32859            spinControls: "custom",
32860            step: "1",
32861            min: "1",
32862            onChange: setPostsPerPage,
32863            label: (0,external_wp_i18n_namespaceObject.__)('Posts per page'),
32864            help: (0,external_wp_i18n_namespaceObject.__)('Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting.'),
32865            hideLabelFromVision: true
32866          })]
32867        })
32868      })
32869    });
32870  }
32871  
32872  ;// ./node_modules/@wordpress/editor/build-module/components/site-discussion/index.js
32873  /**
32874   * WordPress dependencies
32875   */
32876  
32877  
32878  
32879  
32880  
32881  
32882  
32883  /**
32884   * Internal dependencies
32885   */
32886  
32887  
32888  
32889  
32890  const site_discussion_COMMENT_OPTIONS = [{
32891    label: (0,external_wp_i18n_namespaceObject._x)('Open', 'Adjective: e.g. "Comments are open"'),
32892    value: 'open',
32893    description: (0,external_wp_i18n_namespaceObject.__)('Visitors can add new comments and replies.')
32894  }, {
32895    label: (0,external_wp_i18n_namespaceObject.__)('Closed'),
32896    value: '',
32897    description: [(0,external_wp_i18n_namespaceObject.__)('Visitors cannot add new comments or replies.'), (0,external_wp_i18n_namespaceObject.__)('Existing comments remain visible.')].join(' ')
32898  }];
32899  function SiteDiscussion() {
32900    const {
32901      editEntityRecord
32902    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
32903    const {
32904      allowCommentsOnNewPosts,
32905      isTemplate,
32906      postSlug
32907    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
32908      const {
32909        getEditedPostAttribute,
32910        getCurrentPostType
32911      } = select(store_store);
32912      const {
32913        getEditedEntityRecord,
32914        canUser
32915      } = select(external_wp_coreData_namespaceObject.store);
32916      const siteSettings = canUser('read', {
32917        kind: 'root',
32918        name: 'site'
32919      }) ? getEditedEntityRecord('root', 'site') : undefined;
32920      return {
32921        isTemplate: getCurrentPostType() === TEMPLATE_POST_TYPE,
32922        postSlug: getEditedPostAttribute('slug'),
32923        allowCommentsOnNewPosts: siteSettings?.default_comment_status || ''
32924      };
32925    }, []);
32926    // Use internal state instead of a ref to make sure that the component
32927    // re-renders when the popover's anchor updates.
32928    const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
32929    // Memoize popoverProps to avoid returning a new object every time.
32930    const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
32931      // Anchor the popover to the middle of the entire row so that it doesn't
32932      // move around when the label changes.
32933      anchor: popoverAnchor,
32934      placement: 'left-start',
32935      offset: 36,
32936      shift: true
32937    }), [popoverAnchor]);
32938    if (!isTemplate || !['home', 'index'].includes(postSlug)) {
32939      return null;
32940    }
32941    const setAllowCommentsOnNewPosts = newValue => {
32942      editEntityRecord('root', 'site', undefined, {
32943        default_comment_status: newValue ? 'open' : null
32944      });
32945    };
32946    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
32947      label: (0,external_wp_i18n_namespaceObject.__)('Discussion'),
32948      ref: setPopoverAnchor,
32949      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
32950        popoverProps: popoverProps,
32951        contentClassName: "editor-site-discussion-dropdown__content",
32952        focusOnMount: true,
32953        renderToggle: ({
32954          isOpen,
32955          onToggle
32956        }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
32957          size: "compact",
32958          variant: "tertiary",
32959          "aria-expanded": isOpen,
32960          "aria-label": (0,external_wp_i18n_namespaceObject.__)('Change discussion settings'),
32961          onClick: onToggle,
32962          children: allowCommentsOnNewPosts ? (0,external_wp_i18n_namespaceObject.__)('Comments open') : (0,external_wp_i18n_namespaceObject.__)('Comments closed')
32963        }),
32964        renderContent: ({
32965          onClose
32966        }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
32967          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
32968            title: (0,external_wp_i18n_namespaceObject.__)('Discussion'),
32969            onClose: onClose
32970          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
32971            spacing: 3,
32972            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
32973              children: (0,external_wp_i18n_namespaceObject.__)('Changes will apply to new posts only. Individual posts may override these settings.')
32974            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RadioControl, {
32975              className: "editor-site-discussion__options",
32976              hideLabelFromVision: true,
32977              label: (0,external_wp_i18n_namespaceObject.__)('Comment status'),
32978              options: site_discussion_COMMENT_OPTIONS,
32979              onChange: setAllowCommentsOnNewPosts,
32980              selected: allowCommentsOnNewPosts
32981            })]
32982          })]
32983        })
32984      })
32985    });
32986  }
32987  
32988  ;// ./node_modules/@wordpress/editor/build-module/components/sidebar/post-summary.js
32989  /**
32990   * WordPress dependencies
32991   */
32992  
32993  
32994  
32995  /**
32996   * Internal dependencies
32997   */
32998  
32999  
33000  
33001  
33002  
33003  
33004  
33005  
33006  
33007  
33008  
33009  
33010  
33011  
33012  
33013  
33014  
33015  
33016  
33017  
33018  
33019  
33020  
33021  /**
33022   * Module Constants
33023   */
33024  
33025  const post_summary_PANEL_NAME = 'post-status';
33026  function PostSummary({
33027    onActionPerformed
33028  }) {
33029    const {
33030      isRemovedPostStatusPanel,
33031      postType,
33032      postId
33033    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
33034      // We use isEditorPanelRemoved to hide the panel if it was programmatically removed. We do
33035      // not use isEditorPanelEnabled since this panel should not be disabled through the UI.
33036      const {
33037        isEditorPanelRemoved,
33038        getCurrentPostType,
33039        getCurrentPostId
33040      } = select(store_store);
33041      return {
33042        isRemovedPostStatusPanel: isEditorPanelRemoved(post_summary_PANEL_NAME),
33043        postType: getCurrentPostType(),
33044        postId: getCurrentPostId()
33045      };
33046    }, []);
33047    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_section, {
33048      className: "editor-post-summary",
33049      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_post_status_info.Slot, {
33050        children: fills => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
33051          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
33052            spacing: 4,
33053            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostCardPanel, {
33054              postType: postType,
33055              postId: postId,
33056              onActionPerformed: onActionPerformed
33057            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostFeaturedImagePanel, {
33058              withPanelBody: false
33059            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivatePostExcerptPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
33060              spacing: 1,
33061              children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostContentInformation, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostLastEditedPanel, {})]
33062            }), !isRemovedPostStatusPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
33063              spacing: 4,
33064              children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
33065                spacing: 1,
33066                children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostStatus, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSchedulePanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostURLPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(panel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTemplatePanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostDiscussionPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivatePostLastRevision, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PageAttributesPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSyncStatus, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlogTitle, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostsPerPage, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SiteDiscussion, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_format_panel, {}), fills]
33067              }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTrash, {
33068                onActionPerformed: onActionPerformed
33069              })]
33070            })]
33071          })
33072        })
33073      })
33074    });
33075  }
33076  
33077  ;// ./node_modules/@wordpress/editor/build-module/components/post-transform-panel/hooks.js
33078  /**
33079   * WordPress dependencies
33080   */
33081  
33082  
33083  
33084  
33085  
33086  
33087  /**
33088   * Internal dependencies
33089   */
33090  
33091  
33092  const {
33093    EXCLUDED_PATTERN_SOURCES,
33094    PATTERN_TYPES: hooks_PATTERN_TYPES
33095  } = unlock(external_wp_patterns_namespaceObject.privateApis);
33096  function injectThemeAttributeInBlockTemplateContent(block, currentThemeStylesheet) {
33097    block.innerBlocks = block.innerBlocks.map(innerBlock => {
33098      return injectThemeAttributeInBlockTemplateContent(innerBlock, currentThemeStylesheet);
33099    });
33100    if (block.name === 'core/template-part' && block.attributes.theme === undefined) {
33101      block.attributes.theme = currentThemeStylesheet;
33102    }
33103    return block;
33104  }
33105  
33106  /**
33107   * Filter all patterns and return only the ones that are compatible with the current template.
33108   *
33109   * @param {Array}  patterns An array of patterns.
33110   * @param {Object} template The current template.
33111   * @return {Array} Array of patterns that are compatible with the current template.
33112   */
33113  function filterPatterns(patterns, template) {
33114    // Filter out duplicates.
33115    const filterOutDuplicatesByName = (currentItem, index, items) => index === items.findIndex(item => currentItem.name === item.name);
33116  
33117    // Filter out core/directory patterns not included in theme.json.
33118    const filterOutExcludedPatternSources = pattern => !EXCLUDED_PATTERN_SOURCES.includes(pattern.source);
33119  
33120    // Looks for patterns that have the same template type as the current template,
33121    // or have a block type that matches the current template area.
33122    const filterCompatiblePatterns = pattern => pattern.templateTypes?.includes(template.slug) || pattern.blockTypes?.includes('core/template-part/' + template.area);
33123    return patterns.filter((pattern, index, items) => {
33124      return filterOutDuplicatesByName(pattern, index, items) && filterOutExcludedPatternSources(pattern) && filterCompatiblePatterns(pattern);
33125    });
33126  }
33127  function preparePatterns(patterns, currentThemeStylesheet) {
33128    return patterns.map(pattern => ({
33129      ...pattern,
33130      keywords: pattern.keywords || [],
33131      type: hooks_PATTERN_TYPES.theme,
33132      blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content, {
33133        __unstableSkipMigrationLogs: true
33134      }).map(block => injectThemeAttributeInBlockTemplateContent(block, currentThemeStylesheet))
33135    }));
33136  }
33137  function useAvailablePatterns(template) {
33138    const {
33139      blockPatterns,
33140      restBlockPatterns,
33141      currentThemeStylesheet
33142    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
33143      var _settings$__experimen;
33144      const {
33145        getEditorSettings
33146      } = select(store_store);
33147      const settings = getEditorSettings();
33148      return {
33149        blockPatterns: (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : settings.__experimentalBlockPatterns,
33150        restBlockPatterns: select(external_wp_coreData_namespaceObject.store).getBlockPatterns(),
33151        currentThemeStylesheet: select(external_wp_coreData_namespaceObject.store).getCurrentTheme().stylesheet
33152      };
33153    }, []);
33154    return (0,external_wp_element_namespaceObject.useMemo)(() => {
33155      const mergedPatterns = [...(blockPatterns || []), ...(restBlockPatterns || [])];
33156      const filteredPatterns = filterPatterns(mergedPatterns, template);
33157      return preparePatterns(filteredPatterns, template, currentThemeStylesheet);
33158    }, [blockPatterns, restBlockPatterns, template, currentThemeStylesheet]);
33159  }
33160  
33161  ;// ./node_modules/@wordpress/editor/build-module/components/post-transform-panel/index.js
33162  /**
33163   * WordPress dependencies
33164   */
33165  
33166  
33167  
33168  
33169  
33170  
33171  
33172  /**
33173   * Internal dependencies
33174   */
33175  
33176  
33177  
33178  
33179  function post_transform_panel_TemplatesList({
33180    availableTemplates,
33181    onSelect
33182  }) {
33183    if (!availableTemplates || availableTemplates?.length === 0) {
33184      return null;
33185    }
33186    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
33187      label: (0,external_wp_i18n_namespaceObject.__)('Templates'),
33188      blockPatterns: availableTemplates,
33189      onClickPattern: onSelect,
33190      showTitlesAsTooltip: true
33191    });
33192  }
33193  function PostTransform() {
33194    const {
33195      record,
33196      postType,
33197      postId
33198    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
33199      const {
33200        getCurrentPostType,
33201        getCurrentPostId
33202      } = select(store_store);
33203      const {
33204        getEditedEntityRecord
33205      } = select(external_wp_coreData_namespaceObject.store);
33206      const type = getCurrentPostType();
33207      const id = getCurrentPostId();
33208      return {
33209        postType: type,
33210        postId: id,
33211        record: getEditedEntityRecord('postType', type, id)
33212      };
33213    }, []);
33214    const {
33215      editEntityRecord
33216    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
33217    const availablePatterns = useAvailablePatterns(record);
33218    const onTemplateSelect = async selectedTemplate => {
33219      await editEntityRecord('postType', postType, postId, {
33220        blocks: selectedTemplate.blocks,
33221        content: (0,external_wp_blocks_namespaceObject.serialize)(selectedTemplate.blocks)
33222      });
33223    };
33224    if (!availablePatterns?.length) {
33225      return null;
33226    }
33227    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
33228      title: (0,external_wp_i18n_namespaceObject.__)('Design'),
33229      initialOpen: record.type === TEMPLATE_PART_POST_TYPE,
33230      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_transform_panel_TemplatesList, {
33231        availableTemplates: availablePatterns,
33232        onSelect: onTemplateSelect
33233      })
33234    });
33235  }
33236  function PostTransformPanel() {
33237    const {
33238      postType
33239    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
33240      const {
33241        getCurrentPostType
33242      } = select(store_store);
33243      return {
33244        postType: getCurrentPostType()
33245      };
33246    }, []);
33247    if (![TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE].includes(postType)) {
33248      return null;
33249    }
33250    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTransform, {});
33251  }
33252  
33253  ;// ./node_modules/@wordpress/editor/build-module/components/sidebar/constants.js
33254  const sidebars = {
33255    document: 'edit-post/document',
33256    block: 'edit-post/block'
33257  };
33258  
33259  ;// ./node_modules/@wordpress/editor/build-module/components/sidebar/header.js
33260  /**
33261   * WordPress dependencies
33262   */
33263  
33264  
33265  
33266  
33267  
33268  /**
33269   * Internal dependencies
33270   */
33271  
33272  
33273  
33274  
33275  const {
33276    Tabs
33277  } = unlock(external_wp_components_namespaceObject.privateApis);
33278  const SidebarHeader = (_, ref) => {
33279    const {
33280      documentLabel
33281    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
33282      const {
33283        getPostTypeLabel
33284      } = select(store_store);
33285      return {
33286        documentLabel:
33287        // translators: Default label for the Document sidebar tab, not selected.
33288        getPostTypeLabel() || (0,external_wp_i18n_namespaceObject._x)('Document', 'noun, panel')
33289      };
33290    }, []);
33291    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs.TabList, {
33292      ref: ref,
33293      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, {
33294        tabId: sidebars.document
33295        // Used for focus management in the SettingsSidebar component.
33296        ,
33297        "data-tab-id": sidebars.document,
33298        children: documentLabel
33299      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, {
33300        tabId: sidebars.block
33301        // Used for focus management in the SettingsSidebar component.
33302        ,
33303        "data-tab-id": sidebars.block,
33304        children: (0,external_wp_i18n_namespaceObject.__)('Block')
33305      })]
33306    });
33307  };
33308  /* harmony default export */ const sidebar_header = ((0,external_wp_element_namespaceObject.forwardRef)(SidebarHeader));
33309  
33310  ;// ./node_modules/@wordpress/editor/build-module/components/template-content-panel/index.js
33311  /**
33312   * WordPress dependencies
33313   */
33314  
33315  
33316  
33317  
33318  
33319  
33320  
33321  
33322  /**
33323   * Internal dependencies
33324   */
33325  
33326  
33327  
33328  
33329  const {
33330    BlockQuickNavigation
33331  } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
33332  const template_content_panel_POST_CONTENT_BLOCK_TYPES = ['core/post-title', 'core/post-featured-image', 'core/post-content'];
33333  const TEMPLATE_PART_BLOCK = 'core/template-part';
33334  function TemplateContentPanel() {
33335    const postContentBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_hooks_namespaceObject.applyFilters)('editor.postContentBlockTypes', template_content_panel_POST_CONTENT_BLOCK_TYPES), []);
33336    const {
33337      clientIds,
33338      postType,
33339      renderingMode
33340    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
33341      const {
33342        getCurrentPostType,
33343        getPostBlocksByName,
33344        getRenderingMode
33345      } = unlock(select(store_store));
33346      const _postType = getCurrentPostType();
33347      return {
33348        postType: _postType,
33349        clientIds: getPostBlocksByName(TEMPLATE_POST_TYPE === _postType ? TEMPLATE_PART_BLOCK : postContentBlockTypes),
33350        renderingMode: getRenderingMode()
33351      };
33352    }, [postContentBlockTypes]);
33353    const {
33354      enableComplementaryArea
33355    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
33356    if (renderingMode === 'post-only' && postType !== TEMPLATE_POST_TYPE || clientIds.length === 0) {
33357      return null;
33358    }
33359    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
33360      title: (0,external_wp_i18n_namespaceObject.__)('Content'),
33361      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockQuickNavigation, {
33362        clientIds: clientIds,
33363        onSelect: () => {
33364          enableComplementaryArea('core', 'edit-post/document');
33365        }
33366      })
33367    });
33368  }
33369  
33370  ;// ./node_modules/@wordpress/editor/build-module/components/template-part-content-panel/index.js
33371  /**
33372   * WordPress dependencies
33373   */
33374  
33375  
33376  
33377  
33378  
33379  
33380  
33381  /**
33382   * Internal dependencies
33383   */
33384  
33385  
33386  
33387  
33388  const {
33389    BlockQuickNavigation: template_part_content_panel_BlockQuickNavigation
33390  } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
33391  function TemplatePartContentPanelInner() {
33392    const blockTypes = (0,external_wp_data_namespaceObject.useSelect)(select => {
33393      const {
33394        getBlockTypes
33395      } = select(external_wp_blocks_namespaceObject.store);
33396      return getBlockTypes();
33397    }, []);
33398    const themeBlockNames = (0,external_wp_element_namespaceObject.useMemo)(() => {
33399      return blockTypes.filter(blockType => {
33400        return blockType.category === 'theme';
33401      }).map(({
33402        name
33403      }) => name);
33404    }, [blockTypes]);
33405    const themeBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => {
33406      const {
33407        getBlocksByName
33408      } = select(external_wp_blockEditor_namespaceObject.store);
33409      return getBlocksByName(themeBlockNames);
33410    }, [themeBlockNames]);
33411    if (themeBlocks.length === 0) {
33412      return null;
33413    }
33414    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
33415      title: (0,external_wp_i18n_namespaceObject.__)('Content'),
33416      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(template_part_content_panel_BlockQuickNavigation, {
33417        clientIds: themeBlocks
33418      })
33419    });
33420  }
33421  function TemplatePartContentPanel() {
33422    const postType = (0,external_wp_data_namespaceObject.useSelect)(select => {
33423      const {
33424        getCurrentPostType
33425      } = select(store_store);
33426      return getCurrentPostType();
33427    }, []);
33428    if (postType !== TEMPLATE_PART_POST_TYPE) {
33429      return null;
33430    }
33431    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartContentPanelInner, {});
33432  }
33433  
33434  ;// ./node_modules/@wordpress/editor/build-module/components/provider/use-auto-switch-editor-sidebars.js
33435  /**
33436   * WordPress dependencies
33437   */
33438  
33439  
33440  
33441  
33442  
33443  
33444  /**
33445   * This listener hook monitors for block selection and triggers the appropriate
33446   * sidebar state.
33447   */
33448  function useAutoSwitchEditorSidebars() {
33449    const {
33450      hasBlockSelection
33451    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
33452      return {
33453        hasBlockSelection: !!select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart()
33454      };
33455    }, []);
33456    const {
33457      getActiveComplementaryArea
33458    } = (0,external_wp_data_namespaceObject.useSelect)(store);
33459    const {
33460      enableComplementaryArea
33461    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
33462    const {
33463      get: getPreference
33464    } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_preferences_namespaceObject.store);
33465    (0,external_wp_element_namespaceObject.useEffect)(() => {
33466      const activeGeneralSidebar = getActiveComplementaryArea('core');
33467      const isEditorSidebarOpened = ['edit-post/document', 'edit-post/block'].includes(activeGeneralSidebar);
33468      const isDistractionFree = getPreference('core', 'distractionFree');
33469      if (!isEditorSidebarOpened || isDistractionFree) {
33470        return;
33471      }
33472      if (hasBlockSelection) {
33473        enableComplementaryArea('core', 'edit-post/block');
33474      } else {
33475        enableComplementaryArea('core', 'edit-post/document');
33476      }
33477    }, [hasBlockSelection, getActiveComplementaryArea, enableComplementaryArea, getPreference]);
33478  }
33479  /* harmony default export */ const use_auto_switch_editor_sidebars = (useAutoSwitchEditorSidebars);
33480  
33481  ;// ./node_modules/@wordpress/editor/build-module/components/sidebar/index.js
33482  /**
33483   * WordPress dependencies
33484   */
33485  
33486  
33487  
33488  
33489  
33490  
33491  
33492  
33493  
33494  /**
33495   * Internal dependencies
33496   */
33497  
33498  
33499  
33500  
33501  
33502  
33503  
33504  
33505  
33506  
33507  
33508  
33509  
33510  
33511  
33512  const {
33513    Tabs: sidebar_Tabs
33514  } = unlock(external_wp_components_namespaceObject.privateApis);
33515  const SIDEBAR_ACTIVE_BY_DEFAULT = external_wp_element_namespaceObject.Platform.select({
33516    web: true,
33517    native: false
33518  });
33519  const SidebarContent = ({
33520    tabName,
33521    keyboardShortcut,
33522    onActionPerformed,
33523    extraPanels
33524  }) => {
33525    const tabListRef = (0,external_wp_element_namespaceObject.useRef)(null);
33526    // Because `PluginSidebar` renders a `ComplementaryArea`, we
33527    // need to forward the `Tabs` context so it can be passed through the
33528    // underlying slot/fill.
33529    const tabsContextValue = (0,external_wp_element_namespaceObject.useContext)(sidebar_Tabs.Context);
33530  
33531    // This effect addresses a race condition caused by tabbing from the last
33532    // block in the editor into the settings sidebar. Without this effect, the
33533    // selected tab and browser focus can become separated in an unexpected way
33534    // (e.g the "block" tab is focused, but the "post" tab is selected).
33535    (0,external_wp_element_namespaceObject.useEffect)(() => {
33536      const tabsElements = Array.from(tabListRef.current?.querySelectorAll('[role="tab"]') || []);
33537      const selectedTabElement = tabsElements.find(
33538      // We are purposefully using a custom `data-tab-id` attribute here
33539      // because we don't want rely on any assumptions about `Tabs`
33540      // component internals.
33541      element => element.getAttribute('data-tab-id') === tabName);
33542      const activeElement = selectedTabElement?.ownerDocument.activeElement;
33543      const tabsHasFocus = tabsElements.some(element => {
33544        return activeElement && activeElement.id === element.id;
33545      });
33546      if (tabsHasFocus && selectedTabElement && selectedTabElement.id !== activeElement?.id) {
33547        selectedTabElement?.focus();
33548      }
33549    }, [tabName]);
33550    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PluginSidebar, {
33551      identifier: tabName,
33552      header: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(sidebar_Tabs.Context.Provider, {
33553        value: tabsContextValue,
33554        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(sidebar_header, {
33555          ref: tabListRef
33556        })
33557      }),
33558      closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close Settings')
33559      // This classname is added so we can apply a corrective negative
33560      // margin to the panel.
33561      // see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049
33562      ,
33563      className: "editor-sidebar__panel",
33564      headerClassName: "editor-sidebar__panel-tabs",
33565      title: /* translators: button label text should, if possible, be under 16 characters. */
33566      (0,external_wp_i18n_namespaceObject._x)('Settings', 'panel button label'),
33567      toggleShortcut: keyboardShortcut,
33568      icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? drawer_left : drawer_right,
33569      isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT,
33570      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(sidebar_Tabs.Context.Provider, {
33571        value: tabsContextValue,
33572        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(sidebar_Tabs.TabPanel, {
33573          tabId: sidebars.document,
33574          focusable: false,
33575          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSummary, {
33576            onActionPerformed: onActionPerformed
33577          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_document_setting_panel.Slot, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateContentPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartContentPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTransformPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(panel_PostTaxonomies, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternOverridesPanel, {}), extraPanels]
33578        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(sidebar_Tabs.TabPanel, {
33579          tabId: sidebars.block,
33580          focusable: false,
33581          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockInspector, {})
33582        })]
33583      })
33584    });
33585  };
33586  const Sidebar = ({
33587    extraPanels,
33588    onActionPerformed
33589  }) => {
33590    use_auto_switch_editor_sidebars();
33591    const {
33592      tabName,
33593      keyboardShortcut,
33594      showSummary
33595    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
33596      const shortcut = select(external_wp_keyboardShortcuts_namespaceObject.store).getShortcutRepresentation('core/editor/toggle-sidebar');
33597      const sidebar = select(store).getActiveComplementaryArea('core');
33598      const _isEditorSidebarOpened = [sidebars.block, sidebars.document].includes(sidebar);
33599      let _tabName = sidebar;
33600      if (!_isEditorSidebarOpened) {
33601        _tabName = !!select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart() ? sidebars.block : sidebars.document;
33602      }
33603      return {
33604        tabName: _tabName,
33605        keyboardShortcut: shortcut,
33606        showSummary: ![TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE].includes(select(store_store).getCurrentPostType())
33607      };
33608    }, []);
33609    const {
33610      enableComplementaryArea
33611    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
33612    const onTabSelect = (0,external_wp_element_namespaceObject.useCallback)(newSelectedTabId => {
33613      if (!!newSelectedTabId) {
33614        enableComplementaryArea('core', newSelectedTabId);
33615      }
33616    }, [enableComplementaryArea]);
33617    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(sidebar_Tabs, {
33618      selectedTabId: tabName,
33619      onSelect: onTabSelect,
33620      selectOnMove: false,
33621      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContent, {
33622        tabName: tabName,
33623        keyboardShortcut: keyboardShortcut,
33624        showSummary: showSummary,
33625        onActionPerformed: onActionPerformed,
33626        extraPanels: extraPanels
33627      })
33628    });
33629  };
33630  /* harmony default export */ const components_sidebar = (Sidebar);
33631  
33632  ;// ./node_modules/@wordpress/editor/build-module/components/editor/index.js
33633  /**
33634   * WordPress dependencies
33635   */
33636  
33637  
33638  
33639  
33640  
33641  /**
33642   * Internal dependencies
33643   */
33644  
33645  
33646  
33647  
33648  
33649  function Editor({
33650    postType,
33651    postId,
33652    templateId,
33653    settings,
33654    children,
33655    initialEdits,
33656    // This could be part of the settings.
33657    onActionPerformed,
33658    // The following abstractions are not ideal but necessary
33659    // to account for site editor and post editor differences for now.
33660    extraContent,
33661    extraSidebarPanels,
33662    ...props
33663  }) {
33664    const {
33665      post,
33666      template,
33667      hasLoadedPost,
33668      error
33669    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
33670      const {
33671        getEntityRecord,
33672        getResolutionError,
33673        hasFinishedResolution
33674      } = select(external_wp_coreData_namespaceObject.store);
33675      const postArgs = ['postType', postType, postId];
33676      return {
33677        post: getEntityRecord(...postArgs),
33678        template: templateId ? getEntityRecord('postType', TEMPLATE_POST_TYPE, templateId) : undefined,
33679        hasLoadedPost: hasFinishedResolution('getEntityRecord', postArgs),
33680        error: getResolutionError('getEntityRecord', postArgs)?.message
33681      };
33682    }, [postType, postId, templateId]);
33683    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
33684      children: [hasLoadedPost && !post && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, {
33685        status: !!error ? 'error' : 'warning',
33686        isDismissible: false,
33687        children: !error ? (0,external_wp_i18n_namespaceObject.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?") : error
33688      }), !!post && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ExperimentalEditorProvider, {
33689        post: post,
33690        __unstableTemplate: template,
33691        settings: settings,
33692        initialEdits: initialEdits,
33693        useSubRegistry: false,
33694        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorInterface, {
33695          ...props,
33696          children: extraContent
33697        }), children, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(components_sidebar, {
33698          onActionPerformed: onActionPerformed,
33699          extraPanels: extraSidebarPanels
33700        })]
33701      })]
33702    });
33703  }
33704  /* harmony default export */ const editor = (Editor);
33705  
33706  ;// ./node_modules/@wordpress/editor/build-module/components/preferences-modal/enable-publish-sidebar.js
33707  /**
33708   * WordPress dependencies
33709   */
33710  
33711  
33712  
33713  /**
33714   * Internal dependencies
33715   */
33716  
33717  
33718  
33719  const {
33720    PreferenceBaseOption: enable_publish_sidebar_PreferenceBaseOption
33721  } = unlock(external_wp_preferences_namespaceObject.privateApis);
33722  function EnablePublishSidebarOption(props) {
33723    const isChecked = (0,external_wp_data_namespaceObject.useSelect)(select => {
33724      return select(store_store).isPublishSidebarEnabled();
33725    }, []);
33726    const {
33727      enablePublishSidebar,
33728      disablePublishSidebar
33729    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
33730    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_publish_sidebar_PreferenceBaseOption, {
33731      isChecked: isChecked,
33732      onChange: isEnabled => isEnabled ? enablePublishSidebar() : disablePublishSidebar(),
33733      ...props
33734    });
33735  }
33736  
33737  ;// ./node_modules/@wordpress/editor/build-module/components/preferences-modal/block-visibility.js
33738  /**
33739   * WordPress dependencies
33740   */
33741  
33742  
33743  
33744  
33745  
33746  
33747  /**
33748   * Internal dependencies
33749   */
33750  
33751  
33752  
33753  const {
33754    BlockManager
33755  } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
33756  const block_visibility_EMPTY_ARRAY = [];
33757  function BlockVisibility() {
33758    const {
33759      showBlockTypes,
33760      hideBlockTypes
33761    } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
33762    const {
33763      blockTypes,
33764      allowedBlockTypes: _allowedBlockTypes,
33765      hiddenBlockTypes: _hiddenBlockTypes
33766    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
33767      var _select$get;
33768      return {
33769        blockTypes: select(external_wp_blocks_namespaceObject.store).getBlockTypes(),
33770        allowedBlockTypes: select(store_store).getEditorSettings().allowedBlockTypes,
33771        hiddenBlockTypes: (_select$get = select(external_wp_preferences_namespaceObject.store).get('core', 'hiddenBlockTypes')) !== null && _select$get !== void 0 ? _select$get : block_visibility_EMPTY_ARRAY
33772      };
33773    }, []);
33774    const allowedBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(() => {
33775      if (_allowedBlockTypes === true) {
33776        return blockTypes;
33777      }
33778      return blockTypes.filter(({
33779        name
33780      }) => {
33781        return _allowedBlockTypes?.includes(name);
33782      });
33783    }, [_allowedBlockTypes, blockTypes]);
33784    const filteredBlockTypes = allowedBlockTypes.filter(blockType => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'inserter', true) && (!blockType.parent || blockType.parent.includes('core/post-content')));
33785  
33786    // Some hidden blocks become unregistered
33787    // by removing for instance the plugin that registered them, yet
33788    // they're still remain as hidden by the user's action.
33789    // We consider "hidden", blocks which were hidden and
33790    // are still registered.
33791    const hiddenBlockTypes = _hiddenBlockTypes.filter(hiddenBlock => {
33792      return filteredBlockTypes.some(registeredBlock => registeredBlock.name === hiddenBlock);
33793    });
33794    const selectedBlockTypes = filteredBlockTypes.filter(blockType => !hiddenBlockTypes.includes(blockType.name));
33795    const onChangeSelectedBlockTypes = newSelectedBlockTypes => {
33796      if (selectedBlockTypes.length > newSelectedBlockTypes.length) {
33797        const blockTypesToHide = selectedBlockTypes.filter(blockType => !newSelectedBlockTypes.find(({
33798          name
33799        }) => name === blockType.name));
33800        hideBlockTypes(blockTypesToHide.map(({
33801          name
33802        }) => name));
33803      } else if (selectedBlockTypes.length < newSelectedBlockTypes.length) {
33804        const blockTypesToShow = newSelectedBlockTypes.filter(blockType => !selectedBlockTypes.find(({
33805          name
33806        }) => name === blockType.name));
33807        showBlockTypes(blockTypesToShow.map(({
33808          name
33809        }) => name));
33810      }
33811    };
33812    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockManager, {
33813      blockTypes: filteredBlockTypes,
33814      selectedBlockTypes: selectedBlockTypes,
33815      onChange: onChangeSelectedBlockTypes
33816    });
33817  }
33818  
33819  ;// ./node_modules/@wordpress/editor/build-module/components/preferences-modal/index.js
33820  /**
33821   * WordPress dependencies
33822   */
33823  
33824  
33825  
33826  
33827  
33828  
33829  
33830  
33831  /**
33832   * Internal dependencies
33833   */
33834  
33835  
33836  
33837  
33838  
33839  
33840  
33841  
33842  
33843  
33844  
33845  
33846  const {
33847    PreferencesModal,
33848    PreferencesModalTabs,
33849    PreferencesModalSection,
33850    PreferenceToggleControl
33851  } = unlock(external_wp_preferences_namespaceObject.privateApis);
33852  function EditorPreferencesModal({
33853    extraSections = {}
33854  }) {
33855    const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => {
33856      return select(store).isModalActive('editor/preferences');
33857    }, []);
33858    const {
33859      closeModal
33860    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
33861    if (!isActive) {
33862      return null;
33863    }
33864  
33865    // Please wrap all contents inside PreferencesModalContents to prevent all
33866    // hooks from executing when the modal is not open.
33867    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModal, {
33868      closeModal: closeModal,
33869      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalContents, {
33870        extraSections: extraSections
33871      })
33872    });
33873  }
33874  function PreferencesModalContents({
33875    extraSections = {}
33876  }) {
33877    const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
33878    const showBlockBreadcrumbsOption = (0,external_wp_data_namespaceObject.useSelect)(select => {
33879      const {
33880        getEditorSettings
33881      } = select(store_store);
33882      const {
33883        get
33884      } = select(external_wp_preferences_namespaceObject.store);
33885      const isRichEditingEnabled = getEditorSettings().richEditingEnabled;
33886      const isDistractionFreeEnabled = get('core', 'distractionFree');
33887      return !isDistractionFreeEnabled && isLargeViewport && isRichEditingEnabled;
33888    }, [isLargeViewport]);
33889    const {
33890      setIsListViewOpened,
33891      setIsInserterOpened
33892    } = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
33893    const {
33894      set: setPreference
33895    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
33896    const sections = (0,external_wp_element_namespaceObject.useMemo)(() => [{
33897      name: 'general',
33898      tabLabel: (0,external_wp_i18n_namespaceObject.__)('General'),
33899      content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
33900        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreferencesModalSection, {
33901          title: (0,external_wp_i18n_namespaceObject.__)('Interface'),
33902          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, {
33903            scope: "core",
33904            featureName: "showListViewByDefault",
33905            help: (0,external_wp_i18n_namespaceObject.__)('Opens the List View panel by default.'),
33906            label: (0,external_wp_i18n_namespaceObject.__)('Always open List View')
33907          }), showBlockBreadcrumbsOption && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, {
33908            scope: "core",
33909            featureName: "showBlockBreadcrumbs",
33910            help: (0,external_wp_i18n_namespaceObject.__)('Display the block hierarchy trail at the bottom of the editor.'),
33911            label: (0,external_wp_i18n_namespaceObject.__)('Show block breadcrumbs')
33912          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, {
33913            scope: "core",
33914            featureName: "allowRightClickOverrides",
33915            help: (0,external_wp_i18n_namespaceObject.__)('Allows contextual List View menus via right-click, overriding browser defaults.'),
33916            label: (0,external_wp_i18n_namespaceObject.__)('Allow right-click contextual menus')
33917          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, {
33918            scope: "core",
33919            featureName: "enableChoosePatternModal",
33920            help: (0,external_wp_i18n_namespaceObject.__)('Shows starter patterns when creating a new page.'),
33921            label: (0,external_wp_i18n_namespaceObject.__)('Show starter patterns')
33922          })]
33923        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreferencesModalSection, {
33924          title: (0,external_wp_i18n_namespaceObject.__)('Document settings'),
33925          description: (0,external_wp_i18n_namespaceObject.__)('Select what settings are shown in the document panel.'),
33926          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_plugin_document_setting_panel.Slot, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_taxonomies, {
33927            taxonomyWrapper: (content, taxonomy) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePanelOption, {
33928              label: taxonomy.labels.menu_name,
33929              panelName: `taxonomy-panel-$taxonomy.slug}`
33930            })
33931          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_featured_image_check, {
33932            children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePanelOption, {
33933              label: (0,external_wp_i18n_namespaceObject.__)('Featured image'),
33934              panelName: "featured-image"
33935            })
33936          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_excerpt_check, {
33937            children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePanelOption, {
33938              label: (0,external_wp_i18n_namespaceObject.__)('Excerpt'),
33939              panelName: "post-excerpt"
33940            })
33941          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, {
33942            supportKeys: ['comments', 'trackbacks'],
33943            children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePanelOption, {
33944              label: (0,external_wp_i18n_namespaceObject.__)('Discussion'),
33945              panelName: "discussion-panel"
33946            })
33947          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(page_attributes_check, {
33948            children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePanelOption, {
33949              label: (0,external_wp_i18n_namespaceObject.__)('Page attributes'),
33950              panelName: "page-attributes"
33951            })
33952          })]
33953        }), isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalSection, {
33954          title: (0,external_wp_i18n_namespaceObject.__)('Publishing'),
33955          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePublishSidebarOption, {
33956            help: (0,external_wp_i18n_namespaceObject.__)('Review settings, such as visibility and tags.'),
33957            label: (0,external_wp_i18n_namespaceObject.__)('Enable pre-publish checks')
33958          })
33959        }), extraSections?.general]
33960      })
33961    }, {
33962      name: 'appearance',
33963      tabLabel: (0,external_wp_i18n_namespaceObject.__)('Appearance'),
33964      content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreferencesModalSection, {
33965        title: (0,external_wp_i18n_namespaceObject.__)('Appearance'),
33966        description: (0,external_wp_i18n_namespaceObject.__)('Customize the editor interface to suit your needs.'),
33967        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, {
33968          scope: "core",
33969          featureName: "fixedToolbar",
33970          onToggle: () => setPreference('core', 'distractionFree', false),
33971          help: (0,external_wp_i18n_namespaceObject.__)('Access all block and document tools in a single place.'),
33972          label: (0,external_wp_i18n_namespaceObject.__)('Top toolbar')
33973        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, {
33974          scope: "core",
33975          featureName: "distractionFree",
33976          onToggle: () => {
33977            setPreference('core', 'fixedToolbar', true);
33978            setIsInserterOpened(false);
33979            setIsListViewOpened(false);
33980          },
33981          help: (0,external_wp_i18n_namespaceObject.__)('Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'),
33982          label: (0,external_wp_i18n_namespaceObject.__)('Distraction free')
33983        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, {
33984          scope: "core",
33985          featureName: "focusMode",
33986          help: (0,external_wp_i18n_namespaceObject.__)('Highlights the current block and fades other content.'),
33987          label: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode')
33988        }), extraSections?.appearance]
33989      })
33990    }, {
33991      name: 'accessibility',
33992      tabLabel: (0,external_wp_i18n_namespaceObject.__)('Accessibility'),
33993      content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
33994        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalSection, {
33995          title: (0,external_wp_i18n_namespaceObject.__)('Navigation'),
33996          description: (0,external_wp_i18n_namespaceObject.__)('Optimize the editing experience for enhanced control.'),
33997          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, {
33998            scope: "core",
33999            featureName: "keepCaretInsideBlock",
34000            help: (0,external_wp_i18n_namespaceObject.__)('Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users.'),
34001            label: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block')
34002          })
34003        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalSection, {
34004          title: (0,external_wp_i18n_namespaceObject.__)('Interface'),
34005          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, {
34006            scope: "core",
34007            featureName: "showIconLabels",
34008            label: (0,external_wp_i18n_namespaceObject.__)('Show button text labels'),
34009            help: (0,external_wp_i18n_namespaceObject.__)('Show text instead of icons on buttons across the interface.')
34010          })
34011        })]
34012      })
34013    }, {
34014      name: 'blocks',
34015      tabLabel: (0,external_wp_i18n_namespaceObject.__)('Blocks'),
34016      content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
34017        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalSection, {
34018          title: (0,external_wp_i18n_namespaceObject.__)('Inserter'),
34019          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, {
34020            scope: "core",
34021            featureName: "mostUsedBlocks",
34022            help: (0,external_wp_i18n_namespaceObject.__)('Adds a category with the most frequently used blocks in the inserter.'),
34023            label: (0,external_wp_i18n_namespaceObject.__)('Show most used blocks')
34024          })
34025        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalSection, {
34026          title: (0,external_wp_i18n_namespaceObject.__)('Manage block visibility'),
34027          description: (0,external_wp_i18n_namespaceObject.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."),
34028          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockVisibility, {})
34029        })]
34030      })
34031    }, window.__experimentalMediaProcessing && {
34032      name: 'media',
34033      tabLabel: (0,external_wp_i18n_namespaceObject.__)('Media'),
34034      content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
34035        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreferencesModalSection, {
34036          title: (0,external_wp_i18n_namespaceObject.__)('General'),
34037          description: (0,external_wp_i18n_namespaceObject.__)('Customize options related to the media upload flow.'),
34038          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, {
34039            scope: "core/media",
34040            featureName: "optimizeOnUpload",
34041            help: (0,external_wp_i18n_namespaceObject.__)('Compress media items before uploading to the server.'),
34042            label: (0,external_wp_i18n_namespaceObject.__)('Pre-upload compression')
34043          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, {
34044            scope: "core/media",
34045            featureName: "requireApproval",
34046            help: (0,external_wp_i18n_namespaceObject.__)('Require approval step when optimizing existing media.'),
34047            label: (0,external_wp_i18n_namespaceObject.__)('Approval step')
34048          })]
34049        })
34050      })
34051    }].filter(Boolean), [showBlockBreadcrumbsOption, extraSections, setIsInserterOpened, setIsListViewOpened, setPreference, isLargeViewport]);
34052    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModalTabs, {
34053      sections: sections
34054    });
34055  }
34056  
34057  ;// ./node_modules/@wordpress/editor/build-module/components/post-fields/index.js
34058  /**
34059   * WordPress dependencies
34060   */
34061  
34062  
34063  
34064  /**
34065   * Internal dependencies
34066   */
34067  
34068  
34069  function usePostFields({
34070    postType
34071  }) {
34072    const {
34073      registerPostTypeSchema
34074    } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
34075    (0,external_wp_element_namespaceObject.useEffect)(() => {
34076      registerPostTypeSchema(postType);
34077    }, [registerPostTypeSchema, postType]);
34078    const {
34079      defaultFields
34080    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
34081      const {
34082        getEntityFields
34083      } = unlock(select(store_store));
34084      return {
34085        defaultFields: getEntityFields('postType', postType)
34086      };
34087    }, [postType]);
34088    const {
34089      records: authors,
34090      isResolving: isLoadingAuthors
34091    } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('root', 'user', {
34092      per_page: -1
34093    });
34094    const fields = (0,external_wp_element_namespaceObject.useMemo)(() => defaultFields.map(field => {
34095      if (field.id === 'author') {
34096        return {
34097          ...field,
34098          elements: authors?.map(({
34099            id,
34100            name
34101          }) => ({
34102            value: id,
34103            label: name
34104          }))
34105        };
34106      }
34107      return field;
34108    }), [authors, defaultFields]);
34109    return {
34110      isLoading: isLoadingAuthors,
34111      fields
34112    };
34113  }
34114  
34115  /**
34116   * Hook to get the fields for a post (BasePost or BasePostWithEmbeddedAuthor).
34117   */
34118  /* harmony default export */ const post_fields = (usePostFields);
34119  
34120  ;// ./node_modules/@wordpress/editor/build-module/bindings/pattern-overrides.js
34121  /**
34122   * WordPress dependencies
34123   */
34124  
34125  const CONTENT = 'content';
34126  /* harmony default export */ const pattern_overrides = ({
34127    name: 'core/pattern-overrides',
34128    getValues({
34129      select,
34130      clientId,
34131      context,
34132      bindings
34133    }) {
34134      const patternOverridesContent = context['pattern/overrides'];
34135      const {
34136        getBlockAttributes
34137      } = select(external_wp_blockEditor_namespaceObject.store);
34138      const currentBlockAttributes = getBlockAttributes(clientId);
34139      const overridesValues = {};
34140      for (const attributeName of Object.keys(bindings)) {
34141        const overridableValue = patternOverridesContent?.[currentBlockAttributes?.metadata?.name]?.[attributeName];
34142  
34143        // If it has not been overridden, return the original value.
34144        // Check undefined because empty string is a valid value.
34145        if (overridableValue === undefined) {
34146          overridesValues[attributeName] = currentBlockAttributes[attributeName];
34147          continue;
34148        } else {
34149          overridesValues[attributeName] = overridableValue === '' ? undefined : overridableValue;
34150        }
34151      }
34152      return overridesValues;
34153    },
34154    setValues({
34155      select,
34156      dispatch,
34157      clientId,
34158      bindings
34159    }) {
34160      const {
34161        getBlockAttributes,
34162        getBlockParentsByBlockName,
34163        getBlocks
34164      } = select(external_wp_blockEditor_namespaceObject.store);
34165      const currentBlockAttributes = getBlockAttributes(clientId);
34166      const blockName = currentBlockAttributes?.metadata?.name;
34167      if (!blockName) {
34168        return;
34169      }
34170      const [patternClientId] = getBlockParentsByBlockName(clientId, 'core/block', true);
34171  
34172      // Extract the updated attributes from the source bindings.
34173      const attributes = Object.entries(bindings).reduce((attrs, [key, {
34174        newValue
34175      }]) => {
34176        attrs[key] = newValue;
34177        return attrs;
34178      }, {});
34179  
34180      // If there is no pattern client ID, sync blocks with the same name and same attributes.
34181      if (!patternClientId) {
34182        const syncBlocksWithSameName = blocks => {
34183          for (const block of blocks) {
34184            if (block.attributes?.metadata?.name === blockName) {
34185              dispatch(external_wp_blockEditor_namespaceObject.store).updateBlockAttributes(block.clientId, attributes);
34186            }
34187            syncBlocksWithSameName(block.innerBlocks);
34188          }
34189        };
34190        syncBlocksWithSameName(getBlocks());
34191        return;
34192      }
34193      const currentBindingValue = getBlockAttributes(patternClientId)?.[CONTENT];
34194      dispatch(external_wp_blockEditor_namespaceObject.store).updateBlockAttributes(patternClientId, {
34195        [CONTENT]: {
34196          ...currentBindingValue,
34197          [blockName]: {
34198            ...currentBindingValue?.[blockName],
34199            ...Object.entries(attributes).reduce((acc, [key, value]) => {
34200              // TODO: We need a way to represent `undefined` in the serialized overrides.
34201              // Also see: https://github.com/WordPress/gutenberg/pull/57249#discussion_r1452987871
34202              // We use an empty string to represent undefined for now until
34203              // we support a richer format for overrides and the block bindings API.
34204              acc[key] = value === undefined ? '' : value;
34205              return acc;
34206            }, {})
34207          }
34208        }
34209      });
34210    },
34211    canUserEditValue: () => true
34212  });
34213  
34214  ;// ./node_modules/@wordpress/editor/build-module/bindings/post-meta.js
34215  /**
34216   * WordPress dependencies
34217   */
34218  
34219  
34220  /**
34221   * Internal dependencies
34222   */
34223  
34224  
34225  
34226  /**
34227   * Gets a list of post meta fields with their values and labels
34228   * to be consumed in the needed callbacks.
34229   * If the value is not available based on context, like in templates,
34230   * it falls back to the default value, label, or key.
34231   *
34232   * @param {Object} select  The select function from the data store.
34233   * @param {Object} context The context provided.
34234   * @return {Object} List of post meta fields with their value and label.
34235   *
34236   * @example
34237   * ```js
34238   * {
34239   *     field_1_key: {
34240   *         label: 'Field 1 Label',
34241   *         value: 'Field 1 Value',
34242   *     },
34243   *     field_2_key: {
34244   *         label: 'Field 2 Label',
34245   *         value: 'Field 2 Value',
34246   *     },
34247   *     ...
34248   * }
34249   * ```
34250   */
34251  function getPostMetaFields(select, context) {
34252    const {
34253      getEditedEntityRecord
34254    } = select(external_wp_coreData_namespaceObject.store);
34255    const {
34256      getRegisteredPostMeta
34257    } = unlock(select(external_wp_coreData_namespaceObject.store));
34258    let entityMetaValues;
34259    // Try to get the current entity meta values.
34260    if (context?.postType && context?.postId) {
34261      entityMetaValues = getEditedEntityRecord('postType', context?.postType, context?.postId).meta;
34262    }
34263    const registeredFields = getRegisteredPostMeta(context?.postType);
34264    const metaFields = {};
34265    Object.entries(registeredFields || {}).forEach(([key, props]) => {
34266      // Don't include footnotes or private fields.
34267      if (key !== 'footnotes' && key.charAt(0) !== '_') {
34268        var _entityMetaValues$key;
34269        metaFields[key] = {
34270          label: props.title || key,
34271          value: // When using the entity value, an empty string IS a valid value.
34272          (_entityMetaValues$key = entityMetaValues?.[key]) !== null && _entityMetaValues$key !== void 0 ? _entityMetaValues$key :
34273          // When using the default, an empty string IS NOT a valid value.
34274          props.default || undefined,
34275          type: props.type
34276        };
34277      }
34278    });
34279    if (!Object.keys(metaFields || {}).length) {
34280      return null;
34281    }
34282    return metaFields;
34283  }
34284  /* harmony default export */ const post_meta = ({
34285    name: 'core/post-meta',
34286    getValues({
34287      select,
34288      context,
34289      bindings
34290    }) {
34291      const metaFields = getPostMetaFields(select, context);
34292      const newValues = {};
34293      for (const [attributeName, source] of Object.entries(bindings)) {
34294        var _ref;
34295        // Use the value, the field label, or the field key.
34296        const fieldKey = source.args.key;
34297        const {
34298          value: fieldValue,
34299          label: fieldLabel
34300        } = metaFields?.[fieldKey] || {};
34301        newValues[attributeName] = (_ref = fieldValue !== null && fieldValue !== void 0 ? fieldValue : fieldLabel) !== null && _ref !== void 0 ? _ref : fieldKey;
34302      }
34303      return newValues;
34304    },
34305    setValues({
34306      dispatch,
34307      context,
34308      bindings
34309    }) {
34310      const newMeta = {};
34311      Object.values(bindings).forEach(({
34312        args,
34313        newValue
34314      }) => {
34315        newMeta[args.key] = newValue;
34316      });
34317      dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', context?.postType, context?.postId, {
34318        meta: newMeta
34319      });
34320    },
34321    canUserEditValue({
34322      select,
34323      context,
34324      args
34325    }) {
34326      // Lock editing in query loop.
34327      if (context?.query || context?.queryId) {
34328        return false;
34329      }
34330  
34331      // Lock editing when `postType` is not defined.
34332      if (!context?.postType) {
34333        return false;
34334      }
34335      const fieldValue = getPostMetaFields(select, context)?.[args.key]?.value;
34336      // Empty string or `false` could be a valid value, so we need to check if the field value is undefined.
34337      if (fieldValue === undefined) {
34338        return false;
34339      }
34340      // Check that custom fields metabox is not enabled.
34341      const areCustomFieldsEnabled = select(store_store).getEditorSettings().enableCustomFields;
34342      if (areCustomFieldsEnabled) {
34343        return false;
34344      }
34345  
34346      // Check that the user has the capability to edit post meta.
34347      const canUserEdit = select(external_wp_coreData_namespaceObject.store).canUser('update', {
34348        kind: 'postType',
34349        name: context?.postType,
34350        id: context?.postId
34351      });
34352      if (!canUserEdit) {
34353        return false;
34354      }
34355      return true;
34356    },
34357    getFieldsList({
34358      select,
34359      context
34360    }) {
34361      return getPostMetaFields(select, context);
34362    }
34363  });
34364  
34365  ;// ./node_modules/@wordpress/editor/build-module/bindings/api.js
34366  /**
34367   * WordPress dependencies
34368   */
34369  
34370  
34371  /**
34372   * Internal dependencies
34373   */
34374  
34375  
34376  
34377  /**
34378   * Function to register core block bindings sources provided by the editor.
34379   *
34380   * @example
34381   * ```js
34382   * import { registerCoreBlockBindingsSources } from '@wordpress/editor';
34383   *
34384   * registerCoreBlockBindingsSources();
34385   * ```
34386   */
34387  function registerCoreBlockBindingsSources() {
34388    (0,external_wp_blocks_namespaceObject.registerBlockBindingsSource)(pattern_overrides);
34389    (0,external_wp_blocks_namespaceObject.registerBlockBindingsSource)(post_meta);
34390  }
34391  
34392  ;// ./node_modules/@wordpress/editor/build-module/private-apis.js
34393  /**
34394   * WordPress dependencies
34395   */
34396  
34397  
34398  /**
34399   * Internal dependencies
34400   */
34401  
34402  
34403  
34404  
34405  
34406  
34407  
34408  
34409  
34410  
34411  
34412  
34413  
34414  
34415  
34416  
34417  
34418  const {
34419    store: interfaceStore,
34420    ...remainingInterfaceApis
34421  } = build_module_namespaceObject;
34422  const privateApis = {};
34423  lock(privateApis, {
34424    CreateTemplatePartModal: CreateTemplatePartModal,
34425    patternTitleField: pattern_title,
34426    templateTitleField: template_title,
34427    BackButton: back_button,
34428    EntitiesSavedStatesExtensible: EntitiesSavedStatesExtensible,
34429    Editor: editor,
34430    EditorContentSlotFill: content_slot_fill,
34431    GlobalStylesProvider: GlobalStylesProvider,
34432    mergeBaseAndUserConfigs: mergeBaseAndUserConfigs,
34433    PluginPostExcerpt: post_excerpt_plugin,
34434    PostCardPanel: PostCardPanel,
34435    PreferencesModal: EditorPreferencesModal,
34436    usePostActions: usePostActions,
34437    usePostFields: post_fields,
34438    ToolsMoreMenuGroup: tools_more_menu_group,
34439    ViewMoreMenuGroup: view_more_menu_group,
34440    ResizableEditor: resizable_editor,
34441    registerCoreBlockBindingsSources: registerCoreBlockBindingsSources,
34442    getTemplateInfo: getTemplateInfo,
34443    // This is a temporary private API while we're updating the site editor to use EditorProvider.
34444    interfaceStore,
34445    ...remainingInterfaceApis
34446  });
34447  
34448  ;// ./node_modules/@wordpress/editor/build-module/dataviews/api.js
34449  /**
34450   * WordPress dependencies
34451   */
34452  
34453  
34454  /**
34455   * Internal dependencies
34456   */
34457  
34458  
34459  
34460  /**
34461   * @typedef {import('@wordpress/dataviews').Action} Action
34462   * @typedef {import('@wordpress/dataviews').Field} Field
34463   */
34464  
34465  /**
34466   * Registers a new DataViews action.
34467   *
34468   * This is an experimental API and is subject to change.
34469   * it's only available in the Gutenberg plugin for now.
34470   *
34471   * @param {string} kind   Entity kind.
34472   * @param {string} name   Entity name.
34473   * @param {Action} config Action configuration.
34474   */
34475  
34476  function api_registerEntityAction(kind, name, config) {
34477    const {
34478      registerEntityAction: _registerEntityAction
34479    } = unlock((0,external_wp_data_namespaceObject.dispatch)(store_store));
34480    if (false) {}
34481  }
34482  
34483  /**
34484   * Unregisters a DataViews action.
34485   *
34486   * This is an experimental API and is subject to change.
34487   * it's only available in the Gutenberg plugin for now.
34488   *
34489   * @param {string} kind     Entity kind.
34490   * @param {string} name     Entity name.
34491   * @param {string} actionId Action ID.
34492   */
34493  function api_unregisterEntityAction(kind, name, actionId) {
34494    const {
34495      unregisterEntityAction: _unregisterEntityAction
34496    } = unlock((0,external_wp_data_namespaceObject.dispatch)(store_store));
34497    if (false) {}
34498  }
34499  
34500  /**
34501   * Registers a new DataViews field.
34502   *
34503   * This is an experimental API and is subject to change.
34504   * it's only available in the Gutenberg plugin for now.
34505   *
34506   * @param {string} kind   Entity kind.
34507   * @param {string} name   Entity name.
34508   * @param {Field}  config Field configuration.
34509   */
34510  function api_registerEntityField(kind, name, config) {
34511    const {
34512      registerEntityField: _registerEntityField
34513    } = unlock((0,external_wp_data_namespaceObject.dispatch)(store_store));
34514    if (false) {}
34515  }
34516  
34517  /**
34518   * Unregisters a DataViews field.
34519   *
34520   * This is an experimental API and is subject to change.
34521   * it's only available in the Gutenberg plugin for now.
34522   *
34523   * @param {string} kind    Entity kind.
34524   * @param {string} name    Entity name.
34525   * @param {string} fieldId Field ID.
34526   */
34527  function api_unregisterEntityField(kind, name, fieldId) {
34528    const {
34529      unregisterEntityField: _unregisterEntityField
34530    } = unlock((0,external_wp_data_namespaceObject.dispatch)(store_store));
34531    if (false) {}
34532  }
34533  
34534  ;// ./node_modules/@wordpress/editor/build-module/index.js
34535  /**
34536   * Internal dependencies
34537   */
34538  
34539  
34540  
34541  
34542  
34543  
34544  
34545  /*
34546   * Backward compatibility
34547   */
34548  
34549  
34550  })();
34551  
34552  (window.wp = window.wp || {}).editor = __webpack_exports__;
34553  /******/ })()
34554  ;


Generated : Thu Apr 3 08:20:01 2025 Cross-referenced by PHPXref