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