[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

   1  this["wp"] = this["wp"] || {}; this["wp"]["editor"] =
   2  /******/ (function(modules) { // webpackBootstrap
   3  /******/     // The module cache
   4  /******/     var installedModules = {};
   5  /******/
   6  /******/     // The require function
   7  /******/ 	function __webpack_require__(moduleId) {
   8  /******/
   9  /******/         // Check if module is in cache
  10  /******/         if(installedModules[moduleId]) {
  11  /******/             return installedModules[moduleId].exports;
  12  /******/         }
  13  /******/         // Create a new module (and put it into the cache)
  14  /******/         var module = installedModules[moduleId] = {
  15  /******/             i: moduleId,
  16  /******/             l: false,
  17  /******/             exports: {}
  18  /******/         };
  19  /******/
  20  /******/         // Execute the module function
  21  /******/         modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22  /******/
  23  /******/         // Flag the module as loaded
  24  /******/         module.l = true;
  25  /******/
  26  /******/         // Return the exports of the module
  27  /******/         return module.exports;
  28  /******/     }
  29  /******/
  30  /******/
  31  /******/     // expose the modules object (__webpack_modules__)
  32  /******/     __webpack_require__.m = modules;
  33  /******/
  34  /******/     // expose the module cache
  35  /******/     __webpack_require__.c = installedModules;
  36  /******/
  37  /******/     // define getter function for harmony exports
  38  /******/     __webpack_require__.d = function(exports, name, getter) {
  39  /******/         if(!__webpack_require__.o(exports, name)) {
  40  /******/             Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41  /******/         }
  42  /******/     };
  43  /******/
  44  /******/     // define __esModule on exports
  45  /******/     __webpack_require__.r = function(exports) {
  46  /******/         if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47  /******/             Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48  /******/         }
  49  /******/         Object.defineProperty(exports, '__esModule', { value: true });
  50  /******/     };
  51  /******/
  52  /******/     // create a fake namespace object
  53  /******/     // mode & 1: value is a module id, require it
  54  /******/     // mode & 2: merge all properties of value into the ns
  55  /******/     // mode & 4: return value when already ns object
  56  /******/     // mode & 8|1: behave like require
  57  /******/     __webpack_require__.t = function(value, mode) {
  58  /******/         if(mode & 1) value = __webpack_require__(value);
  59  /******/         if(mode & 8) return value;
  60  /******/         if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61  /******/         var ns = Object.create(null);
  62  /******/         __webpack_require__.r(ns);
  63  /******/         Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64  /******/         if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65  /******/         return ns;
  66  /******/     };
  67  /******/
  68  /******/     // getDefaultExport function for compatibility with non-harmony modules
  69  /******/     __webpack_require__.n = function(module) {
  70  /******/         var getter = module && module.__esModule ?
  71  /******/ 			function getDefault() { return module['default']; } :
  72  /******/ 			function getModuleExports() { return module; };
  73  /******/         __webpack_require__.d(getter, 'a', getter);
  74  /******/         return getter;
  75  /******/     };
  76  /******/
  77  /******/     // Object.prototype.hasOwnProperty.call
  78  /******/     __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79  /******/
  80  /******/     // __webpack_public_path__
  81  /******/     __webpack_require__.p = "";
  82  /******/
  83  /******/
  84  /******/     // Load entry module and return exports
  85  /******/     return __webpack_require__(__webpack_require__.s = 363);
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ 0:
  91  /***/ (function(module, exports) {
  92  
  93  (function() { module.exports = this["wp"]["element"]; }());
  94  
  95  /***/ }),
  96  
  97  /***/ 1:
  98  /***/ (function(module, exports) {
  99  
 100  (function() { module.exports = this["wp"]["i18n"]; }());
 101  
 102  /***/ }),
 103  
 104  /***/ 10:
 105  /***/ (function(module, exports) {
 106  
 107  (function() { module.exports = this["wp"]["blocks"]; }());
 108  
 109  /***/ }),
 110  
 111  /***/ 11:
 112  /***/ (function(module, exports, __webpack_require__) {
 113  
 114  var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
 115    Copyright (c) 2017 Jed Watson.
 116    Licensed under the MIT License (MIT), see
 117    http://jedwatson.github.io/classnames
 118  */
 119  /* global define */
 120  
 121  (function () {
 122      'use strict';
 123  
 124      var hasOwn = {}.hasOwnProperty;
 125  
 126  	function classNames () {
 127          var classes = [];
 128  
 129          for (var i = 0; i < arguments.length; i++) {
 130              var arg = arguments[i];
 131              if (!arg) continue;
 132  
 133              var argType = typeof arg;
 134  
 135              if (argType === 'string' || argType === 'number') {
 136                  classes.push(arg);
 137              } else if (Array.isArray(arg) && arg.length) {
 138                  var inner = classNames.apply(null, arg);
 139                  if (inner) {
 140                      classes.push(inner);
 141                  }
 142              } else if (argType === 'object') {
 143                  for (var key in arg) {
 144                      if (hasOwn.call(arg, key) && arg[key]) {
 145                          classes.push(key);
 146                      }
 147                  }
 148              }
 149          }
 150  
 151          return classes.join(' ');
 152      }
 153  
 154      if ( true && module.exports) {
 155          classNames.default = classNames;
 156          module.exports = classNames;
 157      } else if (true) {
 158          // register as 'classnames', consistent with npm package name
 159          !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
 160              return classNames;
 161          }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
 162                  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
 163      } else {}
 164  }());
 165  
 166  
 167  /***/ }),
 168  
 169  /***/ 113:
 170  /***/ (function(module, exports, __webpack_require__) {
 171  
 172  "use strict";
 173  
 174  var __extends = (this && this.__extends) || (function () {
 175      var extendStatics = Object.setPrototypeOf ||
 176          ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
 177          function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
 178      return function (d, b) {
 179          extendStatics(d, b);
 180          function __() { this.constructor = d; }
 181          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
 182      };
 183  })();
 184  var __assign = (this && this.__assign) || Object.assign || function(t) {
 185      for (var s, i = 1, n = arguments.length; i < n; i++) {
 186          s = arguments[i];
 187          for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
 188              t[p] = s[p];
 189      }
 190      return t;
 191  };
 192  var __rest = (this && this.__rest) || function (s, e) {
 193      var t = {};
 194      for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
 195          t[p] = s[p];
 196      if (s != null && typeof Object.getOwnPropertySymbols === "function")
 197          for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
 198              t[p[i]] = s[p[i]];
 199      return t;
 200  };
 201  exports.__esModule = true;
 202  var React = __webpack_require__(20);
 203  var PropTypes = __webpack_require__(28);
 204  var autosize = __webpack_require__(114);
 205  var _getLineHeight = __webpack_require__(115);
 206  var getLineHeight = _getLineHeight;
 207  var UPDATE = 'autosize:update';
 208  var DESTROY = 'autosize:destroy';
 209  var RESIZED = 'autosize:resized';
 210  /**
 211   * A light replacement for built-in textarea component
 212   * which automaticaly adjusts its height to match the content
 213   */
 214  var TextareaAutosize = /** @class */ (function (_super) {
 215      __extends(TextareaAutosize, _super);
 216      function TextareaAutosize() {
 217          var _this = _super !== null && _super.apply(this, arguments) || this;
 218          _this.state = {
 219              lineHeight: null
 220          };
 221          _this.dispatchEvent = function (EVENT_TYPE) {
 222              var event = document.createEvent('Event');
 223              event.initEvent(EVENT_TYPE, true, false);
 224              _this.textarea.dispatchEvent(event);
 225          };
 226          _this.updateLineHeight = function () {
 227              _this.setState({
 228                  lineHeight: getLineHeight(_this.textarea)
 229              });
 230          };
 231          _this.onChange = function (e) {
 232              var onChange = _this.props.onChange;
 233              _this.currentValue = e.currentTarget.value;
 234              onChange && onChange(e);
 235          };
 236          _this.saveDOMNodeRef = function (ref) {
 237              var innerRef = _this.props.innerRef;
 238              if (innerRef) {
 239                  innerRef(ref);
 240              }
 241              _this.textarea = ref;
 242          };
 243          _this.getLocals = function () {
 244              var _a = _this, _b = _a.props, onResize = _b.onResize, maxRows = _b.maxRows, onChange = _b.onChange, style = _b.style, innerRef = _b.innerRef, props = __rest(_b, ["onResize", "maxRows", "onChange", "style", "innerRef"]), lineHeight = _a.state.lineHeight, saveDOMNodeRef = _a.saveDOMNodeRef;
 245              var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null;
 246              return __assign({}, props, { saveDOMNodeRef: saveDOMNodeRef, style: maxHeight ? __assign({}, style, { maxHeight: maxHeight }) : style, onChange: _this.onChange });
 247          };
 248          return _this;
 249      }
 250      TextareaAutosize.prototype.componentDidMount = function () {
 251          var _this = this;
 252          var _a = this.props, onResize = _a.onResize, maxRows = _a.maxRows;
 253          if (typeof maxRows === 'number') {
 254              this.updateLineHeight();
 255          }
 256          /*
 257            the defer is needed to:
 258              - force "autosize" to activate the scrollbar when this.props.maxRows is passed
 259              - support StyledComponents (see #71)
 260          */
 261          setTimeout(function () { return autosize(_this.textarea); });
 262          if (onResize) {
 263              this.textarea.addEventListener(RESIZED, onResize);
 264          }
 265      };
 266      TextareaAutosize.prototype.componentWillUnmount = function () {
 267          var onResize = this.props.onResize;
 268          if (onResize) {
 269              this.textarea.removeEventListener(RESIZED, onResize);
 270          }
 271          this.dispatchEvent(DESTROY);
 272      };
 273      TextareaAutosize.prototype.render = function () {
 274          var _a = this.getLocals(), children = _a.children, saveDOMNodeRef = _a.saveDOMNodeRef, locals = __rest(_a, ["children", "saveDOMNodeRef"]);
 275          return (React.createElement("textarea", __assign({}, locals, { ref: saveDOMNodeRef }), children));
 276      };
 277      TextareaAutosize.prototype.componentDidUpdate = function (prevProps) {
 278          if (this.props.value !== this.currentValue || this.props.rows !== prevProps.rows) {
 279              this.dispatchEvent(UPDATE);
 280          }
 281      };
 282      TextareaAutosize.defaultProps = {
 283          rows: 1
 284      };
 285      TextareaAutosize.propTypes = {
 286          rows: PropTypes.number,
 287          maxRows: PropTypes.number,
 288          onResize: PropTypes.func,
 289          innerRef: PropTypes.func
 290      };
 291      return TextareaAutosize;
 292  }(React.Component));
 293  exports["default"] = TextareaAutosize;
 294  
 295  
 296  /***/ }),
 297  
 298  /***/ 114:
 299  /***/ (function(module, exports, __webpack_require__) {
 300  
 301  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
 302      autosize 4.0.2
 303      license: MIT
 304      http://www.jacklmoore.com/autosize
 305  */
 306  (function (global, factory) {
 307      if (true) {
 308          !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
 309                  __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
 310                  (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
 311                  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
 312      } else { var mod; }
 313  })(this, function (module, exports) {
 314      'use strict';
 315  
 316      var map = typeof Map === "function" ? new Map() : function () {
 317          var keys = [];
 318          var values = [];
 319  
 320          return {
 321              has: function has(key) {
 322                  return keys.indexOf(key) > -1;
 323              },
 324              get: function get(key) {
 325                  return values[keys.indexOf(key)];
 326              },
 327              set: function set(key, value) {
 328                  if (keys.indexOf(key) === -1) {
 329                      keys.push(key);
 330                      values.push(value);
 331                  }
 332              },
 333              delete: function _delete(key) {
 334                  var index = keys.indexOf(key);
 335                  if (index > -1) {
 336                      keys.splice(index, 1);
 337                      values.splice(index, 1);
 338                  }
 339              }
 340          };
 341      }();
 342  
 343      var createEvent = function createEvent(name) {
 344          return new Event(name, { bubbles: true });
 345      };
 346      try {
 347          new Event('test');
 348      } catch (e) {
 349          // IE does not support `new Event()`
 350          createEvent = function createEvent(name) {
 351              var evt = document.createEvent('Event');
 352              evt.initEvent(name, true, false);
 353              return evt;
 354          };
 355      }
 356  
 357  	function assign(ta) {
 358          if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return;
 359  
 360          var heightOffset = null;
 361          var clientWidth = null;
 362          var cachedHeight = null;
 363  
 364  		function init() {
 365              var style = window.getComputedStyle(ta, null);
 366  
 367              if (style.resize === 'vertical') {
 368                  ta.style.resize = 'none';
 369              } else if (style.resize === 'both') {
 370                  ta.style.resize = 'horizontal';
 371              }
 372  
 373              if (style.boxSizing === 'content-box') {
 374                  heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));
 375              } else {
 376                  heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
 377              }
 378              // Fix when a textarea is not on document body and heightOffset is Not a Number
 379              if (isNaN(heightOffset)) {
 380                  heightOffset = 0;
 381              }
 382  
 383              update();
 384          }
 385  
 386  		function changeOverflow(value) {
 387              {
 388                  // Chrome/Safari-specific fix:
 389                  // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space
 390                  // made available by removing the scrollbar. The following forces the necessary text reflow.
 391                  var width = ta.style.width;
 392                  ta.style.width = '0px';
 393                  // Force reflow:
 394                  /* jshint ignore:start */
 395                  ta.offsetWidth;
 396                  /* jshint ignore:end */
 397                  ta.style.width = width;
 398              }
 399  
 400              ta.style.overflowY = value;
 401          }
 402  
 403  		function getParentOverflows(el) {
 404              var arr = [];
 405  
 406              while (el && el.parentNode && el.parentNode instanceof Element) {
 407                  if (el.parentNode.scrollTop) {
 408                      arr.push({
 409                          node: el.parentNode,
 410                          scrollTop: el.parentNode.scrollTop
 411                      });
 412                  }
 413                  el = el.parentNode;
 414              }
 415  
 416              return arr;
 417          }
 418  
 419  		function resize() {
 420              if (ta.scrollHeight === 0) {
 421                  // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.
 422                  return;
 423              }
 424  
 425              var overflows = getParentOverflows(ta);
 426              var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)
 427  
 428              ta.style.height = '';
 429              ta.style.height = ta.scrollHeight + heightOffset + 'px';
 430  
 431              // used to check if an update is actually necessary on window.resize
 432              clientWidth = ta.clientWidth;
 433  
 434              // prevents scroll-position jumping
 435              overflows.forEach(function (el) {
 436                  el.node.scrollTop = el.scrollTop;
 437              });
 438  
 439              if (docTop) {
 440                  document.documentElement.scrollTop = docTop;
 441              }
 442          }
 443  
 444  		function update() {
 445              resize();
 446  
 447              var styleHeight = Math.round(parseFloat(ta.style.height));
 448              var computed = window.getComputedStyle(ta, null);
 449  
 450              // Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box
 451              var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight;
 452  
 453              // The actual height not matching the style height (set via the resize method) indicates that 
 454              // the max-height has been exceeded, in which case the overflow should be allowed.
 455              if (actualHeight < styleHeight) {
 456                  if (computed.overflowY === 'hidden') {
 457                      changeOverflow('scroll');
 458                      resize();
 459                      actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
 460                  }
 461              } else {
 462                  // Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands.
 463                  if (computed.overflowY !== 'hidden') {
 464                      changeOverflow('hidden');
 465                      resize();
 466                      actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
 467                  }
 468              }
 469  
 470              if (cachedHeight !== actualHeight) {
 471                  cachedHeight = actualHeight;
 472                  var evt = createEvent('autosize:resized');
 473                  try {
 474                      ta.dispatchEvent(evt);
 475                  } catch (err) {
 476                      // Firefox will throw an error on dispatchEvent for a detached element
 477                      // https://bugzilla.mozilla.org/show_bug.cgi?id=889376
 478                  }
 479              }
 480          }
 481  
 482          var pageResize = function pageResize() {
 483              if (ta.clientWidth !== clientWidth) {
 484                  update();
 485              }
 486          };
 487  
 488          var destroy = function (style) {
 489              window.removeEventListener('resize', pageResize, false);
 490              ta.removeEventListener('input', update, false);
 491              ta.removeEventListener('keyup', update, false);
 492              ta.removeEventListener('autosize:destroy', destroy, false);
 493              ta.removeEventListener('autosize:update', update, false);
 494  
 495              Object.keys(style).forEach(function (key) {
 496                  ta.style[key] = style[key];
 497              });
 498  
 499              map.delete(ta);
 500          }.bind(ta, {
 501              height: ta.style.height,
 502              resize: ta.style.resize,
 503              overflowY: ta.style.overflowY,
 504              overflowX: ta.style.overflowX,
 505              wordWrap: ta.style.wordWrap
 506          });
 507  
 508          ta.addEventListener('autosize:destroy', destroy, false);
 509  
 510          // IE9 does not fire onpropertychange or oninput for deletions,
 511          // so binding to onkeyup to catch most of those events.
 512          // There is no way that I know of to detect something like 'cut' in IE9.
 513          if ('onpropertychange' in ta && 'oninput' in ta) {
 514              ta.addEventListener('keyup', update, false);
 515          }
 516  
 517          window.addEventListener('resize', pageResize, false);
 518          ta.addEventListener('input', update, false);
 519          ta.addEventListener('autosize:update', update, false);
 520          ta.style.overflowX = 'hidden';
 521          ta.style.wordWrap = 'break-word';
 522  
 523          map.set(ta, {
 524              destroy: destroy,
 525              update: update
 526          });
 527  
 528          init();
 529      }
 530  
 531  	function destroy(ta) {
 532          var methods = map.get(ta);
 533          if (methods) {
 534              methods.destroy();
 535          }
 536      }
 537  
 538  	function update(ta) {
 539          var methods = map.get(ta);
 540          if (methods) {
 541              methods.update();
 542          }
 543      }
 544  
 545      var autosize = null;
 546  
 547      // Do nothing in Node.js environment and IE8 (or lower)
 548      if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {
 549          autosize = function autosize(el) {
 550              return el;
 551          };
 552          autosize.destroy = function (el) {
 553              return el;
 554          };
 555          autosize.update = function (el) {
 556              return el;
 557          };
 558      } else {
 559          autosize = function autosize(el, options) {
 560              if (el) {
 561                  Array.prototype.forEach.call(el.length ? el : [el], function (x) {
 562                      return assign(x, options);
 563                  });
 564              }
 565              return el;
 566          };
 567          autosize.destroy = function (el) {
 568              if (el) {
 569                  Array.prototype.forEach.call(el.length ? el : [el], destroy);
 570              }
 571              return el;
 572          };
 573          autosize.update = function (el) {
 574              if (el) {
 575                  Array.prototype.forEach.call(el.length ? el : [el], update);
 576              }
 577              return el;
 578          };
 579      }
 580  
 581      exports.default = autosize;
 582      module.exports = exports['default'];
 583  });
 584  
 585  /***/ }),
 586  
 587  /***/ 115:
 588  /***/ (function(module, exports, __webpack_require__) {
 589  
 590  // Load in dependencies
 591  var computedStyle = __webpack_require__(116);
 592  
 593  /**
 594   * Calculate the `line-height` of a given node
 595   * @param {HTMLElement} node Element to calculate line height of. Must be in the DOM.
 596   * @returns {Number} `line-height` of the element in pixels
 597   */
 598  function lineHeight(node) {
 599    // Grab the line-height via style
 600    var lnHeightStr = computedStyle(node, 'line-height');
 601    var lnHeight = parseFloat(lnHeightStr, 10);
 602  
 603    // If the lineHeight did not contain a unit (i.e. it was numeric), convert it to ems (e.g. '2.3' === '2.3em')
 604    if (lnHeightStr === lnHeight + '') {
 605      // Save the old lineHeight style and update the em unit to the element
 606      var _lnHeightStyle = node.style.lineHeight;
 607      node.style.lineHeight = lnHeightStr + 'em';
 608  
 609      // Calculate the em based height
 610      lnHeightStr = computedStyle(node, 'line-height');
 611      lnHeight = parseFloat(lnHeightStr, 10);
 612  
 613      // Revert the lineHeight style
 614      if (_lnHeightStyle) {
 615        node.style.lineHeight = _lnHeightStyle;
 616      } else {
 617        delete node.style.lineHeight;
 618      }
 619    }
 620  
 621    // If the lineHeight is in `pt`, convert it to pixels (4px for 3pt)
 622    // DEV: `em` units are converted to `pt` in IE6
 623    // Conversion ratio from https://developer.mozilla.org/en-US/docs/Web/CSS/length
 624    if (lnHeightStr.indexOf('pt') !== -1) {
 625      lnHeight *= 4;
 626      lnHeight /= 3;
 627    // Otherwise, if the lineHeight is in `mm`, convert it to pixels (96px for 25.4mm)
 628    } else if (lnHeightStr.indexOf('mm') !== -1) {
 629      lnHeight *= 96;
 630      lnHeight /= 25.4;
 631    // Otherwise, if the lineHeight is in `cm`, convert it to pixels (96px for 2.54cm)
 632    } else if (lnHeightStr.indexOf('cm') !== -1) {
 633      lnHeight *= 96;
 634      lnHeight /= 2.54;
 635    // Otherwise, if the lineHeight is in `in`, convert it to pixels (96px for 1in)
 636    } else if (lnHeightStr.indexOf('in') !== -1) {
 637      lnHeight *= 96;
 638    // Otherwise, if the lineHeight is in `pc`, convert it to pixels (12pt for 1pc)
 639    } else if (lnHeightStr.indexOf('pc') !== -1) {
 640      lnHeight *= 16;
 641    }
 642  
 643    // Continue our computation
 644    lnHeight = Math.round(lnHeight);
 645  
 646    // If the line-height is "normal", calculate by font-size
 647    if (lnHeightStr === 'normal') {
 648      // Create a temporary node
 649      var nodeName = node.nodeName;
 650      var _node = document.createElement(nodeName);
 651      _node.innerHTML = '&nbsp;';
 652  
 653      // If we have a text area, reset it to only 1 row
 654      // https://github.com/twolfson/line-height/issues/4
 655      if (nodeName.toUpperCase() === 'TEXTAREA') {
 656        _node.setAttribute('rows', '1');
 657      }
 658  
 659      // Set the font-size of the element
 660      var fontSizeStr = computedStyle(node, 'font-size');
 661      _node.style.fontSize = fontSizeStr;
 662  
 663      // Remove default padding/border which can affect offset height
 664      // https://github.com/twolfson/line-height/issues/4
 665      // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight
 666      _node.style.padding = '0px';
 667      _node.style.border = '0px';
 668  
 669      // Append it to the body
 670      var body = document.body;
 671      body.appendChild(_node);
 672  
 673      // Assume the line height of the element is the height
 674      var height = _node.offsetHeight;
 675      lnHeight = height;
 676  
 677      // Remove our child from the DOM
 678      body.removeChild(_node);
 679    }
 680  
 681    // Return the calculated height
 682    return lnHeight;
 683  }
 684  
 685  // Export lineHeight
 686  module.exports = lineHeight;
 687  
 688  
 689  /***/ }),
 690  
 691  /***/ 116:
 692  /***/ (function(module, exports) {
 693  
 694  // This code has been refactored for 140 bytes
 695  // You can see the original here: https://github.com/twolfson/computedStyle/blob/04cd1da2e30fa45844f95f5cb1ac898e9b9ef050/lib/computedStyle.js
 696  var computedStyle = function (el, prop, getComputedStyle) {
 697    getComputedStyle = window.getComputedStyle;
 698  
 699    // In one fell swoop
 700    return (
 701      // If we have getComputedStyle
 702      getComputedStyle ?
 703        // Query it
 704        // TODO: From CSS-Query notes, we might need (node, null) for FF
 705        getComputedStyle(el) :
 706  
 707      // Otherwise, we are in IE and use currentStyle
 708        el.currentStyle
 709    )[
 710      // Switch to camelCase for CSSOM
 711      // DEV: Grabbed from jQuery
 712      // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194
 713      // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597
 714      prop.replace(/-(\w)/gi, function (word, letter) {
 715        return letter.toUpperCase();
 716      })
 717    ];
 718  };
 719  
 720  module.exports = computedStyle;
 721  
 722  
 723  /***/ }),
 724  
 725  /***/ 12:
 726  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 727  
 728  "use strict";
 729  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; });
 730  function _defineProperties(target, props) {
 731    for (var i = 0; i < props.length; i++) {
 732      var descriptor = props[i];
 733      descriptor.enumerable = descriptor.enumerable || false;
 734      descriptor.configurable = true;
 735      if ("value" in descriptor) descriptor.writable = true;
 736      Object.defineProperty(target, descriptor.key, descriptor);
 737    }
 738  }
 739  
 740  function _createClass(Constructor, protoProps, staticProps) {
 741    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
 742    if (staticProps) _defineProperties(Constructor, staticProps);
 743    return Constructor;
 744  }
 745  
 746  /***/ }),
 747  
 748  /***/ 13:
 749  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 750  
 751  "use strict";
 752  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; });
 753  function _classCallCheck(instance, Constructor) {
 754    if (!(instance instanceof Constructor)) {
 755      throw new TypeError("Cannot call a class as a function");
 756    }
 757  }
 758  
 759  /***/ }),
 760  
 761  /***/ 14:
 762  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 763  
 764  "use strict";
 765  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
 766  function _extends() {
 767    _extends = Object.assign || function (target) {
 768      for (var i = 1; i < arguments.length; i++) {
 769        var source = arguments[i];
 770  
 771        for (var key in source) {
 772          if (Object.prototype.hasOwnProperty.call(source, key)) {
 773            target[key] = source[key];
 774          }
 775        }
 776      }
 777  
 778      return target;
 779    };
 780  
 781    return _extends.apply(this, arguments);
 782  }
 783  
 784  /***/ }),
 785  
 786  /***/ 142:
 787  /***/ (function(module, exports) {
 788  
 789  (function() { module.exports = this["wp"]["nux"]; }());
 790  
 791  /***/ }),
 792  
 793  /***/ 143:
 794  /***/ (function(module, exports) {
 795  
 796  (function() { module.exports = this["wp"]["notices"]; }());
 797  
 798  /***/ }),
 799  
 800  /***/ 15:
 801  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 802  
 803  "use strict";
 804  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; });
 805  /* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31);
 806  /* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
 807  
 808  
 809  function _possibleConstructorReturn(self, call) {
 810    if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) {
 811      return call;
 812    }
 813  
 814    return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self);
 815  }
 816  
 817  /***/ }),
 818  
 819  /***/ 16:
 820  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 821  
 822  "use strict";
 823  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; });
 824  function _getPrototypeOf(o) {
 825    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
 826      return o.__proto__ || Object.getPrototypeOf(o);
 827    };
 828    return _getPrototypeOf(o);
 829  }
 830  
 831  /***/ }),
 832  
 833  /***/ 17:
 834  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 835  
 836  "use strict";
 837  
 838  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
 839  function _setPrototypeOf(o, p) {
 840    _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
 841      o.__proto__ = p;
 842      return o;
 843    };
 844  
 845    return _setPrototypeOf(o, p);
 846  }
 847  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
 848  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _inherits; });
 849  
 850  function _inherits(subClass, superClass) {
 851    if (typeof superClass !== "function" && superClass !== null) {
 852      throw new TypeError("Super expression must either be null or a function");
 853    }
 854  
 855    subClass.prototype = Object.create(superClass && superClass.prototype, {
 856      constructor: {
 857        value: subClass,
 858        writable: true,
 859        configurable: true
 860      }
 861    });
 862    if (superClass) _setPrototypeOf(subClass, superClass);
 863  }
 864  
 865  /***/ }),
 866  
 867  /***/ 18:
 868  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 869  
 870  "use strict";
 871  
 872  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
 873  function _arrayWithoutHoles(arr) {
 874    if (Array.isArray(arr)) {
 875      for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
 876        arr2[i] = arr[i];
 877      }
 878  
 879      return arr2;
 880    }
 881  }
 882  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
 883  var iterableToArray = __webpack_require__(32);
 884  
 885  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
 886  function _nonIterableSpread() {
 887    throw new TypeError("Invalid attempt to spread non-iterable instance");
 888  }
 889  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
 890  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _toConsumableArray; });
 891  
 892  
 893  
 894  function _toConsumableArray(arr) {
 895    return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || _nonIterableSpread();
 896  }
 897  
 898  /***/ }),
 899  
 900  /***/ 19:
 901  /***/ (function(module, exports) {
 902  
 903  (function() { module.exports = this["wp"]["keycodes"]; }());
 904  
 905  /***/ }),
 906  
 907  /***/ 2:
 908  /***/ (function(module, exports) {
 909  
 910  (function() { module.exports = this["lodash"]; }());
 911  
 912  /***/ }),
 913  
 914  /***/ 20:
 915  /***/ (function(module, exports) {
 916  
 917  (function() { module.exports = this["React"]; }());
 918  
 919  /***/ }),
 920  
 921  /***/ 21:
 922  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 923  
 924  "use strict";
 925  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; });
 926  /* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40);
 927  
 928  function _objectWithoutProperties(source, excluded) {
 929    if (source == null) return {};
 930    var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded);
 931    var key, i;
 932  
 933    if (Object.getOwnPropertySymbols) {
 934      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
 935  
 936      for (i = 0; i < sourceSymbolKeys.length; i++) {
 937        key = sourceSymbolKeys[i];
 938        if (excluded.indexOf(key) >= 0) continue;
 939        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
 940        target[key] = source[key];
 941      }
 942    }
 943  
 944    return target;
 945  }
 946  
 947  /***/ }),
 948  
 949  /***/ 22:
 950  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 951  
 952  "use strict";
 953  
 954  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
 955  var arrayWithHoles = __webpack_require__(33);
 956  
 957  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
 958  function _iterableToArrayLimit(arr, i) {
 959    if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
 960      return;
 961    }
 962  
 963    var _arr = [];
 964    var _n = true;
 965    var _d = false;
 966    var _e = undefined;
 967  
 968    try {
 969      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
 970        _arr.push(_s.value);
 971  
 972        if (i && _arr.length === i) break;
 973      }
 974    } catch (err) {
 975      _d = true;
 976      _e = err;
 977    } finally {
 978      try {
 979        if (!_n && _i["return"] != null) _i["return"]();
 980      } finally {
 981        if (_d) throw _e;
 982      }
 983    }
 984  
 985    return _arr;
 986  }
 987  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
 988  var nonIterableRest = __webpack_require__(34);
 989  
 990  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
 991  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _slicedToArray; });
 992  
 993  
 994  
 995  function _slicedToArray(arr, i) {
 996    return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(nonIterableRest["a" /* default */])();
 997  }
 998  
 999  /***/ }),
1000  
1001  /***/ 23:
1002  /***/ (function(module, exports) {
1003  
1004  (function() { module.exports = this["regeneratorRuntime"]; }());
1005  
1006  /***/ }),
1007  
1008  /***/ 24:
1009  /***/ (function(module, exports) {
1010  
1011  (function() { module.exports = this["wp"]["richText"]; }());
1012  
1013  /***/ }),
1014  
1015  /***/ 25:
1016  /***/ (function(module, exports) {
1017  
1018  (function() { module.exports = this["wp"]["url"]; }());
1019  
1020  /***/ }),
1021  
1022  /***/ 27:
1023  /***/ (function(module, exports) {
1024  
1025  (function() { module.exports = this["wp"]["hooks"]; }());
1026  
1027  /***/ }),
1028  
1029  /***/ 28:
1030  /***/ (function(module, exports, __webpack_require__) {
1031  
1032  /**
1033   * Copyright (c) 2013-present, Facebook, Inc.
1034   *
1035   * This source code is licensed under the MIT license found in the
1036   * LICENSE file in the root directory of this source tree.
1037   */
1038  
1039  if (false) { var throwOnDirectAccess, ReactIs; } else {
1040    // By explicitly using `prop-types` you are opting into new production behavior.
1041    // http://fb.me/prop-types-in-prod
1042    module.exports = __webpack_require__(88)();
1043  }
1044  
1045  
1046  /***/ }),
1047  
1048  /***/ 3:
1049  /***/ (function(module, exports) {
1050  
1051  (function() { module.exports = this["wp"]["components"]; }());
1052  
1053  /***/ }),
1054  
1055  /***/ 31:
1056  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1057  
1058  "use strict";
1059  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
1060  function _typeof(obj) {
1061    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
1062      _typeof = function _typeof(obj) {
1063        return typeof obj;
1064      };
1065    } else {
1066      _typeof = function _typeof(obj) {
1067        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1068      };
1069    }
1070  
1071    return _typeof(obj);
1072  }
1073  
1074  /***/ }),
1075  
1076  /***/ 32:
1077  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1078  
1079  "use strict";
1080  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
1081  function _iterableToArray(iter) {
1082    if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
1083  }
1084  
1085  /***/ }),
1086  
1087  /***/ 33:
1088  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1089  
1090  "use strict";
1091  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
1092  function _arrayWithHoles(arr) {
1093    if (Array.isArray(arr)) return arr;
1094  }
1095  
1096  /***/ }),
1097  
1098  /***/ 34:
1099  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1100  
1101  "use strict";
1102  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
1103  function _nonIterableRest() {
1104    throw new TypeError("Invalid attempt to destructure non-iterable instance");
1105  }
1106  
1107  /***/ }),
1108  
1109  /***/ 345:
1110  /***/ (function(module, exports, __webpack_require__) {
1111  
1112  "use strict";
1113  
1114  
1115  var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
1116  
1117  function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
1118  
1119  var BEGIN = 'BEGIN';
1120  var COMMIT = 'COMMIT';
1121  var REVERT = 'REVERT';
1122  // Array({transactionID: string or null, beforeState: {object}, action: {object}}
1123  var INITIAL_OPTIMIST = [];
1124  
1125  module.exports = optimist;
1126  module.exports.BEGIN = BEGIN;
1127  module.exports.COMMIT = COMMIT;
1128  module.exports.REVERT = REVERT;
1129  function optimist(fn) {
1130    function beginReducer(state, action) {
1131      var _separateState = separateState(state);
1132  
1133      var optimist = _separateState.optimist;
1134      var innerState = _separateState.innerState;
1135  
1136      optimist = optimist.concat([{ beforeState: innerState, action: action }]);
1137      innerState = fn(innerState, action);
1138      validateState(innerState, action);
1139      return _extends({ optimist: optimist }, innerState);
1140    }
1141    function commitReducer(state, action) {
1142      var _separateState2 = separateState(state);
1143  
1144      var optimist = _separateState2.optimist;
1145      var innerState = _separateState2.innerState;
1146  
1147      var newOptimist = [],
1148          started = false,
1149          committed = false;
1150      optimist.forEach(function (entry) {
1151        if (started) {
1152          if (entry.beforeState && matchesTransaction(entry.action, action.optimist.id)) {
1153            committed = true;
1154            newOptimist.push({ action: entry.action });
1155          } else {
1156            newOptimist.push(entry);
1157          }
1158        } else if (entry.beforeState && !matchesTransaction(entry.action, action.optimist.id)) {
1159          started = true;
1160          newOptimist.push(entry);
1161        } else if (entry.beforeState && matchesTransaction(entry.action, action.optimist.id)) {
1162          committed = true;
1163        }
1164      });
1165      if (!committed) {
1166        console.error('Cannot commit transaction with id "' + action.optimist.id + '" because it does not exist');
1167      }
1168      optimist = newOptimist;
1169      return baseReducer(optimist, innerState, action);
1170    }
1171    function revertReducer(state, action) {
1172      var _separateState3 = separateState(state);
1173  
1174      var optimist = _separateState3.optimist;
1175      var innerState = _separateState3.innerState;
1176  
1177      var newOptimist = [],
1178          started = false,
1179          gotInitialState = false,
1180          currentState = innerState;
1181      optimist.forEach(function (entry) {
1182        if (entry.beforeState && matchesTransaction(entry.action, action.optimist.id)) {
1183          currentState = entry.beforeState;
1184          gotInitialState = true;
1185        }
1186        if (!matchesTransaction(entry.action, action.optimist.id)) {
1187          if (entry.beforeState) {
1188            started = true;
1189          }
1190          if (started) {
1191            if (gotInitialState && entry.beforeState) {
1192              newOptimist.push({
1193                beforeState: currentState,
1194                action: entry.action
1195              });
1196            } else {
1197              newOptimist.push(entry);
1198            }
1199          }
1200          if (gotInitialState) {
1201            currentState = fn(currentState, entry.action);
1202            validateState(innerState, action);
1203          }
1204        }
1205      });
1206      if (!gotInitialState) {
1207        console.error('Cannot revert transaction with id "' + action.optimist.id + '" because it does not exist');
1208      }
1209      optimist = newOptimist;
1210      return baseReducer(optimist, currentState, action);
1211    }
1212    function baseReducer(optimist, innerState, action) {
1213      if (optimist.length) {
1214        optimist = optimist.concat([{ action: action }]);
1215      }
1216      innerState = fn(innerState, action);
1217      validateState(innerState, action);
1218      return _extends({ optimist: optimist }, innerState);
1219    }
1220    return function (state, action) {
1221      if (action.optimist) {
1222        switch (action.optimist.type) {
1223          case BEGIN:
1224            return beginReducer(state, action);
1225          case COMMIT:
1226            return commitReducer(state, action);
1227          case REVERT:
1228            return revertReducer(state, action);
1229        }
1230      }
1231  
1232      var _separateState4 = separateState(state);
1233  
1234      var optimist = _separateState4.optimist;
1235      var innerState = _separateState4.innerState;
1236  
1237      if (state && !optimist.length) {
1238        var nextState = fn(innerState, action);
1239        if (nextState === innerState) {
1240          return state;
1241        }
1242        validateState(nextState, action);
1243        return _extends({ optimist: optimist }, nextState);
1244      }
1245      return baseReducer(optimist, innerState, action);
1246    };
1247  }
1248  
1249  function matchesTransaction(action, id) {
1250    return action.optimist && action.optimist.id === id;
1251  }
1252  
1253  function validateState(newState, action) {
1254    if (!newState || typeof newState !== 'object' || Array.isArray(newState)) {
1255      throw new TypeError('Error while handling "' + action.type + '": Optimist requires that state is always a plain object.');
1256    }
1257  }
1258  
1259  function separateState(state) {
1260    if (!state) {
1261      return { optimist: INITIAL_OPTIMIST, innerState: state };
1262    } else {
1263      var _state$optimist = state.optimist;
1264  
1265      var _optimist = _state$optimist === undefined ? INITIAL_OPTIMIST : _state$optimist;
1266  
1267      var innerState = _objectWithoutProperties(state, ['optimist']);
1268  
1269      return { optimist: _optimist, innerState: innerState };
1270    }
1271  }
1272  
1273  /***/ }),
1274  
1275  /***/ 35:
1276  /***/ (function(module, exports) {
1277  
1278  (function() { module.exports = this["wp"]["deprecated"]; }());
1279  
1280  /***/ }),
1281  
1282  /***/ 363:
1283  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1284  
1285  "use strict";
1286  __webpack_require__.r(__webpack_exports__);
1287  var actions_namespaceObject = {};
1288  __webpack_require__.r(actions_namespaceObject);
1289  __webpack_require__.d(actions_namespaceObject, "setupEditor", function() { return actions_setupEditor; });
1290  __webpack_require__.d(actions_namespaceObject, "__experimentalTearDownEditor", function() { return actions_experimentalTearDownEditor; });
1291  __webpack_require__.d(actions_namespaceObject, "resetPost", function() { return resetPost; });
1292  __webpack_require__.d(actions_namespaceObject, "resetAutosave", function() { return resetAutosave; });
1293  __webpack_require__.d(actions_namespaceObject, "__experimentalRequestPostUpdateStart", function() { return __experimentalRequestPostUpdateStart; });
1294  __webpack_require__.d(actions_namespaceObject, "__experimentalRequestPostUpdateFinish", function() { return __experimentalRequestPostUpdateFinish; });
1295  __webpack_require__.d(actions_namespaceObject, "updatePost", function() { return updatePost; });
1296  __webpack_require__.d(actions_namespaceObject, "setupEditorState", function() { return setupEditorState; });
1297  __webpack_require__.d(actions_namespaceObject, "editPost", function() { return actions_editPost; });
1298  __webpack_require__.d(actions_namespaceObject, "__experimentalOptimisticUpdatePost", function() { return __experimentalOptimisticUpdatePost; });
1299  __webpack_require__.d(actions_namespaceObject, "savePost", function() { return savePost; });
1300  __webpack_require__.d(actions_namespaceObject, "refreshPost", function() { return refreshPost; });
1301  __webpack_require__.d(actions_namespaceObject, "trashPost", function() { return trashPost; });
1302  __webpack_require__.d(actions_namespaceObject, "autosave", function() { return actions_autosave; });
1303  __webpack_require__.d(actions_namespaceObject, "__experimentalLocalAutosave", function() { return actions_experimentalLocalAutosave; });
1304  __webpack_require__.d(actions_namespaceObject, "redo", function() { return actions_redo; });
1305  __webpack_require__.d(actions_namespaceObject, "undo", function() { return actions_undo; });
1306  __webpack_require__.d(actions_namespaceObject, "createUndoLevel", function() { return createUndoLevel; });
1307  __webpack_require__.d(actions_namespaceObject, "updatePostLock", function() { return actions_updatePostLock; });
1308  __webpack_require__.d(actions_namespaceObject, "__experimentalFetchReusableBlocks", function() { return actions_experimentalFetchReusableBlocks; });
1309  __webpack_require__.d(actions_namespaceObject, "__experimentalReceiveReusableBlocks", function() { return __experimentalReceiveReusableBlocks; });
1310  __webpack_require__.d(actions_namespaceObject, "__experimentalSaveReusableBlock", function() { return __experimentalSaveReusableBlock; });
1311  __webpack_require__.d(actions_namespaceObject, "__experimentalDeleteReusableBlock", function() { return __experimentalDeleteReusableBlock; });
1312  __webpack_require__.d(actions_namespaceObject, "__experimentalUpdateReusableBlock", function() { return __experimentalUpdateReusableBlock; });
1313  __webpack_require__.d(actions_namespaceObject, "__experimentalConvertBlockToStatic", function() { return __experimentalConvertBlockToStatic; });
1314  __webpack_require__.d(actions_namespaceObject, "__experimentalConvertBlockToReusable", function() { return __experimentalConvertBlockToReusable; });
1315  __webpack_require__.d(actions_namespaceObject, "enablePublishSidebar", function() { return enablePublishSidebar; });
1316  __webpack_require__.d(actions_namespaceObject, "disablePublishSidebar", function() { return disablePublishSidebar; });
1317  __webpack_require__.d(actions_namespaceObject, "lockPostSaving", function() { return lockPostSaving; });
1318  __webpack_require__.d(actions_namespaceObject, "unlockPostSaving", function() { return unlockPostSaving; });
1319  __webpack_require__.d(actions_namespaceObject, "lockPostAutosaving", function() { return lockPostAutosaving; });
1320  __webpack_require__.d(actions_namespaceObject, "unlockPostAutosaving", function() { return unlockPostAutosaving; });
1321  __webpack_require__.d(actions_namespaceObject, "resetEditorBlocks", function() { return actions_resetEditorBlocks; });
1322  __webpack_require__.d(actions_namespaceObject, "updateEditorSettings", function() { return actions_updateEditorSettings; });
1323  __webpack_require__.d(actions_namespaceObject, "resetBlocks", function() { return resetBlocks; });
1324  __webpack_require__.d(actions_namespaceObject, "receiveBlocks", function() { return receiveBlocks; });
1325  __webpack_require__.d(actions_namespaceObject, "updateBlock", function() { return updateBlock; });
1326  __webpack_require__.d(actions_namespaceObject, "updateBlockAttributes", function() { return updateBlockAttributes; });
1327  __webpack_require__.d(actions_namespaceObject, "selectBlock", function() { return selectBlock; });
1328  __webpack_require__.d(actions_namespaceObject, "startMultiSelect", function() { return startMultiSelect; });
1329  __webpack_require__.d(actions_namespaceObject, "stopMultiSelect", function() { return stopMultiSelect; });
1330  __webpack_require__.d(actions_namespaceObject, "multiSelect", function() { return multiSelect; });
1331  __webpack_require__.d(actions_namespaceObject, "clearSelectedBlock", function() { return actions_clearSelectedBlock; });
1332  __webpack_require__.d(actions_namespaceObject, "toggleSelection", function() { return toggleSelection; });
1333  __webpack_require__.d(actions_namespaceObject, "replaceBlocks", function() { return actions_replaceBlocks; });
1334  __webpack_require__.d(actions_namespaceObject, "replaceBlock", function() { return replaceBlock; });
1335  __webpack_require__.d(actions_namespaceObject, "moveBlocksDown", function() { return moveBlocksDown; });
1336  __webpack_require__.d(actions_namespaceObject, "moveBlocksUp", function() { return moveBlocksUp; });
1337  __webpack_require__.d(actions_namespaceObject, "moveBlockToPosition", function() { return moveBlockToPosition; });
1338  __webpack_require__.d(actions_namespaceObject, "insertBlock", function() { return insertBlock; });
1339  __webpack_require__.d(actions_namespaceObject, "insertBlocks", function() { return insertBlocks; });
1340  __webpack_require__.d(actions_namespaceObject, "showInsertionPoint", function() { return showInsertionPoint; });
1341  __webpack_require__.d(actions_namespaceObject, "hideInsertionPoint", function() { return hideInsertionPoint; });
1342  __webpack_require__.d(actions_namespaceObject, "setTemplateValidity", function() { return setTemplateValidity; });
1343  __webpack_require__.d(actions_namespaceObject, "synchronizeTemplate", function() { return synchronizeTemplate; });
1344  __webpack_require__.d(actions_namespaceObject, "mergeBlocks", function() { return mergeBlocks; });
1345  __webpack_require__.d(actions_namespaceObject, "removeBlocks", function() { return removeBlocks; });
1346  __webpack_require__.d(actions_namespaceObject, "removeBlock", function() { return removeBlock; });
1347  __webpack_require__.d(actions_namespaceObject, "toggleBlockMode", function() { return toggleBlockMode; });
1348  __webpack_require__.d(actions_namespaceObject, "startTyping", function() { return startTyping; });
1349  __webpack_require__.d(actions_namespaceObject, "stopTyping", function() { return stopTyping; });
1350  __webpack_require__.d(actions_namespaceObject, "enterFormattedText", function() { return enterFormattedText; });
1351  __webpack_require__.d(actions_namespaceObject, "exitFormattedText", function() { return exitFormattedText; });
1352  __webpack_require__.d(actions_namespaceObject, "insertDefaultBlock", function() { return actions_insertDefaultBlock; });
1353  __webpack_require__.d(actions_namespaceObject, "updateBlockListSettings", function() { return updateBlockListSettings; });
1354  var selectors_namespaceObject = {};
1355  __webpack_require__.r(selectors_namespaceObject);
1356  __webpack_require__.d(selectors_namespaceObject, "hasEditorUndo", function() { return hasEditorUndo; });
1357  __webpack_require__.d(selectors_namespaceObject, "hasEditorRedo", function() { return hasEditorRedo; });
1358  __webpack_require__.d(selectors_namespaceObject, "isEditedPostNew", function() { return selectors_isEditedPostNew; });
1359  __webpack_require__.d(selectors_namespaceObject, "hasChangedContent", function() { return hasChangedContent; });
1360  __webpack_require__.d(selectors_namespaceObject, "isEditedPostDirty", function() { return selectors_isEditedPostDirty; });
1361  __webpack_require__.d(selectors_namespaceObject, "isCleanNewPost", function() { return selectors_isCleanNewPost; });
1362  __webpack_require__.d(selectors_namespaceObject, "getCurrentPost", function() { return selectors_getCurrentPost; });
1363  __webpack_require__.d(selectors_namespaceObject, "getCurrentPostType", function() { return selectors_getCurrentPostType; });
1364  __webpack_require__.d(selectors_namespaceObject, "getCurrentPostId", function() { return selectors_getCurrentPostId; });
1365  __webpack_require__.d(selectors_namespaceObject, "getCurrentPostRevisionsCount", function() { return getCurrentPostRevisionsCount; });
1366  __webpack_require__.d(selectors_namespaceObject, "getCurrentPostLastRevisionId", function() { return getCurrentPostLastRevisionId; });
1367  __webpack_require__.d(selectors_namespaceObject, "getPostEdits", function() { return getPostEdits; });
1368  __webpack_require__.d(selectors_namespaceObject, "getReferenceByDistinctEdits", function() { return getReferenceByDistinctEdits; });
1369  __webpack_require__.d(selectors_namespaceObject, "getCurrentPostAttribute", function() { return selectors_getCurrentPostAttribute; });
1370  __webpack_require__.d(selectors_namespaceObject, "getEditedPostAttribute", function() { return selectors_getEditedPostAttribute; });
1371  __webpack_require__.d(selectors_namespaceObject, "getAutosaveAttribute", function() { return getAutosaveAttribute; });
1372  __webpack_require__.d(selectors_namespaceObject, "getEditedPostVisibility", function() { return selectors_getEditedPostVisibility; });
1373  __webpack_require__.d(selectors_namespaceObject, "isCurrentPostPending", function() { return isCurrentPostPending; });
1374  __webpack_require__.d(selectors_namespaceObject, "isCurrentPostPublished", function() { return selectors_isCurrentPostPublished; });
1375  __webpack_require__.d(selectors_namespaceObject, "isCurrentPostScheduled", function() { return selectors_isCurrentPostScheduled; });
1376  __webpack_require__.d(selectors_namespaceObject, "isEditedPostPublishable", function() { return selectors_isEditedPostPublishable; });
1377  __webpack_require__.d(selectors_namespaceObject, "isEditedPostSaveable", function() { return selectors_isEditedPostSaveable; });
1378  __webpack_require__.d(selectors_namespaceObject, "isEditedPostEmpty", function() { return isEditedPostEmpty; });
1379  __webpack_require__.d(selectors_namespaceObject, "isEditedPostAutosaveable", function() { return selectors_isEditedPostAutosaveable; });
1380  __webpack_require__.d(selectors_namespaceObject, "getAutosave", function() { return getAutosave; });
1381  __webpack_require__.d(selectors_namespaceObject, "hasAutosave", function() { return hasAutosave; });
1382  __webpack_require__.d(selectors_namespaceObject, "isEditedPostBeingScheduled", function() { return selectors_isEditedPostBeingScheduled; });
1383  __webpack_require__.d(selectors_namespaceObject, "isEditedPostDateFloating", function() { return isEditedPostDateFloating; });
1384  __webpack_require__.d(selectors_namespaceObject, "isSavingPost", function() { return selectors_isSavingPost; });
1385  __webpack_require__.d(selectors_namespaceObject, "didPostSaveRequestSucceed", function() { return didPostSaveRequestSucceed; });
1386  __webpack_require__.d(selectors_namespaceObject, "didPostSaveRequestFail", function() { return didPostSaveRequestFail; });
1387  __webpack_require__.d(selectors_namespaceObject, "isAutosavingPost", function() { return selectors_isAutosavingPost; });
1388  __webpack_require__.d(selectors_namespaceObject, "isPreviewingPost", function() { return isPreviewingPost; });
1389  __webpack_require__.d(selectors_namespaceObject, "getEditedPostPreviewLink", function() { return selectors_getEditedPostPreviewLink; });
1390  __webpack_require__.d(selectors_namespaceObject, "getSuggestedPostFormat", function() { return selectors_getSuggestedPostFormat; });
1391  __webpack_require__.d(selectors_namespaceObject, "getBlocksForSerialization", function() { return getBlocksForSerialization; });
1392  __webpack_require__.d(selectors_namespaceObject, "getEditedPostContent", function() { return getEditedPostContent; });
1393  __webpack_require__.d(selectors_namespaceObject, "__experimentalGetReusableBlock", function() { return __experimentalGetReusableBlock; });
1394  __webpack_require__.d(selectors_namespaceObject, "__experimentalIsSavingReusableBlock", function() { return __experimentalIsSavingReusableBlock; });
1395  __webpack_require__.d(selectors_namespaceObject, "__experimentalIsFetchingReusableBlock", function() { return __experimentalIsFetchingReusableBlock; });
1396  __webpack_require__.d(selectors_namespaceObject, "__experimentalGetReusableBlocks", function() { return selectors_experimentalGetReusableBlocks; });
1397  __webpack_require__.d(selectors_namespaceObject, "getStateBeforeOptimisticTransaction", function() { return getStateBeforeOptimisticTransaction; });
1398  __webpack_require__.d(selectors_namespaceObject, "isPublishingPost", function() { return selectors_isPublishingPost; });
1399  __webpack_require__.d(selectors_namespaceObject, "isPermalinkEditable", function() { return selectors_isPermalinkEditable; });
1400  __webpack_require__.d(selectors_namespaceObject, "getPermalink", function() { return getPermalink; });
1401  __webpack_require__.d(selectors_namespaceObject, "getPermalinkParts", function() { return selectors_getPermalinkParts; });
1402  __webpack_require__.d(selectors_namespaceObject, "inSomeHistory", function() { return inSomeHistory; });
1403  __webpack_require__.d(selectors_namespaceObject, "isPostLocked", function() { return isPostLocked; });
1404  __webpack_require__.d(selectors_namespaceObject, "isPostSavingLocked", function() { return selectors_isPostSavingLocked; });
1405  __webpack_require__.d(selectors_namespaceObject, "isPostAutosavingLocked", function() { return isPostAutosavingLocked; });
1406  __webpack_require__.d(selectors_namespaceObject, "isPostLockTakeover", function() { return isPostLockTakeover; });
1407  __webpack_require__.d(selectors_namespaceObject, "getPostLockUser", function() { return getPostLockUser; });
1408  __webpack_require__.d(selectors_namespaceObject, "getActivePostLock", function() { return getActivePostLock; });
1409  __webpack_require__.d(selectors_namespaceObject, "canUserUseUnfilteredHTML", function() { return selectors_canUserUseUnfilteredHTML; });
1410  __webpack_require__.d(selectors_namespaceObject, "isPublishSidebarEnabled", function() { return selectors_isPublishSidebarEnabled; });
1411  __webpack_require__.d(selectors_namespaceObject, "getEditorBlocks", function() { return selectors_getEditorBlocks; });
1412  __webpack_require__.d(selectors_namespaceObject, "getEditorSelectionStart", function() { return selectors_getEditorSelectionStart; });
1413  __webpack_require__.d(selectors_namespaceObject, "getEditorSelectionEnd", function() { return selectors_getEditorSelectionEnd; });
1414  __webpack_require__.d(selectors_namespaceObject, "__unstableIsEditorReady", function() { return __unstableIsEditorReady; });
1415  __webpack_require__.d(selectors_namespaceObject, "getEditorSettings", function() { return selectors_getEditorSettings; });
1416  __webpack_require__.d(selectors_namespaceObject, "getBlockName", function() { return selectors_getBlockName; });
1417  __webpack_require__.d(selectors_namespaceObject, "isBlockValid", function() { return isBlockValid; });
1418  __webpack_require__.d(selectors_namespaceObject, "getBlockAttributes", function() { return getBlockAttributes; });
1419  __webpack_require__.d(selectors_namespaceObject, "getBlock", function() { return selectors_getBlock; });
1420  __webpack_require__.d(selectors_namespaceObject, "getBlocks", function() { return selectors_getBlocks; });
1421  __webpack_require__.d(selectors_namespaceObject, "__unstableGetBlockWithoutInnerBlocks", function() { return __unstableGetBlockWithoutInnerBlocks; });
1422  __webpack_require__.d(selectors_namespaceObject, "getClientIdsOfDescendants", function() { return getClientIdsOfDescendants; });
1423  __webpack_require__.d(selectors_namespaceObject, "getClientIdsWithDescendants", function() { return getClientIdsWithDescendants; });
1424  __webpack_require__.d(selectors_namespaceObject, "getGlobalBlockCount", function() { return getGlobalBlockCount; });
1425  __webpack_require__.d(selectors_namespaceObject, "getBlocksByClientId", function() { return selectors_getBlocksByClientId; });
1426  __webpack_require__.d(selectors_namespaceObject, "getBlockCount", function() { return getBlockCount; });
1427  __webpack_require__.d(selectors_namespaceObject, "getBlockSelectionStart", function() { return getBlockSelectionStart; });
1428  __webpack_require__.d(selectors_namespaceObject, "getBlockSelectionEnd", function() { return getBlockSelectionEnd; });
1429  __webpack_require__.d(selectors_namespaceObject, "getSelectedBlockCount", function() { return getSelectedBlockCount; });
1430  __webpack_require__.d(selectors_namespaceObject, "hasSelectedBlock", function() { return hasSelectedBlock; });
1431  __webpack_require__.d(selectors_namespaceObject, "getSelectedBlockClientId", function() { return selectors_getSelectedBlockClientId; });
1432  __webpack_require__.d(selectors_namespaceObject, "getSelectedBlock", function() { return getSelectedBlock; });
1433  __webpack_require__.d(selectors_namespaceObject, "getBlockRootClientId", function() { return getBlockRootClientId; });
1434  __webpack_require__.d(selectors_namespaceObject, "getBlockHierarchyRootClientId", function() { return getBlockHierarchyRootClientId; });
1435  __webpack_require__.d(selectors_namespaceObject, "getAdjacentBlockClientId", function() { return getAdjacentBlockClientId; });
1436  __webpack_require__.d(selectors_namespaceObject, "getPreviousBlockClientId", function() { return getPreviousBlockClientId; });
1437  __webpack_require__.d(selectors_namespaceObject, "getNextBlockClientId", function() { return getNextBlockClientId; });
1438  __webpack_require__.d(selectors_namespaceObject, "getSelectedBlocksInitialCaretPosition", function() { return getSelectedBlocksInitialCaretPosition; });
1439  __webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlockClientIds", function() { return getMultiSelectedBlockClientIds; });
1440  __webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlocks", function() { return getMultiSelectedBlocks; });
1441  __webpack_require__.d(selectors_namespaceObject, "getFirstMultiSelectedBlockClientId", function() { return getFirstMultiSelectedBlockClientId; });
1442  __webpack_require__.d(selectors_namespaceObject, "getLastMultiSelectedBlockClientId", function() { return getLastMultiSelectedBlockClientId; });
1443  __webpack_require__.d(selectors_namespaceObject, "isFirstMultiSelectedBlock", function() { return isFirstMultiSelectedBlock; });
1444  __webpack_require__.d(selectors_namespaceObject, "isBlockMultiSelected", function() { return isBlockMultiSelected; });
1445  __webpack_require__.d(selectors_namespaceObject, "isAncestorMultiSelected", function() { return isAncestorMultiSelected; });
1446  __webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlocksStartClientId", function() { return getMultiSelectedBlocksStartClientId; });
1447  __webpack_require__.d(selectors_namespaceObject, "getMultiSelectedBlocksEndClientId", function() { return getMultiSelectedBlocksEndClientId; });
1448  __webpack_require__.d(selectors_namespaceObject, "getBlockOrder", function() { return getBlockOrder; });
1449  __webpack_require__.d(selectors_namespaceObject, "getBlockIndex", function() { return getBlockIndex; });
1450  __webpack_require__.d(selectors_namespaceObject, "isBlockSelected", function() { return isBlockSelected; });
1451  __webpack_require__.d(selectors_namespaceObject, "hasSelectedInnerBlock", function() { return hasSelectedInnerBlock; });
1452  __webpack_require__.d(selectors_namespaceObject, "isBlockWithinSelection", function() { return isBlockWithinSelection; });
1453  __webpack_require__.d(selectors_namespaceObject, "hasMultiSelection", function() { return hasMultiSelection; });
1454  __webpack_require__.d(selectors_namespaceObject, "isMultiSelecting", function() { return isMultiSelecting; });
1455  __webpack_require__.d(selectors_namespaceObject, "isSelectionEnabled", function() { return isSelectionEnabled; });
1456  __webpack_require__.d(selectors_namespaceObject, "getBlockMode", function() { return getBlockMode; });
1457  __webpack_require__.d(selectors_namespaceObject, "isTyping", function() { return isTyping; });
1458  __webpack_require__.d(selectors_namespaceObject, "isCaretWithinFormattedText", function() { return isCaretWithinFormattedText; });
1459  __webpack_require__.d(selectors_namespaceObject, "getBlockInsertionPoint", function() { return getBlockInsertionPoint; });
1460  __webpack_require__.d(selectors_namespaceObject, "isBlockInsertionPointVisible", function() { return isBlockInsertionPointVisible; });
1461  __webpack_require__.d(selectors_namespaceObject, "isValidTemplate", function() { return isValidTemplate; });
1462  __webpack_require__.d(selectors_namespaceObject, "getTemplate", function() { return getTemplate; });
1463  __webpack_require__.d(selectors_namespaceObject, "getTemplateLock", function() { return getTemplateLock; });
1464  __webpack_require__.d(selectors_namespaceObject, "canInsertBlockType", function() { return selectors_canInsertBlockType; });
1465  __webpack_require__.d(selectors_namespaceObject, "getInserterItems", function() { return selectors_getInserterItems; });
1466  __webpack_require__.d(selectors_namespaceObject, "hasInserterItems", function() { return hasInserterItems; });
1467  __webpack_require__.d(selectors_namespaceObject, "getBlockListSettings", function() { return getBlockListSettings; });
1468  
1469  // EXTERNAL MODULE: external {"this":["wp","blockEditor"]}
1470  var external_this_wp_blockEditor_ = __webpack_require__(5);
1471  
1472  // EXTERNAL MODULE: external {"this":["wp","blocks"]}
1473  var external_this_wp_blocks_ = __webpack_require__(10);
1474  
1475  // EXTERNAL MODULE: external {"this":["wp","coreData"]}
1476  var external_this_wp_coreData_ = __webpack_require__(62);
1477  
1478  // EXTERNAL MODULE: external {"this":["wp","notices"]}
1479  var external_this_wp_notices_ = __webpack_require__(143);
1480  
1481  // EXTERNAL MODULE: external {"this":["wp","nux"]}
1482  var external_this_wp_nux_ = __webpack_require__(142);
1483  
1484  // EXTERNAL MODULE: external {"this":["wp","richText"]}
1485  var external_this_wp_richText_ = __webpack_require__(24);
1486  
1487  // EXTERNAL MODULE: external {"this":["wp","viewport"]}
1488  var external_this_wp_viewport_ = __webpack_require__(50);
1489  
1490  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread.js
1491  var objectSpread = __webpack_require__(7);
1492  
1493  // EXTERNAL MODULE: external {"this":["wp","data"]}
1494  var external_this_wp_data_ = __webpack_require__(4);
1495  
1496  // EXTERNAL MODULE: external {"this":["wp","dataControls"]}
1497  var external_this_wp_dataControls_ = __webpack_require__(39);
1498  
1499  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
1500  var defineProperty = __webpack_require__(9);
1501  
1502  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
1503  var esm_typeof = __webpack_require__(31);
1504  
1505  // EXTERNAL MODULE: ./node_modules/redux-optimist/index.js
1506  var redux_optimist = __webpack_require__(85);
1507  var redux_optimist_default = /*#__PURE__*/__webpack_require__.n(redux_optimist);
1508  
1509  // EXTERNAL MODULE: external {"this":"lodash"}
1510  var external_this_lodash_ = __webpack_require__(2);
1511  
1512  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/defaults.js
1513  
1514  
1515  /**
1516   * WordPress dependencies
1517   */
1518  
1519  var PREFERENCES_DEFAULTS = {
1520    insertUsage: {},
1521    // Should be kept for backward compatibility, see: https://github.com/WordPress/gutenberg/issues/14580.
1522    isPublishSidebarEnabled: true
1523  };
1524  /**
1525   * The default post editor settings
1526   *
1527   *  allowedBlockTypes  boolean|Array Allowed block types
1528   *  richEditingEnabled boolean       Whether rich editing is enabled or not
1529   *  codeEditingEnabled boolean       Whether code editing is enabled or not
1530   *  enableCustomFields boolean       Whether the WordPress custom fields are enabled or not
1531   *  autosaveInterval   number        Autosave Interval
1532   *  availableTemplates array?        The available post templates
1533   *  disablePostFormats boolean       Whether or not the post formats are disabled
1534   *  allowedMimeTypes   array?        List of allowed mime types and file extensions
1535   *  maxUploadFileSize  number        Maximum upload file size
1536   */
1537  
1538  var EDITOR_SETTINGS_DEFAULTS = Object(objectSpread["a" /* default */])({}, external_this_wp_blockEditor_["SETTINGS_DEFAULTS"], {
1539    richEditingEnabled: true,
1540    codeEditingEnabled: true,
1541    enableCustomFields: false
1542  });
1543  
1544  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/reducer.js
1545  
1546  
1547  
1548  
1549  /**
1550   * External dependencies
1551   */
1552  
1553  
1554  /**
1555   * WordPress dependencies
1556   */
1557  
1558  
1559  /**
1560   * Internal dependencies
1561   */
1562  
1563  
1564  /**
1565   * Returns a post attribute value, flattening nested rendered content using its
1566   * raw value in place of its original object form.
1567   *
1568   * @param {*} value Original value.
1569   *
1570   * @return {*} Raw value.
1571   */
1572  
1573  function getPostRawValue(value) {
1574    if (value && 'object' === Object(esm_typeof["a" /* default */])(value) && 'raw' in value) {
1575      return value.raw;
1576    }
1577  
1578    return value;
1579  }
1580  /**
1581   * Returns true if the two object arguments have the same keys, or false
1582   * otherwise.
1583   *
1584   * @param {Object} a First object.
1585   * @param {Object} b Second object.
1586   *
1587   * @return {boolean} Whether the two objects have the same keys.
1588   */
1589  
1590  function hasSameKeys(a, b) {
1591    return Object(external_this_lodash_["isEqual"])(Object(external_this_lodash_["keys"])(a), Object(external_this_lodash_["keys"])(b));
1592  }
1593  /**
1594   * Returns true if, given the currently dispatching action and the previously
1595   * dispatched action, the two actions are editing the same post property, or
1596   * false otherwise.
1597   *
1598   * @param {Object} action         Currently dispatching action.
1599   * @param {Object} previousAction Previously dispatched action.
1600   *
1601   * @return {boolean} Whether actions are updating the same post property.
1602   */
1603  
1604  function isUpdatingSamePostProperty(action, previousAction) {
1605    return action.type === 'EDIT_POST' && hasSameKeys(action.edits, previousAction.edits);
1606  }
1607  /**
1608   * Returns true if, given the currently dispatching action and the previously
1609   * dispatched action, the two actions are modifying the same property such that
1610   * undo history should be batched.
1611   *
1612   * @param {Object} action         Currently dispatching action.
1613   * @param {Object} previousAction Previously dispatched action.
1614   *
1615   * @return {boolean} Whether to overwrite present state.
1616   */
1617  
1618  function shouldOverwriteState(action, previousAction) {
1619    if (action.type === 'RESET_EDITOR_BLOCKS') {
1620      return !action.shouldCreateUndoLevel;
1621    }
1622  
1623    if (!previousAction || action.type !== previousAction.type) {
1624      return false;
1625    }
1626  
1627    return isUpdatingSamePostProperty(action, previousAction);
1628  }
1629  function reducer_postId() {
1630    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1631    var action = arguments.length > 1 ? arguments[1] : undefined;
1632  
1633    switch (action.type) {
1634      case 'SETUP_EDITOR_STATE':
1635      case 'RESET_POST':
1636      case 'UPDATE_POST':
1637        return action.post.id;
1638    }
1639  
1640    return state;
1641  }
1642  function reducer_postType() {
1643    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1644    var action = arguments.length > 1 ? arguments[1] : undefined;
1645  
1646    switch (action.type) {
1647      case 'SETUP_EDITOR_STATE':
1648      case 'RESET_POST':
1649      case 'UPDATE_POST':
1650        return action.post.type;
1651    }
1652  
1653    return state;
1654  }
1655  /**
1656   * Reducer returning whether the post blocks match the defined template or not.
1657   *
1658   * @param {Object} state  Current state.
1659   * @param {Object} action Dispatched action.
1660   *
1661   * @return {boolean} Updated state.
1662   */
1663  
1664  function reducer_template() {
1665    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
1666      isValid: true
1667    };
1668    var action = arguments.length > 1 ? arguments[1] : undefined;
1669  
1670    switch (action.type) {
1671      case 'SET_TEMPLATE_VALIDITY':
1672        return Object(objectSpread["a" /* default */])({}, state, {
1673          isValid: action.isValid
1674        });
1675    }
1676  
1677    return state;
1678  }
1679  /**
1680   * Reducer returning the user preferences.
1681   *
1682   * @param {Object}  state                 Current state.
1683   * @param {Object}  action                Dispatched action.
1684   *
1685   * @return {string} Updated state.
1686   */
1687  
1688  function preferences() {
1689    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : PREFERENCES_DEFAULTS;
1690    var action = arguments.length > 1 ? arguments[1] : undefined;
1691  
1692    switch (action.type) {
1693      case 'ENABLE_PUBLISH_SIDEBAR':
1694        return Object(objectSpread["a" /* default */])({}, state, {
1695          isPublishSidebarEnabled: true
1696        });
1697  
1698      case 'DISABLE_PUBLISH_SIDEBAR':
1699        return Object(objectSpread["a" /* default */])({}, state, {
1700          isPublishSidebarEnabled: false
1701        });
1702    }
1703  
1704    return state;
1705  }
1706  /**
1707   * Reducer returning current network request state (whether a request to
1708   * the WP REST API is in progress, successful, or failed).
1709   *
1710   * @param {Object} state  Current state.
1711   * @param {Object} action Dispatched action.
1712   *
1713   * @return {Object} Updated state.
1714   */
1715  
1716  function saving() {
1717    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1718    var action = arguments.length > 1 ? arguments[1] : undefined;
1719  
1720    switch (action.type) {
1721      case 'REQUEST_POST_UPDATE_START':
1722      case 'REQUEST_POST_UPDATE_FINISH':
1723        return {
1724          pending: action.type === 'REQUEST_POST_UPDATE_START',
1725          options: action.options || {}
1726        };
1727    }
1728  
1729    return state;
1730  }
1731  /**
1732   * Post Lock State.
1733   *
1734   * @typedef {Object} PostLockState
1735   *
1736   * @property {boolean} isLocked       Whether the post is locked.
1737   * @property {?boolean} isTakeover     Whether the post editing has been taken over.
1738   * @property {?boolean} activePostLock Active post lock value.
1739   * @property {?Object}  user           User that took over the post.
1740   */
1741  
1742  /**
1743   * Reducer returning the post lock status.
1744   *
1745   * @param {PostLockState} state  Current state.
1746   * @param {Object} action Dispatched action.
1747   *
1748   * @return {PostLockState} Updated state.
1749   */
1750  
1751  function postLock() {
1752    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
1753      isLocked: false
1754    };
1755    var action = arguments.length > 1 ? arguments[1] : undefined;
1756  
1757    switch (action.type) {
1758      case 'UPDATE_POST_LOCK':
1759        return action.lock;
1760    }
1761  
1762    return state;
1763  }
1764  /**
1765   * Post saving lock.
1766   *
1767   * When post saving is locked, the post cannot be published or updated.
1768   *
1769   * @param {PostLockState} state  Current state.
1770   * @param {Object}        action Dispatched action.
1771   *
1772   * @return {PostLockState} Updated state.
1773   */
1774  
1775  function postSavingLock() {
1776    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1777    var action = arguments.length > 1 ? arguments[1] : undefined;
1778  
1779    switch (action.type) {
1780      case 'LOCK_POST_SAVING':
1781        return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.lockName, true));
1782  
1783      case 'UNLOCK_POST_SAVING':
1784        return Object(external_this_lodash_["omit"])(state, action.lockName);
1785    }
1786  
1787    return state;
1788  }
1789  /**
1790   * Post autosaving lock.
1791   *
1792   * When post autosaving is locked, the post will not autosave.
1793   *
1794   * @param {PostLockState} state  Current state.
1795   * @param {Object}        action Dispatched action.
1796   *
1797   * @return {PostLockState} Updated state.
1798   */
1799  
1800  function postAutosavingLock() {
1801    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1802    var action = arguments.length > 1 ? arguments[1] : undefined;
1803  
1804    switch (action.type) {
1805      case 'LOCK_POST_AUTOSAVING':
1806        return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.lockName, true));
1807  
1808      case 'UNLOCK_POST_AUTOSAVING':
1809        return Object(external_this_lodash_["omit"])(state, action.lockName);
1810    }
1811  
1812    return state;
1813  }
1814  var reducer_reusableBlocks = Object(external_this_wp_data_["combineReducers"])({
1815    data: function data() {
1816      var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1817      var action = arguments.length > 1 ? arguments[1] : undefined;
1818  
1819      switch (action.type) {
1820        case 'RECEIVE_REUSABLE_BLOCKS':
1821          {
1822            return Object(objectSpread["a" /* default */])({}, state, Object(external_this_lodash_["keyBy"])(action.results, 'id'));
1823          }
1824  
1825        case 'UPDATE_REUSABLE_BLOCK':
1826          {
1827            var id = action.id,
1828                changes = action.changes;
1829            return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, id, Object(objectSpread["a" /* default */])({}, state[id], changes)));
1830          }
1831  
1832        case 'SAVE_REUSABLE_BLOCK_SUCCESS':
1833          {
1834            var _id = action.id,
1835                updatedId = action.updatedId; // If a temporary reusable block is saved, we swap the temporary id with the final one
1836  
1837            if (_id === updatedId) {
1838              return state;
1839            }
1840  
1841            var value = state[_id];
1842            return Object(objectSpread["a" /* default */])({}, Object(external_this_lodash_["omit"])(state, _id), Object(defineProperty["a" /* default */])({}, updatedId, Object(objectSpread["a" /* default */])({}, value, {
1843              id: updatedId
1844            })));
1845          }
1846  
1847        case 'REMOVE_REUSABLE_BLOCK':
1848          {
1849            var _id2 = action.id;
1850            return Object(external_this_lodash_["omit"])(state, _id2);
1851          }
1852      }
1853  
1854      return state;
1855    },
1856    isFetching: function isFetching() {
1857      var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1858      var action = arguments.length > 1 ? arguments[1] : undefined;
1859  
1860      switch (action.type) {
1861        case 'FETCH_REUSABLE_BLOCKS':
1862          {
1863            var id = action.id;
1864  
1865            if (!id) {
1866              return state;
1867            }
1868  
1869            return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, id, true));
1870          }
1871  
1872        case 'FETCH_REUSABLE_BLOCKS_SUCCESS':
1873        case 'FETCH_REUSABLE_BLOCKS_FAILURE':
1874          {
1875            var _id3 = action.id;
1876            return Object(external_this_lodash_["omit"])(state, _id3);
1877          }
1878      }
1879  
1880      return state;
1881    },
1882    isSaving: function isSaving() {
1883      var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1884      var action = arguments.length > 1 ? arguments[1] : undefined;
1885  
1886      switch (action.type) {
1887        case 'SAVE_REUSABLE_BLOCK':
1888          return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.id, true));
1889  
1890        case 'SAVE_REUSABLE_BLOCK_SUCCESS':
1891        case 'SAVE_REUSABLE_BLOCK_FAILURE':
1892          {
1893            var id = action.id;
1894            return Object(external_this_lodash_["omit"])(state, id);
1895          }
1896      }
1897  
1898      return state;
1899    }
1900  });
1901  /**
1902   * Reducer returning whether the editor is ready to be rendered.
1903   * The editor is considered ready to be rendered once
1904   * the post object is loaded properly and the initial blocks parsed.
1905   *
1906   * @param {boolean} state
1907   * @param {Object} action
1908   *
1909   * @return {boolean} Updated state.
1910   */
1911  
1912  function reducer_isReady() {
1913    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1914    var action = arguments.length > 1 ? arguments[1] : undefined;
1915  
1916    switch (action.type) {
1917      case 'SETUP_EDITOR_STATE':
1918        return true;
1919  
1920      case 'TEAR_DOWN_EDITOR':
1921        return false;
1922    }
1923  
1924    return state;
1925  }
1926  /**
1927   * Reducer returning the post editor setting.
1928   *
1929   * @param {Object} state  Current state.
1930   * @param {Object} action Dispatched action.
1931   *
1932   * @return {Object} Updated state.
1933   */
1934  
1935  function reducer_editorSettings() {
1936    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : EDITOR_SETTINGS_DEFAULTS;
1937    var action = arguments.length > 1 ? arguments[1] : undefined;
1938  
1939    switch (action.type) {
1940      case 'UPDATE_EDITOR_SETTINGS':
1941        return Object(objectSpread["a" /* default */])({}, state, action.settings);
1942    }
1943  
1944    return state;
1945  }
1946  /* harmony default export */ var reducer = (redux_optimist_default()(Object(external_this_wp_data_["combineReducers"])({
1947    postId: reducer_postId,
1948    postType: reducer_postType,
1949    preferences: preferences,
1950    saving: saving,
1951    postLock: postLock,
1952    reusableBlocks: reducer_reusableBlocks,
1953    template: reducer_template,
1954    postSavingLock: postSavingLock,
1955    isReady: reducer_isReady,
1956    editorSettings: reducer_editorSettings,
1957    postAutosavingLock: postAutosavingLock
1958  })));
1959  
1960  // EXTERNAL MODULE: ./node_modules/refx/refx.js
1961  var refx = __webpack_require__(70);
1962  var refx_default = /*#__PURE__*/__webpack_require__.n(refx);
1963  
1964  // EXTERNAL MODULE: external {"this":"regeneratorRuntime"}
1965  var external_this_regeneratorRuntime_ = __webpack_require__(23);
1966  var external_this_regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(external_this_regeneratorRuntime_);
1967  
1968  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
1969  var asyncToGenerator = __webpack_require__(43);
1970  
1971  // EXTERNAL MODULE: external {"this":["wp","apiFetch"]}
1972  var external_this_wp_apiFetch_ = __webpack_require__(37);
1973  var external_this_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_apiFetch_);
1974  
1975  // EXTERNAL MODULE: external {"this":["wp","i18n"]}
1976  var external_this_wp_i18n_ = __webpack_require__(1);
1977  
1978  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
1979  var toConsumableArray = __webpack_require__(18);
1980  
1981  // EXTERNAL MODULE: external {"this":["wp","deprecated"]}
1982  var external_this_wp_deprecated_ = __webpack_require__(35);
1983  var external_this_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_deprecated_);
1984  
1985  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/constants.js
1986  /**
1987   * Set of post properties for which edits should assume a merging behavior,
1988   * assuming an object value.
1989   *
1990   * @type {Set}
1991   */
1992  var EDIT_MERGE_PROPERTIES = new Set(['meta']);
1993  /**
1994   * Constant for the store module (or reducer) key.
1995   *
1996   * @type {string}
1997   */
1998  
1999  var STORE_KEY = 'core/editor';
2000  var POST_UPDATE_TRANSACTION_ID = 'post-update';
2001  var SAVE_POST_NOTICE_ID = 'SAVE_POST_NOTICE_ID';
2002  var TRASH_POST_NOTICE_ID = 'TRASH_POST_NOTICE_ID';
2003  var PERMALINK_POSTNAME_REGEX = /%(?:postname|pagename)%/;
2004  var ONE_MINUTE_IN_MS = 60 * 1000;
2005  var AUTOSAVE_PROPERTIES = ['title', 'excerpt', 'content'];
2006  
2007  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/utils/notice-builder.js
2008  /**
2009   * WordPress dependencies
2010   */
2011  
2012  /**
2013   * Internal dependencies
2014   */
2015  
2016  
2017  /**
2018   * External dependencies
2019   */
2020  
2021  
2022  /**
2023   * Builds the arguments for a success notification dispatch.
2024   *
2025   * @param {Object} data Incoming data to build the arguments from.
2026   *
2027   * @return {Array} Arguments for dispatch. An empty array signals no
2028   *                 notification should be sent.
2029   */
2030  
2031  function getNotificationArgumentsForSaveSuccess(data) {
2032    var previousPost = data.previousPost,
2033        post = data.post,
2034        postType = data.postType; // Autosaves are neither shown a notice nor redirected.
2035  
2036    if (Object(external_this_lodash_["get"])(data.options, ['isAutosave'])) {
2037      return [];
2038    }
2039  
2040    var publishStatus = ['publish', 'private', 'future'];
2041    var isPublished = Object(external_this_lodash_["includes"])(publishStatus, previousPost.status);
2042    var willPublish = Object(external_this_lodash_["includes"])(publishStatus, post.status);
2043    var noticeMessage;
2044    var shouldShowLink = Object(external_this_lodash_["get"])(postType, ['viewable'], false);
2045  
2046    if (!isPublished && !willPublish) {
2047      // If saving a non-published post, don't show notice.
2048      noticeMessage = null;
2049    } else if (isPublished && !willPublish) {
2050      // If undoing publish status, show specific notice
2051      noticeMessage = postType.labels.item_reverted_to_draft;
2052      shouldShowLink = false;
2053    } else if (!isPublished && willPublish) {
2054      // If publishing or scheduling a post, show the corresponding
2055      // publish message
2056      noticeMessage = {
2057        publish: postType.labels.item_published,
2058        private: postType.labels.item_published_privately,
2059        future: postType.labels.item_scheduled
2060      }[post.status];
2061    } else {
2062      // Generic fallback notice
2063      noticeMessage = postType.labels.item_updated;
2064    }
2065  
2066    if (noticeMessage) {
2067      var actions = [];
2068  
2069      if (shouldShowLink) {
2070        actions.push({
2071          label: postType.labels.view_item,
2072          url: post.link
2073        });
2074      }
2075  
2076      return [noticeMessage, {
2077        id: SAVE_POST_NOTICE_ID,
2078        type: 'snackbar',
2079        actions: actions
2080      }];
2081    }
2082  
2083    return [];
2084  }
2085  /**
2086   * Builds the fail notification arguments for dispatch.
2087   *
2088   * @param {Object} data Incoming data to build the arguments with.
2089   *
2090   * @return {Array} Arguments for dispatch. An empty array signals no
2091   *                 notification should be sent.
2092   */
2093  
2094  function getNotificationArgumentsForSaveFail(data) {
2095    var post = data.post,
2096        edits = data.edits,
2097        error = data.error;
2098  
2099    if (error && 'rest_autosave_no_changes' === error.code) {
2100      // Autosave requested a new autosave, but there were no changes. This shouldn't
2101      // result in an error notice for the user.
2102      return [];
2103    }
2104  
2105    var publishStatus = ['publish', 'private', 'future'];
2106    var isPublished = publishStatus.indexOf(post.status) !== -1; // If the post was being published, we show the corresponding publish error message
2107    // Unless we publish an "updating failed" message
2108  
2109    var messages = {
2110      publish: Object(external_this_wp_i18n_["__"])('Publishing failed.'),
2111      private: Object(external_this_wp_i18n_["__"])('Publishing failed.'),
2112      future: Object(external_this_wp_i18n_["__"])('Scheduling failed.')
2113    };
2114    var noticeMessage = !isPublished && publishStatus.indexOf(edits.status) !== -1 ? messages[edits.status] : Object(external_this_wp_i18n_["__"])('Updating failed.'); // Check if message string contains HTML. Notice text is currently only
2115    // supported as plaintext, and stripping the tags may muddle the meaning.
2116  
2117    if (error.message && !/<\/?[^>]*>/.test(error.message)) {
2118      noticeMessage = [noticeMessage, error.message].join(' ');
2119    }
2120  
2121    return [noticeMessage, {
2122      id: SAVE_POST_NOTICE_ID
2123    }];
2124  }
2125  /**
2126   * Builds the trash fail notification arguments for dispatch.
2127   *
2128   * @param {Object} data
2129   *
2130   * @return {Array} Arguments for dispatch.
2131   */
2132  
2133  function getNotificationArgumentsForTrashFail(data) {
2134    return [data.error.message && data.error.code !== 'unknown_error' ? data.error.message : Object(external_this_wp_i18n_["__"])('Trashing failed'), {
2135      id: TRASH_POST_NOTICE_ID
2136    }];
2137  }
2138  
2139  // EXTERNAL MODULE: ./node_modules/memize/index.js
2140  var memize = __webpack_require__(42);
2141  var memize_default = /*#__PURE__*/__webpack_require__.n(memize);
2142  
2143  // EXTERNAL MODULE: external {"this":["wp","autop"]}
2144  var external_this_wp_autop_ = __webpack_require__(68);
2145  
2146  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/utils/serialize-blocks.js
2147  /**
2148   * External dependencies
2149   */
2150  
2151  /**
2152   * WordPress dependencies
2153   */
2154  
2155  
2156  
2157  /**
2158   * Serializes blocks following backwards compatibility conventions.
2159   *
2160   * @param {Array} blocksForSerialization The blocks to serialize.
2161   *
2162   * @return {string} The blocks serialization.
2163   */
2164  
2165  var serializeBlocks = memize_default()(function (blocksForSerialization) {
2166    // A single unmodified default block is assumed to
2167    // be equivalent to an empty post.
2168    if (blocksForSerialization.length === 1 && Object(external_this_wp_blocks_["isUnmodifiedDefaultBlock"])(blocksForSerialization[0])) {
2169      blocksForSerialization = [];
2170    }
2171  
2172    var content = Object(external_this_wp_blocks_["serialize"])(blocksForSerialization); // For compatibility, treat a post consisting of a
2173    // single freeform block as legacy content and apply
2174    // pre-block-editor removep'd content formatting.
2175  
2176    if (blocksForSerialization.length === 1 && blocksForSerialization[0].name === Object(external_this_wp_blocks_["getFreeformContentHandlerName"])()) {
2177      content = Object(external_this_wp_autop_["removep"])(content);
2178    }
2179  
2180    return content;
2181  }, {
2182    maxSize: 1
2183  });
2184  /* harmony default export */ var serialize_blocks = (serializeBlocks);
2185  
2186  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/actions.js
2187  
2188  
2189  
2190  
2191  var _marked =
2192  /*#__PURE__*/
2193  external_this_regeneratorRuntime_default.a.mark(actions_setupEditor),
2194      _marked2 =
2195  /*#__PURE__*/
2196  external_this_regeneratorRuntime_default.a.mark(resetAutosave),
2197      _marked3 =
2198  /*#__PURE__*/
2199  external_this_regeneratorRuntime_default.a.mark(actions_editPost),
2200      _marked4 =
2201  /*#__PURE__*/
2202  external_this_regeneratorRuntime_default.a.mark(savePost),
2203      _marked5 =
2204  /*#__PURE__*/
2205  external_this_regeneratorRuntime_default.a.mark(refreshPost),
2206      _marked6 =
2207  /*#__PURE__*/
2208  external_this_regeneratorRuntime_default.a.mark(trashPost),
2209      _marked7 =
2210  /*#__PURE__*/
2211  external_this_regeneratorRuntime_default.a.mark(actions_autosave),
2212      _marked8 =
2213  /*#__PURE__*/
2214  external_this_regeneratorRuntime_default.a.mark(actions_experimentalLocalAutosave),
2215      _marked9 =
2216  /*#__PURE__*/
2217  external_this_regeneratorRuntime_default.a.mark(actions_redo),
2218      _marked10 =
2219  /*#__PURE__*/
2220  external_this_regeneratorRuntime_default.a.mark(actions_undo),
2221      _marked11 =
2222  /*#__PURE__*/
2223  external_this_regeneratorRuntime_default.a.mark(actions_resetEditorBlocks);
2224  
2225  /**
2226   * External dependencies
2227   */
2228  
2229  /**
2230   * WordPress dependencies
2231   */
2232  
2233  
2234  
2235  
2236  /**
2237   * Internal dependencies
2238   */
2239  
2240  
2241  
2242  
2243  /**
2244   * Returns an action generator used in signalling that editor has initialized with
2245   * the specified post object and editor settings.
2246   *
2247   * @param {Object} post      Post object.
2248   * @param {Object} edits     Initial edited attributes object.
2249   * @param {Array?} template  Block Template.
2250   */
2251  
2252  function actions_setupEditor(post, edits, template) {
2253    var content, blocks, isNewPost;
2254    return external_this_regeneratorRuntime_default.a.wrap(function setupEditor$(_context) {
2255      while (1) {
2256        switch (_context.prev = _context.next) {
2257          case 0:
2258            // In order to ensure maximum of a single parse during setup, edits are
2259            // included as part of editor setup action. Assume edited content as
2260            // canonical if provided, falling back to post.
2261            if (Object(external_this_lodash_["has"])(edits, ['content'])) {
2262              content = edits.content;
2263            } else {
2264              content = post.content.raw;
2265            }
2266  
2267            blocks = Object(external_this_wp_blocks_["parse"])(content); // Apply a template for new posts only, if exists.
2268  
2269            isNewPost = post.status === 'auto-draft';
2270  
2271            if (isNewPost && template) {
2272              blocks = Object(external_this_wp_blocks_["synchronizeBlocksWithTemplate"])(blocks, template);
2273            }
2274  
2275            _context.next = 6;
2276            return resetPost(post);
2277  
2278          case 6:
2279            _context.next = 8;
2280            return {
2281              type: 'SETUP_EDITOR',
2282              post: post,
2283              edits: edits,
2284              template: template
2285            };
2286  
2287          case 8:
2288            _context.next = 10;
2289            return actions_resetEditorBlocks(blocks, {
2290              __unstableShouldCreateUndoLevel: false
2291            });
2292  
2293          case 10:
2294            _context.next = 12;
2295            return setupEditorState(post);
2296  
2297          case 12:
2298            if (!(edits && Object.keys(edits).some(function (key) {
2299              return edits[key] !== (Object(external_this_lodash_["has"])(post, [key, 'raw']) ? post[key].raw : post[key]);
2300            }))) {
2301              _context.next = 15;
2302              break;
2303            }
2304  
2305            _context.next = 15;
2306            return actions_editPost(edits);
2307  
2308          case 15:
2309          case "end":
2310            return _context.stop();
2311        }
2312      }
2313    }, _marked);
2314  }
2315  /**
2316   * Returns an action object signalling that the editor is being destroyed and
2317   * that any necessary state or side-effect cleanup should occur.
2318   *
2319   * @return {Object} Action object.
2320   */
2321  
2322  function actions_experimentalTearDownEditor() {
2323    return {
2324      type: 'TEAR_DOWN_EDITOR'
2325    };
2326  }
2327  /**
2328   * Returns an action object used in signalling that the latest version of the
2329   * post has been received, either by initialization or save.
2330   *
2331   * @param {Object} post Post object.
2332   *
2333   * @return {Object} Action object.
2334   */
2335  
2336  function resetPost(post) {
2337    return {
2338      type: 'RESET_POST',
2339      post: post
2340    };
2341  }
2342  /**
2343   * Returns an action object used in signalling that the latest autosave of the
2344   * post has been received, by initialization or autosave.
2345   *
2346   * @deprecated since 5.6. Callers should use the `receiveAutosaves( postId, autosave )`
2347   *                selector from the '@wordpress/core-data' package.
2348   *
2349   * @param {Object} newAutosave Autosave post object.
2350   *
2351   * @return {Object} Action object.
2352   */
2353  
2354  function resetAutosave(newAutosave) {
2355    var postId;
2356    return external_this_regeneratorRuntime_default.a.wrap(function resetAutosave$(_context2) {
2357      while (1) {
2358        switch (_context2.prev = _context2.next) {
2359          case 0:
2360            external_this_wp_deprecated_default()('resetAutosave action (`core/editor` store)', {
2361              alternative: 'receiveAutosaves action (`core` store)',
2362              plugin: 'Gutenberg'
2363            });
2364            _context2.next = 3;
2365            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPostId');
2366  
2367          case 3:
2368            postId = _context2.sent;
2369            _context2.next = 6;
2370            return Object(external_this_wp_dataControls_["dispatch"])('core', 'receiveAutosaves', postId, newAutosave);
2371  
2372          case 6:
2373            return _context2.abrupt("return", {
2374              type: '__INERT__'
2375            });
2376  
2377          case 7:
2378          case "end":
2379            return _context2.stop();
2380        }
2381      }
2382    }, _marked2);
2383  }
2384  /**
2385   * Action for dispatching that a post update request has started.
2386   *
2387   * @param {Object} options
2388   *
2389   * @return {Object} An action object
2390   */
2391  
2392  function __experimentalRequestPostUpdateStart() {
2393    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2394    return {
2395      type: 'REQUEST_POST_UPDATE_START',
2396      options: options
2397    };
2398  }
2399  /**
2400   * Action for dispatching that a post update request has finished.
2401   *
2402   * @param {Object} options
2403   *
2404   * @return {Object} An action object
2405   */
2406  
2407  function __experimentalRequestPostUpdateFinish() {
2408    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2409    return {
2410      type: 'REQUEST_POST_UPDATE_FINISH',
2411      options: options
2412    };
2413  }
2414  /**
2415   * Returns an action object used in signalling that a patch of updates for the
2416   * latest version of the post have been received.
2417   *
2418   * @param {Object} edits Updated post fields.
2419   *
2420   * @return {Object} Action object.
2421   */
2422  
2423  function updatePost(edits) {
2424    return {
2425      type: 'UPDATE_POST',
2426      edits: edits
2427    };
2428  }
2429  /**
2430   * Returns an action object used to setup the editor state when first opening
2431   * an editor.
2432   *
2433   * @param {Object} post   Post object.
2434   *
2435   * @return {Object} Action object.
2436   */
2437  
2438  function setupEditorState(post) {
2439    return {
2440      type: 'SETUP_EDITOR_STATE',
2441      post: post
2442    };
2443  }
2444  /**
2445   * Returns an action object used in signalling that attributes of the post have
2446   * been edited.
2447   *
2448   * @param {Object} edits   Post attributes to edit.
2449   * @param {Object} options Options for the edit.
2450   *
2451   * @yield {Object} Action object or control.
2452   */
2453  
2454  function actions_editPost(edits, options) {
2455    var _ref, id, type;
2456  
2457    return external_this_regeneratorRuntime_default.a.wrap(function editPost$(_context3) {
2458      while (1) {
2459        switch (_context3.prev = _context3.next) {
2460          case 0:
2461            _context3.next = 2;
2462            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPost');
2463  
2464          case 2:
2465            _ref = _context3.sent;
2466            id = _ref.id;
2467            type = _ref.type;
2468            _context3.next = 7;
2469            return Object(external_this_wp_dataControls_["dispatch"])('core', 'editEntityRecord', 'postType', type, id, edits, options);
2470  
2471          case 7:
2472          case "end":
2473            return _context3.stop();
2474        }
2475      }
2476    }, _marked3);
2477  }
2478  /**
2479   * Returns action object produced by the updatePost creator augmented by
2480   * an optimist option that signals optimistically applying updates.
2481   *
2482   * @param {Object} edits  Updated post fields.
2483   *
2484   * @return {Object} Action object.
2485   */
2486  
2487  function __experimentalOptimisticUpdatePost(edits) {
2488    return Object(objectSpread["a" /* default */])({}, updatePost(edits), {
2489      optimist: {
2490        id: POST_UPDATE_TRANSACTION_ID
2491      }
2492    });
2493  }
2494  /**
2495   * Action generator for saving the current post in the editor.
2496   *
2497   * @param {Object} options
2498   */
2499  
2500  function savePost() {
2501    var options,
2502        edits,
2503        previousRecord,
2504        error,
2505        args,
2506        updatedRecord,
2507        _args4,
2508        _args5 = arguments;
2509  
2510    return external_this_regeneratorRuntime_default.a.wrap(function savePost$(_context4) {
2511      while (1) {
2512        switch (_context4.prev = _context4.next) {
2513          case 0:
2514            options = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
2515            _context4.next = 3;
2516            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'isEditedPostSaveable');
2517  
2518          case 3:
2519            if (_context4.sent) {
2520              _context4.next = 5;
2521              break;
2522            }
2523  
2524            return _context4.abrupt("return");
2525  
2526          case 5:
2527            _context4.next = 7;
2528            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getEditedPostContent');
2529  
2530          case 7:
2531            _context4.t0 = _context4.sent;
2532            edits = {
2533              content: _context4.t0
2534            };
2535  
2536            if (options.isAutosave) {
2537              _context4.next = 12;
2538              break;
2539            }
2540  
2541            _context4.next = 12;
2542            return Object(external_this_wp_dataControls_["dispatch"])(STORE_KEY, 'editPost', edits, {
2543              undoIgnore: true
2544            });
2545  
2546          case 12:
2547            _context4.next = 14;
2548            return __experimentalRequestPostUpdateStart(options);
2549  
2550          case 14:
2551            _context4.next = 16;
2552            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPost');
2553  
2554          case 16:
2555            previousRecord = _context4.sent;
2556            _context4.t1 = objectSpread["a" /* default */];
2557            _context4.t2 = {
2558              id: previousRecord.id
2559            };
2560            _context4.next = 21;
2561            return Object(external_this_wp_dataControls_["select"])('core', 'getEntityRecordNonTransientEdits', 'postType', previousRecord.type, previousRecord.id);
2562  
2563          case 21:
2564            _context4.t3 = _context4.sent;
2565            _context4.t4 = edits;
2566            edits = (0, _context4.t1)(_context4.t2, _context4.t3, _context4.t4);
2567            _context4.next = 26;
2568            return Object(external_this_wp_dataControls_["dispatch"])('core', 'saveEntityRecord', 'postType', previousRecord.type, edits, options);
2569  
2570          case 26:
2571            _context4.next = 28;
2572            return __experimentalRequestPostUpdateFinish(options);
2573  
2574          case 28:
2575            _context4.next = 30;
2576            return Object(external_this_wp_dataControls_["select"])('core', 'getLastEntitySaveError', 'postType', previousRecord.type, previousRecord.id);
2577  
2578          case 30:
2579            error = _context4.sent;
2580  
2581            if (!error) {
2582              _context4.next = 38;
2583              break;
2584            }
2585  
2586            args = getNotificationArgumentsForSaveFail({
2587              post: previousRecord,
2588              edits: edits,
2589              error: error
2590            });
2591  
2592            if (!args.length) {
2593              _context4.next = 36;
2594              break;
2595            }
2596  
2597            _context4.next = 36;
2598            return external_this_wp_dataControls_["dispatch"].apply(void 0, ['core/notices', 'createErrorNotice'].concat(Object(toConsumableArray["a" /* default */])(args)));
2599  
2600          case 36:
2601            _context4.next = 56;
2602            break;
2603  
2604          case 38:
2605            _context4.next = 40;
2606            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPost');
2607  
2608          case 40:
2609            updatedRecord = _context4.sent;
2610            _context4.t5 = getNotificationArgumentsForSaveSuccess;
2611            _context4.t6 = previousRecord;
2612            _context4.t7 = updatedRecord;
2613            _context4.next = 46;
2614            return Object(external_this_wp_dataControls_["select"])('core', 'getPostType', updatedRecord.type);
2615  
2616          case 46:
2617            _context4.t8 = _context4.sent;
2618            _context4.t9 = options;
2619            _context4.t10 = {
2620              previousPost: _context4.t6,
2621              post: _context4.t7,
2622              postType: _context4.t8,
2623              options: _context4.t9
2624            };
2625            _args4 = (0, _context4.t5)(_context4.t10);
2626  
2627            if (!_args4.length) {
2628              _context4.next = 53;
2629              break;
2630            }
2631  
2632            _context4.next = 53;
2633            return external_this_wp_dataControls_["dispatch"].apply(void 0, ['core/notices', 'createSuccessNotice'].concat(Object(toConsumableArray["a" /* default */])(_args4)));
2634  
2635          case 53:
2636            if (options.isAutosave) {
2637              _context4.next = 56;
2638              break;
2639            }
2640  
2641            _context4.next = 56;
2642            return Object(external_this_wp_dataControls_["dispatch"])('core/block-editor', '__unstableMarkLastChangeAsPersistent');
2643  
2644          case 56:
2645          case "end":
2646            return _context4.stop();
2647        }
2648      }
2649    }, _marked4);
2650  }
2651  /**
2652   * Action generator for handling refreshing the current post.
2653   */
2654  
2655  function refreshPost() {
2656    var post, postTypeSlug, postType, newPost;
2657    return external_this_regeneratorRuntime_default.a.wrap(function refreshPost$(_context5) {
2658      while (1) {
2659        switch (_context5.prev = _context5.next) {
2660          case 0:
2661            _context5.next = 2;
2662            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPost');
2663  
2664          case 2:
2665            post = _context5.sent;
2666            _context5.next = 5;
2667            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPostType');
2668  
2669          case 5:
2670            postTypeSlug = _context5.sent;
2671            _context5.next = 8;
2672            return Object(external_this_wp_dataControls_["select"])('core', 'getPostType', postTypeSlug);
2673  
2674          case 8:
2675            postType = _context5.sent;
2676            _context5.next = 11;
2677            return Object(external_this_wp_dataControls_["apiFetch"])({
2678              // Timestamp arg allows caller to bypass browser caching, which is
2679              // expected for this specific function.
2680              path: "/wp/v2/".concat(postType.rest_base, "/").concat(post.id) + "?context=edit&_timestamp=".concat(Date.now())
2681            });
2682  
2683          case 11:
2684            newPost = _context5.sent;
2685            _context5.next = 14;
2686            return Object(external_this_wp_dataControls_["dispatch"])(STORE_KEY, 'resetPost', newPost);
2687  
2688          case 14:
2689          case "end":
2690            return _context5.stop();
2691        }
2692      }
2693    }, _marked5);
2694  }
2695  /**
2696   * Action generator for trashing the current post in the editor.
2697   */
2698  
2699  function trashPost() {
2700    var postTypeSlug, postType, post;
2701    return external_this_regeneratorRuntime_default.a.wrap(function trashPost$(_context6) {
2702      while (1) {
2703        switch (_context6.prev = _context6.next) {
2704          case 0:
2705            _context6.next = 2;
2706            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPostType');
2707  
2708          case 2:
2709            postTypeSlug = _context6.sent;
2710            _context6.next = 5;
2711            return Object(external_this_wp_dataControls_["select"])('core', 'getPostType', postTypeSlug);
2712  
2713          case 5:
2714            postType = _context6.sent;
2715            _context6.next = 8;
2716            return Object(external_this_wp_dataControls_["dispatch"])('core/notices', 'removeNotice', TRASH_POST_NOTICE_ID);
2717  
2718          case 8:
2719            _context6.prev = 8;
2720            _context6.next = 11;
2721            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPost');
2722  
2723          case 11:
2724            post = _context6.sent;
2725            _context6.next = 14;
2726            return Object(external_this_wp_dataControls_["apiFetch"])({
2727              path: "/wp/v2/".concat(postType.rest_base, "/").concat(post.id),
2728              method: 'DELETE'
2729            });
2730  
2731          case 14:
2732            _context6.next = 16;
2733            return Object(external_this_wp_dataControls_["dispatch"])(STORE_KEY, 'savePost');
2734  
2735          case 16:
2736            _context6.next = 22;
2737            break;
2738  
2739          case 18:
2740            _context6.prev = 18;
2741            _context6.t0 = _context6["catch"](8);
2742            _context6.next = 22;
2743            return external_this_wp_dataControls_["dispatch"].apply(void 0, ['core/notices', 'createErrorNotice'].concat(Object(toConsumableArray["a" /* default */])(getNotificationArgumentsForTrashFail({
2744              error: _context6.t0
2745            }))));
2746  
2747          case 22:
2748          case "end":
2749            return _context6.stop();
2750        }
2751      }
2752    }, _marked6, null, [[8, 18]]);
2753  }
2754  /**
2755   * Action generator used in signalling that the post should autosave.
2756   *
2757   * @param {Object?} options Extra flags to identify the autosave.
2758   */
2759  
2760  function actions_autosave(options) {
2761    return external_this_regeneratorRuntime_default.a.wrap(function autosave$(_context7) {
2762      while (1) {
2763        switch (_context7.prev = _context7.next) {
2764          case 0:
2765            _context7.next = 2;
2766            return Object(external_this_wp_dataControls_["dispatch"])(STORE_KEY, 'savePost', Object(objectSpread["a" /* default */])({
2767              isAutosave: true
2768            }, options));
2769  
2770          case 2:
2771          case "end":
2772            return _context7.stop();
2773        }
2774      }
2775    }, _marked7);
2776  }
2777  function actions_experimentalLocalAutosave() {
2778    var post, title, content, excerpt;
2779    return external_this_regeneratorRuntime_default.a.wrap(function __experimentalLocalAutosave$(_context8) {
2780      while (1) {
2781        switch (_context8.prev = _context8.next) {
2782          case 0:
2783            _context8.next = 2;
2784            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPost');
2785  
2786          case 2:
2787            post = _context8.sent;
2788            _context8.next = 5;
2789            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getEditedPostAttribute', 'title');
2790  
2791          case 5:
2792            title = _context8.sent;
2793            _context8.next = 8;
2794            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getEditedPostAttribute', 'content');
2795  
2796          case 8:
2797            content = _context8.sent;
2798            _context8.next = 11;
2799            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getEditedPostAttribute', 'excerpt');
2800  
2801          case 11:
2802            excerpt = _context8.sent;
2803            _context8.next = 14;
2804            return {
2805              type: 'LOCAL_AUTOSAVE_SET',
2806              postId: post.id,
2807              title: title,
2808              content: content,
2809              excerpt: excerpt
2810            };
2811  
2812          case 14:
2813          case "end":
2814            return _context8.stop();
2815        }
2816      }
2817    }, _marked8);
2818  }
2819  /**
2820   * Returns an action object used in signalling that undo history should
2821   * restore last popped state.
2822   *
2823   * @yield {Object} Action object.
2824   */
2825  
2826  function actions_redo() {
2827    return external_this_regeneratorRuntime_default.a.wrap(function redo$(_context9) {
2828      while (1) {
2829        switch (_context9.prev = _context9.next) {
2830          case 0:
2831            _context9.next = 2;
2832            return Object(external_this_wp_dataControls_["dispatch"])('core', 'redo');
2833  
2834          case 2:
2835          case "end":
2836            return _context9.stop();
2837        }
2838      }
2839    }, _marked9);
2840  }
2841  /**
2842   * Returns an action object used in signalling that undo history should pop.
2843   *
2844   * @yield {Object} Action object.
2845   */
2846  
2847  function actions_undo() {
2848    return external_this_regeneratorRuntime_default.a.wrap(function undo$(_context10) {
2849      while (1) {
2850        switch (_context10.prev = _context10.next) {
2851          case 0:
2852            _context10.next = 2;
2853            return Object(external_this_wp_dataControls_["dispatch"])('core', 'undo');
2854  
2855          case 2:
2856          case "end":
2857            return _context10.stop();
2858        }
2859      }
2860    }, _marked10);
2861  }
2862  /**
2863   * Returns an action object used in signalling that undo history record should
2864   * be created.
2865   *
2866   * @return {Object} Action object.
2867   */
2868  
2869  function createUndoLevel() {
2870    return {
2871      type: 'CREATE_UNDO_LEVEL'
2872    };
2873  }
2874  /**
2875   * Returns an action object used to lock the editor.
2876   *
2877   * @param {Object}  lock Details about the post lock status, user, and nonce.
2878   *
2879   * @return {Object} Action object.
2880   */
2881  
2882  function actions_updatePostLock(lock) {
2883    return {
2884      type: 'UPDATE_POST_LOCK',
2885      lock: lock
2886    };
2887  }
2888  /**
2889   * Returns an action object used to fetch a single reusable block or all
2890   * reusable blocks from the REST API into the store.
2891   *
2892   * @param {?string} id If given, only a single reusable block with this ID will
2893   *                     be fetched.
2894   *
2895   * @return {Object} Action object.
2896   */
2897  
2898  function actions_experimentalFetchReusableBlocks(id) {
2899    return {
2900      type: 'FETCH_REUSABLE_BLOCKS',
2901      id: id
2902    };
2903  }
2904  /**
2905   * Returns an action object used in signalling that reusable blocks have been
2906   * received. `results` is an array of objects containing:
2907   *  - `reusableBlock` - Details about how the reusable block is persisted.
2908   *  - `parsedBlock` - The original block.
2909   *
2910   * @param {Object[]} results Reusable blocks received.
2911   *
2912   * @return {Object} Action object.
2913   */
2914  
2915  function __experimentalReceiveReusableBlocks(results) {
2916    return {
2917      type: 'RECEIVE_REUSABLE_BLOCKS',
2918      results: results
2919    };
2920  }
2921  /**
2922   * Returns an action object used to save a reusable block that's in the store to
2923   * the REST API.
2924   *
2925   * @param {Object} id The ID of the reusable block to save.
2926   *
2927   * @return {Object} Action object.
2928   */
2929  
2930  function __experimentalSaveReusableBlock(id) {
2931    return {
2932      type: 'SAVE_REUSABLE_BLOCK',
2933      id: id
2934    };
2935  }
2936  /**
2937   * Returns an action object used to delete a reusable block via the REST API.
2938   *
2939   * @param {number} id The ID of the reusable block to delete.
2940   *
2941   * @return {Object} Action object.
2942   */
2943  
2944  function __experimentalDeleteReusableBlock(id) {
2945    return {
2946      type: 'DELETE_REUSABLE_BLOCK',
2947      id: id
2948    };
2949  }
2950  /**
2951   * Returns an action object used in signalling that a reusable block is
2952   * to be updated.
2953   *
2954   * @param {number} id      The ID of the reusable block to update.
2955   * @param {Object} changes The changes to apply.
2956   *
2957   * @return {Object} Action object.
2958   */
2959  
2960  function __experimentalUpdateReusableBlock(id, changes) {
2961    return {
2962      type: 'UPDATE_REUSABLE_BLOCK',
2963      id: id,
2964      changes: changes
2965    };
2966  }
2967  /**
2968   * Returns an action object used to convert a reusable block into a static
2969   * block.
2970   *
2971   * @param {string} clientId The client ID of the block to attach.
2972   *
2973   * @return {Object} Action object.
2974   */
2975  
2976  function __experimentalConvertBlockToStatic(clientId) {
2977    return {
2978      type: 'CONVERT_BLOCK_TO_STATIC',
2979      clientId: clientId
2980    };
2981  }
2982  /**
2983   * Returns an action object used to convert a static block into a reusable
2984   * block.
2985   *
2986   * @param {string} clientIds The client IDs of the block to detach.
2987   *
2988   * @return {Object} Action object.
2989   */
2990  
2991  function __experimentalConvertBlockToReusable(clientIds) {
2992    return {
2993      type: 'CONVERT_BLOCK_TO_REUSABLE',
2994      clientIds: Object(external_this_lodash_["castArray"])(clientIds)
2995    };
2996  }
2997  /**
2998   * Returns an action object used in signalling that the user has enabled the
2999   * publish sidebar.
3000   *
3001   * @return {Object} Action object
3002   */
3003  
3004  function enablePublishSidebar() {
3005    return {
3006      type: 'ENABLE_PUBLISH_SIDEBAR'
3007    };
3008  }
3009  /**
3010   * Returns an action object used in signalling that the user has disabled the
3011   * publish sidebar.
3012   *
3013   * @return {Object} Action object
3014   */
3015  
3016  function disablePublishSidebar() {
3017    return {
3018      type: 'DISABLE_PUBLISH_SIDEBAR'
3019    };
3020  }
3021  /**
3022   * Returns an action object used to signal that post saving is locked.
3023   *
3024   * @param  {string} lockName The lock name.
3025   *
3026   * @example
3027   * ```
3028   * const { subscribe } = wp.data;
3029   *
3030   * const initialPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );
3031   *
3032   * // Only allow publishing posts that are set to a future date.
3033   * if ( 'publish' !== initialPostStatus ) {
3034   *
3035   *     // Track locking.
3036   *     let locked = false;
3037   *
3038   *     // Watch for the publish event.
3039   *     let unssubscribe = subscribe( () => {
3040   *         const currentPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );
3041   *         if ( 'publish' !== currentPostStatus ) {
3042   *
3043   *             // Compare the post date to the current date, lock the post if the date isn't in the future.
3044   *             const postDate = new Date( wp.data.select( 'core/editor' ).getEditedPostAttribute( 'date' ) );
3045   *             const currentDate = new Date();
3046   *             if ( postDate.getTime() <= currentDate.getTime() ) {
3047   *                 if ( ! locked ) {
3048   *                     locked = true;
3049   *                     wp.data.dispatch( 'core/editor' ).lockPostSaving( 'futurelock' );
3050   *                 }
3051   *             } else {
3052   *                 if ( locked ) {
3053   *                     locked = false;
3054   *                     wp.data.dispatch( 'core/editor' ).unlockPostSaving( 'futurelock' );
3055   *                 }
3056   *             }
3057   *         }
3058   *     } );
3059   * }
3060   * ```
3061   *
3062   * @return {Object} Action object
3063   */
3064  
3065  function lockPostSaving(lockName) {
3066    return {
3067      type: 'LOCK_POST_SAVING',
3068      lockName: lockName
3069    };
3070  }
3071  /**
3072   * Returns an action object used to signal that post saving is unlocked.
3073   *
3074   * @param  {string} lockName The lock name.
3075   *
3076   * @example
3077   * ```
3078   * // Unlock post saving with the lock key `mylock`:
3079   * wp.data.dispatch( 'core/editor' ).unlockPostSaving( 'mylock' );
3080   * ```
3081   *
3082   * @return {Object} Action object
3083   */
3084  
3085  function unlockPostSaving(lockName) {
3086    return {
3087      type: 'UNLOCK_POST_SAVING',
3088      lockName: lockName
3089    };
3090  }
3091  /**
3092   * Returns an action object used to signal that post autosaving is locked.
3093   *
3094   * @param  {string} lockName The lock name.
3095   *
3096   * @example
3097   * ```
3098   * // Lock post autosaving with the lock key `mylock`:
3099   * wp.data.dispatch( 'core/editor' ).lockPostAutosaving( 'mylock' );
3100   * ```
3101   *
3102   * @return {Object} Action object
3103   */
3104  
3105  function lockPostAutosaving(lockName) {
3106    return {
3107      type: 'LOCK_POST_AUTOSAVING',
3108      lockName: lockName
3109    };
3110  }
3111  /**
3112   * Returns an action object used to signal that post autosaving is unlocked.
3113   *
3114   * @param  {string} lockName The lock name.
3115   *
3116   * @example
3117   * ```
3118   * // Unlock post saving with the lock key `mylock`:
3119   * wp.data.dispatch( 'core/editor' ).unlockPostAutosaving( 'mylock' );
3120   * ```
3121   *
3122   * @return {Object} Action object
3123   */
3124  
3125  function unlockPostAutosaving(lockName) {
3126    return {
3127      type: 'UNLOCK_POST_AUTOSAVING',
3128      lockName: lockName
3129    };
3130  }
3131  /**
3132   * Returns an action object used to signal that the blocks have been updated.
3133   *
3134   * @param {Array}   blocks  Block Array.
3135   * @param {?Object} options Optional options.
3136   *
3137   * @yield {Object} Action object
3138   */
3139  
3140  function actions_resetEditorBlocks(blocks) {
3141    var options,
3142        __unstableShouldCreateUndoLevel,
3143        selectionStart,
3144        selectionEnd,
3145        edits,
3146        _ref2,
3147        id,
3148        type,
3149        noChange,
3150        _args12 = arguments;
3151  
3152    return external_this_regeneratorRuntime_default.a.wrap(function resetEditorBlocks$(_context11) {
3153      while (1) {
3154        switch (_context11.prev = _context11.next) {
3155          case 0:
3156            options = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : {};
3157            __unstableShouldCreateUndoLevel = options.__unstableShouldCreateUndoLevel, selectionStart = options.selectionStart, selectionEnd = options.selectionEnd;
3158            edits = {
3159              blocks: blocks,
3160              selectionStart: selectionStart,
3161              selectionEnd: selectionEnd
3162            };
3163  
3164            if (!(__unstableShouldCreateUndoLevel !== false)) {
3165              _context11.next = 19;
3166              break;
3167            }
3168  
3169            _context11.next = 6;
3170            return Object(external_this_wp_dataControls_["select"])(STORE_KEY, 'getCurrentPost');
3171  
3172          case 6:
3173            _ref2 = _context11.sent;
3174            id = _ref2.id;
3175            type = _ref2.type;
3176            _context11.next = 11;
3177            return Object(external_this_wp_dataControls_["select"])('core', 'getEditedEntityRecord', 'postType', type, id);
3178  
3179          case 11:
3180            _context11.t0 = _context11.sent.blocks;
3181            _context11.t1 = edits.blocks;
3182            noChange = _context11.t0 === _context11.t1;
3183  
3184            if (!noChange) {
3185              _context11.next = 18;
3186              break;
3187            }
3188  
3189            _context11.next = 17;
3190            return Object(external_this_wp_dataControls_["dispatch"])('core', '__unstableCreateUndoLevel', 'postType', type, id);
3191  
3192          case 17:
3193            return _context11.abrupt("return", _context11.sent);
3194  
3195          case 18:
3196            // We create a new function here on every persistent edit
3197            // to make sure the edit makes the post dirty and creates
3198            // a new undo level.
3199            edits.content = function (_ref3) {
3200              var _ref3$blocks = _ref3.blocks,
3201                  blocksForSerialization = _ref3$blocks === void 0 ? [] : _ref3$blocks;
3202              return serialize_blocks(blocksForSerialization);
3203            };
3204  
3205          case 19:
3206            return _context11.delegateYield(actions_editPost(edits), "t2", 20);
3207  
3208          case 20:
3209          case "end":
3210            return _context11.stop();
3211        }
3212      }
3213    }, _marked11);
3214  }
3215  /*
3216   * Returns an action object used in signalling that the post editor settings have been updated.
3217   *
3218   * @param {Object} settings Updated settings
3219   *
3220   * @return {Object} Action object
3221   */
3222  
3223  function actions_updateEditorSettings(settings) {
3224    return {
3225      type: 'UPDATE_EDITOR_SETTINGS',
3226      settings: settings
3227    };
3228  }
3229  /**
3230   * Backward compatibility
3231   */
3232  
3233  var actions_getBlockEditorAction = function getBlockEditorAction(name) {
3234    return (
3235      /*#__PURE__*/
3236      external_this_regeneratorRuntime_default.a.mark(function _callee() {
3237        var _len,
3238            args,
3239            _key,
3240            _args13 = arguments;
3241  
3242        return external_this_regeneratorRuntime_default.a.wrap(function _callee$(_context12) {
3243          while (1) {
3244            switch (_context12.prev = _context12.next) {
3245              case 0:
3246                external_this_wp_deprecated_default()('`wp.data.dispatch( \'core/editor\' ).' + name + '`', {
3247                  alternative: '`wp.data.dispatch( \'core/block-editor\' ).' + name + '`'
3248                });
3249  
3250                for (_len = _args13.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3251                  args[_key] = _args13[_key];
3252                }
3253  
3254                _context12.next = 4;
3255                return external_this_wp_dataControls_["dispatch"].apply(void 0, ['core/block-editor', name].concat(args));
3256  
3257              case 4:
3258              case "end":
3259                return _context12.stop();
3260            }
3261          }
3262        }, _callee);
3263      })
3264    );
3265  };
3266  /**
3267   * @see resetBlocks in core/block-editor store.
3268   */
3269  
3270  
3271  var resetBlocks = actions_getBlockEditorAction('resetBlocks');
3272  /**
3273   * @see receiveBlocks in core/block-editor store.
3274   */
3275  
3276  var receiveBlocks = actions_getBlockEditorAction('receiveBlocks');
3277  /**
3278   * @see updateBlock in core/block-editor store.
3279   */
3280  
3281  var updateBlock = actions_getBlockEditorAction('updateBlock');
3282  /**
3283   * @see updateBlockAttributes in core/block-editor store.
3284   */
3285  
3286  var updateBlockAttributes = actions_getBlockEditorAction('updateBlockAttributes');
3287  /**
3288   * @see selectBlock in core/block-editor store.
3289   */
3290  
3291  var selectBlock = actions_getBlockEditorAction('selectBlock');
3292  /**
3293   * @see startMultiSelect in core/block-editor store.
3294   */
3295  
3296  var startMultiSelect = actions_getBlockEditorAction('startMultiSelect');
3297  /**
3298   * @see stopMultiSelect in core/block-editor store.
3299   */
3300  
3301  var stopMultiSelect = actions_getBlockEditorAction('stopMultiSelect');
3302  /**
3303   * @see multiSelect in core/block-editor store.
3304   */
3305  
3306  var multiSelect = actions_getBlockEditorAction('multiSelect');
3307  /**
3308   * @see clearSelectedBlock in core/block-editor store.
3309   */
3310  
3311  var actions_clearSelectedBlock = actions_getBlockEditorAction('clearSelectedBlock');
3312  /**
3313   * @see toggleSelection in core/block-editor store.
3314   */
3315  
3316  var toggleSelection = actions_getBlockEditorAction('toggleSelection');
3317  /**
3318   * @see replaceBlocks in core/block-editor store.
3319   */
3320  
3321  var actions_replaceBlocks = actions_getBlockEditorAction('replaceBlocks');
3322  /**
3323   * @see replaceBlock in core/block-editor store.
3324   */
3325  
3326  var replaceBlock = actions_getBlockEditorAction('replaceBlock');
3327  /**
3328   * @see moveBlocksDown in core/block-editor store.
3329   */
3330  
3331  var moveBlocksDown = actions_getBlockEditorAction('moveBlocksDown');
3332  /**
3333   * @see moveBlocksUp in core/block-editor store.
3334   */
3335  
3336  var moveBlocksUp = actions_getBlockEditorAction('moveBlocksUp');
3337  /**
3338   * @see moveBlockToPosition in core/block-editor store.
3339   */
3340  
3341  var moveBlockToPosition = actions_getBlockEditorAction('moveBlockToPosition');
3342  /**
3343   * @see insertBlock in core/block-editor store.
3344   */
3345  
3346  var insertBlock = actions_getBlockEditorAction('insertBlock');
3347  /**
3348   * @see insertBlocks in core/block-editor store.
3349   */
3350  
3351  var insertBlocks = actions_getBlockEditorAction('insertBlocks');
3352  /**
3353   * @see showInsertionPoint in core/block-editor store.
3354   */
3355  
3356  var showInsertionPoint = actions_getBlockEditorAction('showInsertionPoint');
3357  /**
3358   * @see hideInsertionPoint in core/block-editor store.
3359   */
3360  
3361  var hideInsertionPoint = actions_getBlockEditorAction('hideInsertionPoint');
3362  /**
3363   * @see setTemplateValidity in core/block-editor store.
3364   */
3365  
3366  var setTemplateValidity = actions_getBlockEditorAction('setTemplateValidity');
3367  /**
3368   * @see synchronizeTemplate in core/block-editor store.
3369   */
3370  
3371  var synchronizeTemplate = actions_getBlockEditorAction('synchronizeTemplate');
3372  /**
3373   * @see mergeBlocks in core/block-editor store.
3374   */
3375  
3376  var mergeBlocks = actions_getBlockEditorAction('mergeBlocks');
3377  /**
3378   * @see removeBlocks in core/block-editor store.
3379   */
3380  
3381  var removeBlocks = actions_getBlockEditorAction('removeBlocks');
3382  /**
3383   * @see removeBlock in core/block-editor store.
3384   */
3385  
3386  var removeBlock = actions_getBlockEditorAction('removeBlock');
3387  /**
3388   * @see toggleBlockMode in core/block-editor store.
3389   */
3390  
3391  var toggleBlockMode = actions_getBlockEditorAction('toggleBlockMode');
3392  /**
3393   * @see startTyping in core/block-editor store.
3394   */
3395  
3396  var startTyping = actions_getBlockEditorAction('startTyping');
3397  /**
3398   * @see stopTyping in core/block-editor store.
3399   */
3400  
3401  var stopTyping = actions_getBlockEditorAction('stopTyping');
3402  /**
3403   * @see enterFormattedText in core/block-editor store.
3404   */
3405  
3406  var enterFormattedText = actions_getBlockEditorAction('enterFormattedText');
3407  /**
3408   * @see exitFormattedText in core/block-editor store.
3409   */
3410  
3411  var exitFormattedText = actions_getBlockEditorAction('exitFormattedText');
3412  /**
3413   * @see insertDefaultBlock in core/block-editor store.
3414   */
3415  
3416  var actions_insertDefaultBlock = actions_getBlockEditorAction('insertDefaultBlock');
3417  /**
3418   * @see updateBlockListSettings in core/block-editor store.
3419   */
3420  
3421  var updateBlockListSettings = actions_getBlockEditorAction('updateBlockListSettings');
3422  
3423  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
3424  var slicedToArray = __webpack_require__(22);
3425  
3426  // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
3427  var rememo = __webpack_require__(38);
3428  
3429  // EXTERNAL MODULE: external {"this":["wp","date"]}
3430  var external_this_wp_date_ = __webpack_require__(54);
3431  
3432  // EXTERNAL MODULE: external {"this":["wp","url"]}
3433  var external_this_wp_url_ = __webpack_require__(25);
3434  
3435  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/selectors.js
3436  
3437  
3438  
3439  /**
3440   * External dependencies
3441   */
3442  
3443  
3444  /**
3445   * WordPress dependencies
3446   */
3447  
3448  
3449  
3450  
3451  
3452  
3453  /**
3454   * Internal dependencies
3455   */
3456  
3457  
3458  
3459  
3460  
3461  /**
3462   * Shared reference to an empty object for cases where it is important to avoid
3463   * returning a new object reference on every invocation, as in a connected or
3464   * other pure component which performs `shouldComponentUpdate` check on props.
3465   * This should be used as a last resort, since the normalized data should be
3466   * maintained by the reducer result in state.
3467   */
3468  
3469  var EMPTY_OBJECT = {};
3470  /**
3471   * Shared reference to an empty array for cases where it is important to avoid
3472   * returning a new array reference on every invocation, as in a connected or
3473   * other pure component which performs `shouldComponentUpdate` check on props.
3474   * This should be used as a last resort, since the normalized data should be
3475   * maintained by the reducer result in state.
3476   */
3477  
3478  var EMPTY_ARRAY = [];
3479  /**
3480   * Returns true if any past editor history snapshots exist, or false otherwise.
3481   *
3482   * @param {Object} state Global application state.
3483   *
3484   * @return {boolean} Whether undo history exists.
3485   */
3486  
3487  var hasEditorUndo = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
3488    return function () {
3489      return select('core').hasUndo();
3490    };
3491  });
3492  /**
3493   * Returns true if any future editor history snapshots exist, or false
3494   * otherwise.
3495   *
3496   * @param {Object} state Global application state.
3497   *
3498   * @return {boolean} Whether redo history exists.
3499   */
3500  
3501  var hasEditorRedo = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
3502    return function () {
3503      return select('core').hasRedo();
3504    };
3505  });
3506  /**
3507   * Returns true if the currently edited post is yet to be saved, or false if
3508   * the post has been saved.
3509   *
3510   * @param {Object} state Global application state.
3511   *
3512   * @return {boolean} Whether the post is new.
3513   */
3514  
3515  function selectors_isEditedPostNew(state) {
3516    return selectors_getCurrentPost(state).status === 'auto-draft';
3517  }
3518  /**
3519   * Returns true if content includes unsaved changes, or false otherwise.
3520   *
3521   * @param {Object} state Editor state.
3522   *
3523   * @return {boolean} Whether content includes unsaved changes.
3524   */
3525  
3526  function hasChangedContent(state) {
3527    var edits = getPostEdits(state);
3528    return 'blocks' in edits || // `edits` is intended to contain only values which are different from
3529    // the saved post, so the mere presence of a property is an indicator
3530    // that the value is different than what is known to be saved. While
3531    // content in Visual mode is represented by the blocks state, in Text
3532    // mode it is tracked by `edits.content`.
3533    'content' in edits;
3534  }
3535  /**
3536   * Returns true if there are unsaved values for the current edit session, or
3537   * false if the editing state matches the saved or new post.
3538   *
3539   * @param {Object} state Global application state.
3540   *
3541   * @return {boolean} Whether unsaved values exist.
3542   */
3543  
3544  var selectors_isEditedPostDirty = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
3545    return function (state) {
3546      // Edits should contain only fields which differ from the saved post (reset
3547      // at initial load and save complete). Thus, a non-empty edits state can be
3548      // inferred to contain unsaved values.
3549      var postType = selectors_getCurrentPostType(state);
3550      var postId = selectors_getCurrentPostId(state);
3551  
3552      if (select('core').hasEditsForEntityRecord('postType', postType, postId)) {
3553        return true;
3554      }
3555  
3556      return false;
3557    };
3558  });
3559  /**
3560   * Returns true if there are no unsaved values for the current edit session and
3561   * if the currently edited post is new (has never been saved before).
3562   *
3563   * @param {Object} state Global application state.
3564   *
3565   * @return {boolean} Whether new post and unsaved values exist.
3566   */
3567  
3568  function selectors_isCleanNewPost(state) {
3569    return !selectors_isEditedPostDirty(state) && selectors_isEditedPostNew(state);
3570  }
3571  /**
3572   * Returns the post currently being edited in its last known saved state, not
3573   * including unsaved edits. Returns an object containing relevant default post
3574   * values if the post has not yet been saved.
3575   *
3576   * @param {Object} state Global application state.
3577   *
3578   * @return {Object} Post object.
3579   */
3580  
3581  var selectors_getCurrentPost = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
3582    return function (state) {
3583      var postId = selectors_getCurrentPostId(state);
3584      var postType = selectors_getCurrentPostType(state);
3585      var post = select('core').getRawEntityRecord('postType', postType, postId);
3586  
3587      if (post) {
3588        return post;
3589      } // This exists for compatibility with the previous selector behavior
3590      // which would guarantee an object return based on the editor reducer's
3591      // default empty object state.
3592  
3593  
3594      return EMPTY_OBJECT;
3595    };
3596  });
3597  /**
3598   * Returns the post type of the post currently being edited.
3599   *
3600   * @param {Object} state Global application state.
3601   *
3602   * @return {string} Post type.
3603   */
3604  
3605  function selectors_getCurrentPostType(state) {
3606    return state.postType;
3607  }
3608  /**
3609   * Returns the ID of the post currently being edited, or null if the post has
3610   * not yet been saved.
3611   *
3612   * @param {Object} state Global application state.
3613   *
3614   * @return {?number} ID of current post.
3615   */
3616  
3617  function selectors_getCurrentPostId(state) {
3618    return state.postId;
3619  }
3620  /**
3621   * Returns the number of revisions of the post currently being edited.
3622   *
3623   * @param {Object} state Global application state.
3624   *
3625   * @return {number} Number of revisions.
3626   */
3627  
3628  function getCurrentPostRevisionsCount(state) {
3629    return Object(external_this_lodash_["get"])(selectors_getCurrentPost(state), ['_links', 'version-history', 0, 'count'], 0);
3630  }
3631  /**
3632   * Returns the last revision ID of the post currently being edited,
3633   * or null if the post has no revisions.
3634   *
3635   * @param {Object} state Global application state.
3636   *
3637   * @return {?number} ID of the last revision.
3638   */
3639  
3640  function getCurrentPostLastRevisionId(state) {
3641    return Object(external_this_lodash_["get"])(selectors_getCurrentPost(state), ['_links', 'predecessor-version', 0, 'id'], null);
3642  }
3643  /**
3644   * Returns any post values which have been changed in the editor but not yet
3645   * been saved.
3646   *
3647   * @param {Object} state Global application state.
3648   *
3649   * @return {Object} Object of key value pairs comprising unsaved edits.
3650   */
3651  
3652  var getPostEdits = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
3653    return function (state) {
3654      var postType = selectors_getCurrentPostType(state);
3655      var postId = selectors_getCurrentPostId(state);
3656      return select('core').getEntityRecordEdits('postType', postType, postId) || EMPTY_OBJECT;
3657    };
3658  });
3659  /**
3660   * Returns a new reference when edited values have changed. This is useful in
3661   * inferring where an edit has been made between states by comparison of the
3662   * return values using strict equality.
3663   *
3664   * @deprecated since Gutenberg 6.5.0.
3665   *
3666   * @example
3667   *
3668   * ```
3669   * const hasEditOccurred = (
3670   *    getReferenceByDistinctEdits( beforeState ) !==
3671   *    getReferenceByDistinctEdits( afterState )
3672   * );
3673   * ```
3674   *
3675   * @param {Object} state Editor state.
3676   *
3677   * @return {*} A value whose reference will change only when an edit occurs.
3678   */
3679  
3680  var getReferenceByDistinctEdits = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
3681    return function ()
3682    /* state */
3683    {
3684      external_this_wp_deprecated_default()('`wp.data.select( \'core/editor\' ).getReferenceByDistinctEdits`', {
3685        alternative: '`wp.data.select( \'core\' ).getReferenceByDistinctEdits`'
3686      });
3687      return select('core').getReferenceByDistinctEdits();
3688    };
3689  });
3690  /**
3691   * Returns an attribute value of the saved post.
3692   *
3693   * @param {Object} state         Global application state.
3694   * @param {string} attributeName Post attribute name.
3695   *
3696   * @return {*} Post attribute value.
3697   */
3698  
3699  function selectors_getCurrentPostAttribute(state, attributeName) {
3700    switch (attributeName) {
3701      case 'type':
3702        return selectors_getCurrentPostType(state);
3703  
3704      case 'id':
3705        return selectors_getCurrentPostId(state);
3706  
3707      default:
3708        var post = selectors_getCurrentPost(state);
3709  
3710        if (!post.hasOwnProperty(attributeName)) {
3711          break;
3712        }
3713  
3714        return getPostRawValue(post[attributeName]);
3715    }
3716  }
3717  /**
3718   * Returns a single attribute of the post being edited, preferring the unsaved
3719   * edit if one exists, but merging with the attribute value for the last known
3720   * saved state of the post (this is needed for some nested attributes like meta).
3721   *
3722   * @param {Object} state         Global application state.
3723   * @param {string} attributeName Post attribute name.
3724   *
3725   * @return {*} Post attribute value.
3726   */
3727  
3728  var selectors_getNestedEditedPostProperty = function getNestedEditedPostProperty(state, attributeName) {
3729    var edits = getPostEdits(state);
3730  
3731    if (!edits.hasOwnProperty(attributeName)) {
3732      return selectors_getCurrentPostAttribute(state, attributeName);
3733    }
3734  
3735    return Object(objectSpread["a" /* default */])({}, selectors_getCurrentPostAttribute(state, attributeName), edits[attributeName]);
3736  };
3737  /**
3738   * Returns a single attribute of the post being edited, preferring the unsaved
3739   * edit if one exists, but falling back to the attribute for the last known
3740   * saved state of the post.
3741   *
3742   * @param {Object} state         Global application state.
3743   * @param {string} attributeName Post attribute name.
3744   *
3745   * @return {*} Post attribute value.
3746   */
3747  
3748  
3749  function selectors_getEditedPostAttribute(state, attributeName) {
3750    // Special cases
3751    switch (attributeName) {
3752      case 'content':
3753        return getEditedPostContent(state);
3754    } // Fall back to saved post value if not edited.
3755  
3756  
3757    var edits = getPostEdits(state);
3758  
3759    if (!edits.hasOwnProperty(attributeName)) {
3760      return selectors_getCurrentPostAttribute(state, attributeName);
3761    } // Merge properties are objects which contain only the patch edit in state,
3762    // and thus must be merged with the current post attribute.
3763  
3764  
3765    if (EDIT_MERGE_PROPERTIES.has(attributeName)) {
3766      return selectors_getNestedEditedPostProperty(state, attributeName);
3767    }
3768  
3769    return edits[attributeName];
3770  }
3771  /**
3772   * Returns an attribute value of the current autosave revision for a post, or
3773   * null if there is no autosave for the post.
3774   *
3775   * @deprecated since 5.6. Callers should use the `getAutosave( postType, postId, userId )` selector
3776   *                from the '@wordpress/core-data' package and access properties on the returned
3777   *                autosave object using getPostRawValue.
3778   *
3779   * @param {Object} state         Global application state.
3780   * @param {string} attributeName Autosave attribute name.
3781   *
3782   * @return {*} Autosave attribute value.
3783   */
3784  
3785  var getAutosaveAttribute = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
3786    return function (state, attributeName) {
3787      if (!Object(external_this_lodash_["includes"])(AUTOSAVE_PROPERTIES, attributeName) && attributeName !== 'preview_link') {
3788        return;
3789      }
3790  
3791      var postType = selectors_getCurrentPostType(state);
3792      var postId = selectors_getCurrentPostId(state);
3793      var currentUserId = Object(external_this_lodash_["get"])(select('core').getCurrentUser(), ['id']);
3794      var autosave = select('core').getAutosave(postType, postId, currentUserId);
3795  
3796      if (autosave) {
3797        return getPostRawValue(autosave[attributeName]);
3798      }
3799    };
3800  });
3801  /**
3802   * Returns the current visibility of the post being edited, preferring the
3803   * unsaved value if different than the saved post. The return value is one of
3804   * "private", "password", or "public".
3805   *
3806   * @param {Object} state Global application state.
3807   *
3808   * @return {string} Post visibility.
3809   */
3810  
3811  function selectors_getEditedPostVisibility(state) {
3812    var status = selectors_getEditedPostAttribute(state, 'status');
3813  
3814    if (status === 'private') {
3815      return 'private';
3816    }
3817  
3818    var password = selectors_getEditedPostAttribute(state, 'password');
3819  
3820    if (password) {
3821      return 'password';
3822    }
3823  
3824    return 'public';
3825  }
3826  /**
3827   * Returns true if post is pending review.
3828   *
3829   * @param {Object} state Global application state.
3830   *
3831   * @return {boolean} Whether current post is pending review.
3832   */
3833  
3834  function isCurrentPostPending(state) {
3835    return selectors_getCurrentPost(state).status === 'pending';
3836  }
3837  /**
3838   * Return true if the current post has already been published.
3839   *
3840   * @param {Object}  state       Global application state.
3841   * @param {Object?} currentPost Explicit current post for bypassing registry selector.
3842   *
3843   * @return {boolean} Whether the post has been published.
3844   */
3845  
3846  function selectors_isCurrentPostPublished(state, currentPost) {
3847    var post = currentPost || selectors_getCurrentPost(state);
3848    return ['publish', 'private'].indexOf(post.status) !== -1 || post.status === 'future' && !Object(external_this_wp_date_["isInTheFuture"])(new Date(Number(Object(external_this_wp_date_["getDate"])(post.date)) - ONE_MINUTE_IN_MS));
3849  }
3850  /**
3851   * Returns true if post is already scheduled.
3852   *
3853   * @param {Object} state Global application state.
3854   *
3855   * @return {boolean} Whether current post is scheduled to be posted.
3856   */
3857  
3858  function selectors_isCurrentPostScheduled(state) {
3859    return selectors_getCurrentPost(state).status === 'future' && !selectors_isCurrentPostPublished(state);
3860  }
3861  /**
3862   * Return true if the post being edited can be published.
3863   *
3864   * @param {Object} state Global application state.
3865   *
3866   * @return {boolean} Whether the post can been published.
3867   */
3868  
3869  function selectors_isEditedPostPublishable(state) {
3870    var post = selectors_getCurrentPost(state); // TODO: Post being publishable should be superset of condition of post
3871    // being saveable. Currently this restriction is imposed at UI.
3872    //
3873    //  See: <PostPublishButton /> (`isButtonEnabled` assigned by `isSaveable`)
3874  
3875    return selectors_isEditedPostDirty(state) || ['publish', 'private', 'future'].indexOf(post.status) === -1;
3876  }
3877  /**
3878   * Returns true if the post can be saved, or false otherwise. A post must
3879   * contain a title, an excerpt, or non-empty content to be valid for save.
3880   *
3881   * @param {Object} state Global application state.
3882   *
3883   * @return {boolean} Whether the post can be saved.
3884   */
3885  
3886  function selectors_isEditedPostSaveable(state) {
3887    if (selectors_isSavingPost(state)) {
3888      return false;
3889    } // TODO: Post should not be saveable if not dirty. Cannot be added here at
3890    // this time since posts where meta boxes are present can be saved even if
3891    // the post is not dirty. Currently this restriction is imposed at UI, but
3892    // should be moved here.
3893    //
3894    //  See: `isEditedPostPublishable` (includes `isEditedPostDirty` condition)
3895    //  See: <PostSavedState /> (`forceIsDirty` prop)
3896    //  See: <PostPublishButton /> (`forceIsDirty` prop)
3897    //  See: https://github.com/WordPress/gutenberg/pull/4184
3898  
3899  
3900    return !!selectors_getEditedPostAttribute(state, 'title') || !!selectors_getEditedPostAttribute(state, 'excerpt') || !isEditedPostEmpty(state);
3901  }
3902  /**
3903   * Returns true if the edited post has content. A post has content if it has at
3904   * least one saveable block or otherwise has a non-empty content property
3905   * assigned.
3906   *
3907   * @param {Object} state Global application state.
3908   *
3909   * @return {boolean} Whether post has content.
3910   */
3911  
3912  function isEditedPostEmpty(state) {
3913    // While the condition of truthy content string is sufficient to determine
3914    // emptiness, testing saveable blocks length is a trivial operation. Since
3915    // this function can be called frequently, optimize for the fast case as a
3916    // condition of the mere existence of blocks. Note that the value of edited
3917    // content takes precedent over block content, and must fall through to the
3918    // default logic.
3919    var blocks = selectors_getEditorBlocks(state);
3920  
3921    if (blocks.length) {
3922      // Pierce the abstraction of the serializer in knowing that blocks are
3923      // joined with with newlines such that even if every individual block
3924      // produces an empty save result, the serialized content is non-empty.
3925      if (blocks.length > 1) {
3926        return false;
3927      } // There are two conditions under which the optimization cannot be
3928      // assumed, and a fallthrough to getEditedPostContent must occur:
3929      //
3930      // 1. getBlocksForSerialization has special treatment in omitting a
3931      //    single unmodified default block.
3932      // 2. Comment delimiters are omitted for a freeform or unregistered
3933      //    block in its serialization. The freeform block specifically may
3934      //    produce an empty string in its saved output.
3935      //
3936      // For all other content, the single block is assumed to make a post
3937      // non-empty, if only by virtue of its own comment delimiters.
3938  
3939  
3940      var blockName = blocks[0].name;
3941  
3942      if (blockName !== Object(external_this_wp_blocks_["getDefaultBlockName"])() && blockName !== Object(external_this_wp_blocks_["getFreeformContentHandlerName"])()) {
3943        return false;
3944      }
3945    }
3946  
3947    return !getEditedPostContent(state);
3948  }
3949  /**
3950   * Returns true if the post can be autosaved, or false otherwise.
3951   *
3952   * @param {Object} state    Global application state.
3953   * @param {Object} autosave A raw autosave object from the REST API.
3954   *
3955   * @return {boolean} Whether the post can be autosaved.
3956   */
3957  
3958  var selectors_isEditedPostAutosaveable = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
3959    return function (state) {
3960      // A post must contain a title, an excerpt, or non-empty content to be valid for autosaving.
3961      if (!selectors_isEditedPostSaveable(state)) {
3962        return false;
3963      } // A post is not autosavable when there is a post autosave lock.
3964  
3965  
3966      if (isPostAutosavingLocked(state)) {
3967        return false;
3968      }
3969  
3970      var postType = selectors_getCurrentPostType(state);
3971      var postId = selectors_getCurrentPostId(state);
3972      var hasFetchedAutosave = select('core').hasFetchedAutosaves(postType, postId);
3973      var currentUserId = Object(external_this_lodash_["get"])(select('core').getCurrentUser(), ['id']); // Disable reason - this line causes the side-effect of fetching the autosave
3974      // via a resolver, moving below the return would result in the autosave never
3975      // being fetched.
3976      // eslint-disable-next-line @wordpress/no-unused-vars-before-return
3977  
3978      var autosave = select('core').getAutosave(postType, postId, currentUserId); // If any existing autosaves have not yet been fetched, this function is
3979      // unable to determine if the post is autosaveable, so return false.
3980  
3981      if (!hasFetchedAutosave) {
3982        return false;
3983      } // If we don't already have an autosave, the post is autosaveable.
3984  
3985  
3986      if (!autosave) {
3987        return true;
3988      } // To avoid an expensive content serialization, use the content dirtiness
3989      // flag in place of content field comparison against the known autosave.
3990      // This is not strictly accurate, and relies on a tolerance toward autosave
3991      // request failures for unnecessary saves.
3992  
3993  
3994      if (hasChangedContent(state)) {
3995        return true;
3996      } // If the title or excerpt has changed, the post is autosaveable.
3997  
3998  
3999      return ['title', 'excerpt'].some(function (field) {
4000        return getPostRawValue(autosave[field]) !== selectors_getEditedPostAttribute(state, field);
4001      });
4002    };
4003  });
4004  /**
4005   * Returns the current autosave, or null if one is not set (i.e. if the post
4006   * has yet to be autosaved, or has been saved or published since the last
4007   * autosave).
4008   *
4009   * @deprecated since 5.6. Callers should use the `getAutosave( postType, postId, userId )`
4010   *                selector from the '@wordpress/core-data' package.
4011   *
4012   * @param {Object} state Editor state.
4013   *
4014   * @return {?Object} Current autosave, if exists.
4015   */
4016  
4017  var getAutosave = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4018    return function (state) {
4019      external_this_wp_deprecated_default()('`wp.data.select( \'core/editor\' ).getAutosave()`', {
4020        alternative: '`wp.data.select( \'core\' ).getAutosave( postType, postId, userId )`',
4021        plugin: 'Gutenberg'
4022      });
4023      var postType = selectors_getCurrentPostType(state);
4024      var postId = selectors_getCurrentPostId(state);
4025      var currentUserId = Object(external_this_lodash_["get"])(select('core').getCurrentUser(), ['id']);
4026      var autosave = select('core').getAutosave(postType, postId, currentUserId);
4027      return Object(external_this_lodash_["mapValues"])(Object(external_this_lodash_["pick"])(autosave, AUTOSAVE_PROPERTIES), getPostRawValue);
4028    };
4029  });
4030  /**
4031   * Returns the true if there is an existing autosave, otherwise false.
4032   *
4033   * @deprecated since 5.6. Callers should use the `getAutosave( postType, postId, userId )` selector
4034   *             from the '@wordpress/core-data' package and check for a truthy value.
4035   *
4036   * @param {Object} state Global application state.
4037   *
4038   * @return {boolean} Whether there is an existing autosave.
4039   */
4040  
4041  var hasAutosave = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4042    return function (state) {
4043      external_this_wp_deprecated_default()('`wp.data.select( \'core/editor\' ).hasAutosave()`', {
4044        alternative: '`!! wp.data.select( \'core\' ).getAutosave( postType, postId, userId )`',
4045        plugin: 'Gutenberg'
4046      });
4047      var postType = selectors_getCurrentPostType(state);
4048      var postId = selectors_getCurrentPostId(state);
4049      var currentUserId = Object(external_this_lodash_["get"])(select('core').getCurrentUser(), ['id']);
4050      return !!select('core').getAutosave(postType, postId, currentUserId);
4051    };
4052  });
4053  /**
4054   * Return true if the post being edited is being scheduled. Preferring the
4055   * unsaved status values.
4056   *
4057   * @param {Object} state Global application state.
4058   *
4059   * @return {boolean} Whether the post has been published.
4060   */
4061  
4062  function selectors_isEditedPostBeingScheduled(state) {
4063    var date = selectors_getEditedPostAttribute(state, 'date'); // Offset the date by one minute (network latency)
4064  
4065    var checkedDate = new Date(Number(Object(external_this_wp_date_["getDate"])(date)) - ONE_MINUTE_IN_MS);
4066    return Object(external_this_wp_date_["isInTheFuture"])(checkedDate);
4067  }
4068  /**
4069   * Returns whether the current post should be considered to have a "floating"
4070   * date (i.e. that it would publish "Immediately" rather than at a set time).
4071   *
4072   * Unlike in the PHP backend, the REST API returns a full date string for posts
4073   * where the 0000-00-00T00:00:00 placeholder is present in the database. To
4074   * infer that a post is set to publish "Immediately" we check whether the date
4075   * and modified date are the same.
4076   *
4077   * @param {Object} state Editor state.
4078   *
4079   * @return {boolean} Whether the edited post has a floating date value.
4080   */
4081  
4082  function isEditedPostDateFloating(state) {
4083    var date = selectors_getEditedPostAttribute(state, 'date');
4084    var modified = selectors_getEditedPostAttribute(state, 'modified');
4085    var status = selectors_getEditedPostAttribute(state, 'status');
4086  
4087    if (status === 'draft' || status === 'auto-draft' || status === 'pending') {
4088      return date === modified;
4089    }
4090  
4091    return false;
4092  }
4093  /**
4094   * Returns true if the post is currently being saved, or false otherwise.
4095   *
4096   * @param {Object} state Global application state.
4097   *
4098   * @return {boolean} Whether post is being saved.
4099   */
4100  
4101  var selectors_isSavingPost = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4102    return function (state) {
4103      var postType = selectors_getCurrentPostType(state);
4104      var postId = selectors_getCurrentPostId(state);
4105      return select('core').isSavingEntityRecord('postType', postType, postId);
4106    };
4107  });
4108  /**
4109   * Returns true if a previous post save was attempted successfully, or false
4110   * otherwise.
4111   *
4112   * @param {Object} state Global application state.
4113   *
4114   * @return {boolean} Whether the post was saved successfully.
4115   */
4116  
4117  var didPostSaveRequestSucceed = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4118    return function (state) {
4119      var postType = selectors_getCurrentPostType(state);
4120      var postId = selectors_getCurrentPostId(state);
4121      return !select('core').getLastEntitySaveError('postType', postType, postId);
4122    };
4123  });
4124  /**
4125   * Returns true if a previous post save was attempted but failed, or false
4126   * otherwise.
4127   *
4128   * @param {Object} state Global application state.
4129   *
4130   * @return {boolean} Whether the post save failed.
4131   */
4132  
4133  var didPostSaveRequestFail = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4134    return function (state) {
4135      var postType = selectors_getCurrentPostType(state);
4136      var postId = selectors_getCurrentPostId(state);
4137      return !!select('core').getLastEntitySaveError('postType', postType, postId);
4138    };
4139  });
4140  /**
4141   * Returns true if the post is autosaving, or false otherwise.
4142   *
4143   * @param {Object} state Global application state.
4144   *
4145   * @return {boolean} Whether the post is autosaving.
4146   */
4147  
4148  function selectors_isAutosavingPost(state) {
4149    if (!selectors_isSavingPost(state)) {
4150      return false;
4151    }
4152  
4153    return !!Object(external_this_lodash_["get"])(state.saving, ['options', 'isAutosave']);
4154  }
4155  /**
4156   * Returns true if the post is being previewed, or false otherwise.
4157   *
4158   * @param {Object} state Global application state.
4159   *
4160   * @return {boolean} Whether the post is being previewed.
4161   */
4162  
4163  function isPreviewingPost(state) {
4164    if (!selectors_isSavingPost(state)) {
4165      return false;
4166    }
4167  
4168    return !!state.saving.options.isPreview;
4169  }
4170  /**
4171   * Returns the post preview link
4172   *
4173   * @param {Object} state Global application state.
4174   *
4175   * @return {string?} Preview Link.
4176   */
4177  
4178  function selectors_getEditedPostPreviewLink(state) {
4179    if (state.saving.pending || selectors_isSavingPost(state)) {
4180      return;
4181    }
4182  
4183    var previewLink = getAutosaveAttribute(state, 'preview_link');
4184  
4185    if (!previewLink) {
4186      previewLink = selectors_getEditedPostAttribute(state, 'link');
4187  
4188      if (previewLink) {
4189        previewLink = Object(external_this_wp_url_["addQueryArgs"])(previewLink, {
4190          preview: true
4191        });
4192      }
4193    }
4194  
4195    var featuredImageId = selectors_getEditedPostAttribute(state, 'featured_media');
4196  
4197    if (previewLink && featuredImageId) {
4198      return Object(external_this_wp_url_["addQueryArgs"])(previewLink, {
4199        _thumbnail_id: featuredImageId
4200      });
4201    }
4202  
4203    return previewLink;
4204  }
4205  /**
4206   * Returns a suggested post format for the current post, inferred only if there
4207   * is a single block within the post and it is of a type known to match a
4208   * default post format. Returns null if the format cannot be determined.
4209   *
4210   * @param {Object} state Global application state.
4211   *
4212   * @return {?string} Suggested post format.
4213   */
4214  
4215  function selectors_getSuggestedPostFormat(state) {
4216    var blocks = selectors_getEditorBlocks(state);
4217    var name; // If there is only one block in the content of the post grab its name
4218    // so we can derive a suitable post format from it.
4219  
4220    if (blocks.length === 1) {
4221      name = blocks[0].name;
4222    } // If there are two blocks in the content and the last one is a text blocks
4223    // grab the name of the first one to also suggest a post format from it.
4224  
4225  
4226    if (blocks.length === 2) {
4227      if (blocks[1].name === 'core/paragraph') {
4228        name = blocks[0].name;
4229      }
4230    } // We only convert to default post formats in core.
4231  
4232  
4233    switch (name) {
4234      case 'core/image':
4235        return 'image';
4236  
4237      case 'core/quote':
4238      case 'core/pullquote':
4239        return 'quote';
4240  
4241      case 'core/gallery':
4242        return 'gallery';
4243  
4244      case 'core/video':
4245      case 'core-embed/youtube':
4246      case 'core-embed/vimeo':
4247        return 'video';
4248  
4249      case 'core/audio':
4250      case 'core-embed/spotify':
4251      case 'core-embed/soundcloud':
4252        return 'audio';
4253    }
4254  
4255    return null;
4256  }
4257  /**
4258   * Returns a set of blocks which are to be used in consideration of the post's
4259   * generated save content.
4260   *
4261   * @deprecated since Gutenberg 6.2.0.
4262   *
4263   * @param {Object} state Editor state.
4264   *
4265   * @return {WPBlock[]} Filtered set of blocks for save.
4266   */
4267  
4268  function getBlocksForSerialization(state) {
4269    external_this_wp_deprecated_default()('`core/editor` getBlocksForSerialization selector', {
4270      plugin: 'Gutenberg',
4271      alternative: 'getEditorBlocks',
4272      hint: 'Blocks serialization pre-processing occurs at save time'
4273    });
4274    var blocks = state.editor.present.blocks.value; // WARNING: Any changes to the logic of this function should be verified
4275    // against the implementation of isEditedPostEmpty, which bypasses this
4276    // function for performance' sake, in an assumption of this current logic
4277    // being irrelevant to the optimized condition of emptiness.
4278    // A single unmodified default block is assumed to be equivalent to an
4279    // empty post.
4280  
4281    var isSingleUnmodifiedDefaultBlock = blocks.length === 1 && Object(external_this_wp_blocks_["isUnmodifiedDefaultBlock"])(blocks[0]);
4282  
4283    if (isSingleUnmodifiedDefaultBlock) {
4284      return [];
4285    }
4286  
4287    return blocks;
4288  }
4289  /**
4290   * Returns the content of the post being edited.
4291   *
4292   * @param {Object} state Global application state.
4293   *
4294   * @return {string} Post content.
4295   */
4296  
4297  var getEditedPostContent = Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4298    return function (state) {
4299      var postId = selectors_getCurrentPostId(state);
4300      var postType = selectors_getCurrentPostType(state);
4301      var record = select('core').getEditedEntityRecord('postType', postType, postId);
4302  
4303      if (record) {
4304        if (typeof record.content === 'function') {
4305          return record.content(record);
4306        } else if (record.blocks) {
4307          return serialize_blocks(record.blocks);
4308        } else if (record.content) {
4309          return record.content;
4310        }
4311      }
4312  
4313      return '';
4314    };
4315  });
4316  /**
4317   * Returns the reusable block with the given ID.
4318   *
4319   * @param {Object}        state Global application state.
4320   * @param {number|string} ref   The reusable block's ID.
4321   *
4322   * @return {Object} The reusable block, or null if none exists.
4323   */
4324  
4325  var __experimentalGetReusableBlock = Object(rememo["a" /* default */])(function (state, ref) {
4326    var block = state.reusableBlocks.data[ref];
4327  
4328    if (!block) {
4329      return null;
4330    }
4331  
4332    var isTemporary = isNaN(parseInt(ref));
4333    return Object(objectSpread["a" /* default */])({}, block, {
4334      id: isTemporary ? ref : +ref,
4335      isTemporary: isTemporary
4336    });
4337  }, function (state, ref) {
4338    return [state.reusableBlocks.data[ref]];
4339  });
4340  /**
4341   * Returns whether or not the reusable block with the given ID is being saved.
4342   *
4343   * @param {Object} state Global application state.
4344   * @param {string} ref   The reusable block's ID.
4345   *
4346   * @return {boolean} Whether or not the reusable block is being saved.
4347   */
4348  
4349  function __experimentalIsSavingReusableBlock(state, ref) {
4350    return state.reusableBlocks.isSaving[ref] || false;
4351  }
4352  /**
4353   * Returns true if the reusable block with the given ID is being fetched, or
4354   * false otherwise.
4355   *
4356   * @param {Object} state Global application state.
4357   * @param {string} ref   The reusable block's ID.
4358   *
4359   * @return {boolean} Whether the reusable block is being fetched.
4360   */
4361  
4362  function __experimentalIsFetchingReusableBlock(state, ref) {
4363    return !!state.reusableBlocks.isFetching[ref];
4364  }
4365  /**
4366   * Returns an array of all reusable blocks.
4367   *
4368   * @param {Object} state Global application state.
4369   *
4370   * @return {Array} An array of all reusable blocks.
4371   */
4372  
4373  var selectors_experimentalGetReusableBlocks = Object(rememo["a" /* default */])(function (state) {
4374    return Object(external_this_lodash_["map"])(state.reusableBlocks.data, function (value, ref) {
4375      return __experimentalGetReusableBlock(state, ref);
4376    });
4377  }, function (state) {
4378    return [state.reusableBlocks.data];
4379  });
4380  /**
4381   * Returns state object prior to a specified optimist transaction ID, or `null`
4382   * if the transaction corresponding to the given ID cannot be found.
4383   *
4384   * @param {Object} state         Current global application state.
4385   * @param {Object} transactionId Optimist transaction ID.
4386   *
4387   * @return {Object} Global application state prior to transaction.
4388   */
4389  
4390  function getStateBeforeOptimisticTransaction(state, transactionId) {
4391    var transaction = Object(external_this_lodash_["find"])(state.optimist, function (entry) {
4392      return entry.beforeState && Object(external_this_lodash_["get"])(entry.action, ['optimist', 'id']) === transactionId;
4393    });
4394    return transaction ? transaction.beforeState : null;
4395  }
4396  /**
4397   * Returns true if the post is being published, or false otherwise.
4398   *
4399   * @param {Object} state Global application state.
4400   *
4401   * @return {boolean} Whether post is being published.
4402   */
4403  
4404  function selectors_isPublishingPost(state) {
4405    if (!selectors_isSavingPost(state)) {
4406      return false;
4407    } // Saving is optimistic, so assume that current post would be marked as
4408    // published if publishing
4409  
4410  
4411    if (!selectors_isCurrentPostPublished(state)) {
4412      return false;
4413    } // Use post update transaction ID to retrieve the state prior to the
4414    // optimistic transaction
4415  
4416  
4417    var stateBeforeRequest = getStateBeforeOptimisticTransaction(state, POST_UPDATE_TRANSACTION_ID); // Consider as publishing when current post prior to request was not
4418    // considered published
4419  
4420    return !!stateBeforeRequest && !selectors_isCurrentPostPublished(null, stateBeforeRequest.currentPost);
4421  }
4422  /**
4423   * Returns whether the permalink is editable or not.
4424   *
4425   * @param {Object} state Editor state.
4426   *
4427   * @return {boolean} Whether or not the permalink is editable.
4428   */
4429  
4430  function selectors_isPermalinkEditable(state) {
4431    var permalinkTemplate = selectors_getEditedPostAttribute(state, 'permalink_template');
4432    return PERMALINK_POSTNAME_REGEX.test(permalinkTemplate);
4433  }
4434  /**
4435   * Returns the permalink for the post.
4436   *
4437   * @param {Object} state Editor state.
4438   *
4439   * @return {?string} The permalink, or null if the post is not viewable.
4440   */
4441  
4442  function getPermalink(state) {
4443    var permalinkParts = selectors_getPermalinkParts(state);
4444  
4445    if (!permalinkParts) {
4446      return null;
4447    }
4448  
4449    var prefix = permalinkParts.prefix,
4450        postName = permalinkParts.postName,
4451        suffix = permalinkParts.suffix;
4452  
4453    if (selectors_isPermalinkEditable(state)) {
4454      return prefix + postName + suffix;
4455    }
4456  
4457    return prefix;
4458  }
4459  /**
4460   * Returns the permalink for a post, split into it's three parts: the prefix,
4461   * the postName, and the suffix.
4462   *
4463   * @param {Object} state Editor state.
4464   *
4465   * @return {Object} An object containing the prefix, postName, and suffix for
4466   *                  the permalink, or null if the post is not viewable.
4467   */
4468  
4469  function selectors_getPermalinkParts(state) {
4470    var permalinkTemplate = selectors_getEditedPostAttribute(state, 'permalink_template');
4471  
4472    if (!permalinkTemplate) {
4473      return null;
4474    }
4475  
4476    var postName = selectors_getEditedPostAttribute(state, 'slug') || selectors_getEditedPostAttribute(state, 'generated_slug');
4477  
4478    var _permalinkTemplate$sp = permalinkTemplate.split(PERMALINK_POSTNAME_REGEX),
4479        _permalinkTemplate$sp2 = Object(slicedToArray["a" /* default */])(_permalinkTemplate$sp, 2),
4480        prefix = _permalinkTemplate$sp2[0],
4481        suffix = _permalinkTemplate$sp2[1];
4482  
4483    return {
4484      prefix: prefix,
4485      postName: postName,
4486      suffix: suffix
4487    };
4488  }
4489  /**
4490   * Returns true if an optimistic transaction is pending commit, for which the
4491   * before state satisfies the given predicate function.
4492   *
4493   * @param {Object}   state     Editor state.
4494   * @param {Function} predicate Function given state, returning true if match.
4495   *
4496   * @return {boolean} Whether predicate matches for some history.
4497   */
4498  
4499  function inSomeHistory(state, predicate) {
4500    var optimist = state.optimist; // In recursion, optimist state won't exist. Assume exhausted options.
4501  
4502    if (!optimist) {
4503      return false;
4504    }
4505  
4506    return optimist.some(function (_ref) {
4507      var beforeState = _ref.beforeState;
4508      return beforeState && predicate(beforeState);
4509    });
4510  }
4511  /**
4512   * Returns whether the post is locked.
4513   *
4514   * @param {Object} state Global application state.
4515   *
4516   * @return {boolean} Is locked.
4517   */
4518  
4519  function isPostLocked(state) {
4520    return state.postLock.isLocked;
4521  }
4522  /**
4523   * Returns whether post saving is locked.
4524   *
4525   * @param {Object} state Global application state.
4526   *
4527   * @return {boolean} Is locked.
4528   */
4529  
4530  function selectors_isPostSavingLocked(state) {
4531    return Object.keys(state.postSavingLock).length > 0;
4532  }
4533  /**
4534   * Returns whether post autosaving is locked.
4535   *
4536   * @param {Object} state Global application state.
4537   *
4538   * @return {boolean} Is locked.
4539   */
4540  
4541  function isPostAutosavingLocked(state) {
4542    return Object.keys(state.postAutosavingLock).length > 0;
4543  }
4544  /**
4545   * Returns whether the edition of the post has been taken over.
4546   *
4547   * @param {Object} state Global application state.
4548   *
4549   * @return {boolean} Is post lock takeover.
4550   */
4551  
4552  function isPostLockTakeover(state) {
4553    return state.postLock.isTakeover;
4554  }
4555  /**
4556   * Returns details about the post lock user.
4557   *
4558   * @param {Object} state Global application state.
4559   *
4560   * @return {Object} A user object.
4561   */
4562  
4563  function getPostLockUser(state) {
4564    return state.postLock.user;
4565  }
4566  /**
4567   * Returns the active post lock.
4568   *
4569   * @param {Object} state Global application state.
4570   *
4571   * @return {Object} The lock object.
4572   */
4573  
4574  function getActivePostLock(state) {
4575    return state.postLock.activePostLock;
4576  }
4577  /**
4578   * Returns whether or not the user has the unfiltered_html capability.
4579   *
4580   * @param {Object} state Editor state.
4581   *
4582   * @return {boolean} Whether the user can or can't post unfiltered HTML.
4583   */
4584  
4585  function selectors_canUserUseUnfilteredHTML(state) {
4586    return Object(external_this_lodash_["has"])(selectors_getCurrentPost(state), ['_links', 'wp:action-unfiltered-html']);
4587  }
4588  /**
4589   * Returns whether the pre-publish panel should be shown
4590   * or skipped when the user clicks the "publish" button.
4591   *
4592   * @param {Object} state Global application state.
4593   *
4594   * @return {boolean} Whether the pre-publish panel should be shown or not.
4595   */
4596  
4597  function selectors_isPublishSidebarEnabled(state) {
4598    if (state.preferences.hasOwnProperty('isPublishSidebarEnabled')) {
4599      return state.preferences.isPublishSidebarEnabled;
4600    }
4601  
4602    return PREFERENCES_DEFAULTS.isPublishSidebarEnabled;
4603  }
4604  /**
4605   * Return the current block list.
4606   *
4607   * @param {Object} state
4608   * @return {Array} Block list.
4609   */
4610  
4611  function selectors_getEditorBlocks(state) {
4612    return selectors_getEditedPostAttribute(state, 'blocks') || EMPTY_ARRAY;
4613  }
4614  /**
4615   * A block selection object.
4616   *
4617   * @typedef {Object} WPBlockSelection
4618   *
4619   * @property {string} clientId     A block client ID.
4620   * @property {string} attributeKey A block attribute key.
4621   * @property {number} offset       An attribute value offset, based on the rich
4622   *                                 text value. See `wp.richText.create`.
4623   */
4624  
4625  /**
4626   * Returns the current selection start.
4627   *
4628   * @param {Object} state
4629   * @return {WPBlockSelection} The selection start.
4630   */
4631  
4632  function selectors_getEditorSelectionStart(state) {
4633    return selectors_getEditedPostAttribute(state, 'selectionStart');
4634  }
4635  /**
4636   * Returns the current selection end.
4637   *
4638   * @param {Object} state
4639   * @return {WPBlockSelection} The selection end.
4640   */
4641  
4642  function selectors_getEditorSelectionEnd(state) {
4643    return selectors_getEditedPostAttribute(state, 'selectionEnd');
4644  }
4645  /**
4646   * Is the editor ready
4647   *
4648   * @param {Object} state
4649   * @return {boolean} is Ready.
4650   */
4651  
4652  function __unstableIsEditorReady(state) {
4653    return state.isReady;
4654  }
4655  /**
4656   * Returns the post editor settings.
4657   *
4658   * @param {Object} state Editor state.
4659   *
4660   * @return {Object} The editor settings object.
4661   */
4662  
4663  function selectors_getEditorSettings(state) {
4664    return state.editorSettings;
4665  }
4666  /*
4667   * Backward compatibility
4668   */
4669  
4670  function getBlockEditorSelector(name) {
4671    return Object(external_this_wp_data_["createRegistrySelector"])(function (select) {
4672      return function (state) {
4673        var _select;
4674  
4675        external_this_wp_deprecated_default()('`wp.data.select( \'core/editor\' ).' + name + '`', {
4676          alternative: '`wp.data.select( \'core/block-editor\' ).' + name + '`'
4677        });
4678  
4679        for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
4680          args[_key - 1] = arguments[_key];
4681        }
4682  
4683        return (_select = select('core/block-editor'))[name].apply(_select, args);
4684      };
4685    });
4686  }
4687  /**
4688   * @see getBlockName in core/block-editor store.
4689   */
4690  
4691  
4692  var selectors_getBlockName = getBlockEditorSelector('getBlockName');
4693  /**
4694   * @see isBlockValid in core/block-editor store.
4695   */
4696  
4697  var isBlockValid = getBlockEditorSelector('isBlockValid');
4698  /**
4699   * @see getBlockAttributes in core/block-editor store.
4700   */
4701  
4702  var getBlockAttributes = getBlockEditorSelector('getBlockAttributes');
4703  /**
4704   * @see getBlock in core/block-editor store.
4705   */
4706  
4707  var selectors_getBlock = getBlockEditorSelector('getBlock');
4708  /**
4709   * @see getBlocks in core/block-editor store.
4710   */
4711  
4712  var selectors_getBlocks = getBlockEditorSelector('getBlocks');
4713  /**
4714   * @see __unstableGetBlockWithoutInnerBlocks in core/block-editor store.
4715   */
4716  
4717  var __unstableGetBlockWithoutInnerBlocks = getBlockEditorSelector('__unstableGetBlockWithoutInnerBlocks');
4718  /**
4719   * @see getClientIdsOfDescendants in core/block-editor store.
4720   */
4721  
4722  var getClientIdsOfDescendants = getBlockEditorSelector('getClientIdsOfDescendants');
4723  /**
4724   * @see getClientIdsWithDescendants in core/block-editor store.
4725   */
4726  
4727  var getClientIdsWithDescendants = getBlockEditorSelector('getClientIdsWithDescendants');
4728  /**
4729   * @see getGlobalBlockCount in core/block-editor store.
4730   */
4731  
4732  var getGlobalBlockCount = getBlockEditorSelector('getGlobalBlockCount');
4733  /**
4734   * @see getBlocksByClientId in core/block-editor store.
4735   */
4736  
4737  var selectors_getBlocksByClientId = getBlockEditorSelector('getBlocksByClientId');
4738  /**
4739   * @see getBlockCount in core/block-editor store.
4740   */
4741  
4742  var getBlockCount = getBlockEditorSelector('getBlockCount');
4743  /**
4744   * @see getBlockSelectionStart in core/block-editor store.
4745   */
4746  
4747  var getBlockSelectionStart = getBlockEditorSelector('getBlockSelectionStart');
4748  /**
4749   * @see getBlockSelectionEnd in core/block-editor store.
4750   */
4751  
4752  var getBlockSelectionEnd = getBlockEditorSelector('getBlockSelectionEnd');
4753  /**
4754   * @see getSelectedBlockCount in core/block-editor store.
4755   */
4756  
4757  var getSelectedBlockCount = getBlockEditorSelector('getSelectedBlockCount');
4758  /**
4759   * @see hasSelectedBlock in core/block-editor store.
4760   */
4761  
4762  var hasSelectedBlock = getBlockEditorSelector('hasSelectedBlock');
4763  /**
4764   * @see getSelectedBlockClientId in core/block-editor store.
4765   */
4766  
4767  var selectors_getSelectedBlockClientId = getBlockEditorSelector('getSelectedBlockClientId');
4768  /**
4769   * @see getSelectedBlock in core/block-editor store.
4770   */
4771  
4772  var getSelectedBlock = getBlockEditorSelector('getSelectedBlock');
4773  /**
4774   * @see getBlockRootClientId in core/block-editor store.
4775   */
4776  
4777  var getBlockRootClientId = getBlockEditorSelector('getBlockRootClientId');
4778  /**
4779   * @see getBlockHierarchyRootClientId in core/block-editor store.
4780   */
4781  
4782  var getBlockHierarchyRootClientId = getBlockEditorSelector('getBlockHierarchyRootClientId');
4783  /**
4784   * @see getAdjacentBlockClientId in core/block-editor store.
4785   */
4786  
4787  var getAdjacentBlockClientId = getBlockEditorSelector('getAdjacentBlockClientId');
4788  /**
4789   * @see getPreviousBlockClientId in core/block-editor store.
4790   */
4791  
4792  var getPreviousBlockClientId = getBlockEditorSelector('getPreviousBlockClientId');
4793  /**
4794   * @see getNextBlockClientId in core/block-editor store.
4795   */
4796  
4797  var getNextBlockClientId = getBlockEditorSelector('getNextBlockClientId');
4798  /**
4799   * @see getSelectedBlocksInitialCaretPosition in core/block-editor store.
4800   */
4801  
4802  var getSelectedBlocksInitialCaretPosition = getBlockEditorSelector('getSelectedBlocksInitialCaretPosition');
4803  /**
4804   * @see getMultiSelectedBlockClientIds in core/block-editor store.
4805   */
4806  
4807  var getMultiSelectedBlockClientIds = getBlockEditorSelector('getMultiSelectedBlockClientIds');
4808  /**
4809   * @see getMultiSelectedBlocks in core/block-editor store.
4810   */
4811  
4812  var getMultiSelectedBlocks = getBlockEditorSelector('getMultiSelectedBlocks');
4813  /**
4814   * @see getFirstMultiSelectedBlockClientId in core/block-editor store.
4815   */
4816  
4817  var getFirstMultiSelectedBlockClientId = getBlockEditorSelector('getFirstMultiSelectedBlockClientId');
4818  /**
4819   * @see getLastMultiSelectedBlockClientId in core/block-editor store.
4820   */
4821  
4822  var getLastMultiSelectedBlockClientId = getBlockEditorSelector('getLastMultiSelectedBlockClientId');
4823  /**
4824   * @see isFirstMultiSelectedBlock in core/block-editor store.
4825   */
4826  
4827  var isFirstMultiSelectedBlock = getBlockEditorSelector('isFirstMultiSelectedBlock');
4828  /**
4829   * @see isBlockMultiSelected in core/block-editor store.
4830   */
4831  
4832  var isBlockMultiSelected = getBlockEditorSelector('isBlockMultiSelected');
4833  /**
4834   * @see isAncestorMultiSelected in core/block-editor store.
4835   */
4836  
4837  var isAncestorMultiSelected = getBlockEditorSelector('isAncestorMultiSelected');
4838  /**
4839   * @see getMultiSelectedBlocksStartClientId in core/block-editor store.
4840   */
4841  
4842  var getMultiSelectedBlocksStartClientId = getBlockEditorSelector('getMultiSelectedBlocksStartClientId');
4843  /**
4844   * @see getMultiSelectedBlocksEndClientId in core/block-editor store.
4845   */
4846  
4847  var getMultiSelectedBlocksEndClientId = getBlockEditorSelector('getMultiSelectedBlocksEndClientId');
4848  /**
4849   * @see getBlockOrder in core/block-editor store.
4850   */
4851  
4852  var getBlockOrder = getBlockEditorSelector('getBlockOrder');
4853  /**
4854   * @see getBlockIndex in core/block-editor store.
4855   */
4856  
4857  var getBlockIndex = getBlockEditorSelector('getBlockIndex');
4858  /**
4859   * @see isBlockSelected in core/block-editor store.
4860   */
4861  
4862  var isBlockSelected = getBlockEditorSelector('isBlockSelected');
4863  /**
4864   * @see hasSelectedInnerBlock in core/block-editor store.
4865   */
4866  
4867  var hasSelectedInnerBlock = getBlockEditorSelector('hasSelectedInnerBlock');
4868  /**
4869   * @see isBlockWithinSelection in core/block-editor store.
4870   */
4871  
4872  var isBlockWithinSelection = getBlockEditorSelector('isBlockWithinSelection');
4873  /**
4874   * @see hasMultiSelection in core/block-editor store.
4875   */
4876  
4877  var hasMultiSelection = getBlockEditorSelector('hasMultiSelection');
4878  /**
4879   * @see isMultiSelecting in core/block-editor store.
4880   */
4881  
4882  var isMultiSelecting = getBlockEditorSelector('isMultiSelecting');
4883  /**
4884   * @see isSelectionEnabled in core/block-editor store.
4885   */
4886  
4887  var isSelectionEnabled = getBlockEditorSelector('isSelectionEnabled');
4888  /**
4889   * @see getBlockMode in core/block-editor store.
4890   */
4891  
4892  var getBlockMode = getBlockEditorSelector('getBlockMode');
4893  /**
4894   * @see isTyping in core/block-editor store.
4895   */
4896  
4897  var isTyping = getBlockEditorSelector('isTyping');
4898  /**
4899   * @see isCaretWithinFormattedText in core/block-editor store.
4900   */
4901  
4902  var isCaretWithinFormattedText = getBlockEditorSelector('isCaretWithinFormattedText');
4903  /**
4904   * @see getBlockInsertionPoint in core/block-editor store.
4905   */
4906  
4907  var getBlockInsertionPoint = getBlockEditorSelector('getBlockInsertionPoint');
4908  /**
4909   * @see isBlockInsertionPointVisible in core/block-editor store.
4910   */
4911  
4912  var isBlockInsertionPointVisible = getBlockEditorSelector('isBlockInsertionPointVisible');
4913  /**
4914   * @see isValidTemplate in core/block-editor store.
4915   */
4916  
4917  var isValidTemplate = getBlockEditorSelector('isValidTemplate');
4918  /**
4919   * @see getTemplate in core/block-editor store.
4920   */
4921  
4922  var getTemplate = getBlockEditorSelector('getTemplate');
4923  /**
4924   * @see getTemplateLock in core/block-editor store.
4925   */
4926  
4927  var getTemplateLock = getBlockEditorSelector('getTemplateLock');
4928  /**
4929   * @see canInsertBlockType in core/block-editor store.
4930   */
4931  
4932  var selectors_canInsertBlockType = getBlockEditorSelector('canInsertBlockType');
4933  /**
4934   * @see getInserterItems in core/block-editor store.
4935   */
4936  
4937  var selectors_getInserterItems = getBlockEditorSelector('getInserterItems');
4938  /**
4939   * @see hasInserterItems in core/block-editor store.
4940   */
4941  
4942  var hasInserterItems = getBlockEditorSelector('hasInserterItems');
4943  /**
4944   * @see getBlockListSettings in core/block-editor store.
4945   */
4946  
4947  var getBlockListSettings = getBlockEditorSelector('getBlockListSettings');
4948  
4949  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/effects/reusable-blocks.js
4950  
4951  
4952  
4953  
4954  /**
4955   * External dependencies
4956   */
4957  
4958  
4959  /**
4960   * WordPress dependencies
4961   */
4962  
4963  
4964  
4965   // TODO: Ideally this would be the only dispatch in scope. This requires either
4966  // refactoring editor actions to yielded controls, or replacing direct dispatch
4967  // on the editor store with action creators (e.g. `REMOVE_REUSABLE_BLOCK`).
4968  
4969  
4970  /**
4971   * Internal dependencies
4972   */
4973  
4974  
4975  
4976  /**
4977   * Module Constants
4978   */
4979  
4980  var REUSABLE_BLOCK_NOTICE_ID = 'REUSABLE_BLOCK_NOTICE_ID';
4981  /**
4982   * Fetch Reusable Blocks Effect Handler.
4983   *
4984   * @param {Object} action  action object.
4985   * @param {Object} store   Redux Store.
4986   */
4987  
4988  var fetchReusableBlocks =
4989  /*#__PURE__*/
4990  function () {
4991    var _ref = Object(asyncToGenerator["a" /* default */])(
4992    /*#__PURE__*/
4993    external_this_regeneratorRuntime_default.a.mark(function _callee(action, store) {
4994      var id, dispatch, postType, posts, results;
4995      return external_this_regeneratorRuntime_default.a.wrap(function _callee$(_context) {
4996        while (1) {
4997          switch (_context.prev = _context.next) {
4998            case 0:
4999              id = action.id;
5000              dispatch = store.dispatch; // TODO: these are potentially undefined, this fix is in place
5001              // until there is a filter to not use reusable blocks if undefined
5002  
5003              _context.next = 4;
5004              return external_this_wp_apiFetch_default()({
5005                path: '/wp/v2/types/wp_block'
5006              });
5007  
5008            case 4:
5009              postType = _context.sent;
5010  
5011              if (postType) {
5012                _context.next = 7;
5013                break;
5014              }
5015  
5016              return _context.abrupt("return");
5017  
5018            case 7:
5019              _context.prev = 7;
5020  
5021              if (!id) {
5022                _context.next = 15;
5023                break;
5024              }
5025  
5026              _context.next = 11;
5027              return external_this_wp_apiFetch_default()({
5028                path: "/wp/v2/".concat(postType.rest_base, "/").concat(id)
5029              });
5030  
5031            case 11:
5032              _context.t0 = _context.sent;
5033              posts = [_context.t0];
5034              _context.next = 18;
5035              break;
5036  
5037            case 15:
5038              _context.next = 17;
5039              return external_this_wp_apiFetch_default()({
5040                path: "/wp/v2/".concat(postType.rest_base, "?per_page=-1")
5041              });
5042  
5043            case 17:
5044              posts = _context.sent;
5045  
5046            case 18:
5047              results = Object(external_this_lodash_["compact"])(Object(external_this_lodash_["map"])(posts, function (post) {
5048                if (post.status !== 'publish' || post.content.protected) {
5049                  return null;
5050                }
5051  
5052                return Object(objectSpread["a" /* default */])({}, post, {
5053                  content: post.content.raw,
5054                  title: post.title.raw
5055                });
5056              }));
5057  
5058              if (results.length) {
5059                dispatch(__experimentalReceiveReusableBlocks(results));
5060              }
5061  
5062              dispatch({
5063                type: 'FETCH_REUSABLE_BLOCKS_SUCCESS',
5064                id: id
5065              });
5066              _context.next = 26;
5067              break;
5068  
5069            case 23:
5070              _context.prev = 23;
5071              _context.t1 = _context["catch"](7);
5072              dispatch({
5073                type: 'FETCH_REUSABLE_BLOCKS_FAILURE',
5074                id: id,
5075                error: _context.t1
5076              });
5077  
5078            case 26:
5079            case "end":
5080              return _context.stop();
5081          }
5082        }
5083      }, _callee, null, [[7, 23]]);
5084    }));
5085  
5086    return function fetchReusableBlocks(_x, _x2) {
5087      return _ref.apply(this, arguments);
5088    };
5089  }();
5090  /**
5091   * Save Reusable Blocks Effect Handler.
5092   *
5093   * @param {Object} action  action object.
5094   * @param {Object} store   Redux Store.
5095   */
5096  
5097  var saveReusableBlocks =
5098  /*#__PURE__*/
5099  function () {
5100    var _ref2 = Object(asyncToGenerator["a" /* default */])(
5101    /*#__PURE__*/
5102    external_this_regeneratorRuntime_default.a.mark(function _callee2(action, store) {
5103      var postType, id, dispatch, state, _getReusableBlock, title, content, isTemporary, data, path, method, updatedReusableBlock, message;
5104  
5105      return external_this_regeneratorRuntime_default.a.wrap(function _callee2$(_context2) {
5106        while (1) {
5107          switch (_context2.prev = _context2.next) {
5108            case 0:
5109              _context2.next = 2;
5110              return external_this_wp_apiFetch_default()({
5111                path: '/wp/v2/types/wp_block'
5112              });
5113  
5114            case 2:
5115              postType = _context2.sent;
5116  
5117              if (postType) {
5118                _context2.next = 5;
5119                break;
5120              }
5121  
5122              return _context2.abrupt("return");
5123  
5124            case 5:
5125              id = action.id;
5126              dispatch = store.dispatch;
5127              state = store.getState();
5128              _getReusableBlock = __experimentalGetReusableBlock(state, id), title = _getReusableBlock.title, content = _getReusableBlock.content, isTemporary = _getReusableBlock.isTemporary;
5129              data = isTemporary ? {
5130                title: title,
5131                content: content,
5132                status: 'publish'
5133              } : {
5134                id: id,
5135                title: title,
5136                content: content,
5137                status: 'publish'
5138              };
5139              path = isTemporary ? "/wp/v2/".concat(postType.rest_base) : "/wp/v2/".concat(postType.rest_base, "/").concat(id);
5140              method = isTemporary ? 'POST' : 'PUT';
5141              _context2.prev = 12;
5142              _context2.next = 15;
5143              return external_this_wp_apiFetch_default()({
5144                path: path,
5145                data: data,
5146                method: method
5147              });
5148  
5149            case 15:
5150              updatedReusableBlock = _context2.sent;
5151              dispatch({
5152                type: 'SAVE_REUSABLE_BLOCK_SUCCESS',
5153                updatedId: updatedReusableBlock.id,
5154                id: id
5155              });
5156              message = isTemporary ? Object(external_this_wp_i18n_["__"])('Block created.') : Object(external_this_wp_i18n_["__"])('Block updated.');
5157              Object(external_this_wp_data_["dispatch"])('core/notices').createSuccessNotice(message, {
5158                id: REUSABLE_BLOCK_NOTICE_ID,
5159                type: 'snackbar'
5160              });
5161  
5162              Object(external_this_wp_data_["dispatch"])('core/block-editor').__unstableSaveReusableBlock(id, updatedReusableBlock.id);
5163  
5164              _context2.next = 26;
5165              break;
5166  
5167            case 22:
5168              _context2.prev = 22;
5169              _context2.t0 = _context2["catch"](12);
5170              dispatch({
5171                type: 'SAVE_REUSABLE_BLOCK_FAILURE',
5172                id: id
5173              });
5174              Object(external_this_wp_data_["dispatch"])('core/notices').createErrorNotice(_context2.t0.message, {
5175                id: REUSABLE_BLOCK_NOTICE_ID
5176              });
5177  
5178            case 26:
5179            case "end":
5180              return _context2.stop();
5181          }
5182        }
5183      }, _callee2, null, [[12, 22]]);
5184    }));
5185  
5186    return function saveReusableBlocks(_x3, _x4) {
5187      return _ref2.apply(this, arguments);
5188    };
5189  }();
5190  /**
5191   * Delete Reusable Blocks Effect Handler.
5192   *
5193   * @param {Object} action  action object.
5194   * @param {Object} store   Redux Store.
5195   */
5196  
5197  var deleteReusableBlocks =
5198  /*#__PURE__*/
5199  function () {
5200    var _ref3 = Object(asyncToGenerator["a" /* default */])(
5201    /*#__PURE__*/
5202    external_this_regeneratorRuntime_default.a.mark(function _callee3(action, store) {
5203      var postType, id, getState, dispatch, reusableBlock, allBlocks, associatedBlocks, associatedBlockClientIds, transactionId, message;
5204      return external_this_regeneratorRuntime_default.a.wrap(function _callee3$(_context3) {
5205        while (1) {
5206          switch (_context3.prev = _context3.next) {
5207            case 0:
5208              _context3.next = 2;
5209              return external_this_wp_apiFetch_default()({
5210                path: '/wp/v2/types/wp_block'
5211              });
5212  
5213            case 2:
5214              postType = _context3.sent;
5215  
5216              if (postType) {
5217                _context3.next = 5;
5218                break;
5219              }
5220  
5221              return _context3.abrupt("return");
5222  
5223            case 5:
5224              id = action.id;
5225              getState = store.getState, dispatch = store.dispatch; // Don't allow a reusable block with a temporary ID to be deleted
5226  
5227              reusableBlock = __experimentalGetReusableBlock(getState(), id);
5228  
5229              if (!(!reusableBlock || reusableBlock.isTemporary)) {
5230                _context3.next = 10;
5231                break;
5232              }
5233  
5234              return _context3.abrupt("return");
5235  
5236            case 10:
5237              // Remove any other blocks that reference this reusable block
5238              allBlocks = Object(external_this_wp_data_["select"])('core/block-editor').getBlocks();
5239              associatedBlocks = allBlocks.filter(function (block) {
5240                return Object(external_this_wp_blocks_["isReusableBlock"])(block) && block.attributes.ref === id;
5241              });
5242              associatedBlockClientIds = associatedBlocks.map(function (block) {
5243                return block.clientId;
5244              });
5245              transactionId = Object(external_this_lodash_["uniqueId"])();
5246              dispatch({
5247                type: 'REMOVE_REUSABLE_BLOCK',
5248                id: id,
5249                optimist: {
5250                  type: redux_optimist["BEGIN"],
5251                  id: transactionId
5252                }
5253              }); // Remove the parsed block.
5254  
5255              if (associatedBlockClientIds.length) {
5256                Object(external_this_wp_data_["dispatch"])('core/block-editor').removeBlocks(associatedBlockClientIds);
5257              }
5258  
5259              _context3.prev = 16;
5260              _context3.next = 19;
5261              return external_this_wp_apiFetch_default()({
5262                path: "/wp/v2/".concat(postType.rest_base, "/").concat(id),
5263                method: 'DELETE'
5264              });
5265  
5266            case 19:
5267              dispatch({
5268                type: 'DELETE_REUSABLE_BLOCK_SUCCESS',
5269                id: id,
5270                optimist: {
5271                  type: redux_optimist["COMMIT"],
5272                  id: transactionId
5273                }
5274              });
5275              message = Object(external_this_wp_i18n_["__"])('Block deleted.');
5276              Object(external_this_wp_data_["dispatch"])('core/notices').createSuccessNotice(message, {
5277                id: REUSABLE_BLOCK_NOTICE_ID,
5278                type: 'snackbar'
5279              });
5280              _context3.next = 28;
5281              break;
5282  
5283            case 24:
5284              _context3.prev = 24;
5285              _context3.t0 = _context3["catch"](16);
5286              dispatch({
5287                type: 'DELETE_REUSABLE_BLOCK_FAILURE',
5288                id: id,
5289                optimist: {
5290                  type: redux_optimist["REVERT"],
5291                  id: transactionId
5292                }
5293              });
5294              Object(external_this_wp_data_["dispatch"])('core/notices').createErrorNotice(_context3.t0.message, {
5295                id: REUSABLE_BLOCK_NOTICE_ID
5296              });
5297  
5298            case 28:
5299            case "end":
5300              return _context3.stop();
5301          }
5302        }
5303      }, _callee3, null, [[16, 24]]);
5304    }));
5305  
5306    return function deleteReusableBlocks(_x5, _x6) {
5307      return _ref3.apply(this, arguments);
5308    };
5309  }();
5310  /**
5311   * Convert a reusable block to a static block effect handler
5312   *
5313   * @param {Object} action  action object.
5314   * @param {Object} store   Redux Store.
5315   */
5316  
5317  var reusable_blocks_convertBlockToStatic = function convertBlockToStatic(action, store) {
5318    var state = store.getState();
5319    var oldBlock = Object(external_this_wp_data_["select"])('core/block-editor').getBlock(action.clientId);
5320    var reusableBlock = __experimentalGetReusableBlock(state, oldBlock.attributes.ref);
5321    var newBlocks = Object(external_this_wp_blocks_["parse"])(reusableBlock.content);
5322    Object(external_this_wp_data_["dispatch"])('core/block-editor').replaceBlocks(oldBlock.clientId, newBlocks);
5323  };
5324  /**
5325   * Convert a static block to a reusable block effect handler
5326   *
5327   * @param {Object} action  action object.
5328   * @param {Object} store   Redux Store.
5329   */
5330  
5331  var reusable_blocks_convertBlockToReusable = function convertBlockToReusable(action, store) {
5332    var dispatch = store.dispatch;
5333    var reusableBlock = {
5334      id: Object(external_this_lodash_["uniqueId"])('reusable'),
5335      title: Object(external_this_wp_i18n_["__"])('Untitled Reusable Block'),
5336      content: Object(external_this_wp_blocks_["serialize"])(Object(external_this_wp_data_["select"])('core/block-editor').getBlocksByClientId(action.clientIds))
5337    };
5338    dispatch(__experimentalReceiveReusableBlocks([reusableBlock]));
5339    dispatch(__experimentalSaveReusableBlock(reusableBlock.id));
5340    Object(external_this_wp_data_["dispatch"])('core/block-editor').replaceBlocks(action.clientIds, Object(external_this_wp_blocks_["createBlock"])('core/block', {
5341      ref: reusableBlock.id
5342    }));
5343  };
5344  
5345  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/effects.js
5346  /**
5347   * Internal dependencies
5348   */
5349  
5350  /* harmony default export */ var effects = ({
5351    FETCH_REUSABLE_BLOCKS: function FETCH_REUSABLE_BLOCKS(action, store) {
5352      fetchReusableBlocks(action, store);
5353    },
5354    SAVE_REUSABLE_BLOCK: function SAVE_REUSABLE_BLOCK(action, store) {
5355      saveReusableBlocks(action, store);
5356    },
5357    DELETE_REUSABLE_BLOCK: function DELETE_REUSABLE_BLOCK(action, store) {
5358      deleteReusableBlocks(action, store);
5359    },
5360    CONVERT_BLOCK_TO_STATIC: reusable_blocks_convertBlockToStatic,
5361    CONVERT_BLOCK_TO_REUSABLE: reusable_blocks_convertBlockToReusable
5362  });
5363  
5364  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/middlewares.js
5365  /**
5366   * External dependencies
5367   */
5368  
5369  /**
5370   * Internal dependencies
5371   */
5372  
5373  
5374  /**
5375   * Applies the custom middlewares used specifically in the editor module.
5376   *
5377   * @param {Object} store Store Object.
5378   *
5379   * @return {Object} Update Store Object.
5380   */
5381  
5382  function applyMiddlewares(store) {
5383    var enhancedDispatch = function enhancedDispatch() {
5384      throw new Error('Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
5385    };
5386  
5387    var middlewareAPI = {
5388      getState: store.getState,
5389      dispatch: function dispatch() {
5390        return enhancedDispatch.apply(void 0, arguments);
5391      }
5392    };
5393    enhancedDispatch = refx_default()(effects)(middlewareAPI)(store.dispatch);
5394    store.dispatch = enhancedDispatch;
5395    return store;
5396  }
5397  
5398  /* harmony default export */ var middlewares = (applyMiddlewares);
5399  
5400  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/controls.js
5401  /**
5402   * WordPress dependencies
5403   */
5404  
5405  /**
5406   * Returns a control descriptor signalling to subscribe to the registry and
5407   * resolve the control promise only when the next state change occurs.
5408   *
5409   * @return {Object} Control descriptor.
5410   */
5411  
5412  function awaitNextStateChange() {
5413    return {
5414      type: 'AWAIT_NEXT_STATE_CHANGE'
5415    };
5416  }
5417  /**
5418   * Returns a control descriptor signalling to resolve with the current data
5419   * registry.
5420   *
5421   * @return {Object} Control descriptor.
5422   */
5423  
5424  function getRegistry() {
5425    return {
5426      type: 'GET_REGISTRY'
5427    };
5428  }
5429  /**
5430   * Function returning a sessionStorage key to set or retrieve a given post's
5431   * automatic session backup.
5432   *
5433   * Keys are crucially prefixed with 'wp-autosave-' so that wp-login.php's
5434   * `loggedout` handler can clear sessionStorage of any user-private content.
5435   *
5436   * @see https://github.com/WordPress/wordpress-develop/blob/6dad32d2aed47e6c0cf2aee8410645f6d7aba6bd/src/wp-login.php#L103
5437   *
5438   * @param {string} postId  Post ID.
5439   * @return {string}        sessionStorage key
5440   */
5441  
5442  function postKey(postId) {
5443    return "wp-autosave-block-editor-post-".concat(postId);
5444  }
5445  
5446  function localAutosaveGet(postId) {
5447    return window.sessionStorage.getItem(postKey(postId));
5448  }
5449  function localAutosaveSet(postId, title, content, excerpt) {
5450    window.sessionStorage.setItem(postKey(postId), JSON.stringify({
5451      post_title: title,
5452      content: content,
5453      excerpt: excerpt
5454    }));
5455  }
5456  function localAutosaveClear(postId) {
5457    window.sessionStorage.removeItem(postKey(postId));
5458  }
5459  var controls = {
5460    AWAIT_NEXT_STATE_CHANGE: Object(external_this_wp_data_["createRegistryControl"])(function (registry) {
5461      return function () {
5462        return new Promise(function (resolve) {
5463          var unsubscribe = registry.subscribe(function () {
5464            unsubscribe();
5465            resolve();
5466          });
5467        });
5468      };
5469    }),
5470    GET_REGISTRY: Object(external_this_wp_data_["createRegistryControl"])(function (registry) {
5471      return function () {
5472        return registry;
5473      };
5474    }),
5475    LOCAL_AUTOSAVE_SET: function LOCAL_AUTOSAVE_SET(_ref) {
5476      var postId = _ref.postId,
5477          title = _ref.title,
5478          content = _ref.content,
5479          excerpt = _ref.excerpt;
5480      localAutosaveSet(postId, title, content, excerpt);
5481    }
5482  };
5483  /* harmony default export */ var store_controls = (controls);
5484  
5485  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/index.js
5486  
5487  
5488  /**
5489   * WordPress dependencies
5490   */
5491  
5492  
5493  /**
5494   * Internal dependencies
5495   */
5496  
5497  
5498  
5499  
5500  
5501  
5502  
5503  /**
5504   * Post editor data store configuration.
5505   *
5506   * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#registerStore
5507   *
5508   * @type {Object}
5509   */
5510  
5511  var storeConfig = {
5512    reducer: reducer,
5513    selectors: selectors_namespaceObject,
5514    actions: actions_namespaceObject,
5515    controls: Object(objectSpread["a" /* default */])({}, external_this_wp_dataControls_["controls"], store_controls)
5516  };
5517  var store_store = Object(external_this_wp_data_["registerStore"])(STORE_KEY, Object(objectSpread["a" /* default */])({}, storeConfig, {
5518    persist: ['preferences']
5519  }));
5520  middlewares(store_store);
5521  /* harmony default export */ var build_module_store = (store_store);
5522  
5523  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
5524  var esm_extends = __webpack_require__(14);
5525  
5526  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
5527  var objectWithoutProperties = __webpack_require__(21);
5528  
5529  // EXTERNAL MODULE: external {"this":["wp","element"]}
5530  var external_this_wp_element_ = __webpack_require__(0);
5531  
5532  // EXTERNAL MODULE: external {"this":["wp","compose"]}
5533  var external_this_wp_compose_ = __webpack_require__(8);
5534  
5535  // EXTERNAL MODULE: external {"this":["wp","hooks"]}
5536  var external_this_wp_hooks_ = __webpack_require__(27);
5537  
5538  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/hooks/custom-sources-backwards-compatibility.js
5539  
5540  
5541  
5542  
5543  
5544  
5545  /**
5546   * External dependencies
5547   */
5548  
5549  /**
5550   * WordPress dependencies
5551   */
5552  
5553  
5554  
5555  
5556  
5557  
5558  /** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */
5559  
5560  /** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */
5561  
5562  /**
5563   * Object whose keys are the names of block attributes, where each value
5564   * represents the meta key to which the block attribute is intended to save.
5565   *
5566   * @see https://developer.wordpress.org/reference/functions/register_meta/
5567   *
5568   * @typedef {Object<string,string>} WPMetaAttributeMapping
5569   */
5570  
5571  /**
5572   * Given a mapping of attribute names (meta source attributes) to their
5573   * associated meta key, returns a higher order component that overrides its
5574   * `attributes` and `setAttributes` props to sync any changes with the edited
5575   * post's meta keys.
5576   *
5577   * @param {WPMetaAttributeMapping} metaAttributes Meta attribute mapping.
5578   *
5579   * @return {WPHigherOrderComponent} Higher-order component.
5580   */
5581  
5582  var custom_sources_backwards_compatibility_createWithMetaAttributeSource = function createWithMetaAttributeSource(metaAttributes) {
5583    return Object(external_this_wp_compose_["createHigherOrderComponent"])(function (BlockEdit) {
5584      return function (_ref) {
5585        var attributes = _ref.attributes,
5586            _setAttributes = _ref.setAttributes,
5587            props = Object(objectWithoutProperties["a" /* default */])(_ref, ["attributes", "setAttributes"]);
5588  
5589        var postType = Object(external_this_wp_data_["useSelect"])(function (select) {
5590          return select('core/editor').getCurrentPostType();
5591        }, []);
5592  
5593        var _useEntityProp = Object(external_this_wp_coreData_["useEntityProp"])('postType', postType, 'meta'),
5594            _useEntityProp2 = Object(slicedToArray["a" /* default */])(_useEntityProp, 2),
5595            meta = _useEntityProp2[0],
5596            setMeta = _useEntityProp2[1];
5597  
5598        var mergedAttributes = Object(external_this_wp_element_["useMemo"])(function () {
5599          return Object(objectSpread["a" /* default */])({}, attributes, Object(external_this_lodash_["mapValues"])(metaAttributes, function (metaKey) {
5600            return meta[metaKey];
5601          }));
5602        }, [attributes, meta]);
5603        return Object(external_this_wp_element_["createElement"])(BlockEdit, Object(esm_extends["a" /* default */])({
5604          attributes: mergedAttributes,
5605          setAttributes: function setAttributes(nextAttributes) {
5606            var nextMeta = Object(external_this_lodash_["mapKeys"])( // Filter to intersection of keys between the updated
5607            // attributes and those with an associated meta key.
5608            Object(external_this_lodash_["pickBy"])(nextAttributes, function (value, key) {
5609              return metaAttributes[key];
5610            }), // Rename the keys to the expected meta key name.
5611            function (value, attributeKey) {
5612              return metaAttributes[attributeKey];
5613            });
5614  
5615            if (!Object(external_this_lodash_["isEmpty"])(nextMeta)) {
5616              setMeta(nextMeta);
5617            }
5618  
5619            _setAttributes(nextAttributes);
5620          }
5621        }, props));
5622      };
5623    }, 'withMetaAttributeSource');
5624  };
5625  /**
5626   * Filters a registered block's settings to enhance a block's `edit` component
5627   * to upgrade meta-sourced attributes to use the post's meta entity property.
5628   *
5629   * @param {WPBlockSettings} settings Registered block settings.
5630   *
5631   * @return {WPBlockSettings} Filtered block settings.
5632   */
5633  
5634  
5635  function shimAttributeSource(settings) {
5636    /** @type {WPMetaAttributeMapping} */
5637    var metaAttributes = Object(external_this_lodash_["mapValues"])(Object(external_this_lodash_["pickBy"])(settings.attributes, {
5638      source: 'meta'
5639    }), 'meta');
5640  
5641    if (!Object(external_this_lodash_["isEmpty"])(metaAttributes)) {
5642      settings.edit = custom_sources_backwards_compatibility_createWithMetaAttributeSource(metaAttributes)(settings.edit);
5643    }
5644  
5645    return settings;
5646  }
5647  
5648  Object(external_this_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/editor/custom-sources-backwards-compatibility/shim-attribute-source', shimAttributeSource);
5649  
5650  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/autocompleters/block.js
5651  
5652  
5653  
5654  /**
5655   * External dependencies
5656   */
5657  
5658  /**
5659   * WordPress dependencies
5660   */
5661  
5662  
5663  
5664  
5665  /** @typedef {import('@wordpress/block-editor').WPEditorInserterItem} WPEditorInserterItem */
5666  
5667  /** @typedef {import('@wordpress/components').WPCompleter} WPCompleter */
5668  
5669  /**
5670   * Returns the client ID of the parent where a newly inserted block would be
5671   * placed.
5672   *
5673   * @return {string} Client ID of the parent where a newly inserted block would
5674   *                  be placed.
5675   */
5676  
5677  function defaultGetBlockInsertionParentClientId() {
5678    return Object(external_this_wp_data_["select"])('core/block-editor').getBlockInsertionPoint().rootClientId;
5679  }
5680  /**
5681   * Returns the inserter items for the specified parent block.
5682   *
5683   * @param {string} rootClientId Client ID of the block for which to retrieve
5684   *                              inserter items.
5685   *
5686   * @return {Array<WPEditorInserterItem>} The inserter items for the specified
5687   *                                      parent.
5688   */
5689  
5690  
5691  function defaultGetInserterItems(rootClientId) {
5692    return Object(external_this_wp_data_["select"])('core/block-editor').getInserterItems(rootClientId);
5693  }
5694  /**
5695   * Returns the name of the currently selected block.
5696   *
5697   * @return {string?} The name of the currently selected block or `null` if no
5698   *                   block is selected.
5699   */
5700  
5701  
5702  function defaultGetSelectedBlockName() {
5703    var _select = Object(external_this_wp_data_["select"])('core/block-editor'),
5704        getSelectedBlockClientId = _select.getSelectedBlockClientId,
5705        getBlockName = _select.getBlockName;
5706  
5707    var selectedBlockClientId = getSelectedBlockClientId();
5708    return selectedBlockClientId ? getBlockName(selectedBlockClientId) : null;
5709  }
5710  /**
5711   * Triggers a fetch of reusable blocks, once.
5712   *
5713   * TODO: Reusable blocks fetching should be reimplemented as a core-data entity
5714   * resolver, not relying on `core/editor` (see #7119). The implementation here
5715   * is imperfect in that the options result will not await the completion of the
5716   * fetch request and thus will not include any reusable blocks. This has always
5717   * been true, but relied upon the fact the user would be delayed in typing an
5718   * autocompleter search query. Once implemented using resolvers, the status of
5719   * this request could be subscribed to as part of a promised return value using
5720   * the result of `hasFinishedResolution`. There is currently reliable way to
5721   * determine that a reusable blocks fetch request has completed.
5722   *
5723   * @return {Promise} Promise resolving once reusable blocks fetched.
5724   */
5725  
5726  
5727  var block_fetchReusableBlocks = Object(external_this_lodash_["once"])(function () {
5728    Object(external_this_wp_data_["dispatch"])('core/editor').__experimentalFetchReusableBlocks();
5729  });
5730  /**
5731   * Creates a blocks repeater for replacing the current block with a selected block type.
5732   *
5733   * @return {WPCompleter} A blocks completer.
5734   */
5735  
5736  function createBlockCompleter() {
5737    var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
5738        _ref$getBlockInsertio = _ref.getBlockInsertionParentClientId,
5739        getBlockInsertionParentClientId = _ref$getBlockInsertio === void 0 ? defaultGetBlockInsertionParentClientId : _ref$getBlockInsertio,
5740        _ref$getInserterItems = _ref.getInserterItems,
5741        getInserterItems = _ref$getInserterItems === void 0 ? defaultGetInserterItems : _ref$getInserterItems,
5742        _ref$getSelectedBlock = _ref.getSelectedBlockName,
5743        getSelectedBlockName = _ref$getSelectedBlock === void 0 ? defaultGetSelectedBlockName : _ref$getSelectedBlock;
5744  
5745    return {
5746      name: 'blocks',
5747      className: 'editor-autocompleters__block',
5748      triggerPrefix: '/',
5749      options: function options() {
5750        block_fetchReusableBlocks();
5751        var selectedBlockName = getSelectedBlockName();
5752        return getInserterItems(getBlockInsertionParentClientId()).filter( // Avoid offering to replace the current block with a block of the same type.
5753        function (inserterItem) {
5754          return selectedBlockName !== inserterItem.name;
5755        });
5756      },
5757      getOptionKeywords: function getOptionKeywords(inserterItem) {
5758        var title = inserterItem.title,
5759            _inserterItem$keyword = inserterItem.keywords,
5760            keywords = _inserterItem$keyword === void 0 ? [] : _inserterItem$keyword,
5761            category = inserterItem.category;
5762        return [category].concat(Object(toConsumableArray["a" /* default */])(keywords), [title]);
5763      },
5764      getOptionLabel: function getOptionLabel(inserterItem) {
5765        var icon = inserterItem.icon,
5766            title = inserterItem.title;
5767        return [Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockIcon"], {
5768          key: "icon",
5769          icon: icon,
5770          showColors: true
5771        }), title];
5772      },
5773      allowContext: function allowContext(before, after) {
5774        return !(/\S/.test(before) || /\S/.test(after));
5775      },
5776      getOptionCompletion: function getOptionCompletion(inserterItem) {
5777        var name = inserterItem.name,
5778            initialAttributes = inserterItem.initialAttributes;
5779        return {
5780          action: 'replace',
5781          value: Object(external_this_wp_blocks_["createBlock"])(name, initialAttributes)
5782        };
5783      },
5784      isOptionDisabled: function isOptionDisabled(inserterItem) {
5785        return inserterItem.isDisabled;
5786      }
5787    };
5788  }
5789  /**
5790   * Creates a blocks repeater for replacing the current block with a selected block type.
5791   *
5792   * @return {WPCompleter} A blocks completer.
5793   */
5794  
5795  /* harmony default export */ var autocompleters_block = (createBlockCompleter());
5796  
5797  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/autocompleters/user.js
5798  
5799  
5800  /**
5801   * WordPress dependencies
5802   */
5803  
5804  /** @typedef {import('@wordpress/components').WPCompleter} WPCompleter */
5805  
5806  /**
5807   * A user mentions completer.
5808   *
5809   * @type {WPCompleter}
5810   */
5811  
5812  /* harmony default export */ var autocompleters_user = ({
5813    name: 'users',
5814    className: 'editor-autocompleters__user',
5815    triggerPrefix: '@',
5816    options: function options(search) {
5817      var payload = '';
5818  
5819      if (search) {
5820        payload = '?search=' + encodeURIComponent(search);
5821      }
5822  
5823      return external_this_wp_apiFetch_default()({
5824        path: '/wp/v2/users' + payload
5825      });
5826    },
5827    isDebounced: true,
5828    getOptionKeywords: function getOptionKeywords(user) {
5829      return [user.slug, user.name];
5830    },
5831    getOptionLabel: function getOptionLabel(user) {
5832      return [Object(external_this_wp_element_["createElement"])("img", {
5833        key: "avatar",
5834        className: "editor-autocompleters__user-avatar",
5835        alt: "",
5836        src: user.avatar_urls[24]
5837      }), Object(external_this_wp_element_["createElement"])("span", {
5838        key: "name",
5839        className: "editor-autocompleters__user-name"
5840      }, user.name), Object(external_this_wp_element_["createElement"])("span", {
5841        key: "slug",
5842        className: "editor-autocompleters__user-slug"
5843      }, user.slug)];
5844    },
5845    getOptionCompletion: function getOptionCompletion(user) {
5846      return "@".concat(user.slug);
5847    }
5848  });
5849  
5850  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/autocompleters/index.js
5851  
5852  
5853  
5854  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
5855  var classCallCheck = __webpack_require__(13);
5856  
5857  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
5858  var createClass = __webpack_require__(12);
5859  
5860  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
5861  var possibleConstructorReturn = __webpack_require__(15);
5862  
5863  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
5864  var getPrototypeOf = __webpack_require__(16);
5865  
5866  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
5867  var inherits = __webpack_require__(17);
5868  
5869  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/autosave-monitor/index.js
5870  
5871  
5872  
5873  
5874  
5875  
5876  /**
5877   * WordPress dependencies
5878   */
5879  
5880  
5881  
5882  var autosave_monitor_AutosaveMonitor =
5883  /*#__PURE__*/
5884  function (_Component) {
5885    Object(inherits["a" /* default */])(AutosaveMonitor, _Component);
5886  
5887    function AutosaveMonitor() {
5888      Object(classCallCheck["a" /* default */])(this, AutosaveMonitor);
5889  
5890      return Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(AutosaveMonitor).apply(this, arguments));
5891    }
5892  
5893    Object(createClass["a" /* default */])(AutosaveMonitor, [{
5894      key: "componentDidUpdate",
5895      value: function componentDidUpdate(prevProps) {
5896        var _this$props = this.props,
5897            isDirty = _this$props.isDirty,
5898            editsReference = _this$props.editsReference,
5899            isAutosaveable = _this$props.isAutosaveable,
5900            isAutosaving = _this$props.isAutosaving; // The edits reference is held for comparison to avoid scheduling an
5901        // autosave if an edit has not been made since the last autosave
5902        // completion. This is assigned when the autosave completes, and reset
5903        // when an edit occurs.
5904        //
5905        // See: https://github.com/WordPress/gutenberg/issues/12318
5906  
5907        if (editsReference !== prevProps.editsReference) {
5908          this.didAutosaveForEditsReference = false;
5909        }
5910  
5911        if (!isAutosaving && prevProps.isAutosaving) {
5912          this.didAutosaveForEditsReference = true;
5913        }
5914  
5915        if (prevProps.isDirty !== isDirty || prevProps.isAutosaveable !== isAutosaveable || prevProps.editsReference !== editsReference) {
5916          this.toggleTimer(isDirty && isAutosaveable && !this.didAutosaveForEditsReference);
5917        }
5918      }
5919    }, {
5920      key: "componentWillUnmount",
5921      value: function componentWillUnmount() {
5922        this.toggleTimer(false);
5923      }
5924    }, {
5925      key: "toggleTimer",
5926      value: function toggleTimer(isPendingSave) {
5927        var _this = this;
5928  
5929        var _this$props2 = this.props,
5930            interval = _this$props2.interval,
5931            _this$props2$shouldTh = _this$props2.shouldThrottle,
5932            shouldThrottle = _this$props2$shouldTh === void 0 ? false : _this$props2$shouldTh; // By default, AutosaveMonitor will wait for a pause in editing before
5933        // autosaving. In other words, its action is "debounced".
5934        //
5935        // The `shouldThrottle` props allows overriding this behaviour, thus
5936        // making the autosave action "throttled".
5937  
5938        if (!shouldThrottle && this.pendingSave) {
5939          clearTimeout(this.pendingSave);
5940          delete this.pendingSave;
5941        }
5942  
5943        if (isPendingSave && !(shouldThrottle && this.pendingSave)) {
5944          this.pendingSave = setTimeout(function () {
5945            _this.props.autosave();
5946  
5947            delete _this.pendingSave;
5948          }, interval * 1000);
5949        }
5950      }
5951    }, {
5952      key: "render",
5953      value: function render() {
5954        return null;
5955      }
5956    }]);
5957  
5958    return AutosaveMonitor;
5959  }(external_this_wp_element_["Component"]);
5960  /* harmony default export */ var autosave_monitor = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select, ownProps) {
5961    var _select = select('core'),
5962        getReferenceByDistinctEdits = _select.getReferenceByDistinctEdits;
5963  
5964    var _select2 = select('core/editor'),
5965        isEditedPostDirty = _select2.isEditedPostDirty,
5966        isEditedPostAutosaveable = _select2.isEditedPostAutosaveable,
5967        isAutosavingPost = _select2.isAutosavingPost,
5968        getEditorSettings = _select2.getEditorSettings;
5969  
5970    var _ownProps$interval = ownProps.interval,
5971        interval = _ownProps$interval === void 0 ? getEditorSettings().autosaveInterval : _ownProps$interval;
5972    return {
5973      isDirty: isEditedPostDirty(),
5974      isAutosaveable: isEditedPostAutosaveable(),
5975      editsReference: getReferenceByDistinctEdits(),
5976      isAutosaving: isAutosavingPost(),
5977      interval: interval
5978    };
5979  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch, ownProps) {
5980    return {
5981      autosave: function autosave() {
5982        var _ownProps$autosave = ownProps.autosave,
5983            autosave = _ownProps$autosave === void 0 ? dispatch('core/editor').autosave : _ownProps$autosave;
5984        autosave();
5985      }
5986    };
5987  })])(autosave_monitor_AutosaveMonitor));
5988  
5989  // EXTERNAL MODULE: ./node_modules/classnames/index.js
5990  var classnames = __webpack_require__(11);
5991  var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
5992  
5993  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/document-outline/item.js
5994  
5995  
5996  /**
5997   * External dependencies
5998   */
5999  
6000  /**
6001   * WordPress dependencies
6002   */
6003  
6004  
6005  
6006  var item_TableOfContentsItem = function TableOfContentsItem(_ref) {
6007    var children = _ref.children,
6008        isValid = _ref.isValid,
6009        level = _ref.level,
6010        _ref$path = _ref.path,
6011        path = _ref$path === void 0 ? [] : _ref$path,
6012        href = _ref.href,
6013        onSelect = _ref.onSelect;
6014    return Object(external_this_wp_element_["createElement"])("li", {
6015      className: classnames_default()('document-outline__item', "is-".concat(level.toLowerCase()), {
6016        'is-invalid': !isValid
6017      })
6018    }, Object(external_this_wp_element_["createElement"])("a", {
6019      href: href,
6020      className: "document-outline__button",
6021      onClick: onSelect
6022    }, Object(external_this_wp_element_["createElement"])("span", {
6023      className: "document-outline__emdash",
6024      "aria-hidden": "true"
6025    }), // path is an array of nodes that are ancestors of the heading starting in the top level node.
6026    // This mapping renders each ancestor to make it easier for the user to know where the headings are nested.
6027    path.map(function (_ref2, index) {
6028      var clientId = _ref2.clientId;
6029      return Object(external_this_wp_element_["createElement"])("strong", {
6030        key: index,
6031        className: "document-outline__level"
6032      }, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockTitle"], {
6033        clientId: clientId
6034      }));
6035    }), Object(external_this_wp_element_["createElement"])("strong", {
6036      className: "document-outline__level"
6037    }, level), Object(external_this_wp_element_["createElement"])("span", {
6038      className: "document-outline__item-content"
6039    }, children)));
6040  };
6041  
6042  /* harmony default export */ var document_outline_item = (item_TableOfContentsItem);
6043  
6044  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/document-outline/index.js
6045  
6046  
6047  
6048  
6049  /**
6050   * External dependencies
6051   */
6052  
6053  /**
6054   * WordPress dependencies
6055   */
6056  
6057  
6058  
6059  
6060  
6061  /**
6062   * Internal dependencies
6063   */
6064  
6065  
6066  /**
6067   * Module constants
6068   */
6069  
6070  var emptyHeadingContent = Object(external_this_wp_element_["createElement"])("em", null, Object(external_this_wp_i18n_["__"])('(Empty heading)'));
6071  var incorrectLevelContent = [Object(external_this_wp_element_["createElement"])("br", {
6072    key: "incorrect-break"
6073  }), Object(external_this_wp_element_["createElement"])("em", {
6074    key: "incorrect-message"
6075  }, Object(external_this_wp_i18n_["__"])('(Incorrect heading level)'))];
6076  var singleH1Headings = [Object(external_this_wp_element_["createElement"])("br", {
6077    key: "incorrect-break-h1"
6078  }), Object(external_this_wp_element_["createElement"])("em", {
6079    key: "incorrect-message-h1"
6080  }, Object(external_this_wp_i18n_["__"])('(Your theme may already use a H1 for the post title)'))];
6081  var multipleH1Headings = [Object(external_this_wp_element_["createElement"])("br", {
6082    key: "incorrect-break-multiple-h1"
6083  }), Object(external_this_wp_element_["createElement"])("em", {
6084    key: "incorrect-message-multiple-h1"
6085  }, Object(external_this_wp_i18n_["__"])('(Multiple H1 headings are not recommended)'))];
6086  /**
6087   * Returns an array of heading blocks enhanced with the following properties:
6088   * path    - An array of blocks that are ancestors of the heading starting from a top-level node.
6089   *           Can be an empty array if the heading is a top-level node (is not nested inside another block).
6090   * level   - An integer with the heading level.
6091   * isEmpty - Flag indicating if the heading has no content.
6092   *
6093   * @param {?Array} blocks An array of blocks.
6094   * @param {?Array} path   An array of blocks that are ancestors of the blocks passed as blocks.
6095   *
6096   * @return {Array} An array of heading blocks enhanced with the properties described above.
6097   */
6098  
6099  var document_outline_computeOutlineHeadings = function computeOutlineHeadings() {
6100    var blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6101    var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
6102    return Object(external_this_lodash_["flatMap"])(blocks, function () {
6103      var block = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6104  
6105      if (block.name === 'core/heading') {
6106        return Object(objectSpread["a" /* default */])({}, block, {
6107          path: path,
6108          level: block.attributes.level,
6109          isEmpty: isEmptyHeading(block)
6110        });
6111      }
6112  
6113      return computeOutlineHeadings(block.innerBlocks, [].concat(Object(toConsumableArray["a" /* default */])(path), [block]));
6114    });
6115  };
6116  
6117  var isEmptyHeading = function isEmptyHeading(heading) {
6118    return !heading.attributes.content || heading.attributes.content.length === 0;
6119  };
6120  
6121  var document_outline_DocumentOutline = function DocumentOutline(_ref) {
6122    var _ref$blocks = _ref.blocks,
6123        blocks = _ref$blocks === void 0 ? [] : _ref$blocks,
6124        title = _ref.title,
6125        onSelect = _ref.onSelect,
6126        isTitleSupported = _ref.isTitleSupported,
6127        hasOutlineItemsDisabled = _ref.hasOutlineItemsDisabled;
6128    var headings = document_outline_computeOutlineHeadings(blocks);
6129  
6130    if (headings.length < 1) {
6131      return null;
6132    }
6133  
6134    var prevHeadingLevel = 1; // Not great but it's the simplest way to locate the title right now.
6135  
6136    var titleNode = document.querySelector('.editor-post-title__input');
6137    var hasTitle = isTitleSupported && title && titleNode;
6138    var countByLevel = Object(external_this_lodash_["countBy"])(headings, 'level');
6139    var hasMultipleH1 = countByLevel[1] > 1;
6140    return Object(external_this_wp_element_["createElement"])("div", {
6141      className: "document-outline"
6142    }, Object(external_this_wp_element_["createElement"])("ul", null, hasTitle && Object(external_this_wp_element_["createElement"])(document_outline_item, {
6143      level: Object(external_this_wp_i18n_["__"])('Title'),
6144      isValid: true,
6145      onSelect: onSelect,
6146      href: "#".concat(titleNode.id),
6147      isDisabled: hasOutlineItemsDisabled
6148    }, title), headings.map(function (item, index) {
6149      // Headings remain the same, go up by one, or down by any amount.
6150      // Otherwise there are missing levels.
6151      var isIncorrectLevel = item.level > prevHeadingLevel + 1;
6152      var isValid = !item.isEmpty && !isIncorrectLevel && !!item.level && (item.level !== 1 || !hasMultipleH1 && !hasTitle);
6153      prevHeadingLevel = item.level;
6154      return Object(external_this_wp_element_["createElement"])(document_outline_item, {
6155        key: index,
6156        level: "H".concat(item.level),
6157        isValid: isValid,
6158        path: item.path,
6159        isDisabled: hasOutlineItemsDisabled,
6160        href: "#block-".concat(item.clientId),
6161        onSelect: onSelect
6162      }, item.isEmpty ? emptyHeadingContent : Object(external_this_wp_richText_["getTextContent"])(Object(external_this_wp_richText_["create"])({
6163        html: item.attributes.content
6164      })), isIncorrectLevel && incorrectLevelContent, item.level === 1 && hasMultipleH1 && multipleH1Headings, hasTitle && item.level === 1 && !hasMultipleH1 && singleH1Headings);
6165    })));
6166  };
6167  /* harmony default export */ var document_outline = (Object(external_this_wp_compose_["compose"])(Object(external_this_wp_data_["withSelect"])(function (select) {
6168    var _select = select('core/block-editor'),
6169        getBlocks = _select.getBlocks;
6170  
6171    var _select2 = select('core/editor'),
6172        getEditedPostAttribute = _select2.getEditedPostAttribute;
6173  
6174    var _select3 = select('core'),
6175        getPostType = _select3.getPostType;
6176  
6177    var postType = getPostType(getEditedPostAttribute('type'));
6178    return {
6179      title: getEditedPostAttribute('title'),
6180      blocks: getBlocks(),
6181      isTitleSupported: Object(external_this_lodash_["get"])(postType, ['supports', 'title'], false)
6182    };
6183  }))(document_outline_DocumentOutline));
6184  
6185  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/document-outline/check.js
6186  /**
6187   * External dependencies
6188   */
6189  
6190  /**
6191   * WordPress dependencies
6192   */
6193  
6194  
6195  
6196  function DocumentOutlineCheck(_ref) {
6197    var blocks = _ref.blocks,
6198        children = _ref.children;
6199    var headings = Object(external_this_lodash_["filter"])(blocks, function (block) {
6200      return block.name === 'core/heading';
6201    });
6202  
6203    if (headings.length < 1) {
6204      return null;
6205    }
6206  
6207    return children;
6208  }
6209  
6210  /* harmony default export */ var check = (Object(external_this_wp_data_["withSelect"])(function (select) {
6211    return {
6212      blocks: select('core/block-editor').getBlocks()
6213    };
6214  })(DocumentOutlineCheck));
6215  
6216  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
6217  var assertThisInitialized = __webpack_require__(6);
6218  
6219  // EXTERNAL MODULE: external {"this":["wp","components"]}
6220  var external_this_wp_components_ = __webpack_require__(3);
6221  
6222  // EXTERNAL MODULE: external {"this":["wp","keycodes"]}
6223  var external_this_wp_keycodes_ = __webpack_require__(19);
6224  
6225  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/save-shortcut.js
6226  
6227  
6228  
6229  /**
6230   * WordPress dependencies
6231   */
6232  
6233  
6234  
6235  
6236  function SaveShortcut(_ref) {
6237    var onSave = _ref.onSave;
6238    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["KeyboardShortcuts"], {
6239      bindGlobal: true,
6240      shortcuts: Object(defineProperty["a" /* default */])({}, external_this_wp_keycodes_["rawShortcut"].primary('s'), function (event) {
6241        event.preventDefault();
6242        onSave();
6243      })
6244    });
6245  }
6246  /* harmony default export */ var save_shortcut = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
6247    var _select = select('core/editor'),
6248        isEditedPostDirty = _select.isEditedPostDirty;
6249  
6250    return {
6251      isDirty: isEditedPostDirty()
6252    };
6253  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch, ownProps, _ref3) {
6254    var select = _ref3.select;
6255  
6256    var _dispatch = dispatch('core/editor'),
6257        savePost = _dispatch.savePost;
6258  
6259    return {
6260      onSave: function onSave() {
6261        // TODO: This should be handled in the `savePost` effect in
6262        // considering `isSaveable`. See note on `isEditedPostSaveable`
6263        // selector about dirtiness and meta-boxes.
6264        //
6265        // See: `isEditedPostSaveable`
6266        var _select2 = select('core/editor'),
6267            isEditedPostDirty = _select2.isEditedPostDirty;
6268  
6269        if (!isEditedPostDirty()) {
6270          return;
6271        }
6272  
6273        savePost();
6274      }
6275    };
6276  })])(SaveShortcut));
6277  
6278  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/visual-editor-shortcuts.js
6279  
6280  
6281  
6282  
6283  
6284  
6285  
6286  
6287  
6288  /**
6289   * WordPress dependencies
6290   */
6291  
6292  
6293  
6294  
6295  
6296  
6297  /**
6298   * Internal dependencies
6299   */
6300  
6301  
6302  
6303  var visual_editor_shortcuts_VisualEditorGlobalKeyboardShortcuts =
6304  /*#__PURE__*/
6305  function (_Component) {
6306    Object(inherits["a" /* default */])(VisualEditorGlobalKeyboardShortcuts, _Component);
6307  
6308    function VisualEditorGlobalKeyboardShortcuts() {
6309      var _this;
6310  
6311      Object(classCallCheck["a" /* default */])(this, VisualEditorGlobalKeyboardShortcuts);
6312  
6313      _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(VisualEditorGlobalKeyboardShortcuts).apply(this, arguments));
6314      _this.undoOrRedo = _this.undoOrRedo.bind(Object(assertThisInitialized["a" /* default */])(_this));
6315      return _this;
6316    }
6317  
6318    Object(createClass["a" /* default */])(VisualEditorGlobalKeyboardShortcuts, [{
6319      key: "undoOrRedo",
6320      value: function undoOrRedo(event) {
6321        var _this$props = this.props,
6322            onRedo = _this$props.onRedo,
6323            onUndo = _this$props.onUndo;
6324  
6325        if (event.shiftKey) {
6326          onRedo();
6327        } else {
6328          onUndo();
6329        }
6330  
6331        event.preventDefault();
6332      }
6333    }, {
6334      key: "render",
6335      value: function render() {
6336        var _ref;
6337  
6338        return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["BlockEditorKeyboardShortcuts"], null), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["KeyboardShortcuts"], {
6339          shortcuts: (_ref = {}, Object(defineProperty["a" /* default */])(_ref, external_this_wp_keycodes_["rawShortcut"].primary('z'), this.undoOrRedo), Object(defineProperty["a" /* default */])(_ref, external_this_wp_keycodes_["rawShortcut"].primaryShift('z'), this.undoOrRedo), _ref)
6340        }), Object(external_this_wp_element_["createElement"])(save_shortcut, null));
6341      }
6342    }]);
6343  
6344    return VisualEditorGlobalKeyboardShortcuts;
6345  }(external_this_wp_element_["Component"]);
6346  
6347  var EnhancedVisualEditorGlobalKeyboardShortcuts = Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
6348    var _dispatch = dispatch('core/editor'),
6349        redo = _dispatch.redo,
6350        undo = _dispatch.undo;
6351  
6352    return {
6353      onRedo: redo,
6354      onUndo: undo
6355    };
6356  })(visual_editor_shortcuts_VisualEditorGlobalKeyboardShortcuts);
6357  /* harmony default export */ var visual_editor_shortcuts = (EnhancedVisualEditorGlobalKeyboardShortcuts);
6358  function EditorGlobalKeyboardShortcuts() {
6359    external_this_wp_deprecated_default()('EditorGlobalKeyboardShortcuts', {
6360      alternative: 'VisualEditorGlobalKeyboardShortcuts',
6361      plugin: 'Gutenberg'
6362    });
6363    return Object(external_this_wp_element_["createElement"])(EnhancedVisualEditorGlobalKeyboardShortcuts, null);
6364  }
6365  
6366  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/global-keyboard-shortcuts/text-editor-shortcuts.js
6367  
6368  
6369  /**
6370   * Internal dependencies
6371   */
6372  
6373  function TextEditorGlobalKeyboardShortcuts() {
6374    return Object(external_this_wp_element_["createElement"])(save_shortcut, null);
6375  }
6376  
6377  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/editor-history/redo.js
6378  
6379  
6380  /**
6381   * WordPress dependencies
6382   */
6383  
6384  
6385  
6386  
6387  
6388  
6389  function EditorHistoryRedo(_ref) {
6390    var hasRedo = _ref.hasRedo,
6391        redo = _ref.redo;
6392    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["IconButton"], {
6393      icon: "redo",
6394      label: Object(external_this_wp_i18n_["__"])('Redo'),
6395      shortcut: external_this_wp_keycodes_["displayShortcut"].primaryShift('z') // If there are no redo levels we don't want to actually disable this
6396      // button, because it will remove focus for keyboard users.
6397      // See: https://github.com/WordPress/gutenberg/issues/3486
6398      ,
6399      "aria-disabled": !hasRedo,
6400      onClick: hasRedo ? redo : undefined,
6401      className: "editor-history__redo"
6402    });
6403  }
6404  
6405  /* harmony default export */ var editor_history_redo = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
6406    return {
6407      hasRedo: select('core/editor').hasEditorRedo()
6408    };
6409  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
6410    return {
6411      redo: dispatch('core/editor').redo
6412    };
6413  })])(EditorHistoryRedo));
6414  
6415  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/editor-history/undo.js
6416  
6417  
6418  /**
6419   * WordPress dependencies
6420   */
6421  
6422  
6423  
6424  
6425  
6426  
6427  function EditorHistoryUndo(_ref) {
6428    var hasUndo = _ref.hasUndo,
6429        undo = _ref.undo;
6430    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["IconButton"], {
6431      icon: "undo",
6432      label: Object(external_this_wp_i18n_["__"])('Undo'),
6433      shortcut: external_this_wp_keycodes_["displayShortcut"].primary('z') // If there are no undo levels we don't want to actually disable this
6434      // button, because it will remove focus for keyboard users.
6435      // See: https://github.com/WordPress/gutenberg/issues/3486
6436      ,
6437      "aria-disabled": !hasUndo,
6438      onClick: hasUndo ? undo : undefined,
6439      className: "editor-history__undo"
6440    });
6441  }
6442  
6443  /* harmony default export */ var editor_history_undo = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
6444    return {
6445      hasUndo: select('core/editor').hasEditorUndo()
6446    };
6447  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
6448    return {
6449      undo: dispatch('core/editor').undo
6450    };
6451  })])(EditorHistoryUndo));
6452  
6453  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/template-validation-notice/index.js
6454  
6455  
6456  
6457  /**
6458   * WordPress dependencies
6459   */
6460  
6461  
6462  
6463  
6464  
6465  function TemplateValidationNotice(_ref) {
6466    var isValid = _ref.isValid,
6467        props = Object(objectWithoutProperties["a" /* default */])(_ref, ["isValid"]);
6468  
6469    if (isValid) {
6470      return null;
6471    }
6472  
6473    var confirmSynchronization = function confirmSynchronization() {
6474      // eslint-disable-next-line no-alert
6475      if (window.confirm(Object(external_this_wp_i18n_["__"])('Resetting the template may result in loss of content, do you want to continue?'))) {
6476        props.synchronizeTemplate();
6477      }
6478    };
6479  
6480    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Notice"], {
6481      className: "editor-template-validation-notice",
6482      isDismissible: false,
6483      status: "warning"
6484    }, Object(external_this_wp_element_["createElement"])("p", null, Object(external_this_wp_i18n_["__"])('The content of your post doesn’t match the template assigned to your post type.')), Object(external_this_wp_element_["createElement"])("div", null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
6485      isDefault: true,
6486      onClick: props.resetTemplateValidity
6487    }, Object(external_this_wp_i18n_["__"])('Keep it as is')), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
6488      onClick: confirmSynchronization,
6489      isPrimary: true
6490    }, Object(external_this_wp_i18n_["__"])('Reset the template'))));
6491  }
6492  
6493  /* harmony default export */ var template_validation_notice = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
6494    return {
6495      isValid: select('core/block-editor').isValidTemplate()
6496    };
6497  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
6498    var _dispatch = dispatch('core/block-editor'),
6499        setTemplateValidity = _dispatch.setTemplateValidity,
6500        synchronizeTemplate = _dispatch.synchronizeTemplate;
6501  
6502    return {
6503      resetTemplateValidity: function resetTemplateValidity() {
6504        return setTemplateValidity(true);
6505      },
6506      synchronizeTemplate: synchronizeTemplate
6507    };
6508  })])(TemplateValidationNotice));
6509  
6510  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/editor-notices/index.js
6511  
6512  
6513  /**
6514   * External dependencies
6515   */
6516  
6517  /**
6518   * WordPress dependencies
6519   */
6520  
6521  
6522  
6523  
6524  /**
6525   * Internal dependencies
6526   */
6527  
6528  
6529  function EditorNotices(_ref) {
6530    var notices = _ref.notices,
6531        onRemove = _ref.onRemove;
6532    var dismissibleNotices = Object(external_this_lodash_["filter"])(notices, {
6533      isDismissible: true,
6534      type: 'default'
6535    });
6536    var nonDismissibleNotices = Object(external_this_lodash_["filter"])(notices, {
6537      isDismissible: false,
6538      type: 'default'
6539    });
6540    var snackbarNotices = Object(external_this_lodash_["filter"])(notices, {
6541      type: 'snackbar'
6542    });
6543    return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["NoticeList"], {
6544      notices: nonDismissibleNotices,
6545      className: "components-editor-notices__pinned"
6546    }), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["NoticeList"], {
6547      notices: dismissibleNotices,
6548      className: "components-editor-notices__dismissible",
6549      onRemove: onRemove
6550    }, Object(external_this_wp_element_["createElement"])(template_validation_notice, null)), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["SnackbarList"], {
6551      notices: snackbarNotices,
6552      className: "components-editor-notices__snackbar",
6553      onRemove: onRemove
6554    }));
6555  }
6556  /* harmony default export */ var editor_notices = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
6557    return {
6558      notices: select('core/notices').getNotices()
6559    };
6560  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
6561    return {
6562      onRemove: dispatch('core/notices').removeNotice
6563    };
6564  })])(EditorNotices));
6565  
6566  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/error-boundary/index.js
6567  
6568  
6569  
6570  
6571  
6572  
6573  
6574  
6575  /**
6576   * WordPress dependencies
6577   */
6578  
6579  
6580  
6581  
6582  
6583  
6584  var error_boundary_ErrorBoundary =
6585  /*#__PURE__*/
6586  function (_Component) {
6587    Object(inherits["a" /* default */])(ErrorBoundary, _Component);
6588  
6589    function ErrorBoundary() {
6590      var _this;
6591  
6592      Object(classCallCheck["a" /* default */])(this, ErrorBoundary);
6593  
6594      _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(ErrorBoundary).apply(this, arguments));
6595      _this.reboot = _this.reboot.bind(Object(assertThisInitialized["a" /* default */])(_this));
6596      _this.getContent = _this.getContent.bind(Object(assertThisInitialized["a" /* default */])(_this));
6597      _this.state = {
6598        error: null
6599      };
6600      return _this;
6601    }
6602  
6603    Object(createClass["a" /* default */])(ErrorBoundary, [{
6604      key: "componentDidCatch",
6605      value: function componentDidCatch(error) {
6606        this.setState({
6607          error: error
6608        });
6609      }
6610    }, {
6611      key: "reboot",
6612      value: function reboot() {
6613        this.props.onError();
6614      }
6615    }, {
6616      key: "getContent",
6617      value: function getContent() {
6618        try {
6619          // While `select` in a component is generally discouraged, it is
6620          // used here because it (a) reduces the chance of data loss in the
6621          // case of additional errors by performing a direct retrieval and
6622          // (b) avoids the performance cost associated with unnecessary
6623          // content serialization throughout the lifetime of a non-erroring
6624          // application.
6625          return Object(external_this_wp_data_["select"])('core/editor').getEditedPostContent();
6626        } catch (error) {}
6627      }
6628    }, {
6629      key: "render",
6630      value: function render() {
6631        var error = this.state.error;
6632  
6633        if (!error) {
6634          return this.props.children;
6635        }
6636  
6637        return Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["Warning"], {
6638          className: "editor-error-boundary",
6639          actions: [Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
6640            key: "recovery",
6641            onClick: this.reboot,
6642            isLarge: true
6643          }, Object(external_this_wp_i18n_["__"])('Attempt Recovery')), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ClipboardButton"], {
6644            key: "copy-post",
6645            text: this.getContent,
6646            isLarge: true
6647          }, Object(external_this_wp_i18n_["__"])('Copy Post Text')), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ClipboardButton"], {
6648            key: "copy-error",
6649            text: error.stack,
6650            isLarge: true
6651          }, Object(external_this_wp_i18n_["__"])('Copy Error'))]
6652        }, Object(external_this_wp_i18n_["__"])('The editor has encountered an unexpected error.'));
6653      }
6654    }]);
6655  
6656    return ErrorBoundary;
6657  }(external_this_wp_element_["Component"]);
6658  
6659  /* harmony default export */ var error_boundary = (error_boundary_ErrorBoundary);
6660  
6661  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/local-autosave-monitor/index.js
6662  
6663  
6664  /**
6665   * External dependencies
6666   */
6667  
6668  /**
6669   * WordPress dependencies
6670   */
6671  
6672  
6673  
6674  
6675  
6676  
6677  /**
6678   * Internal dependencies
6679   */
6680  
6681  
6682  
6683  var requestIdleCallback = window.requestIdleCallback ? window.requestIdleCallback : window.requestAnimationFrame;
6684  /**
6685   * Function which returns true if the current environment supports browser
6686   * sessionStorage, or false otherwise. The result of this function is cached and
6687   * reused in subsequent invocations.
6688   */
6689  
6690  var hasSessionStorageSupport = Object(external_this_lodash_["once"])(function () {
6691    try {
6692      // Private Browsing in Safari 10 and earlier will throw an error when
6693      // attempting to set into sessionStorage. The test here is intentional in
6694      // causing a thrown error as condition bailing from local autosave.
6695      window.sessionStorage.setItem('__wpEditorTestSessionStorage', '');
6696      window.sessionStorage.removeItem('__wpEditorTestSessionStorage');
6697      return true;
6698    } catch (error) {
6699      return false;
6700    }
6701  });
6702  /**
6703   * Custom hook which manages the creation of a notice prompting the user to
6704   * restore a local autosave, if one exists.
6705   */
6706  
6707  function useAutosaveNotice() {
6708    var _useSelect = Object(external_this_wp_data_["useSelect"])(function (select) {
6709      return {
6710        postId: select('core/editor').getCurrentPostId(),
6711        getEditedPostAttribute: select('core/editor').getEditedPostAttribute,
6712        hasRemoteAutosave: !!select('core/editor').getEditorSettings().autosave
6713      };
6714    }),
6715        postId = _useSelect.postId,
6716        getEditedPostAttribute = _useSelect.getEditedPostAttribute,
6717        hasRemoteAutosave = _useSelect.hasRemoteAutosave;
6718  
6719    var _useDispatch = Object(external_this_wp_data_["useDispatch"])('core/notices'),
6720        createWarningNotice = _useDispatch.createWarningNotice,
6721        removeNotice = _useDispatch.removeNotice;
6722  
6723    var _useDispatch2 = Object(external_this_wp_data_["useDispatch"])('core/editor'),
6724        editPost = _useDispatch2.editPost,
6725        resetEditorBlocks = _useDispatch2.resetEditorBlocks;
6726  
6727    Object(external_this_wp_element_["useEffect"])(function () {
6728      var localAutosave = localAutosaveGet(postId);
6729  
6730      if (!localAutosave) {
6731        return;
6732      }
6733  
6734      try {
6735        localAutosave = JSON.parse(localAutosave);
6736      } catch (error) {
6737        // Not usable if it can't be parsed.
6738        return;
6739      }
6740  
6741      var _localAutosave = localAutosave,
6742          title = _localAutosave.post_title,
6743          content = _localAutosave.content,
6744          excerpt = _localAutosave.excerpt;
6745      var edits = {
6746        title: title,
6747        content: content,
6748        excerpt: excerpt
6749      };
6750      {
6751        // Only display a notice if there is a difference between what has been
6752        // saved and that which is stored in sessionStorage.
6753        var hasDifference = Object.keys(edits).some(function (key) {
6754          return edits[key] !== getEditedPostAttribute(key);
6755        });
6756  
6757        if (!hasDifference) {
6758          // If there is no difference, it can be safely ejected from storage.
6759          localAutosaveClear(postId);
6760          return;
6761        }
6762      }
6763  
6764      if (hasRemoteAutosave) {
6765        return;
6766      }
6767  
6768      var noticeId = Object(external_this_lodash_["uniqueId"])('wpEditorAutosaveRestore');
6769      createWarningNotice(Object(external_this_wp_i18n_["__"])('The backup of this post in your browser is different from the version below.'), {
6770        id: noticeId,
6771        actions: [{
6772          label: Object(external_this_wp_i18n_["__"])('Restore the backup'),
6773          onClick: function onClick() {
6774            editPost(Object(external_this_lodash_["omit"])(edits, ['content']));
6775            resetEditorBlocks(Object(external_this_wp_blocks_["parse"])(edits.content));
6776            removeNotice(noticeId);
6777          }
6778        }]
6779      });
6780    }, [postId]);
6781  }
6782  /**
6783   * Custom hook which ejects a local autosave after a successful save occurs.
6784   */
6785  
6786  
6787  function useAutosavePurge() {
6788    var _useSelect2 = Object(external_this_wp_data_["useSelect"])(function (select) {
6789      return {
6790        postId: select('core/editor').getCurrentPostId(),
6791        isDirty: select('core/editor').isEditedPostDirty(),
6792        isAutosaving: select('core/editor').isAutosavingPost(),
6793        didError: select('core/editor').didPostSaveRequestFail()
6794      };
6795    }),
6796        postId = _useSelect2.postId,
6797        isDirty = _useSelect2.isDirty,
6798        isAutosaving = _useSelect2.isAutosaving,
6799        didError = _useSelect2.didError;
6800  
6801    var lastIsDirty = Object(external_this_wp_element_["useRef"])(isDirty);
6802    var lastIsAutosaving = Object(external_this_wp_element_["useRef"])(isAutosaving);
6803    Object(external_this_wp_element_["useEffect"])(function () {
6804      if (!didError && (lastIsAutosaving.current && !isAutosaving || lastIsDirty.current && !isDirty)) {
6805        localAutosaveClear(postId);
6806      }
6807  
6808      lastIsDirty.current = isDirty;
6809      lastIsAutosaving.current = isAutosaving;
6810    }, [isDirty, isAutosaving, didError]);
6811  }
6812  
6813  function LocalAutosaveMonitor() {
6814    var _useDispatch3 = Object(external_this_wp_data_["useDispatch"])('core/editor'),
6815        __experimentalLocalAutosave = _useDispatch3.__experimentalLocalAutosave;
6816  
6817    var autosave = Object(external_this_wp_element_["useCallback"])(function () {
6818      requestIdleCallback(__experimentalLocalAutosave);
6819    }, []);
6820    useAutosaveNotice();
6821    useAutosavePurge();
6822  
6823    var _useSelect3 = Object(external_this_wp_data_["useSelect"])(function (select) {
6824      return {
6825        localAutosaveInterval: select('core/editor').getEditorSettings().__experimentalLocalAutosaveInterval
6826      };
6827    }),
6828        localAutosaveInterval = _useSelect3.localAutosaveInterval;
6829  
6830    return Object(external_this_wp_element_["createElement"])(autosave_monitor, {
6831      interval: localAutosaveInterval,
6832      autosave: autosave,
6833      shouldThrottle: true
6834    });
6835  }
6836  
6837  /* harmony default export */ var local_autosave_monitor = (Object(external_this_wp_compose_["ifCondition"])(hasSessionStorageSupport)(LocalAutosaveMonitor));
6838  
6839  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/page-attributes/check.js
6840  /**
6841   * External dependencies
6842   */
6843  
6844  /**
6845   * WordPress dependencies
6846   */
6847  
6848  
6849  function PageAttributesCheck(_ref) {
6850    var availableTemplates = _ref.availableTemplates,
6851        postType = _ref.postType,
6852        children = _ref.children;
6853    var supportsPageAttributes = Object(external_this_lodash_["get"])(postType, ['supports', 'page-attributes'], false); // Only render fields if post type supports page attributes or available templates exist.
6854  
6855    if (!supportsPageAttributes && Object(external_this_lodash_["isEmpty"])(availableTemplates)) {
6856      return null;
6857    }
6858  
6859    return children;
6860  }
6861  /* harmony default export */ var page_attributes_check = (Object(external_this_wp_data_["withSelect"])(function (select) {
6862    var _select = select('core/editor'),
6863        getEditedPostAttribute = _select.getEditedPostAttribute,
6864        getEditorSettings = _select.getEditorSettings;
6865  
6866    var _select2 = select('core'),
6867        getPostType = _select2.getPostType;
6868  
6869    var _getEditorSettings = getEditorSettings(),
6870        availableTemplates = _getEditorSettings.availableTemplates;
6871  
6872    return {
6873      postType: getPostType(getEditedPostAttribute('type')),
6874      availableTemplates: availableTemplates
6875    };
6876  })(PageAttributesCheck));
6877  
6878  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js
6879  /**
6880   * External dependencies
6881   */
6882  
6883  /**
6884   * WordPress dependencies
6885   */
6886  
6887  
6888  /**
6889   * A component which renders its own children only if the current editor post
6890   * type supports one of the given `supportKeys` prop.
6891   *
6892   * @param {Object}    props             Props.
6893   * @param {string}    [props.postType]  Current post type.
6894   * @param {WPElement} props.children    Children to be rendered if post
6895   *                                                                   type supports.
6896   * @param {(string|string[])}                      props.supportKeys String or string array of keys
6897   *                                                                   to test.
6898   *
6899   * @return {WPComponent} The component to be rendered.
6900   */
6901  
6902  function PostTypeSupportCheck(_ref) {
6903    var postType = _ref.postType,
6904        children = _ref.children,
6905        supportKeys = _ref.supportKeys;
6906    var isSupported = true;
6907  
6908    if (postType) {
6909      isSupported = Object(external_this_lodash_["some"])(Object(external_this_lodash_["castArray"])(supportKeys), function (key) {
6910        return !!postType.supports[key];
6911      });
6912    }
6913  
6914    if (!isSupported) {
6915      return null;
6916    }
6917  
6918    return children;
6919  }
6920  /* harmony default export */ var post_type_support_check = (Object(external_this_wp_data_["withSelect"])(function (select) {
6921    var _select = select('core/editor'),
6922        getEditedPostAttribute = _select.getEditedPostAttribute;
6923  
6924    var _select2 = select('core'),
6925        getPostType = _select2.getPostType;
6926  
6927    return {
6928      postType: getPostType(getEditedPostAttribute('type'))
6929    };
6930  })(PostTypeSupportCheck));
6931  
6932  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/page-attributes/order.js
6933  
6934  
6935  /**
6936   * External dependencies
6937   */
6938  
6939  /**
6940   * WordPress dependencies
6941   */
6942  
6943  
6944  
6945  
6946  
6947  /**
6948   * Internal dependencies
6949   */
6950  
6951  
6952  var PageAttributesOrder = Object(external_this_wp_compose_["withState"])({
6953    orderInput: null
6954  })(function (_ref) {
6955    var onUpdateOrder = _ref.onUpdateOrder,
6956        _ref$order = _ref.order,
6957        order = _ref$order === void 0 ? 0 : _ref$order,
6958        orderInput = _ref.orderInput,
6959        setState = _ref.setState;
6960  
6961    var setUpdatedOrder = function setUpdatedOrder(value) {
6962      setState({
6963        orderInput: value
6964      });
6965      var newOrder = Number(value);
6966  
6967      if (Number.isInteger(newOrder) && Object(external_this_lodash_["invoke"])(value, ['trim']) !== '') {
6968        onUpdateOrder(Number(value));
6969      }
6970    };
6971  
6972    var value = orderInput === null ? order : orderInput;
6973    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["TextControl"], {
6974      className: "editor-page-attributes__order",
6975      type: "number",
6976      label: Object(external_this_wp_i18n_["__"])('Order'),
6977      value: value,
6978      onChange: setUpdatedOrder,
6979      size: 6,
6980      onBlur: function onBlur() {
6981        setState({
6982          orderInput: null
6983        });
6984      }
6985    });
6986  });
6987  
6988  function PageAttributesOrderWithChecks(props) {
6989    return Object(external_this_wp_element_["createElement"])(post_type_support_check, {
6990      supportKeys: "page-attributes"
6991    }, Object(external_this_wp_element_["createElement"])(PageAttributesOrder, props));
6992  }
6993  
6994  /* harmony default export */ var page_attributes_order = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
6995    return {
6996      order: select('core/editor').getEditedPostAttribute('menu_order')
6997    };
6998  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
6999    return {
7000      onUpdateOrder: function onUpdateOrder(order) {
7001        dispatch('core/editor').editPost({
7002          menu_order: order
7003        });
7004      }
7005    };
7006  })])(PageAttributesOrderWithChecks));
7007  
7008  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/utils/terms.js
7009  
7010  
7011  /**
7012   * External dependencies
7013   */
7014  
7015  /**
7016   * Returns terms in a tree form.
7017   *
7018   * @param {Array} flatTerms  Array of terms in flat format.
7019   *
7020   * @return {Array} Array of terms in tree format.
7021   */
7022  
7023  function buildTermsTree(flatTerms) {
7024    var flatTermsWithParentAndChildren = flatTerms.map(function (term) {
7025      return Object(objectSpread["a" /* default */])({
7026        children: [],
7027        parent: null
7028      }, term);
7029    });
7030    var termsByParent = Object(external_this_lodash_["groupBy"])(flatTermsWithParentAndChildren, 'parent');
7031  
7032    if (termsByParent.null && termsByParent.null.length) {
7033      return flatTermsWithParentAndChildren;
7034    }
7035  
7036    var fillWithChildren = function fillWithChildren(terms) {
7037      return terms.map(function (term) {
7038        var children = termsByParent[term.id];
7039        return Object(objectSpread["a" /* default */])({}, term, {
7040          children: children && children.length ? fillWithChildren(children) : []
7041        });
7042      });
7043    };
7044  
7045    return fillWithChildren(termsByParent['0'] || []);
7046  }
7047  
7048  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/page-attributes/parent.js
7049  
7050  
7051  /**
7052   * External dependencies
7053   */
7054  
7055  /**
7056   * WordPress dependencies
7057   */
7058  
7059  
7060  
7061  
7062  
7063  /**
7064   * Internal dependencies
7065   */
7066  
7067  
7068  function PageAttributesParent(_ref) {
7069    var parent = _ref.parent,
7070        postType = _ref.postType,
7071        items = _ref.items,
7072        onUpdateParent = _ref.onUpdateParent;
7073    var isHierarchical = Object(external_this_lodash_["get"])(postType, ['hierarchical'], false);
7074    var parentPageLabel = Object(external_this_lodash_["get"])(postType, ['labels', 'parent_item_colon']);
7075    var pageItems = items || [];
7076  
7077    if (!isHierarchical || !parentPageLabel || !pageItems.length) {
7078      return null;
7079    }
7080  
7081    var pagesTree = buildTermsTree(pageItems.map(function (item) {
7082      return {
7083        id: item.id,
7084        parent: item.parent,
7085        name: item.title.raw ? item.title.raw : "#".concat(item.id, " (").concat(Object(external_this_wp_i18n_["__"])('no title'), ")")
7086      };
7087    }));
7088    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["TreeSelect"], {
7089      className: "editor-page-attributes__parent",
7090      label: parentPageLabel,
7091      noOptionLabel: "(".concat(Object(external_this_wp_i18n_["__"])('no parent'), ")"),
7092      tree: pagesTree,
7093      selectedId: parent,
7094      onChange: onUpdateParent
7095    });
7096  }
7097  var applyWithSelect = Object(external_this_wp_data_["withSelect"])(function (select) {
7098    var _select = select('core'),
7099        getPostType = _select.getPostType,
7100        getEntityRecords = _select.getEntityRecords;
7101  
7102    var _select2 = select('core/editor'),
7103        getCurrentPostId = _select2.getCurrentPostId,
7104        getEditedPostAttribute = _select2.getEditedPostAttribute;
7105  
7106    var postTypeSlug = getEditedPostAttribute('type');
7107    var postType = getPostType(postTypeSlug);
7108    var postId = getCurrentPostId();
7109    var isHierarchical = Object(external_this_lodash_["get"])(postType, ['hierarchical'], false);
7110    var query = {
7111      per_page: -1,
7112      exclude: postId,
7113      parent_exclude: postId,
7114      orderby: 'menu_order',
7115      order: 'asc'
7116    };
7117    return {
7118      parent: getEditedPostAttribute('parent'),
7119      items: isHierarchical ? getEntityRecords('postType', postTypeSlug, query) : [],
7120      postType: postType
7121    };
7122  });
7123  var applyWithDispatch = Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
7124    var _dispatch = dispatch('core/editor'),
7125        editPost = _dispatch.editPost;
7126  
7127    return {
7128      onUpdateParent: function onUpdateParent(parent) {
7129        editPost({
7130          parent: parent || 0
7131        });
7132      }
7133    };
7134  });
7135  /* harmony default export */ var page_attributes_parent = (Object(external_this_wp_compose_["compose"])([applyWithSelect, applyWithDispatch])(PageAttributesParent));
7136  
7137  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/page-attributes/template.js
7138  
7139  
7140  /**
7141   * External dependencies
7142   */
7143  
7144  /**
7145   * WordPress dependencies
7146   */
7147  
7148  
7149  
7150  
7151  
7152  function PageTemplate(_ref) {
7153    var availableTemplates = _ref.availableTemplates,
7154        selectedTemplate = _ref.selectedTemplate,
7155        onUpdate = _ref.onUpdate;
7156  
7157    if (Object(external_this_lodash_["isEmpty"])(availableTemplates)) {
7158      return null;
7159    }
7160  
7161    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["SelectControl"], {
7162      label: Object(external_this_wp_i18n_["__"])('Template:'),
7163      value: selectedTemplate,
7164      onChange: onUpdate,
7165      className: "editor-page-attributes__template",
7166      options: Object(external_this_lodash_["map"])(availableTemplates, function (templateName, templateSlug) {
7167        return {
7168          value: templateSlug,
7169          label: templateName
7170        };
7171      })
7172    });
7173  }
7174  /* harmony default export */ var page_attributes_template = (Object(external_this_wp_compose_["compose"])(Object(external_this_wp_data_["withSelect"])(function (select) {
7175    var _select = select('core/editor'),
7176        getEditedPostAttribute = _select.getEditedPostAttribute,
7177        getEditorSettings = _select.getEditorSettings;
7178  
7179    var _getEditorSettings = getEditorSettings(),
7180        availableTemplates = _getEditorSettings.availableTemplates;
7181  
7182    return {
7183      selectedTemplate: getEditedPostAttribute('template'),
7184      availableTemplates: availableTemplates
7185    };
7186  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
7187    return {
7188      onUpdate: function onUpdate(templateSlug) {
7189        dispatch('core/editor').editPost({
7190          template: templateSlug || ''
7191        });
7192      }
7193    };
7194  }))(PageTemplate));
7195  
7196  // EXTERNAL MODULE: external {"this":["wp","htmlEntities"]}
7197  var external_this_wp_htmlEntities_ = __webpack_require__(53);
7198  
7199  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/check.js
7200  
7201  
7202  /**
7203   * External dependencies
7204   */
7205  
7206  /**
7207   * WordPress dependencies
7208   */
7209  
7210  
7211  
7212  /**
7213   * Internal dependencies
7214   */
7215  
7216  
7217  function PostAuthorCheck(_ref) {
7218    var hasAssignAuthorAction = _ref.hasAssignAuthorAction,
7219        authors = _ref.authors,
7220        children = _ref.children;
7221  
7222    if (!hasAssignAuthorAction || authors.length < 2) {
7223      return null;
7224    }
7225  
7226    return Object(external_this_wp_element_["createElement"])(post_type_support_check, {
7227      supportKeys: "author"
7228    }, children);
7229  }
7230  /* harmony default export */ var post_author_check = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
7231    var post = select('core/editor').getCurrentPost();
7232    return {
7233      hasAssignAuthorAction: Object(external_this_lodash_["get"])(post, ['_links', 'wp:action-assign-author'], false),
7234      postType: select('core/editor').getCurrentPostType(),
7235      authors: select('core').getAuthors()
7236    };
7237  }), external_this_wp_compose_["withInstanceId"]])(PostAuthorCheck));
7238  
7239  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/index.js
7240  
7241  
7242  
7243  
7244  
7245  
7246  
7247  
7248  /**
7249   * WordPress dependencies
7250   */
7251  
7252  
7253  
7254  
7255  
7256  /**
7257   * Internal dependencies
7258   */
7259  
7260  
7261  var post_author_PostAuthor =
7262  /*#__PURE__*/
7263  function (_Component) {
7264    Object(inherits["a" /* default */])(PostAuthor, _Component);
7265  
7266    function PostAuthor() {
7267      var _this;
7268  
7269      Object(classCallCheck["a" /* default */])(this, PostAuthor);
7270  
7271      _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(PostAuthor).apply(this, arguments));
7272      _this.setAuthorId = _this.setAuthorId.bind(Object(assertThisInitialized["a" /* default */])(_this));
7273      return _this;
7274    }
7275  
7276    Object(createClass["a" /* default */])(PostAuthor, [{
7277      key: "setAuthorId",
7278      value: function setAuthorId(event) {
7279        var onUpdateAuthor = this.props.onUpdateAuthor;
7280        var value = event.target.value;
7281        onUpdateAuthor(Number(value));
7282      }
7283    }, {
7284      key: "render",
7285      value: function render() {
7286        var _this$props = this.props,
7287            postAuthor = _this$props.postAuthor,
7288            instanceId = _this$props.instanceId,
7289            authors = _this$props.authors;
7290        var selectId = 'post-author-selector-' + instanceId; // Disable reason: A select with an onchange throws a warning
7291  
7292        /* eslint-disable jsx-a11y/no-onchange */
7293  
7294        return Object(external_this_wp_element_["createElement"])(post_author_check, null, Object(external_this_wp_element_["createElement"])("label", {
7295          htmlFor: selectId
7296        }, Object(external_this_wp_i18n_["__"])('Author')), Object(external_this_wp_element_["createElement"])("select", {
7297          id: selectId,
7298          value: postAuthor,
7299          onChange: this.setAuthorId,
7300          className: "editor-post-author__select"
7301        }, authors.map(function (author) {
7302          return Object(external_this_wp_element_["createElement"])("option", {
7303            key: author.id,
7304            value: author.id
7305          }, Object(external_this_wp_htmlEntities_["decodeEntities"])(author.name));
7306        })));
7307        /* eslint-enable jsx-a11y/no-onchange */
7308      }
7309    }]);
7310  
7311    return PostAuthor;
7312  }(external_this_wp_element_["Component"]);
7313  /* harmony default export */ var post_author = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
7314    return {
7315      postAuthor: select('core/editor').getEditedPostAttribute('author'),
7316      authors: select('core').getAuthors()
7317    };
7318  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
7319    return {
7320      onUpdateAuthor: function onUpdateAuthor(author) {
7321        dispatch('core/editor').editPost({
7322          author: author
7323        });
7324      }
7325    };
7326  }), external_this_wp_compose_["withInstanceId"]])(post_author_PostAuthor));
7327  
7328  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-comments/index.js
7329  
7330  
7331  
7332  /**
7333   * WordPress dependencies
7334   */
7335  
7336  
7337  
7338  
7339  
7340  function PostComments(_ref) {
7341    var _ref$commentStatus = _ref.commentStatus,
7342        commentStatus = _ref$commentStatus === void 0 ? 'open' : _ref$commentStatus,
7343        props = Object(objectWithoutProperties["a" /* default */])(_ref, ["commentStatus"]);
7344  
7345    var onToggleComments = function onToggleComments() {
7346      return props.editPost({
7347        comment_status: commentStatus === 'open' ? 'closed' : 'open'
7348      });
7349    };
7350  
7351    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["CheckboxControl"], {
7352      label: Object(external_this_wp_i18n_["__"])('Allow Comments'),
7353      checked: commentStatus === 'open',
7354      onChange: onToggleComments
7355    });
7356  }
7357  
7358  /* harmony default export */ var post_comments = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
7359    return {
7360      commentStatus: select('core/editor').getEditedPostAttribute('comment_status')
7361    };
7362  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
7363    return {
7364      editPost: dispatch('core/editor').editPost
7365    };
7366  })])(PostComments));
7367  
7368  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-excerpt/index.js
7369  
7370  
7371  /**
7372   * WordPress dependencies
7373   */
7374  
7375  
7376  
7377  
7378  
7379  function PostExcerpt(_ref) {
7380    var excerpt = _ref.excerpt,
7381        onUpdateExcerpt = _ref.onUpdateExcerpt;
7382    return Object(external_this_wp_element_["createElement"])("div", {
7383      className: "editor-post-excerpt"
7384    }, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["TextareaControl"], {
7385      label: Object(external_this_wp_i18n_["__"])('Write an excerpt (optional)'),
7386      className: "editor-post-excerpt__textarea",
7387      onChange: function onChange(value) {
7388        return onUpdateExcerpt(value);
7389      },
7390      value: excerpt
7391    }), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ExternalLink"], {
7392      href: Object(external_this_wp_i18n_["__"])('https://wordpress.org/support/article/excerpt/')
7393    }, Object(external_this_wp_i18n_["__"])('Learn more about manual excerpts')));
7394  }
7395  
7396  /* harmony default export */ var post_excerpt = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
7397    return {
7398      excerpt: select('core/editor').getEditedPostAttribute('excerpt')
7399    };
7400  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
7401    return {
7402      onUpdateExcerpt: function onUpdateExcerpt(excerpt) {
7403        dispatch('core/editor').editPost({
7404          excerpt: excerpt
7405        });
7406      }
7407    };
7408  })])(PostExcerpt));
7409  
7410  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-excerpt/check.js
7411  
7412  
7413  
7414  /**
7415   * Internal dependencies
7416   */
7417  
7418  
7419  function PostExcerptCheck(props) {
7420    return Object(external_this_wp_element_["createElement"])(post_type_support_check, Object(esm_extends["a" /* default */])({}, props, {
7421      supportKeys: "excerpt"
7422    }));
7423  }
7424  
7425  /* harmony default export */ var post_excerpt_check = (PostExcerptCheck);
7426  
7427  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/theme-support-check/index.js
7428  /**
7429   * External dependencies
7430   */
7431  
7432  /**
7433   * WordPress dependencies
7434   */
7435  
7436  
7437  function ThemeSupportCheck(_ref) {
7438    var themeSupports = _ref.themeSupports,
7439        children = _ref.children,
7440        postType = _ref.postType,
7441        supportKeys = _ref.supportKeys;
7442    var isSupported = Object(external_this_lodash_["some"])(Object(external_this_lodash_["castArray"])(supportKeys), function (key) {
7443      var supported = Object(external_this_lodash_["get"])(themeSupports, [key], false); // 'post-thumbnails' can be boolean or an array of post types.
7444      // In the latter case, we need to verify `postType` exists
7445      // within `supported`. If `postType` isn't passed, then the check
7446      // should fail.
7447  
7448      if ('post-thumbnails' === key && Object(external_this_lodash_["isArray"])(supported)) {
7449        return Object(external_this_lodash_["includes"])(supported, postType);
7450      }
7451  
7452      return supported;
7453    });
7454  
7455    if (!isSupported) {
7456      return null;
7457    }
7458  
7459    return children;
7460  }
7461  /* harmony default export */ var theme_support_check = (Object(external_this_wp_data_["withSelect"])(function (select) {
7462    var _select = select('core'),
7463        getThemeSupports = _select.getThemeSupports;
7464  
7465    var _select2 = select('core/editor'),
7466        getEditedPostAttribute = _select2.getEditedPostAttribute;
7467  
7468    return {
7469      postType: getEditedPostAttribute('type'),
7470      themeSupports: getThemeSupports()
7471    };
7472  })(ThemeSupportCheck));
7473  
7474  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-featured-image/check.js
7475  
7476  
7477  
7478  /**
7479   * Internal dependencies
7480   */
7481  
7482  
7483  
7484  function PostFeaturedImageCheck(props) {
7485    return Object(external_this_wp_element_["createElement"])(theme_support_check, {
7486      supportKeys: "post-thumbnails"
7487    }, Object(external_this_wp_element_["createElement"])(post_type_support_check, Object(esm_extends["a" /* default */])({}, props, {
7488      supportKeys: "thumbnail"
7489    })));
7490  }
7491  
7492  /* harmony default export */ var post_featured_image_check = (PostFeaturedImageCheck);
7493  
7494  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-featured-image/index.js
7495  
7496  
7497  
7498  /**
7499   * External dependencies
7500   */
7501  
7502  /**
7503   * WordPress dependencies
7504   */
7505  
7506  
7507  
7508  
7509  
7510  
7511  
7512  /**
7513   * Internal dependencies
7514   */
7515  
7516  
7517  var ALLOWED_MEDIA_TYPES = ['image']; // Used when labels from post type were not yet loaded or when they are not present.
7518  
7519  var DEFAULT_FEATURE_IMAGE_LABEL = Object(external_this_wp_i18n_["__"])('Featured Image');
7520  
7521  var DEFAULT_SET_FEATURE_IMAGE_LABEL = Object(external_this_wp_i18n_["__"])('Set Featured Image');
7522  
7523  var DEFAULT_REMOVE_FEATURE_IMAGE_LABEL = Object(external_this_wp_i18n_["__"])('Remove Image');
7524  
7525  function PostFeaturedImage(_ref) {
7526    var currentPostId = _ref.currentPostId,
7527        featuredImageId = _ref.featuredImageId,
7528        onUpdateImage = _ref.onUpdateImage,
7529        onDropImage = _ref.onDropImage,
7530        onRemoveImage = _ref.onRemoveImage,
7531        media = _ref.media,
7532        postType = _ref.postType,
7533        noticeUI = _ref.noticeUI;
7534    var postLabel = Object(external_this_lodash_["get"])(postType, ['labels'], {});
7535    var instructions = Object(external_this_wp_element_["createElement"])("p", null, Object(external_this_wp_i18n_["__"])('To edit the featured image, you need permission to upload media.'));
7536    var mediaWidth, mediaHeight, mediaSourceUrl;
7537  
7538    if (media) {
7539      var mediaSize = Object(external_this_wp_hooks_["applyFilters"])('editor.PostFeaturedImage.imageSize', 'post-thumbnail', media.id, currentPostId);
7540  
7541      if (Object(external_this_lodash_["has"])(media, ['media_details', 'sizes', mediaSize])) {
7542        // use mediaSize when available
7543        mediaWidth = media.media_details.sizes[mediaSize].width;
7544        mediaHeight = media.media_details.sizes[mediaSize].height;
7545        mediaSourceUrl = media.media_details.sizes[mediaSize].source_url;
7546      } else {
7547        // get fallbackMediaSize if mediaSize is not available
7548        var fallbackMediaSize = Object(external_this_wp_hooks_["applyFilters"])('editor.PostFeaturedImage.imageSize', 'thumbnail', media.id, currentPostId);
7549  
7550        if (Object(external_this_lodash_["has"])(media, ['media_details', 'sizes', fallbackMediaSize])) {
7551          // use fallbackMediaSize when mediaSize is not available
7552          mediaWidth = media.media_details.sizes[fallbackMediaSize].width;
7553          mediaHeight = media.media_details.sizes[fallbackMediaSize].height;
7554          mediaSourceUrl = media.media_details.sizes[fallbackMediaSize].source_url;
7555        } else {
7556          // use full image size when mediaFallbackSize and mediaSize are not available
7557          mediaWidth = media.media_details.width;
7558          mediaHeight = media.media_details.height;
7559          mediaSourceUrl = media.source_url;
7560        }
7561      }
7562    }
7563  
7564    return Object(external_this_wp_element_["createElement"])(post_featured_image_check, null, noticeUI, Object(external_this_wp_element_["createElement"])("div", {
7565      className: "editor-post-featured-image"
7566    }, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["MediaUploadCheck"], {
7567      fallback: instructions
7568    }, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["MediaUpload"], {
7569      title: postLabel.featured_image || DEFAULT_FEATURE_IMAGE_LABEL,
7570      onSelect: onUpdateImage,
7571      unstableFeaturedImageFlow: true,
7572      allowedTypes: ALLOWED_MEDIA_TYPES,
7573      modalClass: !featuredImageId ? 'editor-post-featured-image__media-modal' : 'editor-post-featured-image__media-modal',
7574      render: function render(_ref2) {
7575        var open = _ref2.open;
7576        return Object(external_this_wp_element_["createElement"])("div", {
7577          className: "editor-post-featured-image__container"
7578        }, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
7579          className: !featuredImageId ? 'editor-post-featured-image__toggle' : 'editor-post-featured-image__preview',
7580          onClick: open,
7581          "aria-label": !featuredImageId ? null : Object(external_this_wp_i18n_["__"])('Edit or update the image')
7582        }, !!featuredImageId && media && Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ResponsiveWrapper"], {
7583          naturalWidth: mediaWidth,
7584          naturalHeight: mediaHeight,
7585          isInline: true
7586        }, Object(external_this_wp_element_["createElement"])("img", {
7587          src: mediaSourceUrl,
7588          alt: ""
7589        })), !!featuredImageId && !media && Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Spinner"], null), !featuredImageId && (postLabel.set_featured_image || DEFAULT_SET_FEATURE_IMAGE_LABEL)), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["DropZone"], {
7590          onFilesDrop: onDropImage
7591        }));
7592      },
7593      value: featuredImageId
7594    })), !!featuredImageId && media && !media.isLoading && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["MediaUploadCheck"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["MediaUpload"], {
7595      title: postLabel.featured_image || DEFAULT_FEATURE_IMAGE_LABEL,
7596      onSelect: onUpdateImage,
7597      unstableFeaturedImageFlow: true,
7598      allowedTypes: ALLOWED_MEDIA_TYPES,
7599      modalClass: "editor-post-featured-image__media-modal",
7600      render: function render(_ref3) {
7601        var open = _ref3.open;
7602        return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
7603          onClick: open,
7604          isDefault: true,
7605          isLarge: true
7606        }, Object(external_this_wp_i18n_["__"])('Replace Image'));
7607      }
7608    })), !!featuredImageId && Object(external_this_wp_element_["createElement"])(external_this_wp_blockEditor_["MediaUploadCheck"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
7609      onClick: onRemoveImage,
7610      isLink: true,
7611      isDestructive: true
7612    }, postLabel.remove_featured_image || DEFAULT_REMOVE_FEATURE_IMAGE_LABEL))));
7613  }
7614  
7615  var post_featured_image_applyWithSelect = Object(external_this_wp_data_["withSelect"])(function (select) {
7616    var _select = select('core'),
7617        getMedia = _select.getMedia,
7618        getPostType = _select.getPostType;
7619  
7620    var _select2 = select('core/editor'),
7621        getCurrentPostId = _select2.getCurrentPostId,
7622        getEditedPostAttribute = _select2.getEditedPostAttribute;
7623  
7624    var featuredImageId = getEditedPostAttribute('featured_media');
7625    return {
7626      media: featuredImageId ? getMedia(featuredImageId) : null,
7627      currentPostId: getCurrentPostId(),
7628      postType: getPostType(getEditedPostAttribute('type')),
7629      featuredImageId: featuredImageId
7630    };
7631  });
7632  var post_featured_image_applyWithDispatch = Object(external_this_wp_data_["withDispatch"])(function (dispatch, _ref4, _ref5) {
7633    var noticeOperations = _ref4.noticeOperations;
7634    var select = _ref5.select;
7635  
7636    var _dispatch = dispatch('core/editor'),
7637        editPost = _dispatch.editPost;
7638  
7639    return {
7640      onUpdateImage: function onUpdateImage(image) {
7641        editPost({
7642          featured_media: image.id
7643        });
7644      },
7645      onDropImage: function onDropImage(filesList) {
7646        select('core/block-editor').getSettings().mediaUpload({
7647          allowedTypes: ['image'],
7648          filesList: filesList,
7649          onFileChange: function onFileChange(_ref6) {
7650            var _ref7 = Object(slicedToArray["a" /* default */])(_ref6, 1),
7651                image = _ref7[0];
7652  
7653            editPost({
7654              featured_media: image.id
7655            });
7656          },
7657          onError: function onError(message) {
7658            noticeOperations.removeAllNotices();
7659            noticeOperations.createErrorNotice(message);
7660          }
7661        });
7662      },
7663      onRemoveImage: function onRemoveImage() {
7664        editPost({
7665          featured_media: 0
7666        });
7667      }
7668    };
7669  });
7670  /* harmony default export */ var post_featured_image = (Object(external_this_wp_compose_["compose"])(external_this_wp_components_["withNotices"], post_featured_image_applyWithSelect, post_featured_image_applyWithDispatch, Object(external_this_wp_components_["withFilters"])('editor.PostFeaturedImage'))(PostFeaturedImage));
7671  
7672  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-format/check.js
7673  
7674  
7675  
7676  
7677  /**
7678   * WordPress dependencies
7679   */
7680  
7681  /**
7682   * Internal dependencies
7683   */
7684  
7685  
7686  
7687  function PostFormatCheck(_ref) {
7688    var disablePostFormats = _ref.disablePostFormats,
7689        props = Object(objectWithoutProperties["a" /* default */])(_ref, ["disablePostFormats"]);
7690  
7691    return !disablePostFormats && Object(external_this_wp_element_["createElement"])(post_type_support_check, Object(esm_extends["a" /* default */])({}, props, {
7692      supportKeys: "post-formats"
7693    }));
7694  }
7695  
7696  /* harmony default export */ var post_format_check = (Object(external_this_wp_data_["withSelect"])(function (select) {
7697    var editorSettings = select('core/editor').getEditorSettings();
7698    return {
7699      disablePostFormats: editorSettings.disablePostFormats
7700    };
7701  })(PostFormatCheck));
7702  
7703  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-format/index.js
7704  
7705  
7706  /**
7707   * External dependencies
7708   */
7709  
7710  /**
7711   * WordPress dependencies
7712   */
7713  
7714  
7715  
7716  
7717  
7718  /**
7719   * Internal dependencies
7720   */
7721  
7722  
7723  var POST_FORMATS = [{
7724    id: 'aside',
7725    caption: Object(external_this_wp_i18n_["__"])('Aside')
7726  }, {
7727    id: 'gallery',
7728    caption: Object(external_this_wp_i18n_["__"])('Gallery')
7729  }, {
7730    id: 'link',
7731    caption: Object(external_this_wp_i18n_["__"])('Link')
7732  }, {
7733    id: 'image',
7734    caption: Object(external_this_wp_i18n_["__"])('Image')
7735  }, {
7736    id: 'quote',
7737    caption: Object(external_this_wp_i18n_["__"])('Quote')
7738  }, {
7739    id: 'standard',
7740    caption: Object(external_this_wp_i18n_["__"])('Standard')
7741  }, {
7742    id: 'status',
7743    caption: Object(external_this_wp_i18n_["__"])('Status')
7744  }, {
7745    id: 'video',
7746    caption: Object(external_this_wp_i18n_["__"])('Video')
7747  }, {
7748    id: 'audio',
7749    caption: Object(external_this_wp_i18n_["__"])('Audio')
7750  }, {
7751    id: 'chat',
7752    caption: Object(external_this_wp_i18n_["__"])('Chat')
7753  }];
7754  
7755  function PostFormat(_ref) {
7756    var onUpdatePostFormat = _ref.onUpdatePostFormat,
7757        _ref$postFormat = _ref.postFormat,
7758        postFormat = _ref$postFormat === void 0 ? 'standard' : _ref$postFormat,
7759        supportedFormats = _ref.supportedFormats,
7760        suggestedFormat = _ref.suggestedFormat,
7761        instanceId = _ref.instanceId;
7762    var postFormatSelectorId = 'post-format-selector-' + instanceId;
7763    var formats = POST_FORMATS.filter(function (format) {
7764      return Object(external_this_lodash_["includes"])(supportedFormats, format.id);
7765    });
7766    var suggestion = Object(external_this_lodash_["find"])(formats, function (format) {
7767      return format.id === suggestedFormat;
7768    }); // Disable reason: We need to change the value immiediately to show/hide the suggestion if needed
7769  
7770    return Object(external_this_wp_element_["createElement"])(post_format_check, null, Object(external_this_wp_element_["createElement"])("div", {
7771      className: "editor-post-format"
7772    }, Object(external_this_wp_element_["createElement"])("div", {
7773      className: "editor-post-format__content"
7774    }, Object(external_this_wp_element_["createElement"])("label", {
7775      htmlFor: postFormatSelectorId
7776    }, Object(external_this_wp_i18n_["__"])('Post Format')), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["SelectControl"], {
7777      value: postFormat,
7778      onChange: function onChange(format) {
7779        return onUpdatePostFormat(format);
7780      },
7781      id: postFormatSelectorId,
7782      options: formats.map(function (format) {
7783        return {
7784          label: format.caption,
7785          value: format.id
7786        };
7787      })
7788    })), suggestion && suggestion.id !== postFormat && Object(external_this_wp_element_["createElement"])("div", {
7789      className: "editor-post-format__suggestion"
7790    }, Object(external_this_wp_i18n_["__"])('Suggestion:'), ' ', Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
7791      isLink: true,
7792      onClick: function onClick() {
7793        return onUpdatePostFormat(suggestion.id);
7794      }
7795    }, suggestion.caption))));
7796  }
7797  
7798  /* harmony default export */ var post_format = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select) {
7799    var _select = select('core/editor'),
7800        getEditedPostAttribute = _select.getEditedPostAttribute,
7801        getSuggestedPostFormat = _select.getSuggestedPostFormat;
7802  
7803    var postFormat = getEditedPostAttribute('format');
7804    var themeSupports = select('core').getThemeSupports(); // Ensure current format is always in the set.
7805    // The current format may not be a format supported by the theme.
7806  
7807    var supportedFormats = Object(external_this_lodash_["union"])([postFormat], Object(external_this_lodash_["get"])(themeSupports, ['formats'], []));
7808    return {
7809      postFormat: postFormat,
7810      supportedFormats: supportedFormats,
7811      suggestedFormat: getSuggestedPostFormat()
7812    };
7813  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
7814    return {
7815      onUpdatePostFormat: function onUpdatePostFormat(postFormat) {
7816        dispatch('core/editor').editPost({
7817          format: postFormat
7818        });
7819      }
7820    };
7821  }), external_this_wp_compose_["withInstanceId"]])(PostFormat));
7822  
7823  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-last-revision/check.js
7824  
7825  
7826  /**
7827   * WordPress dependencies
7828   */
7829  
7830  /**
7831   * Internal dependencies
7832   */
7833  
7834  
7835  function PostLastRevisionCheck(_ref) {
7836    var lastRevisionId = _ref.lastRevisionId,
7837        revisionsCount = _ref.revisionsCount,
7838        children = _ref.children;
7839  
7840    if (!lastRevisionId || revisionsCount < 2) {
7841      return null;
7842    }
7843  
7844    return Object(external_this_wp_element_["createElement"])(post_type_support_check, {
7845      supportKeys: "revisions"
7846    }, children);
7847  }
7848  /* harmony default export */ var post_last_revision_check = (Object(external_this_wp_data_["withSelect"])(function (select) {
7849    var _select = select('core/editor'),
7850        getCurrentPostLastRevisionId = _select.getCurrentPostLastRevisionId,
7851        getCurrentPostRevisionsCount = _select.getCurrentPostRevisionsCount;
7852  
7853    return {
7854      lastRevisionId: getCurrentPostLastRevisionId(),
7855      revisionsCount: getCurrentPostRevisionsCount()
7856    };
7857  })(PostLastRevisionCheck));
7858  
7859  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/utils/url.js
7860  /**
7861   * External dependencies
7862   */
7863  
7864  /**
7865   * WordPress dependencies
7866   */
7867  
7868  
7869  /**
7870   * Returns the URL of a WPAdmin Page.
7871   *
7872   * TODO: This should be moved to a module less specific to the editor.
7873   *
7874   * @param {string} page  Page to navigate to.
7875   * @param {Object} query Query Args.
7876   *
7877   * @return {string} WPAdmin URL.
7878   */
7879  
7880  function getWPAdminURL(page, query) {
7881    return Object(external_this_wp_url_["addQueryArgs"])(page, query);
7882  }
7883  /**
7884   * Performs some basic cleanup of a string for use as a post slug
7885   *
7886   * This replicates some of what sanitize_title() does in WordPress core, but
7887   * is only designed to approximate what the slug will be.
7888   *
7889   * Converts whitespace, periods, forward slashes and underscores to hyphens.
7890   * Converts Latin-1 Supplement and Latin Extended-A letters to basic Latin
7891   * letters. Removes combining diacritical marks. Converts remaining string
7892   * to lowercase. It does not touch octets, HTML entities, or other encoded
7893   * characters.
7894   *
7895   * @param {string} string Title or slug to be processed
7896   *
7897   * @return {string} Processed string
7898   */
7899  
7900  function cleanForSlug(string) {
7901    if (!string) {
7902      return '';
7903    }
7904  
7905    return Object(external_this_lodash_["toLower"])(Object(external_this_lodash_["deburr"])(Object(external_this_lodash_["trim"])(string.replace(/[\s\./_]+/g, '-'), '-')));
7906  }
7907  
7908  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-last-revision/index.js
7909  
7910  
7911  /**
7912   * WordPress dependencies
7913   */
7914  
7915  
7916  
7917  /**
7918   * Internal dependencies
7919   */
7920  
7921  
7922  
7923  
7924  function LastRevision(_ref) {
7925    var lastRevisionId = _ref.lastRevisionId,
7926        revisionsCount = _ref.revisionsCount;
7927    return Object(external_this_wp_element_["createElement"])(post_last_revision_check, null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["IconButton"], {
7928      href: getWPAdminURL('revision.php', {
7929        revision: lastRevisionId,
7930        gutenberg: true
7931      }),
7932      className: "editor-post-last-revision__title",
7933      icon: "backup"
7934    }, Object(external_this_wp_i18n_["sprintf"])(Object(external_this_wp_i18n_["_n"])('%d Revision', '%d Revisions', revisionsCount), revisionsCount)));
7935  }
7936  
7937  /* harmony default export */ var post_last_revision = (Object(external_this_wp_data_["withSelect"])(function (select) {
7938    var _select = select('core/editor'),
7939        getCurrentPostLastRevisionId = _select.getCurrentPostLastRevisionId,
7940        getCurrentPostRevisionsCount = _select.getCurrentPostRevisionsCount;
7941  
7942    return {
7943      lastRevisionId: getCurrentPostLastRevisionId(),
7944      revisionsCount: getCurrentPostRevisionsCount()
7945    };
7946  })(LastRevision));
7947  
7948  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-preview-button/index.js
7949  
7950  
7951  
7952  
7953  
7954  
7955  
7956  
7957  /**
7958   * External dependencies
7959   */
7960  
7961  /**
7962   * WordPress dependencies
7963   */
7964  
7965  
7966  
7967  
7968  
7969  
7970  
7971  
7972  function writeInterstitialMessage(targetDocument) {
7973    var markup = Object(external_this_wp_element_["renderToString"])(Object(external_this_wp_element_["createElement"])("div", {
7974      className: "editor-post-preview-button__interstitial-message"
7975    }, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["SVG"], {
7976      xmlns: "http://www.w3.org/2000/svg",
7977      viewBox: "0 0 96 96"
7978    }, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Path"], {
7979      className: "outer",
7980      d: "M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",
7981      fill: "none"
7982    }), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Path"], {
7983      className: "inner",
7984      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",
7985      fill: "none"
7986    })), Object(external_this_wp_element_["createElement"])("p", null, Object(external_this_wp_i18n_["__"])('Generating preview…'))));
7987    markup += "\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\t\t}\n\t\t</style>\n\t";
7988    /**
7989     * Filters the interstitial message shown when generating previews.
7990     *
7991     * @param {string} markup The preview interstitial markup.
7992     */
7993  
7994    markup = Object(external_this_wp_hooks_["applyFilters"])('editor.PostPreview.interstitialMarkup', markup);
7995    targetDocument.write(markup);
7996    targetDocument.title = Object(external_this_wp_i18n_["__"])('Generating preview…');
7997    targetDocument.close();
7998  }
7999  
8000  var post_preview_button_PostPreviewButton =
8001  /*#__PURE__*/
8002  function (_Component) {
8003    Object(inherits["a" /* default */])(PostPreviewButton, _Component);
8004  
8005    function PostPreviewButton() {
8006      var _this;
8007  
8008      Object(classCallCheck["a" /* default */])(this, PostPreviewButton);
8009  
8010      _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(PostPreviewButton).apply(this, arguments));
8011      _this.openPreviewWindow = _this.openPreviewWindow.bind(Object(assertThisInitialized["a" /* default */])(_this));
8012      return _this;
8013    }
8014  
8015    Object(createClass["a" /* default */])(PostPreviewButton, [{
8016      key: "componentDidUpdate",
8017      value: function componentDidUpdate(prevProps) {
8018        var previewLink = this.props.previewLink; // This relies on the window being responsible to unset itself when
8019        // navigation occurs or a new preview window is opened, to avoid
8020        // unintentional forceful redirects.
8021  
8022        if (previewLink && !prevProps.previewLink) {
8023          this.setPreviewWindowLink(previewLink);
8024        }
8025      }
8026      /**
8027       * Sets the preview window's location to the given URL, if a preview window
8028       * exists and is not closed.
8029       *
8030       * @param {string} url URL to assign as preview window location.
8031       */
8032  
8033    }, {
8034      key: "setPreviewWindowLink",
8035      value: function setPreviewWindowLink(url) {
8036        var previewWindow = this.previewWindow;
8037  
8038        if (previewWindow && !previewWindow.closed) {
8039          previewWindow.location = url;
8040        }
8041      }
8042    }, {
8043      key: "getWindowTarget",
8044      value: function getWindowTarget() {
8045        var postId = this.props.postId;
8046        return "wp-preview-".concat(postId);
8047      }
8048    }, {
8049      key: "openPreviewWindow",
8050      value: function openPreviewWindow(event) {
8051        // Our Preview button has its 'href' and 'target' set correctly for a11y
8052        // purposes. Unfortunately, though, we can't rely on the default 'click'
8053        // handler since sometimes it incorrectly opens a new tab instead of reusing
8054        // the existing one.
8055        // https://github.com/WordPress/gutenberg/pull/8330
8056        event.preventDefault(); // Open up a Preview tab if needed. This is where we'll show the preview.
8057  
8058        if (!this.previewWindow || this.previewWindow.closed) {
8059          this.previewWindow = window.open('', this.getWindowTarget());
8060        } // Focus the Preview tab. This might not do anything, depending on the browser's
8061        // and user's preferences.
8062        // https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus
8063  
8064  
8065        this.previewWindow.focus(); // If we don't need to autosave the post before previewing, then we simply
8066        // load the Preview URL in the Preview tab.
8067  
8068        if (!this.props.isAutosaveable) {
8069          this.setPreviewWindowLink(event.target.href);
8070          return;
8071        } // Request an autosave. This happens asynchronously and causes the component
8072        // to update when finished.
8073  
8074  
8075        if (this.props.isDraft) {
8076          this.props.savePost({
8077            isPreview: true
8078          });
8079        } else {
8080          this.props.autosave({
8081            isPreview: true
8082          });
8083        } // Display a 'Generating preview' message in the Preview tab while we wait for the
8084        // autosave to finish.
8085  
8086  
8087        writeInterstitialMessage(this.previewWindow.document);
8088      }
8089    }, {
8090      key: "render",
8091      value: function render() {
8092        var _this$props = this.props,
8093            previewLink = _this$props.previewLink,
8094            currentPostLink = _this$props.currentPostLink,
8095            isSaveable = _this$props.isSaveable; // Link to the `?preview=true` URL if we have it, since this lets us see
8096        // changes that were autosaved since the post was last published. Otherwise,
8097        // just link to the post's URL.
8098  
8099        var href = previewLink || currentPostLink;
8100        return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
8101          isLarge: true,
8102          className: "editor-post-preview",
8103          href: href,
8104          target: this.getWindowTarget(),
8105          disabled: !isSaveable,
8106          onClick: this.openPreviewWindow
8107        }, Object(external_this_wp_i18n_["_x"])('Preview', 'imperative verb'), Object(external_this_wp_element_["createElement"])("span", {
8108          className: "screen-reader-text"
8109        },
8110        /* translators: accessibility text */
8111        Object(external_this_wp_i18n_["__"])('(opens in a new tab)')));
8112      }
8113    }]);
8114  
8115    return PostPreviewButton;
8116  }(external_this_wp_element_["Component"]);
8117  /* harmony default export */ var post_preview_button = (Object(external_this_wp_compose_["compose"])([Object(external_this_wp_data_["withSelect"])(function (select, _ref) {
8118    var forcePreviewLink = _ref.forcePreviewLink,
8119        forceIsAutosaveable = _ref.forceIsAutosaveable;
8120  
8121    var _select = select('core/editor'),
8122        getCurrentPostId = _select.getCurrentPostId,
8123        getCurrentPostAttribute = _select.getCurrentPostAttribute,
8124        getEditedPostAttribute = _select.getEditedPostAttribute,
8125        isEditedPostSaveable = _select.isEditedPostSaveable,
8126        isEditedPostAutosaveable = _select.isEditedPostAutosaveable,
8127        getEditedPostPreviewLink = _select.getEditedPostPreviewLink;
8128  
8129    var _select2 = select('core'),
8130        getPostType = _select2.getPostType;
8131  
8132    var previewLink = getEditedPostPreviewLink();
8133    var postType = getPostType(getEditedPostAttribute('type'));
8134    return {
8135      postId: getCurrentPostId(),
8136      currentPostLink: getCurrentPostAttribute('link'),
8137      previewLink: forcePreviewLink !== undefined ? forcePreviewLink : previewLink,
8138      isSaveable: isEditedPostSaveable(),
8139      isAutosaveable: forceIsAutosaveable || isEditedPostAutosaveable(),
8140      isViewable: Object(external_this_lodash_["get"])(postType, ['viewable'], false),
8141      isDraft: ['draft', 'auto-draft'].indexOf(getEditedPostAttribute('status')) !== -1
8142    };
8143  }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
8144    return {
8145      autosave: dispatch('core/editor').autosave,
8146      savePost: dispatch('core/editor').savePost
8147    };
8148  }), Object(external_this_wp_compose_["ifCondition"])(function (_ref2) {
8149    var isViewable = _ref2.isViewable;
8150    return isViewable;
8151  })])(post_preview_button_PostPreviewButton));
8152  
8153  // CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-locked-modal/index.js
8154  
8155  
8156  
8157  
8158  
8159  
8160  
8161  
8162  /**
8163   * External dependencies
8164   */
8165  
8166  /**
8167   * WordPress dependencies
8168   */
8169  
8170  
8171  
8172  
8173  
8174  
8175  
8176  
8177  /**
8178   * Internal dependencies
8179   */
8180  
8181  
8182  
8183  
8184  var post_locked_modal_PostLockedModal =
8185  /*#__PURE__*/
8186  function (_Component) {
8187    Object(inherits["a" /* default */])(PostLockedModal, _Component);
8188  
8189    function PostLockedModal() {
8190      var _this;
8191  
8192      Object(classCallCheck["a" /* default */])(this, PostLockedModal);
8193  
8194      _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(PostLockedModal).apply(this, arguments));
8195      _this.sendPostLock = _this.sendPostLock.bind(Object(assertThisInitialized["a" /* default */])(_this));
8196      _this.receivePostLock = _this.receivePostLock.bind(Object(assertThisInitialized["a" /* default */])(_this));
8197      _this.releasePostLock = _this.releasePostLock.bind(Object(assertThisInitialized["a" /* default */])(_this));
8198      return _this;
8199    }
8200  
8201    Object(createClass["a" /* default */])(PostLockedModal, [{
8202      key: "componentDidMount",
8203      value: function componentDidMount() {
8204        var hookName = this.getHookName(); // Details on these events on the Heartbeat API docs
8205        // https://developer.wordpress.org/plugins/javascript/heartbeat-api/
8206  
8207        Object(external_this_wp_hooks_["addAction"])('heartbeat.send', hookName, this.sendPostLock);
8208        Object(external_this_wp_hooks_["addAction"])('heartbeat.tick', hookName, this.receivePostLock);
8209      }
8210    }, {
8211      key: "componentWillUnmount",
8212      value: function componentWillUnmount() {
8213        var hookName = this.getHookName();
8214        Object(external_this_wp_hooks_["removeAction"])('heartbeat.send', hookName);
8215        Object(external_this_wp_hooks_["removeAction"])('heartbeat.tick', hookName);
8216      }
8217      /**
8218       * Returns a `@wordpress/hooks` hook name specific to the instance of the
8219       * component.
8220       *
8221       * @return {string} Hook name prefix.
8222       */
8223  
8224    }, {
8225      key: "getHookName",
8226      value: function getHookName() {
8227        var instanceId = this.props.instanceId;
8228        return 'core/editor/post-locked-modal-' + instanceId;
8229      }
8230      /**
8231       * Keep the lock refreshed.
8232       *
8233       * When the user does not send a heartbeat in a heartbeat-tick
8234       * the user is no longer editing and another user can start editing.
8235       *
8236       * @param {Object} data Data to send in the heartbeat request.
8237       */
8238  
8239    }, {
8240      key: "sendPostLock",
8241      value: function sendPostLock(data) {
8242        var _this$props = this.props,
8243            isLocked = _this$props.isLocked,
8244            activePostLock = _this$props.activePostLock,
8245            postId = _this$props.postId;
8246  
8247        if (isLocked) {
8248          return;
8249        }
8250  
8251        data['wp-refresh-post-lock'] = {
8252          lock: activePostLock,
8253          post_id: postId
8254        };
8255      }
8256      /**
8257       * Refresh post locks: update the lock string or show the dialog if somebody has taken over editing.
8258       *
8259       * @param {Object} data Data received in the heartbeat request
8260       */
8261  
8262    }, {
8263      key: "receivePostLock",
8264      value: function receivePostLock(data) {
8265        if (!data['wp-refresh-post-lock']) {
8266          return;
8267        }
8268  
8269        var _this$props2 = this.props,
8270            autosave = _this$props2.autosave,
8271            updatePostLock = _this$props2.updatePostLock;
8272        var received = data['wp-refresh-post-lock'];
8273  
8274        if (received.lock_error) {
8275          // Auto save and display the takeover modal.
8276          autosave();
8277          updatePostLock({
8278            isLocked: true,
8279            isTakeover: true,
8280            user: {
8281              avatar: received.lock_error.avatar_src
8282            }
8283          });
8284        } else if (received.new_lock) {
8285          updatePostLock({
8286            isLocked: false,
8287            activePostLock: received.new_lock
8288          });
8289        }
8290      }
8291      /**
8292       * Unlock the post before the window is exited.
8293       */
8294  
8295    }, {
8296      key: "releasePostLock",
8297      value: function releasePostLock() {
8298        var _this$props3 = this.props,
8299            isLocked = _this$props3.isLocked,
8300            activePostLock = _this$props3.activePostLock,
8301            postLockUtils = _this$props3.postLockUtils,
8302            postId = _this$props3.postId;
8303  
8304        if (isLocked || !activePostLock) {
8305          return;
8306        }
8307  
8308        var data = new window.FormData();
8309        data.append('action', 'wp-remove-post-lock');
8310        data.append('_wpnonce', postLockUtils.unlockNonce);
8311        data.append