Skip to content
Snippets Groups Projects
index.js 8.75 MiB
Newer Older
  • Learn to ignore specific revisions
  • var baseGet = __webpack_require__(1514);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /**
     * A specialized version of `baseProperty` which supports deep paths.
     *
     * @private
     * @param {Array|string} path The path of the property to get.
     * @returns {Function} Returns the new accessor function.
     */
    function basePropertyDeep(path) {
      return function(object) {
        return baseGet(object, path);
      };
    }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = basePropertyDeep;
    
    /***/ }),
    /* 1567 */
    /***/ (function(module, exports) {
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /** Error message constants. */
    var FUNC_ERROR_TEXT = 'Expected a function';
    
    Romain CREY's avatar
    Romain CREY committed
    
    /**
    
     * Creates a function that negates the result of the predicate `func`. The
     * `func` predicate is invoked with the `this` binding and arguments of the
     * created function.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Function
     * @param {Function} predicate The predicate to negate.
     * @returns {Function} Returns the new negated function.
     * @example
     *
     * function isEven(n) {
     *   return n % 2 == 0;
     * }
     *
     * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
     * // => [1, 3, 5]
    
    Romain CREY's avatar
    Romain CREY committed
     */
    
    function negate(predicate) {
      if (typeof predicate != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
    
    Romain CREY's avatar
    Romain CREY committed
      }
    
      return function() {
        var args = arguments;
        switch (args.length) {
          case 0: return !predicate.call(this);
          case 1: return !predicate.call(this, args[0]);
          case 2: return !predicate.call(this, args[0], args[1]);
          case 3: return !predicate.call(this, args[0], args[1], args[2]);
        }
        return !predicate.apply(this, args);
      };
    
    Romain CREY's avatar
    Romain CREY committed
    }
    
    
    module.exports = negate;
    
    /***/ }),
    /* 1568 */
    /***/ (function(module, exports, __webpack_require__) {
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    var arrayMap = __webpack_require__(1395),
        baseIteratee = __webpack_require__(1545),
        basePickBy = __webpack_require__(1532),
        getAllKeysIn = __webpack_require__(1483);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /**
     * Creates an object composed of the `object` properties `predicate` returns
     * truthy for. The predicate is invoked with two arguments: (value, key).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Object
     * @param {Object} object The source object.
     * @param {Function} [predicate=_.identity] The function invoked per property.
     * @returns {Object} Returns the new object.
     * @example
     *
     * var object = { 'a': 1, 'b': '2', 'c': 3 };
     *
     * _.pickBy(object, _.isNumber);
     * // => { 'a': 1, 'c': 3 }
     */
    function pickBy(object, predicate) {
      if (object == null) {
        return {};
    
    Romain CREY's avatar
    Romain CREY committed
      }
    
      var props = arrayMap(getAllKeysIn(object), function(prop) {
        return [prop];
      });
      predicate = baseIteratee(predicate);
      return basePickBy(object, props, function(value, path) {
        return predicate(value, path[0]);
      });
    
    Romain CREY's avatar
    Romain CREY committed
    }
    
    
    module.exports = pickBy;
    
    /***/ }),
    /* 1569 */
    /***/ (function(module, exports) {
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /**
     * Checks if `value` is `undefined`.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
     * @example
     *
     * _.isUndefined(void 0);
     * // => true
     *
     * _.isUndefined(null);
     * // => false
     */
    function isUndefined(value) {
      return value === undefined;
    
    Romain CREY's avatar
    Romain CREY committed
    }
    
    
    module.exports = isUndefined;
    
    /***/ }),
    /* 1570 */
    /***/ (function(module, exports) {
    
    Romain CREY's avatar
    Romain CREY committed
    
    /**
    
     * The inverse of `_.toPairs`; this method returns an object composed
     * from key-value `pairs`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {Array} pairs The key-value pairs.
     * @returns {Object} Returns the new object.
     * @example
     *
     * _.fromPairs([['a', 1], ['b', 2]]);
     * // => { 'a': 1, 'b': 2 }
    
    Romain CREY's avatar
    Romain CREY committed
     */
    
    function fromPairs(pairs) {
      var index = -1,
          length = pairs == null ? 0 : pairs.length,
          result = {};
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      while (++index < length) {
        var pair = pairs[index];
        result[pair[0]] = pair[1];
    
    Romain CREY's avatar
    Romain CREY committed
      }
    
    Romain CREY's avatar
    Romain CREY committed
    }
    
    
    module.exports = fromPairs;
    
    
    /***/ }),
    /* 1571 */
    /***/ (function(module, exports, __webpack_require__) {
    
    var baseFlatten = __webpack_require__(1521),
        map = __webpack_require__(1572);
    
    
    Romain CREY's avatar
    Romain CREY committed
    /**
    
     * Creates a flattened array of values by running each element in `collection`
     * thru `iteratee` and flattening the mapped results. The iteratee is invoked
     * with three arguments: (value, index|key, collection).
    
    Romain CREY's avatar
    Romain CREY committed
     *
    
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @returns {Array} Returns the new flattened array.
     * @example
     *
     * function duplicate(n) {
     *   return [n, n];
     * }
     *
     * _.flatMap([1, 2], duplicate);
     * // => [1, 1, 2, 2]
    
    Romain CREY's avatar
    Romain CREY committed
     */
    
    function flatMap(collection, iteratee) {
      return baseFlatten(map(collection, iteratee), 1);
    
    Romain CREY's avatar
    Romain CREY committed
    }
    
    
    module.exports = flatMap;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /***/ }),
    
    Romain CREY's avatar
    Romain CREY committed
    /***/ (function(module, exports, __webpack_require__) {
    
    
    var arrayMap = __webpack_require__(1395),
        baseIteratee = __webpack_require__(1545),
        baseMap = __webpack_require__(1573),
        isArray = __webpack_require__(1453);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /**
     * Creates an array of values by running each element in `collection` thru
     * `iteratee`. The iteratee is invoked with three arguments:
     * (value, index|key, collection).
     *
     * Many lodash methods are guarded to work as iteratees for methods like
     * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
     *
     * The guarded methods are:
     * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
     * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
     * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
     * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @returns {Array} Returns the new mapped array.
     * @example
     *
     * function square(n) {
     *   return n * n;
     * }
     *
     * _.map([4, 8], square);
     * // => [16, 64]
     *
     * _.map({ 'a': 4, 'b': 8 }, square);
     * // => [16, 64] (iteration order is not guaranteed)
     *
     * var users = [
     *   { 'user': 'barney' },
     *   { 'user': 'fred' }
     * ];
     *
     * // The `_.property` iteratee shorthand.
     * _.map(users, 'user');
     * // => ['barney', 'fred']
     */
    function map(collection, iteratee) {
      var func = isArray(collection) ? arrayMap : baseMap;
      return func(collection, baseIteratee(iteratee, 3));
    
    Romain CREY's avatar
    Romain CREY committed
    }
    
    
    module.exports = map;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /***/ }),
    
    Romain CREY's avatar
    Romain CREY committed
    /***/ (function(module, exports, __webpack_require__) {
    
    
    var baseEach = __webpack_require__(1574),
        isArrayLike = __webpack_require__(1466);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /**
     * The base implementation of `_.map` without support for iteratee shorthands.
     *
     * @private
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {Array} Returns the new mapped array.
     */
    function baseMap(collection, iteratee) {
      var index = -1,
          result = isArrayLike(collection) ? Array(collection.length) : [];
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      baseEach(collection, function(value, key, collection) {
        result[++index] = iteratee(value, key, collection);
      });
      return result;
    }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = baseMap;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /***/ }),
    
    Romain CREY's avatar
    Romain CREY committed
    /***/ (function(module, exports, __webpack_require__) {
    
    
    var baseForOwn = __webpack_require__(1575),
        createBaseEach = __webpack_require__(1578);
    
    Romain CREY's avatar
    Romain CREY committed
    
    /**
    
     * The base implementation of `_.forEach` without support for iteratee shorthands.
    
    Romain CREY's avatar
    Romain CREY committed
     *
    
     * @private
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {Array|Object} Returns `collection`.
    
    Romain CREY's avatar
    Romain CREY committed
     */
    
    var baseEach = createBaseEach(baseForOwn);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = baseEach;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /***/ }),
    
    Romain CREY's avatar
    Romain CREY committed
    /***/ (function(module, exports, __webpack_require__) {
    
    
    var baseFor = __webpack_require__(1576),
        keys = __webpack_require__(1447);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /**
     * The base implementation of `_.forOwn` without support for iteratee shorthands.
     *
     * @private
     * @param {Object} object The object to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {Object} Returns `object`.
     */
    function baseForOwn(object, iteratee) {
      return object && baseFor(object, iteratee, keys);
    }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = baseForOwn;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /***/ }),
    
    Romain CREY's avatar
    Romain CREY committed
    /***/ (function(module, exports, __webpack_require__) {
    
    
    var createBaseFor = __webpack_require__(1577);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /**
     * The base implementation of `baseForOwn` which iterates over `object`
     * properties returned by `keysFunc` and invokes `iteratee` for each property.
     * Iteratee functions may exit iteration early by explicitly returning `false`.
     *
     * @private
     * @param {Object} object The object to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @param {Function} keysFunc The function to get the keys of `object`.
     * @returns {Object} Returns `object`.
     */
    var baseFor = createBaseFor();
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = baseFor;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /***/ }),
    
    /* 1577 */
    /***/ (function(module, exports) {
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /**
     * Creates a base function for methods like `_.forIn` and `_.forOwn`.
     *
     * @private
     * @param {boolean} [fromRight] Specify iterating from right to left.
     * @returns {Function} Returns the new base function.
     */
    function createBaseFor(fromRight) {
      return function(object, iteratee, keysFunc) {
        var index = -1,
            iterable = Object(object),
            props = keysFunc(object),
            length = props.length;
    
        while (length--) {
          var key = props[fromRight ? length : ++index];
          if (iteratee(iterable[key], key, iterable) === false) {
            break;
          }
        }
        return object;
      };
    }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = createBaseFor;
    
    /***/ }),
    /* 1578 */
    /***/ (function(module, exports, __webpack_require__) {
    
    var isArrayLike = __webpack_require__(1466);
    
    Romain CREY's avatar
    Romain CREY committed
    
    /**
    
     * Creates a `baseEach` or `baseEachRight` function.
    
    Romain CREY's avatar
    Romain CREY committed
     *
    
     * @private
     * @param {Function} eachFunc The function to iterate over a collection.
     * @param {boolean} [fromRight] Specify iterating from right to left.
     * @returns {Function} Returns the new base function.
    
    Romain CREY's avatar
    Romain CREY committed
     */
    
    function createBaseEach(eachFunc, fromRight) {
      return function(collection, iteratee) {
        if (collection == null) {
          return collection;
    
    Romain CREY's avatar
    Romain CREY committed
        }
    
        if (!isArrayLike(collection)) {
          return eachFunc(collection, iteratee);
        }
        var length = collection.length,
            index = fromRight ? length : -1,
            iterable = Object(collection);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
        while ((fromRight ? index-- : ++index < length)) {
          if (iteratee(iterable[index], index, iterable) === false) {
            break;
    
    Romain CREY's avatar
    Romain CREY committed
          }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = createBaseEach;
    
    /***/ }),
    /* 1579 */
    /***/ (function(module, exports, __webpack_require__) {
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    var baseAssignValue = __webpack_require__(1443),
        createAggregator = __webpack_require__(1580);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /** Used for built-in method references. */
    var objectProto = Object.prototype;
    
    /** Used to check objects for own properties. */
    var hasOwnProperty = objectProto.hasOwnProperty;
    
    /**
     * Creates an object composed of keys generated from the results of running
     * each element of `collection` thru `iteratee`. The order of grouped values
     * is determined by the order they occur in `collection`. The corresponding
     * value of each key is an array of elements responsible for generating the
     * key. The iteratee is invoked with one argument: (value).
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
     * @returns {Object} Returns the composed aggregate object.
     * @example
     *
     * _.groupBy([6.1, 4.2, 6.3], Math.floor);
     * // => { '4': [4.2], '6': [6.1, 6.3] }
     *
     * // The `_.property` iteratee shorthand.
     * _.groupBy(['one', 'two', 'three'], 'length');
     * // => { '3': ['one', 'two'], '5': ['three'] }
     */
    var groupBy = createAggregator(function(result, value, key) {
      if (hasOwnProperty.call(result, key)) {
        result[key].push(value);
      } else {
        baseAssignValue(result, key, [value]);
    
    Romain CREY's avatar
    Romain CREY committed
      }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = groupBy;
    
    /***/ }),
    /* 1580 */
    /***/ (function(module, exports, __webpack_require__) {
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    var arrayAggregator = __webpack_require__(1581),
        baseAggregator = __webpack_require__(1582),
        baseIteratee = __webpack_require__(1545),
        isArray = __webpack_require__(1453);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /**
     * Creates a function like `_.groupBy`.
     *
     * @private
     * @param {Function} setter The function to set accumulator values.
     * @param {Function} [initializer] The accumulator object initializer.
     * @returns {Function} Returns the new aggregator function.
     */
    function createAggregator(setter, initializer) {
      return function(collection, iteratee) {
        var func = isArray(collection) ? arrayAggregator : baseAggregator,
            accumulator = initializer ? initializer() : {};
    
    Romain CREY's avatar
    Romain CREY committed
    
    
        return func(collection, setter, baseIteratee(iteratee, 2), accumulator);
      };
    }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = createAggregator;
    
    /***/ }),
    /* 1581 */
    /***/ (function(module, exports) {
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /**
     * A specialized version of `baseAggregator` for arrays.
     *
     * @private
     * @param {Array} [array] The array to iterate over.
     * @param {Function} setter The function to set `accumulator` values.
     * @param {Function} iteratee The iteratee to transform keys.
     * @param {Object} accumulator The initial aggregated object.
     * @returns {Function} Returns `accumulator`.
     */
    function arrayAggregator(array, setter, iteratee, accumulator) {
      var index = -1,
          length = array == null ? 0 : array.length;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      while (++index < length) {
        var value = array[index];
        setter(accumulator, value, iteratee(value), array);
    
    Romain CREY's avatar
    Romain CREY committed
      }
    
      return accumulator;
    
    Romain CREY's avatar
    Romain CREY committed
    }
    
    
    module.exports = arrayAggregator;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /***/ }),
    
    Romain CREY's avatar
    Romain CREY committed
    /***/ (function(module, exports, __webpack_require__) {
    
    
    var baseEach = __webpack_require__(1574);
    
    Romain CREY's avatar
    Romain CREY committed
    
    /**
    
     * Aggregates elements of `collection` on `accumulator` with keys transformed
     * by `iteratee` and values set by `setter`.
     *
     * @private
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} setter The function to set `accumulator` values.
     * @param {Function} iteratee The iteratee to transform keys.
     * @param {Object} accumulator The initial aggregated object.
     * @returns {Function} Returns `accumulator`.
    
    Romain CREY's avatar
    Romain CREY committed
     */
    
    function baseAggregator(collection, setter, iteratee, accumulator) {
      baseEach(collection, function(value, key, collection) {
        setter(accumulator, value, iteratee(value), collection);
      });
      return accumulator;
    }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = baseAggregator;
    
    /***/ }),
    /* 1583 */
    /***/ (function(module, exports, __webpack_require__) {
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    var baseFlatten = __webpack_require__(1521),
        baseOrderBy = __webpack_require__(1584),
        baseRest = __webpack_require__(1588),
        isIterateeCall = __webpack_require__(1589);
    
    Romain CREY's avatar
    Romain CREY committed
    
    /**
    
     * Creates an array of elements, sorted in ascending order by the results of
     * running each element in a collection thru each iteratee. This method
     * performs a stable sort, that is, it preserves the original sort order of
     * equal elements. The iteratees are invoked with one argument: (value).
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {...(Function|Function[])} [iteratees=[_.identity]]
     *  The iteratees to sort by.
     * @returns {Array} Returns the new sorted array.
     * @example
     *
     * var users = [
     *   { 'user': 'fred',   'age': 48 },
     *   { 'user': 'barney', 'age': 36 },
     *   { 'user': 'fred',   'age': 40 },
     *   { 'user': 'barney', 'age': 34 }
     * ];
     *
     * _.sortBy(users, [function(o) { return o.user; }]);
     * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
     *
     * _.sortBy(users, ['user', 'age']);
     * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
    
    Romain CREY's avatar
    Romain CREY committed
     */
    
    var sortBy = baseRest(function(collection, iteratees) {
      if (collection == null) {
        return [];
      }
      var length = iteratees.length;
      if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
        iteratees = [];
      } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
        iteratees = [iteratees[0]];
      }
      return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
    });
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = sortBy;
    
    /***/ }),
    /* 1584 */
    /***/ (function(module, exports, __webpack_require__) {
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    var arrayMap = __webpack_require__(1395),
        baseIteratee = __webpack_require__(1545),
        baseMap = __webpack_require__(1573),
        baseSortBy = __webpack_require__(1585),
        baseUnary = __webpack_require__(1460),
        compareMultiple = __webpack_require__(1586),
        identity = __webpack_require__(1528);
    
    Romain CREY's avatar
    Romain CREY committed
    
    /**
    
     * The base implementation of `_.orderBy` without param guards.
     *
     * @private
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
     * @param {string[]} orders The sort orders of `iteratees`.
     * @returns {Array} Returns the new sorted array.
    
    Romain CREY's avatar
    Romain CREY committed
     */
    
    function baseOrderBy(collection, iteratees, orders) {
      var index = -1;
      iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      var result = baseMap(collection, function(value, key, collection) {
        var criteria = arrayMap(iteratees, function(iteratee) {
          return iteratee(value);
        });
        return { 'criteria': criteria, 'index': ++index, 'value': value };
      });
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      return baseSortBy(result, function(object, other) {
        return compareMultiple(object, other, orders);
      });
    }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = baseOrderBy;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    
    /***/ }),
    /* 1585 */
    /***/ (function(module, exports) {
    
    Romain CREY's avatar
    Romain CREY committed
    
    /**
    
     * The base implementation of `_.sortBy` which uses `comparer` to define the
     * sort order of `array` and replaces criteria objects with their corresponding
     * values.
     *
     * @private
     * @param {Array} array The array to sort.
     * @param {Function} comparer The function to define sort order.
     * @returns {Array} Returns `array`.
    
    Romain CREY's avatar
    Romain CREY committed
     */
    
    function baseSortBy(array, comparer) {
      var length = array.length;
    
      array.sort(comparer);
      while (length--) {
        array[length] = array[length].value;
      }
      return array;
    }
    
    module.exports = baseSortBy;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /***/ }),
    
    Romain CREY's avatar
    Romain CREY committed
    /***/ (function(module, exports, __webpack_require__) {
    
    
    var compareAscending = __webpack_require__(1587);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /**
     * Used by `_.orderBy` to compare multiple properties of a value to another
     * and stable sort them.
     *
     * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
     * specify an order of "desc" for descending or "asc" for ascending sort order
     * of corresponding values.
     *
     * @private
     * @param {Object} object The object to compare.
     * @param {Object} other The other object to compare.
     * @param {boolean[]|string[]} orders The order to sort by for each property.
     * @returns {number} Returns the sort order indicator for `object`.
     */
    function compareMultiple(object, other, orders) {
      var index = -1,
          objCriteria = object.criteria,
          othCriteria = other.criteria,
          length = objCriteria.length,
          ordersLength = orders.length;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      while (++index < length) {
        var result = compareAscending(objCriteria[index], othCriteria[index]);
        if (result) {
          if (index >= ordersLength) {
            return result;
          }
          var order = orders[index];
          return result * (order == 'desc' ? -1 : 1);
        }
      }
      // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
      // that causes it, under certain circumstances, to provide the same value for
      // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
      // for more details.
      //
      // This also ensures a stable sort in V8 and other engines.
      // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
      return object.index - other.index;
    }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = compareMultiple;
    
    /***/ }),
    /* 1587 */
    /***/ (function(module, exports, __webpack_require__) {
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    var isSymbol = __webpack_require__(1506);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /**
     * Compares values to sort them in ascending order.
     *
     * @private
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @returns {number} Returns the sort order indicator for `value`.
     */
    function compareAscending(value, other) {
      if (value !== other) {
        var valIsDefined = value !== undefined,
            valIsNull = value === null,
            valIsReflexive = value === value,
            valIsSymbol = isSymbol(value);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
        var othIsDefined = other !== undefined,
            othIsNull = other === null,
            othIsReflexive = other === other,
            othIsSymbol = isSymbol(other);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
        if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
            (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
            (valIsNull && othIsDefined && othIsReflexive) ||
            (!valIsDefined && othIsReflexive) ||
            !valIsReflexive) {
          return 1;
        }
        if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
            (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
            (othIsNull && valIsDefined && valIsReflexive) ||
            (!othIsDefined && valIsReflexive) ||
            !othIsReflexive) {
          return -1;
        }
    
    Romain CREY's avatar
    Romain CREY committed
      }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = compareAscending;
    
    /***/ }),
    /* 1588 */
    /***/ (function(module, exports, __webpack_require__) {
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    var identity = __webpack_require__(1528),
        overRest = __webpack_require__(1523),
        setToString = __webpack_require__(1525);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /**
     * The base implementation of `_.rest` which doesn't validate or coerce arguments.
     *
     * @private
     * @param {Function} func The function to apply a rest parameter to.
     * @param {number} [start=func.length-1] The start position of the rest parameter.
     * @returns {Function} Returns the new function.
     */
    function baseRest(func, start) {
      return setToString(overRest(func, start, identity), func + '');
    
    Romain CREY's avatar
    Romain CREY committed
    }
    
    
    module.exports = baseRest;
    
    /***/ }),
    /* 1589 */
    /***/ (function(module, exports, __webpack_require__) {
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    var eq = __webpack_require__(1402),
        isArrayLike = __webpack_require__(1466),
        isIndex = __webpack_require__(1456),
        isObject = __webpack_require__(1421);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /**
     * Checks if the given arguments are from an iteratee call.
     *
     * @private
     * @param {*} value The potential iteratee value argument.
     * @param {*} index The potential iteratee index or key argument.
     * @param {*} object The potential iteratee object argument.
     * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
     *  else `false`.
     */
    function isIterateeCall(value, index, object) {
      if (!isObject(object)) {
        return false;
      }
      var type = typeof index;
      if (type == 'number'
            ? (isArrayLike(object) && isIndex(index, object.length))
            : (type == 'string' && index in object)
          ) {
        return eq(object[index], value);
      }
      return false;
    }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = isIterateeCall;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /***/ }),
    
    Romain CREY's avatar
    Romain CREY committed
    /***/ (function(module, exports, __webpack_require__) {
    
    
    const PromisePool = __webpack_require__(1591)
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /**
     * Like a map, executed in parallel via a promise pool
     *
     * @param  {Array}    arr          Items to process
     * @param  {Function} fn           Promise creator (will be passed each item)
     * @param  {Number}   concurrency  How many promise can be in flight at the same time
     * @return {Promise}               Resolved with the results of the promise, not necessary in order
     */
    const parallelMap = (iterable, fn, concurrencyArg) => {
      const concurrency = concurrencyArg || 30
      const res = []
      const pool = new PromisePool(function*() {
        for (let item of iterable) {
          yield fn(item).then(x => res.push(x))
        }
      }, concurrency)
      return pool.start().then(() => res)
    }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = {
      parallelMap
    }
    
    /***/ }),
    /* 1591 */
    /***/ (function(module, exports, __webpack_require__) {
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) {
      /* istanbul ignore next */
      if (true) {
        !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
    				__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
    				(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
    				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))
      } else {}
    })(this, function () {
      'use strict'
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      var EventTarget = function () {
        this._listeners = {}
      }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      EventTarget.prototype.addEventListener = function (type, listener) {
        this._listeners[type] = this._listeners[type] || []
        if (this._listeners[type].indexOf(listener) < 0) {
          this._listeners[type].push(listener)
    
    Romain CREY's avatar
    Romain CREY committed
        }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      EventTarget.prototype.removeEventListener = function (type, listener) {
        if (this._listeners[type]) {
          var p = this._listeners[type].indexOf(listener)
          if (p >= 0) {
            this._listeners[type].splice(p, 1)
          }
    
    Romain CREY's avatar
    Romain CREY committed
        }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      EventTarget.prototype.dispatchEvent = function (evt) {
        if (this._listeners[evt.type] && this._listeners[evt.type].length) {
          var listeners = this._listeners[evt.type].slice()
          for (var i = 0, l = listeners.length; i < l; ++i) {
            listeners[i].call(this, evt)
          }
        }
      }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      var isGenerator = function (func) {
        return (typeof func.constructor === 'function' &&
          func.constructor.name === 'GeneratorFunction')
      }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      var functionToIterator = function (func) {
        return {
          next: function () {
            var promise = func()
            return promise ? {value: promise} : {done: true}
          }
    
    Romain CREY's avatar
    Romain CREY committed
        }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      var promiseToIterator = function (promise) {
        var called = false
        return {
          next: function () {
            if (called) {
              return {done: true}
            }
            called = true
            return {value: promise}
          }
    
    Romain CREY's avatar
    Romain CREY committed
        }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      var toIterator = function (obj, Promise) {
        var type = typeof obj
        if (type === 'object') {
          if (typeof obj.next === 'function') {
            return obj
          }
          /* istanbul ignore else */
          if (typeof obj.then === 'function') {
            return promiseToIterator(obj)
          }
    
    Romain CREY's avatar
    Romain CREY committed
        }
    
        if (type === 'function') {
          return isGenerator(obj) ? obj() : functionToIterator(obj)
    
    Romain CREY's avatar
    Romain CREY committed
        }
    
        return promiseToIterator(Promise.resolve(obj))
      }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      var PromisePoolEvent = function (target, type, data) {
        this.target = target
        this.type = type
        this.data = data
      }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      var PromisePool = function (source, concurrency, options) {
        EventTarget.call(this)
        if (typeof concurrency !== 'number' ||
            Math.floor(concurrency) !== concurrency ||
            concurrency < 1) {
          throw new Error('Invalid concurrency')
    
    Romain CREY's avatar
    Romain CREY committed
        }
    
        this._concurrency = concurrency
        this._options = options || {}
        this._options.promise = this._options.promise || Promise
        this._iterator = toIterator(source, this._options.promise)
        this._done = false
        this._size = 0
        this._promise = null
        this._callbacks = null
      }
      PromisePool.prototype = new EventTarget()
      PromisePool.prototype.constructor = PromisePool
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      PromisePool.prototype.concurrency = function (value) {
        if (typeof value !== 'undefined') {
          this._concurrency = value
          if (this.active()) {
            this._proceed()
          }
    
    Romain CREY's avatar
    Romain CREY committed
        }
    
        return this._concurrency
      }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      PromisePool.prototype.size = function () {
        return this._size
      }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      PromisePool.prototype.active = function () {
        return !!this._promise
      }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      PromisePool.prototype.promise = function () {
        return this._promise
      }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      PromisePool.prototype.start = function () {
        var that = this
        var Promise = this._options.promise