[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-includes/js/dist/ -> list-reusable-blocks.js (source)

   1  this["wp"] = this["wp"] || {}; this["wp"]["listReusableBlocks"] =
   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 = 358);
  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  /***/ 11:
 105  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 106  
 107  "use strict";
 108  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; });
 109  function _defineProperties(target, props) {
 110    for (var i = 0; i < props.length; i++) {
 111      var descriptor = props[i];
 112      descriptor.enumerable = descriptor.enumerable || false;
 113      descriptor.configurable = true;
 114      if ("value" in descriptor) descriptor.writable = true;
 115      Object.defineProperty(target, descriptor.key, descriptor);
 116    }
 117  }
 118  
 119  function _createClass(Constructor, protoProps, staticProps) {
 120    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
 121    if (staticProps) _defineProperties(Constructor, staticProps);
 122    return Constructor;
 123  }
 124  
 125  /***/ }),
 126  
 127  /***/ 12:
 128  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 129  
 130  "use strict";
 131  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; });
 132  function _classCallCheck(instance, Constructor) {
 133    if (!(instance instanceof Constructor)) {
 134      throw new TypeError("Cannot call a class as a function");
 135    }
 136  }
 137  
 138  /***/ }),
 139  
 140  /***/ 13:
 141  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 142  
 143  "use strict";
 144  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; });
 145  /* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31);
 146  /* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
 147  
 148  
 149  function _possibleConstructorReturn(self, call) {
 150    if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) {
 151      return call;
 152    }
 153  
 154    return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self);
 155  }
 156  
 157  /***/ }),
 158  
 159  /***/ 14:
 160  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 161  
 162  "use strict";
 163  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; });
 164  function _getPrototypeOf(o) {
 165    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
 166      return o.__proto__ || Object.getPrototypeOf(o);
 167    };
 168    return _getPrototypeOf(o);
 169  }
 170  
 171  /***/ }),
 172  
 173  /***/ 15:
 174  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 175  
 176  "use strict";
 177  
 178  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
 179  function _setPrototypeOf(o, p) {
 180    _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
 181      o.__proto__ = p;
 182      return o;
 183    };
 184  
 185    return _setPrototypeOf(o, p);
 186  }
 187  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
 188  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _inherits; });
 189  
 190  function _inherits(subClass, superClass) {
 191    if (typeof superClass !== "function" && superClass !== null) {
 192      throw new TypeError("Super expression must either be null or a function");
 193    }
 194  
 195    subClass.prototype = Object.create(superClass && superClass.prototype, {
 196      constructor: {
 197        value: subClass,
 198        writable: true,
 199        configurable: true
 200      }
 201    });
 202    if (superClass) _setPrototypeOf(subClass, superClass);
 203  }
 204  
 205  /***/ }),
 206  
 207  /***/ 2:
 208  /***/ (function(module, exports) {
 209  
 210  (function() { module.exports = this["lodash"]; }());
 211  
 212  /***/ }),
 213  
 214  /***/ 20:
 215  /***/ (function(module, exports, __webpack_require__) {
 216  
 217  module.exports = __webpack_require__(47);
 218  
 219  
 220  /***/ }),
 221  
 222  /***/ 3:
 223  /***/ (function(module, exports) {
 224  
 225  (function() { module.exports = this["wp"]["components"]; }());
 226  
 227  /***/ }),
 228  
 229  /***/ 31:
 230  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 231  
 232  "use strict";
 233  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
 234  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); }
 235  
 236  function _typeof(obj) {
 237    if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
 238      _typeof = function _typeof(obj) {
 239        return _typeof2(obj);
 240      };
 241    } else {
 242      _typeof = function _typeof(obj) {
 243        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
 244      };
 245    }
 246  
 247    return _typeof(obj);
 248  }
 249  
 250  /***/ }),
 251  
 252  /***/ 34:
 253  /***/ (function(module, exports) {
 254  
 255  (function() { module.exports = this["wp"]["apiFetch"]; }());
 256  
 257  /***/ }),
 258  
 259  /***/ 358:
 260  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 261  
 262  "use strict";
 263  __webpack_require__.r(__webpack_exports__);
 264  
 265  // EXTERNAL MODULE: external {"this":["wp","element"]}
 266  var external_this_wp_element_ = __webpack_require__(0);
 267  
 268  // EXTERNAL MODULE: external {"this":["wp","i18n"]}
 269  var external_this_wp_i18n_ = __webpack_require__(1);
 270  
 271  // EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
 272  var regenerator = __webpack_require__(20);
 273  var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
 274  
 275  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
 276  var asyncToGenerator = __webpack_require__(43);
 277  
 278  // EXTERNAL MODULE: external "lodash"
 279  var external_lodash_ = __webpack_require__(2);
 280  
 281  // EXTERNAL MODULE: external {"this":["wp","apiFetch"]}
 282  var external_this_wp_apiFetch_ = __webpack_require__(34);
 283  var external_this_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_apiFetch_);
 284  
 285  // CONCATENATED MODULE: ./node_modules/@wordpress/list-reusable-blocks/build-module/utils/file.js
 286  /**
 287   * Downloads a file.
 288   *
 289   * @param {string} fileName    File Name.
 290   * @param {string} content     File Content.
 291   * @param {string} contentType File mime type.
 292   */
 293  function download(fileName, content, contentType) {
 294    var file = new window.Blob([content], {
 295      type: contentType
 296    }); // IE11 can't use the click to download technique
 297    // we use a specific IE11 technique instead.
 298  
 299    if (window.navigator.msSaveOrOpenBlob) {
 300      window.navigator.msSaveOrOpenBlob(file, fileName);
 301    } else {
 302      var a = document.createElement('a');
 303      a.href = URL.createObjectURL(file);
 304      a.download = fileName;
 305      a.style.display = 'none';
 306      document.body.appendChild(a);
 307      a.click();
 308      document.body.removeChild(a);
 309    }
 310  }
 311  /**
 312   * Reads the textual content of the given file.
 313   *
 314   * @param  {File} file        File.
 315   * @return {Promise<string>}  Content of the file.
 316   */
 317  
 318  function readTextFile(file) {
 319    var reader = new window.FileReader();
 320    return new Promise(function (resolve) {
 321      reader.onload = function () {
 322        resolve(reader.result);
 323      };
 324  
 325      reader.readAsText(file);
 326    });
 327  }
 328  
 329  // CONCATENATED MODULE: ./node_modules/@wordpress/list-reusable-blocks/build-module/utils/export.js
 330  
 331  
 332  
 333  /**
 334   * External dependencies
 335   */
 336  
 337  /**
 338   * WordPress dependencies
 339   */
 340  
 341  
 342  /**
 343   * Internal dependencies
 344   */
 345  
 346  
 347  /**
 348   * Export a reusable block as a JSON file.
 349   *
 350   * @param {number} id
 351   */
 352  
 353  function exportReusableBlock(_x) {
 354    return _exportReusableBlock.apply(this, arguments);
 355  }
 356  
 357  function _exportReusableBlock() {
 358    _exportReusableBlock = Object(asyncToGenerator["a" /* default */])(
 359    /*#__PURE__*/
 360    regenerator_default.a.mark(function _callee(id) {
 361      var postType, post, title, content, fileContent, fileName;
 362      return regenerator_default.a.wrap(function _callee$(_context) {
 363        while (1) {
 364          switch (_context.prev = _context.next) {
 365            case 0:
 366              _context.next = 2;
 367              return external_this_wp_apiFetch_default()({
 368                path: "/wp/v2/types/wp_block"
 369              });
 370  
 371            case 2:
 372              postType = _context.sent;
 373              _context.next = 5;
 374              return external_this_wp_apiFetch_default()({
 375                path: "/wp/v2/".concat(postType.rest_base, "/").concat(id, "?context=edit")
 376              });
 377  
 378            case 5:
 379              post = _context.sent;
 380              title = post.title.raw;
 381              content = post.content.raw;
 382              fileContent = JSON.stringify({
 383                __file: 'wp_block',
 384                title: title,
 385                content: content
 386              }, null, 2);
 387              fileName = Object(external_lodash_["kebabCase"])(title) + '.json';
 388              download(fileName, fileContent, 'application/json');
 389  
 390            case 11:
 391            case "end":
 392              return _context.stop();
 393          }
 394        }
 395      }, _callee);
 396    }));
 397    return _exportReusableBlock.apply(this, arguments);
 398  }
 399  
 400  /* harmony default export */ var utils_export = (exportReusableBlock);
 401  
 402  // EXTERNAL MODULE: external {"this":["wp","components"]}
 403  var external_this_wp_components_ = __webpack_require__(3);
 404  
 405  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
 406  var classCallCheck = __webpack_require__(12);
 407  
 408  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
 409  var createClass = __webpack_require__(11);
 410  
 411  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
 412  var possibleConstructorReturn = __webpack_require__(13);
 413  
 414  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
 415  var getPrototypeOf = __webpack_require__(14);
 416  
 417  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
 418  var assertThisInitialized = __webpack_require__(5);
 419  
 420  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
 421  var inherits = __webpack_require__(15);
 422  
 423  // EXTERNAL MODULE: external {"this":["wp","compose"]}
 424  var external_this_wp_compose_ = __webpack_require__(8);
 425  
 426  // CONCATENATED MODULE: ./node_modules/@wordpress/list-reusable-blocks/build-module/utils/import.js
 427  
 428  
 429  
 430  /**
 431   * External dependencies
 432   */
 433  
 434  /**
 435   * WordPress dependencies
 436   */
 437  
 438  
 439  /**
 440   * Internal dependencies
 441   */
 442  
 443  
 444  /**
 445   * Import a reusable block from a JSON file.
 446   *
 447   * @param {File}     file File.
 448   * @return {Promise} Promise returning the imported reusable block.
 449   */
 450  
 451  function importReusableBlock(_x) {
 452    return _importReusableBlock.apply(this, arguments);
 453  }
 454  
 455  function _importReusableBlock() {
 456    _importReusableBlock = Object(asyncToGenerator["a" /* default */])(
 457    /*#__PURE__*/
 458    regenerator_default.a.mark(function _callee(file) {
 459      var fileContent, parsedContent, postType, reusableBlock;
 460      return regenerator_default.a.wrap(function _callee$(_context) {
 461        while (1) {
 462          switch (_context.prev = _context.next) {
 463            case 0:
 464              _context.next = 2;
 465              return readTextFile(file);
 466  
 467            case 2:
 468              fileContent = _context.sent;
 469              _context.prev = 3;
 470              parsedContent = JSON.parse(fileContent);
 471              _context.next = 10;
 472              break;
 473  
 474            case 7:
 475              _context.prev = 7;
 476              _context.t0 = _context["catch"](3);
 477              throw new Error('Invalid JSON file');
 478  
 479            case 10:
 480              if (!(parsedContent.__file !== 'wp_block' || !parsedContent.title || !parsedContent.content || !Object(external_lodash_["isString"])(parsedContent.title) || !Object(external_lodash_["isString"])(parsedContent.content))) {
 481                _context.next = 12;
 482                break;
 483              }
 484  
 485              throw new Error('Invalid Reusable Block JSON file');
 486  
 487            case 12:
 488              _context.next = 14;
 489              return external_this_wp_apiFetch_default()({
 490                path: "/wp/v2/types/wp_block"
 491              });
 492  
 493            case 14:
 494              postType = _context.sent;
 495              _context.next = 17;
 496              return external_this_wp_apiFetch_default()({
 497                path: "/wp/v2/".concat(postType.rest_base),
 498                data: {
 499                  title: parsedContent.title,
 500                  content: parsedContent.content,
 501                  status: 'publish'
 502                },
 503                method: 'POST'
 504              });
 505  
 506            case 17:
 507              reusableBlock = _context.sent;
 508              return _context.abrupt("return", reusableBlock);
 509  
 510            case 19:
 511            case "end":
 512              return _context.stop();
 513          }
 514        }
 515      }, _callee, null, [[3, 7]]);
 516    }));
 517    return _importReusableBlock.apply(this, arguments);
 518  }
 519  
 520  /* harmony default export */ var utils_import = (importReusableBlock);
 521  
 522  // CONCATENATED MODULE: ./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-form/index.js
 523  
 524  
 525  
 526  
 527  
 528  
 529  
 530  
 531  /**
 532   * WordPress dependencies
 533   */
 534  
 535  
 536  
 537  
 538  /**
 539   * Internal dependencies
 540   */
 541  
 542  
 543  
 544  var import_form_ImportForm =
 545  /*#__PURE__*/
 546  function (_Component) {
 547    Object(inherits["a" /* default */])(ImportForm, _Component);
 548  
 549    function ImportForm() {
 550      var _this;
 551  
 552      Object(classCallCheck["a" /* default */])(this, ImportForm);
 553  
 554      _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(ImportForm).apply(this, arguments));
 555      _this.state = {
 556        isLoading: false,
 557        error: null,
 558        file: null
 559      };
 560      _this.isStillMounted = true;
 561      _this.onChangeFile = _this.onChangeFile.bind(Object(assertThisInitialized["a" /* default */])(_this));
 562      _this.onSubmit = _this.onSubmit.bind(Object(assertThisInitialized["a" /* default */])(_this));
 563      return _this;
 564    }
 565  
 566    Object(createClass["a" /* default */])(ImportForm, [{
 567      key: "componentWillUnmount",
 568      value: function componentWillUnmount() {
 569        this.isStillMounted = false;
 570      }
 571    }, {
 572      key: "onChangeFile",
 573      value: function onChangeFile(event) {
 574        this.setState({
 575          file: event.target.files[0]
 576        });
 577      }
 578    }, {
 579      key: "onSubmit",
 580      value: function onSubmit(event) {
 581        var _this2 = this;
 582  
 583        event.preventDefault();
 584        var file = this.state.file;
 585        var onUpload = this.props.onUpload;
 586  
 587        if (!file) {
 588          return;
 589        }
 590  
 591        this.setState({
 592          isLoading: true
 593        });
 594        utils_import(file).then(function (reusableBlock) {
 595          if (!_this2.isStillMounted) {
 596            return;
 597          }
 598  
 599          _this2.setState({
 600            isLoading: false
 601          });
 602  
 603          onUpload(reusableBlock);
 604        }).catch(function (error) {
 605          if (!_this2.isStillMounted) {
 606            return;
 607          }
 608  
 609          var uiMessage;
 610  
 611          switch (error.message) {
 612            case 'Invalid JSON file':
 613              uiMessage = Object(external_this_wp_i18n_["__"])('Invalid JSON file');
 614              break;
 615  
 616            case 'Invalid Reusable Block JSON file':
 617              uiMessage = Object(external_this_wp_i18n_["__"])('Invalid Reusable Block JSON file');
 618              break;
 619  
 620            default:
 621              uiMessage = Object(external_this_wp_i18n_["__"])('Unknown error');
 622          }
 623  
 624          _this2.setState({
 625            isLoading: false,
 626            error: uiMessage
 627          });
 628        });
 629      }
 630    }, {
 631      key: "render",
 632      value: function render() {
 633        var instanceId = this.props.instanceId;
 634        var _this$state = this.state,
 635            file = _this$state.file,
 636            isLoading = _this$state.isLoading,
 637            error = _this$state.error;
 638        var inputId = 'list-reusable-blocks-import-form-' + instanceId;
 639        return Object(external_this_wp_element_["createElement"])("form", {
 640          className: "list-reusable-blocks-import-form",
 641          onSubmit: this.onSubmit
 642        }, error && Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Notice"], {
 643          status: "error"
 644        }, error), Object(external_this_wp_element_["createElement"])("label", {
 645          htmlFor: inputId,
 646          className: "list-reusable-blocks-import-form__label"
 647        }, Object(external_this_wp_i18n_["__"])('File')), Object(external_this_wp_element_["createElement"])("input", {
 648          id: inputId,
 649          type: "file",
 650          onChange: this.onChangeFile
 651        }), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
 652          type: "submit",
 653          isBusy: isLoading,
 654          disabled: !file || isLoading,
 655          isDefault: true,
 656          className: "list-reusable-blocks-import-form__button"
 657        }, Object(external_this_wp_i18n_["_x"])('Import', 'button label')));
 658      }
 659    }]);
 660  
 661    return ImportForm;
 662  }(external_this_wp_element_["Component"]);
 663  
 664  /* harmony default export */ var import_form = (Object(external_this_wp_compose_["withInstanceId"])(import_form_ImportForm));
 665  
 666  // CONCATENATED MODULE: ./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-dropdown/index.js
 667  
 668  
 669  /**
 670   * External dependencies
 671   */
 672  
 673  /**
 674   * WordPress dependencies
 675   */
 676  
 677  
 678  
 679  /**
 680   * Internal dependencies
 681   */
 682  
 683  
 684  
 685  function ImportDropdown(_ref) {
 686    var onUpload = _ref.onUpload;
 687    return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Dropdown"], {
 688      position: "bottom right",
 689      contentClassName: "list-reusable-blocks-import-dropdown__content",
 690      renderToggle: function renderToggle(_ref2) {
 691        var isOpen = _ref2.isOpen,
 692            onToggle = _ref2.onToggle;
 693        return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
 694          type: "button",
 695          "aria-expanded": isOpen,
 696          onClick: onToggle,
 697          isPrimary: true
 698        }, Object(external_this_wp_i18n_["__"])('Import from JSON'));
 699      },
 700      renderContent: function renderContent(_ref3) {
 701        var onClose = _ref3.onClose;
 702        return Object(external_this_wp_element_["createElement"])(import_form, {
 703          onUpload: Object(external_lodash_["flow"])(onClose, onUpload)
 704        });
 705      }
 706    });
 707  }
 708  
 709  /* harmony default export */ var import_dropdown = (ImportDropdown);
 710  
 711  // CONCATENATED MODULE: ./node_modules/@wordpress/list-reusable-blocks/build-module/index.js
 712  
 713  
 714  /**
 715   * WordPress dependencies
 716   */
 717  
 718  
 719  /**
 720   * Internal dependencies
 721   */
 722  
 723  
 724   // Setup Export Links
 725  
 726  document.body.addEventListener('click', function (event) {
 727    if (!event.target.classList.contains('wp-list-reusable-blocks__export')) {
 728      return;
 729    }
 730  
 731    event.preventDefault();
 732    utils_export(event.target.dataset.id);
 733  }); // Setup Import Form
 734  
 735  document.addEventListener('DOMContentLoaded', function () {
 736    var button = document.querySelector('.page-title-action');
 737  
 738    if (!button) {
 739      return;
 740    }
 741  
 742    var showNotice = function showNotice() {
 743      var notice = document.createElement('div');
 744      notice.className = 'notice notice-success is-dismissible';
 745      notice.innerHTML = "<p>".concat(Object(external_this_wp_i18n_["__"])('Reusable block imported successfully!'), "</p>");
 746      var headerEnd = document.querySelector('.wp-header-end');
 747  
 748      if (!headerEnd) {
 749        return;
 750      }
 751  
 752      headerEnd.parentNode.insertBefore(notice, headerEnd);
 753    };
 754  
 755    var container = document.createElement('div');
 756    container.className = 'list-reusable-blocks__container';
 757    button.parentNode.insertBefore(container, button);
 758    Object(external_this_wp_element_["render"])(Object(external_this_wp_element_["createElement"])(import_dropdown, {
 759      onUpload: showNotice
 760    }), container);
 761  });
 762  
 763  
 764  /***/ }),
 765  
 766  /***/ 43:
 767  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 768  
 769  "use strict";
 770  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _asyncToGenerator; });
 771  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
 772    try {
 773      var info = gen[key](arg);
 774      var value = info.value;
 775    } catch (error) {
 776      reject(error);
 777      return;
 778    }
 779  
 780    if (info.done) {
 781      resolve(value);
 782    } else {
 783      Promise.resolve(value).then(_next, _throw);
 784    }
 785  }
 786  
 787  function _asyncToGenerator(fn) {
 788    return function () {
 789      var self = this,
 790          args = arguments;
 791      return new Promise(function (resolve, reject) {
 792        var gen = fn.apply(self, args);
 793  
 794        function _next(value) {
 795          asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
 796        }
 797  
 798        function _throw(err) {
 799          asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
 800        }
 801  
 802        _next(undefined);
 803      });
 804    };
 805  }
 806  
 807  /***/ }),
 808  
 809  /***/ 47:
 810  /***/ (function(module, exports, __webpack_require__) {
 811  
 812  /**
 813   * Copyright (c) 2014-present, Facebook, Inc.
 814   *
 815   * This source code is licensed under the MIT license found in the
 816   * LICENSE file in the root directory of this source tree.
 817   */
 818  
 819  var runtime = (function (exports) {
 820    "use strict";
 821  
 822    var Op = Object.prototype;
 823    var hasOwn = Op.hasOwnProperty;
 824    var undefined; // More compressible than void 0.
 825    var $Symbol = typeof Symbol === "function" ? Symbol : {};
 826    var iteratorSymbol = $Symbol.iterator || "@@iterator";
 827    var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
 828    var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
 829  
 830    function wrap(innerFn, outerFn, self, tryLocsList) {
 831      // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
 832      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
 833      var generator = Object.create(protoGenerator.prototype);
 834      var context = new Context(tryLocsList || []);
 835  
 836      // The ._invoke method unifies the implementations of the .next,
 837      // .throw, and .return methods.
 838      generator._invoke = makeInvokeMethod(innerFn, self, context);
 839  
 840      return generator;
 841    }
 842    exports.wrap = wrap;
 843  
 844    // Try/catch helper to minimize deoptimizations. Returns a completion
 845    // record like context.tryEntries[i].completion. This interface could
 846    // have been (and was previously) designed to take a closure to be
 847    // invoked without arguments, but in all the cases we care about we
 848    // already have an existing method we want to call, so there's no need
 849    // to create a new function object. We can even get away with assuming
 850    // the method takes exactly one argument, since that happens to be true
 851    // in every case, so we don't have to touch the arguments object. The
 852    // only additional allocation required is the completion record, which
 853    // has a stable shape and so hopefully should be cheap to allocate.
 854    function tryCatch(fn, obj, arg) {
 855      try {
 856        return { type: "normal", arg: fn.call(obj, arg) };
 857      } catch (err) {
 858        return { type: "throw", arg: err };
 859      }
 860    }
 861  
 862    var GenStateSuspendedStart = "suspendedStart";
 863    var GenStateSuspendedYield = "suspendedYield";
 864    var GenStateExecuting = "executing";
 865    var GenStateCompleted = "completed";
 866  
 867    // Returning this object from the innerFn has the same effect as
 868    // breaking out of the dispatch switch statement.
 869    var ContinueSentinel = {};
 870  
 871    // Dummy constructor functions that we use as the .constructor and
 872    // .constructor.prototype properties for functions that return Generator
 873    // objects. For full spec compliance, you may wish to configure your
 874    // minifier not to mangle the names of these two functions.
 875    function Generator() {}
 876    function GeneratorFunction() {}
 877    function GeneratorFunctionPrototype() {}
 878  
 879    // This is a polyfill for %IteratorPrototype% for environments that
 880    // don't natively support it.
 881    var IteratorPrototype = {};
 882    IteratorPrototype[iteratorSymbol] = function () {
 883      return this;
 884    };
 885  
 886    var getProto = Object.getPrototypeOf;
 887    var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
 888    if (NativeIteratorPrototype &&
 889        NativeIteratorPrototype !== Op &&
 890        hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
 891      // This environment has a native %IteratorPrototype%; use it instead
 892      // of the polyfill.
 893      IteratorPrototype = NativeIteratorPrototype;
 894    }
 895  
 896    var Gp = GeneratorFunctionPrototype.prototype =
 897      Generator.prototype = Object.create(IteratorPrototype);
 898    GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
 899    GeneratorFunctionPrototype.constructor = GeneratorFunction;
 900    GeneratorFunctionPrototype[toStringTagSymbol] =
 901      GeneratorFunction.displayName = "GeneratorFunction";
 902  
 903    // Helper for defining the .next, .throw, and .return methods of the
 904    // Iterator interface in terms of a single ._invoke method.
 905    function defineIteratorMethods(prototype) {
 906      ["next", "throw", "return"].forEach(function(method) {
 907        prototype[method] = function(arg) {
 908          return this._invoke(method, arg);
 909        };
 910      });
 911    }
 912  
 913    exports.isGeneratorFunction = function(genFun) {
 914      var ctor = typeof genFun === "function" && genFun.constructor;
 915      return ctor
 916        ? ctor === GeneratorFunction ||
 917          // For the native GeneratorFunction constructor, the best we can
 918          // do is to check its .name property.
 919          (ctor.displayName || ctor.name) === "GeneratorFunction"
 920        : false;
 921    };
 922  
 923    exports.mark = function(genFun) {
 924      if (Object.setPrototypeOf) {
 925        Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
 926      } else {
 927        genFun.__proto__ = GeneratorFunctionPrototype;
 928        if (!(toStringTagSymbol in genFun)) {
 929          genFun[toStringTagSymbol] = "GeneratorFunction";
 930        }
 931      }
 932      genFun.prototype = Object.create(Gp);
 933      return genFun;
 934    };
 935  
 936    // Within the body of any async function, `await x` is transformed to
 937    // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
 938    // `hasOwn.call(value, "__await")` to determine if the yielded value is
 939    // meant to be awaited.
 940    exports.awrap = function(arg) {
 941      return { __await: arg };
 942    };
 943  
 944    function AsyncIterator(generator) {
 945      function invoke(method, arg, resolve, reject) {
 946        var record = tryCatch(generator[method], generator, arg);
 947        if (record.type === "throw") {
 948          reject(record.arg);
 949        } else {
 950          var result = record.arg;
 951          var value = result.value;
 952          if (value &&
 953              typeof value === "object" &&
 954              hasOwn.call(value, "__await")) {
 955            return Promise.resolve(value.__await).then(function(value) {
 956              invoke("next", value, resolve, reject);
 957            }, function(err) {
 958              invoke("throw", err, resolve, reject);
 959            });
 960          }
 961  
 962          return Promise.resolve(value).then(function(unwrapped) {
 963            // When a yielded Promise is resolved, its final value becomes
 964            // the .value of the Promise<{value,done}> result for the
 965            // current iteration.
 966            result.value = unwrapped;
 967            resolve(result);
 968          }, function(error) {
 969            // If a rejected Promise was yielded, throw the rejection back
 970            // into the async generator function so it can be handled there.
 971            return invoke("throw", error, resolve, reject);
 972          });
 973        }
 974      }
 975  
 976      var previousPromise;
 977  
 978      function enqueue(method, arg) {
 979        function callInvokeWithMethodAndArg() {
 980          return new Promise(function(resolve, reject) {
 981            invoke(method, arg, resolve, reject);
 982          });
 983        }
 984  
 985        return previousPromise =
 986          // If enqueue has been called before, then we want to wait until
 987          // all previous Promises have been resolved before calling invoke,
 988          // so that results are always delivered in the correct order. If
 989          // enqueue has not been called before, then it is important to
 990          // call invoke immediately, without waiting on a callback to fire,
 991          // so that the async generator function has the opportunity to do
 992          // any necessary setup in a predictable way. This predictability
 993          // is why the Promise constructor synchronously invokes its
 994          // executor callback, and why async functions synchronously
 995          // execute code before the first await. Since we implement simple
 996          // async functions in terms of async generators, it is especially
 997          // important to get this right, even though it requires care.
 998          previousPromise ? previousPromise.then(
 999            callInvokeWithMethodAndArg,
1000            // Avoid propagating failures to Promises returned by later
1001            // invocations of the iterator.
1002            callInvokeWithMethodAndArg
1003          ) : callInvokeWithMethodAndArg();
1004      }
1005  
1006      // Define the unified helper method that is used to implement .next,
1007      // .throw, and .return (see defineIteratorMethods).
1008      this._invoke = enqueue;
1009    }
1010  
1011    defineIteratorMethods(AsyncIterator.prototype);
1012    AsyncIterator.prototype[asyncIteratorSymbol] = function () {
1013      return this;
1014    };
1015    exports.AsyncIterator = AsyncIterator;
1016  
1017    // Note that simple async functions are implemented on top of
1018    // AsyncIterator objects; they just return a Promise for the value of
1019    // the final result produced by the iterator.
1020    exports.async = function(innerFn, outerFn, self, tryLocsList) {
1021      var iter = new AsyncIterator(
1022        wrap(innerFn, outerFn, self, tryLocsList)
1023      );
1024  
1025      return exports.isGeneratorFunction(outerFn)
1026        ? iter // If outerFn is a generator, return the full iterator.
1027        : iter.next().then(function(result) {
1028            return result.done ? result.value : iter.next();
1029          });
1030    };
1031  
1032    function makeInvokeMethod(innerFn, self, context) {
1033      var state = GenStateSuspendedStart;
1034  
1035      return function invoke(method, arg) {
1036        if (state === GenStateExecuting) {
1037          throw new Error("Generator is already running");
1038        }
1039  
1040        if (state === GenStateCompleted) {
1041          if (method === "throw") {
1042            throw arg;
1043          }
1044  
1045          // Be forgiving, per 25.3.3.3.3 of the spec:
1046          // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
1047          return doneResult();
1048        }
1049  
1050        context.method = method;
1051        context.arg = arg;
1052  
1053        while (true) {
1054          var delegate = context.delegate;
1055          if (delegate) {
1056            var delegateResult = maybeInvokeDelegate(delegate, context);
1057            if (delegateResult) {
1058              if (delegateResult === ContinueSentinel) continue;
1059              return delegateResult;
1060            }
1061          }
1062  
1063          if (context.method === "next") {
1064            // Setting context._sent for legacy support of Babel's
1065            // function.sent implementation.
1066            context.sent = context._sent = context.arg;
1067  
1068          } else if (context.method === "throw") {
1069            if (state === GenStateSuspendedStart) {
1070              state = GenStateCompleted;
1071              throw context.arg;
1072            }
1073  
1074            context.dispatchException(context.arg);
1075  
1076          } else if (context.method === "return") {
1077            context.abrupt("return", context.arg);
1078          }
1079  
1080          state = GenStateExecuting;
1081  
1082          var record = tryCatch(innerFn, self, context);
1083          if (record.type === "normal") {
1084            // If an exception is thrown from innerFn, we leave state ===
1085            // GenStateExecuting and loop back for another invocation.
1086            state = context.done
1087              ? GenStateCompleted
1088              : GenStateSuspendedYield;
1089  
1090            if (record.arg === ContinueSentinel) {
1091              continue;
1092            }
1093  
1094            return {
1095              value: record.arg,
1096              done: context.done
1097            };
1098  
1099          } else if (record.type === "throw") {
1100            state = GenStateCompleted;
1101            // Dispatch the exception by looping back around to the
1102            // context.dispatchException(context.arg) call above.
1103            context.method = "throw";
1104            context.arg = record.arg;
1105          }
1106        }
1107      };
1108    }
1109  
1110    // Call delegate.iterator[context.method](context.arg) and handle the
1111    // result, either by returning a { value, done } result from the
1112    // delegate iterator, or by modifying context.method and context.arg,
1113    // setting context.delegate to null, and returning the ContinueSentinel.
1114    function maybeInvokeDelegate(delegate, context) {
1115      var method = delegate.iterator[context.method];
1116      if (method === undefined) {
1117        // A .throw or .return when the delegate iterator has no .throw
1118        // method always terminates the yield* loop.
1119        context.delegate = null;
1120  
1121        if (context.method === "throw") {
1122          // Note: ["return"] must be used for ES3 parsing compatibility.
1123          if (delegate.iterator["return"]) {
1124            // If the delegate iterator has a return method, give it a
1125            // chance to clean up.
1126            context.method = "return";
1127            context.arg = undefined;
1128            maybeInvokeDelegate(delegate, context);
1129  
1130            if (context.method === "throw") {
1131              // If maybeInvokeDelegate(context) changed context.method from
1132              // "return" to "throw", let that override the TypeError below.
1133              return ContinueSentinel;
1134            }
1135          }
1136  
1137          context.method = "throw";
1138          context.arg = new TypeError(
1139            "The iterator does not provide a 'throw' method");
1140        }
1141  
1142        return ContinueSentinel;
1143      }
1144  
1145      var record = tryCatch(method, delegate.iterator, context.arg);
1146  
1147      if (record.type === "throw") {
1148        context.method = "throw";
1149        context.arg = record.arg;
1150        context.delegate = null;
1151        return ContinueSentinel;
1152      }
1153  
1154      var info = record.arg;
1155  
1156      if (! info) {
1157        context.method = "throw";
1158        context.arg = new TypeError("iterator result is not an object");
1159        context.delegate = null;
1160        return ContinueSentinel;
1161      }
1162  
1163      if (info.done) {
1164        // Assign the result of the finished delegate to the temporary
1165        // variable specified by delegate.resultName (see delegateYield).
1166        context[delegate.resultName] = info.value;
1167  
1168        // Resume execution at the desired location (see delegateYield).
1169        context.next = delegate.nextLoc;
1170  
1171        // If context.method was "throw" but the delegate handled the
1172        // exception, let the outer generator proceed normally. If
1173        // context.method was "next", forget context.arg since it has been
1174        // "consumed" by the delegate iterator. If context.method was
1175        // "return", allow the original .return call to continue in the
1176        // outer generator.
1177        if (context.method !== "return") {
1178          context.method = "next";
1179          context.arg = undefined;
1180        }
1181  
1182      } else {
1183        // Re-yield the result returned by the delegate method.
1184        return info;
1185      }
1186  
1187      // The delegate iterator is finished, so forget it and continue with
1188      // the outer generator.
1189      context.delegate = null;
1190      return ContinueSentinel;
1191    }
1192  
1193    // Define Generator.prototype.{next,throw,return} in terms of the
1194    // unified ._invoke helper method.
1195    defineIteratorMethods(Gp);
1196  
1197    Gp[toStringTagSymbol] = "Generator";
1198  
1199    // A Generator should always return itself as the iterator object when the
1200    // @@iterator function is called on it. Some browsers' implementations of the
1201    // iterator prototype chain incorrectly implement this, causing the Generator
1202    // object to not be returned from this call. This ensures that doesn't happen.
1203    // See https://github.com/facebook/regenerator/issues/274 for more details.
1204    Gp[iteratorSymbol] = function() {
1205      return this;
1206    };
1207  
1208    Gp.toString = function() {
1209      return "[object Generator]";
1210    };
1211  
1212    function pushTryEntry(locs) {
1213      var entry = { tryLoc: locs[0] };
1214  
1215      if (1 in locs) {
1216        entry.catchLoc = locs[1];
1217      }
1218  
1219      if (2 in locs) {
1220        entry.finallyLoc = locs[2];
1221        entry.afterLoc = locs[3];
1222      }
1223  
1224      this.tryEntries.push(entry);
1225    }
1226  
1227    function resetTryEntry(entry) {
1228      var record = entry.completion || {};
1229      record.type = "normal";
1230      delete record.arg;
1231      entry.completion = record;
1232    }
1233  
1234    function Context(tryLocsList) {
1235      // The root entry object (effectively a try statement without a catch
1236      // or a finally block) gives us a place to store values thrown from
1237      // locations where there is no enclosing try statement.
1238      this.tryEntries = [{ tryLoc: "root" }];
1239      tryLocsList.forEach(pushTryEntry, this);
1240      this.reset(true);
1241    }
1242  
1243    exports.keys = function(object) {
1244      var keys = [];
1245      for (var key in object) {
1246        keys.push(key);
1247      }
1248      keys.reverse();
1249  
1250      // Rather than returning an object with a next method, we keep
1251      // things simple and return the next function itself.
1252      return function next() {
1253        while (keys.length) {
1254          var key = keys.pop();
1255          if (key in object) {
1256            next.value = key;
1257            next.done = false;
1258            return next;
1259          }
1260        }
1261  
1262        // To avoid creating an additional object, we just hang the .value
1263        // and .done properties off the next function object itself. This
1264        // also ensures that the minifier will not anonymize the function.
1265        next.done = true;
1266        return next;
1267      };
1268    };
1269  
1270    function values(iterable) {
1271      if (iterable) {
1272        var iteratorMethod = iterable[iteratorSymbol];
1273        if (iteratorMethod) {
1274          return iteratorMethod.call(iterable);
1275        }
1276  
1277        if (typeof iterable.next === "function") {
1278          return iterable;
1279        }
1280  
1281        if (!isNaN(iterable.length)) {
1282          var i = -1, next = function next() {
1283            while (++i < iterable.length) {
1284              if (hasOwn.call(iterable, i)) {
1285                next.value = iterable[i];
1286                next.done = false;
1287                return next;
1288              }
1289            }
1290  
1291            next.value = undefined;
1292            next.done = true;
1293  
1294            return next;
1295          };
1296  
1297          return next.next = next;
1298        }
1299      }
1300  
1301      // Return an iterator with no values.
1302      return { next: doneResult };
1303    }
1304    exports.values = values;
1305  
1306    function doneResult() {
1307      return { value: undefined, done: true };
1308    }
1309  
1310    Context.prototype = {
1311      constructor: Context,
1312  
1313      reset: function(skipTempReset) {
1314        this.prev = 0;
1315        this.next = 0;
1316        // Resetting context._sent for legacy support of Babel's
1317        // function.sent implementation.
1318        this.sent = this._sent = undefined;
1319        this.done = false;
1320        this.delegate = null;
1321  
1322        this.method = "next";
1323        this.arg = undefined;
1324  
1325        this.tryEntries.forEach(resetTryEntry);
1326  
1327        if (!skipTempReset) {
1328          for (var name in this) {
1329            // Not sure about the optimal order of these conditions:
1330            if (name.charAt(0) === "t" &&
1331                hasOwn.call(this, name) &&
1332                !isNaN(+name.slice(1))) {
1333              this[name] = undefined;
1334            }
1335          }
1336        }
1337      },
1338  
1339      stop: function() {
1340        this.done = true;
1341  
1342        var rootEntry = this.tryEntries[0];
1343        var rootRecord = rootEntry.completion;
1344        if (rootRecord.type === "throw") {
1345          throw rootRecord.arg;
1346        }
1347  
1348        return this.rval;
1349      },
1350  
1351      dispatchException: function(exception) {
1352        if (this.done) {
1353          throw exception;
1354        }
1355  
1356        var context = this;
1357        function handle(loc, caught) {
1358          record.type = "throw";
1359          record.arg = exception;
1360          context.next = loc;
1361  
1362          if (caught) {
1363            // If the dispatched exception was caught by a catch block,
1364            // then let that catch block handle the exception normally.
1365            context.method = "next";
1366            context.arg = undefined;
1367          }
1368  
1369          return !! caught;
1370        }
1371  
1372        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1373          var entry = this.tryEntries[i];
1374          var record = entry.completion;
1375  
1376          if (entry.tryLoc === "root") {
1377            // Exception thrown outside of any try block that could handle
1378            // it, so set the completion value of the entire function to
1379            // throw the exception.
1380            return handle("end");
1381          }
1382  
1383          if (entry.tryLoc <= this.prev) {
1384            var hasCatch = hasOwn.call(entry, "catchLoc");
1385            var hasFinally = hasOwn.call(entry, "finallyLoc");
1386  
1387            if (hasCatch && hasFinally) {
1388              if (this.prev < entry.catchLoc) {
1389                return handle(entry.catchLoc, true);
1390              } else if (this.prev < entry.finallyLoc) {
1391                return handle(entry.finallyLoc);
1392              }
1393  
1394            } else if (hasCatch) {
1395              if (this.prev < entry.catchLoc) {
1396                return handle(entry.catchLoc, true);
1397              }
1398  
1399            } else if (hasFinally) {
1400              if (this.prev < entry.finallyLoc) {
1401                return handle(entry.finallyLoc);
1402              }
1403  
1404            } else {
1405              throw new Error("try statement without catch or finally");
1406            }
1407          }
1408        }
1409      },
1410  
1411      abrupt: function(type, arg) {
1412        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1413          var entry = this.tryEntries[i];
1414          if (entry.tryLoc <= this.prev &&
1415              hasOwn.call(entry, "finallyLoc") &&
1416              this.prev < entry.finallyLoc) {
1417            var finallyEntry = entry;
1418            break;
1419          }
1420        }
1421  
1422        if (finallyEntry &&
1423            (type === "break" ||
1424             type === "continue") &&
1425            finallyEntry.tryLoc <= arg &&
1426            arg <= finallyEntry.finallyLoc) {
1427          // Ignore the finally entry if control is not jumping to a
1428          // location outside the try/catch block.
1429          finallyEntry = null;
1430        }
1431  
1432        var record = finallyEntry ? finallyEntry.completion : {};
1433        record.type = type;
1434        record.arg = arg;
1435  
1436        if (finallyEntry) {
1437          this.method = "next";
1438          this.next = finallyEntry.finallyLoc;
1439          return ContinueSentinel;
1440        }
1441  
1442        return this.complete(record);
1443      },
1444  
1445      complete: function(record, afterLoc) {
1446        if (record.type === "throw") {
1447          throw record.arg;
1448        }
1449  
1450        if (record.type === "break" ||
1451            record.type === "continue") {
1452          this.next = record.arg;
1453        } else if (record.type === "return") {
1454          this.rval = this.arg = record.arg;
1455          this.method = "return";
1456          this.next = "end";
1457        } else if (record.type === "normal" && afterLoc) {
1458          this.next = afterLoc;
1459        }
1460  
1461        return ContinueSentinel;
1462      },
1463  
1464      finish: function(finallyLoc) {
1465        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1466          var entry = this.tryEntries[i];
1467          if (entry.finallyLoc === finallyLoc) {
1468            this.complete(entry.completion, entry.afterLoc);
1469            resetTryEntry(entry);
1470            return ContinueSentinel;
1471          }
1472        }
1473      },
1474  
1475      "catch": function(tryLoc) {
1476        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1477          var entry = this.tryEntries[i];
1478          if (entry.tryLoc === tryLoc) {
1479            var record = entry.completion;
1480            if (record.type === "throw") {
1481              var thrown = record.arg;
1482              resetTryEntry(entry);
1483            }
1484            return thrown;
1485          }
1486        }
1487  
1488        // The context.catch method must only be called with a location
1489        // argument that corresponds to a known catch block.
1490        throw new Error("illegal catch attempt");
1491      },
1492  
1493      delegateYield: function(iterable, resultName, nextLoc) {
1494        this.delegate = {
1495          iterator: values(iterable),
1496          resultName: resultName,
1497          nextLoc: nextLoc
1498        };
1499  
1500        if (this.method === "next") {
1501          // Deliberately forget the last sent value so that we don't
1502          // accidentally pass it on to the delegate.
1503          this.arg = undefined;
1504        }
1505  
1506        return ContinueSentinel;
1507      }
1508    };
1509  
1510    // Regardless of whether this script is executing as a CommonJS module
1511    // or not, return the runtime object so that we can declare the variable
1512    // regeneratorRuntime in the outer scope, which allows this module to be
1513    // injected easily by `bin/regenerator --include-runtime script.js`.
1514    return exports;
1515  
1516  }(
1517    // If this script is executing as a CommonJS module, use module.exports
1518    // as the regeneratorRuntime namespace. Otherwise create a new empty
1519    // object. Either way, the resulting object will be used to initialize
1520    // the regeneratorRuntime variable at the top of this file.
1521     true ? module.exports : undefined
1522  ));
1523  
1524  try {
1525    regeneratorRuntime = runtime;
1526  } catch (accidentalStrictMode) {
1527    // This module should not be running in strict mode, so the above
1528    // assignment should always work unless something is misconfigured. Just
1529    // in case runtime.js accidentally runs in strict mode, we can escape
1530    // strict mode using a global Function call. This could conceivably fail
1531    // if a Content Security Policy forbids using Function, but in that case
1532    // the proper solution is to fix the accidental strict mode problem. If
1533    // you've misconfigured your bundler to force strict mode and applied a
1534    // CSP to forbid Function, and you're not willing to fix either of those
1535    // problems, please detail your unique predicament in a GitHub issue.
1536    Function("r", "regeneratorRuntime = r")(runtime);
1537  }
1538  
1539  
1540  /***/ }),
1541  
1542  /***/ 5:
1543  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1544  
1545  "use strict";
1546  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; });
1547  function _assertThisInitialized(self) {
1548    if (self === void 0) {
1549      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1550    }
1551  
1552    return self;
1553  }
1554  
1555  /***/ }),
1556  
1557  /***/ 8:
1558  /***/ (function(module, exports) {
1559  
1560  (function() { module.exports = this["wp"]["compose"]; }());
1561  
1562  /***/ })
1563  
1564  /******/ });


Generated: Sat Nov 23 20:47:33 2019 Cross-referenced by PHPXref 0.7