diff --git a/bower.json b/bower.json index 1c1a3285..dcb328c0 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "neo-async", "main": "lib/async.js", - "version": "2.6.0", + "version": "2.6.1", "homepage": "https://github.com/suguru03/neo-async", "authors": [ "Suguru Motegi" diff --git a/dist/async.js b/dist/async.js index cfb3691c..45d86761 100644 --- a/dist/async.js +++ b/dist/async.js @@ -1,12 +1,14 @@ -(function (global, factory) { +(function(global, factory) { /*jshint -W030 */ 'use strict'; - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - global.async ? factory(global.neo_async = global.neo_async || {}) : - factory(global.async = global.async || {}); -}(this, function(exports) { - + typeof exports === 'object' && typeof module !== 'undefined' + ? factory(exports) + : typeof define === 'function' && define.amd + ? define(['exports'], factory) + : global.async + ? factory((global.neo_async = global.neo_async || {})) + : factory((global.async = global.async || {})); +})(this, function(exports) { 'use strict'; var noop = function noop() {}; @@ -1964,11 +1966,11 @@ var dir = createLogger('dir'); /** - * @version 2.6.0 + * @version 2.6.1 * @namespace async */ var index = { - VERSION: '2.6.0', + VERSION: '2.6.1', // Collections each: each, @@ -2095,9 +2097,13 @@ }; exports['default'] = index; - baseEachSync(index, function(func, key) { - exports[key] = func; - }, nativeKeys(index)); + baseEachSync( + index, + function(func, key) { + exports[key] = func; + }, + nativeKeys(index) + ); /** * @private @@ -2181,7 +2187,6 @@ return result; } - /** * Create an array with all falsey values removed. * @@ -2241,7 +2246,7 @@ var index = -1; var size = array.length; - while(++index < size) { + while (++index < size) { if (array[index] === target) { return false; } @@ -2832,7 +2837,6 @@ * @param {Function} baseEach */ function createEach(arrayEach, baseEach, symbolEach) { - return function each(collection, iterator, callback) { callback = once(callback || noop); var size, keys; @@ -2874,7 +2878,6 @@ * @param {Function} symbolEach */ function createMap(arrayEach, baseEach, symbolEach, useArray) { - var init, clone; if (useArray) { init = Array; @@ -2940,7 +2943,6 @@ * @param {boolean} bool */ function createFilter(arrayEach, baseEach, symbolEach, bool) { - return function(collection, iterator, callback) { callback = callback || noop; var size, keys, result; @@ -2993,7 +2995,6 @@ * @param {boolean} bool */ function createFilterSeries(bool) { - return function(collection, iterator, callback) { callback = onlyOnce(callback || noop); var size, key, value, keys, iter, item, iterate; @@ -3080,7 +3081,6 @@ * @param {boolean} bool */ function createFilterLimit(bool) { - return function(collection, limit, iterator, callback) { callback = callback || noop; var size, index, key, value, keys, iter, item, iterate, result; @@ -3129,7 +3129,7 @@ if (item.done === false) { value = item.value; iterator(value, createCallback(value, started++)); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null, compact(result)); } @@ -3140,7 +3140,7 @@ if (item.done === false) { value = item.value; iterator(value, started, createCallback(value, started++)); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null, compact(result)); } @@ -3478,8 +3478,9 @@ function symbolIterator() { item = iter.next(); if (item.done === false) { + started++; iterator(item.value, done); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null); } @@ -3489,7 +3490,7 @@ item = iter.next(); if (item.done === false) { iterator(item.value, started++, done); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null); } @@ -3792,7 +3793,7 @@ item = iter.next(); if (item.done === false) { iterator(item.value, createCallback(started++)); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null, result); } @@ -3802,7 +3803,7 @@ item = iter.next(); if (item.done === false) { iterator(item.value, started, createCallback(started++)); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null, result); } @@ -4118,7 +4119,7 @@ item = iter.next(); if (item.done === false) { iterator(item.value, createCallback(started++)); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null, result); } @@ -4128,7 +4129,7 @@ item = iter.next(); if (item.done === false) { iterator(item.value, started, createCallback(started++)); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null, result); } @@ -4185,7 +4186,6 @@ * @param {boolean} bool */ function createDetect(arrayEach, baseEach, symbolEach, bool) { - return function(collection, iterator, callback) { callback = callback || noop; var size, keys; @@ -4233,7 +4233,6 @@ * @param {boolean} bool */ function createDetectSeries(bool) { - return function(collection, iterator, callback) { callback = onlyOnce(callback || noop); var size, key, value, keys, iter, item, iterate; @@ -4316,7 +4315,6 @@ * @param {boolean} bool */ function createDetectLimit(bool) { - return function(collection, limit, iterator, callback) { callback = callback || noop; var size, index, key, value, keys, iter, item, iterate; @@ -4361,9 +4359,10 @@ function symbolIterator() { item = iter.next(); if (item.done === false) { + started++; value = item.value; iterator(value, createCallback(value)); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null); } @@ -4374,7 +4373,7 @@ if (item.done === false) { value = item.value; iterator(value, started++, createCallback(value)); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null); } @@ -4433,7 +4432,6 @@ * @param {boolean} bool */ function createPick(arrayEach, baseEach, symbolEach, bool) { - return function(collection, iterator, callback) { callback = callback || noop; var size, keys; @@ -4484,7 +4482,6 @@ * @param {boolean} bool */ function createPickSeries(bool) { - return function(collection, iterator, callback) { callback = onlyOnce(callback || noop); var size, key, value, keys, iter, item, iterate; @@ -4510,7 +4507,6 @@ } iterate(); - function arrayIterator() { key = completed; value = collection[completed]; @@ -4576,7 +4572,6 @@ * @param {boolean} bool */ function createPickLimit(bool) { - return function(collection, limit, iterator, callback) { callback = callback || noop; var size, index, key, value, keys, iter, item, iterate; @@ -4624,7 +4619,7 @@ if (item.done === false) { value = item.value; iterator(value, createCallback(value, started++)); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null, result); } @@ -4635,7 +4630,7 @@ if (item.done === false) { value = item.value; iterator(value, started, createCallback(value, started++)); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null, result); } @@ -4763,7 +4758,7 @@ */ function reduce(collection, result, iterator, callback) { callback = onlyOnce(callback || noop); - var size, key, keys, iter, iterate; + var size, key, keys, iter, item, iterate; var sync = false; var completed = 0; @@ -4772,7 +4767,7 @@ iterate = iterator.length === 4 ? arrayIteratorWithIndex : arrayIterator; } else if (!collection) { } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = collection.size; + size = Infinity; iter = collection[iteratorSymbol](); iterate = iterator.length === 4 ? symbolIteratorWithKey : symbolIterator; } else if (typeof collection === obj) { @@ -4793,12 +4788,14 @@ iterator(result, collection[completed], completed, done); } - function symbolIterator() { - iterator(result, iter.next().value, done); + function symbolIterator(result) { + item = iter.next(); + item.done ? callback(null, result) : iterator(result, item.value, done); } - function symbolIteratorWithKey() { - iterator(result, iter.next().value, completed, done); + function symbolIteratorWithKey(result) { + item = iter.next(); + item.done ? callback(null, result) : iterator(result, item.value, completed, done); } function objectIterator(result) { @@ -4910,14 +4907,14 @@ iterate = iterator.length === 4 ? arrayIteratorWithIndex : arrayIterator; } else if (!collection) { } else if (iteratorSymbol && collection[iteratorSymbol]) { - resIndex = collection.size; - col = Array(resIndex); + col = []; iter = collection[iteratorSymbol](); index = -1; while ((item = iter.next()).done === false) { col[++index] = item.value; } collection = col; + resIndex = col.length; iterate = iterator.length === 4 ? arrayIteratorWithIndex : arrayIterator; } else if (typeof collection === obj) { keys = nativeKeys(collection); @@ -4971,7 +4968,6 @@ * @param {Function} symbolEach */ function createTransform(arrayEach, baseEach, symbolEach) { - return function transform(collection, accumulator, iterator, callback) { if (arguments.length === 3) { callback = iterator; @@ -5108,7 +5104,7 @@ iterate = iterator.length === 4 ? arrayIteratorWithIndex : arrayIterator; } else if (!collection) { } else if (iteratorSymbol && collection[iteratorSymbol]) { - size = collection.size; + size = Infinity; iter = collection[iteratorSymbol](); result = accumulator !== undefined ? accumulator : {}; iterate = iterator.length === 4 ? symbolIteratorWithKey : symbolIterator; @@ -5293,8 +5289,9 @@ function symbolIterator() { item = iter.next(); if (item.done === false) { + started++; iterator(result, item.value, onlyOnce(done)); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null, result); } @@ -5304,7 +5301,7 @@ item = iter.next(); if (item.done === false) { iterator(result, item.value, started++, onlyOnce(done)); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null, result); } @@ -5350,7 +5347,6 @@ * @param {function} symbolEach */ function createSortBy(arrayEach, baseEach, symbolEach) { - return function sortBy(collection, iterator, callback) { callback = callback || noop; var size, array, criteria; @@ -5682,7 +5678,7 @@ value = item.value; array[started] = value; iterator(value, createCallback(value, started++)); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null, sortByCriteria(array, criteria)); } @@ -5694,7 +5690,7 @@ value = item.value; array[started] = value; iterator(value, started, createCallback(value, started++)); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null, sortByCriteria(array, criteria)); } @@ -5999,7 +5995,6 @@ * @param {Function} symbolEach */ function createEvery(arrayEach, baseEach, symbolEach) { - var deny = createDetect(arrayEach, baseEach, symbolEach, false); return function every(collection, iterator, callback) { @@ -6019,7 +6014,6 @@ * @private */ function createEverySeries() { - var denySeries = createDetectSeries(false); return function everySeries(collection, iterator, callback) { @@ -6039,7 +6033,6 @@ * @private */ function createEveryLimit() { - var denyLimit = createDetectLimit(false); return function everyLimit(collection, limit, iterator, callback) { @@ -6062,7 +6055,6 @@ * @param {Function} symbolEach */ function createConcat(arrayEach, baseEach, symbolEach) { - return function concat(collection, iterator, callback) { callback = callback || noop; var size, result; @@ -6383,7 +6375,7 @@ item = iter.next(); if (item.done === false) { iterator(item.value, createCallback(started++)); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null, makeConcatResult(result)); } @@ -6393,7 +6385,7 @@ item = iter.next(); if (item.done === false) { iterator(item.value, started, createCallback(started++)); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null, makeConcatResult(result)); } @@ -6464,7 +6456,6 @@ * @param {Function} symbolEach */ function createGroupBy(arrayEach, baseEach, symbolEach) { - return function groupBy(collection, iterator, callback) { callback = callback || noop; var size; @@ -6783,9 +6774,10 @@ function symbolIterator() { item = iter.next(); if (item.done === false) { + started++; value = item.value; iterator(value, createCallback(value)); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null, result); } @@ -6796,7 +6788,7 @@ if (item.done === false) { value = item.value; iterator(value, started++, createCallback(value)); - } else if (completed >= collection.size && iterator !== noop) { + } else if (completed === started && iterator !== noop) { iterator = noop; callback(null, result); } @@ -6855,7 +6847,6 @@ * @param {Function} baseEach */ function createParallel(arrayEach, baseEach) { - return function parallel(tasks, callback) { callback = callback || noop; var size, keys, result; @@ -7268,7 +7259,6 @@ return true; } - /** * check for waterfall tasks * @private @@ -7298,7 +7288,6 @@ } } - /** * @memberof async * @namespace waterfall @@ -7810,11 +7799,10 @@ * @memberof async * @namespace seq */ - function seq( /* functions... */ ) { + function seq(/* functions... */) { var fns = createArray(arguments); return function() { - var self = this; var args = createArray(arguments); var callback = args[args.length - 1]; @@ -7843,9 +7831,7 @@ } function createApplyEach(func) { - - return function applyEach(fns /* arguments */ ) { - + return function applyEach(fns /* arguments */) { var go = function() { var self = this; var args = createArray(arguments); @@ -7880,7 +7866,7 @@ if (prev) { prev.next = next; } else { - this.head = next; + this.head = next; } if (next) { next.prev = prev; @@ -7934,7 +7920,7 @@ }; DLL.prototype.shift = function() { - return this.head && this._removeLink(this.head); + return this.head && this._removeLink(this.head); }; DLL.prototype.splice = function(end) { @@ -7948,7 +7934,7 @@ DLL.prototype.remove = function(test) { var node = this.head; - while(node) { + while (node) { if (test(node)) { this._removeLink(node); } @@ -8065,7 +8051,11 @@ task = tasks[taskIndex]; while (++index < size) { if (workersList[index] === task) { - workersList.splice(index, 1); + if (index === 0) { + workersList.shift(); + } else { + workersList.splice(index, 1); + } index = size; size--; } @@ -8279,7 +8269,13 @@ while (++index < dependencySize) { var dependencyName = task[index]; if (notInclude(keys, dependencyName)) { - var msg = 'async.auto task `' + key + '` has non-existent dependency `' + dependencyName + '` in ' + task.join(', '); + var msg = + 'async.auto task `' + + key + + '` has non-existent dependency `' + + dependencyName + + '` in ' + + task.join(', '); throw new Error(msg); } var taskListeners = listeners[dependencyName]; @@ -8350,7 +8346,7 @@ var FN_ARGS = /^(function)?\s*[^\(]*\(\s*([^\)]*)\)/m; var FN_ARG_SPLIT = /,/; var FN_ARG = /(=.+)?(\s*)$/; - var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; + var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm; /** * parse function arguments for `autoInject` @@ -8361,7 +8357,7 @@ func = func.toString().replace(STRIP_COMMENTS, ''); func = func.match(FN_ARGS)[2].replace(' ', ''); func = func ? func.split(FN_ARG_SPLIT) : []; - func = func.map(function (arg) { + func = func.map(function(arg) { return arg.replace(FN_ARG, '').trim(); }); return func; @@ -8420,7 +8416,7 @@ break; default: var i = -1; - while(++i < taskLength) { + while (++i < taskLength) { params[i] = results[params[i]]; } params[i] = done; @@ -8461,11 +8457,13 @@ case 'string': case 'number': interval = +interval; - intervalFunc = interval ? function() { - return interval; - } : function() { - return DEFAULT_INTERVAL; - }; + intervalFunc = interval + ? function() { + return interval; + } + : function() { + return DEFAULT_INTERVAL; + }; break; } times = +opts.times || DEFAULT_TIMES; @@ -8495,7 +8493,7 @@ } function simpleCallback(err, res) { - if (++count === times || !err || errorFilter && !errorFilter(err)) { + if (++count === times || !err || (errorFilter && !errorFilter(err))) { if (arguments.length <= 2) { return callback(err, res); } @@ -8510,7 +8508,7 @@ } function intervalCallback(err, res) { - if (++count === times || !err || errorFilter && !errorFilter(err)) { + if (++count === times || !err || (errorFilter && !errorFilter(err))) { if (arguments.length <= 2) { return callback(err, res); } @@ -8595,7 +8593,7 @@ return fn.next(); }; fn.next = function() { - return (index < size - 1) ? makeCallback(index + 1) : null; + return index < size - 1 ? makeCallback(index + 1) : null; }; return fn; } @@ -8669,7 +8667,7 @@ } function simpleApply(func, args) { - switch(args.length) { + switch (args.length) { case 0: func(); break; @@ -8940,9 +8938,11 @@ * @namespace memoize */ function memoize(fn, hasher) { - hasher = hasher || function(hash) { - return hash; - }; + hasher = + hasher || + function(hash) { + return hash; + }; var memo = {}; var queues = {}; @@ -8999,7 +8999,7 @@ * @namespace ensureAsync */ function ensureAsync(fn) { - return function( /* ...args, callback */ ) { + return function(/* ...args, callback */) { var args = createArray(arguments); var lastIndex = args.length - 1; var callback = args[lastIndex]; @@ -9025,7 +9025,7 @@ * @memberof async * @namespace constant */ - function constant( /* values... */ ) { + function constant(/* values... */) { var args = [null].concat(createArray(arguments)); return function(callback) { callback = arguments[arguments.length - 1]; @@ -9034,7 +9034,7 @@ } function asyncify(fn) { - return function( /* args..., callback */ ) { + return function(/* args..., callback */) { var args = createArray(arguments); var callback = args.pop(); var result; @@ -9044,11 +9044,14 @@ return callback(e); } if (result && typeof result.then === func) { - result.then(function(value) { - invokeCallback(callback, null, value); - }, function(err) { - invokeCallback(callback, err && err.message ? err : new Error(err)); - }); + result.then( + function(value) { + invokeCallback(callback, null, value); + }, + function(err) { + invokeCallback(callback, err && err.message ? err : new Error(err)); + } + ); } else { callback(null, result); } @@ -9074,7 +9077,7 @@ * @return {Function} */ function reflect(func) { - return function( /* args..., callback */ ) { + return function(/* args..., callback */) { var callback; switch (arguments.length) { case 1: @@ -9176,5 +9179,4 @@ createImmediate(false); return exports; } - -})); +}); diff --git a/dist/async.min.js b/dist/async.min.js index 36a35a77..ee74f08e 100644 --- a/dist/async.min.js +++ b/dist/async.min.js @@ -7,74 +7,74 @@ e=0;a=a[z]();if(3===c.length)for(;!1===(d=a.next()).done;)d=d.value,c(d,e++,b(d) c(d,e,b(e++,d));else for(;!1===(d=a.next()).done;)d=d.value,c(d,b(e++,d));return e}function ta(a,c,b,d){var e,f,g=-1,l=d.length;if(3===c.length)for(;++g=c.size&&d!==w&&(d=w,e(null,U(y)))}function q(){v=t.next();!1===v.done?(p=v.value,d(p,B,k(p,B++))):R>=c.size&&d!==w&&(d=w,e(null,U(y)))}function s(){r=B++;rb)return e(null,[]);y=y||Array(m);K(b>m?m:b,x)}}function Y(a,c,b){function d(){c(a[t],s)}function e(){c(a[t],t,s)}function f(){n=r.next();n.done?b(null):c(n.value,s)}function g(){n=r.next();n.done?b(null):c(n.value,t,s)}function l(){c(a[m[t]],s)}function q(){k=m[t];c(a[k],k,s)}function s(a,d){a?b(a):++t===h||!1===d?(p=A,b(null)): -u?D(p):(u=!0,p());u=!1}b=E(b||w);var h,k,m,r,n,p,u=!1,t=0;C(a)?(h=a.length,p=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,r=a[z](),p=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,p=3===c.length?q:l));if(!h)return b(null);p()}function Z(a,c,b,d){function e(){x=a.size&&b!==w&&(b=w,d(null))}function l(){u=p.next();!1===u.done?b(u.value,x++,h):y>=a.size&&b!==w&&(b=w,d(null))}function q(){x< -k&&b(a[n[x++]],h)}function s(){m=x++;mc)return d(null);K(c>k?k:c,t)}function za(a,c,b){function d(){c(a[v],s)}function e(){c(a[v],v,s)}function f(){n= -r.next();n.done?b(null,p):c(n.value,s)}function g(){n=r.next();n.done?b(null,p):c(n.value,v,s)}function l(){c(a[m[v]],s)}function q(){k=m[v];c(a[k],k,s)}function s(a,d){a?(u=A,b=E(b),b(a,H(p))):(p[v]=d,++v===h?(u=A,b(null,p),b=A):t?D(u):(t=!0,u()),t=!1)}b=b||w;var h,k,m,r,n,p,u,t=!1,v=0;C(a)?(h=a.length,u=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,p=[],r=a[z](),u=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,u=3===c.length?q:l));if(!h)return b(null,[]);p=p||Array(h);u()}function Aa(a,c, -b,d){return function(e,f,g){function l(a){var b=!1;return function(c,e){b&&A();b=!0;c?(g=I(g),g(c)):!!e===d?(g=I(g),g(null,a)):++h===q&&g(null)}}g=g||w;var q,s,h=0;C(e)?(q=e.length,a(e,f,l)):e&&(z&&e[z]?(q=b(e,f,l))&&q===h&&g(null):"object"===typeof e&&(s=F(e),q=s.length,c(e,f,l,s)));q||g(null)}}function Ba(a){return function(c,b,d){function e(){r=c[x];b(r,h)}function f(){r=c[x];b(r,x,h)}function g(){u=p.next();r=u.value;u.done?d(null):b(r,h)}function l(){u=p.next();r=u.value;u.done?d(null):b(r,x, -h)}function q(){r=c[n[x]];b(r,h)}function s(){m=n[x];r=c[m];b(r,m,h)}function h(b,c){b?d(b):!!c===a?(t=A,d(null,r)):++x===k?(t=A,d(null)):v?D(t):(v=!0,t());v=!1}d=E(d||w);var k,m,r,n,p,u,t,v=!1,x=0;C(c)?(k=c.length,t=3===b.length?f:e):c&&(z&&c[z]?(k=Infinity,p=c[z](),t=3===b.length?l:g):"object"===typeof c&&(n=F(c),k=n.length,t=3===b.length?s:q));if(!k)return d(null);t()}}function Ca(a){return function(c,b,d,e){function f(){r=G++;r=c.size&&d!==w&&(d=w,e(null))}function q(){v=t.next();!1===v.done?(p=v.value,d(p,G++,k(p))):B>=c.size&&d!==w&&(d=w,e(null))}function s(){r=G++;rb)return e(null);K(b>m?m:b,x)}}function Da(a,c,b,d){return function(e,f,g){function l(a,b){return function(c,e){null===a&&A();c?(a=null,g=I(g),g(c,L(k))):(!!e===d&&(k[a]=b),a=null,++h===q&&g(null,k))}}g=g||w;var q,s,h=0,k={};C(e)?(q=e.length,a(e,f,l)):e&&(z&&e[z]?(q=b(e,f,l))&&q===h&&g(null,k):"object"===typeof e&&(s=F(e),q=s.length,c(e,f,l,s)));if(!q)return g(null, -{})}}function Ea(a){return function(c,b,d){function e(){m=y;r=c[y];b(r,h)}function f(){m=y;r=c[y];b(r,y,h)}function g(){m=y;u=p.next();r=u.value;u.done?d(null,x):b(r,h)}function l(){m=y;u=p.next();r=u.value;u.done?d(null,x):b(r,m,h)}function q(){m=n[y];r=c[m];b(r,h)}function s(){m=n[y];r=c[m];b(r,m,h)}function h(b,c){b?d(b,x):(!!c===a&&(x[m]=r),++y===k?(t=A,d(null,x)):v?D(t):(v=!0,t()),v=!1)}d=E(d||w);var k,m,r,n,p,u,t,v=!1,x={},y=0;C(c)?(k=c.length,t=3===b.length?f:e):c&&(z&&c[z]?(k=Infinity,p=c[z](), -t=3===b.length?l:g):"object"===typeof c&&(n=F(c),k=n.length,t=3===b.length?s:q));if(!k)return d(null,{});t()}}function Fa(a){return function(c,b,d,e){function f(){r=B++;r=c.size&&d!==w&&(d=w,e(null,G))}function q(){v=t.next();!1===v.done?(p=v.value,d(p,B,k(p,B++))):R>=c.size&&d!==w&&(d=w,e(null,G))}function s(){Bb)return e(null,{});K(b>m?m:b,x)}}function $(a,c,b,d){function e(d){b(d,a[t],h)}function f(d){b(d, -a[t],t,h)}function g(){b(c,n.next().value,h)}function l(){b(c,n.next().value,t,h)}function q(d){b(d,a[r[t]],h)}function s(d){m=r[t];b(d,a[m],m,h)}function h(a,c){a?d(a,c):++t===k?(b=A,d(null,c)):u?D(function(){p(c)}):(u=!0,p(c));u=!1}d=E(d||w);var k,m,r,n,p,u=!1,t=0;C(a)?(k=a.length,p=4===b.length?f:e):a&&(z&&a[z]?(k=a.size,n=a[z](),p=4===b.length?l:g):"object"===typeof a&&(r=F(a),k=r.length,p=4===b.length?s:q));if(!k)return d(null,c);p(c)}function Ga(a,c,b,d){function e(d){b(d,a[--s],q)}function f(d){b(d, -a[--s],s,q)}function g(d){b(d,a[m[--s]],q)}function l(d){k=m[--s];b(d,a[k],k,q)}function q(a,b){a?d(a,b):0===s?(u=A,d(null,b)):t?D(function(){u(b)}):(t=!0,u(b));t=!1}d=E(d||w);var s,h,k,m,r,n,p,u,t=!1;if(C(a))s=a.length,u=4===b.length?f:e;else if(a)if(z&&a[z]){s=a.size;p=Array(s);r=a[z]();for(h=-1;!1===(n=r.next()).done;)p[++h]=n.value;a=p;u=4===b.length?f:e}else"object"===typeof a&&(m=F(a),s=m.length,u=4===b.length?l:g);if(!s)return d(null,c);u(c)}function Ha(a,c,b){b=b||w;ja(a,c,function(a,c){if(a)return b(a); +r=c[m];b(r,h)}function s(){m=n[x];r=c[m];b(r,m,h)}function h(b,c){b?d(b):(!!c===a&&(y[y.length]=r),++x===k?(v=A,d(null,y)):t?D(v):(t=!0,v()),t=!1)}d=E(d||w);var k,m,r,n,p,u,v,t=!1,x=0,y=[];C(c)?(k=c.length,v=3===b.length?f:e):c&&(z&&c[z]?(k=Infinity,p=c[z](),v=3===b.length?l:g):"object"===typeof c&&(n=F(c),k=n.length,v=3===b.length?s:q));if(!k)return d(null,[]);v()}}function ya(a){return function(c,b,d,e){function f(){r=B++;rb)return e(null,[]);y=y||Array(m);K(b>m?m:b,x)}}function Y(a,c,b){function d(){c(a[v],s)}function e(){c(a[v],v,s)}function f(){n=r.next();n.done?b(null):c(n.value,s)}function g(){n=r.next();n.done?b(null):c(n.value,v,s)}function l(){c(a[m[v]],s)}function q(){k=m[v];c(a[k],k,s)}function s(a,d){a?b(a):++v===h||!1===d?(p=A,b(null)):u?D(p): +(u=!0,p());u=!1}b=E(b||w);var h,k,m,r,n,p,u=!1,v=0;C(a)?(h=a.length,p=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,r=a[z](),p=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,p=3===c.length?q:l));if(!h)return b(null);p()}function Z(a,c,b,d){function e(){xc)return d(null);K(c>k?k:c,v)}function za(a,c,b){function d(){c(a[t],s)}function e(){c(a[t],t,s)}function f(){n=r.next(); +n.done?b(null,p):c(n.value,s)}function g(){n=r.next();n.done?b(null,p):c(n.value,t,s)}function l(){c(a[m[t]],s)}function q(){k=m[t];c(a[k],k,s)}function s(a,d){a?(u=A,b=E(b),b(a,H(p))):(p[t]=d,++t===h?(u=A,b(null,p),b=A):v?D(u):(v=!0,u()),v=!1)}b=b||w;var h,k,m,r,n,p,u,v=!1,t=0;C(a)?(h=a.length,u=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,p=[],r=a[z](),u=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,u=3===c.length?q:l));if(!h)return b(null,[]);p=p||Array(h);u()}function Aa(a,c,b,d){return function(e, +f,g){function l(a){var b=!1;return function(c,e){b&&A();b=!0;c?(g=I(g),g(c)):!!e===d?(g=I(g),g(null,a)):++h===q&&g(null)}}g=g||w;var q,s,h=0;C(e)?(q=e.length,a(e,f,l)):e&&(z&&e[z]?(q=b(e,f,l))&&q===h&&g(null):"object"===typeof e&&(s=F(e),q=s.length,c(e,f,l,s)));q||g(null)}}function Ba(a){return function(c,b,d){function e(){r=c[x];b(r,h)}function f(){r=c[x];b(r,x,h)}function g(){u=p.next();r=u.value;u.done?d(null):b(r,h)}function l(){u=p.next();r=u.value;u.done?d(null):b(r,x,h)}function q(){r=c[n[x]]; +b(r,h)}function s(){m=n[x];r=c[m];b(r,m,h)}function h(b,c){b?d(b):!!c===a?(v=A,d(null,r)):++x===k?(v=A,d(null)):t?D(v):(t=!0,v());t=!1}d=E(d||w);var k,m,r,n,p,u,v,t=!1,x=0;C(c)?(k=c.length,v=3===b.length?f:e):c&&(z&&c[z]?(k=Infinity,p=c[z](),v=3===b.length?l:g):"object"===typeof c&&(n=F(c),k=n.length,v=3===b.length?s:q));if(!k)return d(null);v()}}function Ca(a){return function(c,b,d,e){function f(){r=G++;rb)return e(null);K(b>m?m:b,x)}}function Da(a,c,b,d){return function(e,f,g){function l(a,b){return function(c,e){null===a&&A();c?(a=null,g=I(g),g(c,L(k))):(!!e===d&&(k[a]=b),a=null,++h===q&&g(null,k))}}g=g||w;var q,s,h=0,k={};C(e)?(q=e.length,a(e,f,l)):e&&(z&&e[z]?(q=b(e,f,l))&&q===h&&g(null,k):"object"===typeof e&&(s=F(e),q=s.length,c(e,f,l,s)));if(!q)return g(null,{})}}function Ea(a){return function(c, +b,d){function e(){m=y;r=c[y];b(r,h)}function f(){m=y;r=c[y];b(r,y,h)}function g(){m=y;u=p.next();r=u.value;u.done?d(null,x):b(r,h)}function l(){m=y;u=p.next();r=u.value;u.done?d(null,x):b(r,m,h)}function q(){m=n[y];r=c[m];b(r,h)}function s(){m=n[y];r=c[m];b(r,m,h)}function h(b,c){b?d(b,x):(!!c===a&&(x[m]=r),++y===k?(v=A,d(null,x)):t?D(v):(t=!0,v()),t=!1)}d=E(d||w);var k,m,r,n,p,u,v,t=!1,x={},y=0;C(c)?(k=c.length,v=3===b.length?f:e):c&&(z&&c[z]?(k=Infinity,p=c[z](),v=3===b.length?l:g):"object"===typeof c&& +(n=F(c),k=n.length,v=3===b.length?s:q));if(!k)return d(null,{});v()}}function Fa(a){return function(c,b,d,e){function f(){r=B++;rb)return e(null,{});K(b>m?m:b,x)}}function $(a,c,b,d){function e(d){b(d,a[t],h)}function f(d){b(d,a[t],t,h)}function g(a){p=n.next();p.done?d(null,a):b(a,p.value, +h)}function l(a){p=n.next();p.done?d(null,a):b(a,p.value,t,h)}function q(d){b(d,a[r[t]],h)}function s(d){m=r[t];b(d,a[m],m,h)}function h(a,c){a?d(a,c):++t===k?(b=A,d(null,c)):v?D(function(){u(c)}):(v=!0,u(c));v=!1}d=E(d||w);var k,m,r,n,p,u,v=!1,t=0;C(a)?(k=a.length,u=4===b.length?f:e):a&&(z&&a[z]?(k=Infinity,n=a[z](),u=4===b.length?l:g):"object"===typeof a&&(r=F(a),k=r.length,u=4===b.length?s:q));if(!k)return d(null,c);u(c)}function Ga(a,c,b,d){function e(d){b(d,a[--s],q)}function f(d){b(d,a[--s], +s,q)}function g(d){b(d,a[m[--s]],q)}function l(d){k=m[--s];b(d,a[k],k,q)}function q(a,b){a?d(a,b):0===s?(u=A,d(null,b)):v?D(function(){u(b)}):(v=!0,u(b));v=!1}d=E(d||w);var s,h,k,m,r,n,p,u,v=!1;if(C(a))s=a.length,u=4===b.length?f:e;else if(a)if(z&&a[z]){p=[];r=a[z]();for(h=-1;!1===(n=r.next()).done;)p[++h]=n.value;a=p;s=p.length;u=4===b.length?f:e}else"object"===typeof a&&(m=F(a),s=m.length,u=4===b.length?l:g);if(!s)return d(null,c);u(c)}function Ha(a,c,b){b=b||w;ja(a,c,function(a,c){if(a)return b(a); b(null,!!c)})}function Ia(a,c,b){b=b||w;ka(a,c,function(a,c){if(a)return b(a);b(null,!!c)})}function Ja(a,c,b,d){d=d||w;la(a,c,b,function(a,b){if(a)return d(a);d(null,!!b)})}function Ka(a,c){return C(a)?0===a.length?(c(null),!1):!0:(c(Error("First argument to waterfall must be an array of functions")),!1)}function ma(a,c,b){switch(c.length){case 0:case 1:return a(b);case 2:return a(c[1],b);case 3:return a(c[1],c[2],b);case 4:return a(c[1],c[2],c[3],b);case 5:return a(c[1],c[2],c[3],c[4],b);case 6:return a(c[1], c[2],c[3],c[4],c[5],b);default:return c=J(c,1),c.push(b),a.apply(null,c)}}function La(a,c){function b(b,h){if(b)q=A,c=E(c),c(b);else if(++d===f){q=A;var k=c;c=A;2===arguments.length?k(b,h):k.apply(null,H(arguments))}else g=a[d],l=arguments,e?D(q):(e=!0,q()),e=!1}c=c||w;if(Ka(a,c)){var d=0,e=!1,f=a.length,g=a[d],l=[],q=function(){switch(g.length){case 0:try{b(null,g())}catch(a){b(a)}break;case 1:return g(b);case 2:return g(l[1],b);case 3:return g(l[1],l[2],b);case 4:return g(l[1],l[2],l[3],b);case 5:return g(l[1], l[2],l[3],l[4],b);default:return l=J(l,1),l[g.length-1]=b,g.apply(null,l)}};q()}}function Ma(){var a=H(arguments);return function(){var c=this,b=H(arguments),d=b[b.length-1];"function"===typeof d?b.pop():d=w;$(a,b,function(a,b,d){a.push(function(a){var b=J(arguments,1);d(a,b)});b.apply(c,a)},function(a,b){b=C(b)?b:[b];b.unshift(a);d.apply(c,b)})}}function Na(a){return function(c){var b=function(){var b=this,d=H(arguments),g=d.pop()||w;return a(c,function(a,c){a.apply(b,d.concat([c]))},g)};if(1b)throw Error("Concurrency must not be zero");var h=0,k=[],m,r,n={_tasks:new M,concurrency:b,payload:d,saturated:w,unsaturated:w,buffer:b/4,empty:w,drain:w,error:w,started:!1,paused:!1,push:function(a,b){f(a,b)},kill:function(){n.drain= -w;n._tasks.empty()},unshift:function(a,b){f(a,b,!0)},remove:function(a){n._tasks.remove(a)},process:a?l:q,length:function(){return n._tasks.length},running:function(){return h},workersList:function(){return k},idle:function(){return 0===n.length()+h},pause:function(){n.paused=!0},resume:function(){!1!==n.paused&&(n.paused=!1,K(n.concurrency=arguments.length?f:J(arguments,1);if(a){q=g=0;s.length=0;var k=L(l);k[d]=f;d=null;var h=b;b=w;h(a,k)}else q--,g--,l[d]=f,e(d),d=null}function n(){0===--t&& -s.push([p,u,c])}var p,u;if(C(a)){var t=a.length-1;p=a[t];u=t;if(0===t)s.push([p,u,c]);else for(var v=-1;++v=arguments.length)return b(a,e);var f=H(arguments);return b.apply(null,f)}c(d)}function e(){c(f)}function f(a,d){if(++s===g||!a||q&&!q(a)){if(2>=arguments.length)return b(a,d);var c=H(arguments);return b.apply(null,c)}setTimeout(e,l(s))}var g,l,q,s=0;if(3>arguments.length&&"function"===typeof a)b=c||w,c=a,a=null,g=5;else switch(b=b||w,typeof a){case "object":"function"===typeof a.errorFilter&&(q=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 c)throw Error("Invalid arguments for async.retry");l?c(f):c(d)}function Pa(a){return function(){var c=H(arguments),b=c.pop(),d;try{d=a.apply(this,c)}catch(e){return b(e)}d&&"function"===typeof d.then?d.then(function(a){try{b(null,a)}catch(d){D(Qa,d)}},function(a){a=a&&a.message?a:Error(a);try{b(a, -void 0)}catch(d){D(Qa,d)}}):b(null,d)}}function Qa(a){throw a;}function Ra(a){return function(){function c(a,d){if(a)return b(null,{error:a});2=arguments.length?c:J(arguments,1),a=null,++q===f&&d(null,l))}}d=d||w;var f,g,l,q=0;C(b)?(f=b.length,l=Array(f),a(b,e)):b&&"object"===typeof b&&(g=F(b),f=g.length,l={},c(b,e,g));f||d(null,l)}}(function(a,c){for(var b=-1,d=a.length;++b=a.size&&b!==w&&(b=w,d(null,t))}function l(){u=p.next();!1===u.done?b(u.value,y,h(y++)):G>=a.size&&b!==w&&(b=w,d(null,t))}function q(){m=y++;mc)return d(null,[]);t=t||Array(k);K(c>k?k:c,v)},mapValues:fb,mapValuesSeries:function(a,c,b){function d(){k=v;c(a[v],s)}function e(){k=v;c(a[v],v,s)}function f(){k=v;n=r.next(); -n.done?b(null,t):c(n.value,s)}function g(){k=v;n=r.next();n.done?b(null,t):c(n.value,v,s)}function l(){k=m[v];c(a[k],s)}function q(){k=m[v];c(a[k],k,s)}function s(a,d){a?(p=A,b=E(b),b(a,L(t))):(t[k]=d,++v===h?(p=A,b(null,t),b=A):u?D(p):(u=!0,p()),u=!1)}b=b||w;var h,k,m,r,n,p,u=!1,t={},v=0;C(a)?(h=a.length,p=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,r=a[z](),p=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,p=3===c.length?q:l));if(!h)return b(null,t);p()},mapValuesLimit:function(a,c,b,d){function e(){m= -y++;m=a.size&&b!==w&&(b=w,d(null,x))}function l(){u=p.next();!1===u.done?b(u.value,y,h(y++)):G>=a.size&&b!==w&&(b=w,d(null,x))}function q(){m=y++;mc)return d(null,x);K(c>k?k:c,t)},filter:Ta,filterSeries:Ua,filterLimit:Va,select:Ta,selectSeries:Ua,selectLimit:Va,reject:gb,rejectSeries:hb,rejectLimit:ib,detect:ja,detectSeries:ka,detectLimit:la,find:ja,findSeries:ka,findLimit:la,pick:jb,pickSeries:kb,pickLimit:lb,omit:mb,omitSeries:nb,omitLimit:ob,reduce:$,inject:$, -foldl:$,reduceRight:Ga,foldr:Ga,transform:pb,transformSeries:function(a,c,b,d){function e(){b(t,a[x],h)}function f(){b(t,a[x],x,h)}function g(){p=n.next();p.done?d(null,t):b(t,p.value,h)}function l(){p=n.next();p.done?d(null,t):b(t,p.value,x,h)}function q(){b(t,a[r[x]],h)}function s(){m=r[x];b(t,a[m],m,h)}function h(a,b){a?d(a,t):++x===k||!1===b?(u=A,d(null,t)):v?D(u):(v=!0,u());v=!1}3===arguments.length&&(d=b,b=c,c=void 0);d=E(d||w);var k,m,r,n,p,u,t,v=!1,x=0;C(a)?(k=a.length,t=void 0!==c?c:[],u= -4===b.length?f:e):a&&(z&&a[z]?(k=a.size,n=a[z](),t=void 0!==c?c:{},u=4===b.length?l:g):"object"===typeof a&&(r=F(a),k=r.length,t=void 0!==c?c:{},u=4===b.length?s:q));if(!k)return d(null,void 0!==c?c:t||{});u()},transformLimit:function(a,c,b,d,e){function f(){r=A++;r=a.size&&d!==w&&(d=w,e(null,x))}function q(){t=u.next();!1===t.done?d(x,t.value,A++,E(k)):B>=a.size&&d!==w&&(d=w,e(null, -x))}function s(){r=A++;rc)return e(null,void 0!==b?b:x||{});K(c>m?m:c,v)},sortBy:qb,sortBySeries:function(a,c,b){function d(){m=a[y];c(m,s)}function e(){m=a[y];c(m,y,s)}function f(){p=n.next();if(p.done)return b(null,P(u,t));m=p.value;u[y]=m;c(m,s)}function g(){p=n.next();if(p.done)return b(null,P(u,t));m=p.value;u[y]=m;c(m,y,s)}function l(){m=a[r[y]];u[y]=m;c(m,s)}function q(){k=r[y];m=a[k];u[y]=m;c(m,k,s)}function s(a,d){t[y]=d;a?b(a):++y===h?(v=A,b(null,P(u,t))):x?D(v):(x=!0,v());x=!1}b=E(b||w);var h,k,m,r,n,p,u,t, -v,x=!1,y=0;C(a)?(h=a.length,u=a,t=Array(h),v=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,u=[],t=[],n=a[z](),v=3===c.length?g:f):"object"===typeof a&&(r=F(a),h=r.length,u=Array(h),t=Array(h),v=3===c.length?q:l));if(!h)return b(null,[]);v()},sortByLimit:function(a,c,b,d){function e(){B=a.size&&b!==w&&(b=w,d(null,P(p,x)))}function l(){v=t.next();!1===v.done?(n= -v.value,p[B]=n,b(n,B,h(n,B++))):E>=a.size&&b!==w&&(b=w,d(null,P(p,x)))}function q(){Bc)return d(null,[]);x=x||Array(k);K(c>k?k:c,y)},some:Ha,someSeries:Ia,someLimit:Ja,any:Ha,anySeries:Ia,anyLimit:Ja,every:Wa,everySeries:Xa,everyLimit:Ya,all:Wa,allSeries:Xa,allLimit:Ya,concat:rb,concatSeries:function(a,c,b){function d(){c(a[v],s)}function e(){c(a[v],v,s)}function f(){n=r.next();n.done?b(null,t):c(n.value,s)}function g(){n=r.next();n.done?b(null,t):c(n.value,v,s)}function l(){c(a[m[v]],s)}function q(){k=m[v];c(a[k],k,s)}function s(a,d){C(d)? -X.apply(t,d):2<=arguments.length&&X.apply(t,J(arguments,1));a?b(a,t):++v===h?(p=A,b(null,t)):u?D(p):(u=!0,p());u=!1}b=E(b||w);var h,k,m,r,n,p,u=!1,t=[],v=0;C(a)?(h=a.length,p=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,r=a[z](),p=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,p=3===c.length?q:l));if(!h)return b(null,t);p()},concatLimit:function(a,c,b,d){function e(){v=a.size&&b!== -w&&(b=w,d(null,S(u)))}function l(){n=r.next();!1===n.done?b(n.value,v,h(v++)):x>=a.size&&b!==w&&(b=w,d(null,S(u)))}function q(){vc)return d(null,[]);u=u||Array(k);K(c>k?k:c,p)},groupBy:sb,groupBySeries:function(a,c,b){function d(){m=a[v];c(m,s)}function e(){m=a[v];c(m,v,s)}function f(){p=n.next();m=p.value;p.done?b(null,x):c(m,s)}function g(){p=n.next();m=p.value;p.done?b(null,x):c(m,v,s)}function l(){m=a[r[v]];c(m, -s)}function q(){k=r[v];m=a[k];c(m,k,s)}function s(a,d){if(a)u=A,b=E(b),b(a,L(x));else{var c=x[d];c?c.push(m):x[d]=[m];++v===h?(u=A,b(null,x)):t?D(u):(t=!0,u());t=!1}}b=E(b||w);var h,k,m,r,n,p,u,t=!1,v=0,x={};C(a)?(h=a.length,u=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,n=a[z](),u=3===c.length?g:f):"object"===typeof a&&(r=F(a),h=r.length,u=3===c.length?q:l));if(!h)return b(null,x);u()},groupByLimit:function(a,c,b,d){function e(){y=a.size&&b!==w&&(b=w,d(null,B))}function l(){t=u.next();!1===t.done?(n=t.value,b(n,y++,h(n))):E>=a.size&&b!==w&&(b=w,d(null,B))}function q(){yc)return d(null,B);K(c>k?k:c,v)},parallel:tb,series:function(a,c){function b(){g=k;a[k](e)}function d(){g=l[k];a[g](e)}function e(a,b){a?(s=A,c=E(c),c(a,q)):(q[g]=2>=arguments.length?b:J(arguments,1),++k===f?(s=A,c(null,q)):h?D(s):(h=!0,s()),h=!1)}c=c||w;var f,g,l,q,s,h=!1,k=0;if(C(a))f=a.length,q=Array(f),s=b;else if(a&&"object"===typeof a)l=F(a), -f=l.length,q={},s=d;else return c(null);if(!f)return c(null,q);s()},parallelLimit:function(a,c,b){function d(){l=r++;if(l=arguments.length?c:J(arguments,1),a=null,++n===g?b(null,h):m?D(k):(m=!0,k()),m=!1)}}b=b||w;var g,l,q,s,h,k,m=!1,r=0,n=0;C(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(c)||1>c)return b(null, -h);K(c>g?g:c,k)},tryEach:function(a,c){function b(){a[q](e)}function d(){a[g[q]](e)}function e(a,b){a?++q===f?c(a):l():2>=arguments.length?c(null,b):c(null,J(arguments,1))}c=c||w;var f,g,l,q=0;C(a)?(f=a.length,l=b):a&&"object"===typeof a&&(g=F(a),f=g.length,l=d);if(!f)return c(null);l()},waterfall:function(a,c){function b(){ma(e,f,d(e))}function d(h){return function(k,m){void 0===h&&(c=w,A());h=void 0;k?(g=c,c=A,g(k)):++q===s?(g=c,c=A,2>=arguments.length?g(k,m):g.apply(null,H(arguments))):(l?(f=arguments, -e=a[q]||A,D(b)):(l=!0,ma(a[q]||A,arguments,d(q))),l=!1)}}c=c||w;if(Ka(a,c)){var e,f,g,l,q=0,s=a.length;ma(a[0],[],d(0))}},angelFall:La,angelfall:La,whilst:function(a,c,b){function d(){g?D(e):(g=!0,c(f));g=!1}function e(){c(f)}function f(c,e){if(c)return b(c);2>=arguments.length?a(e)?d():b(null,e):(e=J(arguments,1),a.apply(null,e)?d():b.apply(null,[null].concat(e)))}b=b||w;var g=!1;a()?d():b(null)},doWhilst:function(a,c,b){function d(){g?D(e):(g=!0,a(f));g=!1}function e(){a(f)}function f(a,e){if(a)return b(a); -2>=arguments.length?c(e)?d():b(null,e):(e=J(arguments,1),c.apply(null,e)?d():b.apply(null,[null].concat(e)))}b=b||w;var g=!1;e()},until:function(a,c,b){function d(){g?D(e):(g=!0,c(f));g=!1}function e(){c(f)}function f(c,e){if(c)return b(c);2>=arguments.length?a(e)?b(null,e):d():(e=J(arguments,1),a.apply(null,e)?b.apply(null,[null].concat(e)):d())}b=b||w;var g=!1;a()?b(null):d()},doUntil:function(a,c,b){function d(){g?D(e):(g=!0,a(f));g=!1}function e(){a(f)}function f(a,e){if(a)return b(a);2>=arguments.length? -c(e)?b(null,e):d():(e=J(arguments,1),c.apply(null,e)?b.apply(null,[null].concat(e)):d())}b=b||w;var g=!1;e()},during:function(a,c,b){function d(a,d){if(a)return b(a);d?c(e):b(null)}function e(c){if(c)return b(c);a(d)}b=b||w;a(d)},doDuring:function(a,c,b){function d(d,c){if(d)return b(d);c?a(e):b(null)}function e(a,e){if(a)return b(a);switch(arguments.length){case 0:case 1:c(d);break;case 2:c(e,d);break;default:var l=J(arguments,1);l.push(d);c.apply(null,l)}}b=b||w;d(null,!0)},forever:function(a,c){function b(){a(d)} -function d(a){if(a){if(c)return c(a);throw a;}e?D(b):(e=!0,b());e=!1}var e=!1;b()},compose:function(){return Ma.apply(null,Za(arguments))},seq:Ma,applyEach:ub,applyEachSeries:vb,queue:function(a,c){return na(!0,a,c)},priorityQueue:function(a,c){var b=na(!0,a,c);b.push=function(a,c,f){b.started=!0;c=c||0;var g=C(a)?a:[a],l=g.length;if(void 0===a||0===l)b.idle()&&D(b.drain);else{f="function"===typeof f?f:w;for(a=b._tasks.head;a&&c>=a.priority;)a=a.next;for(;l--;){var q={data:g[l],priority:c,callback:f}; -a?b._tasks.insertBefore(a,q):b._tasks.push(q);D(b.process)}}};delete b.unshift;return b},cargo:function(a,c){return na(!1,a,1,c)},auto:Oa,autoInject:function(a,c,b){var d={};W(a,function(a,b){var c,l=a.length;if(C(a)){if(0===l)throw Error("autoInject task functions require explicit parameters.");c=H(a);l=c.length-1;a=c[l];if(0===l){d[b]=a;return}}else{if(1===l){d[b]=a;return}c=ab(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 b(null,[]);var e=Array(a);K(a,function(a){c(a,d(a))})},timesSeries:function(a,c,b){function d(){c(l,e)}function e(c, -e){f[l]=e;c?(b(c),b=A):++l>=a?(b(null,f),b=A):g?D(d):(g=!0,d());g=!1}b=b||w;a=+a;if(isNaN(a)||1>a)return b(null,[]);var f=Array(a),g=!1,l=0;d()},timesLimit:function(a,c,b,d){function e(){var c=q++;c=a?(d(null,g),d=A):l?D(e):(l=!0,e());l=!1}}d=d||w;a=+a;if(isNaN(a)||1>a||isNaN(c)||1>c)return d(null,[]);var g=Array(a),l=!1,q=0,s=0;K(c>a?a:c,e)},race:function(a,c){c=I(c||w);var b,d,e=-1;if(C(a))for(b=a.length;++e< -b;)a[e](c);else if(a&&"object"===typeof a)for(d=F(a),b=d.length;++eb)throw Error("Concurrency must not be zero");var h=0,k=[],m,r,n={_tasks:new M,concurrency:b,payload:d,saturated:w,unsaturated:w,buffer:b/4,empty:w,drain:w,error:w,started:!1,paused:!1,push:function(a, +b){f(a,b)},kill:function(){n.drain=w;n._tasks.empty()},unshift:function(a,b){f(a,b,!0)},remove:function(a){n._tasks.remove(a)},process:a?l:q,length:function(){return n._tasks.length},running:function(){return h},workersList:function(){return k},idle:function(){return 0===n.length()+h},pause:function(){n.paused=!0},resume:function(){!1!==n.paused&&(n.paused=!1,K(n.concurrency=arguments.length?f:J(arguments,1);if(a){q=g=0;s.length=0;var k=L(l);k[d]=f;d=null;var h= +b;b=w;h(a,k)}else q--,g--,l[d]=f,e(d),d=null}function n(){0===--v&&s.push([p,u,c])}var p,u;if(C(a)){var v=a.length-1;p=a[v];u=v;if(0===v)s.push([p,u,c]);else for(var t=-1;++t=arguments.length)return b(a,e);var f=H(arguments);return b.apply(null,f)}c(d)}function e(){c(f)}function f(a,d){if(++s===g||!a||q&&!q(a)){if(2>=arguments.length)return b(a,d);var c=H(arguments);return b.apply(null,c)}setTimeout(e,l(s))}var g,l,q,s=0;if(3>arguments.length&&"function"===typeof a)b=c||w,c=a,a=null,g=5;else switch(b=b||w,typeof a){case "object":"function"===typeof a.errorFilter&&(q=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 c)throw Error("Invalid arguments for async.retry");l?c(f):c(d)}function Pa(a){return function(){var c=H(arguments),b=c.pop(),d;try{d=a.apply(this,c)}catch(e){return b(e)}d&&"function"===typeof d.then?d.then(function(a){try{b(null, +a)}catch(d){D(Qa,d)}},function(a){a=a&&a.message?a:Error(a);try{b(a,void 0)}catch(d){D(Qa,d)}}):b(null,d)}}function Qa(a){throw a;}function Ra(a){return function(){function c(a,d){if(a)return b(null,{error:a});2=arguments.length?c:J(arguments,1),a=null,++q===f&&d(null,l))}}d=d||w;var f,g,l,q=0;C(b)?(f=b.length,l=Array(f),a(b,e)):b&&"object"===typeof b&&(g=F(b),f=g.length,l={},c(b,e,g));f||d(null,l)}}(function(a,c){for(var b=-1,d=a.length;++bc)return d(null,[]);v=v||Array(k);K(c>k?k:c,t)},mapValues:fb,mapValuesSeries:function(a,c,b){function d(){k=t;c(a[t], +s)}function e(){k=t;c(a[t],t,s)}function f(){k=t;n=r.next();n.done?b(null,v):c(n.value,s)}function g(){k=t;n=r.next();n.done?b(null,v):c(n.value,t,s)}function l(){k=m[t];c(a[k],s)}function q(){k=m[t];c(a[k],k,s)}function s(a,d){a?(p=A,b=E(b),b(a,L(v))):(v[k]=d,++t===h?(p=A,b(null,v),b=A):u?D(p):(u=!0,p()),u=!1)}b=b||w;var h,k,m,r,n,p,u=!1,v={},t=0;C(a)?(h=a.length,p=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,r=a[z](),p=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,p=3===c.length?q:l)); +if(!h)return b(null,v);p()},mapValuesLimit:function(a,c,b,d){function e(){m=y++;mc)return d(null,x);K(c>k?k:c,v)},filter:Ta,filterSeries:Ua,filterLimit:Va,select:Ta,selectSeries:Ua,selectLimit:Va,reject:gb,rejectSeries:hb,rejectLimit:ib,detect:ja,detectSeries:ka,detectLimit:la,find:ja,findSeries:ka,findLimit:la,pick:jb,pickSeries:kb, +pickLimit:lb,omit:mb,omitSeries:nb,omitLimit:ob,reduce:$,inject:$,foldl:$,reduceRight:Ga,foldr:Ga,transform:pb,transformSeries:function(a,c,b,d){function e(){b(v,a[x],h)}function f(){b(v,a[x],x,h)}function g(){p=n.next();p.done?d(null,v):b(v,p.value,h)}function l(){p=n.next();p.done?d(null,v):b(v,p.value,x,h)}function q(){b(v,a[r[x]],h)}function s(){m=r[x];b(v,a[m],m,h)}function h(a,b){a?d(a,v):++x===k||!1===b?(u=A,d(null,v)):t?D(u):(t=!0,u());t=!1}3===arguments.length&&(d=b,b=c,c=void 0);d=E(d|| +w);var k,m,r,n,p,u,v,t=!1,x=0;C(a)?(k=a.length,v=void 0!==c?c:[],u=4===b.length?f:e):a&&(z&&a[z]?(k=Infinity,n=a[z](),v=void 0!==c?c:{},u=4===b.length?l:g):"object"===typeof a&&(r=F(a),k=r.length,v=void 0!==c?c:{},u=4===b.length?s:q));if(!k)return d(null,void 0!==c?c:v||{});u()},transformLimit:function(a,c,b,d,e){function f(){r=A++;rc)return e(null,void 0!==b?b:x||{});K(c>m?m:c,t)},sortBy:qb,sortBySeries:function(a,c,b){function d(){m=a[y];c(m,s)}function e(){m=a[y];c(m,y,s)}function f(){p=n.next();if(p.done)return b(null,P(u,v));m=p.value;u[y]=m;c(m,s)}function g(){p=n.next();if(p.done)return b(null,P(u,v));m=p.value;u[y]=m;c(m,y,s)}function l(){m=a[r[y]];u[y]=m;c(m,s)}function q(){k=r[y];m=a[k];u[y]=m;c(m,k,s)}function s(a,d){v[y]=d;a?b(a):++y===h?(t=A,b(null, +P(u,v))):x?D(t):(x=!0,t());x=!1}b=E(b||w);var h,k,m,r,n,p,u,v,t,x=!1,y=0;C(a)?(h=a.length,u=a,v=Array(h),t=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,u=[],v=[],n=a[z](),t=3===c.length?g:f):"object"===typeof a&&(r=F(a),h=r.length,u=Array(h),v=Array(h),t=3===c.length?q:l));if(!h)return b(null,[]);t()},sortByLimit:function(a,c,b,d){function e(){Bc)return d(null,[]);x=x||Array(k);K(c>k?k:c,y)},some:Ha,someSeries:Ia,someLimit:Ja,any:Ha,anySeries:Ia,anyLimit:Ja,every:Wa,everySeries:Xa,everyLimit:Ya,all:Wa,allSeries:Xa,allLimit:Ya,concat:rb,concatSeries:function(a,c,b){function d(){c(a[t],s)}function e(){c(a[t],t,s)}function f(){n=r.next();n.done?b(null,v):c(n.value,s)}function g(){n=r.next();n.done?b(null,v):c(n.value,t,s)}function l(){c(a[m[t]], +s)}function q(){k=m[t];c(a[k],k,s)}function s(a,d){C(d)?X.apply(v,d):2<=arguments.length&&X.apply(v,J(arguments,1));a?b(a,v):++t===h?(p=A,b(null,v)):u?D(p):(u=!0,p());u=!1}b=E(b||w);var h,k,m,r,n,p,u=!1,v=[],t=0;C(a)?(h=a.length,p=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,r=a[z](),p=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,p=3===c.length?q:l));if(!h)return b(null,v);p()},concatLimit:function(a,c,b,d){function e(){tc)return d(null,[]);u=u||Array(k);K(c>k?k:c,p)},groupBy:sb,groupBySeries:function(a,c,b){function d(){m=a[t];c(m,s)}function e(){m=a[t];c(m,t,s)}function f(){p=n.next();m=p.value;p.done?b(null,x):c(m,s)}function g(){p=n.next();m=p.value;p.done? +b(null,x):c(m,t,s)}function l(){m=a[r[t]];c(m,s)}function q(){k=r[t];m=a[k];c(m,k,s)}function s(a,d){if(a)u=A,b=E(b),b(a,L(x));else{var c=x[d];c?c.push(m):x[d]=[m];++t===h?(u=A,b(null,x)):v?D(u):(v=!0,u());v=!1}}b=E(b||w);var h,k,m,r,n,p,u,v=!1,t=0,x={};C(a)?(h=a.length,u=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,n=a[z](),u=3===c.length?g:f):"object"===typeof a&&(r=F(a),h=r.length,u=3===c.length?q:l));if(!h)return b(null,x);u()},groupByLimit:function(a,c,b,d){function e(){yc)return d(null,B);K(c>k?k:c,t)},parallel:tb,series:function(a,c){function b(){g=k;a[k](e)}function d(){g=l[k];a[g](e)}function e(a,b){a?(s=A,c=E(c),c(a,q)):(q[g]=2>=arguments.length?b:J(arguments,1),++k===f?(s=A,c(null,q)):h?D(s):(h=!0,s()),h=!1)}c=c||w;var f,g,l,q,s,h=!1,k=0;if(C(a))f=a.length,q=Array(f), +s=b;else if(a&&"object"===typeof a)l=F(a),f=l.length,q={},s=d;else return c(null);if(!f)return c(null,q);s()},parallelLimit:function(a,c,b){function d(){l=r++;if(l=arguments.length?c:J(arguments,1),a=null,++n===g?b(null,h):m?D(k):(m=!0,k()),m=!1)}}b=b||w;var g,l,q,s,h,k,m=!1,r=0,n=0;C(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(c)||1>c)return b(null,h);K(c>g?g:c,k)},tryEach:function(a,c){function b(){a[q](e)}function d(){a[g[q]](e)}function e(a,b){a?++q===f?c(a):l():2>=arguments.length?c(null,b):c(null,J(arguments,1))}c=c||w;var f,g,l,q=0;C(a)?(f=a.length,l=b):a&&"object"===typeof a&&(g=F(a),f=g.length,l=d);if(!f)return c(null);l()},waterfall:function(a,c){function b(){ma(e,f,d(e))}function d(h){return function(k,m){void 0===h&&(c=w,A());h=void 0;k?(g=c,c=A,g(k)):++q===s?(g=c,c=A,2>=arguments.length? +g(k,m):g.apply(null,H(arguments))):(l?(f=arguments,e=a[q]||A,D(b)):(l=!0,ma(a[q]||A,arguments,d(q))),l=!1)}}c=c||w;if(Ka(a,c)){var e,f,g,l,q=0,s=a.length;ma(a[0],[],d(0))}},angelFall:La,angelfall:La,whilst:function(a,c,b){function d(){g?D(e):(g=!0,c(f));g=!1}function e(){c(f)}function f(c,e){if(c)return b(c);2>=arguments.length?a(e)?d():b(null,e):(e=J(arguments,1),a.apply(null,e)?d():b.apply(null,[null].concat(e)))}b=b||w;var g=!1;a()?d():b(null)},doWhilst:function(a,c,b){function d(){g?D(e):(g=!0, +a(f));g=!1}function e(){a(f)}function f(a,e){if(a)return b(a);2>=arguments.length?c(e)?d():b(null,e):(e=J(arguments,1),c.apply(null,e)?d():b.apply(null,[null].concat(e)))}b=b||w;var g=!1;e()},until:function(a,c,b){function d(){g?D(e):(g=!0,c(f));g=!1}function e(){c(f)}function f(c,e){if(c)return b(c);2>=arguments.length?a(e)?b(null,e):d():(e=J(arguments,1),a.apply(null,e)?b.apply(null,[null].concat(e)):d())}b=b||w;var g=!1;a()?b(null):d()},doUntil:function(a,c,b){function d(){g?D(e):(g=!0,a(f));g= +!1}function e(){a(f)}function f(a,e){if(a)return b(a);2>=arguments.length?c(e)?b(null,e):d():(e=J(arguments,1),c.apply(null,e)?b.apply(null,[null].concat(e)):d())}b=b||w;var g=!1;e()},during:function(a,c,b){function d(a,d){if(a)return b(a);d?c(e):b(null)}function e(c){if(c)return b(c);a(d)}b=b||w;a(d)},doDuring:function(a,c,b){function d(d,c){if(d)return b(d);c?a(e):b(null)}function e(a,e){if(a)return b(a);switch(arguments.length){case 0:case 1:c(d);break;case 2:c(e,d);break;default:var l=J(arguments, +1);l.push(d);c.apply(null,l)}}b=b||w;d(null,!0)},forever:function(a,c){function b(){a(d)}function d(a){if(a){if(c)return c(a);throw a;}e?D(b):(e=!0,b());e=!1}var e=!1;b()},compose:function(){return Ma.apply(null,Za(arguments))},seq:Ma,applyEach:ub,applyEachSeries:vb,queue:function(a,c){return na(!0,a,c)},priorityQueue:function(a,c){var b=na(!0,a,c);b.push=function(a,c,f){b.started=!0;c=c||0;var g=C(a)?a:[a],l=g.length;if(void 0===a||0===l)b.idle()&&D(b.drain);else{f="function"===typeof f?f:w;for(a= +b._tasks.head;a&&c>=a.priority;)a=a.next;for(;l--;){var q={data:g[l],priority:c,callback:f};a?b._tasks.insertBefore(a,q):b._tasks.push(q);D(b.process)}}};delete b.unshift;return b},cargo:function(a,c){return na(!1,a,1,c)},auto:Oa,autoInject:function(a,c,b){var d={};W(a,function(a,b){var c,l=a.length;if(C(a)){if(0===l)throw Error("autoInject task functions require explicit parameters.");c=H(a);l=c.length-1;a=c[l];if(0===l){d[b]=a;return}}else{if(1===l){d[b]=a;return}c=ab(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 b(null,[]);var e=Array(a);K(a,function(a){c(a,d(a))})},timesSeries:function(a,c,b){function d(){c(l, +e)}function e(c,e){f[l]=e;c?(b(c),b=A):++l>=a?(b(null,f),b=A):g?D(d):(g=!0,d());g=!1}b=b||w;a=+a;if(isNaN(a)||1>a)return b(null,[]);var f=Array(a),g=!1,l=0;d()},timesLimit:function(a,c,b,d){function e(){var c=q++;c=a?(d(null,g),d=A):l?D(e):(l=!0,e());l=!1}}d=d||w;a=+a;if(isNaN(a)||1>a||isNaN(c)||1>c)return d(null,[]);var g=Array(a),l=!1,q=0,s=0;K(c>a?a:c,e)},race:function(a,c){c=I(c||w);var b,d,e=-1;if(C(a))for(b= +a.length;++e=c.size&&d!==w&&(d=w,e(null,U(y)))}function q(){v=t.next();!1===v.done?(p=v.value,d(p,B,k(p,B++))):R>=c.size&&d!==w&&(d=w,e(null,U(y)))}function s(){r=B++;rb)return e(null,[]);y=y||Array(m);K(b>m?m:b,x)}}function Y(a,c,b){function d(){c(a[t],s)}function e(){c(a[t],t,s)}function f(){n=r.next();n.done?b(null):c(n.value,s)}function g(){n=r.next();n.done?b(null):c(n.value,t,s)}function l(){c(a[m[t]],s)}function q(){k=m[t];c(a[k],k,s)}function s(a,d){a?b(a):++t===h||!1===d?(p=A,b(null)): -u?D(p):(u=!0,p());u=!1}b=E(b||w);var h,k,m,r,n,p,u=!1,t=0;C(a)?(h=a.length,p=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,r=a[z](),p=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,p=3===c.length?q:l));if(!h)return b(null);p()}function Z(a,c,b,d){function e(){x=a.size&&b!==w&&(b=w,d(null))}function l(){u=p.next();!1===u.done?b(u.value,x++,h):y>=a.size&&b!==w&&(b=w,d(null))}function q(){x< -k&&b(a[n[x++]],h)}function s(){m=x++;mc)return d(null);K(c>k?k:c,t)}function za(a,c,b){function d(){c(a[v],s)}function e(){c(a[v],v,s)}function f(){n= -r.next();n.done?b(null,p):c(n.value,s)}function g(){n=r.next();n.done?b(null,p):c(n.value,v,s)}function l(){c(a[m[v]],s)}function q(){k=m[v];c(a[k],k,s)}function s(a,d){a?(u=A,b=E(b),b(a,H(p))):(p[v]=d,++v===h?(u=A,b(null,p),b=A):t?D(u):(t=!0,u()),t=!1)}b=b||w;var h,k,m,r,n,p,u,t=!1,v=0;C(a)?(h=a.length,u=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,p=[],r=a[z](),u=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,u=3===c.length?q:l));if(!h)return b(null,[]);p=p||Array(h);u()}function Aa(a,c, -b,d){return function(e,f,g){function l(a){var b=!1;return function(c,e){b&&A();b=!0;c?(g=I(g),g(c)):!!e===d?(g=I(g),g(null,a)):++h===q&&g(null)}}g=g||w;var q,s,h=0;C(e)?(q=e.length,a(e,f,l)):e&&(z&&e[z]?(q=b(e,f,l))&&q===h&&g(null):"object"===typeof e&&(s=F(e),q=s.length,c(e,f,l,s)));q||g(null)}}function Ba(a){return function(c,b,d){function e(){r=c[x];b(r,h)}function f(){r=c[x];b(r,x,h)}function g(){u=p.next();r=u.value;u.done?d(null):b(r,h)}function l(){u=p.next();r=u.value;u.done?d(null):b(r,x, -h)}function q(){r=c[n[x]];b(r,h)}function s(){m=n[x];r=c[m];b(r,m,h)}function h(b,c){b?d(b):!!c===a?(t=A,d(null,r)):++x===k?(t=A,d(null)):v?D(t):(v=!0,t());v=!1}d=E(d||w);var k,m,r,n,p,u,t,v=!1,x=0;C(c)?(k=c.length,t=3===b.length?f:e):c&&(z&&c[z]?(k=Infinity,p=c[z](),t=3===b.length?l:g):"object"===typeof c&&(n=F(c),k=n.length,t=3===b.length?s:q));if(!k)return d(null);t()}}function Ca(a){return function(c,b,d,e){function f(){r=G++;r=c.size&&d!==w&&(d=w,e(null))}function q(){v=t.next();!1===v.done?(p=v.value,d(p,G++,k(p))):B>=c.size&&d!==w&&(d=w,e(null))}function s(){r=G++;rb)return e(null);K(b>m?m:b,x)}}function Da(a,c,b,d){return function(e,f,g){function l(a,b){return function(c,e){null===a&&A();c?(a=null,g=I(g),g(c,L(k))):(!!e===d&&(k[a]=b),a=null,++h===q&&g(null,k))}}g=g||w;var q,s,h=0,k={};C(e)?(q=e.length,a(e,f,l)):e&&(z&&e[z]?(q=b(e,f,l))&&q===h&&g(null,k):"object"===typeof e&&(s=F(e),q=s.length,c(e,f,l,s)));if(!q)return g(null, -{})}}function Ea(a){return function(c,b,d){function e(){m=y;r=c[y];b(r,h)}function f(){m=y;r=c[y];b(r,y,h)}function g(){m=y;u=p.next();r=u.value;u.done?d(null,x):b(r,h)}function l(){m=y;u=p.next();r=u.value;u.done?d(null,x):b(r,m,h)}function q(){m=n[y];r=c[m];b(r,h)}function s(){m=n[y];r=c[m];b(r,m,h)}function h(b,c){b?d(b,x):(!!c===a&&(x[m]=r),++y===k?(t=A,d(null,x)):v?D(t):(v=!0,t()),v=!1)}d=E(d||w);var k,m,r,n,p,u,t,v=!1,x={},y=0;C(c)?(k=c.length,t=3===b.length?f:e):c&&(z&&c[z]?(k=Infinity,p=c[z](), -t=3===b.length?l:g):"object"===typeof c&&(n=F(c),k=n.length,t=3===b.length?s:q));if(!k)return d(null,{});t()}}function Fa(a){return function(c,b,d,e){function f(){r=B++;r=c.size&&d!==w&&(d=w,e(null,G))}function q(){v=t.next();!1===v.done?(p=v.value,d(p,B,k(p,B++))):R>=c.size&&d!==w&&(d=w,e(null,G))}function s(){Bb)return e(null,{});K(b>m?m:b,x)}}function $(a,c,b,d){function e(d){b(d,a[t],h)}function f(d){b(d, -a[t],t,h)}function g(){b(c,n.next().value,h)}function l(){b(c,n.next().value,t,h)}function q(d){b(d,a[r[t]],h)}function s(d){m=r[t];b(d,a[m],m,h)}function h(a,c){a?d(a,c):++t===k?(b=A,d(null,c)):u?D(function(){p(c)}):(u=!0,p(c));u=!1}d=E(d||w);var k,m,r,n,p,u=!1,t=0;C(a)?(k=a.length,p=4===b.length?f:e):a&&(z&&a[z]?(k=a.size,n=a[z](),p=4===b.length?l:g):"object"===typeof a&&(r=F(a),k=r.length,p=4===b.length?s:q));if(!k)return d(null,c);p(c)}function Ga(a,c,b,d){function e(d){b(d,a[--s],q)}function f(d){b(d, -a[--s],s,q)}function g(d){b(d,a[m[--s]],q)}function l(d){k=m[--s];b(d,a[k],k,q)}function q(a,b){a?d(a,b):0===s?(u=A,d(null,b)):t?D(function(){u(b)}):(t=!0,u(b));t=!1}d=E(d||w);var s,h,k,m,r,n,p,u,t=!1;if(C(a))s=a.length,u=4===b.length?f:e;else if(a)if(z&&a[z]){s=a.size;p=Array(s);r=a[z]();for(h=-1;!1===(n=r.next()).done;)p[++h]=n.value;a=p;u=4===b.length?f:e}else"object"===typeof a&&(m=F(a),s=m.length,u=4===b.length?l:g);if(!s)return d(null,c);u(c)}function Ha(a,c,b){b=b||w;ja(a,c,function(a,c){if(a)return b(a); +r=c[m];b(r,h)}function s(){m=n[x];r=c[m];b(r,m,h)}function h(b,c){b?d(b):(!!c===a&&(y[y.length]=r),++x===k?(v=A,d(null,y)):t?D(v):(t=!0,v()),t=!1)}d=E(d||w);var k,m,r,n,p,u,v,t=!1,x=0,y=[];C(c)?(k=c.length,v=3===b.length?f:e):c&&(z&&c[z]?(k=Infinity,p=c[z](),v=3===b.length?l:g):"object"===typeof c&&(n=F(c),k=n.length,v=3===b.length?s:q));if(!k)return d(null,[]);v()}}function ya(a){return function(c,b,d,e){function f(){r=B++;rb)return e(null,[]);y=y||Array(m);K(b>m?m:b,x)}}function Y(a,c,b){function d(){c(a[v],s)}function e(){c(a[v],v,s)}function f(){n=r.next();n.done?b(null):c(n.value,s)}function g(){n=r.next();n.done?b(null):c(n.value,v,s)}function l(){c(a[m[v]],s)}function q(){k=m[v];c(a[k],k,s)}function s(a,d){a?b(a):++v===h||!1===d?(p=A,b(null)):u?D(p): +(u=!0,p());u=!1}b=E(b||w);var h,k,m,r,n,p,u=!1,v=0;C(a)?(h=a.length,p=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,r=a[z](),p=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,p=3===c.length?q:l));if(!h)return b(null);p()}function Z(a,c,b,d){function e(){xc)return d(null);K(c>k?k:c,v)}function za(a,c,b){function d(){c(a[t],s)}function e(){c(a[t],t,s)}function f(){n=r.next(); +n.done?b(null,p):c(n.value,s)}function g(){n=r.next();n.done?b(null,p):c(n.value,t,s)}function l(){c(a[m[t]],s)}function q(){k=m[t];c(a[k],k,s)}function s(a,d){a?(u=A,b=E(b),b(a,H(p))):(p[t]=d,++t===h?(u=A,b(null,p),b=A):v?D(u):(v=!0,u()),v=!1)}b=b||w;var h,k,m,r,n,p,u,v=!1,t=0;C(a)?(h=a.length,u=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,p=[],r=a[z](),u=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,u=3===c.length?q:l));if(!h)return b(null,[]);p=p||Array(h);u()}function Aa(a,c,b,d){return function(e, +f,g){function l(a){var b=!1;return function(c,e){b&&A();b=!0;c?(g=I(g),g(c)):!!e===d?(g=I(g),g(null,a)):++h===q&&g(null)}}g=g||w;var q,s,h=0;C(e)?(q=e.length,a(e,f,l)):e&&(z&&e[z]?(q=b(e,f,l))&&q===h&&g(null):"object"===typeof e&&(s=F(e),q=s.length,c(e,f,l,s)));q||g(null)}}function Ba(a){return function(c,b,d){function e(){r=c[x];b(r,h)}function f(){r=c[x];b(r,x,h)}function g(){u=p.next();r=u.value;u.done?d(null):b(r,h)}function l(){u=p.next();r=u.value;u.done?d(null):b(r,x,h)}function q(){r=c[n[x]]; +b(r,h)}function s(){m=n[x];r=c[m];b(r,m,h)}function h(b,c){b?d(b):!!c===a?(v=A,d(null,r)):++x===k?(v=A,d(null)):t?D(v):(t=!0,v());t=!1}d=E(d||w);var k,m,r,n,p,u,v,t=!1,x=0;C(c)?(k=c.length,v=3===b.length?f:e):c&&(z&&c[z]?(k=Infinity,p=c[z](),v=3===b.length?l:g):"object"===typeof c&&(n=F(c),k=n.length,v=3===b.length?s:q));if(!k)return d(null);v()}}function Ca(a){return function(c,b,d,e){function f(){r=G++;rb)return e(null);K(b>m?m:b,x)}}function Da(a,c,b,d){return function(e,f,g){function l(a,b){return function(c,e){null===a&&A();c?(a=null,g=I(g),g(c,L(k))):(!!e===d&&(k[a]=b),a=null,++h===q&&g(null,k))}}g=g||w;var q,s,h=0,k={};C(e)?(q=e.length,a(e,f,l)):e&&(z&&e[z]?(q=b(e,f,l))&&q===h&&g(null,k):"object"===typeof e&&(s=F(e),q=s.length,c(e,f,l,s)));if(!q)return g(null,{})}}function Ea(a){return function(c, +b,d){function e(){m=y;r=c[y];b(r,h)}function f(){m=y;r=c[y];b(r,y,h)}function g(){m=y;u=p.next();r=u.value;u.done?d(null,x):b(r,h)}function l(){m=y;u=p.next();r=u.value;u.done?d(null,x):b(r,m,h)}function q(){m=n[y];r=c[m];b(r,h)}function s(){m=n[y];r=c[m];b(r,m,h)}function h(b,c){b?d(b,x):(!!c===a&&(x[m]=r),++y===k?(v=A,d(null,x)):t?D(v):(t=!0,v()),t=!1)}d=E(d||w);var k,m,r,n,p,u,v,t=!1,x={},y=0;C(c)?(k=c.length,v=3===b.length?f:e):c&&(z&&c[z]?(k=Infinity,p=c[z](),v=3===b.length?l:g):"object"===typeof c&& +(n=F(c),k=n.length,v=3===b.length?s:q));if(!k)return d(null,{});v()}}function Fa(a){return function(c,b,d,e){function f(){r=B++;rb)return e(null,{});K(b>m?m:b,x)}}function $(a,c,b,d){function e(d){b(d,a[t],h)}function f(d){b(d,a[t],t,h)}function g(a){p=n.next();p.done?d(null,a):b(a,p.value, +h)}function l(a){p=n.next();p.done?d(null,a):b(a,p.value,t,h)}function q(d){b(d,a[r[t]],h)}function s(d){m=r[t];b(d,a[m],m,h)}function h(a,c){a?d(a,c):++t===k?(b=A,d(null,c)):v?D(function(){u(c)}):(v=!0,u(c));v=!1}d=E(d||w);var k,m,r,n,p,u,v=!1,t=0;C(a)?(k=a.length,u=4===b.length?f:e):a&&(z&&a[z]?(k=Infinity,n=a[z](),u=4===b.length?l:g):"object"===typeof a&&(r=F(a),k=r.length,u=4===b.length?s:q));if(!k)return d(null,c);u(c)}function Ga(a,c,b,d){function e(d){b(d,a[--s],q)}function f(d){b(d,a[--s], +s,q)}function g(d){b(d,a[m[--s]],q)}function l(d){k=m[--s];b(d,a[k],k,q)}function q(a,b){a?d(a,b):0===s?(u=A,d(null,b)):v?D(function(){u(b)}):(v=!0,u(b));v=!1}d=E(d||w);var s,h,k,m,r,n,p,u,v=!1;if(C(a))s=a.length,u=4===b.length?f:e;else if(a)if(z&&a[z]){p=[];r=a[z]();for(h=-1;!1===(n=r.next()).done;)p[++h]=n.value;a=p;s=p.length;u=4===b.length?f:e}else"object"===typeof a&&(m=F(a),s=m.length,u=4===b.length?l:g);if(!s)return d(null,c);u(c)}function Ha(a,c,b){b=b||w;ja(a,c,function(a,c){if(a)return b(a); b(null,!!c)})}function Ia(a,c,b){b=b||w;ka(a,c,function(a,c){if(a)return b(a);b(null,!!c)})}function Ja(a,c,b,d){d=d||w;la(a,c,b,function(a,b){if(a)return d(a);d(null,!!b)})}function Ka(a,c){return C(a)?0===a.length?(c(null),!1):!0:(c(Error("First argument to waterfall must be an array of functions")),!1)}function ma(a,c,b){switch(c.length){case 0:case 1:return a(b);case 2:return a(c[1],b);case 3:return a(c[1],c[2],b);case 4:return a(c[1],c[2],c[3],b);case 5:return a(c[1],c[2],c[3],c[4],b);case 6:return a(c[1], c[2],c[3],c[4],c[5],b);default:return c=J(c,1),c.push(b),a.apply(null,c)}}function La(a,c){function b(b,h){if(b)q=A,c=E(c),c(b);else if(++d===f){q=A;var k=c;c=A;2===arguments.length?k(b,h):k.apply(null,H(arguments))}else g=a[d],l=arguments,e?D(q):(e=!0,q()),e=!1}c=c||w;if(Ka(a,c)){var d=0,e=!1,f=a.length,g=a[d],l=[],q=function(){switch(g.length){case 0:try{b(null,g())}catch(a){b(a)}break;case 1:return g(b);case 2:return g(l[1],b);case 3:return g(l[1],l[2],b);case 4:return g(l[1],l[2],l[3],b);case 5:return g(l[1], l[2],l[3],l[4],b);default:return l=J(l,1),l[g.length-1]=b,g.apply(null,l)}};q()}}function Ma(){var a=H(arguments);return function(){var c=this,b=H(arguments),d=b[b.length-1];"function"===typeof d?b.pop():d=w;$(a,b,function(a,b,d){a.push(function(a){var b=J(arguments,1);d(a,b)});b.apply(c,a)},function(a,b){b=C(b)?b:[b];b.unshift(a);d.apply(c,b)})}}function Na(a){return function(c){var b=function(){var b=this,d=H(arguments),g=d.pop()||w;return a(c,function(a,c){a.apply(b,d.concat([c]))},g)};if(1b)throw Error("Concurrency must not be zero");var h=0,k=[],m,r,n={_tasks:new M,concurrency:b,payload:d,saturated:w,unsaturated:w,buffer:b/4,empty:w,drain:w,error:w,started:!1,paused:!1,push:function(a,b){f(a,b)},kill:function(){n.drain= -w;n._tasks.empty()},unshift:function(a,b){f(a,b,!0)},remove:function(a){n._tasks.remove(a)},process:a?l:q,length:function(){return n._tasks.length},running:function(){return h},workersList:function(){return k},idle:function(){return 0===n.length()+h},pause:function(){n.paused=!0},resume:function(){!1!==n.paused&&(n.paused=!1,K(n.concurrency=arguments.length?f:J(arguments,1);if(a){q=g=0;s.length=0;var k=L(l);k[d]=f;d=null;var h=b;b=w;h(a,k)}else q--,g--,l[d]=f,e(d),d=null}function n(){0===--t&& -s.push([p,u,c])}var p,u;if(C(a)){var t=a.length-1;p=a[t];u=t;if(0===t)s.push([p,u,c]);else for(var v=-1;++v=arguments.length)return b(a,e);var f=H(arguments);return b.apply(null,f)}c(d)}function e(){c(f)}function f(a,d){if(++s===g||!a||q&&!q(a)){if(2>=arguments.length)return b(a,d);var c=H(arguments);return b.apply(null,c)}setTimeout(e,l(s))}var g,l,q,s=0;if(3>arguments.length&&"function"===typeof a)b=c||w,c=a,a=null,g=5;else switch(b=b||w,typeof a){case "object":"function"===typeof a.errorFilter&&(q=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 c)throw Error("Invalid arguments for async.retry");l?c(f):c(d)}function Pa(a){return function(){var c=H(arguments),b=c.pop(),d;try{d=a.apply(this,c)}catch(e){return b(e)}d&&"function"===typeof d.then?d.then(function(a){try{b(null,a)}catch(d){D(Qa,d)}},function(a){a=a&&a.message?a:Error(a);try{b(a, -void 0)}catch(d){D(Qa,d)}}):b(null,d)}}function Qa(a){throw a;}function Ra(a){return function(){function c(a,d){if(a)return b(null,{error:a});2=arguments.length?c:J(arguments,1),a=null,++q===f&&d(null,l))}}d=d||w;var f,g,l,q=0;C(b)?(f=b.length,l=Array(f),a(b,e)):b&&"object"===typeof b&&(g=F(b),f=g.length,l={},c(b,e,g));f||d(null,l)}}(function(a,c){for(var b=-1,d=a.length;++b=a.size&&b!==w&&(b=w,d(null,t))}function l(){u=p.next();!1===u.done?b(u.value,y,h(y++)):G>=a.size&&b!==w&&(b=w,d(null,t))}function q(){m=y++;mc)return d(null,[]);t=t||Array(k);K(c>k?k:c,v)},mapValues:fb,mapValuesSeries:function(a,c,b){function d(){k=v;c(a[v],s)}function e(){k=v;c(a[v],v,s)}function f(){k=v;n=r.next(); -n.done?b(null,t):c(n.value,s)}function g(){k=v;n=r.next();n.done?b(null,t):c(n.value,v,s)}function l(){k=m[v];c(a[k],s)}function q(){k=m[v];c(a[k],k,s)}function s(a,d){a?(p=A,b=E(b),b(a,L(t))):(t[k]=d,++v===h?(p=A,b(null,t),b=A):u?D(p):(u=!0,p()),u=!1)}b=b||w;var h,k,m,r,n,p,u=!1,t={},v=0;C(a)?(h=a.length,p=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,r=a[z](),p=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,p=3===c.length?q:l));if(!h)return b(null,t);p()},mapValuesLimit:function(a,c,b,d){function e(){m= -y++;m=a.size&&b!==w&&(b=w,d(null,x))}function l(){u=p.next();!1===u.done?b(u.value,y,h(y++)):G>=a.size&&b!==w&&(b=w,d(null,x))}function q(){m=y++;mc)return d(null,x);K(c>k?k:c,t)},filter:Ta,filterSeries:Ua,filterLimit:Va,select:Ta,selectSeries:Ua,selectLimit:Va,reject:gb,rejectSeries:hb,rejectLimit:ib,detect:ja,detectSeries:ka,detectLimit:la,find:ja,findSeries:ka,findLimit:la,pick:jb,pickSeries:kb,pickLimit:lb,omit:mb,omitSeries:nb,omitLimit:ob,reduce:$,inject:$, -foldl:$,reduceRight:Ga,foldr:Ga,transform:pb,transformSeries:function(a,c,b,d){function e(){b(t,a[x],h)}function f(){b(t,a[x],x,h)}function g(){p=n.next();p.done?d(null,t):b(t,p.value,h)}function l(){p=n.next();p.done?d(null,t):b(t,p.value,x,h)}function q(){b(t,a[r[x]],h)}function s(){m=r[x];b(t,a[m],m,h)}function h(a,b){a?d(a,t):++x===k||!1===b?(u=A,d(null,t)):v?D(u):(v=!0,u());v=!1}3===arguments.length&&(d=b,b=c,c=void 0);d=E(d||w);var k,m,r,n,p,u,t,v=!1,x=0;C(a)?(k=a.length,t=void 0!==c?c:[],u= -4===b.length?f:e):a&&(z&&a[z]?(k=a.size,n=a[z](),t=void 0!==c?c:{},u=4===b.length?l:g):"object"===typeof a&&(r=F(a),k=r.length,t=void 0!==c?c:{},u=4===b.length?s:q));if(!k)return d(null,void 0!==c?c:t||{});u()},transformLimit:function(a,c,b,d,e){function f(){r=A++;r=a.size&&d!==w&&(d=w,e(null,x))}function q(){t=u.next();!1===t.done?d(x,t.value,A++,E(k)):B>=a.size&&d!==w&&(d=w,e(null, -x))}function s(){r=A++;rc)return e(null,void 0!==b?b:x||{});K(c>m?m:c,v)},sortBy:qb,sortBySeries:function(a,c,b){function d(){m=a[y];c(m,s)}function e(){m=a[y];c(m,y,s)}function f(){p=n.next();if(p.done)return b(null,P(u,t));m=p.value;u[y]=m;c(m,s)}function g(){p=n.next();if(p.done)return b(null,P(u,t));m=p.value;u[y]=m;c(m,y,s)}function l(){m=a[r[y]];u[y]=m;c(m,s)}function q(){k=r[y];m=a[k];u[y]=m;c(m,k,s)}function s(a,d){t[y]=d;a?b(a):++y===h?(v=A,b(null,P(u,t))):x?D(v):(x=!0,v());x=!1}b=E(b||w);var h,k,m,r,n,p,u,t, -v,x=!1,y=0;C(a)?(h=a.length,u=a,t=Array(h),v=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,u=[],t=[],n=a[z](),v=3===c.length?g:f):"object"===typeof a&&(r=F(a),h=r.length,u=Array(h),t=Array(h),v=3===c.length?q:l));if(!h)return b(null,[]);v()},sortByLimit:function(a,c,b,d){function e(){B=a.size&&b!==w&&(b=w,d(null,P(p,x)))}function l(){v=t.next();!1===v.done?(n= -v.value,p[B]=n,b(n,B,h(n,B++))):E>=a.size&&b!==w&&(b=w,d(null,P(p,x)))}function q(){Bc)return d(null,[]);x=x||Array(k);K(c>k?k:c,y)},some:Ha,someSeries:Ia,someLimit:Ja,any:Ha,anySeries:Ia,anyLimit:Ja,every:Wa,everySeries:Xa,everyLimit:Ya,all:Wa,allSeries:Xa,allLimit:Ya,concat:rb,concatSeries:function(a,c,b){function d(){c(a[v],s)}function e(){c(a[v],v,s)}function f(){n=r.next();n.done?b(null,t):c(n.value,s)}function g(){n=r.next();n.done?b(null,t):c(n.value,v,s)}function l(){c(a[m[v]],s)}function q(){k=m[v];c(a[k],k,s)}function s(a,d){C(d)? -X.apply(t,d):2<=arguments.length&&X.apply(t,J(arguments,1));a?b(a,t):++v===h?(p=A,b(null,t)):u?D(p):(u=!0,p());u=!1}b=E(b||w);var h,k,m,r,n,p,u=!1,t=[],v=0;C(a)?(h=a.length,p=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,r=a[z](),p=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,p=3===c.length?q:l));if(!h)return b(null,t);p()},concatLimit:function(a,c,b,d){function e(){v=a.size&&b!== -w&&(b=w,d(null,S(u)))}function l(){n=r.next();!1===n.done?b(n.value,v,h(v++)):x>=a.size&&b!==w&&(b=w,d(null,S(u)))}function q(){vc)return d(null,[]);u=u||Array(k);K(c>k?k:c,p)},groupBy:sb,groupBySeries:function(a,c,b){function d(){m=a[v];c(m,s)}function e(){m=a[v];c(m,v,s)}function f(){p=n.next();m=p.value;p.done?b(null,x):c(m,s)}function g(){p=n.next();m=p.value;p.done?b(null,x):c(m,v,s)}function l(){m=a[r[v]];c(m, -s)}function q(){k=r[v];m=a[k];c(m,k,s)}function s(a,d){if(a)u=A,b=E(b),b(a,L(x));else{var c=x[d];c?c.push(m):x[d]=[m];++v===h?(u=A,b(null,x)):t?D(u):(t=!0,u());t=!1}}b=E(b||w);var h,k,m,r,n,p,u,t=!1,v=0,x={};C(a)?(h=a.length,u=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,n=a[z](),u=3===c.length?g:f):"object"===typeof a&&(r=F(a),h=r.length,u=3===c.length?q:l));if(!h)return b(null,x);u()},groupByLimit:function(a,c,b,d){function e(){y=a.size&&b!==w&&(b=w,d(null,B))}function l(){t=u.next();!1===t.done?(n=t.value,b(n,y++,h(n))):E>=a.size&&b!==w&&(b=w,d(null,B))}function q(){yc)return d(null,B);K(c>k?k:c,v)},parallel:tb,series:function(a,c){function b(){g=k;a[k](e)}function d(){g=l[k];a[g](e)}function e(a,b){a?(s=A,c=E(c),c(a,q)):(q[g]=2>=arguments.length?b:J(arguments,1),++k===f?(s=A,c(null,q)):h?D(s):(h=!0,s()),h=!1)}c=c||w;var f,g,l,q,s,h=!1,k=0;if(C(a))f=a.length,q=Array(f),s=b;else if(a&&"object"===typeof a)l=F(a), -f=l.length,q={},s=d;else return c(null);if(!f)return c(null,q);s()},parallelLimit:function(a,c,b){function d(){l=r++;if(l=arguments.length?c:J(arguments,1),a=null,++n===g?b(null,h):m?D(k):(m=!0,k()),m=!1)}}b=b||w;var g,l,q,s,h,k,m=!1,r=0,n=0;C(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(c)||1>c)return b(null, -h);K(c>g?g:c,k)},tryEach:function(a,c){function b(){a[q](e)}function d(){a[g[q]](e)}function e(a,b){a?++q===f?c(a):l():2>=arguments.length?c(null,b):c(null,J(arguments,1))}c=c||w;var f,g,l,q=0;C(a)?(f=a.length,l=b):a&&"object"===typeof a&&(g=F(a),f=g.length,l=d);if(!f)return c(null);l()},waterfall:function(a,c){function b(){ma(e,f,d(e))}function d(h){return function(k,m){void 0===h&&(c=w,A());h=void 0;k?(g=c,c=A,g(k)):++q===s?(g=c,c=A,2>=arguments.length?g(k,m):g.apply(null,H(arguments))):(l?(f=arguments, -e=a[q]||A,D(b)):(l=!0,ma(a[q]||A,arguments,d(q))),l=!1)}}c=c||w;if(Ka(a,c)){var e,f,g,l,q=0,s=a.length;ma(a[0],[],d(0))}},angelFall:La,angelfall:La,whilst:function(a,c,b){function d(){g?D(e):(g=!0,c(f));g=!1}function e(){c(f)}function f(c,e){if(c)return b(c);2>=arguments.length?a(e)?d():b(null,e):(e=J(arguments,1),a.apply(null,e)?d():b.apply(null,[null].concat(e)))}b=b||w;var g=!1;a()?d():b(null)},doWhilst:function(a,c,b){function d(){g?D(e):(g=!0,a(f));g=!1}function e(){a(f)}function f(a,e){if(a)return b(a); -2>=arguments.length?c(e)?d():b(null,e):(e=J(arguments,1),c.apply(null,e)?d():b.apply(null,[null].concat(e)))}b=b||w;var g=!1;e()},until:function(a,c,b){function d(){g?D(e):(g=!0,c(f));g=!1}function e(){c(f)}function f(c,e){if(c)return b(c);2>=arguments.length?a(e)?b(null,e):d():(e=J(arguments,1),a.apply(null,e)?b.apply(null,[null].concat(e)):d())}b=b||w;var g=!1;a()?b(null):d()},doUntil:function(a,c,b){function d(){g?D(e):(g=!0,a(f));g=!1}function e(){a(f)}function f(a,e){if(a)return b(a);2>=arguments.length? -c(e)?b(null,e):d():(e=J(arguments,1),c.apply(null,e)?b.apply(null,[null].concat(e)):d())}b=b||w;var g=!1;e()},during:function(a,c,b){function d(a,d){if(a)return b(a);d?c(e):b(null)}function e(c){if(c)return b(c);a(d)}b=b||w;a(d)},doDuring:function(a,c,b){function d(d,c){if(d)return b(d);c?a(e):b(null)}function e(a,e){if(a)return b(a);switch(arguments.length){case 0:case 1:c(d);break;case 2:c(e,d);break;default:var l=J(arguments,1);l.push(d);c.apply(null,l)}}b=b||w;d(null,!0)},forever:function(a,c){function b(){a(d)} -function d(a){if(a){if(c)return c(a);throw a;}e?D(b):(e=!0,b());e=!1}var e=!1;b()},compose:function(){return Ma.apply(null,Za(arguments))},seq:Ma,applyEach:ub,applyEachSeries:vb,queue:function(a,c){return na(!0,a,c)},priorityQueue:function(a,c){var b=na(!0,a,c);b.push=function(a,c,f){b.started=!0;c=c||0;var g=C(a)?a:[a],l=g.length;if(void 0===a||0===l)b.idle()&&D(b.drain);else{f="function"===typeof f?f:w;for(a=b._tasks.head;a&&c>=a.priority;)a=a.next;for(;l--;){var q={data:g[l],priority:c,callback:f}; -a?b._tasks.insertBefore(a,q):b._tasks.push(q);D(b.process)}}};delete b.unshift;return b},cargo:function(a,c){return na(!1,a,1,c)},auto:Oa,autoInject:function(a,c,b){var d={};W(a,function(a,b){var c,l=a.length;if(C(a)){if(0===l)throw Error("autoInject task functions require explicit parameters.");c=H(a);l=c.length-1;a=c[l];if(0===l){d[b]=a;return}}else{if(1===l){d[b]=a;return}c=ab(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 b(null,[]);var e=Array(a);K(a,function(a){c(a,d(a))})},timesSeries:function(a,c,b){function d(){c(l,e)}function e(c, -e){f[l]=e;c?(b(c),b=A):++l>=a?(b(null,f),b=A):g?D(d):(g=!0,d());g=!1}b=b||w;a=+a;if(isNaN(a)||1>a)return b(null,[]);var f=Array(a),g=!1,l=0;d()},timesLimit:function(a,c,b,d){function e(){var c=q++;c=a?(d(null,g),d=A):l?D(e):(l=!0,e());l=!1}}d=d||w;a=+a;if(isNaN(a)||1>a||isNaN(c)||1>c)return d(null,[]);var g=Array(a),l=!1,q=0,s=0;K(c>a?a:c,e)},race:function(a,c){c=I(c||w);var b,d,e=-1;if(C(a))for(b=a.length;++e< -b;)a[e](c);else if(a&&"object"===typeof a)for(d=F(a),b=d.length;++eb)throw Error("Concurrency must not be zero");var h=0,k=[],m,r,n={_tasks:new M,concurrency:b,payload:d,saturated:w,unsaturated:w,buffer:b/4,empty:w,drain:w,error:w,started:!1,paused:!1,push:function(a, +b){f(a,b)},kill:function(){n.drain=w;n._tasks.empty()},unshift:function(a,b){f(a,b,!0)},remove:function(a){n._tasks.remove(a)},process:a?l:q,length:function(){return n._tasks.length},running:function(){return h},workersList:function(){return k},idle:function(){return 0===n.length()+h},pause:function(){n.paused=!0},resume:function(){!1!==n.paused&&(n.paused=!1,K(n.concurrency=arguments.length?f:J(arguments,1);if(a){q=g=0;s.length=0;var k=L(l);k[d]=f;d=null;var h= +b;b=w;h(a,k)}else q--,g--,l[d]=f,e(d),d=null}function n(){0===--v&&s.push([p,u,c])}var p,u;if(C(a)){var v=a.length-1;p=a[v];u=v;if(0===v)s.push([p,u,c]);else for(var t=-1;++t=arguments.length)return b(a,e);var f=H(arguments);return b.apply(null,f)}c(d)}function e(){c(f)}function f(a,d){if(++s===g||!a||q&&!q(a)){if(2>=arguments.length)return b(a,d);var c=H(arguments);return b.apply(null,c)}setTimeout(e,l(s))}var g,l,q,s=0;if(3>arguments.length&&"function"===typeof a)b=c||w,c=a,a=null,g=5;else switch(b=b||w,typeof a){case "object":"function"===typeof a.errorFilter&&(q=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 c)throw Error("Invalid arguments for async.retry");l?c(f):c(d)}function Pa(a){return function(){var c=H(arguments),b=c.pop(),d;try{d=a.apply(this,c)}catch(e){return b(e)}d&&"function"===typeof d.then?d.then(function(a){try{b(null, +a)}catch(d){D(Qa,d)}},function(a){a=a&&a.message?a:Error(a);try{b(a,void 0)}catch(d){D(Qa,d)}}):b(null,d)}}function Qa(a){throw a;}function Ra(a){return function(){function c(a,d){if(a)return b(null,{error:a});2=arguments.length?c:J(arguments,1),a=null,++q===f&&d(null,l))}}d=d||w;var f,g,l,q=0;C(b)?(f=b.length,l=Array(f),a(b,e)):b&&"object"===typeof b&&(g=F(b),f=g.length,l={},c(b,e,g));f||d(null,l)}}(function(a,c){for(var b=-1,d=a.length;++bc)return d(null,[]);v=v||Array(k);K(c>k?k:c,t)},mapValues:fb,mapValuesSeries:function(a,c,b){function d(){k=t;c(a[t], +s)}function e(){k=t;c(a[t],t,s)}function f(){k=t;n=r.next();n.done?b(null,v):c(n.value,s)}function g(){k=t;n=r.next();n.done?b(null,v):c(n.value,t,s)}function l(){k=m[t];c(a[k],s)}function q(){k=m[t];c(a[k],k,s)}function s(a,d){a?(p=A,b=E(b),b(a,L(v))):(v[k]=d,++t===h?(p=A,b(null,v),b=A):u?D(p):(u=!0,p()),u=!1)}b=b||w;var h,k,m,r,n,p,u=!1,v={},t=0;C(a)?(h=a.length,p=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,r=a[z](),p=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,p=3===c.length?q:l)); +if(!h)return b(null,v);p()},mapValuesLimit:function(a,c,b,d){function e(){m=y++;mc)return d(null,x);K(c>k?k:c,v)},filter:Ta,filterSeries:Ua,filterLimit:Va,select:Ta,selectSeries:Ua,selectLimit:Va,reject:gb,rejectSeries:hb,rejectLimit:ib,detect:ja,detectSeries:ka,detectLimit:la,find:ja,findSeries:ka,findLimit:la,pick:jb,pickSeries:kb, +pickLimit:lb,omit:mb,omitSeries:nb,omitLimit:ob,reduce:$,inject:$,foldl:$,reduceRight:Ga,foldr:Ga,transform:pb,transformSeries:function(a,c,b,d){function e(){b(v,a[x],h)}function f(){b(v,a[x],x,h)}function g(){p=n.next();p.done?d(null,v):b(v,p.value,h)}function l(){p=n.next();p.done?d(null,v):b(v,p.value,x,h)}function q(){b(v,a[r[x]],h)}function s(){m=r[x];b(v,a[m],m,h)}function h(a,b){a?d(a,v):++x===k||!1===b?(u=A,d(null,v)):t?D(u):(t=!0,u());t=!1}3===arguments.length&&(d=b,b=c,c=void 0);d=E(d|| +w);var k,m,r,n,p,u,v,t=!1,x=0;C(a)?(k=a.length,v=void 0!==c?c:[],u=4===b.length?f:e):a&&(z&&a[z]?(k=Infinity,n=a[z](),v=void 0!==c?c:{},u=4===b.length?l:g):"object"===typeof a&&(r=F(a),k=r.length,v=void 0!==c?c:{},u=4===b.length?s:q));if(!k)return d(null,void 0!==c?c:v||{});u()},transformLimit:function(a,c,b,d,e){function f(){r=A++;rc)return e(null,void 0!==b?b:x||{});K(c>m?m:c,t)},sortBy:qb,sortBySeries:function(a,c,b){function d(){m=a[y];c(m,s)}function e(){m=a[y];c(m,y,s)}function f(){p=n.next();if(p.done)return b(null,P(u,v));m=p.value;u[y]=m;c(m,s)}function g(){p=n.next();if(p.done)return b(null,P(u,v));m=p.value;u[y]=m;c(m,y,s)}function l(){m=a[r[y]];u[y]=m;c(m,s)}function q(){k=r[y];m=a[k];u[y]=m;c(m,k,s)}function s(a,d){v[y]=d;a?b(a):++y===h?(t=A,b(null, +P(u,v))):x?D(t):(x=!0,t());x=!1}b=E(b||w);var h,k,m,r,n,p,u,v,t,x=!1,y=0;C(a)?(h=a.length,u=a,v=Array(h),t=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,u=[],v=[],n=a[z](),t=3===c.length?g:f):"object"===typeof a&&(r=F(a),h=r.length,u=Array(h),v=Array(h),t=3===c.length?q:l));if(!h)return b(null,[]);t()},sortByLimit:function(a,c,b,d){function e(){Bc)return d(null,[]);x=x||Array(k);K(c>k?k:c,y)},some:Ha,someSeries:Ia,someLimit:Ja,any:Ha,anySeries:Ia,anyLimit:Ja,every:Wa,everySeries:Xa,everyLimit:Ya,all:Wa,allSeries:Xa,allLimit:Ya,concat:rb,concatSeries:function(a,c,b){function d(){c(a[t],s)}function e(){c(a[t],t,s)}function f(){n=r.next();n.done?b(null,v):c(n.value,s)}function g(){n=r.next();n.done?b(null,v):c(n.value,t,s)}function l(){c(a[m[t]], +s)}function q(){k=m[t];c(a[k],k,s)}function s(a,d){C(d)?X.apply(v,d):2<=arguments.length&&X.apply(v,J(arguments,1));a?b(a,v):++t===h?(p=A,b(null,v)):u?D(p):(u=!0,p());u=!1}b=E(b||w);var h,k,m,r,n,p,u=!1,v=[],t=0;C(a)?(h=a.length,p=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,r=a[z](),p=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,p=3===c.length?q:l));if(!h)return b(null,v);p()},concatLimit:function(a,c,b,d){function e(){tc)return d(null,[]);u=u||Array(k);K(c>k?k:c,p)},groupBy:sb,groupBySeries:function(a,c,b){function d(){m=a[t];c(m,s)}function e(){m=a[t];c(m,t,s)}function f(){p=n.next();m=p.value;p.done?b(null,x):c(m,s)}function g(){p=n.next();m=p.value;p.done? +b(null,x):c(m,t,s)}function l(){m=a[r[t]];c(m,s)}function q(){k=r[t];m=a[k];c(m,k,s)}function s(a,d){if(a)u=A,b=E(b),b(a,L(x));else{var c=x[d];c?c.push(m):x[d]=[m];++t===h?(u=A,b(null,x)):v?D(u):(v=!0,u());v=!1}}b=E(b||w);var h,k,m,r,n,p,u,v=!1,t=0,x={};C(a)?(h=a.length,u=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,n=a[z](),u=3===c.length?g:f):"object"===typeof a&&(r=F(a),h=r.length,u=3===c.length?q:l));if(!h)return b(null,x);u()},groupByLimit:function(a,c,b,d){function e(){yc)return d(null,B);K(c>k?k:c,t)},parallel:tb,series:function(a,c){function b(){g=k;a[k](e)}function d(){g=l[k];a[g](e)}function e(a,b){a?(s=A,c=E(c),c(a,q)):(q[g]=2>=arguments.length?b:J(arguments,1),++k===f?(s=A,c(null,q)):h?D(s):(h=!0,s()),h=!1)}c=c||w;var f,g,l,q,s,h=!1,k=0;if(C(a))f=a.length,q=Array(f), +s=b;else if(a&&"object"===typeof a)l=F(a),f=l.length,q={},s=d;else return c(null);if(!f)return c(null,q);s()},parallelLimit:function(a,c,b){function d(){l=r++;if(l=arguments.length?c:J(arguments,1),a=null,++n===g?b(null,h):m?D(k):(m=!0,k()),m=!1)}}b=b||w;var g,l,q,s,h,k,m=!1,r=0,n=0;C(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(c)||1>c)return b(null,h);K(c>g?g:c,k)},tryEach:function(a,c){function b(){a[q](e)}function d(){a[g[q]](e)}function e(a,b){a?++q===f?c(a):l():2>=arguments.length?c(null,b):c(null,J(arguments,1))}c=c||w;var f,g,l,q=0;C(a)?(f=a.length,l=b):a&&"object"===typeof a&&(g=F(a),f=g.length,l=d);if(!f)return c(null);l()},waterfall:function(a,c){function b(){ma(e,f,d(e))}function d(h){return function(k,m){void 0===h&&(c=w,A());h=void 0;k?(g=c,c=A,g(k)):++q===s?(g=c,c=A,2>=arguments.length? +g(k,m):g.apply(null,H(arguments))):(l?(f=arguments,e=a[q]||A,D(b)):(l=!0,ma(a[q]||A,arguments,d(q))),l=!1)}}c=c||w;if(Ka(a,c)){var e,f,g,l,q=0,s=a.length;ma(a[0],[],d(0))}},angelFall:La,angelfall:La,whilst:function(a,c,b){function d(){g?D(e):(g=!0,c(f));g=!1}function e(){c(f)}function f(c,e){if(c)return b(c);2>=arguments.length?a(e)?d():b(null,e):(e=J(arguments,1),a.apply(null,e)?d():b.apply(null,[null].concat(e)))}b=b||w;var g=!1;a()?d():b(null)},doWhilst:function(a,c,b){function d(){g?D(e):(g=!0, +a(f));g=!1}function e(){a(f)}function f(a,e){if(a)return b(a);2>=arguments.length?c(e)?d():b(null,e):(e=J(arguments,1),c.apply(null,e)?d():b.apply(null,[null].concat(e)))}b=b||w;var g=!1;e()},until:function(a,c,b){function d(){g?D(e):(g=!0,c(f));g=!1}function e(){c(f)}function f(c,e){if(c)return b(c);2>=arguments.length?a(e)?b(null,e):d():(e=J(arguments,1),a.apply(null,e)?b.apply(null,[null].concat(e)):d())}b=b||w;var g=!1;a()?b(null):d()},doUntil:function(a,c,b){function d(){g?D(e):(g=!0,a(f));g= +!1}function e(){a(f)}function f(a,e){if(a)return b(a);2>=arguments.length?c(e)?b(null,e):d():(e=J(arguments,1),c.apply(null,e)?b.apply(null,[null].concat(e)):d())}b=b||w;var g=!1;e()},during:function(a,c,b){function d(a,d){if(a)return b(a);d?c(e):b(null)}function e(c){if(c)return b(c);a(d)}b=b||w;a(d)},doDuring:function(a,c,b){function d(d,c){if(d)return b(d);c?a(e):b(null)}function e(a,e){if(a)return b(a);switch(arguments.length){case 0:case 1:c(d);break;case 2:c(e,d);break;default:var l=J(arguments, +1);l.push(d);c.apply(null,l)}}b=b||w;d(null,!0)},forever:function(a,c){function b(){a(d)}function d(a){if(a){if(c)return c(a);throw a;}e?D(b):(e=!0,b());e=!1}var e=!1;b()},compose:function(){return Ma.apply(null,Za(arguments))},seq:Ma,applyEach:ub,applyEachSeries:vb,queue:function(a,c){return na(!0,a,c)},priorityQueue:function(a,c){var b=na(!0,a,c);b.push=function(a,c,f){b.started=!0;c=c||0;var g=C(a)?a:[a],l=g.length;if(void 0===a||0===l)b.idle()&&D(b.drain);else{f="function"===typeof f?f:w;for(a= +b._tasks.head;a&&c>=a.priority;)a=a.next;for(;l--;){var q={data:g[l],priority:c,callback:f};a?b._tasks.insertBefore(a,q):b._tasks.push(q);D(b.process)}}};delete b.unshift;return b},cargo:function(a,c){return na(!1,a,1,c)},auto:Oa,autoInject:function(a,c,b){var d={};W(a,function(a,b){var c,l=a.length;if(C(a)){if(0===l)throw Error("autoInject task functions require explicit parameters.");c=H(a);l=c.length-1;a=c[l];if(0===l){d[b]=a;return}}else{if(1===l){d[b]=a;return}c=ab(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 b(null,[]);var e=Array(a);K(a,function(a){c(a,d(a))})},timesSeries:function(a,c,b){function d(){c(l, +e)}function e(c,e){f[l]=e;c?(b(c),b=A):++l>=a?(b(null,f),b=A):g?D(d):(g=!0,d());g=!1}b=b||w;a=+a;if(isNaN(a)||1>a)return b(null,[]);var f=Array(a),g=!1,l=0;d()},timesLimit:function(a,c,b,d){function e(){var c=q++;c=a?(d(null,g),d=A):l?D(e):(l=!0,e());l=!1}}d=d||w;a=+a;if(isNaN(a)||1>a||isNaN(c)||1>c)return d(null,[]);var g=Array(a),l=!1,q=0,s=0;K(c>a?a:c,e)},race:function(a,c){c=I(c||w);var b,d,e=-1;if(C(a))for(b= +a.length;++e