[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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


Generated: Mon Jan 7 01:00:05 2019 Cross-referenced by PHPXref 0.7.1