diff --git a/bower.json b/bower.json index c08cb180..60214479 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "neo-async", "main": "lib/async.js", - "version": "2.5.0", + "version": "2.5.1", "homepage": "https://github.com/suguru03/neo-async", "authors": [ "Suguru Motegi" diff --git a/dist/async.js b/dist/async.js index 0983fc87..55db32ce 100644 --- a/dist/async.js +++ b/dist/async.js @@ -1715,7 +1715,7 @@ * }); * */ - var sortBy = createSortBy(arrayEachValue, baseEachValue, symbolEachValue); + var sortBy = createSortBy(arrayEachIndexValue, baseEachIndexValue, symbolEachIndexValue); /** * @memberof async @@ -1964,11 +1964,11 @@ var dir = createLogger('dir'); /** - * @version 2.5.0 + * @version 2.5.1 * @namespace async */ var index = { - VERSION: '2.5.0', + VERSION: '2.5.1', // Collections each: each, @@ -2296,27 +2296,72 @@ /** * @private * @param {Array} array - * @param {string} key + * @param {number[]} criteria */ - function pluck(array, key) { - var index = -1; - var size = array.length; - var result = Array(size); - - while (++index < size) { - var item = array[index] || {}; - result[index] = item[key]; + function sortByCriteria(array, criteria) { + var l = array.length; + var indices = Array(l); + var i; + for (i = 0; i < l; i++) { + indices[i] = i; + } + quickSort(criteria, 0, l - 1, indices); + var result = Array(l); + for (var n = 0; n < l; n++) { + i = indices[n]; + result[n] = i === undefined ? array[n] : array[i]; } return result; } - /** - * @private - * @param {Object} a - * @param {Object} b - */ - function sortIterator(a, b) { - return a.criteria - b.criteria; + function partition(array, i, j, mid, indices) { + var l = i; + var r = j; + while (l <= r) { + i = l; + while (l < r && array[l] < mid) { + l++; + } + while (r >= i && array[r] >= mid) { + r--; + } + if (l > r) { + break; + } + swap(array, indices, l++, r--); + } + return l; + } + + function swap(array, indices, l, r) { + var n = array[l]; + array[l] = array[r]; + array[r] = n; + var i = indices[l]; + indices[l] = indices[r]; + indices[r] = i; + } + + function quickSort(array, i, j, indices) { + if (i === j) { + return; + } + var k = i; + while (++k <= j && array[i] === array[k]) { + var l = k - 1; + if (indices[l] > indices[k]) { + var index = indices[l]; + indices[l] = indices[k]; + indices[k] = index; + } + } + if (k > j) { + return; + } + var p = array[i] > array[k] ? i : k; + k = partition(array, i, j, array[p], indices); + quickSort(array, i, k - 1, indices); + quickSort(array, k, j, indices); } /** @@ -5242,45 +5287,45 @@ return function sortBy(collection, iterator, callback) { callback = callback || noop; - var size, result; + var size, array, criteria; var completed = 0; if (isArray(collection)) { size = collection.length; - result = Array(size); + array = Array(size); + criteria = Array(size); arrayEach(collection, iterator, createCallback); } else if (!collection) { } else if (iteratorSymbol && collection[iteratorSymbol]) { size = collection.size; - result = Array(size); + array = Array(size); + criteria = Array(size); symbolEach(collection, iterator, createCallback); } else if (typeof collection === obj) { var keys = nativeKeys(collection); size = keys.length; - result = Array(size); + array = Array(size); + criteria = Array(size); baseEach(collection, iterator, createCallback, keys); } if (!size) { callback(null, []); } - function createCallback(value) { + function createCallback(index, value) { var called = false; - return function done(err, criteria) { + array[index] = value; + return function done(err, criterion) { if (called) { throwError(); } called = true; - result[completed] = { - value: value, - criteria: criteria - }; + criteria[index] = criterion; if (err) { callback = once(callback); callback(err); } else if (++completed === size) { - result.sort(sortIterator); - callback(null, pluck(result, 'value')); + callback(null, sortByCriteria(array, criteria)); } }; } @@ -5360,27 +5405,32 @@ */ function sortBySeries(collection, iterator, callback) { callback = onlyOnce(callback || noop); - var size, key, value, keys, iter, result, iterate; + var size, key, value, keys, iter, array, criteria, iterate; var sync = false; var completed = 0; if (isArray(collection)) { size = collection.length; + array = collection; + criteria = Array(size); iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; } else if (!collection) { } else if (iteratorSymbol && collection[iteratorSymbol]) { size = collection.size; + array = Array(size); + criteria = Array(size); iter = collection[iteratorSymbol](); iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; } else if (typeof collection === obj) { keys = nativeKeys(collection); size = keys.length; + array = Array(size); + criteria = Array(size); iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; } if (!size) { return callback(null, []); } - result = Array(size); iterate(); function arrayIterator() { @@ -5395,36 +5445,36 @@ function symbolIterator() { value = iter.next().value; + array[completed] = value; iterator(value, done); } function symbolIteratorWithKey() { value = iter.next().value; + array[completed] = value; iterator(value, completed, done); } function objectIterator() { value = collection[keys[completed]]; + array[completed] = value; iterator(value, done); } function objectIteratorWithKey() { key = keys[completed]; value = collection[key]; + array[completed] = value; iterator(value, key, done); } - function done(err, criteria) { - result[completed] = { - value: value, - criteria: criteria - }; + function done(err, criterion) { + criteria[completed] = criterion; if (err) { callback(err); } else if (++completed === size) { iterate = throwError; - result.sort(sortIterator); - callback(null, pluck(result, 'value')); + callback(null, sortByCriteria(array, criteria)); } else if (sync) { nextTick(iterate); } else { @@ -5509,34 +5559,37 @@ */ function sortByLimit(collection, limit, iterator, callback) { callback = callback || noop; - var size, index, key, value, keys, iter, item, result, iterate; + var size, index, key, value, array, keys, iter, item, criteria, iterate; var sync = false; var started = 0; var completed = 0; if (isArray(collection)) { size = collection.length; + array = collection; iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; } else if (!collection) { } else if (iteratorSymbol && collection[iteratorSymbol]) { size = collection.size; iter = collection[iteratorSymbol](); + array = Array(size); iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; } else if (typeof collection === obj) { keys = nativeKeys(collection); size = keys.length; + array = Array(size); iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; } if (!size || isNaN(limit) || limit < 1) { return callback(null, []); } - result = Array(size); + criteria = Array(size); timesSync(limit > size ? size : limit, iterate); function arrayIterator() { if (started < size) { - value = collection[started++]; - iterator(value, createCallback(value)); + value = collection[started]; + iterator(value, createCallback(value, started++)); } } @@ -5544,57 +5597,57 @@ index = started++; if (index < size) { value = collection[index]; - iterator(value, index, createCallback(value)); + iterator(value, index, createCallback(value, index)); } } function symbolIterator() { if ((item = iter.next()).done === false) { value = item.value; - iterator(value, createCallback(value)); + array[started] = value; + iterator(value, createCallback(value, started++)); } } function symbolIteratorWithKey() { if ((item = iter.next()).done === false) { value = item.value; - iterator(value, started++, createCallback(value)); + array[started] = value; + iterator(value, started, createCallback(value, started++)); } } function objectIterator() { if (started < size) { - value = collection[keys[started++]]; - iterator(value, createCallback(value)); + value = collection[keys[started]]; + array[started] = value; + iterator(value, createCallback(value, started++)); } } function objectIteratorWithKey() { if (started < size) { - key = keys[started++]; + key = keys[started]; value = collection[key]; - iterator(value, key, createCallback(value)); + array[started] = value; + iterator(value, key, createCallback(value, started++)); } } - function createCallback(value) { + function createCallback(value, index) { var called = false; - return function(err, criteria) { + return function(err, criterion) { if (called) { throwError(); } called = true; - result[completed] = { - value: value, - criteria: criteria - }; + criteria[index] = criterion; if (err) { iterate = noop; callback(err); callback = noop; } else if (++completed === size) { - result.sort(sortIterator); - callback(null, pluck(result, 'value')); + callback(null, sortByCriteria(array, criteria)); } else if (sync) { nextTick(iterate); } else { @@ -8137,10 +8190,11 @@ if (key === null) { throwError(); } - runningTasks--; - rest--; arg = arguments.length <= 2 ? arg : slice(arguments, 1); if (err) { + rest = 0; + runningTasks = 0; + readyTasks.length = 0; var safeResults = objectClone(results); safeResults[key] = arg; key = null; @@ -8149,6 +8203,8 @@ _callback(err, safeResults); return; } + runningTasks--; + rest--; results[key] = arg; taskComplete(key); key = null; @@ -8886,7 +8942,7 @@ result.then(function(value) { invokeCallback(callback, null, value); }, function(err) { - invokeCallback(callback, err.message ? err : new Error(err)); + invokeCallback(callback, err && err.message ? err : new Error(err)); }); } else { callback(null, result); diff --git a/dist/async.min.js b/dist/async.min.js index 623c31c9..b5bec295 100644 --- a/dist/async.min.js +++ b/dist/async.min.js @@ -1,76 +1,77 @@ -(function(N,O){"object"===typeof exports&&"undefined"!==typeof module?O(exports):"function"===typeof define&&define.amd?define(["exports"],O):N.async?O(N.neo_async=N.neo_async||{}):O(N.async=N.async||{})})(this,function(N){function O(a){var b=function(a){var b=I(arguments,1);setTimeout(function(){a.apply(null,b)})};Q="function"===typeof setImmediate?setImmediate:b;"object"===typeof process&&"function"===typeof process.nextTick?(C=/^v0.10/.test(process.version)?Q:process.nextTick,ba=/^v0/.test(process.version)? -Q:process.nextTick):ba=C=Q;!1===a&&(C=function(a){a()})}function F(a){for(var b=-1,c=a.length,d=Array(c);++b=d)return[];for(var e=Array(d);++cc)return e(null,[]);A=Array(h);K(c>h?h:c,w)}}function Y(a,b,c){function d(){b(a[u],s)}function e(){b(a[u],u,s)}function f(){b(p.next().value,s)}function g(){q=p.next().value;b(q,u,s)}function m(){b(a[h[u]],s)}function r(){l=h[u];b(a[l],l,s)}function s(a,b){a?c(a):++u===k?(n=z,c(null)):!1===b?(n=z,c(null)):t?C(n):(t=!0,n());t=!1}c=E(c||y);var k,l,h,p,q,n,t=!1,u=0;B(a)?(k=a.length, -n=3===b.length?e:d):a&&(x&&a[x]?(k=a.size,p=a[x](),n=3===b.length?g:f):"object"===typeof a&&(h=D(a),k=h.length,n=3===b.length?r:m));if(!k)return c(null);n()}function Z(a,b,c,d){function e(){wb)return d(null);K(b>l?l:b,u)}function ya(a,b,c){function d(){b(a[v],s)}function e(){b(a[v],v,s)}function f(){b(p.next().value,s)}function g(){q=p.next().value;b(q,v,s)}function m(){b(a[h[v]],s)}function r(){l=h[v];b(a[l],l, -s)}function s(a,b){a?(t=z,c=E(c),c(a,F(n))):(n[v]=b,++v===k?(t=z,c(null,n),c=z):u?C(t):(u=!0,t()),u=!1)}c=c||y;var k,l,h,p,q,n,t,u=!1,v=0;B(a)?(k=a.length,t=3===b.length?e:d):a&&(x&&a[x]?(k=a.size,p=a[x](),t=3===b.length?g:f):"object"===typeof a&&(h=D(a),k=h.length,t=3===b.length?r:m));if(!k)return c(null,[]);n=Array(k);t()}function za(a,b,c,d){return function(e,f,g){function m(a){var b=!1;return function(c,e){b&&z();b=!0;c?(g=H(g),g(c)):!!e===d?(g=H(g),g(null,a)):++k===r&&g(null)}}g=g||y;var r,s, -k=0;B(e)?(r=e.length,a(e,f,m)):e&&(x&&e[x]?(r=e.size,c(e,f,m)):"object"===typeof e&&(s=D(e),r=s.length,b(e,f,m,s)));r||g(null)}}function Aa(a){return function(b,c,d){function e(){p=b[v];c(p,k)}function f(){p=b[v];c(p,v,k)}function g(){p=n.next().value;c(p,k)}function m(){p=n.next().value;c(p,v,k)}function r(){p=b[q[v]];c(p,k)}function s(){h=q[v];p=b[h];c(p,h,k)}function k(b,c){b?d(b):!!c===a?(t=z,d(null,p)):++v===l?(t=z,d(null)):u?C(t):(u=!0,t());u=!1}d=E(d||y);var l,h,p,q,n,t,u=!1,v=0;B(b)?(l=b.length, -t=3===c.length?f:e):b&&(x&&b[x]?(l=b.size,n=b[x](),t=3===c.length?m:g):"object"===typeof b&&(q=D(b),l=q.length,t=3===c.length?s:r));if(!l)return d(null);t()}}function Ba(a){return function(b,c,d,e){function f(){p=G++;pc)return e(null);K(c>h?h:c,w)}}function Ca(a,b,c,d){return function(e,f,g){function m(a,b){return function(c,e){null===a&&z();c?(a=null,g=H(g),g(c, -L(l))):(!!e===d&&(l[a]=b),a=null,++k===r&&g(null,l))}}g=g||y;var r,s,k=0,l={};B(e)?(r=e.length,a(e,f,m)):e&&(x&&e[x]?(r=e.size,c(e,f,m)):"object"===typeof e&&(s=D(e),r=s.length,b(e,f,m,s)));if(!r)return g(null,{})}}function Da(a){return function(b,c,d){function e(){h=w;p=b[w];c(p,k)}function f(){h=w;p=b[w];c(p,w,k)}function g(){h=w;p=n.next().value;c(p,k)}function m(){h=w;p=n.next().value;c(p,h,k)}function r(){h=q[w];p=b[h];c(p,k)}function s(){h=q[w];p=b[h];c(p,h,k)}function k(b,c){b?d(b,v):(!!c=== -a&&(v[h]=p),++w===l?(t=z,d(null,v)):u?C(t):(u=!0,t()),u=!1)}d=E(d||y);var l,h,p,q,n,t,u=!1,v={},w=0;B(b)?(l=b.length,t=3===c.length?f:e):b&&(x&&b[x]?(l=b.size,n=b[x](),t=3===c.length?m:g):"object"===typeof b&&(q=D(b),l=q.length,t=3===c.length?s:r));if(!l)return d(null,{});t()}}function Ea(a){return function(b,c,d,e){function f(){p=J++;pc)return e(null,{});K(c>h?h:c,w)}}function $(a,b,c,d){function e(b){c(b,a[u],k)}function f(b){c(b,a[u],u,k)}function g(){c(b,q.next().value,k)}function m(){c(b,q.next().value,u,k)}function r(b){c(b,a[p[u]],k)}function s(b){h=p[u];c(b,a[h],h,k)}function k(a,b){a?d(a,b):++u===l?(c=z,d(null,b)):t?C(function(){n(b)}):(t=!0,n(b));t=!1}d=E(d||y);var l,h,p,q,n,t=!1,u=0;B(a)?(l=a.length,n=4===c.length?f:e):a&&(x&&a[x]?(l=a.size,q=a[x](),n=4===c.length?m:g):"object"===typeof a&&(p=D(a),l=p.length,n=4=== -c.length?s:r));if(!l)return d(null,b);n(b)}function Fa(a,b,c,d){function e(b){c(b,a[--s],r)}function f(b){c(b,a[--s],s,r)}function g(b){c(b,a[h[--s]],r)}function m(b){l=h[--s];c(b,a[l],l,r)}function r(a,b){a?d(a,b):0===s?(t=z,d(null,b)):u?C(function(){t(b)}):(u=!0,t(b));u=!1}d=E(d||y);var s,k,l,h,p,q,n,t,u=!1;if(B(a))s=a.length,t=4===c.length?f:e;else if(a)if(x&&a[x]){s=a.size;n=Array(s);p=a[x]();for(k=-1;!1===(q=p.next()).done;)n[++k]=q.value;a=n;t=4===c.length?f:e}else"object"===typeof a&&(h=D(a), -s=h.length,t=4===c.length?m:g);if(!s)return d(null,b);t(b)}function Ga(a,b,c){c=c||y;fa(a,b,function(a,b){if(a)return c(a);c(null,!!b)})}function Ha(a,b,c){c=c||y;ga(a,b,function(a,b){if(a)return c(a);c(null,!!b)})}function Ia(a,b,c,d){d=d||y;ha(a,b,c,function(a,b){if(a)return d(a);d(null,!!b)})}function Ja(a,b){return B(a)?0===a.length?(b(null),!1):!0:(b(Error("First argument to waterfall must be an array of functions")),!1)}function ia(a,b,c){switch(b.length){case 0:case 1:return a(c);case 2:return a(b[1], -c);case 3:return a(b[1],b[2],c);case 4:return a(b[1],b[2],b[3],c);case 5:return a(b[1],b[2],b[3],b[4],c);case 6:return a(b[1],b[2],b[3],b[4],b[5],c);default:return b=I(b,1),b.push(c),a.apply(null,b)}}function Ka(a,b){function c(c,k){if(c)r=z,b=E(b),b(c);else if(++d===f){r=z;var l=b;b=z;2===arguments.length?l(c,k):l.apply(null,F(arguments))}else g=a[d],m=arguments,e?C(r):(e=!0,r()),e=!1}b=b||y;if(Ja(a,b)){var d=0,e=!1,f=a.length,g=a[d],m=[],r=function(){switch(g.length){case 0:try{c(null,g())}catch(a){c(a)}break; -case 1:return g(c);case 2:return g(m[1],c);case 3:return g(m[1],m[2],c);case 4:return g(m[1],m[2],m[3],c);case 5:return g(m[1],m[2],m[3],m[4],c);default:return m=I(m,1),m[g.length-1]=c,g.apply(null,m)}};r()}}function La(){var a=F(arguments);return function(){var b=this,c=F(arguments),d=c[c.length-1];"function"===typeof d?c.pop():d=y;$(a,c,function(a,c,d){a.push(function(a){var b=I(arguments,1);d(a,b)});c.apply(b,a)},function(a,c){c=B(c)?c:[c];c.unshift(a);d.apply(b,c)})}}function Ma(a){return function(b){var c= -function(){var c=this,d=F(arguments),g=d.pop()||y;return a(b,function(a,b){a.apply(c,d.concat([b]))},g)};if(1c)throw Error("Concurrency must not be zero");var k=0,l=[],h,p,q={_tasks:new M,concurrency:c, -payload:d,saturated:y,unsaturated:y,buffer:c/4,empty:y,drain:y,error:y,started:!1,paused:!1,push:function(a,b){f(a,b)},kill:function(){q.drain=y;q._tasks.empty()},unshift:function(a,b){f(a,b,!0)},remove:function(a){q._tasks.remove(a)},process:a?m:r,length:function(){return q._tasks.length},running:function(){return k},workersList:function(){return l},idle:function(){return 0===q.length()+k},pause:function(){q.paused=!0},resume:function(){!1!==q.paused&&(q.paused=!1,K(q.concurrency=arguments.length?f:I(arguments,1);if(a){var l=L(m);l[b]=f;b=null;var k=c;c=y;k(a,l)}else m[b]=f,e(b),b=null}function q(){0===--u&&s.push([n,t,d])}var n,t;if(B(a)){var u=a.length-1;n=a[u];t=u;if(0===u)s.push([n,t,d]);else for(var v=-1;++v=arguments.length)return c(a,e);var f=F(arguments);return c.apply(null,f)}b(d)}function e(){b(f)}function f(a,b){if(++s===g||!a||r&&!r(a)){if(2>=arguments.length)return c(a,b);var d=F(arguments);return c.apply(null,d)}setTimeout(e,m(s))}var g,m,r,s=0;if(3>arguments.length&&"function"===typeof a)c=b||y,b=a,a=null,g=5;else switch(c= -c||y,typeof a){case "object":"function"===typeof a.errorFilter&&(r=a.errorFilter);var k=a.interval;switch(typeof k){case "function":m=k;break;case "string":case "number":m=(k=+k)?function(){return k}:function(){return 0}}g=+a.times||5;break;case "number":g=a||5;break;case "string":g=+a||5;break;default:throw Error("Invalid arguments for async.retry");}if("function"!==typeof b)throw Error("Invalid arguments for async.retry");m?b(f):b(d)}function Oa(a){return function(){var b=F(arguments),c=b.pop(), -d;try{d=a.apply(this,b)}catch(e){return c(e)}d&&"function"===typeof d.then?d.then(function(a){try{c(null,a)}catch(b){C(Pa,b)}},function(a){a=a.message?a:Error(a);try{c(a,void 0)}catch(b){C(Pa,b)}}):c(null,d)}}function Pa(a){throw a;}function Qa(a){return function(){function b(a,b){if(a)return c(null,{error:a});2=arguments.length?c:I(arguments,1),a=null,++r===f&&d(null,m))}}d=d||y;var f,g,m,r=0;B(c)?(f=c.length,m=Array(f),a(c,e)):c&&"object"===typeof c&&(g=D(c),f=g.length,m={},b(c,e,g));f||d(null,m)}}(function(a,b){for(var c=-1,d=a.length;++cb)return d(null,[]);u=Array(l);K(b>l?l:b,v)},mapValues:eb,mapValuesSeries:function(a,b,c){function d(){l=v;b(a[v],s)}function e(){l=v;b(a[v],v,s)}function f(){l=v;q=p.next().value;b(q,s)}function g(){l= -v;q=p.next().value;b(q,v,s)}function m(){l=h[v];b(a[l],s)}function r(){l=h[v];b(a[l],l,s)}function s(a,b){a?(n=z,c=E(c),c(a,L(u))):(u[l]=b,++v===k?(n=z,c(null,u),c=z):t?C(n):(t=!0,n()),t=!1)}c=c||y;var k,l,h,p,q,n,t=!1,u={},v=0;B(a)?(k=a.length,n=3===b.length?e:d):a&&(x&&a[x]?(k=a.size,p=a[x](),n=3===b.length?g:f):"object"===typeof a&&(h=D(a),k=h.length,n=3===b.length?r:m));if(!k)return c(null,u);n()},mapValuesLimit:function(a,b,c,d){function e(){h=A++;hb)return d(null,w);K(b>l?l:b,u)},filter:Sa,filterSeries:Ta,filterLimit:Ua,select:Sa,selectSeries:Ta,selectLimit:Ua,reject:fb,rejectSeries:gb,rejectLimit:hb,detect:fa,detectSeries:ga,detectLimit:ha,find:fa,findSeries:ga,findLimit:ha,pick:ib,pickSeries:jb,pickLimit:kb,omit:lb,omitSeries:mb,omitLimit:nb,reduce:$,inject:$,foldl:$,reduceRight:Fa,foldr:Fa,transform:ob,transformSeries:function(a,b,c,d){function e(){c(t,a[v],k)}function f(){c(t,a[v], -v,k)}function g(){c(t,q.next().value,k)}function m(){c(t,q.next().value,v,k)}function r(){c(t,a[p[v]],k)}function s(){h=p[v];c(t,a[h],h,k)}function k(a,b){a?d(a,t):++v===l?(n=z,d(null,t)):!1===b?(n=z,d(null,t)):u?C(n):(u=!0,n());u=!1}3===arguments.length&&(d=c,c=b,b=void 0);d=E(d||y);var l,h,p,q,n,t,u=!1,v=0;B(a)?(l=a.length,t=void 0!==b?b:[],n=4===c.length?f:e):a&&(x&&a[x]?(l=a.size,q=a[x](),t=void 0!==b?b:{},n=4===c.length?m:g):"object"===typeof a&&(p=D(a),l=p.length,t=void 0!==b?b:{},n=4===c.length? -s:r));if(!l)return d(null,void 0!==b?b:t||{});n()},transformLimit:function(a,b,c,d,e){function f(){p=z++;pb)return e(null,void 0!==c?c:w||{});K(b>h?h:b,v)},sortBy:pb,sortBySeries:function(a,b,c){function d(){h=a[v];b(h,s)}function e(){h=a[v];b(h,v,s)}function f(){h=q.next().value;b(h,s)}function g(){h=q.next().value; -b(h,v,s)}function m(){h=a[p[v]];b(h,s)}function r(){l=p[v];h=a[l];b(h,l,s)}function s(a,b){n[v]={value:h,criteria:b};a?c(a):++v===k?(t=z,n.sort(da),c(null,ca(n,"value"))):u?C(t):(u=!0,t());u=!1}c=E(c||y);var k,l,h,p,q,n,t,u=!1,v=0;B(a)?(k=a.length,t=3===b.length?e:d):a&&(x&&a[x]?(k=a.size,q=a[x](),t=3===b.length?g:f):"object"===typeof a&&(p=D(a),k=p.length,t=3===b.length?r:m));if(!k)return c(null,[]);n=Array(k);t()},sortByLimit:function(a,b,c,d){function e(){Gb)return d(null,[]);v=Array(l);K(b>l?l:b,w)},some:Ga,someSeries:Ha,someLimit:Ia,any:Ga,anySeries:Ha,anyLimit:Ia,every:Va,everySeries:Wa,everyLimit:Xa,all:Va,allSeries:Wa,allLimit:Xa,concat:qb,concatSeries:function(a,b,c){function d(){b(a[v],s)}function e(){b(a[v],v,s)}function f(){b(p.next().value,s)}function g(){q=p.next().value;b(q,v,s)}function m(){b(a[h[v]],s)}function r(){l=h[v]; -b(a[l],l,s)}function s(a,b){B(b)?T.apply(u,b):2<=arguments.length&&T.apply(u,I(arguments,1));a?c(a,u):++v===k?(n=z,c(null,u)):t?C(n):(t=!0,n());t=!1}c=E(c||y);var k,l,h,p,q,n,t=!1,u=[],v=0;B(a)?(k=a.length,n=3===b.length?e:d):a&&(x&&a[x]?(k=a.size,p=a[x](),n=3===b.length?g:f):"object"===typeof a&&(h=D(a),k=h.length,n=3===b.length?r:m));if(!k)return c(null,u);n()},concatLimit:function(a,b,c,d){function e(){ub)return d(null,[]);var A=Array(l);K(b>l?l:b,n)},groupBy:rb,groupBySeries:function(a,b,c){function d(){h=a[u];b(h,s)}function e(){h=a[u];b(h,u,s)}function f(){h=q.next().value;b(h,s)}function g(){h=q.next().value;b(h,u,s)}function m(){h=a[p[u]];b(h,s)}function r(){l=p[u];h=a[l];b(h,l,s)}function s(a,b){if(a)n=z,c=E(c),c(a,L(v));else{var d= -v[b];d?d.push(h):v[b]=[h];++u===k?(n=z,c(null,v)):t?C(n):(t=!0,n());t=!1}}c=E(c||y);var k,l,h,p,q,n,t=!1,u=0,v={};B(a)?(k=a.length,n=3===b.length?e:d):a&&(x&&a[x]?(k=a.size,q=a[x](),n=3===b.length?g:f):"object"===typeof a&&(p=D(a),k=p.length,n=3===b.length?r:m));if(!k)return c(null,v);n()},groupByLimit:function(a,b,c,d){function e(){Ab)return d(null, -F);K(b>l?l:b,v)},parallel:sb,series:function(a,b){function c(){g=l;a[l](e)}function d(){g=m[l];a[g](e)}function e(a,c){a?(s=z,b=E(b),b(a,r)):(r[g]=2>=arguments.length?c:I(arguments,1),++l===f?(s=z,b(null,r)):k?C(s):(k=!0,s()),k=!1)}b=b||y;var f,g,m,r,s,k=!1,l=0;if(B(a))f=a.length,r=Array(f),s=c;else if(a&&"object"===typeof a)m=D(a),f=m.length,r={},s=d;else return b(null);if(!f)return b(null,r);s()},parallelLimit:function(a,b,c){function d(){m=p++;if(m=arguments.length?d:I(arguments,1),a=null,++q===g?c(null,k):h?C(l):(h=!0,l()),h=!1)}}c=c||y;var g,m,r,s,k,l,h=!1,p=0,q=0;B(a)?(g=a.length,k=Array(g),l=d):a&&"object"===typeof a&&(s=D(a),g=s.length,k={},l=e);if(!g||isNaN(b)||1>b)return c(null,k);K(b>g?g:b,l)},tryEach:function(a,b){function c(){a[r](e)}function d(){a[g[r]](e)}function e(a,c){a?++r===f?b(a):m():2>=arguments.length?b(null,c):b(null,I(arguments,1))}b= -b||y;var f,g,m,r=0;B(a)?(f=a.length,m=c):a&&"object"===typeof a&&(g=D(a),f=g.length,m=d);if(!f)return b(null);m()},waterfall:function(a,b){function c(){ia(e,f,d(e))}function d(k){return function(l,h){void 0===k&&(b=y,z());k=void 0;l?(g=b,b=z,g(l)):++r===s?(g=b,b=z,2>=arguments.length?g(l,h):g.apply(null,F(arguments))):(m?(f=arguments,e=a[r]||z,C(c)):(m=!0,ia(a[r]||z,arguments,d(r))),m=!1)}}b=b||y;if(Ja(a,b)){var e,f,g,m,r=0,s=a.length;ia(a[0],[],d(0))}},angelFall:Ka,angelfall:Ka,whilst:function(a, -b,c){function d(){g?C(e):(g=!0,b(f));g=!1}function e(){b(f)}function f(b,e){if(b)return c(b);2>=arguments.length?a(e)?d():c(null,e):(e=I(arguments,1),a.apply(null,e)?d():c.apply(null,[null].concat(e)))}c=c||y;var g=!1;a()?d():c(null)},doWhilst:function(a,b,c){function d(){g?C(e):(g=!0,a(f));g=!1}function e(){a(f)}function f(a,e){if(a)return c(a);2>=arguments.length?b(e)?d():c(null,e):(e=I(arguments,1),b.apply(null,e)?d():c.apply(null,[null].concat(e)))}c=c||y;var g=!1;e()},until:function(a,b,c){function d(){g? -C(e):(g=!0,b(f));g=!1}function e(){b(f)}function f(b,e){if(b)return c(b);2>=arguments.length?a(e)?c(null,e):d():(e=I(arguments,1),a.apply(null,e)?c.apply(null,[null].concat(e)):d())}c=c||y;var g=!1;a()?c(null):d()},doUntil:function(a,b,c){function d(){g?C(e):(g=!0,a(f));g=!1}function e(){a(f)}function f(a,e){if(a)return c(a);2>=arguments.length?b(e)?c(null,e):d():(e=I(arguments,1),b.apply(null,e)?c.apply(null,[null].concat(e)):d())}c=c||y;var g=!1;e()},during:function(a,b,c){function d(a,d){if(a)return c(a); -d?b(e):c(null)}function e(b){if(b)return c(b);a(d)}c=c||y;a(d)},doDuring:function(a,b,c){function d(b,d){if(b)return c(b);d?a(e):c(null)}function e(a,e){if(a)return c(a);switch(arguments.length){case 0:case 1:b(d);break;case 2:b(e,d);break;default:var m=I(arguments,1);m.push(d);b.apply(null,m)}}c=c||y;d(null,!0)},forever:function(a,b){function c(){a(d)}function d(a){if(a){if(b)return b(a);throw a;}e?C(c):(e=!0,c());e=!1}var e=!1;c()},compose:function(){return La.apply(null,Ya(arguments))},seq:La, -applyEach:tb,applyEachSeries:ub,queue:function(a,b){return ja(!0,a,b)},priorityQueue:function(a,b){var c=ja(!0,a,b);c.push=function(a,b,f){c.started=!0;b=b||0;var g=B(a)?a:[a],m=g.length;if(void 0===a||0===m)c.idle()&&C(c.drain);else{f="function"===typeof f?f:y;for(a=c._tasks.head;a&&b>=a.priority;)a=a.next;for(;m--;){var r={data:g[m],priority:b,callback:f};a?c._tasks.insertBefore(a,r):c._tasks.push(r);C(c.process)}}};delete c.unshift;return c},cargo:function(a,b){return ja(!1,a,1,b)},auto:Na,autoInject:function(a, -b,c){var d={};R(a,function(a,b){var c,m=a.length;if(B(a)){if(0===m)throw Error("autoInject task functions require explicit parameters.");c=F(a);m=c.length-1;a=c[m];if(0===m){d[b]=a;return}}else{if(1===m){d[b]=a;return}c=$a(a);if(0===m&&0===c.length)throw Error("autoInject task functions require explicit parameters.");m=c.length-1}c[m]=function(b,d){switch(m){case 1:a(b[c[0]],d);break;case 2:a(b[c[0]],b[c[1]],d);break;case 3:a(b[c[0]],b[c[1]],b[c[2]],d);break;default:for(var f=-1;++fa)return c(null,[]);var e=Array(a);K(a,function(a){b(a,d(a))})},timesSeries:function(a,b,c){function d(){b(m,e)}function e(b,e){f[m]=e;b?(c(b),c=z):++m>=a?(c(null,f),c=z):g?C(d):(g=!0,d());g=!1}c=c||y;a=+a;if(isNaN(a)||1>a)return c(null,[]);var f=Array(a),g=!1,m=0;d()}, -timesLimit:function(a,b,c,d){function e(){var b=r++;b=a?(d(null,g),d=z):m?C(e):(m=!0,e());m=!1}}d=d||y;a=+a;if(isNaN(a)||1>a||isNaN(b)||1>b)return d(null,[]);var g=Array(a),m=!1,r=0,s=0;K(b>a?a:b,e)},race:function(a,b){b=H(b||y);var c,d,e=-1;if(B(a))for(c=a.length;++e=d)return[];for(var e=Array(d);++cd[e]){var g=d[f]; +d[f]=d[e];d[e]=g}}if(!(e>c)){for(var l,e=a[a[b]>a[e]?b:e],f=b,g=c;f<=g;){for(l=f;f=l&&a[g]>=e;)g--;if(f>g)break;var r=a;l=d;var s=f++,h=g--,k=r[s];r[s]=r[h];r[h]=k;r=l[s];l[s]=l[h];l[h]=r}e=f;aa(a,b,e-1,d);aa(a,e,c,d)}}}function T(a){var b=[];P(a,function(a){a!==y&&(B(a)?U.apply(b,a):b.push(a))});return b}function ba(a,b,c){var d=-1,e=a.length;if(3===b.length)for(;++dc)return e(null,[]);A=Array(m); +K(c>m?m:c,w)}}function V(a,b,c){function d(){b(a[t],s)}function e(){b(a[t],t,s)}function f(){b(q.next().value,s)}function g(){p=q.next().value;b(p,t,s)}function l(){b(a[m[t]],s)}function r(){k=m[t];b(a[k],k,s)}function s(a,b){a?c(a):++t===h?(n=z,c(null)):!1===b?(n=z,c(null)):u?C(n):(u=!0,n());u=!1}c=E(c||y);var h,k,m,q,p,n,u=!1,t=0;B(a)?(h=a.length,n=3===b.length?e:d):a&&(x&&a[x]?(h=a.size,q=a[x](),n=3===b.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,n=3===b.length?r:l));if(!h)return c(null); +n()}function W(a,b,c,d){function e(){wb)return d(null);K(b>k?k:b,t)}function ya(a,b,c){function d(){b(a[v],s)}function e(){b(a[v],v,s)}function f(){b(q.next().value,s)}function g(){p=q.next().value;b(p,v,s)}function l(){b(a[m[v]],s)}function r(){k=m[v];b(a[k],k,s)}function s(a,b){a?(u=z,c=E(c),c(a,G(n))):(n[v]=b,++v===h?(u=z,c(null,n),c=z):t?C(u):(t=!0,u()),t=!1)}c=c||y;var h,k,m,q,p,n,u,t=!1,v=0;B(a)?(h=a.length, +u=3===b.length?e:d):a&&(x&&a[x]?(h=a.size,q=a[x](),u=3===b.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,u=3===b.length?r:l));if(!h)return c(null,[]);n=Array(h);u()}function za(a,b,c,d){return function(e,f,g){function l(a){var b=!1;return function(c,e){b&&z();b=!0;c?(g=H(g),g(c)):!!e===d?(g=H(g),g(null,a)):++h===r&&g(null)}}g=g||y;var r,s,h=0;B(e)?(r=e.length,a(e,f,l)):e&&(x&&e[x]?(r=e.size,c(e,f,l)):"object"===typeof e&&(s=F(e),r=s.length,b(e,f,l,s)));r||g(null)}}function Aa(a){return function(b, +c,d){function e(){q=b[v];c(q,h)}function f(){q=b[v];c(q,v,h)}function g(){q=n.next().value;c(q,h)}function l(){q=n.next().value;c(q,v,h)}function r(){q=b[p[v]];c(q,h)}function s(){m=p[v];q=b[m];c(q,m,h)}function h(b,c){b?d(b):!!c===a?(u=z,d(null,q)):++v===k?(u=z,d(null)):t?C(u):(t=!0,u());t=!1}d=E(d||y);var k,m,q,p,n,u,t=!1,v=0;B(b)?(k=b.length,u=3===c.length?f:e):b&&(x&&b[x]?(k=b.size,n=b[x](),u=3===c.length?l:g):"object"===typeof b&&(p=F(b),k=p.length,u=3===c.length?s:r));if(!k)return d(null);u()}} +function Ba(a){return function(b,c,d,e){function f(){q=J++;qc)return e(null);K(c>m?m:c,w)}}function Ca(a,b,c,d){return function(e,f,g){function l(a,b){return function(c,e){null===a&&z();c?(a=null,g=H(g),g(c,L(k))):(!!e===d&&(k[a]=b),a=null,++h===r&&g(null,k))}}g=g||y;var r,s,h=0,k={};B(e)?(r=e.length,a(e,f,l)):e&&(x&&e[x]?(r=e.size,c(e,f,l)):"object"===typeof e&&(s= +F(e),r=s.length,b(e,f,l,s)));if(!r)return g(null,{})}}function Da(a){return function(b,c,d){function e(){m=w;q=b[w];c(q,h)}function f(){m=w;q=b[w];c(q,w,h)}function g(){m=w;q=n.next().value;c(q,h)}function l(){m=w;q=n.next().value;c(q,m,h)}function r(){m=p[w];q=b[m];c(q,h)}function s(){m=p[w];q=b[m];c(q,m,h)}function h(b,c){b?d(b,v):(!!c===a&&(v[m]=q),++w===k?(u=z,d(null,v)):t?C(u):(t=!0,u()),t=!1)}d=E(d||y);var k,m,q,p,n,u,t=!1,v={},w=0;B(b)?(k=b.length,u=3===c.length?f:e):b&&(x&&b[x]?(k=b.size, +n=b[x](),u=3===c.length?l:g):"object"===typeof b&&(p=F(b),k=p.length,u=3===c.length?s:r));if(!k)return d(null,{});u()}}function Ea(a){return function(b,c,d,e){function f(){q=D++;qc)return e(null,{});K(c>m?m:c,w)}}function X(a,b,c,d){function e(b){c(b,a[t],h)}function f(b){c(b,a[t],t,h)}function g(){c(b,p.next().value,h)}function l(){c(b, +p.next().value,t,h)}function r(b){c(b,a[q[t]],h)}function s(b){m=q[t];c(b,a[m],m,h)}function h(a,b){a?d(a,b):++t===k?(c=z,d(null,b)):u?C(function(){n(b)}):(u=!0,n(b));u=!1}d=E(d||y);var k,m,q,p,n,u=!1,t=0;B(a)?(k=a.length,n=4===c.length?f:e):a&&(x&&a[x]?(k=a.size,p=a[x](),n=4===c.length?l:g):"object"===typeof a&&(q=F(a),k=q.length,n=4===c.length?s:r));if(!k)return d(null,b);n(b)}function Fa(a,b,c,d){function e(b){c(b,a[--s],r)}function f(b){c(b,a[--s],s,r)}function g(b){c(b,a[m[--s]],r)}function l(b){k= +m[--s];c(b,a[k],k,r)}function r(a,b){a?d(a,b):0===s?(u=z,d(null,b)):t?C(function(){u(b)}):(t=!0,u(b));t=!1}d=E(d||y);var s,h,k,m,q,p,n,u,t=!1;if(B(a))s=a.length,u=4===c.length?f:e;else if(a)if(x&&a[x]){s=a.size;n=Array(s);q=a[x]();for(h=-1;!1===(p=q.next()).done;)n[++h]=p.value;a=n;u=4===c.length?f:e}else"object"===typeof a&&(m=F(a),s=m.length,u=4===c.length?l:g);if(!s)return d(null,b);u(b)}function Ga(a,b,c){c=c||y;ha(a,b,function(a,b){if(a)return c(a);c(null,!!b)})}function Ha(a,b,c){c=c||y;ia(a, +b,function(a,b){if(a)return c(a);c(null,!!b)})}function Ia(a,b,c,d){d=d||y;ja(a,b,c,function(a,b){if(a)return d(a);d(null,!!b)})}function Ja(a,b){return B(a)?0===a.length?(b(null),!1):!0:(b(Error("First argument to waterfall must be an array of functions")),!1)}function ka(a,b,c){switch(b.length){case 0:case 1:return a(c);case 2:return a(b[1],c);case 3:return a(b[1],b[2],c);case 4:return a(b[1],b[2],b[3],c);case 5:return a(b[1],b[2],b[3],b[4],c);case 6:return a(b[1],b[2],b[3],b[4],b[5],c);default:return b= +I(b,1),b.push(c),a.apply(null,b)}}function Ka(a,b){function c(c,h){if(c)r=z,b=E(b),b(c);else if(++d===f){r=z;var k=b;b=z;2===arguments.length?k(c,h):k.apply(null,G(arguments))}else g=a[d],l=arguments,e?C(r):(e=!0,r()),e=!1}b=b||y;if(Ja(a,b)){var d=0,e=!1,f=a.length,g=a[d],l=[],r=function(){switch(g.length){case 0:try{c(null,g())}catch(a){c(a)}break;case 1:return g(c);case 2:return g(l[1],c);case 3:return g(l[1],l[2],c);case 4:return g(l[1],l[2],l[3],c);case 5:return g(l[1],l[2],l[3],l[4],c);default:return l= +I(l,1),l[g.length-1]=c,g.apply(null,l)}};r()}}function La(){var a=G(arguments);return function(){var b=this,c=G(arguments),d=c[c.length-1];"function"===typeof d?c.pop():d=y;X(a,c,function(a,c,d){a.push(function(a){var b=I(arguments,1);d(a,b)});c.apply(b,a)},function(a,c){c=B(c)?c:[c];c.unshift(a);d.apply(b,c)})}}function Ma(a){return function(b){var c=function(){var c=this,d=G(arguments),g=d.pop()||y;return a(b,function(a,b){a.apply(c,d.concat([b]))},g)};if(1c)throw Error("Concurrency must not be zero");var h=0,k=[],m,q,p={_tasks:new M,concurrency:c,payload:d,saturated:y,unsaturated:y,buffer:c/4,empty:y,drain:y,error:y,started:!1,paused:!1,push:function(a,b){f(a,b)},kill:function(){p.drain=y;p._tasks.empty()}, +unshift:function(a,b){f(a,b,!0)},remove:function(a){p._tasks.remove(a)},process:a?l:r,length:function(){return p._tasks.length},running:function(){return h},workersList:function(){return k},idle:function(){return 0===p.length()+h},pause:function(){p.paused=!0},resume:function(){!1!==p.paused&&(p.paused=!1,K(p.concurrency=arguments.length?f:I(arguments,1);if(a){r=g=0;s.length=0;var k=L(l);k[b]=f;b=null;var h=c;c=y;h(a,k)}else r--,g--,l[b]=f,e(b),b=null}function p(){0===--t&& +s.push([n,u,d])}var n,u;if(B(a)){var t=a.length-1;n=a[t];u=t;if(0===t)s.push([n,u,d]);else for(var v=-1;++v=arguments.length)return c(a,e);var f=G(arguments);return c.apply(null,f)}b(d)}function e(){b(f)}function f(a,b){if(++s===g||!a||r&&!r(a)){if(2>=arguments.length)return c(a,b);var d=G(arguments);return c.apply(null,d)}setTimeout(e,l(s))}var g,l,r,s=0;if(3>arguments.length&&"function"===typeof a)c=b||y,b=a,a=null,g=5;else switch(c=c||y,typeof a){case "object":"function"===typeof a.errorFilter&&(r=a.errorFilter);var h=a.interval;switch(typeof h){case "function":l=h;break;case "string":case "number":l= +(h=+h)?function(){return h}:function(){return 0}}g=+a.times||5;break;case "number":g=a||5;break;case "string":g=+a||5;break;default:throw Error("Invalid arguments for async.retry");}if("function"!==typeof b)throw Error("Invalid arguments for async.retry");l?b(f):b(d)}function Oa(a){return function(){var b=G(arguments),c=b.pop(),d;try{d=a.apply(this,b)}catch(e){return c(e)}d&&"function"===typeof d.then?d.then(function(a){try{c(null,a)}catch(b){C(Pa,b)}},function(a){a=a&&a.message?a:Error(a);try{c(a, +void 0)}catch(b){C(Pa,b)}}):c(null,d)}}function Pa(a){throw a;}function Qa(a){return function(){function b(a,b){if(a)return c(null,{error:a});2=arguments.length?c: +I(arguments,1),a=null,++r===f&&d(null,l))}}d=d||y;var f,g,l,r=0;B(c)?(f=c.length,l=Array(f),a(c,e)):c&&"object"===typeof c&&(g=F(c),f=g.length,l={},b(c,e,g));f||d(null,l)}}(function(a,b){for(var c=-1,d=a.length;++cb)return d(null,[]);t=Array(k);K(b>k?k:b,v)},mapValues:eb,mapValuesSeries:function(a,b,c){function d(){k=v;b(a[v],s)}function e(){k=v;b(a[v],v,s)}function f(){k=v;p=q.next().value;b(p,s)}function g(){k=v;p=q.next().value;b(p,v,s)}function l(){k=m[v];b(a[k],s)}function r(){k=m[v];b(a[k],k,s)}function s(a,b){a? +(n=z,c=E(c),c(a,L(t))):(t[k]=b,++v===h?(n=z,c(null,t),c=z):u?C(n):(u=!0,n()),u=!1)}c=c||y;var h,k,m,q,p,n,u=!1,t={},v=0;B(a)?(h=a.length,n=3===b.length?e:d):a&&(x&&a[x]?(h=a.size,q=a[x](),n=3===b.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,n=3===b.length?r:l));if(!h)return c(null,t);n()},mapValuesLimit:function(a,b,c,d){function e(){m=A++;mb)return d(null,w);K(b>k?k:b,t)},filter:Sa,filterSeries:Ta, +filterLimit:Ua,select:Sa,selectSeries:Ta,selectLimit:Ua,reject:fb,rejectSeries:gb,rejectLimit:hb,detect:ha,detectSeries:ia,detectLimit:ja,find:ha,findSeries:ia,findLimit:ja,pick:ib,pickSeries:jb,pickLimit:kb,omit:lb,omitSeries:mb,omitLimit:nb,reduce:X,inject:X,foldl:X,reduceRight:Fa,foldr:Fa,transform:ob,transformSeries:function(a,b,c,d){function e(){c(u,a[v],h)}function f(){c(u,a[v],v,h)}function g(){c(u,p.next().value,h)}function l(){c(u,p.next().value,v,h)}function r(){c(u,a[q[v]],h)}function s(){m= +q[v];c(u,a[m],m,h)}function h(a,b){a?d(a,u):++v===k?(n=z,d(null,u)):!1===b?(n=z,d(null,u)):t?C(n):(t=!0,n());t=!1}3===arguments.length&&(d=c,c=b,b=void 0);d=E(d||y);var k,m,q,p,n,u,t=!1,v=0;B(a)?(k=a.length,u=void 0!==b?b:[],n=4===c.length?f:e):a&&(x&&a[x]?(k=a.size,p=a[x](),u=void 0!==b?b:{},n=4===c.length?l:g):"object"===typeof a&&(q=F(a),k=q.length,u=void 0!==b?b:{},n=4===c.length?s:r));if(!k)return d(null,void 0!==b?b:u||{});n()},transformLimit:function(a,b,c,d,e){function f(){q=z++;qb)return e(null,void 0!==c?c:w||{});K(b>m?m:b,v)},sortBy:pb,sortBySeries:function(a,b,c){function d(){m=a[w];b(m,s)}function e(){m=a[w];b(m,w,s)}function f(){m=p.next().value;n[w]=m;b(m,s)}function g(){m=p.next().value;n[w]=m;b(m,w,s)}function l(){m=a[q[w]];n[w]=m;b(m,s)}function r(){k=q[w];m=a[k];n[w]=m;b(m,k,s)} +function s(a,b){u[w]=b;a?c(a):++w===h?(t=z,c(null,$(n,u))):v?C(t):(v=!0,t());v=!1}c=E(c||y);var h,k,m,q,p,n,u,t,v=!1,w=0;B(a)?(h=a.length,n=a,u=Array(h),t=3===b.length?e:d):a&&(x&&a[x]?(h=a.size,n=Array(h),u=Array(h),p=a[x](),t=3===b.length?g:f):"object"===typeof a&&(q=F(a),h=q.length,n=Array(h),u=Array(h),t=3===b.length?r:l));if(!h)return c(null,[]);t()},sortByLimit:function(a,b,c,d){function e(){Db)return d(null,[]);w=Array(k);K(b>k?k:b,A)},some:Ga,someSeries:Ha,someLimit:Ia,any:Ga,anySeries:Ha,anyLimit:Ia,every:Va,everySeries:Wa,everyLimit:Xa,all:Va,allSeries:Wa,allLimit:Xa,concat:qb,concatSeries:function(a,b,c){function d(){b(a[v],s)}function e(){b(a[v],v,s)}function f(){b(q.next().value,s)}function g(){p=q.next().value;b(p,v,s)}function l(){b(a[m[v]],s)}function r(){k=m[v];b(a[k],k,s)}function s(a,b){B(b)?U.apply(t,b): +2<=arguments.length&&U.apply(t,I(arguments,1));a?c(a,t):++v===h?(n=z,c(null,t)):u?C(n):(u=!0,n());u=!1}c=E(c||y);var h,k,m,q,p,n,u=!1,t=[],v=0;B(a)?(h=a.length,n=3===b.length?e:d):a&&(x&&a[x]?(h=a.size,q=a[x](),n=3===b.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,n=3===b.length?r:l));if(!h)return c(null,t);n()},concatLimit:function(a,b,c,d){function e(){tb)return d(null,[]);var A=Array(k);K(b>k?k:b,n)},groupBy:rb,groupBySeries:function(a,b,c){function d(){m=a[t];b(m,s)}function e(){m=a[t];b(m,t,s)}function f(){m=p.next().value;b(m,s)}function g(){m=p.next().value;b(m,t,s)}function l(){m=a[q[t]];b(m,s)}function r(){k=q[t];m=a[k];b(m,k,s)}function s(a,b){if(a)n=z,c=E(c),c(a,L(v));else{var d=v[b];d?d.push(m):v[b]=[m];++t===h?(n=z,c(null,v)):u? +C(n):(u=!0,n());u=!1}}c=E(c||y);var h,k,m,q,p,n,u=!1,t=0,v={};B(a)?(h=a.length,n=3===b.length?e:d):a&&(x&&a[x]?(h=a.size,p=a[x](),n=3===b.length?g:f):"object"===typeof a&&(q=F(a),h=q.length,n=3===b.length?r:l));if(!h)return c(null,v);n()},groupByLimit:function(a,b,c,d){function e(){Ab)return d(null,D);K(b>k?k:b,v)},parallel:sb,series:function(a,b){function c(){g= +k;a[k](e)}function d(){g=l[k];a[g](e)}function e(a,c){a?(s=z,b=E(b),b(a,r)):(r[g]=2>=arguments.length?c:I(arguments,1),++k===f?(s=z,b(null,r)):h?C(s):(h=!0,s()),h=!1)}b=b||y;var f,g,l,r,s,h=!1,k=0;if(B(a))f=a.length,r=Array(f),s=c;else if(a&&"object"===typeof a)l=F(a),f=l.length,r={},s=d;else return b(null);if(!f)return b(null,r);s()},parallelLimit:function(a,b,c){function d(){l=q++;if(l=arguments.length?d:I(arguments,1),a=null,++p===g?c(null,h):m?C(k):(m=!0,k()),m=!1)}}c=c||y;var g,l,r,s,h,k,m=!1,q=0,p=0;B(a)?(g=a.length,h=Array(g),k=d):a&&"object"===typeof a&&(s=F(a),g=s.length,h={},k=e);if(!g||isNaN(b)||1>b)return c(null,h);K(b>g?g:b,k)},tryEach:function(a,b){function c(){a[r](e)}function d(){a[g[r]](e)}function e(a,c){a?++r===f?b(a):l():2>=arguments.length?b(null,c):b(null,I(arguments,1))}b=b||y;var f,g,l,r=0;B(a)?(f=a.length,l=c):a&&"object"===typeof a&& +(g=F(a),f=g.length,l=d);if(!f)return b(null);l()},waterfall:function(a,b){function c(){ka(e,f,d(e))}function d(h){return function(k,m){void 0===h&&(b=y,z());h=void 0;k?(g=b,b=z,g(k)):++r===s?(g=b,b=z,2>=arguments.length?g(k,m):g.apply(null,G(arguments))):(l?(f=arguments,e=a[r]||z,C(c)):(l=!0,ka(a[r]||z,arguments,d(r))),l=!1)}}b=b||y;if(Ja(a,b)){var e,f,g,l,r=0,s=a.length;ka(a[0],[],d(0))}},angelFall:Ka,angelfall:Ka,whilst:function(a,b,c){function d(){g?C(e):(g=!0,b(f));g=!1}function e(){b(f)}function f(b, +e){if(b)return c(b);2>=arguments.length?a(e)?d():c(null,e):(e=I(arguments,1),a.apply(null,e)?d():c.apply(null,[null].concat(e)))}c=c||y;var g=!1;a()?d():c(null)},doWhilst:function(a,b,c){function d(){g?C(e):(g=!0,a(f));g=!1}function e(){a(f)}function f(a,e){if(a)return c(a);2>=arguments.length?b(e)?d():c(null,e):(e=I(arguments,1),b.apply(null,e)?d():c.apply(null,[null].concat(e)))}c=c||y;var g=!1;e()},until:function(a,b,c){function d(){g?C(e):(g=!0,b(f));g=!1}function e(){b(f)}function f(b,e){if(b)return c(b); +2>=arguments.length?a(e)?c(null,e):d():(e=I(arguments,1),a.apply(null,e)?c.apply(null,[null].concat(e)):d())}c=c||y;var g=!1;a()?c(null):d()},doUntil:function(a,b,c){function d(){g?C(e):(g=!0,a(f));g=!1}function e(){a(f)}function f(a,e){if(a)return c(a);2>=arguments.length?b(e)?c(null,e):d():(e=I(arguments,1),b.apply(null,e)?c.apply(null,[null].concat(e)):d())}c=c||y;var g=!1;e()},during:function(a,b,c){function d(a,d){if(a)return c(a);d?b(e):c(null)}function e(b){if(b)return c(b);a(d)}c=c||y;a(d)}, +doDuring:function(a,b,c){function d(b,d){if(b)return c(b);d?a(e):c(null)}function e(a,e){if(a)return c(a);switch(arguments.length){case 0:case 1:b(d);break;case 2:b(e,d);break;default:var l=I(arguments,1);l.push(d);b.apply(null,l)}}c=c||y;d(null,!0)},forever:function(a,b){function c(){a(d)}function d(a){if(a){if(b)return b(a);throw a;}e?C(c):(e=!0,c());e=!1}var e=!1;c()},compose:function(){return La.apply(null,Ya(arguments))},seq:La,applyEach:tb,applyEachSeries:ub,queue:function(a,b){return la(!0, +a,b)},priorityQueue:function(a,b){var c=la(!0,a,b);c.push=function(a,b,f){c.started=!0;b=b||0;var g=B(a)?a:[a],l=g.length;if(void 0===a||0===l)c.idle()&&C(c.drain);else{f="function"===typeof f?f:y;for(a=c._tasks.head;a&&b>=a.priority;)a=a.next;for(;l--;){var r={data:g[l],priority:b,callback:f};a?c._tasks.insertBefore(a,r):c._tasks.push(r);C(c.process)}}};delete c.unshift;return c},cargo:function(a,b){return la(!1,a,1,b)},auto:Na,autoInject:function(a,b,c){var d={};S(a,function(a,b){var c,l=a.length; +if(B(a)){if(0===l)throw Error("autoInject task functions require explicit parameters.");c=G(a);l=c.length-1;a=c[l];if(0===l){d[b]=a;return}}else{if(1===l){d[b]=a;return}c=$a(a);if(0===l&&0===c.length)throw Error("autoInject task functions require explicit parameters.");l=c.length-1}c[l]=function(b,d){switch(l){case 1:a(b[c[0]],d);break;case 2:a(b[c[0]],b[c[1]],d);break;case 3:a(b[c[0]],b[c[1]],b[c[2]],d);break;default:for(var f=-1;++fa)return c(null,[]);var e=Array(a);K(a,function(a){b(a,d(a))})},timesSeries:function(a,b,c){function d(){b(l,e)}function e(b,e){f[l]=e;b?(c(b),c=z):++l>=a?(c(null,f),c=z):g?C(d):(g=!0,d());g=!1}c=c||y;a=+a;if(isNaN(a)||1>a)return c(null,[]);var f=Array(a),g=!1,l=0;d()},timesLimit:function(a,b,c,d){function e(){var b= +r++;b=a?(d(null,g),d=z):l?C(e):(l=!0,e());l=!1}}d=d||y;a=+a;if(isNaN(a)||1>a||isNaN(b)||1>b)return d(null,[]);var g=Array(a),l=!1,r=0,s=0;K(b>a?a:b,e)},race:function(a,b){b=H(b||y);var c,d,e=-1;if(B(a))for(c=a.length;++e=d)return[];for(var e=Array(d);++cc)return e(null,[]);A=Array(h);K(c>h?h:c,w)}}function Y(a,b,c){function d(){b(a[u],s)}function e(){b(a[u],u,s)}function f(){b(p.next().value,s)}function g(){q=p.next().value;b(q,u,s)}function m(){b(a[h[u]],s)}function r(){l=h[u];b(a[l],l,s)}function s(a,b){a?c(a):++u===k?(n=z,c(null)):!1===b?(n=z,c(null)):t?C(n):(t=!0,n());t=!1}c=E(c||y);var k,l,h,p,q,n,t=!1,u=0;B(a)?(k=a.length, -n=3===b.length?e:d):a&&(x&&a[x]?(k=a.size,p=a[x](),n=3===b.length?g:f):"object"===typeof a&&(h=D(a),k=h.length,n=3===b.length?r:m));if(!k)return c(null);n()}function Z(a,b,c,d){function e(){wb)return d(null);K(b>l?l:b,u)}function ya(a,b,c){function d(){b(a[v],s)}function e(){b(a[v],v,s)}function f(){b(p.next().value,s)}function g(){q=p.next().value;b(q,v,s)}function m(){b(a[h[v]],s)}function r(){l=h[v];b(a[l],l, -s)}function s(a,b){a?(t=z,c=E(c),c(a,F(n))):(n[v]=b,++v===k?(t=z,c(null,n),c=z):u?C(t):(u=!0,t()),u=!1)}c=c||y;var k,l,h,p,q,n,t,u=!1,v=0;B(a)?(k=a.length,t=3===b.length?e:d):a&&(x&&a[x]?(k=a.size,p=a[x](),t=3===b.length?g:f):"object"===typeof a&&(h=D(a),k=h.length,t=3===b.length?r:m));if(!k)return c(null,[]);n=Array(k);t()}function za(a,b,c,d){return function(e,f,g){function m(a){var b=!1;return function(c,e){b&&z();b=!0;c?(g=H(g),g(c)):!!e===d?(g=H(g),g(null,a)):++k===r&&g(null)}}g=g||y;var r,s, -k=0;B(e)?(r=e.length,a(e,f,m)):e&&(x&&e[x]?(r=e.size,c(e,f,m)):"object"===typeof e&&(s=D(e),r=s.length,b(e,f,m,s)));r||g(null)}}function Aa(a){return function(b,c,d){function e(){p=b[v];c(p,k)}function f(){p=b[v];c(p,v,k)}function g(){p=n.next().value;c(p,k)}function m(){p=n.next().value;c(p,v,k)}function r(){p=b[q[v]];c(p,k)}function s(){h=q[v];p=b[h];c(p,h,k)}function k(b,c){b?d(b):!!c===a?(t=z,d(null,p)):++v===l?(t=z,d(null)):u?C(t):(u=!0,t());u=!1}d=E(d||y);var l,h,p,q,n,t,u=!1,v=0;B(b)?(l=b.length, -t=3===c.length?f:e):b&&(x&&b[x]?(l=b.size,n=b[x](),t=3===c.length?m:g):"object"===typeof b&&(q=D(b),l=q.length,t=3===c.length?s:r));if(!l)return d(null);t()}}function Ba(a){return function(b,c,d,e){function f(){p=G++;pc)return e(null);K(c>h?h:c,w)}}function Ca(a,b,c,d){return function(e,f,g){function m(a,b){return function(c,e){null===a&&z();c?(a=null,g=H(g),g(c, -L(l))):(!!e===d&&(l[a]=b),a=null,++k===r&&g(null,l))}}g=g||y;var r,s,k=0,l={};B(e)?(r=e.length,a(e,f,m)):e&&(x&&e[x]?(r=e.size,c(e,f,m)):"object"===typeof e&&(s=D(e),r=s.length,b(e,f,m,s)));if(!r)return g(null,{})}}function Da(a){return function(b,c,d){function e(){h=w;p=b[w];c(p,k)}function f(){h=w;p=b[w];c(p,w,k)}function g(){h=w;p=n.next().value;c(p,k)}function m(){h=w;p=n.next().value;c(p,h,k)}function r(){h=q[w];p=b[h];c(p,k)}function s(){h=q[w];p=b[h];c(p,h,k)}function k(b,c){b?d(b,v):(!!c=== -a&&(v[h]=p),++w===l?(t=z,d(null,v)):u?C(t):(u=!0,t()),u=!1)}d=E(d||y);var l,h,p,q,n,t,u=!1,v={},w=0;B(b)?(l=b.length,t=3===c.length?f:e):b&&(x&&b[x]?(l=b.size,n=b[x](),t=3===c.length?m:g):"object"===typeof b&&(q=D(b),l=q.length,t=3===c.length?s:r));if(!l)return d(null,{});t()}}function Ea(a){return function(b,c,d,e){function f(){p=J++;pc)return e(null,{});K(c>h?h:c,w)}}function $(a,b,c,d){function e(b){c(b,a[u],k)}function f(b){c(b,a[u],u,k)}function g(){c(b,q.next().value,k)}function m(){c(b,q.next().value,u,k)}function r(b){c(b,a[p[u]],k)}function s(b){h=p[u];c(b,a[h],h,k)}function k(a,b){a?d(a,b):++u===l?(c=z,d(null,b)):t?C(function(){n(b)}):(t=!0,n(b));t=!1}d=E(d||y);var l,h,p,q,n,t=!1,u=0;B(a)?(l=a.length,n=4===c.length?f:e):a&&(x&&a[x]?(l=a.size,q=a[x](),n=4===c.length?m:g):"object"===typeof a&&(p=D(a),l=p.length,n=4=== -c.length?s:r));if(!l)return d(null,b);n(b)}function Fa(a,b,c,d){function e(b){c(b,a[--s],r)}function f(b){c(b,a[--s],s,r)}function g(b){c(b,a[h[--s]],r)}function m(b){l=h[--s];c(b,a[l],l,r)}function r(a,b){a?d(a,b):0===s?(t=z,d(null,b)):u?C(function(){t(b)}):(u=!0,t(b));u=!1}d=E(d||y);var s,k,l,h,p,q,n,t,u=!1;if(B(a))s=a.length,t=4===c.length?f:e;else if(a)if(x&&a[x]){s=a.size;n=Array(s);p=a[x]();for(k=-1;!1===(q=p.next()).done;)n[++k]=q.value;a=n;t=4===c.length?f:e}else"object"===typeof a&&(h=D(a), -s=h.length,t=4===c.length?m:g);if(!s)return d(null,b);t(b)}function Ga(a,b,c){c=c||y;fa(a,b,function(a,b){if(a)return c(a);c(null,!!b)})}function Ha(a,b,c){c=c||y;ga(a,b,function(a,b){if(a)return c(a);c(null,!!b)})}function Ia(a,b,c,d){d=d||y;ha(a,b,c,function(a,b){if(a)return d(a);d(null,!!b)})}function Ja(a,b){return B(a)?0===a.length?(b(null),!1):!0:(b(Error("First argument to waterfall must be an array of functions")),!1)}function ia(a,b,c){switch(b.length){case 0:case 1:return a(c);case 2:return a(b[1], -c);case 3:return a(b[1],b[2],c);case 4:return a(b[1],b[2],b[3],c);case 5:return a(b[1],b[2],b[3],b[4],c);case 6:return a(b[1],b[2],b[3],b[4],b[5],c);default:return b=I(b,1),b.push(c),a.apply(null,b)}}function Ka(a,b){function c(c,k){if(c)r=z,b=E(b),b(c);else if(++d===f){r=z;var l=b;b=z;2===arguments.length?l(c,k):l.apply(null,F(arguments))}else g=a[d],m=arguments,e?C(r):(e=!0,r()),e=!1}b=b||y;if(Ja(a,b)){var d=0,e=!1,f=a.length,g=a[d],m=[],r=function(){switch(g.length){case 0:try{c(null,g())}catch(a){c(a)}break; -case 1:return g(c);case 2:return g(m[1],c);case 3:return g(m[1],m[2],c);case 4:return g(m[1],m[2],m[3],c);case 5:return g(m[1],m[2],m[3],m[4],c);default:return m=I(m,1),m[g.length-1]=c,g.apply(null,m)}};r()}}function La(){var a=F(arguments);return function(){var b=this,c=F(arguments),d=c[c.length-1];"function"===typeof d?c.pop():d=y;$(a,c,function(a,c,d){a.push(function(a){var b=I(arguments,1);d(a,b)});c.apply(b,a)},function(a,c){c=B(c)?c:[c];c.unshift(a);d.apply(b,c)})}}function Ma(a){return function(b){var c= -function(){var c=this,d=F(arguments),g=d.pop()||y;return a(b,function(a,b){a.apply(c,d.concat([b]))},g)};if(1c)throw Error("Concurrency must not be zero");var k=0,l=[],h,p,q={_tasks:new M,concurrency:c, -payload:d,saturated:y,unsaturated:y,buffer:c/4,empty:y,drain:y,error:y,started:!1,paused:!1,push:function(a,b){f(a,b)},kill:function(){q.drain=y;q._tasks.empty()},unshift:function(a,b){f(a,b,!0)},remove:function(a){q._tasks.remove(a)},process:a?m:r,length:function(){return q._tasks.length},running:function(){return k},workersList:function(){return l},idle:function(){return 0===q.length()+k},pause:function(){q.paused=!0},resume:function(){!1!==q.paused&&(q.paused=!1,K(q.concurrency=arguments.length?f:I(arguments,1);if(a){var l=L(m);l[b]=f;b=null;var k=c;c=y;k(a,l)}else m[b]=f,e(b),b=null}function q(){0===--u&&s.push([n,t,d])}var n,t;if(B(a)){var u=a.length-1;n=a[u];t=u;if(0===u)s.push([n,t,d]);else for(var v=-1;++v=arguments.length)return c(a,e);var f=F(arguments);return c.apply(null,f)}b(d)}function e(){b(f)}function f(a,b){if(++s===g||!a||r&&!r(a)){if(2>=arguments.length)return c(a,b);var d=F(arguments);return c.apply(null,d)}setTimeout(e,m(s))}var g,m,r,s=0;if(3>arguments.length&&"function"===typeof a)c=b||y,b=a,a=null,g=5;else switch(c= -c||y,typeof a){case "object":"function"===typeof a.errorFilter&&(r=a.errorFilter);var k=a.interval;switch(typeof k){case "function":m=k;break;case "string":case "number":m=(k=+k)?function(){return k}:function(){return 0}}g=+a.times||5;break;case "number":g=a||5;break;case "string":g=+a||5;break;default:throw Error("Invalid arguments for async.retry");}if("function"!==typeof b)throw Error("Invalid arguments for async.retry");m?b(f):b(d)}function Oa(a){return function(){var b=F(arguments),c=b.pop(), -d;try{d=a.apply(this,b)}catch(e){return c(e)}d&&"function"===typeof d.then?d.then(function(a){try{c(null,a)}catch(b){C(Pa,b)}},function(a){a=a.message?a:Error(a);try{c(a,void 0)}catch(b){C(Pa,b)}}):c(null,d)}}function Pa(a){throw a;}function Qa(a){return function(){function b(a,b){if(a)return c(null,{error:a});2=arguments.length?c:I(arguments,1),a=null,++r===f&&d(null,m))}}d=d||y;var f,g,m,r=0;B(c)?(f=c.length,m=Array(f),a(c,e)):c&&"object"===typeof c&&(g=D(c),f=g.length,m={},b(c,e,g));f||d(null,m)}}(function(a,b){for(var c=-1,d=a.length;++cb)return d(null,[]);u=Array(l);K(b>l?l:b,v)},mapValues:eb,mapValuesSeries:function(a,b,c){function d(){l=v;b(a[v],s)}function e(){l=v;b(a[v],v,s)}function f(){l=v;q=p.next().value;b(q,s)}function g(){l= -v;q=p.next().value;b(q,v,s)}function m(){l=h[v];b(a[l],s)}function r(){l=h[v];b(a[l],l,s)}function s(a,b){a?(n=z,c=E(c),c(a,L(u))):(u[l]=b,++v===k?(n=z,c(null,u),c=z):t?C(n):(t=!0,n()),t=!1)}c=c||y;var k,l,h,p,q,n,t=!1,u={},v=0;B(a)?(k=a.length,n=3===b.length?e:d):a&&(x&&a[x]?(k=a.size,p=a[x](),n=3===b.length?g:f):"object"===typeof a&&(h=D(a),k=h.length,n=3===b.length?r:m));if(!k)return c(null,u);n()},mapValuesLimit:function(a,b,c,d){function e(){h=A++;hb)return d(null,w);K(b>l?l:b,u)},filter:Sa,filterSeries:Ta,filterLimit:Ua,select:Sa,selectSeries:Ta,selectLimit:Ua,reject:fb,rejectSeries:gb,rejectLimit:hb,detect:fa,detectSeries:ga,detectLimit:ha,find:fa,findSeries:ga,findLimit:ha,pick:ib,pickSeries:jb,pickLimit:kb,omit:lb,omitSeries:mb,omitLimit:nb,reduce:$,inject:$,foldl:$,reduceRight:Fa,foldr:Fa,transform:ob,transformSeries:function(a,b,c,d){function e(){c(t,a[v],k)}function f(){c(t,a[v], -v,k)}function g(){c(t,q.next().value,k)}function m(){c(t,q.next().value,v,k)}function r(){c(t,a[p[v]],k)}function s(){h=p[v];c(t,a[h],h,k)}function k(a,b){a?d(a,t):++v===l?(n=z,d(null,t)):!1===b?(n=z,d(null,t)):u?C(n):(u=!0,n());u=!1}3===arguments.length&&(d=c,c=b,b=void 0);d=E(d||y);var l,h,p,q,n,t,u=!1,v=0;B(a)?(l=a.length,t=void 0!==b?b:[],n=4===c.length?f:e):a&&(x&&a[x]?(l=a.size,q=a[x](),t=void 0!==b?b:{},n=4===c.length?m:g):"object"===typeof a&&(p=D(a),l=p.length,t=void 0!==b?b:{},n=4===c.length? -s:r));if(!l)return d(null,void 0!==b?b:t||{});n()},transformLimit:function(a,b,c,d,e){function f(){p=z++;pb)return e(null,void 0!==c?c:w||{});K(b>h?h:b,v)},sortBy:pb,sortBySeries:function(a,b,c){function d(){h=a[v];b(h,s)}function e(){h=a[v];b(h,v,s)}function f(){h=q.next().value;b(h,s)}function g(){h=q.next().value; -b(h,v,s)}function m(){h=a[p[v]];b(h,s)}function r(){l=p[v];h=a[l];b(h,l,s)}function s(a,b){n[v]={value:h,criteria:b};a?c(a):++v===k?(t=z,n.sort(da),c(null,ca(n,"value"))):u?C(t):(u=!0,t());u=!1}c=E(c||y);var k,l,h,p,q,n,t,u=!1,v=0;B(a)?(k=a.length,t=3===b.length?e:d):a&&(x&&a[x]?(k=a.size,q=a[x](),t=3===b.length?g:f):"object"===typeof a&&(p=D(a),k=p.length,t=3===b.length?r:m));if(!k)return c(null,[]);n=Array(k);t()},sortByLimit:function(a,b,c,d){function e(){Gb)return d(null,[]);v=Array(l);K(b>l?l:b,w)},some:Ga,someSeries:Ha,someLimit:Ia,any:Ga,anySeries:Ha,anyLimit:Ia,every:Va,everySeries:Wa,everyLimit:Xa,all:Va,allSeries:Wa,allLimit:Xa,concat:qb,concatSeries:function(a,b,c){function d(){b(a[v],s)}function e(){b(a[v],v,s)}function f(){b(p.next().value,s)}function g(){q=p.next().value;b(q,v,s)}function m(){b(a[h[v]],s)}function r(){l=h[v]; -b(a[l],l,s)}function s(a,b){B(b)?T.apply(u,b):2<=arguments.length&&T.apply(u,I(arguments,1));a?c(a,u):++v===k?(n=z,c(null,u)):t?C(n):(t=!0,n());t=!1}c=E(c||y);var k,l,h,p,q,n,t=!1,u=[],v=0;B(a)?(k=a.length,n=3===b.length?e:d):a&&(x&&a[x]?(k=a.size,p=a[x](),n=3===b.length?g:f):"object"===typeof a&&(h=D(a),k=h.length,n=3===b.length?r:m));if(!k)return c(null,u);n()},concatLimit:function(a,b,c,d){function e(){ub)return d(null,[]);var A=Array(l);K(b>l?l:b,n)},groupBy:rb,groupBySeries:function(a,b,c){function d(){h=a[u];b(h,s)}function e(){h=a[u];b(h,u,s)}function f(){h=q.next().value;b(h,s)}function g(){h=q.next().value;b(h,u,s)}function m(){h=a[p[u]];b(h,s)}function r(){l=p[u];h=a[l];b(h,l,s)}function s(a,b){if(a)n=z,c=E(c),c(a,L(v));else{var d= -v[b];d?d.push(h):v[b]=[h];++u===k?(n=z,c(null,v)):t?C(n):(t=!0,n());t=!1}}c=E(c||y);var k,l,h,p,q,n,t=!1,u=0,v={};B(a)?(k=a.length,n=3===b.length?e:d):a&&(x&&a[x]?(k=a.size,q=a[x](),n=3===b.length?g:f):"object"===typeof a&&(p=D(a),k=p.length,n=3===b.length?r:m));if(!k)return c(null,v);n()},groupByLimit:function(a,b,c,d){function e(){Ab)return d(null, -F);K(b>l?l:b,v)},parallel:sb,series:function(a,b){function c(){g=l;a[l](e)}function d(){g=m[l];a[g](e)}function e(a,c){a?(s=z,b=E(b),b(a,r)):(r[g]=2>=arguments.length?c:I(arguments,1),++l===f?(s=z,b(null,r)):k?C(s):(k=!0,s()),k=!1)}b=b||y;var f,g,m,r,s,k=!1,l=0;if(B(a))f=a.length,r=Array(f),s=c;else if(a&&"object"===typeof a)m=D(a),f=m.length,r={},s=d;else return b(null);if(!f)return b(null,r);s()},parallelLimit:function(a,b,c){function d(){m=p++;if(m=arguments.length?d:I(arguments,1),a=null,++q===g?c(null,k):h?C(l):(h=!0,l()),h=!1)}}c=c||y;var g,m,r,s,k,l,h=!1,p=0,q=0;B(a)?(g=a.length,k=Array(g),l=d):a&&"object"===typeof a&&(s=D(a),g=s.length,k={},l=e);if(!g||isNaN(b)||1>b)return c(null,k);K(b>g?g:b,l)},tryEach:function(a,b){function c(){a[r](e)}function d(){a[g[r]](e)}function e(a,c){a?++r===f?b(a):m():2>=arguments.length?b(null,c):b(null,I(arguments,1))}b= -b||y;var f,g,m,r=0;B(a)?(f=a.length,m=c):a&&"object"===typeof a&&(g=D(a),f=g.length,m=d);if(!f)return b(null);m()},waterfall:function(a,b){function c(){ia(e,f,d(e))}function d(k){return function(l,h){void 0===k&&(b=y,z());k=void 0;l?(g=b,b=z,g(l)):++r===s?(g=b,b=z,2>=arguments.length?g(l,h):g.apply(null,F(arguments))):(m?(f=arguments,e=a[r]||z,C(c)):(m=!0,ia(a[r]||z,arguments,d(r))),m=!1)}}b=b||y;if(Ja(a,b)){var e,f,g,m,r=0,s=a.length;ia(a[0],[],d(0))}},angelFall:Ka,angelfall:Ka,whilst:function(a, -b,c){function d(){g?C(e):(g=!0,b(f));g=!1}function e(){b(f)}function f(b,e){if(b)return c(b);2>=arguments.length?a(e)?d():c(null,e):(e=I(arguments,1),a.apply(null,e)?d():c.apply(null,[null].concat(e)))}c=c||y;var g=!1;a()?d():c(null)},doWhilst:function(a,b,c){function d(){g?C(e):(g=!0,a(f));g=!1}function e(){a(f)}function f(a,e){if(a)return c(a);2>=arguments.length?b(e)?d():c(null,e):(e=I(arguments,1),b.apply(null,e)?d():c.apply(null,[null].concat(e)))}c=c||y;var g=!1;e()},until:function(a,b,c){function d(){g? -C(e):(g=!0,b(f));g=!1}function e(){b(f)}function f(b,e){if(b)return c(b);2>=arguments.length?a(e)?c(null,e):d():(e=I(arguments,1),a.apply(null,e)?c.apply(null,[null].concat(e)):d())}c=c||y;var g=!1;a()?c(null):d()},doUntil:function(a,b,c){function d(){g?C(e):(g=!0,a(f));g=!1}function e(){a(f)}function f(a,e){if(a)return c(a);2>=arguments.length?b(e)?c(null,e):d():(e=I(arguments,1),b.apply(null,e)?c.apply(null,[null].concat(e)):d())}c=c||y;var g=!1;e()},during:function(a,b,c){function d(a,d){if(a)return c(a); -d?b(e):c(null)}function e(b){if(b)return c(b);a(d)}c=c||y;a(d)},doDuring:function(a,b,c){function d(b,d){if(b)return c(b);d?a(e):c(null)}function e(a,e){if(a)return c(a);switch(arguments.length){case 0:case 1:b(d);break;case 2:b(e,d);break;default:var m=I(arguments,1);m.push(d);b.apply(null,m)}}c=c||y;d(null,!0)},forever:function(a,b){function c(){a(d)}function d(a){if(a){if(b)return b(a);throw a;}e?C(c):(e=!0,c());e=!1}var e=!1;c()},compose:function(){return La.apply(null,Ya(arguments))},seq:La, -applyEach:tb,applyEachSeries:ub,queue:function(a,b){return ja(!0,a,b)},priorityQueue:function(a,b){var c=ja(!0,a,b);c.push=function(a,b,f){c.started=!0;b=b||0;var g=B(a)?a:[a],m=g.length;if(void 0===a||0===m)c.idle()&&C(c.drain);else{f="function"===typeof f?f:y;for(a=c._tasks.head;a&&b>=a.priority;)a=a.next;for(;m--;){var r={data:g[m],priority:b,callback:f};a?c._tasks.insertBefore(a,r):c._tasks.push(r);C(c.process)}}};delete c.unshift;return c},cargo:function(a,b){return ja(!1,a,1,b)},auto:Na,autoInject:function(a, -b,c){var d={};R(a,function(a,b){var c,m=a.length;if(B(a)){if(0===m)throw Error("autoInject task functions require explicit parameters.");c=F(a);m=c.length-1;a=c[m];if(0===m){d[b]=a;return}}else{if(1===m){d[b]=a;return}c=$a(a);if(0===m&&0===c.length)throw Error("autoInject task functions require explicit parameters.");m=c.length-1}c[m]=function(b,d){switch(m){case 1:a(b[c[0]],d);break;case 2:a(b[c[0]],b[c[1]],d);break;case 3:a(b[c[0]],b[c[1]],b[c[2]],d);break;default:for(var f=-1;++fa)return c(null,[]);var e=Array(a);K(a,function(a){b(a,d(a))})},timesSeries:function(a,b,c){function d(){b(m,e)}function e(b,e){f[m]=e;b?(c(b),c=z):++m>=a?(c(null,f),c=z):g?C(d):(g=!0,d());g=!1}c=c||y;a=+a;if(isNaN(a)||1>a)return c(null,[]);var f=Array(a),g=!1,m=0;d()}, -timesLimit:function(a,b,c,d){function e(){var b=r++;b=a?(d(null,g),d=z):m?C(e):(m=!0,e());m=!1}}d=d||y;a=+a;if(isNaN(a)||1>a||isNaN(b)||1>b)return d(null,[]);var g=Array(a),m=!1,r=0,s=0;K(b>a?a:b,e)},race:function(a,b){b=H(b||y);var c,d,e=-1;if(B(a))for(c=a.length;++e=d)return[];for(var e=Array(d);++cd[e]){var g=d[f]; +d[f]=d[e];d[e]=g}}if(!(e>c)){for(var l,e=a[a[b]>a[e]?b:e],f=b,g=c;f<=g;){for(l=f;f=l&&a[g]>=e;)g--;if(f>g)break;var r=a;l=d;var s=f++,h=g--,k=r[s];r[s]=r[h];r[h]=k;r=l[s];l[s]=l[h];l[h]=r}e=f;aa(a,b,e-1,d);aa(a,e,c,d)}}}function T(a){var b=[];P(a,function(a){a!==y&&(B(a)?U.apply(b,a):b.push(a))});return b}function ba(a,b,c){var d=-1,e=a.length;if(3===b.length)for(;++dc)return e(null,[]);A=Array(m); +K(c>m?m:c,w)}}function V(a,b,c){function d(){b(a[t],s)}function e(){b(a[t],t,s)}function f(){b(q.next().value,s)}function g(){p=q.next().value;b(p,t,s)}function l(){b(a[m[t]],s)}function r(){k=m[t];b(a[k],k,s)}function s(a,b){a?c(a):++t===h?(n=z,c(null)):!1===b?(n=z,c(null)):u?C(n):(u=!0,n());u=!1}c=E(c||y);var h,k,m,q,p,n,u=!1,t=0;B(a)?(h=a.length,n=3===b.length?e:d):a&&(x&&a[x]?(h=a.size,q=a[x](),n=3===b.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,n=3===b.length?r:l));if(!h)return c(null); +n()}function W(a,b,c,d){function e(){wb)return d(null);K(b>k?k:b,t)}function ya(a,b,c){function d(){b(a[v],s)}function e(){b(a[v],v,s)}function f(){b(q.next().value,s)}function g(){p=q.next().value;b(p,v,s)}function l(){b(a[m[v]],s)}function r(){k=m[v];b(a[k],k,s)}function s(a,b){a?(u=z,c=E(c),c(a,G(n))):(n[v]=b,++v===h?(u=z,c(null,n),c=z):t?C(u):(t=!0,u()),t=!1)}c=c||y;var h,k,m,q,p,n,u,t=!1,v=0;B(a)?(h=a.length, +u=3===b.length?e:d):a&&(x&&a[x]?(h=a.size,q=a[x](),u=3===b.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,u=3===b.length?r:l));if(!h)return c(null,[]);n=Array(h);u()}function za(a,b,c,d){return function(e,f,g){function l(a){var b=!1;return function(c,e){b&&z();b=!0;c?(g=H(g),g(c)):!!e===d?(g=H(g),g(null,a)):++h===r&&g(null)}}g=g||y;var r,s,h=0;B(e)?(r=e.length,a(e,f,l)):e&&(x&&e[x]?(r=e.size,c(e,f,l)):"object"===typeof e&&(s=F(e),r=s.length,b(e,f,l,s)));r||g(null)}}function Aa(a){return function(b, +c,d){function e(){q=b[v];c(q,h)}function f(){q=b[v];c(q,v,h)}function g(){q=n.next().value;c(q,h)}function l(){q=n.next().value;c(q,v,h)}function r(){q=b[p[v]];c(q,h)}function s(){m=p[v];q=b[m];c(q,m,h)}function h(b,c){b?d(b):!!c===a?(u=z,d(null,q)):++v===k?(u=z,d(null)):t?C(u):(t=!0,u());t=!1}d=E(d||y);var k,m,q,p,n,u,t=!1,v=0;B(b)?(k=b.length,u=3===c.length?f:e):b&&(x&&b[x]?(k=b.size,n=b[x](),u=3===c.length?l:g):"object"===typeof b&&(p=F(b),k=p.length,u=3===c.length?s:r));if(!k)return d(null);u()}} +function Ba(a){return function(b,c,d,e){function f(){q=J++;qc)return e(null);K(c>m?m:c,w)}}function Ca(a,b,c,d){return function(e,f,g){function l(a,b){return function(c,e){null===a&&z();c?(a=null,g=H(g),g(c,L(k))):(!!e===d&&(k[a]=b),a=null,++h===r&&g(null,k))}}g=g||y;var r,s,h=0,k={};B(e)?(r=e.length,a(e,f,l)):e&&(x&&e[x]?(r=e.size,c(e,f,l)):"object"===typeof e&&(s= +F(e),r=s.length,b(e,f,l,s)));if(!r)return g(null,{})}}function Da(a){return function(b,c,d){function e(){m=w;q=b[w];c(q,h)}function f(){m=w;q=b[w];c(q,w,h)}function g(){m=w;q=n.next().value;c(q,h)}function l(){m=w;q=n.next().value;c(q,m,h)}function r(){m=p[w];q=b[m];c(q,h)}function s(){m=p[w];q=b[m];c(q,m,h)}function h(b,c){b?d(b,v):(!!c===a&&(v[m]=q),++w===k?(u=z,d(null,v)):t?C(u):(t=!0,u()),t=!1)}d=E(d||y);var k,m,q,p,n,u,t=!1,v={},w=0;B(b)?(k=b.length,u=3===c.length?f:e):b&&(x&&b[x]?(k=b.size, +n=b[x](),u=3===c.length?l:g):"object"===typeof b&&(p=F(b),k=p.length,u=3===c.length?s:r));if(!k)return d(null,{});u()}}function Ea(a){return function(b,c,d,e){function f(){q=D++;qc)return e(null,{});K(c>m?m:c,w)}}function X(a,b,c,d){function e(b){c(b,a[t],h)}function f(b){c(b,a[t],t,h)}function g(){c(b,p.next().value,h)}function l(){c(b, +p.next().value,t,h)}function r(b){c(b,a[q[t]],h)}function s(b){m=q[t];c(b,a[m],m,h)}function h(a,b){a?d(a,b):++t===k?(c=z,d(null,b)):u?C(function(){n(b)}):(u=!0,n(b));u=!1}d=E(d||y);var k,m,q,p,n,u=!1,t=0;B(a)?(k=a.length,n=4===c.length?f:e):a&&(x&&a[x]?(k=a.size,p=a[x](),n=4===c.length?l:g):"object"===typeof a&&(q=F(a),k=q.length,n=4===c.length?s:r));if(!k)return d(null,b);n(b)}function Fa(a,b,c,d){function e(b){c(b,a[--s],r)}function f(b){c(b,a[--s],s,r)}function g(b){c(b,a[m[--s]],r)}function l(b){k= +m[--s];c(b,a[k],k,r)}function r(a,b){a?d(a,b):0===s?(u=z,d(null,b)):t?C(function(){u(b)}):(t=!0,u(b));t=!1}d=E(d||y);var s,h,k,m,q,p,n,u,t=!1;if(B(a))s=a.length,u=4===c.length?f:e;else if(a)if(x&&a[x]){s=a.size;n=Array(s);q=a[x]();for(h=-1;!1===(p=q.next()).done;)n[++h]=p.value;a=n;u=4===c.length?f:e}else"object"===typeof a&&(m=F(a),s=m.length,u=4===c.length?l:g);if(!s)return d(null,b);u(b)}function Ga(a,b,c){c=c||y;ha(a,b,function(a,b){if(a)return c(a);c(null,!!b)})}function Ha(a,b,c){c=c||y;ia(a, +b,function(a,b){if(a)return c(a);c(null,!!b)})}function Ia(a,b,c,d){d=d||y;ja(a,b,c,function(a,b){if(a)return d(a);d(null,!!b)})}function Ja(a,b){return B(a)?0===a.length?(b(null),!1):!0:(b(Error("First argument to waterfall must be an array of functions")),!1)}function ka(a,b,c){switch(b.length){case 0:case 1:return a(c);case 2:return a(b[1],c);case 3:return a(b[1],b[2],c);case 4:return a(b[1],b[2],b[3],c);case 5:return a(b[1],b[2],b[3],b[4],c);case 6:return a(b[1],b[2],b[3],b[4],b[5],c);default:return b= +I(b,1),b.push(c),a.apply(null,b)}}function Ka(a,b){function c(c,h){if(c)r=z,b=E(b),b(c);else if(++d===f){r=z;var k=b;b=z;2===arguments.length?k(c,h):k.apply(null,G(arguments))}else g=a[d],l=arguments,e?C(r):(e=!0,r()),e=!1}b=b||y;if(Ja(a,b)){var d=0,e=!1,f=a.length,g=a[d],l=[],r=function(){switch(g.length){case 0:try{c(null,g())}catch(a){c(a)}break;case 1:return g(c);case 2:return g(l[1],c);case 3:return g(l[1],l[2],c);case 4:return g(l[1],l[2],l[3],c);case 5:return g(l[1],l[2],l[3],l[4],c);default:return l= +I(l,1),l[g.length-1]=c,g.apply(null,l)}};r()}}function La(){var a=G(arguments);return function(){var b=this,c=G(arguments),d=c[c.length-1];"function"===typeof d?c.pop():d=y;X(a,c,function(a,c,d){a.push(function(a){var b=I(arguments,1);d(a,b)});c.apply(b,a)},function(a,c){c=B(c)?c:[c];c.unshift(a);d.apply(b,c)})}}function Ma(a){return function(b){var c=function(){var c=this,d=G(arguments),g=d.pop()||y;return a(b,function(a,b){a.apply(c,d.concat([b]))},g)};if(1c)throw Error("Concurrency must not be zero");var h=0,k=[],m,q,p={_tasks:new M,concurrency:c,payload:d,saturated:y,unsaturated:y,buffer:c/4,empty:y,drain:y,error:y,started:!1,paused:!1,push:function(a,b){f(a,b)},kill:function(){p.drain=y;p._tasks.empty()}, +unshift:function(a,b){f(a,b,!0)},remove:function(a){p._tasks.remove(a)},process:a?l:r,length:function(){return p._tasks.length},running:function(){return h},workersList:function(){return k},idle:function(){return 0===p.length()+h},pause:function(){p.paused=!0},resume:function(){!1!==p.paused&&(p.paused=!1,K(p.concurrency=arguments.length?f:I(arguments,1);if(a){r=g=0;s.length=0;var k=L(l);k[b]=f;b=null;var h=c;c=y;h(a,k)}else r--,g--,l[b]=f,e(b),b=null}function p(){0===--t&& +s.push([n,u,d])}var n,u;if(B(a)){var t=a.length-1;n=a[t];u=t;if(0===t)s.push([n,u,d]);else for(var v=-1;++v=arguments.length)return c(a,e);var f=G(arguments);return c.apply(null,f)}b(d)}function e(){b(f)}function f(a,b){if(++s===g||!a||r&&!r(a)){if(2>=arguments.length)return c(a,b);var d=G(arguments);return c.apply(null,d)}setTimeout(e,l(s))}var g,l,r,s=0;if(3>arguments.length&&"function"===typeof a)c=b||y,b=a,a=null,g=5;else switch(c=c||y,typeof a){case "object":"function"===typeof a.errorFilter&&(r=a.errorFilter);var h=a.interval;switch(typeof h){case "function":l=h;break;case "string":case "number":l= +(h=+h)?function(){return h}:function(){return 0}}g=+a.times||5;break;case "number":g=a||5;break;case "string":g=+a||5;break;default:throw Error("Invalid arguments for async.retry");}if("function"!==typeof b)throw Error("Invalid arguments for async.retry");l?b(f):b(d)}function Oa(a){return function(){var b=G(arguments),c=b.pop(),d;try{d=a.apply(this,b)}catch(e){return c(e)}d&&"function"===typeof d.then?d.then(function(a){try{c(null,a)}catch(b){C(Pa,b)}},function(a){a=a&&a.message?a:Error(a);try{c(a, +void 0)}catch(b){C(Pa,b)}}):c(null,d)}}function Pa(a){throw a;}function Qa(a){return function(){function b(a,b){if(a)return c(null,{error:a});2=arguments.length?c: +I(arguments,1),a=null,++r===f&&d(null,l))}}d=d||y;var f,g,l,r=0;B(c)?(f=c.length,l=Array(f),a(c,e)):c&&"object"===typeof c&&(g=F(c),f=g.length,l={},b(c,e,g));f||d(null,l)}}(function(a,b){for(var c=-1,d=a.length;++cb)return d(null,[]);t=Array(k);K(b>k?k:b,v)},mapValues:eb,mapValuesSeries:function(a,b,c){function d(){k=v;b(a[v],s)}function e(){k=v;b(a[v],v,s)}function f(){k=v;p=q.next().value;b(p,s)}function g(){k=v;p=q.next().value;b(p,v,s)}function l(){k=m[v];b(a[k],s)}function r(){k=m[v];b(a[k],k,s)}function s(a,b){a? +(n=z,c=E(c),c(a,L(t))):(t[k]=b,++v===h?(n=z,c(null,t),c=z):u?C(n):(u=!0,n()),u=!1)}c=c||y;var h,k,m,q,p,n,u=!1,t={},v=0;B(a)?(h=a.length,n=3===b.length?e:d):a&&(x&&a[x]?(h=a.size,q=a[x](),n=3===b.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,n=3===b.length?r:l));if(!h)return c(null,t);n()},mapValuesLimit:function(a,b,c,d){function e(){m=A++;mb)return d(null,w);K(b>k?k:b,t)},filter:Sa,filterSeries:Ta, +filterLimit:Ua,select:Sa,selectSeries:Ta,selectLimit:Ua,reject:fb,rejectSeries:gb,rejectLimit:hb,detect:ha,detectSeries:ia,detectLimit:ja,find:ha,findSeries:ia,findLimit:ja,pick:ib,pickSeries:jb,pickLimit:kb,omit:lb,omitSeries:mb,omitLimit:nb,reduce:X,inject:X,foldl:X,reduceRight:Fa,foldr:Fa,transform:ob,transformSeries:function(a,b,c,d){function e(){c(u,a[v],h)}function f(){c(u,a[v],v,h)}function g(){c(u,p.next().value,h)}function l(){c(u,p.next().value,v,h)}function r(){c(u,a[q[v]],h)}function s(){m= +q[v];c(u,a[m],m,h)}function h(a,b){a?d(a,u):++v===k?(n=z,d(null,u)):!1===b?(n=z,d(null,u)):t?C(n):(t=!0,n());t=!1}3===arguments.length&&(d=c,c=b,b=void 0);d=E(d||y);var k,m,q,p,n,u,t=!1,v=0;B(a)?(k=a.length,u=void 0!==b?b:[],n=4===c.length?f:e):a&&(x&&a[x]?(k=a.size,p=a[x](),u=void 0!==b?b:{},n=4===c.length?l:g):"object"===typeof a&&(q=F(a),k=q.length,u=void 0!==b?b:{},n=4===c.length?s:r));if(!k)return d(null,void 0!==b?b:u||{});n()},transformLimit:function(a,b,c,d,e){function f(){q=z++;qb)return e(null,void 0!==c?c:w||{});K(b>m?m:b,v)},sortBy:pb,sortBySeries:function(a,b,c){function d(){m=a[w];b(m,s)}function e(){m=a[w];b(m,w,s)}function f(){m=p.next().value;n[w]=m;b(m,s)}function g(){m=p.next().value;n[w]=m;b(m,w,s)}function l(){m=a[q[w]];n[w]=m;b(m,s)}function r(){k=q[w];m=a[k];n[w]=m;b(m,k,s)} +function s(a,b){u[w]=b;a?c(a):++w===h?(t=z,c(null,$(n,u))):v?C(t):(v=!0,t());v=!1}c=E(c||y);var h,k,m,q,p,n,u,t,v=!1,w=0;B(a)?(h=a.length,n=a,u=Array(h),t=3===b.length?e:d):a&&(x&&a[x]?(h=a.size,n=Array(h),u=Array(h),p=a[x](),t=3===b.length?g:f):"object"===typeof a&&(q=F(a),h=q.length,n=Array(h),u=Array(h),t=3===b.length?r:l));if(!h)return c(null,[]);t()},sortByLimit:function(a,b,c,d){function e(){Db)return d(null,[]);w=Array(k);K(b>k?k:b,A)},some:Ga,someSeries:Ha,someLimit:Ia,any:Ga,anySeries:Ha,anyLimit:Ia,every:Va,everySeries:Wa,everyLimit:Xa,all:Va,allSeries:Wa,allLimit:Xa,concat:qb,concatSeries:function(a,b,c){function d(){b(a[v],s)}function e(){b(a[v],v,s)}function f(){b(q.next().value,s)}function g(){p=q.next().value;b(p,v,s)}function l(){b(a[m[v]],s)}function r(){k=m[v];b(a[k],k,s)}function s(a,b){B(b)?U.apply(t,b): +2<=arguments.length&&U.apply(t,I(arguments,1));a?c(a,t):++v===h?(n=z,c(null,t)):u?C(n):(u=!0,n());u=!1}c=E(c||y);var h,k,m,q,p,n,u=!1,t=[],v=0;B(a)?(h=a.length,n=3===b.length?e:d):a&&(x&&a[x]?(h=a.size,q=a[x](),n=3===b.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,n=3===b.length?r:l));if(!h)return c(null,t);n()},concatLimit:function(a,b,c,d){function e(){tb)return d(null,[]);var A=Array(k);K(b>k?k:b,n)},groupBy:rb,groupBySeries:function(a,b,c){function d(){m=a[t];b(m,s)}function e(){m=a[t];b(m,t,s)}function f(){m=p.next().value;b(m,s)}function g(){m=p.next().value;b(m,t,s)}function l(){m=a[q[t]];b(m,s)}function r(){k=q[t];m=a[k];b(m,k,s)}function s(a,b){if(a)n=z,c=E(c),c(a,L(v));else{var d=v[b];d?d.push(m):v[b]=[m];++t===h?(n=z,c(null,v)):u? +C(n):(u=!0,n());u=!1}}c=E(c||y);var h,k,m,q,p,n,u=!1,t=0,v={};B(a)?(h=a.length,n=3===b.length?e:d):a&&(x&&a[x]?(h=a.size,p=a[x](),n=3===b.length?g:f):"object"===typeof a&&(q=F(a),h=q.length,n=3===b.length?r:l));if(!h)return c(null,v);n()},groupByLimit:function(a,b,c,d){function e(){Ab)return d(null,D);K(b>k?k:b,v)},parallel:sb,series:function(a,b){function c(){g= +k;a[k](e)}function d(){g=l[k];a[g](e)}function e(a,c){a?(s=z,b=E(b),b(a,r)):(r[g]=2>=arguments.length?c:I(arguments,1),++k===f?(s=z,b(null,r)):h?C(s):(h=!0,s()),h=!1)}b=b||y;var f,g,l,r,s,h=!1,k=0;if(B(a))f=a.length,r=Array(f),s=c;else if(a&&"object"===typeof a)l=F(a),f=l.length,r={},s=d;else return b(null);if(!f)return b(null,r);s()},parallelLimit:function(a,b,c){function d(){l=q++;if(l=arguments.length?d:I(arguments,1),a=null,++p===g?c(null,h):m?C(k):(m=!0,k()),m=!1)}}c=c||y;var g,l,r,s,h,k,m=!1,q=0,p=0;B(a)?(g=a.length,h=Array(g),k=d):a&&"object"===typeof a&&(s=F(a),g=s.length,h={},k=e);if(!g||isNaN(b)||1>b)return c(null,h);K(b>g?g:b,k)},tryEach:function(a,b){function c(){a[r](e)}function d(){a[g[r]](e)}function e(a,c){a?++r===f?b(a):l():2>=arguments.length?b(null,c):b(null,I(arguments,1))}b=b||y;var f,g,l,r=0;B(a)?(f=a.length,l=c):a&&"object"===typeof a&& +(g=F(a),f=g.length,l=d);if(!f)return b(null);l()},waterfall:function(a,b){function c(){ka(e,f,d(e))}function d(h){return function(k,m){void 0===h&&(b=y,z());h=void 0;k?(g=b,b=z,g(k)):++r===s?(g=b,b=z,2>=arguments.length?g(k,m):g.apply(null,G(arguments))):(l?(f=arguments,e=a[r]||z,C(c)):(l=!0,ka(a[r]||z,arguments,d(r))),l=!1)}}b=b||y;if(Ja(a,b)){var e,f,g,l,r=0,s=a.length;ka(a[0],[],d(0))}},angelFall:Ka,angelfall:Ka,whilst:function(a,b,c){function d(){g?C(e):(g=!0,b(f));g=!1}function e(){b(f)}function f(b, +e){if(b)return c(b);2>=arguments.length?a(e)?d():c(null,e):(e=I(arguments,1),a.apply(null,e)?d():c.apply(null,[null].concat(e)))}c=c||y;var g=!1;a()?d():c(null)},doWhilst:function(a,b,c){function d(){g?C(e):(g=!0,a(f));g=!1}function e(){a(f)}function f(a,e){if(a)return c(a);2>=arguments.length?b(e)?d():c(null,e):(e=I(arguments,1),b.apply(null,e)?d():c.apply(null,[null].concat(e)))}c=c||y;var g=!1;e()},until:function(a,b,c){function d(){g?C(e):(g=!0,b(f));g=!1}function e(){b(f)}function f(b,e){if(b)return c(b); +2>=arguments.length?a(e)?c(null,e):d():(e=I(arguments,1),a.apply(null,e)?c.apply(null,[null].concat(e)):d())}c=c||y;var g=!1;a()?c(null):d()},doUntil:function(a,b,c){function d(){g?C(e):(g=!0,a(f));g=!1}function e(){a(f)}function f(a,e){if(a)return c(a);2>=arguments.length?b(e)?c(null,e):d():(e=I(arguments,1),b.apply(null,e)?c.apply(null,[null].concat(e)):d())}c=c||y;var g=!1;e()},during:function(a,b,c){function d(a,d){if(a)return c(a);d?b(e):c(null)}function e(b){if(b)return c(b);a(d)}c=c||y;a(d)}, +doDuring:function(a,b,c){function d(b,d){if(b)return c(b);d?a(e):c(null)}function e(a,e){if(a)return c(a);switch(arguments.length){case 0:case 1:b(d);break;case 2:b(e,d);break;default:var l=I(arguments,1);l.push(d);b.apply(null,l)}}c=c||y;d(null,!0)},forever:function(a,b){function c(){a(d)}function d(a){if(a){if(b)return b(a);throw a;}e?C(c):(e=!0,c());e=!1}var e=!1;c()},compose:function(){return La.apply(null,Ya(arguments))},seq:La,applyEach:tb,applyEachSeries:ub,queue:function(a,b){return la(!0, +a,b)},priorityQueue:function(a,b){var c=la(!0,a,b);c.push=function(a,b,f){c.started=!0;b=b||0;var g=B(a)?a:[a],l=g.length;if(void 0===a||0===l)c.idle()&&C(c.drain);else{f="function"===typeof f?f:y;for(a=c._tasks.head;a&&b>=a.priority;)a=a.next;for(;l--;){var r={data:g[l],priority:b,callback:f};a?c._tasks.insertBefore(a,r):c._tasks.push(r);C(c.process)}}};delete c.unshift;return c},cargo:function(a,b){return la(!1,a,1,b)},auto:Na,autoInject:function(a,b,c){var d={};S(a,function(a,b){var c,l=a.length; +if(B(a)){if(0===l)throw Error("autoInject task functions require explicit parameters.");c=G(a);l=c.length-1;a=c[l];if(0===l){d[b]=a;return}}else{if(1===l){d[b]=a;return}c=$a(a);if(0===l&&0===c.length)throw Error("autoInject task functions require explicit parameters.");l=c.length-1}c[l]=function(b,d){switch(l){case 1:a(b[c[0]],d);break;case 2:a(b[c[0]],b[c[1]],d);break;case 3:a(b[c[0]],b[c[1]],b[c[2]],d);break;default:for(var f=-1;++fa)return c(null,[]);var e=Array(a);K(a,function(a){b(a,d(a))})},timesSeries:function(a,b,c){function d(){b(l,e)}function e(b,e){f[l]=e;b?(c(b),c=z):++l>=a?(c(null,f),c=z):g?C(d):(g=!0,d());g=!1}c=c||y;a=+a;if(isNaN(a)||1>a)return c(null,[]);var f=Array(a),g=!1,l=0;d()},timesLimit:function(a,b,c,d){function e(){var b= +r++;b=a?(d(null,g),d=z):l?C(e):(l=!0,e());l=!1}}d=d||y;a=+a;if(isNaN(a)||1>a||isNaN(b)||1>b)return d(null,[]);var g=Array(a),l=!1,r=0,s=0;K(b>a?a:b,e)},race:function(a,b){b=H(b||y);var c,d,e=-1;if(B(a))for(c=a.length;++e