[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> redux-routine.js (source)

   1  this["wp"] = this["wp"] || {}; this["wp"]["reduxRoutine"] =
   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 = "+ekt");
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ "+ekt":
  91  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92  
  93  "use strict";
  94  // ESM COMPAT FLAG
  95  __webpack_require__.r(__webpack_exports__);
  96  
  97  // EXPORTS
  98  __webpack_require__.d(__webpack_exports__, "default", function() { return /* binding */ createMiddleware; });
  99  
 100  // CONCATENATED MODULE: ./node_modules/@wordpress/redux-routine/build-module/is-generator.js
 101  /**
 102   * Returns true if the given object is a generator, or false otherwise.
 103   *
 104   * @see https://www.ecma-international.org/ecma-262/6.0/#sec-generator-objects
 105   *
 106   * @param {*} object Object to test.
 107   *
 108   * @return {boolean} Whether object is a generator.
 109   */
 110  function isGenerator(object) {
 111    // Check that iterator (next) and iterable (Symbol.iterator) interfaces are satisfied.
 112    // These checks seem to be compatible with several generator helpers as well as the native implementation.
 113    return !!object && typeof object[Symbol.iterator] === 'function' && typeof object.next === 'function';
 114  }
 115  
 116  // EXTERNAL MODULE: ./node_modules/rungen/dist/index.js
 117  var dist = __webpack_require__("hnoU");
 118  
 119  // EXTERNAL MODULE: external "lodash"
 120  var external_lodash_ = __webpack_require__("YLtl");
 121  
 122  // EXTERNAL MODULE: ./node_modules/is-promise/index.js
 123  var is_promise = __webpack_require__("JlUD");
 124  var is_promise_default = /*#__PURE__*/__webpack_require__.n(is_promise);
 125  
 126  // CONCATENATED MODULE: ./node_modules/@wordpress/redux-routine/build-module/is-action.js
 127  /**
 128   * External dependencies
 129   */
 130  
 131  /**
 132   * Returns true if the given object quacks like an action.
 133   *
 134   * @param {*} object Object to test
 135   *
 136   * @return {boolean}  Whether object is an action.
 137   */
 138  
 139  function isAction(object) {
 140    return Object(external_lodash_["isPlainObject"])(object) && Object(external_lodash_["isString"])(object.type);
 141  }
 142  /**
 143   * Returns true if the given object quacks like an action and has a specific
 144   * action type
 145   *
 146   * @param {*}      object       Object to test
 147   * @param {string} expectedType The expected type for the action.
 148   *
 149   * @return {boolean} Whether object is an action and is of specific type.
 150   */
 151  
 152  function isActionOfType(object, expectedType) {
 153    return isAction(object) && object.type === expectedType;
 154  }
 155  
 156  // CONCATENATED MODULE: ./node_modules/@wordpress/redux-routine/build-module/runtime.js
 157  /**
 158   * External dependencies
 159   */
 160  
 161  
 162  
 163  /**
 164   * Internal dependencies
 165   */
 166  
 167  
 168  /**
 169   * Create a co-routine runtime.
 170   *
 171   * @param {Object}    controls Object of control handlers.
 172   * @param {Function}  dispatch Unhandled action dispatch.
 173   *
 174   * @return {Function} co-routine runtime
 175   */
 176  
 177  function createRuntime(controls = {}, dispatch) {
 178    const rungenControls = Object(external_lodash_["map"])(controls, (control, actionType) => (value, next, iterate, yieldNext, yieldError) => {
 179      if (!isActionOfType(value, actionType)) {
 180        return false;
 181      }
 182  
 183      const routine = control(value);
 184  
 185      if (is_promise_default()(routine)) {
 186        // Async control routine awaits resolution.
 187        routine.then(yieldNext, yieldError);
 188      } else {
 189        yieldNext(routine);
 190      }
 191  
 192      return true;
 193    });
 194  
 195    const unhandledActionControl = (value, next) => {
 196      if (!isAction(value)) {
 197        return false;
 198      }
 199  
 200      dispatch(value);
 201      next();
 202      return true;
 203    };
 204  
 205    rungenControls.push(unhandledActionControl);
 206    const rungenRuntime = Object(dist["create"])(rungenControls);
 207    return action => new Promise((resolve, reject) => rungenRuntime(action, result => {
 208      if (isAction(result)) {
 209        dispatch(result);
 210      }
 211  
 212      resolve(result);
 213    }, reject));
 214  }
 215  
 216  // CONCATENATED MODULE: ./node_modules/@wordpress/redux-routine/build-module/index.js
 217  /**
 218   * Internal dependencies
 219   */
 220  
 221  
 222  /**
 223   * Creates a Redux middleware, given an object of controls where each key is an
 224   * action type for which to act upon, the value a function which returns either
 225   * a promise which is to resolve when evaluation of the action should continue,
 226   * or a value. The value or resolved promise value is assigned on the return
 227   * value of the yield assignment. If the control handler returns undefined, the
 228   * execution is not continued.
 229   *
 230   * @param {Object} controls Object of control handlers.
 231   *
 232   * @return {Function} Co-routine runtime
 233   */
 234  
 235  function createMiddleware(controls = {}) {
 236    return store => {
 237      const runtime = createRuntime(controls, store.dispatch);
 238      return next => action => {
 239        if (!isGenerator(action)) {
 240          return next(action);
 241        }
 242  
 243        return runtime(action);
 244      };
 245    };
 246  }
 247  
 248  
 249  /***/ }),
 250  
 251  /***/ "Hkfj":
 252  /***/ (function(module, exports, __webpack_require__) {
 253  
 254  "use strict";
 255  
 256  
 257  Object.defineProperty(exports, "__esModule", {
 258    value: true
 259  });
 260  var createDispatcher = function createDispatcher() {
 261    var listeners = [];
 262  
 263    return {
 264      subscribe: function subscribe(listener) {
 265        listeners.push(listener);
 266        return function () {
 267          listeners = listeners.filter(function (l) {
 268            return l !== listener;
 269          });
 270        };
 271      },
 272      dispatch: function dispatch(action) {
 273        listeners.slice().forEach(function (listener) {
 274          return listener(action);
 275        });
 276      }
 277    };
 278  };
 279  
 280  exports.default = createDispatcher;
 281  
 282  /***/ }),
 283  
 284  /***/ "JlUD":
 285  /***/ (function(module, exports) {
 286  
 287  module.exports = isPromise;
 288  module.exports.default = isPromise;
 289  
 290  function isPromise(obj) {
 291    return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
 292  }
 293  
 294  
 295  /***/ }),
 296  
 297  /***/ "PERq":
 298  /***/ (function(module, exports, __webpack_require__) {
 299  
 300  "use strict";
 301  
 302  
 303  Object.defineProperty(exports, "__esModule", {
 304    value: true
 305  });
 306  exports.cps = exports.call = undefined;
 307  
 308  var _is = __webpack_require__("qmpp");
 309  
 310  var _is2 = _interopRequireDefault(_is);
 311  
 312  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 313  
 314  function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
 315  
 316  var call = exports.call = function call(value, next, rungen, yieldNext, raiseNext) {
 317    if (!_is2.default.call(value)) return false;
 318    try {
 319      next(value.func.apply(value.context, value.args));
 320    } catch (err) {
 321      raiseNext(err);
 322    }
 323    return true;
 324  };
 325  
 326  var cps = exports.cps = function cps(value, next, rungen, yieldNext, raiseNext) {
 327    var _value$func;
 328  
 329    if (!_is2.default.cps(value)) return false;
 330    (_value$func = value.func).call.apply(_value$func, [null].concat(_toConsumableArray(value.args), [function (err, result) {
 331      if (err) raiseNext(err);else next(result);
 332    }]));
 333    return true;
 334  };
 335  
 336  exports.default = [call, cps];
 337  
 338  /***/ }),
 339  
 340  /***/ "YLtl":
 341  /***/ (function(module, exports) {
 342  
 343  (function() { module.exports = window["lodash"]; }());
 344  
 345  /***/ }),
 346  
 347  /***/ "e6BM":
 348  /***/ (function(module, exports, __webpack_require__) {
 349  
 350  "use strict";
 351  
 352  
 353  Object.defineProperty(exports, "__esModule", {
 354    value: true
 355  });
 356  exports.createChannel = exports.subscribe = exports.cps = exports.apply = exports.call = exports.invoke = exports.delay = exports.race = exports.join = exports.fork = exports.error = exports.all = undefined;
 357  
 358  var _keys = __webpack_require__("tGEh");
 359  
 360  var _keys2 = _interopRequireDefault(_keys);
 361  
 362  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 363  
 364  var all = exports.all = function all(value) {
 365    return {
 366      type: _keys2.default.all,
 367      value: value
 368    };
 369  };
 370  
 371  var error = exports.error = function error(err) {
 372    return {
 373      type: _keys2.default.error,
 374      error: err
 375    };
 376  };
 377  
 378  var fork = exports.fork = function fork(iterator) {
 379    for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
 380      args[_key - 1] = arguments[_key];
 381    }
 382  
 383    return {
 384      type: _keys2.default.fork,
 385      iterator: iterator,
 386      args: args
 387    };
 388  };
 389  
 390  var join = exports.join = function join(task) {
 391    return {
 392      type: _keys2.default.join,
 393      task: task
 394    };
 395  };
 396  
 397  var race = exports.race = function race(competitors) {
 398    return {
 399      type: _keys2.default.race,
 400      competitors: competitors
 401    };
 402  };
 403  
 404  var delay = exports.delay = function delay(timeout) {
 405    return new Promise(function (resolve) {
 406      setTimeout(function () {
 407        return resolve(true);
 408      }, timeout);
 409    });
 410  };
 411  
 412  var invoke = exports.invoke = function invoke(func) {
 413    for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
 414      args[_key2 - 1] = arguments[_key2];
 415    }
 416  
 417    return {
 418      type: _keys2.default.call,
 419      func: func,
 420      context: null,
 421      args: args
 422    };
 423  };
 424  
 425  var call = exports.call = function call(func, context) {
 426    for (var _len3 = arguments.length, args = Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
 427      args[_key3 - 2] = arguments[_key3];
 428    }
 429  
 430    return {
 431      type: _keys2.default.call,
 432      func: func,
 433      context: context,
 434      args: args
 435    };
 436  };
 437  
 438  var apply = exports.apply = function apply(func, context, args) {
 439    return {
 440      type: _keys2.default.call,
 441      func: func,
 442      context: context,
 443      args: args
 444    };
 445  };
 446  
 447  var cps = exports.cps = function cps(func) {
 448    for (var _len4 = arguments.length, args = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
 449      args[_key4 - 1] = arguments[_key4];
 450    }
 451  
 452    return {
 453      type: _keys2.default.cps,
 454      func: func,
 455      args: args
 456    };
 457  };
 458  
 459  var subscribe = exports.subscribe = function subscribe(channel) {
 460    return {
 461      type: _keys2.default.subscribe,
 462      channel: channel
 463    };
 464  };
 465  
 466  var createChannel = exports.createChannel = function createChannel(callback) {
 467    var listeners = [];
 468    var subscribe = function subscribe(l) {
 469      listeners.push(l);
 470      return function () {
 471        return listeners.splice(listeners.indexOf(l), 1);
 472      };
 473    };
 474    var next = function next(val) {
 475      return listeners.forEach(function (l) {
 476        return l(val);
 477      });
 478    };
 479    callback(next);
 480  
 481    return {
 482      subscribe: subscribe
 483    };
 484  };
 485  
 486  /***/ }),
 487  
 488  /***/ "hecb":
 489  /***/ (function(module, exports, __webpack_require__) {
 490  
 491  "use strict";
 492  
 493  
 494  Object.defineProperty(exports, "__esModule", {
 495    value: true
 496  });
 497  exports.race = exports.join = exports.fork = exports.promise = undefined;
 498  
 499  var _is = __webpack_require__("qmpp");
 500  
 501  var _is2 = _interopRequireDefault(_is);
 502  
 503  var _helpers = __webpack_require__("e6BM");
 504  
 505  var _dispatcher = __webpack_require__("Hkfj");
 506  
 507  var _dispatcher2 = _interopRequireDefault(_dispatcher);
 508  
 509  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 510  
 511  var promise = exports.promise = function promise(value, next, rungen, yieldNext, raiseNext) {
 512    if (!_is2.default.promise(value)) return false;
 513    value.then(next, raiseNext);
 514    return true;
 515  };
 516  
 517  var forkedTasks = new Map();
 518  var fork = exports.fork = function fork(value, next, rungen) {
 519    if (!_is2.default.fork(value)) return false;
 520    var task = Symbol('fork');
 521    var dispatcher = (0, _dispatcher2.default)();
 522    forkedTasks.set(task, dispatcher);
 523    rungen(value.iterator.apply(null, value.args), function (result) {
 524      return dispatcher.dispatch(result);
 525    }, function (err) {
 526      return dispatcher.dispatch((0, _helpers.error)(err));
 527    });
 528    var unsubscribe = dispatcher.subscribe(function () {
 529      unsubscribe();
 530      forkedTasks.delete(task);
 531    });
 532    next(task);
 533    return true;
 534  };
 535  
 536  var join = exports.join = function join(value, next, rungen, yieldNext, raiseNext) {
 537    if (!_is2.default.join(value)) return false;
 538    var dispatcher = forkedTasks.get(value.task);
 539    if (!dispatcher) {
 540      raiseNext('join error : task not found');
 541    } else {
 542      (function () {
 543        var unsubscribe = dispatcher.subscribe(function (result) {
 544          unsubscribe();
 545          next(result);
 546        });
 547      })();
 548    }
 549    return true;
 550  };
 551  
 552  var race = exports.race = function race(value, next, rungen, yieldNext, raiseNext) {
 553    if (!_is2.default.race(value)) return false;
 554    var finished = false;
 555    var success = function success(result, k, v) {
 556      if (finished) return;
 557      finished = true;
 558      result[k] = v;
 559      next(result);
 560    };
 561  
 562    var fail = function fail(err) {
 563      if (finished) return;
 564      raiseNext(err);
 565    };
 566    if (_is2.default.array(value.competitors)) {
 567      (function () {
 568        var result = value.competitors.map(function () {
 569          return false;
 570        });
 571        value.competitors.forEach(function (competitor, index) {
 572          rungen(competitor, function (output) {
 573            return success(result, index, output);
 574          }, fail);
 575        });
 576      })();
 577    } else {
 578      (function () {
 579        var result = Object.keys(value.competitors).reduce(function (p, c) {
 580          p[c] = false;
 581          return p;
 582        }, {});
 583        Object.keys(value.competitors).forEach(function (index) {
 584          rungen(value.competitors[index], function (output) {
 585            return success(result, index, output);
 586          }, fail);
 587        });
 588      })();
 589    }
 590    return true;
 591  };
 592  
 593  var subscribe = function subscribe(value, next) {
 594    if (!_is2.default.subscribe(value)) return false;
 595    if (!_is2.default.channel(value.channel)) {
 596      throw new Error('the first argument of "subscribe" must be a valid channel');
 597    }
 598    var unsubscribe = value.channel.subscribe(function (ret) {
 599      unsubscribe && unsubscribe();
 600      next(ret);
 601    });
 602  
 603    return true;
 604  };
 605  
 606  exports.default = [promise, fork, join, race, subscribe];
 607  
 608  /***/ }),
 609  
 610  /***/ "hnoU":
 611  /***/ (function(module, exports, __webpack_require__) {
 612  
 613  "use strict";
 614  
 615  
 616  Object.defineProperty(exports, "__esModule", {
 617    value: true
 618  });
 619  exports.wrapControls = exports.asyncControls = exports.create = undefined;
 620  
 621  var _helpers = __webpack_require__("e6BM");
 622  
 623  Object.keys(_helpers).forEach(function (key) {
 624    if (key === "default") return;
 625    Object.defineProperty(exports, key, {
 626      enumerable: true,
 627      get: function get() {
 628        return _helpers[key];
 629      }
 630    });
 631  });
 632  
 633  var _create = __webpack_require__("vsQm");
 634  
 635  var _create2 = _interopRequireDefault(_create);
 636  
 637  var _async = __webpack_require__("hecb");
 638  
 639  var _async2 = _interopRequireDefault(_async);
 640  
 641  var _wrap = __webpack_require__("PERq");
 642  
 643  var _wrap2 = _interopRequireDefault(_wrap);
 644  
 645  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 646  
 647  exports.create = _create2.default;
 648  exports.asyncControls = _async2.default;
 649  exports.wrapControls = _wrap2.default;
 650  
 651  /***/ }),
 652  
 653  /***/ "k4FQ":
 654  /***/ (function(module, exports, __webpack_require__) {
 655  
 656  "use strict";
 657  
 658  
 659  Object.defineProperty(exports, "__esModule", {
 660    value: true
 661  });
 662  exports.iterator = exports.array = exports.object = exports.error = exports.any = undefined;
 663  
 664  var _is = __webpack_require__("qmpp");
 665  
 666  var _is2 = _interopRequireDefault(_is);
 667  
 668  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 669  
 670  var any = exports.any = function any(value, next, rungen, yieldNext) {
 671    yieldNext(value);
 672    return true;
 673  };
 674  
 675  var error = exports.error = function error(value, next, rungen, yieldNext, raiseNext) {
 676    if (!_is2.default.error(value)) return false;
 677    raiseNext(value.error);
 678    return true;
 679  };
 680  
 681  var object = exports.object = function object(value, next, rungen, yieldNext, raiseNext) {
 682    if (!_is2.default.all(value) || !_is2.default.obj(value.value)) return false;
 683    var result = {};
 684    var keys = Object.keys(value.value);
 685    var count = 0;
 686    var hasError = false;
 687    var gotResultSuccess = function gotResultSuccess(key, ret) {
 688      if (hasError) return;
 689      result[key] = ret;
 690      count++;
 691      if (count === keys.length) {
 692        yieldNext(result);
 693      }
 694    };
 695  
 696    var gotResultError = function gotResultError(key, error) {
 697      if (hasError) return;
 698      hasError = true;
 699      raiseNext(error);
 700    };
 701  
 702    keys.map(function (key) {
 703      rungen(value.value[key], function (ret) {
 704        return gotResultSuccess(key, ret);
 705      }, function (err) {
 706        return gotResultError(key, err);
 707      });
 708    });
 709  
 710    return true;
 711  };
 712  
 713  var array = exports.array = function array(value, next, rungen, yieldNext, raiseNext) {
 714    if (!_is2.default.all(value) || !_is2.default.array(value.value)) return false;
 715    var result = [];
 716    var count = 0;
 717    var hasError = false;
 718    var gotResultSuccess = function gotResultSuccess(key, ret) {
 719      if (hasError) return;
 720      result[key] = ret;
 721      count++;
 722      if (count === value.value.length) {
 723        yieldNext(result);
 724      }
 725    };
 726  
 727    var gotResultError = function gotResultError(key, error) {
 728      if (hasError) return;
 729      hasError = true;
 730      raiseNext(error);
 731    };
 732  
 733    value.value.map(function (v, key) {
 734      rungen(v, function (ret) {
 735        return gotResultSuccess(key, ret);
 736      }, function (err) {
 737        return gotResultError(key, err);
 738      });
 739    });
 740  
 741    return true;
 742  };
 743  
 744  var iterator = exports.iterator = function iterator(value, next, rungen, yieldNext, raiseNext) {
 745    if (!_is2.default.iterator(value)) return false;
 746    rungen(value, next, raiseNext);
 747    return true;
 748  };
 749  
 750  exports.default = [error, iterator, array, object, any];
 751  
 752  /***/ }),
 753  
 754  /***/ "qmpp":
 755  /***/ (function(module, exports, __webpack_require__) {
 756  
 757  "use strict";
 758  
 759  
 760  Object.defineProperty(exports, "__esModule", {
 761    value: true
 762  });
 763  
 764  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
 765  
 766  var _keys = __webpack_require__("tGEh");
 767  
 768  var _keys2 = _interopRequireDefault(_keys);
 769  
 770  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 771  
 772  var is = {
 773    obj: function obj(value) {
 774      return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && !!value;
 775    },
 776    all: function all(value) {
 777      return is.obj(value) && value.type === _keys2.default.all;
 778    },
 779    error: function error(value) {
 780      return is.obj(value) && value.type === _keys2.default.error;
 781    },
 782    array: Array.isArray,
 783    func: function func(value) {
 784      return typeof value === 'function';
 785    },
 786    promise: function promise(value) {
 787      return value && is.func(value.then);
 788    },
 789    iterator: function iterator(value) {
 790      return value && is.func(value.next) && is.func(value.throw);
 791    },
 792    fork: function fork(value) {
 793      return is.obj(value) && value.type === _keys2.default.fork;
 794    },
 795    join: function join(value) {
 796      return is.obj(value) && value.type === _keys2.default.join;
 797    },
 798    race: function race(value) {
 799      return is.obj(value) && value.type === _keys2.default.race;
 800    },
 801    call: function call(value) {
 802      return is.obj(value) && value.type === _keys2.default.call;
 803    },
 804    cps: function cps(value) {
 805      return is.obj(value) && value.type === _keys2.default.cps;
 806    },
 807    subscribe: function subscribe(value) {
 808      return is.obj(value) && value.type === _keys2.default.subscribe;
 809    },
 810    channel: function channel(value) {
 811      return is.obj(value) && is.func(value.subscribe);
 812    }
 813  };
 814  
 815  exports.default = is;
 816  
 817  /***/ }),
 818  
 819  /***/ "tGEh":
 820  /***/ (function(module, exports, __webpack_require__) {
 821  
 822  "use strict";
 823  
 824  
 825  Object.defineProperty(exports, "__esModule", {
 826    value: true
 827  });
 828  var keys = {
 829    all: Symbol('all'),
 830    error: Symbol('error'),
 831    fork: Symbol('fork'),
 832    join: Symbol('join'),
 833    race: Symbol('race'),
 834    call: Symbol('call'),
 835    cps: Symbol('cps'),
 836    subscribe: Symbol('subscribe')
 837  };
 838  
 839  exports.default = keys;
 840  
 841  /***/ }),
 842  
 843  /***/ "vsQm":
 844  /***/ (function(module, exports, __webpack_require__) {
 845  
 846  "use strict";
 847  
 848  
 849  Object.defineProperty(exports, "__esModule", {
 850    value: true
 851  });
 852  
 853  var _builtin = __webpack_require__("k4FQ");
 854  
 855  var _builtin2 = _interopRequireDefault(_builtin);
 856  
 857  var _is = __webpack_require__("qmpp");
 858  
 859  var _is2 = _interopRequireDefault(_is);
 860  
 861  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 862  
 863  function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
 864  
 865  var create = function create() {
 866    var userControls = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
 867  
 868    var controls = [].concat(_toConsumableArray(userControls), _toConsumableArray(_builtin2.default));
 869  
 870    var runtime = function runtime(input) {
 871      var success = arguments.length <= 1 || arguments[1] === undefined ? function () {} : arguments[1];
 872      var error = arguments.length <= 2 || arguments[2] === undefined ? function () {} : arguments[2];
 873  
 874      var iterate = function iterate(gen) {
 875        var yieldValue = function yieldValue(isError) {
 876          return function (ret) {
 877            try {
 878              var _ref = isError ? gen.throw(ret) : gen.next(ret);
 879  
 880              var value = _ref.value;
 881              var done = _ref.done;
 882  
 883              if (done) return success(value);
 884              next(value);
 885            } catch (e) {
 886              return error(e);
 887            }
 888          };
 889        };
 890  
 891        var next = function next(ret) {
 892          controls.some(function (control) {
 893            return control(ret, next, runtime, yieldValue(false), yieldValue(true));
 894          });
 895        };
 896  
 897        yieldValue(false)();
 898      };
 899  
 900      var iterator = _is2.default.iterator(input) ? input : regeneratorRuntime.mark(function _callee() {
 901        return regeneratorRuntime.wrap(function _callee$(_context) {
 902          while (1) {
 903            switch (_context.prev = _context.next) {
 904              case 0:
 905                _context.next = 2;
 906                return input;
 907  
 908              case 2:
 909                return _context.abrupt('return', _context.sent);
 910  
 911              case 3:
 912              case 'end':
 913                return _context.stop();
 914            }
 915          }
 916        }, _callee, this);
 917      })();
 918  
 919      iterate(iterator, success, error);
 920    };
 921  
 922    return runtime;
 923  };
 924  
 925  exports.default = create;
 926  
 927  /***/ })
 928  
 929  /******/ })["default"];


Generated: Wed Jun 16 01:00:05 2021 Cross-referenced by PHPXref 0.7.1