[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

   1  this["wp"] = this["wp"] || {}; this["wp"]["notices"] =
   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 = 357);
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ 15:
  91  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92  
  93  "use strict";
  94  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
  95  function _defineProperty(obj, key, value) {
  96    if (key in obj) {
  97      Object.defineProperty(obj, key, {
  98        value: value,
  99        enumerable: true,
 100        configurable: true,
 101        writable: true
 102      });
 103    } else {
 104      obj[key] = value;
 105    }
 106  
 107    return obj;
 108  }
 109  
 110  /***/ }),
 111  
 112  /***/ 17:
 113  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 114  
 115  "use strict";
 116  
 117  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
 118  function _arrayWithoutHoles(arr) {
 119    if (Array.isArray(arr)) {
 120      for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
 121        arr2[i] = arr[i];
 122      }
 123  
 124      return arr2;
 125    }
 126  }
 127  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
 128  var iterableToArray = __webpack_require__(34);
 129  
 130  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
 131  function _nonIterableSpread() {
 132    throw new TypeError("Invalid attempt to spread non-iterable instance");
 133  }
 134  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
 135  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _toConsumableArray; });
 136  
 137  
 138  
 139  function _toConsumableArray(arr) {
 140    return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || _nonIterableSpread();
 141  }
 142  
 143  /***/ }),
 144  
 145  /***/ 2:
 146  /***/ (function(module, exports) {
 147  
 148  (function() { module.exports = this["lodash"]; }());
 149  
 150  /***/ }),
 151  
 152  /***/ 23:
 153  /***/ (function(module, exports, __webpack_require__) {
 154  
 155  module.exports = __webpack_require__(54);
 156  
 157  
 158  /***/ }),
 159  
 160  /***/ 34:
 161  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 162  
 163  "use strict";
 164  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
 165  function _iterableToArray(iter) {
 166    if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
 167  }
 168  
 169  /***/ }),
 170  
 171  /***/ 357:
 172  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 173  
 174  "use strict";
 175  __webpack_require__.r(__webpack_exports__);
 176  var actions_namespaceObject = {};
 177  __webpack_require__.r(actions_namespaceObject);
 178  __webpack_require__.d(actions_namespaceObject, "createNotice", function() { return createNotice; });
 179  __webpack_require__.d(actions_namespaceObject, "createSuccessNotice", function() { return createSuccessNotice; });
 180  __webpack_require__.d(actions_namespaceObject, "createInfoNotice", function() { return createInfoNotice; });
 181  __webpack_require__.d(actions_namespaceObject, "createErrorNotice", function() { return createErrorNotice; });
 182  __webpack_require__.d(actions_namespaceObject, "createWarningNotice", function() { return createWarningNotice; });
 183  __webpack_require__.d(actions_namespaceObject, "removeNotice", function() { return removeNotice; });
 184  var selectors_namespaceObject = {};
 185  __webpack_require__.r(selectors_namespaceObject);
 186  __webpack_require__.d(selectors_namespaceObject, "getNotices", function() { return getNotices; });
 187  
 188  // EXTERNAL MODULE: external {"this":["wp","data"]}
 189  var external_this_wp_data_ = __webpack_require__(5);
 190  
 191  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
 192  var toConsumableArray = __webpack_require__(17);
 193  
 194  // EXTERNAL MODULE: external "lodash"
 195  var external_lodash_ = __webpack_require__(2);
 196  
 197  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
 198  var defineProperty = __webpack_require__(15);
 199  
 200  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread.js
 201  var objectSpread = __webpack_require__(7);
 202  
 203  // CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/utils/on-sub-key.js
 204  
 205  
 206  
 207  /**
 208   * Higher-order reducer creator which creates a combined reducer object, keyed
 209   * by a property on the action object.
 210   *
 211   * @param {string} actionProperty Action property by which to key object.
 212   *
 213   * @return {Function} Higher-order reducer.
 214   */
 215  var on_sub_key_onSubKey = function onSubKey(actionProperty) {
 216    return function (reducer) {
 217      return function () {
 218        var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
 219        var action = arguments.length > 1 ? arguments[1] : undefined;
 220        // Retrieve subkey from action. Do not track if undefined; useful for cases
 221        // where reducer is scoped by action shape.
 222        var key = action[actionProperty];
 223  
 224        if (key === undefined) {
 225          return state;
 226        } // Avoid updating state if unchanged. Note that this also accounts for a
 227        // reducer which returns undefined on a key which is not yet tracked.
 228  
 229  
 230        var nextKeyState = reducer(state[key], action);
 231  
 232        if (nextKeyState === state[key]) {
 233          return state;
 234        }
 235  
 236        return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, key, nextKeyState));
 237      };
 238    };
 239  };
 240  /* harmony default export */ var on_sub_key = (on_sub_key_onSubKey);
 241  
 242  // CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/reducer.js
 243  
 244  
 245  /**
 246   * External dependencies
 247   */
 248  
 249  /**
 250   * Internal dependencies
 251   */
 252  
 253  
 254  /**
 255   * Reducer returning the next notices state. The notices state is an object
 256   * where each key is a context, its value an array of notice objects.
 257   *
 258   * @param {Object} state  Current state.
 259   * @param {Object} action Dispatched action.
 260   *
 261   * @return {Object} Updated state.
 262   */
 263  
 264  var notices = on_sub_key('context')(function () {
 265    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
 266    var action = arguments.length > 1 ? arguments[1] : undefined;
 267  
 268    switch (action.type) {
 269      case 'CREATE_NOTICE':
 270        // Avoid duplicates on ID.
 271        return [].concat(Object(toConsumableArray["a" /* default */])(Object(external_lodash_["reject"])(state, {
 272          id: action.notice.id
 273        })), [action.notice]);
 274  
 275      case 'REMOVE_NOTICE':
 276        return Object(external_lodash_["reject"])(state, {
 277          id: action.id
 278        });
 279    }
 280  
 281    return state;
 282  });
 283  /* harmony default export */ var store_reducer = (notices);
 284  
 285  // EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
 286  var regenerator = __webpack_require__(23);
 287  var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
 288  
 289  // CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/constants.js
 290  /**
 291   * Default context to use for notice grouping when not otherwise specified. Its
 292   * specific value doesn't hold much meaning, but it must be reasonably unique
 293   * and, more importantly, referenced consistently in the store implementation.
 294   *
 295   * @type {string}
 296   */
 297  var DEFAULT_CONTEXT = 'global';
 298  /**
 299   * Default notice status.
 300   *
 301   * @type {string}
 302   */
 303  
 304  var DEFAULT_STATUS = 'info';
 305  
 306  // CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/actions.js
 307  
 308  
 309  var _marked =
 310  /*#__PURE__*/
 311  regenerator_default.a.mark(createNotice);
 312  
 313  /**
 314   * External dependencies
 315   */
 316  
 317  /**
 318   * Internal dependencies
 319   */
 320  
 321  
 322  /**
 323   * Yields action objects used in signalling that a notice is to be created.
 324   *
 325   * @param {?string}                status                Notice status.
 326   *                                                       Defaults to `info`.
 327   * @param {string}                 content               Notice message.
 328   * @param {?Object}                options               Notice options.
 329   * @param {?string}                options.context       Context under which to
 330   *                                                       group notice.
 331   * @param {?string}                options.id            Identifier for notice.
 332   *                                                       Automatically assigned
 333   *                                                       if not specified.
 334   * @param {?boolean}               options.isDismissible Whether the notice can
 335   *                                                       be dismissed by user.
 336   *                                                       Defaults to `true`.
 337   * @param {?boolean}               options.speak         Whether the notice
 338   *                                                       content should be
 339   *                                                       announced to screen
 340   *                                                       readers. Defaults to
 341   *                                                       `true`.
 342   * @param {?Array<WPNoticeAction>} options.actions       User actions to be
 343   *                                                       presented with notice.
 344   */
 345  
 346  function createNotice() {
 347    var status,
 348        content,
 349        options,
 350        _options$speak,
 351        speak,
 352        _options$isDismissibl,
 353        isDismissible,
 354        _options$context,
 355        context,
 356        _options$id,
 357        id,
 358        _options$actions,
 359        actions,
 360        __unstableHTML,
 361        _args = arguments;
 362  
 363    return regenerator_default.a.wrap(function createNotice$(_context) {
 364      while (1) {
 365        switch (_context.prev = _context.next) {
 366          case 0:
 367            status = _args.length > 0 && _args[0] !== undefined ? _args[0] : DEFAULT_STATUS;
 368            content = _args.length > 1 ? _args[1] : undefined;
 369            options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {};
 370            _options$speak = options.speak, speak = _options$speak === void 0 ? true : _options$speak, _options$isDismissibl = options.isDismissible, isDismissible = _options$isDismissibl === void 0 ? true : _options$isDismissibl, _options$context = options.context, context = _options$context === void 0 ? DEFAULT_CONTEXT : _options$context, _options$id = options.id, id = _options$id === void 0 ? Object(external_lodash_["uniqueId"])(context) : _options$id, _options$actions = options.actions, actions = _options$actions === void 0 ? [] : _options$actions, __unstableHTML = options.__unstableHTML; // The supported value shape of content is currently limited to plain text
 371            // strings. To avoid setting expectation that e.g. a WPElement could be
 372            // supported, cast to a string.
 373  
 374            content = String(content);
 375  
 376            if (!speak) {
 377              _context.next = 8;
 378              break;
 379            }
 380  
 381            _context.next = 8;
 382            return {
 383              type: 'SPEAK',
 384              message: content
 385            };
 386  
 387          case 8:
 388            _context.next = 10;
 389            return {
 390              type: 'CREATE_NOTICE',
 391              context: context,
 392              notice: {
 393                id: id,
 394                status: status,
 395                content: content,
 396                __unstableHTML: __unstableHTML,
 397                isDismissible: isDismissible,
 398                actions: actions
 399              }
 400            };
 401  
 402          case 10:
 403          case "end":
 404            return _context.stop();
 405        }
 406      }
 407    }, _marked, this);
 408  }
 409  /**
 410   * Returns an action object used in signalling that a success notice is to be
 411   * created. Refer to `createNotice` for options documentation.
 412   *
 413   * @see createNotice
 414   *
 415   * @param {string}  content Notice message.
 416   * @param {?Object} options Optional notice options.
 417   *
 418   * @return {Object} Action object.
 419   */
 420  
 421  function createSuccessNotice(content, options) {
 422    return createNotice('success', content, options);
 423  }
 424  /**
 425   * Returns an action object used in signalling that an info notice is to be
 426   * created. Refer to `createNotice` for options documentation.
 427   *
 428   * @see createNotice
 429   *
 430   * @param {string}  content Notice message.
 431   * @param {?Object} options Optional notice options.
 432   *
 433   * @return {Object} Action object.
 434   */
 435  
 436  function createInfoNotice(content, options) {
 437    return createNotice('info', content, options);
 438  }
 439  /**
 440   * Returns an action object used in signalling that an error notice is to be
 441   * created. Refer to `createNotice` for options documentation.
 442   *
 443   * @see createNotice
 444   *
 445   * @param {string}  content Notice message.
 446   * @param {?Object} options Optional notice options.
 447   *
 448   * @return {Object} Action object.
 449   */
 450  
 451  function createErrorNotice(content, options) {
 452    return createNotice('error', content, options);
 453  }
 454  /**
 455   * Returns an action object used in signalling that a warning notice is to be
 456   * created. Refer to `createNotice` for options documentation.
 457   *
 458   * @see createNotice
 459   *
 460   * @param {string}  content Notice message.
 461   * @param {?Object} options Optional notice options.
 462   *
 463   * @return {Object} Action object.
 464   */
 465  
 466  function createWarningNotice(content, options) {
 467    return createNotice('warning', content, options);
 468  }
 469  /**
 470   * Returns an action object used in signalling that a notice is to be removed.
 471   *
 472   * @param {string}  id      Notice unique identifier.
 473   * @param {?string} context Optional context (grouping) in which the notice is
 474   *                          intended to appear. Defaults to default context.
 475   *
 476   * @return {Object} Action object.
 477   */
 478  
 479  function removeNotice(id) {
 480    var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_CONTEXT;
 481    return {
 482      type: 'REMOVE_NOTICE',
 483      id: id,
 484      context: context
 485    };
 486  }
 487  
 488  // CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/selectors.js
 489  /**
 490   * Internal dependencies
 491   */
 492  
 493  /**
 494   * The default empty set of notices to return when there are no notices
 495   * assigned for a given notices context. This can occur if the getNotices
 496   * selector is called without a notice ever having been created for the
 497   * context. A shared value is used to ensure referential equality between
 498   * sequential selector calls, since otherwise `[] !== []`.
 499   *
 500   * @type {Array}
 501   */
 502  
 503  var DEFAULT_NOTICES = [];
 504  /**
 505   * Notice object.
 506   *
 507   * @property {string}  id               Unique identifier of notice.
 508   * @property {string}  status           Status of notice, one of `success`,
 509   *                                      `info`, `error`, or `warning`. Defaults
 510   *                                      to `info`.
 511   * @property {string}  content          Notice message.
 512   * @property {string}  __unstableHTML   Notice message as raw HTML. Intended to
 513   *                                      serve primarily for compatibility of
 514   *                                      server-rendered notices, and SHOULD NOT
 515   *                                      be used for notices. It is subject to
 516   *                                      removal without notice.
 517   * @property {boolean} isDismissible    Whether the notice can be dismissed by
 518   *                                      user. Defaults to `true`.
 519   * @property {WPNoticeAction[]} actions User actions to present with notice.
 520   *
 521   * @typedef {WPNotice}
 522   */
 523  
 524  /**
 525   * Object describing a user action option associated with a notice.
 526   *
 527   * @property {string}    label    Message to use as action label.
 528   * @property {?string}   url      Optional URL of resource if action incurs
 529   *                                browser navigation.
 530   * @property {?Function} callback Optional function to invoke when action is
 531   *                                triggered by user.
 532   *
 533   * @typedef {WPNoticeAction}
 534   */
 535  
 536  /**
 537   * Returns all notices as an array, optionally for a given context. Defaults to
 538   * the global context.
 539   *
 540   * @param {Object}  state   Notices state.
 541   * @param {?string} context Optional grouping context.
 542   *
 543   * @return {WPNotice[]} Array of notices.
 544   */
 545  
 546  function getNotices(state) {
 547    var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_CONTEXT;
 548    return state[context] || DEFAULT_NOTICES;
 549  }
 550  
 551  // EXTERNAL MODULE: external {"this":["wp","a11y"]}
 552  var external_this_wp_a11y_ = __webpack_require__(48);
 553  
 554  // CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/controls.js
 555  /**
 556   * WordPress dependencies
 557   */
 558  
 559  /* harmony default export */ var controls = ({
 560    SPEAK: function SPEAK(action) {
 561      Object(external_this_wp_a11y_["speak"])(action.message, 'assertive');
 562    }
 563  });
 564  
 565  // CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/index.js
 566  /**
 567   * WordPress dependencies
 568   */
 569  
 570  /**
 571   * Internal dependencies
 572   */
 573  
 574  
 575  
 576  
 577  
 578  /* harmony default export */ var store = (Object(external_this_wp_data_["registerStore"])('core/notices', {
 579    reducer: store_reducer,
 580    actions: actions_namespaceObject,
 581    selectors: selectors_namespaceObject,
 582    controls: controls
 583  }));
 584  
 585  // CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/index.js
 586  /**
 587   * Internal dependencies
 588   */
 589  
 590  
 591  
 592  /***/ }),
 593  
 594  /***/ 48:
 595  /***/ (function(module, exports) {
 596  
 597  (function() { module.exports = this["wp"]["a11y"]; }());
 598  
 599  /***/ }),
 600  
 601  /***/ 5:
 602  /***/ (function(module, exports) {
 603  
 604  (function() { module.exports = this["wp"]["data"]; }());
 605  
 606  /***/ }),
 607  
 608  /***/ 54:
 609  /***/ (function(module, exports, __webpack_require__) {
 610  
 611  /**
 612   * Copyright (c) 2014-present, Facebook, Inc.
 613   *
 614   * This source code is licensed under the MIT license found in the
 615   * LICENSE file in the root directory of this source tree.
 616   */
 617  
 618  var runtime = (function (exports) {
 619    "use strict";
 620  
 621    var Op = Object.prototype;
 622    var hasOwn = Op.hasOwnProperty;
 623    var undefined; // More compressible than void 0.
 624    var $Symbol = typeof Symbol === "function" ? Symbol : {};
 625    var iteratorSymbol = $Symbol.iterator || "@@iterator";
 626    var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
 627    var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
 628  
 629    function wrap(innerFn, outerFn, self, tryLocsList) {
 630      // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
 631      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
 632      var generator = Object.create(protoGenerator.prototype);
 633      var context = new Context(tryLocsList || []);
 634  
 635      // The ._invoke method unifies the implementations of the .next,
 636      // .throw, and .return methods.
 637      generator._invoke = makeInvokeMethod(innerFn, self, context);
 638  
 639      return generator;
 640    }
 641    exports.wrap = wrap;
 642  
 643    // Try/catch helper to minimize deoptimizations. Returns a completion
 644    // record like context.tryEntries[i].completion. This interface could
 645    // have been (and was previously) designed to take a closure to be
 646    // invoked without arguments, but in all the cases we care about we
 647    // already have an existing method we want to call, so there's no need
 648    // to create a new function object. We can even get away with assuming
 649    // the method takes exactly one argument, since that happens to be true
 650    // in every case, so we don't have to touch the arguments object. The
 651    // only additional allocation required is the completion record, which
 652    // has a stable shape and so hopefully should be cheap to allocate.
 653    function tryCatch(fn, obj, arg) {
 654      try {
 655        return { type: "normal", arg: fn.call(obj, arg) };
 656      } catch (err) {
 657        return { type: "throw", arg: err };
 658      }
 659    }
 660  
 661    var GenStateSuspendedStart = "suspendedStart";
 662    var GenStateSuspendedYield = "suspendedYield";
 663    var GenStateExecuting = "executing";
 664    var GenStateCompleted = "completed";
 665  
 666    // Returning this object from the innerFn has the same effect as
 667    // breaking out of the dispatch switch statement.
 668    var ContinueSentinel = {};
 669  
 670    // Dummy constructor functions that we use as the .constructor and
 671    // .constructor.prototype properties for functions that return Generator
 672    // objects. For full spec compliance, you may wish to configure your
 673    // minifier not to mangle the names of these two functions.
 674    function Generator() {}
 675    function GeneratorFunction() {}
 676    function GeneratorFunctionPrototype() {}
 677  
 678    // This is a polyfill for %IteratorPrototype% for environments that
 679    // don't natively support it.
 680    var IteratorPrototype = {};
 681    IteratorPrototype[iteratorSymbol] = function () {
 682      return this;
 683    };
 684  
 685    var getProto = Object.getPrototypeOf;
 686    var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
 687    if (NativeIteratorPrototype &&
 688        NativeIteratorPrototype !== Op &&
 689        hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
 690      // This environment has a native %IteratorPrototype%; use it instead
 691      // of the polyfill.
 692      IteratorPrototype = NativeIteratorPrototype;
 693    }
 694  
 695    var Gp = GeneratorFunctionPrototype.prototype =
 696      Generator.prototype = Object.create(IteratorPrototype);
 697    GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
 698    GeneratorFunctionPrototype.constructor = GeneratorFunction;
 699    GeneratorFunctionPrototype[toStringTagSymbol] =
 700      GeneratorFunction.displayName = "GeneratorFunction";
 701  
 702    // Helper for defining the .next, .throw, and .return methods of the
 703    // Iterator interface in terms of a single ._invoke method.
 704    function defineIteratorMethods(prototype) {
 705      ["next", "throw", "return"].forEach(function(method) {
 706        prototype[method] = function(arg) {
 707          return this._invoke(method, arg);
 708        };
 709      });
 710    }
 711  
 712    exports.isGeneratorFunction = function(genFun) {
 713      var ctor = typeof genFun === "function" && genFun.constructor;
 714      return ctor
 715        ? ctor === GeneratorFunction ||
 716          // For the native GeneratorFunction constructor, the best we can
 717          // do is to check its .name property.
 718          (ctor.displayName || ctor.name) === "GeneratorFunction"
 719        : false;
 720    };
 721  
 722    exports.mark = function(genFun) {
 723      if (Object.setPrototypeOf) {
 724        Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
 725      } else {
 726        genFun.__proto__ = GeneratorFunctionPrototype;
 727        if (!(toStringTagSymbol in genFun)) {
 728          genFun[toStringTagSymbol] = "GeneratorFunction";
 729        }
 730      }
 731      genFun.prototype = Object.create(Gp);
 732      return genFun;
 733    };
 734  
 735    // Within the body of any async function, `await x` is transformed to
 736    // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
 737    // `hasOwn.call(value, "__await")` to determine if the yielded value is
 738    // meant to be awaited.
 739    exports.awrap = function(arg) {
 740      return { __await: arg };
 741    };
 742  
 743    function AsyncIterator(generator) {
 744      function invoke(method, arg, resolve, reject) {
 745        var record = tryCatch(generator[method], generator, arg);
 746        if (record.type === "throw") {
 747          reject(record.arg);
 748        } else {
 749          var result = record.arg;
 750          var value = result.value;
 751          if (value &&
 752              typeof value === "object" &&
 753              hasOwn.call(value, "__await")) {
 754            return Promise.resolve(value.__await).then(function(value) {
 755              invoke("next", value, resolve, reject);
 756            }, function(err) {
 757              invoke("throw", err, resolve, reject);
 758            });
 759          }
 760  
 761          return Promise.resolve(value).then(function(unwrapped) {
 762            // When a yielded Promise is resolved, its final value becomes
 763            // the .value of the Promise<{value,done}> result for the
 764            // current iteration.
 765            result.value = unwrapped;
 766            resolve(result);
 767          }, function(error) {
 768            // If a rejected Promise was yielded, throw the rejection back
 769            // into the async generator function so it can be handled there.
 770            return invoke("throw", error, resolve, reject);
 771          });
 772        }
 773      }
 774  
 775      var previousPromise;
 776  
 777      function enqueue(method, arg) {
 778        function callInvokeWithMethodAndArg() {
 779          return new Promise(function(resolve, reject) {
 780            invoke(method, arg, resolve, reject);
 781          });
 782        }
 783  
 784        return previousPromise =
 785          // If enqueue has been called before, then we want to wait until
 786          // all previous Promises have been resolved before calling invoke,
 787          // so that results are always delivered in the correct order. If
 788          // enqueue has not been called before, then it is important to
 789          // call invoke immediately, without waiting on a callback to fire,
 790          // so that the async generator function has the opportunity to do
 791          // any necessary setup in a predictable way. This predictability
 792          // is why the Promise constructor synchronously invokes its
 793          // executor callback, and why async functions synchronously
 794          // execute code before the first await. Since we implement simple
 795          // async functions in terms of async generators, it is especially
 796          // important to get this right, even though it requires care.
 797          previousPromise ? previousPromise.then(
 798            callInvokeWithMethodAndArg,
 799            // Avoid propagating failures to Promises returned by later
 800            // invocations of the iterator.
 801            callInvokeWithMethodAndArg
 802          ) : callInvokeWithMethodAndArg();
 803      }
 804  
 805      // Define the unified helper method that is used to implement .next,
 806      // .throw, and .return (see defineIteratorMethods).
 807      this._invoke = enqueue;
 808    }
 809  
 810    defineIteratorMethods(AsyncIterator.prototype);
 811    AsyncIterator.prototype[asyncIteratorSymbol] = function () {
 812      return this;
 813    };
 814    exports.AsyncIterator = AsyncIterator;
 815  
 816    // Note that simple async functions are implemented on top of
 817    // AsyncIterator objects; they just return a Promise for the value of
 818    // the final result produced by the iterator.
 819    exports.async = function(innerFn, outerFn, self, tryLocsList) {
 820      var iter = new AsyncIterator(
 821        wrap(innerFn, outerFn, self, tryLocsList)
 822      );
 823  
 824      return exports.isGeneratorFunction(outerFn)
 825        ? iter // If outerFn is a generator, return the full iterator.
 826        : iter.next().then(function(result) {
 827            return result.done ? result.value : iter.next();
 828          });
 829    };
 830  
 831    function makeInvokeMethod(innerFn, self, context) {
 832      var state = GenStateSuspendedStart;
 833  
 834      return function invoke(method, arg) {
 835        if (state === GenStateExecuting) {
 836          throw new Error("Generator is already running");
 837        }
 838  
 839        if (state === GenStateCompleted) {
 840          if (method === "throw") {
 841            throw arg;
 842          }
 843  
 844          // Be forgiving, per 25.3.3.3.3 of the spec:
 845          // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
 846          return doneResult();
 847        }
 848  
 849        context.method = method;
 850        context.arg = arg;
 851  
 852        while (true) {
 853          var delegate = context.delegate;
 854          if (delegate) {
 855            var delegateResult = maybeInvokeDelegate(delegate, context);
 856            if (delegateResult) {
 857              if (delegateResult === ContinueSentinel) continue;
 858              return delegateResult;
 859            }
 860          }
 861  
 862          if (context.method === "next") {
 863            // Setting context._sent for legacy support of Babel's
 864            // function.sent implementation.
 865            context.sent = context._sent = context.arg;
 866  
 867          } else if (context.method === "throw") {
 868            if (state === GenStateSuspendedStart) {
 869              state = GenStateCompleted;
 870              throw context.arg;
 871            }
 872  
 873            context.dispatchException(context.arg);
 874  
 875          } else if (context.method === "return") {
 876            context.abrupt("return", context.arg);
 877          }
 878  
 879          state = GenStateExecuting;
 880  
 881          var record = tryCatch(innerFn, self, context);
 882          if (record.type === "normal") {
 883            // If an exception is thrown from innerFn, we leave state ===
 884            // GenStateExecuting and loop back for another invocation.
 885            state = context.done
 886              ? GenStateCompleted
 887              : GenStateSuspendedYield;
 888  
 889            if (record.arg === ContinueSentinel) {
 890              continue;
 891            }
 892  
 893            return {
 894              value: record.arg,
 895              done: context.done
 896            };
 897  
 898          } else if (record.type === "throw") {
 899            state = GenStateCompleted;
 900            // Dispatch the exception by looping back around to the
 901            // context.dispatchException(context.arg) call above.
 902            context.method = "throw";
 903            context.arg = record.arg;
 904          }
 905        }
 906      };
 907    }
 908  
 909    // Call delegate.iterator[context.method](context.arg) and handle the
 910    // result, either by returning a { value, done } result from the
 911    // delegate iterator, or by modifying context.method and context.arg,
 912    // setting context.delegate to null, and returning the ContinueSentinel.
 913    function maybeInvokeDelegate(delegate, context) {
 914      var method = delegate.iterator[context.method];
 915      if (method === undefined) {
 916        // A .throw or .return when the delegate iterator has no .throw
 917        // method always terminates the yield* loop.
 918        context.delegate = null;
 919  
 920        if (context.method === "throw") {
 921          // Note: ["return"] must be used for ES3 parsing compatibility.
 922          if (delegate.iterator["return"]) {
 923            // If the delegate iterator has a return method, give it a
 924            // chance to clean up.
 925            context.method = "return";
 926            context.arg = undefined;
 927            maybeInvokeDelegate(delegate, context);
 928  
 929            if (context.method === "throw") {
 930              // If maybeInvokeDelegate(context) changed context.method from
 931              // "return" to "throw", let that override the TypeError below.
 932              return ContinueSentinel;
 933            }
 934          }
 935  
 936          context.method = "throw";
 937          context.arg = new TypeError(
 938            "The iterator does not provide a 'throw' method");
 939        }
 940  
 941        return ContinueSentinel;
 942      }
 943  
 944      var record = tryCatch(method, delegate.iterator, context.arg);
 945  
 946      if (record.type === "throw") {
 947        context.method = "throw";
 948        context.arg = record.arg;
 949        context.delegate = null;
 950        return ContinueSentinel;
 951      }
 952  
 953      var info = record.arg;
 954  
 955      if (! info) {
 956        context.method = "throw";
 957        context.arg = new TypeError("iterator result is not an object");
 958        context.delegate = null;
 959        return ContinueSentinel;
 960      }
 961  
 962      if (info.done) {
 963        // Assign the result of the finished delegate to the temporary
 964        // variable specified by delegate.resultName (see delegateYield).
 965        context[delegate.resultName] = info.value;
 966  
 967        // Resume execution at the desired location (see delegateYield).
 968        context.next = delegate.nextLoc;
 969  
 970        // If context.method was "throw" but the delegate handled the
 971        // exception, let the outer generator proceed normally. If
 972        // context.method was "next", forget context.arg since it has been
 973        // "consumed" by the delegate iterator. If context.method was
 974        // "return", allow the original .return call to continue in the
 975        // outer generator.
 976        if (context.method !== "return") {
 977          context.method = "next";
 978          context.arg = undefined;
 979        }
 980  
 981      } else {
 982        // Re-yield the result returned by the delegate method.
 983        return info;
 984      }
 985  
 986      // The delegate iterator is finished, so forget it and continue with
 987      // the outer generator.
 988      context.delegate = null;
 989      return ContinueSentinel;
 990    }
 991  
 992    // Define Generator.prototype.{next,throw,return} in terms of the
 993    // unified ._invoke helper method.
 994    defineIteratorMethods(Gp);
 995  
 996    Gp[toStringTagSymbol] = "Generator";
 997  
 998    // A Generator should always return itself as the iterator object when the
 999    // @@iterator function is called on it. Some browsers' implementations of the
1000    // iterator prototype chain incorrectly implement this, causing the Generator
1001    // object to not be returned from this call. This ensures that doesn't happen.
1002    // See https://github.com/facebook/regenerator/issues/274 for more details.
1003    Gp[iteratorSymbol] = function() {
1004      return this;
1005    };
1006  
1007    Gp.toString = function() {
1008      return "[object Generator]";
1009    };
1010  
1011    function pushTryEntry(locs) {
1012      var entry = { tryLoc: locs[0] };
1013  
1014      if (1 in locs) {
1015        entry.catchLoc = locs[1];
1016      }
1017  
1018      if (2 in locs) {
1019        entry.finallyLoc = locs[2];
1020        entry.afterLoc = locs[3];
1021      }
1022  
1023      this.tryEntries.push(entry);
1024    }
1025  
1026    function resetTryEntry(entry) {
1027      var record = entry.completion || {};
1028      record.type = "normal";
1029      delete record.arg;
1030      entry.completion = record;
1031    }
1032  
1033    function Context(tryLocsList) {
1034      // The root entry object (effectively a try statement without a catch
1035      // or a finally block) gives us a place to store values thrown from
1036      // locations where there is no enclosing try statement.
1037      this.tryEntries = [{ tryLoc: "root" }];
1038      tryLocsList.forEach(pushTryEntry, this);
1039      this.reset(true);
1040    }
1041  
1042    exports.keys = function(object) {
1043      var keys = [];
1044      for (var key in object) {
1045        keys.push(key);
1046      }
1047      keys.reverse();
1048  
1049      // Rather than returning an object with a next method, we keep
1050      // things simple and return the next function itself.
1051      return function next() {
1052        while (keys.length) {
1053          var key = keys.pop();
1054          if (key in object) {
1055            next.value = key;
1056            next.done = false;
1057            return next;
1058          }
1059        }
1060  
1061        // To avoid creating an additional object, we just hang the .value
1062        // and .done properties off the next function object itself. This
1063        // also ensures that the minifier will not anonymize the function.
1064        next.done = true;
1065        return next;
1066      };
1067    };
1068  
1069    function values(iterable) {
1070      if (iterable) {
1071        var iteratorMethod = iterable[iteratorSymbol];
1072        if (iteratorMethod) {
1073          return iteratorMethod.call(iterable);
1074        }
1075  
1076        if (typeof iterable.next === "function") {
1077          return iterable;
1078        }
1079  
1080        if (!isNaN(iterable.length)) {
1081          var i = -1, next = function next() {
1082            while (++i < iterable.length) {
1083              if (hasOwn.call(iterable, i)) {
1084                next.value = iterable[i];
1085                next.done = false;
1086                return next;
1087              }
1088            }
1089  
1090            next.value = undefined;
1091            next.done = true;
1092  
1093            return next;
1094          };
1095  
1096          return next.next = next;
1097        }
1098      }
1099  
1100      // Return an iterator with no values.
1101      return { next: doneResult };
1102    }
1103    exports.values = values;
1104  
1105    function doneResult() {
1106      return { value: undefined, done: true };
1107    }
1108  
1109    Context.prototype = {
1110      constructor: Context,
1111  
1112      reset: function(skipTempReset) {
1113        this.prev = 0;
1114        this.next = 0;
1115        // Resetting context._sent for legacy support of Babel's
1116        // function.sent implementation.
1117        this.sent = this._sent = undefined;
1118        this.done = false;
1119        this.delegate = null;
1120  
1121        this.method = "next";
1122        this.arg = undefined;
1123  
1124        this.tryEntries.forEach(resetTryEntry);
1125  
1126        if (!skipTempReset) {
1127          for (var name in this) {
1128            // Not sure about the optimal order of these conditions:
1129            if (name.charAt(0) === "t" &&
1130                hasOwn.call(this, name) &&
1131                !isNaN(+name.slice(1))) {
1132              this[name] = undefined;
1133            }
1134          }
1135        }
1136      },
1137  
1138      stop: function() {
1139        this.done = true;
1140  
1141        var rootEntry = this.tryEntries[0];
1142        var rootRecord = rootEntry.completion;
1143        if (rootRecord.type === "throw") {
1144          throw rootRecord.arg;
1145        }
1146  
1147        return this.rval;
1148      },
1149  
1150      dispatchException: function(exception) {
1151        if (this.done) {
1152          throw exception;
1153        }
1154  
1155        var context = this;
1156        function handle(loc, caught) {
1157          record.type = "throw";
1158          record.arg = exception;
1159          context.next = loc;
1160  
1161          if (caught) {
1162            // If the dispatched exception was caught by a catch block,
1163            // then let that catch block handle the exception normally.
1164            context.method = "next";
1165            context.arg = undefined;
1166          }
1167  
1168          return !! caught;
1169        }
1170  
1171        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1172          var entry = this.tryEntries[i];
1173          var record = entry.completion;
1174  
1175          if (entry.tryLoc === "root") {
1176            // Exception thrown outside of any try block that could handle
1177            // it, so set the completion value of the entire function to
1178            // throw the exception.
1179            return handle("end");
1180          }
1181  
1182          if (entry.tryLoc <= this.prev) {
1183            var hasCatch = hasOwn.call(entry, "catchLoc");
1184            var hasFinally = hasOwn.call(entry, "finallyLoc");
1185  
1186            if (hasCatch && hasFinally) {
1187              if (this.prev < entry.catchLoc) {
1188                return handle(entry.catchLoc, true);
1189              } else if (this.prev < entry.finallyLoc) {
1190                return handle(entry.finallyLoc);
1191              }
1192  
1193            } else if (hasCatch) {
1194              if (this.prev < entry.catchLoc) {
1195                return handle(entry.catchLoc, true);
1196              }
1197  
1198            } else if (hasFinally) {
1199              if (this.prev < entry.finallyLoc) {
1200                return handle(entry.finallyLoc);
1201              }
1202  
1203            } else {
1204              throw new Error("try statement without catch or finally");
1205            }
1206          }
1207        }
1208      },
1209  
1210      abrupt: function(type, arg) {
1211        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1212          var entry = this.tryEntries[i];
1213          if (entry.tryLoc <= this.prev &&
1214              hasOwn.call(entry, "finallyLoc") &&
1215              this.prev < entry.finallyLoc) {
1216            var finallyEntry = entry;
1217            break;
1218          }
1219        }
1220  
1221        if (finallyEntry &&
1222            (type === "break" ||
1223             type === "continue") &&
1224            finallyEntry.tryLoc <= arg &&
1225            arg <= finallyEntry.finallyLoc) {
1226          // Ignore the finally entry if control is not jumping to a
1227          // location outside the try/catch block.
1228          finallyEntry = null;
1229        }
1230  
1231        var record = finallyEntry ? finallyEntry.completion : {};
1232        record.type = type;
1233        record.arg = arg;
1234  
1235        if (finallyEntry) {
1236          this.method = "next";
1237          this.next = finallyEntry.finallyLoc;
1238          return ContinueSentinel;
1239        }
1240  
1241        return this.complete(record);
1242      },
1243  
1244      complete: function(record, afterLoc) {
1245        if (record.type === "throw") {
1246          throw record.arg;
1247        }
1248  
1249        if (record.type === "break" ||
1250            record.type === "continue") {
1251          this.next = record.arg;
1252        } else if (record.type === "return") {
1253          this.rval = this.arg = record.arg;
1254          this.method = "return";
1255          this.next = "end";
1256        } else if (record.type === "normal" && afterLoc) {
1257          this.next = afterLoc;
1258        }
1259  
1260        return ContinueSentinel;
1261      },
1262  
1263      finish: function(finallyLoc) {
1264        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1265          var entry = this.tryEntries[i];
1266          if (entry.finallyLoc === finallyLoc) {
1267            this.complete(entry.completion, entry.afterLoc);
1268            resetTryEntry(entry);
1269            return ContinueSentinel;
1270          }
1271        }
1272      },
1273  
1274      "catch": function(tryLoc) {
1275        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1276          var entry = this.tryEntries[i];
1277          if (entry.tryLoc === tryLoc) {
1278            var record = entry.completion;
1279            if (record.type === "throw") {
1280              var thrown = record.arg;
1281              resetTryEntry(entry);
1282            }
1283            return thrown;
1284          }
1285        }
1286  
1287        // The context.catch method must only be called with a location
1288        // argument that corresponds to a known catch block.
1289        throw new Error("illegal catch attempt");
1290      },
1291  
1292      delegateYield: function(iterable, resultName, nextLoc) {
1293        this.delegate = {
1294          iterator: values(iterable),
1295          resultName: resultName,
1296          nextLoc: nextLoc
1297        };
1298  
1299        if (this.method === "next") {
1300          // Deliberately forget the last sent value so that we don't
1301          // accidentally pass it on to the delegate.
1302          this.arg = undefined;
1303        }
1304  
1305        return ContinueSentinel;
1306      }
1307    };
1308  
1309    // Regardless of whether this script is executing as a CommonJS module
1310    // or not, return the runtime object so that we can declare the variable
1311    // regeneratorRuntime in the outer scope, which allows this module to be
1312    // injected easily by `bin/regenerator --include-runtime script.js`.
1313    return exports;
1314  
1315  }(
1316    // If this script is executing as a CommonJS module, use module.exports
1317    // as the regeneratorRuntime namespace. Otherwise create a new empty
1318    // object. Either way, the resulting object will be used to initialize
1319    // the regeneratorRuntime variable at the top of this file.
1320     true ? module.exports : undefined
1321  ));
1322  
1323  try {
1324    regeneratorRuntime = runtime;
1325  } catch (accidentalStrictMode) {
1326    // This module should not be running in strict mode, so the above
1327    // assignment should always work unless something is misconfigured. Just
1328    // in case runtime.js accidentally runs in strict mode, we can escape
1329    // strict mode using a global Function call. This could conceivably fail
1330    // if a Content Security Policy forbids using Function, but in that case
1331    // the proper solution is to fix the accidental strict mode problem. If
1332    // you've misconfigured your bundler to force strict mode and applied a
1333    // CSP to forbid Function, and you're not willing to fix either of those
1334    // problems, please detail your unique predicament in a GitHub issue.
1335    Function("r", "regeneratorRuntime = r")(runtime);
1336  }
1337  
1338  
1339  /***/ }),
1340  
1341  /***/ 7:
1342  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1343  
1344  "use strict";
1345  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread; });
1346  /* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
1347  
1348  function _objectSpread(target) {
1349    for (var i = 1; i < arguments.length; i++) {
1350      var source = arguments[i] != null ? arguments[i] : {};
1351      var ownKeys = Object.keys(source);
1352  
1353      if (typeof Object.getOwnPropertySymbols === 'function') {
1354        ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
1355          return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1356        }));
1357      }
1358  
1359      ownKeys.forEach(function (key) {
1360        Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]);
1361      });
1362    }
1363  
1364    return target;
1365  }
1366  
1367  /***/ })
1368  
1369  /******/ });


Generated: Sun Sep 15 01:00:03 2019 Cross-referenced by PHPXref 0.7.1