angular-extend-promises
Advanced tools
Comparing version 1.0.0-rc.3 to 1.0.0
/*! | ||
* angular-extend-promises v1.0.0-rc.3 - 2015-04-22 | ||
* (c) 2014-2015 L.systems SARL, Etienne Folio, Quentin Raynaud | ||
* angular-extend-promises v1.0.0-rc.4 - 2016-12-15 | ||
* (c) 2014-2016 L.systems SARL, Etienne Folio, Quentin Raynaud | ||
* https://bitbucket.org/lsystems/angular-extend-promises | ||
@@ -9,10 +9,10 @@ * License: MIT | ||
if(typeof exports === 'object' && typeof module === 'object') | ||
module.exports = factory((function webpackLoadOptionalExternalModule() { try { return require("../tmp/lodash"); } catch(e) {} }())); | ||
module.exports = factory((function webpackLoadOptionalExternalModule() { try { return require("lodash"); } catch(e) {} }())); | ||
else if(typeof define === 'function' && define.amd) | ||
define(["../tmp/lodash"], factory); | ||
define(["lodash"], factory); | ||
else if(typeof exports === 'object') | ||
exports["angular-extend-promises"] = factory((function webpackLoadOptionalExternalModule() { try { return require("../tmp/lodash"); } catch(e) {} }())); | ||
exports["angular-extend-promises"] = factory((function webpackLoadOptionalExternalModule() { try { return require("lodash"); } catch(e) {} }())); | ||
else | ||
root["angular-extend-promises"] = factory(root["../tmp/lodash"]); | ||
})(this, function(__WEBPACK_EXTERNAL_MODULE_21__) { | ||
root["angular-extend-promises"] = factory(root["lodash"]); | ||
})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) { | ||
return /******/ (function(modules) { // webpackBootstrap | ||
@@ -93,3 +93,3 @@ /******/ // The module cache | ||
return __webpack_require__(2); | ||
return __webpack_require__(4); | ||
}]); | ||
@@ -107,3 +107,3 @@ }]) | ||
var _ = __webpack_require__(3); | ||
var _ = __webpack_require__(2); | ||
@@ -123,5 +123,28 @@ _.extend(module.exports, { | ||
var _ = __webpack_require__(3); | ||
/* global _ */ | ||
try { | ||
module.exports = __webpack_require__(3); | ||
} | ||
catch (e) { | ||
module.exports = _; | ||
} | ||
/***/ }, | ||
/* 3 */ | ||
/***/ function(module, exports) { | ||
if(typeof __WEBPACK_EXTERNAL_MODULE_3__ === 'undefined') {var e = new Error("Cannot find module \"lodash\""); e.code = 'MODULE_NOT_FOUND'; throw e;} | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_3__; | ||
/***/ }, | ||
/* 4 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _ = __webpack_require__(2); | ||
var globals = __webpack_require__(1); | ||
var errors = __webpack_require__(4); | ||
var errors = __webpack_require__(5); | ||
@@ -144,17 +167,17 @@ var newq = module.exports = function(resolver) { | ||
// Methods & aliases | ||
all: __webpack_require__(5), | ||
any: __webpack_require__(6), | ||
bind: __webpack_require__(7), | ||
defer: __webpack_require__(8), | ||
each: __webpack_require__(9), | ||
filter: __webpack_require__(10), | ||
map: __webpack_require__(11), | ||
join: __webpack_require__(12), | ||
method: __webpack_require__(13), | ||
props: __webpack_require__(14), | ||
reduce: __webpack_require__(15), | ||
reject: __webpack_require__(16), | ||
resolve: __webpack_require__(17), | ||
some: __webpack_require__(18), | ||
when: __webpack_require__(19), | ||
all: __webpack_require__(6), | ||
any: __webpack_require__(24), | ||
bind: __webpack_require__(25), | ||
defer: __webpack_require__(26), | ||
each: __webpack_require__(27), | ||
filter: __webpack_require__(30), | ||
map: __webpack_require__(31), | ||
join: __webpack_require__(32), | ||
method: __webpack_require__(33), | ||
props: __webpack_require__(35), | ||
reduce: __webpack_require__(36), | ||
reject: __webpack_require__(37), | ||
resolve: __webpack_require__(39), | ||
some: __webpack_require__(40), | ||
when: __webpack_require__(41), | ||
@@ -168,3 +191,3 @@ // Errors | ||
_.extend(newq, { | ||
attempt: __webpack_require__(20) | ||
attempt: __webpack_require__(34) | ||
}); | ||
@@ -175,3 +198,3 @@ } | ||
_.extend(newq, { | ||
'try': __webpack_require__(20) | ||
'try': __webpack_require__(34) | ||
}); | ||
@@ -182,23 +205,7 @@ } | ||
/***/ }, | ||
/* 3 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/* 5 */ | ||
/***/ function(module, exports) { | ||
'use strict'; | ||
/* global _ */ | ||
try { | ||
module.exports = __webpack_require__(21); | ||
} | ||
catch (e) { | ||
module.exports = _; | ||
} | ||
/***/ }, | ||
/* 4 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var NewQError = module.exports.NewQError = function NewQError(message) { | ||
@@ -248,3 +255,3 @@ this.name = this.constructor.name; | ||
/***/ }, | ||
/* 5 */ | ||
/* 6 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -254,6 +261,6 @@ | ||
var _ = __webpack_require__(3); | ||
var decorate = __webpack_require__(22); | ||
var _ = __webpack_require__(2); | ||
var decorate = __webpack_require__(7); | ||
var globals = __webpack_require__(1); | ||
var newq = __webpack_require__(2); | ||
var newq = __webpack_require__(4); | ||
@@ -273,15 +280,2 @@ module.exports = function(promises) { | ||
/***/ }, | ||
/* 6 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var newq = __webpack_require__(2); | ||
module.exports = function(array) { | ||
return newq.some(array, 1).get(0); | ||
}; | ||
/***/ }, | ||
/* 7 */ | ||
@@ -292,274 +286,7 @@ /***/ function(module, exports, __webpack_require__) { | ||
var newq = __webpack_require__(2); | ||
module.exports = function(oThis) { | ||
return newq.resolve().bind(oThis); | ||
}; | ||
/***/ }, | ||
/* 8 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var decorate = __webpack_require__(22); | ||
var _ = __webpack_require__(2); | ||
var globals = __webpack_require__(1); | ||
var callNewQ = __webpack_require__(8); | ||
var defineProperty = __webpack_require__(10); | ||
globals.$defer = function $defer(parent) { | ||
var deferred = globals.$delegate.defer(); | ||
deferred.promise = decorate(deferred.promise, parent); | ||
return deferred; | ||
}; | ||
module.exports = function defer() { | ||
return globals.$defer(); | ||
}; | ||
/***/ }, | ||
/* 9 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var walkCollection = __webpack_require__(23); | ||
module.exports = walkCollection('tap'); | ||
/***/ }, | ||
/* 10 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _ = __webpack_require__(3); | ||
var newq = __webpack_require__(2); | ||
module.exports = function(array, cb, options) { | ||
return newq.map(array, function(val) { | ||
return newq.props({ | ||
val: val, | ||
toFilter: cb.apply(null, arguments) | ||
}); | ||
}, options) | ||
.then(function(array) { | ||
return _.map(_.filter(array, 'toFilter'), 'val'); | ||
}) | ||
; | ||
}; | ||
/***/ }, | ||
/* 11 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var walkCollection = __webpack_require__(23); | ||
module.exports = walkCollection('then'); | ||
/***/ }, | ||
/* 12 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _ = __webpack_require__(3); | ||
var newq = __webpack_require__(2); | ||
module.exports = function join() { | ||
var args = _.toArray(arguments); | ||
var cb = args.pop(); | ||
return newq.all(args).spread(cb); | ||
}; | ||
/***/ }, | ||
/* 13 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var attempt = __webpack_require__(20); | ||
module.exports = function(fn) { | ||
return function() { | ||
return attempt(fn, arguments, this); | ||
}; | ||
}; | ||
/***/ }, | ||
/* 14 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _ = __webpack_require__(3); | ||
var newq = __webpack_require__(2); | ||
module.exports = function(obj) { | ||
return newq.all(_.values(obj)).then(function(vals) { | ||
return _.object(_.keys(obj), vals); | ||
}); | ||
}; | ||
/***/ }, | ||
/* 15 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _ = __webpack_require__(3); | ||
var newq = __webpack_require__(2); | ||
module.exports = function(array, cb, initialValue) { | ||
return _.reduce(array, function(acc, val, i) { | ||
return newq.join(acc, val, function(acc, val) { | ||
return cb(acc, val, i, array.length); | ||
}); | ||
}, newq.resolve(initialValue)); | ||
}; | ||
/***/ }, | ||
/* 16 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var autoDecorate = __webpack_require__(24); | ||
module.exports = autoDecorate('reject'); | ||
/***/ }, | ||
/* 17 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var newq = __webpack_require__(2); | ||
var autoDecorate = __webpack_require__(24); | ||
// depending Angular's version, $q.resolve might not exist | ||
module.exports = autoDecorate('resolve') || function(val) { | ||
var def = newq.defer(); | ||
def.resolve(val); | ||
return def.promise; | ||
}; | ||
/***/ }, | ||
/* 18 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _ = __webpack_require__(3); | ||
var newq = __webpack_require__(2); | ||
var AggregateError = __webpack_require__(4).AggregateError; | ||
module.exports = function(array, count) { | ||
if (array.length < count) { | ||
return newq.reject(new AggregateError( | ||
'initial array length (' + array.length + ') > count (' + count + ')' | ||
)); | ||
} | ||
var rejectedCount = 0; | ||
var res = []; | ||
var def = newq.defer(); | ||
_.each(array, function(elt) { | ||
newq.when(elt) | ||
.tap(function(val) { | ||
if (res === null) | ||
return; | ||
res.push(val); | ||
// resolve when we have enough fulfilled elements | ||
if (res.length >= count) { | ||
def.resolve(res); | ||
res = null; | ||
} | ||
}) | ||
.$$catch(function() { | ||
if (res === null) | ||
return; | ||
++rejectedCount; | ||
// reject if objective cannot be fulfilled | ||
if (array.length - rejectedCount < count) { | ||
def.reject(new AggregateError( | ||
'Cannot resolve promise: too many rejections (' + rejectedCount + ')' | ||
)); | ||
res = null; | ||
} | ||
}) | ||
; | ||
}); | ||
return def.promise; | ||
}; | ||
/***/ }, | ||
/* 19 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var autoDecorate = __webpack_require__(24); | ||
module.exports = autoDecorate('when'); | ||
/***/ }, | ||
/* 20 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _ = __webpack_require__(3); | ||
var newq = __webpack_require__(2); | ||
module.exports = function(fn, args, oThis) { | ||
try { | ||
if (!_.isEmpty(args) && !(_.isArray(args) || _.isArguments(args))) | ||
args = [args]; | ||
return newq.when(fn.apply(oThis || this, args)); | ||
} | ||
catch (err) { | ||
return newq.reject(err); | ||
} | ||
}; | ||
/***/ }, | ||
/* 21 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
if(typeof __WEBPACK_EXTERNAL_MODULE_21__ === 'undefined') {var e = new Error("Cannot find module \"../tmp/lodash\""); e.code = 'MODULE_NOT_FOUND'; throw e;} | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_21__; | ||
/***/ }, | ||
/* 22 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _ = __webpack_require__(3); | ||
var globals = __webpack_require__(1); | ||
var callNewQ = __webpack_require__(25); | ||
var defineProperty = __webpack_require__(26); | ||
var aliases = { | ||
@@ -575,5 +302,5 @@ 'catch': 'caught', | ||
_.each(_.methods($qPromise), function(name) { | ||
_.each(_.functionsIn($qPromise), function(name) { | ||
defineProperty(this, '$$' + name, $qPromise[name]); | ||
}, this); | ||
}.bind(this)); | ||
@@ -596,7 +323,7 @@ if (parent && parent.$$boundTo) | ||
any: callNewQ('any'), | ||
bind: __webpack_require__(27), | ||
call: __webpack_require__(28), | ||
'catch': __webpack_require__(29), | ||
delay: __webpack_require__(30), | ||
done: __webpack_require__(31), | ||
bind: __webpack_require__(11), | ||
call: __webpack_require__(12), | ||
'catch': __webpack_require__(13), | ||
delay: __webpack_require__(14), | ||
done: __webpack_require__(15), | ||
each: callNewQ('each'), | ||
@@ -607,14 +334,14 @@ filter: callNewQ('filter'), | ||
}, | ||
get: __webpack_require__(32), | ||
get: __webpack_require__(16), | ||
map: callNewQ('map'), | ||
nodeify: __webpack_require__(33), | ||
nodeify: __webpack_require__(17), | ||
props: callNewQ('props'), | ||
reduce: callNewQ('reduce'), | ||
'return': __webpack_require__(34), | ||
'return': __webpack_require__(18), | ||
some: callNewQ('some'), | ||
spread: __webpack_require__(35), | ||
tap: __webpack_require__(36), | ||
then: __webpack_require__(37), | ||
'throw': __webpack_require__(38), | ||
timeout: __webpack_require__(39), | ||
spread: __webpack_require__(19), | ||
tap: __webpack_require__(20), | ||
then: __webpack_require__(21), | ||
'throw': __webpack_require__(22), | ||
timeout: __webpack_require__(23), | ||
@@ -646,3 +373,3 @@ constructor: Promise | ||
/***/ }, | ||
/* 23 */ | ||
/* 8 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -652,66 +379,6 @@ | ||
var _ = __webpack_require__(3); | ||
var newq = __webpack_require__(2); | ||
var Gate = __webpack_require__(40); | ||
var defineProperty = __webpack_require__(26); | ||
var bindMethods = __webpack_require__(9); | ||
var newQ = __webpack_require__(4); | ||
var defineProperty = __webpack_require__(10); | ||
module.exports = function walkCollection(promiseFn) { | ||
return function(array, cb, options) { | ||
options = _.pick(options, 'concurrency'); | ||
var gate = options.concurrency ? new Gate(options) : { | ||
add: function(fn) { | ||
return fn(); | ||
} | ||
}; | ||
// create an array with each promises affected by the operation | ||
var $$unsynced = _.map(array, function(val, i) { | ||
// return a new promise for each item | ||
return newq.when(val)[promiseFn](function(val) { | ||
return gate.add(function() { | ||
// call user callback | ||
return newq.when(cb.call(null, val, i, array.length)); | ||
}); | ||
}); | ||
}); | ||
// create a promise synchronizing everything | ||
var res = newq.all($$unsynced); | ||
// save the unsynced array of promises in the result | ||
defineProperty(res, '$$unsynced', $$unsynced); | ||
// return the promise | ||
return res; | ||
}; | ||
}; | ||
/***/ }, | ||
/* 24 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var decorate = __webpack_require__(22); | ||
var globals = __webpack_require__(1); | ||
module.exports = function autoDecorate(name) { | ||
return !(name in globals.$delegate) ? null : function() { | ||
return decorate(globals.$delegate[name].apply(globals.$delegate, arguments)); | ||
}; | ||
}; | ||
/***/ }, | ||
/* 25 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var bindMethods = __webpack_require__(41); | ||
var newQ = __webpack_require__(2); | ||
var defineProperty = __webpack_require__(26); | ||
module.exports = function callNewQ(method) { | ||
@@ -760,3 +427,3 @@ /* jshint -W040 */ | ||
/***/ }, | ||
/* 26 */ | ||
/* 9 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -766,2 +433,19 @@ | ||
var _ = __webpack_require__(2); | ||
module.exports = function bindMethods(array) { | ||
return _.map(array, function(arg) { | ||
if (!_.isFunction(arg)) | ||
return arg; | ||
return arg.bind(this.$$boundTo || this); | ||
}.bind(this)); | ||
}; | ||
/***/ }, | ||
/* 10 */ | ||
/***/ function(module, exports) { | ||
'use strict'; | ||
module.exports = function defineProperty(obj, name, value) { | ||
@@ -783,3 +467,3 @@ if (Object.defineProperty) { | ||
/***/ }, | ||
/* 27 */ | ||
/* 11 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -789,3 +473,3 @@ | ||
var defineProperty = __webpack_require__(26); | ||
var defineProperty = __webpack_require__(10); | ||
@@ -799,3 +483,3 @@ module.exports = function(bound) { | ||
/***/ }, | ||
/* 28 */ | ||
/* 12 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -805,3 +489,3 @@ | ||
var _ = __webpack_require__(3); | ||
var _ = __webpack_require__(2); | ||
@@ -819,3 +503,3 @@ module.exports = function() { | ||
/***/ }, | ||
/* 29 */ | ||
/* 13 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -825,4 +509,4 @@ | ||
var newq = __webpack_require__(2); | ||
var _ = __webpack_require__(3); | ||
var newq = __webpack_require__(4); | ||
var _ = __webpack_require__(2); | ||
@@ -861,3 +545,3 @@ function checkErrorsAndPredicates(errorsAndPredicates, err) { | ||
/***/ }, | ||
/* 30 */ | ||
/* 14 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -879,3 +563,3 @@ | ||
/***/ }, | ||
/* 31 */ | ||
/* 15 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -885,3 +569,3 @@ | ||
var newQ = __webpack_require__(2); | ||
var newQ = __webpack_require__(4); | ||
@@ -904,4 +588,4 @@ module.exports = function() { | ||
/***/ }, | ||
/* 32 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/* 16 */ | ||
/***/ function(module, exports) { | ||
@@ -918,3 +602,3 @@ 'use strict'; | ||
/***/ }, | ||
/* 33 */ | ||
/* 17 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -924,4 +608,4 @@ | ||
var _ = __webpack_require__(3); | ||
var newq = __webpack_require__(2); | ||
var _ = __webpack_require__(2); | ||
var newq = __webpack_require__(4); | ||
@@ -955,3 +639,3 @@ module.exports = function(cb, options) { | ||
/***/ }, | ||
/* 34 */ | ||
/* 18 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -961,3 +645,3 @@ | ||
var _ = __webpack_require__(3); | ||
var _ = __webpack_require__(2); | ||
@@ -970,3 +654,3 @@ module.exports = function(val) { | ||
/***/ }, | ||
/* 35 */ | ||
/* 19 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -976,3 +660,3 @@ | ||
var _ = __webpack_require__(3); | ||
var _ = __webpack_require__(2); | ||
@@ -991,3 +675,3 @@ module.exports = function(fn) { | ||
/***/ }, | ||
/* 36 */ | ||
/* 20 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -997,3 +681,3 @@ | ||
var newQ = __webpack_require__(2); | ||
var newQ = __webpack_require__(4); | ||
@@ -1009,3 +693,3 @@ module.exports = function(fn) { | ||
/***/ }, | ||
/* 37 */ | ||
/* 21 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -1015,4 +699,4 @@ | ||
var bindMethods = __webpack_require__(41); | ||
var decorate = __webpack_require__(22); | ||
var bindMethods = __webpack_require__(9); | ||
var decorate = __webpack_require__(7); | ||
@@ -1027,3 +711,3 @@ // Then is special because it needs the previous then to work | ||
/***/ }, | ||
/* 38 */ | ||
/* 22 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -1033,3 +717,3 @@ | ||
var newq = __webpack_require__(2); | ||
var newq = __webpack_require__(4); | ||
@@ -1044,3 +728,3 @@ module.exports = function(err) { | ||
/***/ }, | ||
/* 39 */ | ||
/* 23 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -1051,3 +735,3 @@ | ||
var globals = __webpack_require__(1); | ||
var newq = __webpack_require__(2); | ||
var newq = __webpack_require__(4); | ||
@@ -1074,3 +758,3 @@ module.exports = function(ms, msg) { | ||
/***/ }, | ||
/* 40 */ | ||
/* 24 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -1080,5 +764,106 @@ | ||
var _ = __webpack_require__(3); | ||
var newq = __webpack_require__(4); | ||
module.exports = function(array) { | ||
return newq.some(array, 1).get(0); | ||
}; | ||
/***/ }, | ||
/* 25 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var newq = __webpack_require__(4); | ||
module.exports = function(oThis) { | ||
return newq.resolve().bind(oThis); | ||
}; | ||
/***/ }, | ||
/* 26 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var decorate = __webpack_require__(7); | ||
var globals = __webpack_require__(1); | ||
globals.$defer = function $defer(parent) { | ||
var deferred = globals.$delegate.defer(); | ||
deferred.promise = decorate(deferred.promise, parent); | ||
return deferred; | ||
}; | ||
module.exports = function defer() { | ||
return globals.$defer(); | ||
}; | ||
/***/ }, | ||
/* 27 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var walkCollection = __webpack_require__(28); | ||
module.exports = walkCollection('tap'); | ||
/***/ }, | ||
/* 28 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _ = __webpack_require__(2); | ||
var newq = __webpack_require__(4); | ||
var Gate = __webpack_require__(29); | ||
var defineProperty = __webpack_require__(10); | ||
module.exports = function walkCollection(promiseFn) { | ||
return function(array, cb, options) { | ||
options = _.pick(options, 'concurrency'); | ||
var gate = options.concurrency ? new Gate(options) : { | ||
add: function(fn) { | ||
return fn(); | ||
} | ||
}; | ||
// create an array with each promises affected by the operation | ||
var $$unsynced = _.map(array, function(val, i) { | ||
// return a new promise for each item | ||
return newq.when(val)[promiseFn](function(val) { | ||
return gate.add(function() { | ||
// call user callback | ||
return newq.when(cb.call(null, val, i, array.length)); | ||
}); | ||
}); | ||
}); | ||
// create a promise synchronizing everything | ||
var res = newq.all($$unsynced); | ||
// save the unsynced array of promises in the result | ||
defineProperty(res, '$$unsynced', $$unsynced); | ||
// return the promise | ||
return res; | ||
}; | ||
}; | ||
/***/ }, | ||
/* 29 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _ = __webpack_require__(2); | ||
var globals = __webpack_require__(1); | ||
var Gate = module.exports = function Gate(options) { | ||
@@ -1123,3 +908,3 @@ this.$options = _.defaults(options, { | ||
/***/ }, | ||
/* 41 */ | ||
/* 30 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -1129,13 +914,228 @@ | ||
var _ = __webpack_require__(3); | ||
var _ = __webpack_require__(2); | ||
var newq = __webpack_require__(4); | ||
module.exports = function bindMethods(array) { | ||
return _.map(array, function(arg) { | ||
if (!_.isFunction(arg)) | ||
return arg; | ||
return arg.bind(this.$$boundTo || this); | ||
}, this); | ||
module.exports = function(array, cb, options) { | ||
return newq.map(array, function(val) { | ||
return newq.props({ | ||
val: val, | ||
toFilter: cb.apply(null, arguments) | ||
}); | ||
}, options) | ||
.then(function(array) { | ||
return _.map(_.filter(array, 'toFilter'), 'val'); | ||
}) | ||
; | ||
}; | ||
/***/ }, | ||
/* 31 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var walkCollection = __webpack_require__(28); | ||
module.exports = walkCollection('then'); | ||
/***/ }, | ||
/* 32 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _ = __webpack_require__(2); | ||
var newq = __webpack_require__(4); | ||
module.exports = function join() { | ||
var args = _.toArray(arguments); | ||
var cb = args.pop(); | ||
return newq.all(args).spread(cb); | ||
}; | ||
/***/ }, | ||
/* 33 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var attempt = __webpack_require__(34); | ||
module.exports = function(fn) { | ||
return function() { | ||
return attempt(fn, arguments, this); | ||
}; | ||
}; | ||
/***/ }, | ||
/* 34 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _ = __webpack_require__(2); | ||
var newq = __webpack_require__(4); | ||
module.exports = function(fn, args, oThis) { | ||
try { | ||
if (!_.isEmpty(args) && !(_.isArray(args) || _.isArguments(args))) | ||
args = [args]; | ||
return newq.when(fn.apply(oThis || this, args)); | ||
} | ||
catch (err) { | ||
return newq.reject(err); | ||
} | ||
}; | ||
/***/ }, | ||
/* 35 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _ = __webpack_require__(2); | ||
var newq = __webpack_require__(4); | ||
module.exports = function(obj) { | ||
return newq.all(_.values(obj)).then(function(vals) { | ||
return _.zipObject(_.keys(obj), vals); | ||
}); | ||
}; | ||
/***/ }, | ||
/* 36 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _ = __webpack_require__(2); | ||
var newq = __webpack_require__(4); | ||
module.exports = function(array, cb, initialValue) { | ||
return _.reduce(array, function(acc, val, i) { | ||
return newq.join(acc, val, function(acc, val) { | ||
return cb(acc, val, i, array.length); | ||
}); | ||
}, newq.resolve(initialValue)); | ||
}; | ||
/***/ }, | ||
/* 37 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var autoDecorate = __webpack_require__(38); | ||
module.exports = autoDecorate('reject'); | ||
/***/ }, | ||
/* 38 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var decorate = __webpack_require__(7); | ||
var globals = __webpack_require__(1); | ||
module.exports = function autoDecorate(name) { | ||
return !(name in globals.$delegate) ? null : function() { | ||
return decorate(globals.$delegate[name].apply(globals.$delegate, arguments)); | ||
}; | ||
}; | ||
/***/ }, | ||
/* 39 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var newq = __webpack_require__(4); | ||
var autoDecorate = __webpack_require__(38); | ||
// depending Angular's version, $q.resolve might not exist | ||
module.exports = autoDecorate('resolve') || function(val) { | ||
var def = newq.defer(); | ||
def.resolve(val); | ||
return def.promise; | ||
}; | ||
/***/ }, | ||
/* 40 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _ = __webpack_require__(2); | ||
var newq = __webpack_require__(4); | ||
var AggregateError = __webpack_require__(5).AggregateError; | ||
module.exports = function(array, count) { | ||
if (array.length < count) { | ||
return newq.reject(new AggregateError( | ||
'initial array length (' + array.length + ') > count (' + count + ')' | ||
)); | ||
} | ||
var rejectedCount = 0; | ||
var res = []; | ||
var def = newq.defer(); | ||
_.each(array, function(elt) { | ||
newq.when(elt) | ||
.tap(function(val) { | ||
if (res === null) | ||
return; | ||
res.push(val); | ||
// resolve when we have enough fulfilled elements | ||
if (res.length >= count) { | ||
def.resolve(res); | ||
res = null; | ||
} | ||
}) | ||
.$$catch(function() { | ||
if (res === null) | ||
return; | ||
++rejectedCount; | ||
// reject if objective cannot be fulfilled | ||
if (array.length - rejectedCount < count) { | ||
def.reject(new AggregateError( | ||
'Cannot resolve promise: too many rejections (' + rejectedCount + ')' | ||
)); | ||
res = null; | ||
} | ||
}) | ||
; | ||
}); | ||
return def.promise; | ||
}; | ||
/***/ }, | ||
/* 41 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var autoDecorate = __webpack_require__(38); | ||
module.exports = autoDecorate('when'); | ||
/***/ } | ||
@@ -1142,0 +1142,0 @@ /******/ ]) |
/*! | ||
* angular-extend-promises v1.0.0-rc.3 - 2015-04-22 | ||
* (c) 2014-2015 L.systems SARL, Etienne Folio, Quentin Raynaud | ||
* angular-extend-promises v1.0.0-rc.4 - 2016-12-15 | ||
* (c) 2014-2016 L.systems SARL, Etienne Folio, Quentin Raynaud | ||
* https://bitbucket.org/lsystems/angular-extend-promises | ||
* License: MIT | ||
*/ | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(function(){try{return require("../tmp/lodash")}catch(t){}}()):"function"==typeof define&&define.amd?define(["../tmp/lodash"],n):"object"==typeof exports?exports["angular-extend-promises"]=n(function(){try{return require("../tmp/lodash")}catch(t){}}()):t["angular-extend-promises"]=n(t["../tmp/lodash"])}(this,function(t){return function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n,r){"use strict";angular.module("angular-extend-promises",[]).provider("angularExtendPromises",function(){this.options={compatibilityAliases:!0,disableES5Methods:!1},this.$get=function(){return this.options}}).config(["$provide",function(t){if(angular.mock)for(var n in r.c)delete r.c[n];t.decorator("$q",["$delegate","angularExtendPromises",function(t,n){var e=r(1);return e.$delegate=t,e.$options=n,r(2)}])}])},function(t,n,r){"use strict";var e=r(3);e.extend(t.exports,{$defer:e.noop(),$delegate:{},$options:{}})},function(t,n,r){"use strict";var e=r(3),o=r(1),u=r(4),i=t.exports=function(t){if(!e.isFunction(t))throw new Error("resolver should be a function");var n=i.defer();try{t(n.resolve,n.reject)}catch(r){n.reject(r)}return n.promise};e.extend(i,{all:r(5),any:r(6),bind:r(7),defer:r(8),each:r(9),filter:r(10),map:r(11),join:r(12),method:r(13),props:r(14),reduce:r(15),reject:r(16),resolve:r(17),some:r(18),when:r(19),AggregateError:u.AggregateError,TimeoutError:u.TimeoutError}),o.$options.compatibilityAliases&&e.extend(i,{attempt:r(20)}),o.$options.disableES5Methods||e.extend(i,{"try":r(20)})},function(t,n,r){"use strict";try{t.exports=r(21)}catch(e){t.exports=_}},function(t,n,r){"use strict";var e=t.exports.NewQError=function(t){this.name=this.constructor.name,Error.apply(this,arguments),this.message=t,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack};e.prototype.toString=function(){return this.stack.toString()},e.subError=function(t,n){function r(){}n=n||e,r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t,t.subError||(t.subError=function(n){e.subError(n,t)})},e.subError(e,Error);var o=t.exports.AggregateError=function(){e.apply(this,arguments)};e.subError(o);var u=t.exports.TimeoutError=function(){e.apply(this,arguments)};e.subError(u)},function(t,n,r){"use strict";var e=r(3),o=r(22),u=r(1),i=r(2);t.exports=function(t){return e.isArray(t)?(t=e.map(t,function(t){return i.when(t)}),o(u.$delegate.all(t))):i.props(t)}},function(t,n,r){"use strict";var e=r(2);t.exports=function(t){return e.some(t,1).get(0)}},function(t,n,r){"use strict";var e=r(2);t.exports=function(t){return e.resolve().bind(t)}},function(t,n,r){"use strict";var e=r(22),o=r(1);o.$defer=function(t){var n=o.$delegate.defer();return n.promise=e(n.promise,t),n},t.exports=function(){return o.$defer()}},function(t,n,r){"use strict";var e=r(23);t.exports=e("tap")},function(t,n,r){"use strict";var e=r(3),o=r(2);t.exports=function(t,n,r){return o.map(t,function(t){return o.props({val:t,toFilter:n.apply(null,arguments)})},r).then(function(t){return e.map(e.filter(t,"toFilter"),"val")})}},function(t,n,r){"use strict";var e=r(23);t.exports=e("then")},function(t,n,r){"use strict";var e=r(3),o=r(2);t.exports=function(){var t=e.toArray(arguments),n=t.pop();return o.all(t).spread(n)}},function(t,n,r){"use strict";var e=r(20);t.exports=function(t){return function(){return e(t,arguments,this)}}},function(t,n,r){"use strict";var e=r(3),o=r(2);t.exports=function(t){return o.all(e.values(t)).then(function(n){return e.object(e.keys(t),n)})}},function(t,n,r){"use strict";var e=r(3),o=r(2);t.exports=function(t,n,r){return e.reduce(t,function(r,e,u){return o.join(r,e,function(r,e){return n(r,e,u,t.length)})},o.resolve(r))}},function(t,n,r){"use strict";var e=r(24);t.exports=e("reject")},function(t,n,r){"use strict";var e=r(2),o=r(24);t.exports=o("resolve")||function(t){var n=e.defer();return n.resolve(t),n.promise}},function(t,n,r){"use strict";var e=r(3),o=r(2),u=r(4).AggregateError;t.exports=function(t,n){if(t.length<n)return o.reject(new u("initial array length ("+t.length+") > count ("+n+")"));var r=0,i=[],c=o.defer();return e.each(t,function(e){o.when(e).tap(function(t){null!==i&&(i.push(t),i.length>=n&&(c.resolve(i),i=null))}).$$catch(function(){null!==i&&(++r,t.length-r<n&&(c.reject(new u("Cannot resolve promise: too many rejections ("+r+")")),i=null))})}),c.promise}},function(t,n,r){"use strict";var e=r(24);t.exports=e("when")},function(t,n,r){"use strict";var e=r(3),o=r(2);t.exports=function(t,n,r){try{return e.isEmpty(n)||e.isArray(n)||e.isArguments(n)||(n=[n]),o.when(t.apply(r||this,n))}catch(u){return o.reject(u)}}},function(n,r,e){if("undefined"==typeof t){var o=new Error('Cannot find module "../tmp/lodash"');throw o.code="MODULE_NOT_FOUND",o}n.exports=t},function(t,n,r){"use strict";function e(t,n){c(this,"$$state",t.$$state),o.each(o.methods(t),function(n){c(this,"$$"+n,t[n])},this),n&&n.$$boundTo&&c(this,"$$boundTo",n.$$boundTo),c(this,"$$arrayListeners",[]),this.then=t.then=this.then.bind(this)}var o=r(3),u=r(1),i=r(27),c=r(26),s={"catch":"caught","finally":"lastly","return":["thenReturn","returns"],"throw":["thenThrow"]};t.exports=function(t,n){return new e(t,n)},e.prototype={all:i("all"),any:i("any"),bind:r(28),call:r(29),"catch":r(30),delay:r(31),done:r(32),each:i("each"),filter:i("filter"),"finally":function(){return this.$$finally.apply(this,arguments)},get:r(33),map:i("map"),nodeify:r(34),props:i("props"),reduce:i("reduce"),"return":r(35),some:i("some"),spread:r(36),tap:r(37),then:r(38),"throw":r(39),timeout:r(40),constructor:e},c(e.prototype,"$$callArrayListeners",function(t){o.each(this.$$arrayListeners,function(n){n(t)})}),o.each(s,function(t,n){o.isArray(t)||(t=[t]),u.$options.compatibilityAliases&&o.each(t,function(t){e.prototype[t]=e.prototype[n]}),u.$options.disableES5Methods&&delete e.prototype[n]})},function(t,n,r){"use strict";var e=r(3),o=r(2),u=r(25),i=r(26);t.exports=function(t){return function(n,r,c){c=e.pick(c,"concurrency");var s=c.concurrency?new u(c):{add:function(t){return t()}},a=e.map(n,function(e,u){return o.when(e)[t](function(t){return s.add(function(){return o.when(r.call(null,t,u,n.length))})})}),f=o.all(a);return i(f,"$$unsynced",a),f}}},function(t,n,r){"use strict";var e=r(22),o=r(1);t.exports=function(t){return t in o.$delegate?function(){return e(o.$delegate[t].apply(o.$delegate,arguments))}:null}},function(t,n,r){"use strict";var e=r(3),o=r(1),u=t.exports=function(t){this.$options=e.defaults(t,{concurrency:1,maxQueue:0}),this.$fns=[]};u.prototype.add=function(t){var n=o.$defer(),r=function(){t()["finally"](function(){this.$fns.splice(this.$fns.indexOf(r),1),this.$fns.length>=this.$options.concurrency&&this.$fns[this.$options.concurrency-1]()}.bind(this)).then(function(t){n.resolve(t)},function(t){n.reject(t)})}.bind(this);return this.$fns.push(r)<=this.$options.concurrency&&r(),n.promise}},function(t,n,r){"use strict";t.exports=function(t,n,r){if(Object.defineProperty)try{Object.defineProperty(t,n,{value:r})}catch(e){}t[n]!==r&&(t[n]=r)}},function(t,n,r){"use strict";var e=r(41),o=r(2),u=r(26);t.exports=function(t){function n(n,r){var e=o[t].apply(null,[r].concat(n));return u(e,"$$boundTo",this.$$boundTo),e}return function(){var t=e.call(this,arguments);if(this.$$unsynced)return n.call(this,t,this.$$unsynced);var r=this.then(function(e){if(r.$$promiseResult)return r.$$promiseResult;var o=n.call(this,t,e);return r.$$arrayListeners.length&&o.$$unsynced&&r.$$callArrayListeners(o.$$unsynced),o}.bind(this));return this.$$arrayListeners.push(function(e){u(this,"$$promiseResult",n.call(this,t,e)),r.$$arrayListeners.length&&this.$$promiseResult.$$unsynced&&r.$$callArrayListeners(this.$$promiseResult.$$unsynced)}.bind(this)),r}}},function(t,n,r){"use strict";var e=r(26);t.exports=function(t){return e(this,"$$boundTo",t),this}},function(t,n,r){"use strict";var e=r(3);t.exports=function(){var t=e.toArray(arguments),n=t.shift();return this.then(function(r){return r[n].apply(r,t)})}},function(t,n,r){"use strict";function e(t,n){var r=!t.length;return u.each(t,function(t){if(!u.isFunction(t))throw new Error("Invalid argument.");return t instanceof Error||t.prototype instanceof Error?(r=r||n instanceof t,!r):(r=r||t(n),!r)}),r}var o=r(2),u=r(3);t.exports=function(){var t=u.toArray(arguments),n=t.pop();return this.$$catch(function(r){return u.isFunction(n)&&e(t,r)?n.call(this,r):o.reject(r)})}},function(t,n,r){"use strict";var e=r(1);t.exports=function(t){return this.then(function(n){var r=e.$defer(this);return setTimeout(r.resolve,t,n),r.promise}.bind(this))}},function(t,n,r){"use strict";var e=r(2);t.exports=function(){return this.then.apply(this,arguments).$$catch(function(t){setTimeout(function(){throw t})}).$$finally(function(){return e.reject(new Error("Do not chain anything after calling done()!"))})}},function(t,n,r){"use strict";t.exports=function(t){return this.then(function(n){return n[t]})}},function(t,n,r){"use strict";var e=r(3),o=r(2);t.exports=function(t,n){return t=t||e.noop,n=n||{},this.then(function(r){var o=r;return o=n.spread&&e.isArray(o)?[null].concat(o):[null,o],t.apply(this,o),r},function(n){return t.call(this,n),o.reject(n)})}},function(t,n,r){"use strict";var e=r(3);t.exports=function(t){return this.then(e.constant(t))}},function(t,n,r){"use strict";var e=r(3);t.exports=function(t){return this.then(function(n){return e.isArray(n)||(n=[n]),t.apply(this,n)})}},function(t,n,r){"use strict";var e=r(2);t.exports=function(t){return this.then(function(n){return e.when(t.call(this,n)).returns(n)})}},function(t,n,r){"use strict";var e=r(41),o=r(22);t.exports=function(){return o(this.$$then.apply(this,e.call(this,arguments)),this)}},function(t,n,r){"use strict";var e=r(2);t.exports=function(t){return this.then(function(){return e.reject(t)})}},function(t,n,r){"use strict";var e=r(1),o=r(2);t.exports=function(t,n){var r=e.$defer(this),u=setTimeout(function(){r.reject(new o.TimeoutError(n||"Timed out after "+t+" ms"))},t);return this.then(function(t){r.resolve(t)},function(t){r.reject(t)})["finally"](clearTimeout.bind(null,u)),r.promise}},function(t,n,r){"use strict";var e=r(3);t.exports=function(t){return e.map(t,function(t){return e.isFunction(t)?t.bind(this.$$boundTo||this):t},this)}}])}); | ||
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(function(){try{return require("lodash")}catch(t){}}()):"function"==typeof define&&define.amd?define(["lodash"],r):"object"==typeof exports?exports["angular-extend-promises"]=r(function(){try{return require("lodash")}catch(t){}}()):t["angular-extend-promises"]=r(t.lodash)}(this,function(t){return function(t){function r(e){if(n[e])return n[e].exports;var o=n[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}var n={};return r.m=t,r.c=n,r.p="",r(0)}([function(t,r,n){"use strict";angular.module("angular-extend-promises",[]).provider("angularExtendPromises",function(){this.options={compatibilityAliases:!0,disableES5Methods:!1},this.$get=function(){return this.options}}).config(["$provide",function(t){if(angular.mock)for(var r in n.c)delete n.c[r];t.decorator("$q",["$delegate","angularExtendPromises",function(t,r){var e=n(1);return e.$delegate=t,e.$options=r,n(4)}])}])},function(t,r,n){"use strict";var e=n(2);e.extend(t.exports,{$defer:e.noop(),$delegate:{},$options:{}})},function(t,r,n){"use strict";try{t.exports=n(3)}catch(r){t.exports=_}},function(r,n){if("undefined"==typeof t){var e=new Error('Cannot find module "lodash"');throw e.code="MODULE_NOT_FOUND",e}r.exports=t},function(t,r,n){"use strict";var e=n(2),o=n(1),i=n(5),s=t.exports=function(t){if(!e.isFunction(t))throw new Error("resolver should be a function");var r=s.defer();try{t(r.resolve,r.reject)}catch(t){r.reject(t)}return r.promise};e.extend(s,{all:n(6),any:n(24),bind:n(25),defer:n(26),each:n(27),filter:n(30),map:n(31),join:n(32),method:n(33),props:n(35),reduce:n(36),reject:n(37),resolve:n(39),some:n(40),when:n(41),AggregateError:i.AggregateError,TimeoutError:i.TimeoutError}),o.$options.compatibilityAliases&&e.extend(s,{attempt:n(34)}),o.$options.disableES5Methods||e.extend(s,{try:n(34)})},function(t,r){"use strict";var n=t.exports.NewQError=function(t){this.name=this.constructor.name,Error.apply(this,arguments),this.message=t,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack};n.prototype.toString=function(){return this.stack.toString()},n.subError=function(t,r){function e(){}r=r||n,e.prototype=r.prototype,t.prototype=new e,t.prototype.constructor=t,t.subError||(t.subError=function(r){n.subError(r,t)})},n.subError(n,Error);var e=t.exports.AggregateError=function(){n.apply(this,arguments)};n.subError(e);var o=t.exports.TimeoutError=function(){n.apply(this,arguments)};n.subError(o)},function(t,r,n){"use strict";var e=n(2),o=n(7),i=n(1),s=n(4);t.exports=function(t){return e.isArray(t)?(t=e.map(t,function(t){return s.when(t)}),o(i.$delegate.all(t))):s.props(t)}},function(t,r,n){"use strict";function e(t,r){u(this,"$$state",t.$$state),o.each(o.functionsIn(t),function(r){u(this,"$$"+r,t[r])}.bind(this)),r&&r.$$boundTo&&u(this,"$$boundTo",r.$$boundTo),u(this,"$$arrayListeners",[]),this.then=t.then=this.then.bind(this)}var o=n(2),i=n(1),s=n(8),u=n(10),c={catch:"caught",finally:"lastly",return:["thenReturn","returns"],throw:["thenThrow"]};t.exports=function(t,r){return new e(t,r)},e.prototype={all:s("all"),any:s("any"),bind:n(11),call:n(12),catch:n(13),delay:n(14),done:n(15),each:s("each"),filter:s("filter"),finally:function(){return this.$$finally.apply(this,arguments)},get:n(16),map:s("map"),nodeify:n(17),props:s("props"),reduce:s("reduce"),return:n(18),some:s("some"),spread:n(19),tap:n(20),then:n(21),throw:n(22),timeout:n(23),constructor:e},u(e.prototype,"$$callArrayListeners",function(t){o.each(this.$$arrayListeners,function(r){r(t)})}),o.each(c,function(t,r){o.isArray(t)||(t=[t]),i.$options.compatibilityAliases&&o.each(t,function(t){e.prototype[t]=e.prototype[r]}),i.$options.disableES5Methods&&delete e.prototype[r]})},function(t,r,n){"use strict";var e=n(9),o=n(4),i=n(10);t.exports=function(t){function r(r,n){var e=o[t].apply(null,[n].concat(r));return i(e,"$$boundTo",this.$$boundTo),e}return function(){var t=e.call(this,arguments);if(this.$$unsynced)return r.call(this,t,this.$$unsynced);var n=this.then(function(e){if(n.$$promiseResult)return n.$$promiseResult;var o=r.call(this,t,e);return n.$$arrayListeners.length&&o.$$unsynced&&n.$$callArrayListeners(o.$$unsynced),o}.bind(this));return this.$$arrayListeners.push(function(e){i(this,"$$promiseResult",r.call(this,t,e)),n.$$arrayListeners.length&&this.$$promiseResult.$$unsynced&&n.$$callArrayListeners(this.$$promiseResult.$$unsynced)}.bind(this)),n}}},function(t,r,n){"use strict";var e=n(2);t.exports=function(t){return e.map(t,function(t){return e.isFunction(t)?t.bind(this.$$boundTo||this):t}.bind(this))}},function(t,r){"use strict";t.exports=function(t,r,n){if(Object.defineProperty)try{Object.defineProperty(t,r,{value:n})}catch(t){}t[r]!==n&&(t[r]=n)}},function(t,r,n){"use strict";var e=n(10);t.exports=function(t){return e(this,"$$boundTo",t),this}},function(t,r,n){"use strict";var e=n(2);t.exports=function(){var t=e.toArray(arguments),r=t.shift();return this.then(function(n){return n[r].apply(n,t)})}},function(t,r,n){"use strict";function e(t,r){var n=!t.length;return i.each(t,function(t){if(!i.isFunction(t))throw new Error("Invalid argument.");return t instanceof Error||t.prototype instanceof Error?(n=n||r instanceof t,!n):(n=n||t(r),!n)}),n}var o=n(4),i=n(2);t.exports=function(){var t=i.toArray(arguments),r=t.pop();return this.$$catch(function(n){return i.isFunction(r)&&e(t,n)?r.call(this,n):o.reject(n)})}},function(t,r,n){"use strict";var e=n(1);t.exports=function(t){return this.then(function(r){var n=e.$defer(this);return setTimeout(n.resolve,t,r),n.promise}.bind(this))}},function(t,r,n){"use strict";var e=n(4);t.exports=function(){return this.then.apply(this,arguments).$$catch(function(t){setTimeout(function(){throw t})}).$$finally(function(){return e.reject(new Error("Do not chain anything after calling done()!"))})}},function(t,r){"use strict";t.exports=function(t){return this.then(function(r){return r[t]})}},function(t,r,n){"use strict";var e=n(2),o=n(4);t.exports=function(t,r){return t=t||e.noop,r=r||{},this.then(function(n){var o=n;return o=r.spread&&e.isArray(o)?[null].concat(o):[null,o],t.apply(this,o),n},function(r){return t.call(this,r),o.reject(r)})}},function(t,r,n){"use strict";var e=n(2);t.exports=function(t){return this.then(e.constant(t))}},function(t,r,n){"use strict";var e=n(2);t.exports=function(t){return this.then(function(r){return e.isArray(r)||(r=[r]),t.apply(this,r)})}},function(t,r,n){"use strict";var e=n(4);t.exports=function(t){return this.then(function(r){return e.when(t.call(this,r)).returns(r)})}},function(t,r,n){"use strict";var e=n(9),o=n(7);t.exports=function(){return o(this.$$then.apply(this,e.call(this,arguments)),this)}},function(t,r,n){"use strict";var e=n(4);t.exports=function(t){return this.then(function(){return e.reject(t)})}},function(t,r,n){"use strict";var e=n(1),o=n(4);t.exports=function(t,r){var n=e.$defer(this),i=setTimeout(function(){n.reject(new o.TimeoutError(r||"Timed out after "+t+" ms"))},t);return this.then(function(t){n.resolve(t)},function(t){n.reject(t)}).finally(clearTimeout.bind(null,i)),n.promise}},function(t,r,n){"use strict";var e=n(4);t.exports=function(t){return e.some(t,1).get(0)}},function(t,r,n){"use strict";var e=n(4);t.exports=function(t){return e.resolve().bind(t)}},function(t,r,n){"use strict";var e=n(7),o=n(1);o.$defer=function(t){var r=o.$delegate.defer();return r.promise=e(r.promise,t),r},t.exports=function(){return o.$defer()}},function(t,r,n){"use strict";var e=n(28);t.exports=e("tap")},function(t,r,n){"use strict";var e=n(2),o=n(4),i=n(29),s=n(10);t.exports=function(t){return function(r,n,u){u=e.pick(u,"concurrency");var c=u.concurrency?new i(u):{add:function(t){return t()}},a=e.map(r,function(e,i){return o.when(e)[t](function(t){return c.add(function(){return o.when(n.call(null,t,i,r.length))})})}),f=o.all(a);return s(f,"$$unsynced",a),f}}},function(t,r,n){"use strict";var e=n(2),o=n(1),i=t.exports=function(t){this.$options=e.defaults(t,{concurrency:1,maxQueue:0}),this.$fns=[]};i.prototype.add=function(t){var r=o.$defer(),n=function(){t().finally(function(){this.$fns.splice(this.$fns.indexOf(n),1),this.$fns.length>=this.$options.concurrency&&this.$fns[this.$options.concurrency-1]()}.bind(this)).then(function(t){r.resolve(t)},function(t){r.reject(t)})}.bind(this);return this.$fns.push(n)<=this.$options.concurrency&&n(),r.promise}},function(t,r,n){"use strict";var e=n(2),o=n(4);t.exports=function(t,r,n){return o.map(t,function(t){return o.props({val:t,toFilter:r.apply(null,arguments)})},n).then(function(t){return e.map(e.filter(t,"toFilter"),"val")})}},function(t,r,n){"use strict";var e=n(28);t.exports=e("then")},function(t,r,n){"use strict";var e=n(2),o=n(4);t.exports=function(){var t=e.toArray(arguments),r=t.pop();return o.all(t).spread(r)}},function(t,r,n){"use strict";var e=n(34);t.exports=function(t){return function(){return e(t,arguments,this)}}},function(t,r,n){"use strict";var e=n(2),o=n(4);t.exports=function(t,r,n){try{return e.isEmpty(r)||e.isArray(r)||e.isArguments(r)||(r=[r]),o.when(t.apply(n||this,r))}catch(t){return o.reject(t)}}},function(t,r,n){"use strict";var e=n(2),o=n(4);t.exports=function(t){return o.all(e.values(t)).then(function(r){return e.zipObject(e.keys(t),r)})}},function(t,r,n){"use strict";var e=n(2),o=n(4);t.exports=function(t,r,n){return e.reduce(t,function(n,e,i){return o.join(n,e,function(n,e){return r(n,e,i,t.length)})},o.resolve(n))}},function(t,r,n){"use strict";var e=n(38);t.exports=e("reject")},function(t,r,n){"use strict";var e=n(7),o=n(1);t.exports=function(t){return t in o.$delegate?function(){return e(o.$delegate[t].apply(o.$delegate,arguments))}:null}},function(t,r,n){"use strict";var e=n(4),o=n(38);t.exports=o("resolve")||function(t){var r=e.defer();return r.resolve(t),r.promise}},function(t,r,n){"use strict";var e=n(2),o=n(4),i=n(5).AggregateError;t.exports=function(t,r){if(t.length<r)return o.reject(new i("initial array length ("+t.length+") > count ("+r+")"));var n=0,s=[],u=o.defer();return e.each(t,function(e){o.when(e).tap(function(t){null!==s&&(s.push(t),s.length>=r&&(u.resolve(s),s=null))}).$$catch(function(){null!==s&&(++n,t.length-n<r&&(u.reject(new i("Cannot resolve promise: too many rejections ("+n+")")),s=null))})}),u.promise}},function(t,r,n){"use strict";var e=n(38);t.exports=e("when")}])}); | ||
//# sourceMappingURL=angular-extend-promises-without-lodash.min.js.map |
/*! | ||
* angular-extend-promises v1.0.0-rc.3 - 2015-04-22 | ||
* (c) 2014-2015 L.systems SARL, Etienne Folio, Quentin Raynaud | ||
* angular-extend-promises v1.0.0-rc.4 - 2016-12-15 | ||
* (c) 2014-2016 L.systems SARL, Etienne Folio, Quentin Raynaud | ||
* https://bitbucket.org/lsystems/angular-extend-promises | ||
* License: MIT | ||
*/ | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):"object"==typeof exports?exports["angular-extend-promises"]=n():t["angular-extend-promises"]=n()}(this,function(){return function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n,r){"use strict";angular.module("angular-extend-promises",[]).provider("angularExtendPromises",function(){this.options={compatibilityAliases:!0,disableES5Methods:!1},this.$get=function(){return this.options}}).config(["$provide",function(t){if(angular.mock)for(var n in r.c)delete r.c[n];t.decorator("$q",["$delegate","angularExtendPromises",function(t,n){var e=r(1);return e.$delegate=t,e.$options=n,r(2)}])}])},function(t,n,r){"use strict";var e=r(3);e.extend(t.exports,{$defer:e.noop(),$delegate:{},$options:{}})},function(t,n,r){"use strict";var e=r(3),o=r(1),u=r(4),i=t.exports=function(t){if(!e.isFunction(t))throw new Error("resolver should be a function");var n=i.defer();try{t(n.resolve,n.reject)}catch(r){n.reject(r)}return n.promise};e.extend(i,{all:r(5),any:r(6),bind:r(7),defer:r(8),each:r(9),filter:r(10),map:r(11),join:r(12),method:r(13),props:r(14),reduce:r(15),reject:r(16),resolve:r(17),some:r(18),when:r(19),AggregateError:u.AggregateError,TimeoutError:u.TimeoutError}),o.$options.compatibilityAliases&&e.extend(i,{attempt:r(20)}),o.$options.disableES5Methods||e.extend(i,{"try":r(20)})},function(t,n,r){"use strict";try{t.exports=r(21)}catch(e){t.exports=_}},function(t,n,r){"use strict";var e=t.exports.NewQError=function(t){this.name=this.constructor.name,Error.apply(this,arguments),this.message=t,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack};e.prototype.toString=function(){return this.stack.toString()},e.subError=function(t,n){function r(){}n=n||e,r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t,t.subError||(t.subError=function(n){e.subError(n,t)})},e.subError(e,Error);var o=t.exports.AggregateError=function(){e.apply(this,arguments)};e.subError(o);var u=t.exports.TimeoutError=function(){e.apply(this,arguments)};e.subError(u)},function(t,n,r){"use strict";var e=r(3),o=r(22),u=r(1),i=r(2);t.exports=function(t){return e.isArray(t)?(t=e.map(t,function(t){return i.when(t)}),o(u.$delegate.all(t))):i.props(t)}},function(t,n,r){"use strict";var e=r(2);t.exports=function(t){return e.some(t,1).get(0)}},function(t,n,r){"use strict";var e=r(2);t.exports=function(t){return e.resolve().bind(t)}},function(t,n,r){"use strict";var e=r(22),o=r(1);o.$defer=function(t){var n=o.$delegate.defer();return n.promise=e(n.promise,t),n},t.exports=function(){return o.$defer()}},function(t,n,r){"use strict";var e=r(23);t.exports=e("tap")},function(t,n,r){"use strict";var e=r(3),o=r(2);t.exports=function(t,n,r){return o.map(t,function(t){return o.props({val:t,toFilter:n.apply(null,arguments)})},r).then(function(t){return e.map(e.filter(t,"toFilter"),"val")})}},function(t,n,r){"use strict";var e=r(23);t.exports=e("then")},function(t,n,r){"use strict";var e=r(3),o=r(2);t.exports=function(){var t=e.toArray(arguments),n=t.pop();return o.all(t).spread(n)}},function(t,n,r){"use strict";var e=r(20);t.exports=function(t){return function(){return e(t,arguments,this)}}},function(t,n,r){"use strict";var e=r(3),o=r(2);t.exports=function(t){return o.all(e.values(t)).then(function(n){return e.object(e.keys(t),n)})}},function(t,n,r){"use strict";var e=r(3),o=r(2);t.exports=function(t,n,r){return e.reduce(t,function(r,e,u){return o.join(r,e,function(r,e){return n(r,e,u,t.length)})},o.resolve(r))}},function(t,n,r){"use strict";var e=r(24);t.exports=e("reject")},function(t,n,r){"use strict";var e=r(2),o=r(24);t.exports=o("resolve")||function(t){var n=e.defer();return n.resolve(t),n.promise}},function(t,n,r){"use strict";var e=r(3),o=r(2),u=r(4).AggregateError;t.exports=function(t,n){if(t.length<n)return o.reject(new u("initial array length ("+t.length+") > count ("+n+")"));var r=0,i=[],c=o.defer();return e.each(t,function(e){o.when(e).tap(function(t){null!==i&&(i.push(t),i.length>=n&&(c.resolve(i),i=null))}).$$catch(function(){null!==i&&(++r,t.length-r<n&&(c.reject(new u("Cannot resolve promise: too many rejections ("+r+")")),i=null))})}),c.promise}},function(t,n,r){"use strict";var e=r(24);t.exports=e("when")},function(t,n,r){"use strict";var e=r(3),o=r(2);t.exports=function(t,n,r){try{return e.isEmpty(n)||e.isArray(n)||e.isArguments(n)||(n=[n]),o.when(t.apply(r||this,n))}catch(u){return o.reject(u)}}},function(t,n,r){var e;(function(t,o){(function(){function u(t){return"function"==typeof t||!1}function i(t){return"string"==typeof t?t:null==t?"":t+""}function c(t){return!!t&&"object"==typeof t}function s(){}function a(t,n){var r=-1,e=t.length;for(n||(n=Array(e));++r<e;)n[r]=t[r];return n}function f(t,n){for(var r=-1,e=t.length;++r<e&&n(t[r],r,t)!==!1;);return t}function l(t,n){for(var r=-1,e=t.length,o=-1,u=[];++r<e;){var i=t[r];n(i,r,t)&&(u[++o]=i)}return u}function p(t,n){for(var r=-1,e=t.length,o=Array(e);++r<e;)o[r]=n(t[r],r,t);return o}function h(t,n,r,e){var o=-1,u=t.length;for(e&&u&&(r=t[++o]);++o<u;)r=n(r,t[o],o,t);return r}function v(t,n){return t===jt?n:t}function y(t,n,r){var e=zn(n);xn.apply(e,Cn(n));for(var o=-1,u=e.length;++o<u;){var i=e[o],c=t[i],s=r(c,n[i],i,t,n);(s===s?s===c:c!==c)&&(c!==jt||i in t)||(t[i]=s)}return t}function g(t,n,r){r||(r={});for(var e=-1,o=n.length;++e<o;){var u=n[e];r[u]=t[u]}return r}function d(t,n,r){var e=typeof t;return"function"==e?n===jt?t:I(t,n,r):null==t?$t:"object"==e?T(t):n===jt?xt(t):k(t,n)}function m(t,n){var r=[];return _n(t,function(t,e,o){n(t,e,o)&&r.push(t)}),r}function $(t,n,r){for(var e=-1,o=t.length,u=-1,i=[];++e<o;){var s=t[e];if(c(s)&&H(s.length)&&(Dn(s)||it(s))){n&&(s=$(s,n,r));var a=-1,f=s.length;for(i.length+=f;++a<f;)i[++u]=s[a]}else r||(i[++u]=s)}return i}function b(t,n){return In(t,n,vt)}function x(t,n){return In(t,n,zn)}function j(t,n){for(var r=-1,e=n.length,o=-1,u=[];++r<e;){var i=n[r];Bn(t[i])&&(u[++o]=i)}return u}function E(t,n,r){if(null!=t){t=Z(t),r!==jt&&r in t&&(n=[r]);for(var e=-1,o=n.length;null!=t&&++e<o;)var u=t=Z(t)[n[e]];return u}}function A(t,n,r,e,o,u){if(t===n)return 0!==t||1/t==1/n;var i=typeof t,c=typeof n;return"function"!=i&&"object"!=i&&"function"!=c&&"object"!=c||null==t||null==n?t!==t&&n!==n:w(t,n,A,r,e,o,u)}function w(t,n,r,e,o,u,i){var c=Dn(t),s=Dn(n),a=Ot,f=Ot;c||(a=mn.call(t),a==wt?a=Lt:a!=Lt&&(c=lt(t))),s||(f=mn.call(n),f==wt?f=Lt:f!=Lt&&(s=lt(n)));var l=a==Lt&&!ln(t),p=f==Lt&&!ln(n),h=a==f;if(h&&!c&&!l)return Q(t,n,a);if(!o){var v=l&&dn.call(t,"__wrapped__"),y=p&&dn.call(n,"__wrapped__");if(v||y)return r(v?t.value():t,y?n.value():n,e,o,u,i)}if(!h)return!1;u||(u=[]),i||(i=[]);for(var g=u.length;g--;)if(u[g]==t)return i[g]==n;u.push(t),i.push(n);var d=(c?B:q)(t,n,r,e,o,u,i);return u.pop(),i.pop(),d}function O(t,n,r,e,o){for(var u=-1,i=n.length,c=!o;++u<i;)if(c&&e[u]?r[u]!==t[n[u]]:!(n[u]in t))return!1;for(u=-1;++u<i;){var s=n[u],a=t[s],f=r[u];if(c&&e[u])var l=a!==jt||s in t;else l=o?o(a,f,s):jt,l===jt&&(l=A(f,a,o,!0));if(!l)return!1}return!0}function S(t,n){var r=-1,e=Mn(t),o=H(e)?Array(e):[];return _n(t,function(t,e,u){o[++r]=n(t,e,u)}),o}function T(t){var n=zn(t),r=n.length;if(!r)return mt(!0);if(1==r){var e=n[0],o=t[e];if(J(o))return function(t){return null==t?!1:(t=Z(t),t[e]===o&&(o!==jt||e in t))}}for(var u=Array(r),i=Array(r);r--;)o=t[n[r]],u[r]=o,i[r]=J(o);return function(t){return null!=t&&O(Z(t),n,u,i)}}function k(t,n){var r=Dn(t),e=G(t)&&J(n),o=t+"";return t=tt(t),function(u){if(null==u)return!1;var i=o;if(u=Z(u),!(!r&&e||i in u)){if(u=1==t.length?u:E(u,L(t,0,-1)),null==u)return!1;i=nt(t),u=Z(u)}return u[i]===n?n!==jt||i in u:A(n,u[i],null,!0)}}function P(t){return function(n){return null==n?jt:Z(n)[t]}}function F(t){var n=t+"";return t=tt(t),function(r){return E(r,t,n)}}function R(t,n,r,e,o){return o(t,function(t,o,u){r=e?(e=!1,t):n(r,t,o,u)}),r}function L(t,n,r){var e=-1,o=t.length;n=null==n?0:+n||0,0>n&&(n=-n>o?0:o+n),r=r===jt||r>o?o:+r||0,0>r&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var u=Array(o);++e<o;)u[e]=t[e+n];return u}function _(t,n){for(var r=-1,e=n.length,o=Array(e);++r<e;)o[r]=t[n[r]];return o}function I(t,n,r){if("function"!=typeof t)return $t;if(n===jt)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 3:return function(r,e,o){return t.call(n,r,e,o)};case 4:return function(r,e,o,u){return t.call(n,r,e,o,u)};case 5:return function(r,e,o,u,i){return t.call(n,r,e,o,u,i)}}return function(){return t.apply(n,arguments)}}function M(t){return ut(function(n,r){var e=-1,o=null==n?0:r.length,u=o>2&&r[o-2],i=o>2&&r[2],c=o>1&&r[o-1];for("function"==typeof u?(u=I(u,c,5),o-=2):(u="function"==typeof c?c:null,o-=u?1:0),i&&W(r[0],r[1],i)&&(u=3>o?null:u,o=1);++e<o;){var s=r[e];s&&t(n,s,u)}return n})}function C(t,n){return function(r,e){var o=r?Mn(r):0;if(!H(o))return t(r,e);for(var u=n?o:-1,i=Z(r);(n?u--:++u<o)&&e(i[u],u,i)!==!1;);return r}}function N(t){return function(n,r,e){for(var o=Z(n),u=e(n),i=u.length,c=t?i:-1;t?c--:++c<i;){var s=u[c];if(r(o[s],s,o)===!1)break}return n}}function U(t,n){return function(r,e,o){return"function"==typeof e&&o===jt&&Dn(r)?t(r,e):n(r,I(e,o,3))}}function D(t,n){return function(r,e,o,u){var i=arguments.length<3;return"function"==typeof e&&u===jt&&Dn(r)?t(r,e,o,i):R(r,z(e,u,4),o,i,n)}}function B(t,n,r,e,o,u,i){var c=-1,s=t.length,a=n.length,f=!0;if(s!=a&&!(o&&a>s))return!1;for(;f&&++c<s;){var l=t[c],p=n[c];if(f=jt,e&&(f=o?e(p,l,c):e(l,p,c)),f===jt)if(o)for(var h=a;h--&&(p=n[h],!(f=l&&l===p||r(l,p,e,o,u,i))););else f=l&&l===p||r(l,p,e,o,u,i)}return!!f}function Q(t,n,r){switch(r){case St:case Tt:return+t==+n;case kt:return t.name==n.name&&t.message==n.message;case Rt:return t!=+t?n!=+n:0==t?1/t==1/n:t==+n;case _t:case Mt:return t==n+""}return!1}function q(t,n,r,e,o,u,i){var c=zn(t),s=c.length,a=zn(n),f=a.length;if(s!=f&&!o)return!1;for(var l=o,p=-1;++p<s;){var h=c[p],v=o?h in n:dn.call(n,h);if(v){var y=t[h],g=n[h];v=jt,e&&(v=o?e(g,y,h):e(y,g,h)),v===jt&&(v=y&&y===g||r(y,g,e,o,u,i))}if(!v)return!1;l||(l="constructor"==h)}if(!l){var d=t.constructor,m=n.constructor;if(d!=m&&"constructor"in t&&"constructor"in n&&!("function"==typeof d&&d instanceof d&&"function"==typeof m&&m instanceof m))return!1}return!0}function z(t,n,r){var e=s.callback||dt;return e=e===dt?d:e,r?e(t,n,r):e}function V(t,n){return t=+t,n=null==n?Pn:n,t>-1&&t%1==0&&n>t}function W(t,n,r){if(!st(r))return!1;var e=typeof n;if("number"==e)var o=Mn(r),u=H(o)&&V(n,o);else u="string"==e&&n in r;if(u){var i=r[n];return t===t?t===i:i!==i}return!1}function G(t,n){var r=typeof t;if("string"==r&&Jt.test(t)||"number"==r)return!0;if(Dn(t))return!1;var e=!Ht.test(t);return e||null!=n&&t in Z(n)}function H(t){return"number"==typeof t&&t>-1&&t%1==0&&Pn>=t}function J(t){return t===t&&(0===t?1/t>0:!st(t))}function K(t,n){t=Z(t);for(var r=-1,e=n.length,o={};++r<e;){var u=n[r];u in t&&(o[u]=t[u])}return o}function X(t,n){var r={};return b(t,function(t,e,o){n(t,e,o)&&(r[e]=t)}),r}function Y(t){for(var n=vt(t),r=n.length,e=r&&t.length,o=s.support,u=e&&H(e)&&(Dn(t)||o.nonEnumStrings&&ft(t)||o.nonEnumArgs&&it(t)),i=-1,c=[];++i<r;){var a=n[i];(u&&V(a,e)||dn.call(t,a))&&c.push(a)}return c}function Z(t){if(s.support.unindexedChars&&ft(t)){for(var n=-1,r=t.length,e=Object(t);++n<r;)e[n]=t.charAt(n);return e}return st(t)?t:Object(t)}function tt(t){if(Dn(t))return t;var n=[];return i(t).replace(Kt,function(t,r,e,o){n.push(e?o.replace(Zt,"$1"):r||t)}),n}function nt(t){var n=t?t.length:0;return n?t[n-1]:jt}function rt(t,n){var r=-1,e=t?t.length:0,o={};for(!e||n||Dn(t[0])||(n=[]);++r<e;){var u=t[r];n?o[u]=n[r]:u&&(o[u[0]]=u[1])}return o}function et(t,n,r){var e=Dn(t)?l:m;return n=z(n,r,3),e(t,n)}function ot(t,n,r){var e=Dn(t)?p:S;return n=z(n,r,3),e(t,n)}function ut(t,n){if("function"!=typeof t)throw new TypeError(At);return n=kn(n===jt?t.length-1:+n||0,0),function(){for(var r=arguments,e=-1,o=kn(r.length-n,0),u=Array(o);++e<o;)u[e]=r[n+e];switch(n){case 0:return t.call(this,u);case 1:return t.call(this,r[0],u);case 2:return t.call(this,r[0],r[1],u)}var i=Array(n+1);for(e=-1;++e<n;)i[e]=r[e];return i[n]=u,t.apply(this,i)}}function it(t){var n=c(t)?t.length:jt;return H(n)&&mn.call(t)==wt}function ct(t){if(null==t)return!0;var n=Mn(t);return H(n)&&(Dn(t)||ft(t)||it(t)||c(t)&&Bn(t.splice))?!n:!zn(t).length}function st(t){var n=typeof t;return"function"==n||!!t&&"object"==n}function at(t){return null==t?!1:mn.call(t)==Pt?$n.test(gn.call(t)):c(t)&&(ln(t)?$n:tn).test(t)}function ft(t){return"string"==typeof t||c(t)&&mn.call(t)==Mt}function lt(t){return c(t)&&H(t.length)&&!!rn[mn.call(t)]}function pt(t){var n=t?Mn(t):0;return H(n)?n?s.support.unindexedChars&&ft(t)?t.split(""):a(t):[]:yt(t)}function ht(t){return j(t,vt(t))}function vt(t){if(null==t)return[];st(t)||(t=Object(t));var n=t.length,r=s.support;n=n&&H(n)&&(Dn(t)||r.nonEnumStrings&&ft(t)||r.nonEnumArgs&&it(t))&&n||0;for(var e=t.constructor,o=-1,u=Bn(e)&&e.prototype||vn,i=u===t,c=Array(n),a=n>0,f=r.enumErrorProps&&(t===hn||t instanceof Error),l=r.enumPrototypes&&Bn(t);++o<n;)c[o]=o+"";for(var p in t)l&&"prototype"==p||f&&("message"==p||"name"==p)||a&&V(p,n)||"constructor"==p&&(i||!dn.call(t,p))||c.push(p);if(r.nonEnumShadows&&t!==vn){var h=t===yn?Mt:t===hn?kt:mn.call(t),v=Fn[h]||Fn[Lt];for(h==Lt&&(u=vn),n=nn.length;n--;){p=nn[n];var y=v[p];i&&y||(y?!dn.call(t,p):t[p]===u[p])||c.push(p)}}return c}function yt(t){return _(t,zn(t))}function gt(t){return t=i(t),t&&Yt.test(t)?t.replace(Xt,"\\$&"):t}function dt(t,n,r){return r&&W(t,n,r)&&(n=null),d(t,n)}function mt(t){return function(){return t}}function $t(t){return t}function bt(){}function xt(t){return G(t)?P(t):F(t)}var jt,Et="3.7.0",At="Expected a function",wt="[object Arguments]",Ot="[object Array]",St="[object Boolean]",Tt="[object Date]",kt="[object Error]",Pt="[object Function]",Ft="[object Map]",Rt="[object Number]",Lt="[object Object]",_t="[object RegExp]",It="[object Set]",Mt="[object String]",Ct="[object WeakMap]",Nt="[object ArrayBuffer]",Ut="[object Float32Array]",Dt="[object Float64Array]",Bt="[object Int8Array]",Qt="[object Int16Array]",qt="[object Int32Array]",zt="[object Uint8Array]",Vt="[object Uint8ClampedArray]",Wt="[object Uint16Array]",Gt="[object Uint32Array]",Ht=/\.|\[(?:[^[\]]+|(["'])(?:(?!\1)[^\n\\]|\\.)*?)\1\]/,Jt=/^\w*$/,Kt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,Xt=/[.*+?^${}()|[\]\/\\]/g,Yt=RegExp(Xt.source),Zt=/\\(\\)?/g,tn=/^\[object .+?Constructor\]$/,nn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rn={};rn[Ut]=rn[Dt]=rn[Bt]=rn[Qt]=rn[qt]=rn[zt]=rn[Vt]=rn[Wt]=rn[Gt]=!0,rn[wt]=rn[Ot]=rn[Nt]=rn[St]=rn[Tt]=rn[kt]=rn[Pt]=rn[Ft]=rn[Rt]=rn[Lt]=rn[_t]=rn[It]=rn[Mt]=rn[Ct]=!1;var en={"function":!0,object:!0},on=en[typeof n]&&n&&!n.nodeType&&n,un=en[typeof t]&&t&&!t.nodeType&&t,cn=on&&un&&"object"==typeof o&&o&&o.Object&&o,sn=en[typeof self]&&self&&self.Object&&self,an=en[typeof window]&&window&&window.Object&&window,fn=(un&&un.exports===on&&on,cn||an!==(this&&this.window)&&an||sn||this),ln=function(){try{Object({toString:0}+"")}catch(t){return function(){return!1}}return function(t){return"function"!=typeof t.toString&&"string"==typeof(t+"")}}(),pn=Array.prototype,hn=Error.prototype,vn=Object.prototype,yn=String.prototype,gn=Function.prototype.toString,dn=vn.hasOwnProperty,mn=vn.toString,$n=RegExp("^"+gt(mn).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),bn=at(bn=Object.getOwnPropertySymbols)&&bn,xn=pn.push,jn=at(Object.preventExtensions=Object.preventExtensions)&&jn,En=vn.propertyIsEnumerable,An=pn.splice,wn=at(wn=fn.Uint8Array)&&wn,On=function(){var t={1:0},n=jn&&at(n=Object.assign)&&n;try{n(jn(t),"xo")}catch(r){}return!t[1]&&n}(),Sn=at(Sn=Array.isArray)&&Sn,Tn=at(Tn=Object.keys)&&Tn,kn=Math.max,Pn=Math.pow(2,53)-1,Fn={};Fn[Ot]=Fn[Tt]=Fn[Rt]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Fn[St]=Fn[Mt]={constructor:!0,toString:!0,valueOf:!0},Fn[kt]=Fn[Pt]=Fn[_t]={constructor:!0,toString:!0},Fn[Lt]={constructor:!0},f(nn,function(t){for(var n in Fn)if(dn.call(Fn,n)){var r=Fn[n];r[t]=dn.call(r,t)}});var Rn=s.support={};!function(t){var n=function(){this.x=t},r={0:t,length:t},e=[];n.prototype={valueOf:t,y:t};for(var o in new n)e.push(o);Rn.argsTag=mn.call(arguments)==wt,Rn.enumErrorProps=En.call(hn,"message")||En.call(hn,"name"),Rn.enumPrototypes=En.call(n,"prototype"),Rn.funcDecomp=/\bthis\b/.test(function(){return this}),Rn.funcNames="string"==typeof Function.name,Rn.nonEnumStrings=!En.call("x",0),Rn.nonEnumShadows=!/valueOf/.test(e),Rn.spliceObjects=(An.call(r,0,1),!r[0]),Rn.unindexedChars="x"[0]+Object("x")[0]!="xx";try{Rn.nonEnumArgs=!En.call(arguments,1)}catch(u){Rn.nonEnumArgs=!0}}(1,0);var Ln=On||function(t,n){return null==n?t:g(n,Cn(n),g(n,zn(n),t))},_n=C(x),In=N(),Mn=P("length"),Cn=bn?function(t){return bn(Z(t))}:mt([]),Nn=U(f,_n),Un=D(h,_n);Rn.argsTag||(it=function(t){var n=c(t)?t.length:jt;return H(n)&&dn.call(t,"callee")&&!En.call(t,"callee")});var Dn=Sn||function(t){return c(t)&&H(t.length)&&mn.call(t)==Ot},Bn=u(/x/)||wn&&!u(wn)?function(t){return mn.call(t)==Pt}:u,Qn=M(function(t,n,r){return r?y(t,n,r):Ln(t,n)}),qn=ut(function(t){var n=t[0];return null==n?n:(t.push(v),Qn.apply(jt,t))}),zn=Tn?function(t){if(t)var n=t.constructor,r=t.length;return"function"==typeof n&&n.prototype===t||("function"==typeof t?s.support.enumPrototypes:H(r))?Y(t):st(t)?Tn(t):[]}:Y,Vn=ut(function(t,n){return null==t?{}:"function"==typeof n[0]?X(t,I(n[0],n[1],3)):K(t,$(n))});s.assign=Qn,s.callback=dt,s.constant=mt,s.defaults=qn,s.filter=et,s.forEach=Nn,s.functions=ht,s.keys=zn,s.keysIn=vt,s.map=ot,s.pick=Vn,s.property=xt,s.restParam=ut,s.toArray=pt,s.values=yt,s.zipObject=rt,s.collect=ot,s.each=Nn,s.extend=Qn,s.iteratee=dt,s.methods=ht,s.object=rt,s.select=et,s.escapeRegExp=gt,s.identity=$t,s.isArguments=it,s.isArray=Dn,s.isEmpty=ct,s.isFunction=Bn,s.isNative=at,s.isObject=st,s.isString=ft,s.isTypedArray=lt,s.last=nt,s.noop=bt,s.reduce=Un,s.foldl=Un,s.inject=Un,s.VERSION=Et,fn._=s,e=function(){return s}.call(n,r,n,t),!(e!==jt&&(t.exports=e))}).call(this)}).call(n,r(41)(t),function(){return this}())},function(t,n,r){"use strict";function e(t,n){c(this,"$$state",t.$$state),o.each(o.methods(t),function(n){c(this,"$$"+n,t[n])},this),n&&n.$$boundTo&&c(this,"$$boundTo",n.$$boundTo),c(this,"$$arrayListeners",[]),this.then=t.then=this.then.bind(this)}var o=r(3),u=r(1),i=r(25),c=r(26),s={"catch":"caught","finally":"lastly","return":["thenReturn","returns"],"throw":["thenThrow"]};t.exports=function(t,n){return new e(t,n)},e.prototype={all:i("all"),any:i("any"),bind:r(27),call:r(28),"catch":r(29),delay:r(30),done:r(31),each:i("each"),filter:i("filter"),"finally":function(){return this.$$finally.apply(this,arguments)},get:r(32),map:i("map"),nodeify:r(33),props:i("props"),reduce:i("reduce"),"return":r(34),some:i("some"),spread:r(35),tap:r(36),then:r(37),"throw":r(38),timeout:r(39),constructor:e},c(e.prototype,"$$callArrayListeners",function(t){o.each(this.$$arrayListeners,function(n){n(t)})}),o.each(s,function(t,n){o.isArray(t)||(t=[t]),u.$options.compatibilityAliases&&o.each(t,function(t){e.prototype[t]=e.prototype[n]}),u.$options.disableES5Methods&&delete e.prototype[n]})},function(t,n,r){"use strict";var e=r(3),o=r(2),u=r(40),i=r(26);t.exports=function(t){return function(n,r,c){c=e.pick(c,"concurrency");var s=c.concurrency?new u(c):{add:function(t){return t()}},a=e.map(n,function(e,u){return o.when(e)[t](function(t){return s.add(function(){return o.when(r.call(null,t,u,n.length))})})}),f=o.all(a);return i(f,"$$unsynced",a),f}}},function(t,n,r){"use strict";var e=r(22),o=r(1);t.exports=function(t){return t in o.$delegate?function(){return e(o.$delegate[t].apply(o.$delegate,arguments))}:null}},function(t,n,r){"use strict";var e=r(42),o=r(2),u=r(26);t.exports=function(t){function n(n,r){var e=o[t].apply(null,[r].concat(n));return u(e,"$$boundTo",this.$$boundTo),e}return function(){var t=e.call(this,arguments);if(this.$$unsynced)return n.call(this,t,this.$$unsynced);var r=this.then(function(e){if(r.$$promiseResult)return r.$$promiseResult;var o=n.call(this,t,e);return r.$$arrayListeners.length&&o.$$unsynced&&r.$$callArrayListeners(o.$$unsynced),o}.bind(this));return this.$$arrayListeners.push(function(e){u(this,"$$promiseResult",n.call(this,t,e)),r.$$arrayListeners.length&&this.$$promiseResult.$$unsynced&&r.$$callArrayListeners(this.$$promiseResult.$$unsynced)}.bind(this)),r}}},function(t,n,r){"use strict";t.exports=function(t,n,r){if(Object.defineProperty)try{Object.defineProperty(t,n,{value:r})}catch(e){}t[n]!==r&&(t[n]=r)}},function(t,n,r){"use strict";var e=r(26);t.exports=function(t){return e(this,"$$boundTo",t),this}},function(t,n,r){"use strict";var e=r(3);t.exports=function(){var t=e.toArray(arguments),n=t.shift();return this.then(function(r){return r[n].apply(r,t)})}},function(t,n,r){"use strict";function e(t,n){var r=!t.length;return u.each(t,function(t){if(!u.isFunction(t))throw new Error("Invalid argument.");return t instanceof Error||t.prototype instanceof Error?(r=r||n instanceof t,!r):(r=r||t(n),!r)}),r}var o=r(2),u=r(3);t.exports=function(){var t=u.toArray(arguments),n=t.pop();return this.$$catch(function(r){return u.isFunction(n)&&e(t,r)?n.call(this,r):o.reject(r)})}},function(t,n,r){"use strict";var e=r(1);t.exports=function(t){return this.then(function(n){var r=e.$defer(this);return setTimeout(r.resolve,t,n),r.promise}.bind(this))}},function(t,n,r){"use strict";var e=r(2);t.exports=function(){return this.then.apply(this,arguments).$$catch(function(t){setTimeout(function(){throw t})}).$$finally(function(){return e.reject(new Error("Do not chain anything after calling done()!"))})}},function(t,n,r){"use strict";t.exports=function(t){return this.then(function(n){return n[t]})}},function(t,n,r){"use strict";var e=r(3),o=r(2);t.exports=function(t,n){return t=t||e.noop,n=n||{},this.then(function(r){var o=r;return o=n.spread&&e.isArray(o)?[null].concat(o):[null,o],t.apply(this,o),r},function(n){return t.call(this,n),o.reject(n)})}},function(t,n,r){"use strict";var e=r(3);t.exports=function(t){return this.then(e.constant(t))}},function(t,n,r){"use strict";var e=r(3);t.exports=function(t){return this.then(function(n){return e.isArray(n)||(n=[n]),t.apply(this,n)})}},function(t,n,r){"use strict";var e=r(2);t.exports=function(t){return this.then(function(n){return e.when(t.call(this,n)).returns(n)})}},function(t,n,r){"use strict";var e=r(42),o=r(22);t.exports=function(){return o(this.$$then.apply(this,e.call(this,arguments)),this)}},function(t,n,r){"use strict";var e=r(2);t.exports=function(t){return this.then(function(){return e.reject(t)})}},function(t,n,r){"use strict";var e=r(1),o=r(2);t.exports=function(t,n){var r=e.$defer(this),u=setTimeout(function(){r.reject(new o.TimeoutError(n||"Timed out after "+t+" ms"))},t);return this.then(function(t){r.resolve(t)},function(t){r.reject(t)})["finally"](clearTimeout.bind(null,u)),r.promise}},function(t,n,r){"use strict";var e=r(3),o=r(1),u=t.exports=function(t){this.$options=e.defaults(t,{concurrency:1,maxQueue:0}),this.$fns=[]};u.prototype.add=function(t){var n=o.$defer(),r=function(){t()["finally"](function(){this.$fns.splice(this.$fns.indexOf(r),1),this.$fns.length>=this.$options.concurrency&&this.$fns[this.$options.concurrency-1]()}.bind(this)).then(function(t){n.resolve(t)},function(t){n.reject(t)})}.bind(this);return this.$fns.push(r)<=this.$options.concurrency&&r(),n.promise}},function(t,n,r){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,n,r){"use strict";var e=r(3);t.exports=function(t){return e.map(t,function(t){return e.isFunction(t)?t.bind(this.$$boundTo||this):t},this)}}])}); | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["angular-extend-promises"]=n():t["angular-extend-promises"]=n()}(this,function(){return function(t){function n(e){if(r[e])return r[e].exports;var u=r[e]={exports:{},id:e,loaded:!1};return t[e].call(u.exports,u,u.exports,n),u.loaded=!0,u.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n,r){"use strict";angular.module("angular-extend-promises",[]).provider("angularExtendPromises",function(){this.options={compatibilityAliases:!0,disableES5Methods:!1},this.$get=function(){return this.options}}).config(["$provide",function(t){if(angular.mock)for(var n in r.c)delete r.c[n];t.decorator("$q",["$delegate","angularExtendPromises",function(t,n){var e=r(1);return e.$delegate=t,e.$options=n,r(5)}])}])},function(t,n,r){"use strict";var e=r(2);e.extend(t.exports,{$defer:e.noop(),$delegate:{},$options:{}})},function(t,n,r){"use strict";try{t.exports=r(3)}catch(n){t.exports=_}},function(t,n,r){var e;(function(t,u){(function(){function o(t,n){return t.set(n[0],n[1]),t}function i(t,n){return t.add(n),t}function c(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}function a(t,n){for(var r=-1,e=null==t?0:t.length;++r<e&&n(t[r],r,t)!==!1;);return t}function s(t,n){for(var r=-1,e=null==t?0:t.length,u=0,o=[];++r<e;){var i=t[r];n(i,r,t)&&(o[u++]=i)}return o}function f(t,n){for(var r=-1,e=null==t?0:t.length,u=Array(e);++r<e;)u[r]=n(t[r],r,t);return u}function l(t,n){for(var r=-1,e=n.length,u=t.length;++r<e;)t[u+r]=n[r];return t}function p(t,n,r,e){var u=-1,o=null==t?0:t.length;for(e&&o&&(r=t[++u]);++u<o;)r=n(r,t[u],u,t);return r}function h(t,n){for(var r=-1,e=null==t?0:t.length;++r<e;)if(n(t[r],r,t))return!0;return!1}function v(t){return t.split("")}function y(t){return function(n){return null==n?sr:n[t]}}function d(t,n,r,e,u){return u(t,function(t,u,o){r=e?(e=!1,t):n(r,t,u,o)}),r}function g(t,n){for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);return e}function b(t){return function(n){return t(n)}}function _(t,n){return f(n,function(n){return t[n]})}function $(t,n){return t.has(n)}function j(t,n){return null==t?sr:t[n]}function m(t){return Te.test(t)}function x(t){for(var n,r=[];!(n=t.next()).done;)r.push(n.value);return r}function w(t){var n=-1,r=Array(t.size);return t.forEach(function(t,e){r[++n]=[e,t]}),r}function A(t,n){return function(r){return t(n(r))}}function O(t){var n=-1,r=Array(t.size);return t.forEach(function(t){r[++n]=t}),r}function E(t){return m(t)?z(t):v(t)}function z(t){return t.match(ke)||[]}function k(){}function T(t){var n=-1,r=null==t?0:t.length;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function S(){this.__data__=_u?_u(null):{},this.size=0}function L(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}function F(t){var n=this.__data__;if(_u){var r=n[t];return r===hr?sr:r}return Ge.call(n,t)?n[t]:sr}function I(t){var n=this.__data__;return _u?n[t]!==sr:Ge.call(n,t)}function P(t,n){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=_u&&n===sr?hr:n,this}function R(t){var n=-1,r=null==t?0:t.length;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function M(){this.__data__=[],this.size=0}function U(t){var n=this.__data__,r=it(n,t);if(r<0)return!1;var e=n.length-1;return r==e?n.pop():uu.call(n,r,1),--this.size,!0}function B(t){var n=this.__data__,r=it(n,t);return r<0?sr:n[r][1]}function C(t){return it(this.__data__,t)>-1}function D(t,n){var r=this.__data__,e=it(r,t);return e<0?(++this.size,r.push([t,n])):r[e][1]=n,this}function N(t){var n=-1,r=null==t?0:t.length;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function W(){this.size=0,this.__data__={hash:new T,map:new(yu||R),string:new T}}function V(t){var n=an(this,t).delete(t);return this.size-=n?1:0,n}function q(t){return an(this,t).get(t)}function Q(t){return an(this,t).has(t)}function G(t,n){var r=an(this,t),e=r.size;return r.set(t,n),this.size+=r.size==e?0:1,this}function H(t){var n=-1,r=null==t?0:t.length;for(this.__data__=new N;++n<r;)this.add(t[n])}function J(t){return this.__data__.set(t,hr),this}function K(t){return this.__data__.has(t)}function X(t){var n=this.__data__=new R(t);this.size=n.size}function Y(){this.__data__=new R,this.size=0}function Z(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}function tt(t){return this.__data__.get(t)}function nt(t){return this.__data__.has(t)}function rt(t,n){var r=this.__data__;if(r instanceof R){var e=r.__data__;if(!yu||e.length<lr-1)return e.push([t,n]),this.size=++r.size,this;r=this.__data__=new N(e)}return r.set(t,n),this.size=r.size,this}function et(t,n){var r=Uu(t),e=!r&&Mu(t),u=!r&&!e&&Bu(t),o=!r&&!e&&!u&&Cu(t),i=r||e||u||o,c=i?g(t.length,String):[],a=c.length;for(var s in t)!n&&!Ge.call(t,s)||i&&("length"==s||u&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||gn(s,a))||c.push(s);return c}function ut(t,n,r,e){return t===sr||Bn(t,Ve[r])&&!Ge.call(e,r)?n:t}function ot(t,n,r){var e=t[n];Ge.call(t,n)&&Bn(e,r)&&(r!==sr||n in t)||st(t,n,r)}function it(t,n){for(var r=t.length;r--;)if(Bn(t[r][0],n))return r;return-1}function ct(t,n){return t&&Ht(n,Zn(n),t)}function at(t,n){return t&&Ht(n,tr(n),t)}function st(t,n,r){"__proto__"==n&&au?au(t,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[n]=r}function ft(t,n,r,e,u,o){var i,c=n&yr,s=n&dr,f=n&gr;if(r&&(i=u?r(t,e,u,o):r(t)),i!==sr)return i;if(!Vn(t))return t;var l=Uu(t);if(l){if(i=hn(t),!c)return Gt(t,i)}else{var p=Iu(t),h=p==Tr||p==Sr;if(Bu(t))return Bt(t,c);if(p==Pr||p==wr||h&&!u){if(i=s||h?{}:vn(t),!c)return s?Kt(t,at(i,t)):Jt(t,ct(i,t))}else{if(!Le[p])return u?t:{};i=yn(t,p,ft,c)}}o||(o=new X);var v=o.get(t);if(v)return v;o.set(t,i);var y=f?s?on:un:s?tr:Zn,d=l?sr:y(t);return a(d||t,function(e,u){d&&(u=e,e=t[u]),ot(i,u,ft(e,n,r,u,t,o))}),i}function lt(t,n){var r=[];return ku(t,function(t,e,u){n(t,e,u)&&r.push(t)}),r}function pt(t,n,r,e,u){var o=-1,i=t.length;for(r||(r=dn),u||(u=[]);++o<i;){var c=t[o];n>0&&r(c)?n>1?pt(c,n-1,r,e,u):l(u,c):e||(u[u.length]=c)}return u}function ht(t,n){return t&&Tu(t,n,Zn)}function vt(t,n){return s(n,function(n){return Nn(t[n])})}function yt(t,n){n=Ut(n,t);for(var r=0,e=n.length;null!=t&&r<e;)t=t[Tn(n[r++])];return r&&r==e?t:sr}function dt(t,n,r){var e=n(t);return Uu(t)?e:l(e,r(t))}function gt(t){return null==t?t===sr?Nr:Ir:(t=Object(t),cu&&cu in t?ln(t):En(t))}function bt(t,n){return null!=t&&n in Object(t)}function _t(t){return qn(t)&>(t)==wr}function $t(t,n,r,e,u){return t===n||(null==t||null==n||!Vn(t)&&!qn(n)?t!==t&&n!==n:jt(t,n,r,e,$t,u))}function jt(t,n,r,e,u,o){var i=Uu(t),c=Uu(n),a=Ar,s=Ar;i||(a=Iu(t),a=a==wr?Pr:a),c||(s=Iu(n),s=s==wr?Pr:s);var f=a==Pr,l=s==Pr,p=a==s;if(p&&Bu(t)){if(!Bu(n))return!1;i=!0,f=!1}if(p&&!f)return o||(o=new X),i||Cu(t)?tn(t,n,r,e,u,o):nn(t,n,a,r,e,u,o);if(!(r&br)){var h=f&&Ge.call(t,"__wrapped__"),v=l&&Ge.call(n,"__wrapped__");if(h||v){var y=h?t.value():t,d=v?n.value():n;return o||(o=new X),u(y,d,r,e,o)}}return!!p&&(o||(o=new X),rn(t,n,r,e,u,o))}function mt(t,n,r,e){var u=r.length,o=u,i=!e;if(null==t)return!o;for(t=Object(t);u--;){var c=r[u];if(i&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++u<o;){c=r[u];var a=c[0],s=t[a],f=c[1];if(i&&c[2]){if(s===sr&&!(a in t))return!1}else{var l=new X;if(e)var p=e(s,f,a,t,n,l);if(!(p===sr?$t(f,s,br|_r,e,l):p))return!1}}return!0}function xt(t){if(!Vn(t)||jn(t))return!1;var n=Nn(t)?Ke:ae;return n.test(Sn(t))}function wt(t){return qn(t)&&Wn(t.length)&&!!Se[gt(t)]}function At(t){return"function"==typeof t?t:null==t?er:"object"==typeof t?Uu(t)?Tt(t[0],t[1]):kt(t):ir(t)}function Ot(t){if(!mn(t))return lu(t);var n=[];for(var r in Object(t))Ge.call(t,r)&&"constructor"!=r&&n.push(r);return n}function Et(t){if(!Vn(t))return On(t);var n=mn(t),r=[];for(var e in t)("constructor"!=e||!n&&Ge.call(t,e))&&r.push(e);return r}function zt(t,n){var r=-1,e=Cn(t)?Array(t.length):[];return ku(t,function(t,u,o){e[++r]=n(t,u,o)}),e}function kt(t){var n=sn(t);return 1==n.length&&n[0][2]?wn(n[0][0],n[0][1]):function(r){return r===t||mt(r,t,n)}}function Tt(t,n){return _n(t)&&xn(n)?wn(Tn(t),n):function(r){var e=Xn(r,t);return e===sr&&e===n?Yn(r,t):$t(n,e,br|_r)}}function St(t,n){return t=Object(t),Lt(t,n,function(n,r){return Yn(t,r)})}function Lt(t,n,r){for(var e=-1,u=n.length,o={};++e<u;){var i=n[e],c=yt(t,i);r(c,i)&&Pt(o,i,c)}return o}function Ft(t){return function(n){return yt(n,t)}}function It(t,n){return Pu(zn(t,n,er),t+"")}function Pt(t,n,r,e){if(!Vn(t))return t;n=Ut(n,t);for(var u=-1,o=n.length,i=o-1,c=t;null!=c&&++u<o;){var a=Tn(n[u]),s=r;if(u!=i){var f=c[a];s=e?e(f,a,c):sr,s===sr&&(s=Vn(f)?f:gn(n[u+1])?[]:{})}ot(c,a,s),c=c[a]}return t}function Rt(t){if("string"==typeof t)return t;if(Uu(t))return f(t,Rt)+"";if(Gn(t))return Eu?Eu.call(t):"";var n=t+"";return"0"==n&&1/t==-mr?"-0":n}function Mt(t,n,r){for(var e=-1,u=t.length,o=n.length,i={};++e<u;){var c=e<o?n[e]:sr;r(i,t[e],c)}return i}function Ut(t,n){return Uu(t)?t:_n(t,n)?[t]:Ru(Jn(t))}function Bt(t,n){if(n)return t.slice();var r=t.length,e=tu?tu(r):new t.constructor(r);return t.copy(e),e}function Ct(t){var n=new t.constructor(t.byteLength);return new Ze(n).set(new Ze(t)),n}function Dt(t,n){var r=n?Ct(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}function Nt(t,n,r){var e=n?r(w(t),yr):w(t);return p(e,o,new t.constructor)}function Wt(t){var n=new t.constructor(t.source,ce.exec(t));return n.lastIndex=t.lastIndex,n}function Vt(t,n,r){var e=n?r(O(t),yr):O(t);return p(e,i,new t.constructor)}function qt(t){return Ou?Object(Ou.call(t)):{}}function Qt(t,n){var r=n?Ct(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Gt(t,n){var r=-1,e=t.length;for(n||(n=Array(e));++r<e;)n[r]=t[r];return n}function Ht(t,n,r,e){var u=!r;r||(r={});for(var o=-1,i=n.length;++o<i;){var c=n[o],a=e?e(r[c],t[c],c,r,t):sr;a===sr&&(a=t[c]),u?st(r,c,a):ot(r,c,a)}return r}function Jt(t,n){return Ht(t,Lu(t),n)}function Kt(t,n){return Ht(t,Fu(t),n)}function Xt(t){return It(function(n,r){var e=-1,u=r.length,o=u>1?r[u-1]:sr,i=u>2?r[2]:sr;for(o=t.length>3&&"function"==typeof o?(u--,o):sr,i&&bn(r[0],r[1],i)&&(o=u<3?sr:o,u=1),n=Object(n);++e<u;){var c=r[e];c&&t(n,c,e,o)}return n})}function Yt(t,n){return function(r,e){if(null==r)return r;if(!Cn(r))return t(r,e);for(var u=r.length,o=n?u:-1,i=Object(r);(n?o--:++o<u)&&e(i[o],o,i)!==!1;);return r}}function Zt(t){return function(n,r,e){for(var u=-1,o=Object(n),i=e(n),c=i.length;c--;){var a=i[t?c:++u];if(r(o[a],a,o)===!1)break}return n}}function tn(t,n,r,e,u,o){var i=r&br,c=t.length,a=n.length;if(c!=a&&!(i&&a>c))return!1;var s=o.get(t);if(s&&o.get(n))return s==n;var f=-1,l=!0,p=r&_r?new H:sr;for(o.set(t,n),o.set(n,t);++f<c;){var v=t[f],y=n[f];if(e)var d=i?e(y,v,f,n,t,o):e(v,y,f,t,n,o);if(d!==sr){if(d)continue;l=!1;break}if(p){if(!h(n,function(t,n){if(!$(p,n)&&(v===t||u(v,t,r,e,o)))return p.push(n)})){l=!1;break}}else if(v!==y&&!u(v,y,r,e,o)){l=!1;break}}return o.delete(t),o.delete(n),l}function nn(t,n,r,e,u,o,i){switch(r){case qr:if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)return!1;t=t.buffer,n=n.buffer;case Vr:return!(t.byteLength!=n.byteLength||!o(new Ze(t),new Ze(n)));case Er:case zr:case Fr:return Bn(+t,+n);case kr:return t.name==n.name&&t.message==n.message;case Ur:case Cr:return t==n+"";case Lr:var c=w;case Br:var a=e&br;if(c||(c=O),t.size!=n.size&&!a)return!1;var s=i.get(t);if(s)return s==n;e|=_r,i.set(t,n);var f=tn(c(t),c(n),e,u,o,i);return i.delete(t),f;case Dr:if(Ou)return Ou.call(t)==Ou.call(n)}return!1}function rn(t,n,r,e,u,o){var i=r&br,c=Zn(t),a=c.length,s=Zn(n),f=s.length;if(a!=f&&!i)return!1;for(var l=a;l--;){var p=c[l];if(!(i?p in n:Ge.call(n,p)))return!1}var h=o.get(t);if(h&&o.get(n))return h==n;var v=!0;o.set(t,n),o.set(n,t);for(var y=i;++l<a;){p=c[l];var d=t[p],g=n[p];if(e)var b=i?e(g,d,p,n,t,o):e(d,g,p,t,n,o);if(!(b===sr?d===g||u(d,g,r,e,o):b)){v=!1;break}y||(y="constructor"==p)}if(v&&!y){var _=t.constructor,$=n.constructor;_!=$&&"constructor"in t&&"constructor"in n&&!("function"==typeof _&&_ instanceof _&&"function"==typeof $&&$ instanceof $)&&(v=!1)}return o.delete(t),o.delete(n),v}function en(t){return Pu(zn(t,sr,Ln),t+"")}function un(t){return dt(t,Zn,Lu)}function on(t){return dt(t,tr,Fu)}function cn(){var t=k.iteratee||ur;return t=t===ur?At:t,arguments.length?t(arguments[0],arguments[1]):t}function an(t,n){var r=t.__data__;return $n(n)?r["string"==typeof n?"string":"hash"]:r.map}function sn(t){for(var n=Zn(t),r=n.length;r--;){var e=n[r],u=t[e];n[r]=[e,u,xn(u)]}return n}function fn(t,n){var r=j(t,n);return xt(r)?r:sr}function ln(t){var n=Ge.call(t,cu),r=t[cu];try{t[cu]=sr;var e=!0}catch(t){}var u=Je.call(t);return e&&(n?t[cu]=r:delete t[cu]),u}function pn(t,n,r){n=Ut(n,t);for(var e=-1,u=n.length,o=!1;++e<u;){var i=Tn(n[e]);if(!(o=null!=t&&r(t,i)))break;t=t[i]}return o||++e!=u?o:(u=null==t?0:t.length,!!u&&Wn(u)&&gn(i,u)&&(Uu(t)||Mu(t)))}function hn(t){var n=t.length,r=t.constructor(n);return n&&"string"==typeof t[0]&&Ge.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function vn(t){return"function"!=typeof t.constructor||mn(t)?{}:zu(nu(t))}function yn(t,n,r,e){var u=t.constructor;switch(n){case Vr:return Ct(t);case Er:case zr:return new u(+t);case qr:return Dt(t,e);case Qr:case Gr:case Hr:case Jr:case Kr:case Xr:case Yr:case Zr:case te:return Qt(t,e);case Lr:return Nt(t,e,r);case Fr:case Cr:return new u(t);case Ur:return Wt(t);case Br:return Vt(t,e,r);case Dr:return qt(t)}}function dn(t){return Uu(t)||Mu(t)||!!(ou&&t&&t[ou])}function gn(t,n){return n=null==n?xr:n,!!n&&("number"==typeof t||se.test(t))&&t>-1&&t%1==0&&t<n}function bn(t,n,r){if(!Vn(r))return!1;var e=typeof n;return!!("number"==e?Cn(r)&&gn(n,r.length):"string"==e&&n in r)&&Bn(r[n],t)}function _n(t,n){if(Uu(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Gn(t))||(re.test(t)||!ne.test(t)||null!=n&&t in Object(n))}function $n(t){var n=typeof t;return"string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==t:null===t}function jn(t){return!!He&&He in t}function mn(t){var n=t&&t.constructor,r="function"==typeof n&&n.prototype||Ve;return t===r}function xn(t){return t===t&&!Vn(t)}function wn(t,n){return function(r){return null!=r&&(r[t]===n&&(n!==sr||t in Object(r)))}}function An(t){var n=Un(t,function(t){return r.size===vr&&r.clear(),t}),r=n.cache;return n}function On(t){var n=[];if(null!=t)for(var r in Object(t))n.push(r);return n}function En(t){return Je.call(t)}function zn(t,n,r){return n=pu(n===sr?t.length-1:n,0),function(){for(var e=arguments,u=-1,o=pu(e.length-n,0),i=Array(o);++u<o;)i[u]=e[n+u];u=-1;for(var a=Array(n+1);++u<n;)a[u]=e[u];return a[n]=r(i),c(t,this,a)}}function kn(t){var n=0,r=0;return function(){var e=hu(),u=jr-(e-r);if(r=e,u>0){if(++n>=$r)return arguments[0]}else n=0;return t.apply(sr,arguments)}}function Tn(t){if("string"==typeof t||Gn(t))return t;var n=t+"";return"0"==n&&1/t==-mr?"-0":n}function Sn(t){if(null!=t){try{return Qe.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ln(t){var n=null==t?0:t.length;return n?pt(t,1):[]}function Fn(t,n){return Mt(t||[],n||[],ot)}function In(t,n){var r=Uu(t)?s:lt;return r(t,cn(n,3))}function Pn(t,n){var r=Uu(t)?a:ku;return r(t,cn(n,3))}function Rn(t,n){var r=Uu(t)?f:zt;return r(t,cn(n,3))}function Mn(t,n,r){var e=Uu(t)?p:d,u=arguments.length<3;return e(t,cn(n,4),r,u,ku)}function Un(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new TypeError(pr);var r=function(){var e=arguments,u=n?n.apply(this,e):e[0],o=r.cache;if(o.has(u))return o.get(u);var i=t.apply(this,e);return r.cache=o.set(u,i)||o,i};return r.cache=new(Un.Cache||N),r}function Bn(t,n){return t===n||t!==t&&n!==n}function Cn(t){return null!=t&&Wn(t.length)&&!Nn(t)}function Dn(t){if(null==t)return!0;if(Cn(t)&&(Uu(t)||"string"==typeof t||"function"==typeof t.splice||Bu(t)||Cu(t)||Mu(t)))return!t.length;var n=Iu(t);if(n==Lr||n==Br)return!t.size;if(mn(t))return!Ot(t).length;for(var r in t)if(Ge.call(t,r))return!1;return!0}function Nn(t){if(!Vn(t))return!1;var n=gt(t);return n==Tr||n==Sr||n==Or||n==Mr}function Wn(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=xr}function Vn(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)}function qn(t){return null!=t&&"object"==typeof t}function Qn(t){return"string"==typeof t||!Uu(t)&&qn(t)&>(t)==Cr}function Gn(t){return"symbol"==typeof t||qn(t)&>(t)==Dr}function Hn(t){if(!t)return[];if(Cn(t))return Qn(t)?E(t):Gt(t);if(iu&&t[iu])return x(t[iu]());var n=Iu(t),r=n==Lr?w:n==Br?O:nr;return r(t)}function Jn(t){return null==t?"":Rt(t)}function Kn(t){return null==t?[]:vt(t,tr(t))}function Xn(t,n,r){var e=null==t?sr:yt(t,n);return e===sr?r:e}function Yn(t,n){return null!=t&&pn(t,n,bt)}function Zn(t){return Cn(t)?et(t):Ot(t)}function tr(t){return Cn(t)?et(t,!0):Et(t)}function nr(t){return null==t?[]:_(t,Zn(t))}function rr(t){return function(){return t}}function er(t){return t}function ur(t){return At("function"==typeof t?t:ft(t,yr))}function or(){}function ir(t){return _n(t)?y(Tn(t)):Ft(t)}function cr(){return[]}function ar(){return!1}var sr,fr="4.17.1",lr=200,pr="Expected a function",hr="__lodash_hash_undefined__",vr=500,yr=1,dr=2,gr=4,br=1,_r=2,$r=800,jr=16,mr=1/0,xr=9007199254740991,wr="[object Arguments]",Ar="[object Array]",Or="[object AsyncFunction]",Er="[object Boolean]",zr="[object Date]",kr="[object Error]",Tr="[object Function]",Sr="[object GeneratorFunction]",Lr="[object Map]",Fr="[object Number]",Ir="[object Null]",Pr="[object Object]",Rr="[object Promise]",Mr="[object Proxy]",Ur="[object RegExp]",Br="[object Set]",Cr="[object String]",Dr="[object Symbol]",Nr="[object Undefined]",Wr="[object WeakMap]",Vr="[object ArrayBuffer]",qr="[object DataView]",Qr="[object Float32Array]",Gr="[object Float64Array]",Hr="[object Int8Array]",Jr="[object Int16Array]",Kr="[object Int32Array]",Xr="[object Uint8Array]",Yr="[object Uint8ClampedArray]",Zr="[object Uint16Array]",te="[object Uint32Array]",ne=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,re=/^\w*$/,ee=/^\./,ue=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oe=/[\\^$.*+?()[\]{}|]/g,ie=/\\(\\)?/g,ce=/\w*$/,ae=/^\[object .+?Constructor\]$/,se=/^(?:0|[1-9]\d*)$/,fe="\\ud800-\\udfff",le="\\u0300-\\u036f",pe="\\ufe20-\\ufe2f",he="\\u20d0-\\u20ff",ve=le+pe+he,ye="\\ufe0e\\ufe0f",de="["+fe+"]",ge="["+ve+"]",be="\\ud83c[\\udffb-\\udfff]",_e="(?:"+ge+"|"+be+")",$e="[^"+fe+"]",je="(?:\\ud83c[\\udde6-\\uddff]){2}",me="[\\ud800-\\udbff][\\udc00-\\udfff]",xe="\\u200d",we=_e+"?",Ae="["+ye+"]?",Oe="(?:"+xe+"(?:"+[$e,je,me].join("|")+")"+Ae+we+")*",Ee=Ae+we+Oe,ze="(?:"+[$e+ge+"?",ge,je,me,de].join("|")+")",ke=RegExp(be+"(?="+be+")|"+ze+Ee,"g"),Te=RegExp("["+xe+fe+ve+ye+"]"),Se={};Se[Qr]=Se[Gr]=Se[Hr]=Se[Jr]=Se[Kr]=Se[Xr]=Se[Yr]=Se[Zr]=Se[te]=!0,Se[wr]=Se[Ar]=Se[Vr]=Se[Er]=Se[qr]=Se[zr]=Se[kr]=Se[Tr]=Se[Lr]=Se[Fr]=Se[Pr]=Se[Ur]=Se[Br]=Se[Cr]=Se[Wr]=!1;var Le={};Le[wr]=Le[Ar]=Le[Vr]=Le[qr]=Le[Er]=Le[zr]=Le[Qr]=Le[Gr]=Le[Hr]=Le[Jr]=Le[Kr]=Le[Lr]=Le[Fr]=Le[Pr]=Le[Ur]=Le[Br]=Le[Cr]=Le[Dr]=Le[Xr]=Le[Yr]=Le[Zr]=Le[te]=!0,Le[kr]=Le[Tr]=Le[Wr]=!1;var Fe="object"==typeof t&&t&&t.Object===Object&&t,Ie="object"==typeof self&&self&&self.Object===Object&&self,Pe=Fe||Ie||Function("return this")(),Re="object"==typeof n&&n&&!n.nodeType&&n,Me=Re&&"object"==typeof u&&u&&!u.nodeType&&u,Ue=Me&&Me.exports===Re,Be=Ue&&Fe.process,Ce=function(){try{return Be&&Be.binding&&Be.binding("util")}catch(t){}}(),De=Ce&&Ce.isTypedArray,Ne=Array.prototype,We=Function.prototype,Ve=Object.prototype,qe=Pe["__core-js_shared__"],Qe=We.toString,Ge=Ve.hasOwnProperty,He=function(){var t=/[^.]+$/.exec(qe&&qe.keys&&qe.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Je=Ve.toString,Ke=RegExp("^"+Qe.call(Ge).replace(oe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xe=Ue?Pe.Buffer:sr,Ye=Pe.Symbol,Ze=Pe.Uint8Array,tu=Xe?Xe.allocUnsafe:sr,nu=A(Object.getPrototypeOf,Object),ru=Object.create,eu=Ve.propertyIsEnumerable,uu=Ne.splice,ou=Ye?Ye.isConcatSpreadable:sr,iu=Ye?Ye.iterator:sr,cu=Ye?Ye.toStringTag:sr,au=function(){try{var t=fn(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),su=Object.getOwnPropertySymbols,fu=Xe?Xe.isBuffer:sr,lu=A(Object.keys,Object),pu=Math.max,hu=Date.now,vu=fn(Pe,"DataView"),yu=fn(Pe,"Map"),du=fn(Pe,"Promise"),gu=fn(Pe,"Set"),bu=fn(Pe,"WeakMap"),_u=fn(Object,"create"),$u=Sn(vu),ju=Sn(yu),mu=Sn(du),xu=Sn(gu),wu=Sn(bu),Au=Ye?Ye.prototype:sr,Ou=Au?Au.valueOf:sr,Eu=Au?Au.toString:sr,zu=function(){function t(){}return function(n){if(!Vn(n))return{};if(ru)return ru(n);t.prototype=n;var r=new t;return t.prototype=sr,r}}();T.prototype.clear=S,T.prototype.delete=L,T.prototype.get=F,T.prototype.has=I,T.prototype.set=P,R.prototype.clear=M,R.prototype.delete=U,R.prototype.get=B,R.prototype.has=C,R.prototype.set=D,N.prototype.clear=W,N.prototype.delete=V,N.prototype.get=q,N.prototype.has=Q,N.prototype.set=G,H.prototype.add=H.prototype.push=J,H.prototype.has=K,X.prototype.clear=Y,X.prototype.delete=Z,X.prototype.get=tt,X.prototype.has=nt,X.prototype.set=rt;var ku=Yt(ht),Tu=Zt(),Su=au?function(t,n){return au(t,"toString",{configurable:!0,enumerable:!1,value:rr(n),writable:!0})}:er,Lu=su?A(su,Object):cr,Fu=su?function(t){for(var n=[];t;)l(n,Lu(t)),t=nu(t);return n}:cr,Iu=gt;(vu&&Iu(new vu(new ArrayBuffer(1)))!=qr||yu&&Iu(new yu)!=Lr||du&&Iu(du.resolve())!=Rr||gu&&Iu(new gu)!=Br||bu&&Iu(new bu)!=Wr)&&(Iu=function(t){var n=gt(t),r=n==Pr?t.constructor:sr,e=r?Sn(r):"";if(e)switch(e){case $u:return qr;case ju:return Lr;case mu:return Rr;case xu:return Br;case wu:return Wr}return n});var Pu=kn(Su),Ru=An(function(t){var n=[];return ee.test(t)&&n.push(""),t.replace(ue,function(t,r,e,u){n.push(e?u.replace(ie,"$1"):r||t)}),n});Un.Cache=N;var Mu=_t(function(){return arguments}())?_t:function(t){return qn(t)&&Ge.call(t,"callee")&&!eu.call(t,"callee")},Uu=Array.isArray,Bu=fu||ar,Cu=De?b(De):wt,Du=Xt(function(t,n){Ht(n,tr(n),t)}),Nu=Xt(function(t,n,r,e){Ht(n,tr(n),t,e)}),Wu=It(function(t){return t.push(sr,ut),c(Nu,sr,t)}),Vu=en(function(t,n){return null==t?{}:St(t,n)});k.assignIn=Du,k.assignInWith=Nu,k.constant=rr,k.defaults=Wu,k.filter=In,k.flatten=Ln,k.functionsIn=Kn,k.iteratee=ur,k.keys=Zn,k.keysIn=tr,k.map=Rn,k.memoize=Un,k.pick=Vu,k.property=ir,k.toArray=Hn,k.values=nr,k.zipObject=Fn,k.extend=Du,k.extendWith=Nu,k.eq=Bn,k.forEach=Pn,k.get=Xn,k.hasIn=Yn,k.identity=er,k.isArguments=Mu,k.isArray=Uu,k.isArrayLike=Cn,k.isBuffer=Bu,k.isEmpty=Dn,k.isFunction=Nn,k.isLength=Wn,k.isObject=Vn,k.isObjectLike=qn,k.isString=Qn,k.isSymbol=Gn,k.isTypedArray=Cu,k.stubArray=cr,k.stubFalse=ar,k.noop=or,k.reduce=Mn,k.toString=Jn,k.each=Pn,k.VERSION=fr,Pe._=k,e=function(){return k}.call(n,r,n,u),!(e!==sr&&(u.exports=e))}).call(this)}).call(n,function(){return this}(),r(4)(t))},function(t,n){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,n,r){"use strict";var e=r(2),u=r(1),o=r(6),i=t.exports=function(t){if(!e.isFunction(t))throw new Error("resolver should be a function");var n=i.defer();try{t(n.resolve,n.reject)}catch(t){n.reject(t)}return n.promise};e.extend(i,{all:r(7),any:r(25),bind:r(26),defer:r(27),each:r(28),filter:r(31),map:r(32),join:r(33),method:r(34),props:r(36),reduce:r(37),reject:r(38),resolve:r(40),some:r(41),when:r(42),AggregateError:o.AggregateError,TimeoutError:o.TimeoutError}),u.$options.compatibilityAliases&&e.extend(i,{attempt:r(35)}),u.$options.disableES5Methods||e.extend(i,{try:r(35)})},function(t,n){"use strict";var r=t.exports.NewQError=function(t){this.name=this.constructor.name,Error.apply(this,arguments),this.message=t,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack};r.prototype.toString=function(){return this.stack.toString()},r.subError=function(t,n){function e(){}n=n||r,e.prototype=n.prototype,t.prototype=new e,t.prototype.constructor=t,t.subError||(t.subError=function(n){r.subError(n,t)})},r.subError(r,Error);var e=t.exports.AggregateError=function(){r.apply(this,arguments)};r.subError(e);var u=t.exports.TimeoutError=function(){r.apply(this,arguments)};r.subError(u)},function(t,n,r){"use strict";var e=r(2),u=r(8),o=r(1),i=r(5);t.exports=function(t){return e.isArray(t)?(t=e.map(t,function(t){return i.when(t)}),u(o.$delegate.all(t))):i.props(t)}},function(t,n,r){"use strict";function e(t,n){c(this,"$$state",t.$$state),u.each(u.functionsIn(t),function(n){c(this,"$$"+n,t[n])}.bind(this)),n&&n.$$boundTo&&c(this,"$$boundTo",n.$$boundTo),c(this,"$$arrayListeners",[]),this.then=t.then=this.then.bind(this)}var u=r(2),o=r(1),i=r(9),c=r(11),a={catch:"caught",finally:"lastly",return:["thenReturn","returns"],throw:["thenThrow"]};t.exports=function(t,n){return new e(t,n)},e.prototype={all:i("all"),any:i("any"),bind:r(12),call:r(13),catch:r(14),delay:r(15),done:r(16),each:i("each"),filter:i("filter"),finally:function(){return this.$$finally.apply(this,arguments)},get:r(17),map:i("map"),nodeify:r(18),props:i("props"),reduce:i("reduce"),return:r(19),some:i("some"),spread:r(20),tap:r(21),then:r(22),throw:r(23),timeout:r(24),constructor:e},c(e.prototype,"$$callArrayListeners",function(t){u.each(this.$$arrayListeners,function(n){n(t)})}),u.each(a,function(t,n){u.isArray(t)||(t=[t]),o.$options.compatibilityAliases&&u.each(t,function(t){e.prototype[t]=e.prototype[n]}),o.$options.disableES5Methods&&delete e.prototype[n]})},function(t,n,r){"use strict";var e=r(10),u=r(5),o=r(11);t.exports=function(t){function n(n,r){var e=u[t].apply(null,[r].concat(n));return o(e,"$$boundTo",this.$$boundTo),e}return function(){var t=e.call(this,arguments);if(this.$$unsynced)return n.call(this,t,this.$$unsynced);var r=this.then(function(e){if(r.$$promiseResult)return r.$$promiseResult;var u=n.call(this,t,e);return r.$$arrayListeners.length&&u.$$unsynced&&r.$$callArrayListeners(u.$$unsynced),u}.bind(this));return this.$$arrayListeners.push(function(e){o(this,"$$promiseResult",n.call(this,t,e)),r.$$arrayListeners.length&&this.$$promiseResult.$$unsynced&&r.$$callArrayListeners(this.$$promiseResult.$$unsynced)}.bind(this)),r}}},function(t,n,r){"use strict";var e=r(2);t.exports=function(t){return e.map(t,function(t){return e.isFunction(t)?t.bind(this.$$boundTo||this):t}.bind(this))}},function(t,n){"use strict";t.exports=function(t,n,r){if(Object.defineProperty)try{Object.defineProperty(t,n,{value:r})}catch(t){}t[n]!==r&&(t[n]=r)}},function(t,n,r){"use strict";var e=r(11);t.exports=function(t){return e(this,"$$boundTo",t),this}},function(t,n,r){"use strict";var e=r(2);t.exports=function(){var t=e.toArray(arguments),n=t.shift();return this.then(function(r){return r[n].apply(r,t)})}},function(t,n,r){"use strict";function e(t,n){var r=!t.length;return o.each(t,function(t){if(!o.isFunction(t))throw new Error("Invalid argument.");return t instanceof Error||t.prototype instanceof Error?(r=r||n instanceof t,!r):(r=r||t(n),!r)}),r}var u=r(5),o=r(2);t.exports=function(){var t=o.toArray(arguments),n=t.pop();return this.$$catch(function(r){return o.isFunction(n)&&e(t,r)?n.call(this,r):u.reject(r)})}},function(t,n,r){"use strict";var e=r(1);t.exports=function(t){return this.then(function(n){var r=e.$defer(this);return setTimeout(r.resolve,t,n),r.promise}.bind(this))}},function(t,n,r){"use strict";var e=r(5);t.exports=function(){return this.then.apply(this,arguments).$$catch(function(t){setTimeout(function(){throw t})}).$$finally(function(){return e.reject(new Error("Do not chain anything after calling done()!"))})}},function(t,n){"use strict";t.exports=function(t){return this.then(function(n){return n[t]})}},function(t,n,r){"use strict";var e=r(2),u=r(5);t.exports=function(t,n){return t=t||e.noop,n=n||{},this.then(function(r){var u=r;return u=n.spread&&e.isArray(u)?[null].concat(u):[null,u],t.apply(this,u),r},function(n){return t.call(this,n),u.reject(n)})}},function(t,n,r){"use strict";var e=r(2);t.exports=function(t){return this.then(e.constant(t))}},function(t,n,r){"use strict";var e=r(2);t.exports=function(t){return this.then(function(n){return e.isArray(n)||(n=[n]),t.apply(this,n)})}},function(t,n,r){"use strict";var e=r(5);t.exports=function(t){return this.then(function(n){return e.when(t.call(this,n)).returns(n)})}},function(t,n,r){"use strict";var e=r(10),u=r(8);t.exports=function(){return u(this.$$then.apply(this,e.call(this,arguments)),this)}},function(t,n,r){"use strict";var e=r(5);t.exports=function(t){return this.then(function(){return e.reject(t)})}},function(t,n,r){"use strict";var e=r(1),u=r(5);t.exports=function(t,n){var r=e.$defer(this),o=setTimeout(function(){r.reject(new u.TimeoutError(n||"Timed out after "+t+" ms"))},t);return this.then(function(t){r.resolve(t)},function(t){r.reject(t)}).finally(clearTimeout.bind(null,o)),r.promise}},function(t,n,r){"use strict";var e=r(5);t.exports=function(t){return e.some(t,1).get(0)}},function(t,n,r){"use strict";var e=r(5);t.exports=function(t){return e.resolve().bind(t)}},function(t,n,r){"use strict";var e=r(8),u=r(1);u.$defer=function(t){var n=u.$delegate.defer();return n.promise=e(n.promise,t),n},t.exports=function(){return u.$defer()}},function(t,n,r){"use strict";var e=r(29);t.exports=e("tap")},function(t,n,r){"use strict";var e=r(2),u=r(5),o=r(30),i=r(11);t.exports=function(t){return function(n,r,c){c=e.pick(c,"concurrency");var a=c.concurrency?new o(c):{add:function(t){return t()}},s=e.map(n,function(e,o){return u.when(e)[t](function(t){return a.add(function(){return u.when(r.call(null,t,o,n.length))})})}),f=u.all(s);return i(f,"$$unsynced",s),f}}},function(t,n,r){"use strict";var e=r(2),u=r(1),o=t.exports=function(t){this.$options=e.defaults(t,{concurrency:1,maxQueue:0}),this.$fns=[]};o.prototype.add=function(t){var n=u.$defer(),r=function(){t().finally(function(){this.$fns.splice(this.$fns.indexOf(r),1),this.$fns.length>=this.$options.concurrency&&this.$fns[this.$options.concurrency-1]()}.bind(this)).then(function(t){n.resolve(t)},function(t){n.reject(t)})}.bind(this);return this.$fns.push(r)<=this.$options.concurrency&&r(),n.promise}},function(t,n,r){"use strict";var e=r(2),u=r(5);t.exports=function(t,n,r){return u.map(t,function(t){return u.props({val:t,toFilter:n.apply(null,arguments)})},r).then(function(t){return e.map(e.filter(t,"toFilter"),"val")})}},function(t,n,r){"use strict";var e=r(29);t.exports=e("then")},function(t,n,r){"use strict";var e=r(2),u=r(5);t.exports=function(){var t=e.toArray(arguments),n=t.pop();return u.all(t).spread(n)}},function(t,n,r){"use strict";var e=r(35);t.exports=function(t){return function(){return e(t,arguments,this)}}},function(t,n,r){"use strict";var e=r(2),u=r(5);t.exports=function(t,n,r){try{return e.isEmpty(n)||e.isArray(n)||e.isArguments(n)||(n=[n]),u.when(t.apply(r||this,n))}catch(t){return u.reject(t)}}},function(t,n,r){"use strict";var e=r(2),u=r(5);t.exports=function(t){return u.all(e.values(t)).then(function(n){return e.zipObject(e.keys(t),n)})}},function(t,n,r){"use strict";var e=r(2),u=r(5);t.exports=function(t,n,r){return e.reduce(t,function(r,e,o){return u.join(r,e,function(r,e){return n(r,e,o,t.length)})},u.resolve(r))}},function(t,n,r){"use strict";var e=r(39);t.exports=e("reject")},function(t,n,r){"use strict";var e=r(8),u=r(1);t.exports=function(t){return t in u.$delegate?function(){return e(u.$delegate[t].apply(u.$delegate,arguments))}:null}},function(t,n,r){"use strict";var e=r(5),u=r(39);t.exports=u("resolve")||function(t){var n=e.defer();return n.resolve(t),n.promise}},function(t,n,r){"use strict";var e=r(2),u=r(5),o=r(6).AggregateError;t.exports=function(t,n){if(t.length<n)return u.reject(new o("initial array length ("+t.length+") > count ("+n+")"));var r=0,i=[],c=u.defer();return e.each(t,function(e){u.when(e).tap(function(t){null!==i&&(i.push(t),i.length>=n&&(c.resolve(i),i=null))}).$$catch(function(){null!==i&&(++r, | ||
t.length-r<n&&(c.reject(new o("Cannot resolve promise: too many rejections ("+r+")")),i=null))})}),c.promise}},function(t,n,r){"use strict";var e=r(39);t.exports=e("when")}])}); | ||
//# sourceMappingURL=angular-extend-promises.min.js.map |
{ | ||
"name": "angular-extend-promises", | ||
"version": "1.0.0-rc.3", | ||
"version": "1.0.0", | ||
"homepage": "https://bitbucket.org/lsystems/angular-extend-promises", | ||
@@ -42,23 +42,24 @@ "author": "L.systems SARL", | ||
"devDependencies": { | ||
"grunt": "^0.4.5", | ||
"grunt-bumpup": "^0.6.2", | ||
"grunt-contrib-clean": "^0.6.0", | ||
"grunt-contrib-jshint": "^0.11.2", | ||
"grunt-jscs": "^1.6.0", | ||
"grunt-karma": "^0.10.1", | ||
"grunt": "^1.0.1", | ||
"grunt-bumpup": "^0.6.3", | ||
"grunt-contrib-clean": "^1.0.0", | ||
"grunt-contrib-jshint": "^1.1.0", | ||
"grunt-jscs": "^3.0.1", | ||
"grunt-karma": "^2.0.0", | ||
"grunt-mocha-protractor": "^0.5.2", | ||
"grunt-webpack": "^1.0.7", | ||
"jshint-stylish": "^1.0.0", | ||
"karma": "^0.12.25", | ||
"karma-chai-plugins": "^0.5.0", | ||
"karma-chrome-launcher": "^0.1.5", | ||
"karma-firefox-launcher": "^0.1.3", | ||
"karma-mocha": "^0.1.9", | ||
"karma-phantomjs-launcher": "^0.1.4", | ||
"lodash-cli": "^3.7.0", | ||
"mocha": "^2.0.1", | ||
"semver": "^4.1.0", | ||
"shelljs": "^0.4.0", | ||
"uglifyify": "^3.0.1", | ||
"webpack": "^1.3.2-beta9" | ||
"grunt-webpack": "^2.0.0-beta.4", | ||
"jshint-stylish": "^2.2.1", | ||
"karma": "^1.3.0", | ||
"karma-chai-plugins": "^0.8.0", | ||
"karma-chrome-launcher": "^2.0.0", | ||
"karma-firefox-launcher": "^1.0.0", | ||
"karma-mocha": "^1.3.0", | ||
"karma-phantomjs-launcher": "^1.0.2", | ||
"lodash-cli": "^4.17.1", | ||
"mocha": "^3.2.0", | ||
"semver": "^5.3.0", | ||
"shelljs": "^0.7.5", | ||
"uglifyify": "^3.0.4", | ||
"webpack": "^1.14.0", | ||
"webpack-dev-server": "^1.16.2" | ||
}, | ||
@@ -69,2 +70,2 @@ "scripts": { | ||
} | ||
} | ||
} |
@@ -591,3 +591,3 @@ Angular-extend-promises | ||
console.log(val); | ||
return $q.reolve(21).delay(10); | ||
return $q.resolve(21).delay(10); | ||
}) | ||
@@ -714,2 +714,2 @@ // here value in then will be 42 but it will sync promise | ||
[License MIT](raw/master/LICENSE) | ||
[License MIT](raw/master/LICENSE) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
949623
6032
1
22
713