async.min.js
21.9 KB
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.async=n.async||{})}(this,function(n){"use strict";function t(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function e(n,e,r){return e=rt(void 0===e?n.length-1:e,0),function(){for(var u=arguments,o=-1,i=rt(u.length-e,0),c=Array(i);++o<i;)c[o]=u[e+o];o=-1;for(var f=Array(e+1);++o<e;)f[o]=u[o];return f[e]=r(c),t(n,this,f)}}function r(n){return n}function u(n,t){return e(n,t,r)}function o(n){return u(function(t,e){var r=ut(function(e,r){var u=this;return n(t,function(n,t){n.apply(u,e.concat([t]))},r)});return e.length?r.apply(this,e):r})}function i(n){var t=lt.call(n,pt),e=n[pt];try{n[pt]=void 0;var r=!0}catch(n){}var u=st.call(n);return r&&(t?n[pt]=e:delete n[pt]),u}function c(n){return yt.call(n)}function f(n){return null==n?void 0===n?dt:vt:(n=Object(n),mt&&mt in n?i(n):c(n))}function a(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function l(n){if(!a(n))return!1;var t=f(n);return t==bt||t==jt||t==gt||t==St}function s(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=kt}function p(n){return null!=n&&s(n.length)&&!l(n)}function h(){}function y(n){return function(){if(null!==n){var t=n;n=null,t.apply(this,arguments)}}}function v(n,t){for(var e=-1,r=Array(n);++e<n;)r[e]=t(e);return r}function d(n){return null!=n&&"object"==typeof n}function m(n){return d(n)&&f(n)==Ot}function g(){return!1}function b(n,t){return t=null==t?Vt:t,!!t&&("number"==typeof n||Pt.test(n))&&n>-1&&n%1==0&&n<t}function j(n){return d(n)&&s(n.length)&&!!ae[f(n)]}function S(n){return function(t){return n(t)}}function k(n,t){var e=Ft(n),r=!e&&Tt(n),u=!e&&!r&&zt(n),o=!e&&!r&&!u&&me(n),i=e||r||u||o,c=i?v(n.length,String):[],f=c.length;for(var a in n)!t&&!be.call(n,a)||i&&("length"==a||u&&("offset"==a||"parent"==a)||o&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||b(a,f))||c.push(a);return c}function w(n){var t=n&&n.constructor,e="function"==typeof t&&t.prototype||je;return n===e}function x(n,t){return function(e){return n(t(e))}}function O(n){if(!w(n))return Se(n);var t=[];for(var e in Object(n))we.call(n,e)&&"constructor"!=e&&t.push(e);return t}function E(n){return p(n)?k(n):O(n)}function L(n){var t=-1,e=n.length;return function(){return++t<e?{value:n[t],key:t}:null}}function A(n){var t=-1;return function(){var e=n.next();return e.done?null:(t++,{value:e.value,key:t})}}function T(n){var t=E(n),e=-1,r=t.length;return function(){var u=t[++e];return e<r?{value:n[u],key:u}:null}}function F(n){if(p(n))return L(n);var t=xt(n);return t?A(t):T(n)}function I(n){return function(){if(null===n)throw new Error("Callback was already called.");var t=n;n=null,t.apply(this,arguments)}}function _(n){return function(t,e,r){function u(n,t){if(f-=1,n)c=!0,r(n);else{if(t===xe||c&&f<=0)return c=!0,r(null);o()}}function o(){for(;f<n&&!c;){var t=i();if(null===t)return c=!0,void(f<=0&&r(null));f+=1,e(t.value,t.key,I(u))}}if(r=y(r||h),n<=0||!t)return r(null);var i=F(t),c=!1,f=0;o()}}function B(n,t,e,r){_(t)(n,e,r)}function M(n,t){return function(e,r,u){return n(e,t,r,u)}}function U(n,t,e){function r(n){n?e(n):++o===i&&e(null)}e=y(e||h);var u=0,o=0,i=n.length;for(0===i&&e(null);u<i;u++)t(n[u],u,I(r))}function z(n){return function(t,e,r){return n(Ee,t,e,r)}}function V(n,t,e,r){r=r||h,t=t||[];var u=[],o=0;n(t,function(n,t,r){var i=o++;e(n,function(n,t){u[i]=t,r(n)})},function(n){r(n,u)})}function P(n){return function(t,e,r,u){return n(_(e),t,r,u)}}function q(n){return ut(function(t,e){var r;try{r=n.apply(this,t)}catch(n){return e(n)}a(r)&&"function"==typeof r.then?r.then(function(n){e(null,n)},function(n){e(n.message?n:new Error(n))}):e(null,r)})}function D(n,t){for(var e=-1,r=null==n?0:n.length;++e<r&&t(n[e],e,n)!==!1;);return n}function R(n){return function(t,e,r){for(var u=-1,o=Object(t),i=r(t),c=i.length;c--;){var f=i[n?c:++u];if(e(o[f],f,o)===!1)break}return t}}function C(n,t){return n&&Be(n,t,E)}function $(n,t,e,r){for(var u=n.length,o=e+(r?1:-1);r?o--:++o<u;)if(t(n[o],o,n))return o;return-1}function W(n){return n!==n}function N(n,t,e){for(var r=e-1,u=n.length;++r<u;)if(n[r]===t)return r;return-1}function Q(n,t,e){return t===t?N(n,t,e):$(n,W,e)}function G(n,t){for(var e=-1,r=null==n?0:n.length,u=Array(r);++e<r;)u[e]=t(n[e],e,n);return u}function H(n){return"symbol"==typeof n||d(n)&&f(n)==Ue}function J(n){if("string"==typeof n)return n;if(Ft(n))return G(n,J)+"";if(H(n))return Pe?Pe.call(n):"";var t=n+"";return"0"==t&&1/n==-ze?"-0":t}function K(n,t,e){var r=-1,u=n.length;t<0&&(t=-t>u?0:u+t),e=e>u?u:e,e<0&&(e+=u),u=t>e?0:e-t>>>0,t>>>=0;for(var o=Array(u);++r<u;)o[r]=n[r+t];return o}function X(n,t,e){var r=n.length;return e=void 0===e?r:e,!t&&e>=r?n:K(n,t,e)}function Y(n,t){for(var e=n.length;e--&&Q(t,n[e],0)>-1;);return e}function Z(n,t){for(var e=-1,r=n.length;++e<r&&Q(t,n[e],0)>-1;);return e}function nn(n){return n.split("")}function tn(n){return We.test(n)}function en(n){return n.match(fr)||[]}function rn(n){return tn(n)?en(n):nn(n)}function un(n){return null==n?"":J(n)}function on(n,t,e){if(n=un(n),n&&(e||void 0===t))return n.replace(ar,"");if(!n||!(t=J(t)))return n;var r=rn(n),u=rn(t),o=Z(r,u),i=Y(r,u)+1;return X(r,o,i).join("")}function cn(n){return n=n.toString().replace(hr,""),n=n.match(lr)[2].replace(" ",""),n=n?n.split(sr):[],n=n.map(function(n){return on(n.replace(pr,""))})}function fn(n,t){var e={};C(n,function(n,t){function r(t,e){var r=G(u,function(n){return t[n]});r.push(e),n.apply(null,r)}var u;if(Ft(n))u=n.slice(0,-1),n=n[n.length-1],e[t]=u.concat(u.length>0?r:n);else if(1===n.length)e[t]=n;else{if(u=cn(n),0===n.length&&0===u.length)throw new Error("autoInject task functions require explicit parameters.");u.pop(),e[t]=u.concat(r)}}),Me(e,t)}function an(n){setTimeout(n,0)}function ln(n){return u(function(t,e){n(function(){t.apply(null,e)})})}function sn(){this.head=this.tail=null,this.length=0}function pn(n,t){n.length=1,n.head=n.tail=t}function hn(n,t,e){function r(n,t,e){if(null!=e&&"function"!=typeof e)throw new Error("task callback must be a function");if(f.started=!0,Ft(n)||(n=[n]),0===n.length&&f.idle())return dr(function(){f.drain()});for(var r=0,u=n.length;r<u;r++){var o={data:n[r],callback:e||h};t?f._tasks.unshift(o):f._tasks.push(o)}dr(f.process)}function o(n){return u(function(t){i-=1;for(var e=0,r=n.length;e<r;e++){var u=n[e],o=Q(c,u,0);o>=0&&c.splice(o),u.callback.apply(u,t),null!=t[0]&&f.error(t[0],u.data)}i<=f.concurrency-f.buffer&&f.unsaturated(),f.idle()&&f.drain(),f.process()})}if(null==t)t=1;else if(0===t)throw new Error("Concurrency must not be zero");var i=0,c=[],f={_tasks:new sn,concurrency:t,payload:e,saturated:h,unsaturated:h,buffer:t/4,empty:h,drain:h,error:h,started:!1,paused:!1,push:function(n,t){r(n,!1,t)},kill:function(){f.drain=h,f._tasks.empty()},unshift:function(n,t){r(n,!0,t)},process:function(){for(;!f.paused&&i<f.concurrency&&f._tasks.length;){var t=[],e=[],r=f._tasks.length;f.payload&&(r=Math.min(r,f.payload));for(var u=0;u<r;u++){var a=f._tasks.shift();t.push(a),e.push(a.data)}0===f._tasks.length&&f.empty(),i+=1,c.push(t[0]),i===f.concurrency&&f.saturated();var l=I(o(t));n(e,l)}},length:function(){return f._tasks.length},running:function(){return i},workersList:function(){return c},idle:function(){return f._tasks.length+i===0},pause:function(){f.paused=!0},resume:function(){if(f.paused!==!1){f.paused=!1;for(var n=Math.min(f.concurrency,f._tasks.length),t=1;t<=n;t++)dr(f.process)}}};return f}function yn(n,t){return hn(n,1,t)}function vn(n,t,e,r){r=y(r||h),gr(n,function(n,r,u){e(t,n,function(n,e){t=e,u(n)})},function(n){r(n,t)})}function dn(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(n,t){u=u.concat(t||[]),r(n)})},function(n){r(n,u)})}function mn(n){return function(t,e,r){return n(gr,t,e,r)}}function gn(n,t,e){return function(r,u,o,i){function c(){i&&i(null,e(!1))}function f(n,r,u){return i?void o(n,function(r,c){i&&(r||t(c))?(r?i(r):i(r,e(!0,n)),i=o=!1,u(r,xe)):u()}):u()}arguments.length>3?(i=i||h,n(r,u,f,c)):(i=o,i=i||h,o=u,n(r,f,c))}}function bn(n,t){return t}function jn(n){return u(function(t,e){t.apply(null,e.concat([u(function(t,e){"object"==typeof console&&(t?console.error&&console.error(t):console[n]&&D(e,function(t){console[n](t)}))})]))})}function Sn(n,t,e){function r(t,r){return t?e(t):r?void n(o):e(null)}e=I(e||h);var o=u(function(n,u){return n?e(n):(u.push(r),void t.apply(this,u))});r(null,!0)}function kn(n,t,e){e=I(e||h);var r=u(function(u,o){return u?e(u):t.apply(this,o)?n(r):void e.apply(null,[null].concat(o))});n(r)}function wn(n,t,e){kn(n,function(){return!t.apply(this,arguments)},e)}function xn(n,t,e){function r(t){return t?e(t):void n(u)}function u(n,u){return n?e(n):u?void t(r):e(null)}e=I(e||h),n(u)}function On(n){return function(t,e,r){return n(t,r)}}function En(n,t,e){Ee(n,On(t),e)}function Ln(n,t,e,r){_(t)(n,On(e),r)}function An(n){return ut(function(t,e){var r=!0;t.push(function(){var n=arguments;r?dr(function(){e.apply(null,n)}):e.apply(null,n)}),n.apply(this,t),r=!1})}function Tn(n){return!n}function Fn(n){return function(t){return null==t?void 0:t[n]}}function In(n,t,e,r){var u=new Array(t.length);n(t,function(n,t,r){e(n,function(n,e){u[t]=!!e,r(n)})},function(n){if(n)return r(n);for(var e=[],o=0;o<t.length;o++)u[o]&&e.push(t[o]);r(null,e)})}function _n(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(e,o){e?r(e):(o&&u.push({index:t,value:n}),r())})},function(n){n?r(n):r(null,G(u.sort(function(n,t){return n.index-t.index}),Fn("value")))})}function Bn(n,t,e,r){var u=p(t)?In:_n;u(n,t,e,r||h)}function Mn(n,t){function e(n){return n?r(n):void u(e)}var r=I(t||h),u=An(n);e()}function Un(n,t,e,r){r=y(r||h);var u={};B(n,t,function(n,t,r){e(n,t,function(n,e){return n?r(n):(u[t]=e,void r())})},function(n){r(n,u)})}function zn(n,t){return t in n}function Vn(n,t){var e=Object.create(null),o=Object.create(null);t=t||r;var i=ut(function(r,i){var c=t.apply(null,r);zn(e,c)?dr(function(){i.apply(null,e[c])}):zn(o,c)?o[c].push(i):(o[c]=[i],n.apply(null,r.concat([u(function(n){e[c]=n;var t=o[c];delete o[c];for(var r=0,u=t.length;r<u;r++)t[r].apply(null,n)})])))});return i.memo=e,i.unmemoized=n,i}function Pn(n,t,e){e=e||h;var r=p(t)?[]:{};n(t,function(n,t,e){n(u(function(n,u){u.length<=1&&(u=u[0]),r[t]=u,e(n)}))},function(n){e(n,r)})}function qn(n,t){Pn(Ee,n,t)}function Dn(n,t,e){Pn(_(t),n,e)}function Rn(n,t){if(t=y(t||h),!Ft(n))return t(new TypeError("First argument to race must be an array of functions"));if(!n.length)return t();for(var e=0,r=n.length;e<r;e++)n[e](t)}function Cn(n,t,e,r){var u=Rr.call(n).reverse();vn(u,t,e,r)}function $n(n){return ut(function(t,e){return t.push(u(function(n,t){if(n)e(null,{error:n});else{var r=null;1===t.length?r=t[0]:t.length>1&&(r=t),e(null,{value:r})}})),n.apply(this,t)})}function Wn(n,t,e,r){Bn(n,t,function(n,t){e(n,function(n,e){t(n,!e)})},r)}function Nn(n){var t;return Ft(n)?t=G(n,$n):(t={},C(n,function(n,e){t[e]=$n.call(this,n)})),t}function Qn(n){return function(){return n}}function Gn(n,t,e){function r(n,t){if("object"==typeof t)n.times=+t.times||o,n.intervalFunc="function"==typeof t.interval?t.interval:Qn(+t.interval||i),n.errorFilter=t.errorFilter;else{if("number"!=typeof t&&"string"!=typeof t)throw new Error("Invalid arguments for async.retry");n.times=+t||o}}function u(){t(function(n){n&&f++<c.times&&("function"!=typeof c.errorFilter||c.errorFilter(n))?setTimeout(u,c.intervalFunc(f)):e.apply(null,arguments)})}var o=5,i=0,c={times:o,intervalFunc:Qn(i)};if(arguments.length<3&&"function"==typeof n?(e=t||h,t=n):(r(c,n),e=e||h),"function"!=typeof t)throw new Error("Invalid arguments for async.retry");var f=1;u()}function Hn(n,t){Pn(gr,n,t)}function Jn(n,t,e){function r(n,t){var e=n.criteria,r=t.criteria;return e<r?-1:e>r?1:0}Le(n,function(n,e){t(n,function(t,r){return t?e(t):void e(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,G(t.sort(r),Fn("value")))})}function Kn(n,t,e){function r(){c||(o.apply(null,arguments),clearTimeout(i))}function u(){var t=n.name||"anonymous",r=new Error('Callback function "'+t+'" timed out.');r.code="ETIMEDOUT",e&&(r.info=e),c=!0,o(r)}var o,i,c=!1;return ut(function(e,c){o=c,i=setTimeout(u,t),n.apply(null,e.concat(r))})}function Xn(n,t,e,r){for(var u=-1,o=Kr(Jr((t-n)/(e||1)),0),i=Array(o);o--;)i[r?o:++u]=n,n+=e;return i}function Yn(n,t,e,r){Te(Xn(0,n,1),t,e,r)}function Zn(n,t,e,r){3===arguments.length&&(r=e,e=t,t=Ft(n)?[]:{}),r=y(r||h),Ee(n,function(n,r,u){e(t,n,r,u)},function(n){r(n,t)})}function nt(n){return function(){return(n.unmemoized||n).apply(null,arguments)}}function tt(n,t,e){if(e=I(e||h),!n())return e(null);var r=u(function(u,o){return u?e(u):n()?t(r):void e.apply(null,[null].concat(o))});t(r)}function et(n,t,e){tt(function(){return!n.apply(this,arguments)},t,e)}var rt=Math.max,ut=function(n){return u(function(t){var e=t.pop();n.call(this,t,e)})},ot="object"==typeof global&&global&&global.Object===Object&&global,it="object"==typeof self&&self&&self.Object===Object&&self,ct=ot||it||Function("return this")(),ft=ct.Symbol,at=Object.prototype,lt=at.hasOwnProperty,st=at.toString,pt=ft?ft.toStringTag:void 0,ht=Object.prototype,yt=ht.toString,vt="[object Null]",dt="[object Undefined]",mt=ft?ft.toStringTag:void 0,gt="[object AsyncFunction]",bt="[object Function]",jt="[object GeneratorFunction]",St="[object Proxy]",kt=9007199254740991,wt="function"==typeof Symbol&&Symbol.iterator,xt=function(n){return wt&&n[wt]&&n[wt]()},Ot="[object Arguments]",Et=Object.prototype,Lt=Et.hasOwnProperty,At=Et.propertyIsEnumerable,Tt=m(function(){return arguments}())?m:function(n){return d(n)&&Lt.call(n,"callee")&&!At.call(n,"callee")},Ft=Array.isArray,It="object"==typeof n&&n&&!n.nodeType&&n,_t=It&&"object"==typeof module&&module&&!module.nodeType&&module,Bt=_t&&_t.exports===It,Mt=Bt?ct.Buffer:void 0,Ut=Mt?Mt.isBuffer:void 0,zt=Ut||g,Vt=9007199254740991,Pt=/^(?:0|[1-9]\d*)$/,qt="[object Arguments]",Dt="[object Array]",Rt="[object Boolean]",Ct="[object Date]",$t="[object Error]",Wt="[object Function]",Nt="[object Map]",Qt="[object Number]",Gt="[object Object]",Ht="[object RegExp]",Jt="[object Set]",Kt="[object String]",Xt="[object WeakMap]",Yt="[object ArrayBuffer]",Zt="[object DataView]",ne="[object Float32Array]",te="[object Float64Array]",ee="[object Int8Array]",re="[object Int16Array]",ue="[object Int32Array]",oe="[object Uint8Array]",ie="[object Uint8ClampedArray]",ce="[object Uint16Array]",fe="[object Uint32Array]",ae={};ae[ne]=ae[te]=ae[ee]=ae[re]=ae[ue]=ae[oe]=ae[ie]=ae[ce]=ae[fe]=!0,ae[qt]=ae[Dt]=ae[Yt]=ae[Rt]=ae[Zt]=ae[Ct]=ae[$t]=ae[Wt]=ae[Nt]=ae[Qt]=ae[Gt]=ae[Ht]=ae[Jt]=ae[Kt]=ae[Xt]=!1;var le,se="object"==typeof n&&n&&!n.nodeType&&n,pe=se&&"object"==typeof module&&module&&!module.nodeType&&module,he=pe&&pe.exports===se,ye=he&&ot.process,ve=function(){try{return ye&&ye.binding("util")}catch(n){}}(),de=ve&&ve.isTypedArray,me=de?S(de):j,ge=Object.prototype,be=ge.hasOwnProperty,je=Object.prototype,Se=x(Object.keys,Object),ke=Object.prototype,we=ke.hasOwnProperty,xe={},Oe=M(B,1/0),Ee=function(n,t,e){var r=p(n)?U:Oe;r(n,t,e)},Le=z(V),Ae=o(Le),Te=P(V),Fe=M(Te,1),Ie=o(Fe),_e=u(function(n,t){return u(function(e){return n.apply(null,t.concat(e))})}),Be=R(),Me=function(n,t,e){function r(n,t){b.push(function(){f(n,t)})}function o(){if(0===b.length&&0===d)return e(null,v);for(;b.length&&d<t;){var n=b.shift();n()}}function i(n,t){var e=g[n];e||(e=g[n]=[]),e.push(t)}function c(n){var t=g[n]||[];D(t,function(n){n()}),o()}function f(n,t){if(!m){var r=I(u(function(t,r){if(d--,r.length<=1&&(r=r[0]),t){var u={};C(v,function(n,t){u[t]=n}),u[n]=r,m=!0,g=[],e(t,u)}else v[n]=r,c(n)}));d++;var o=t[t.length-1];t.length>1?o(v,r):o(r)}}function a(){for(var n,t=0;j.length;)n=j.pop(),t++,D(l(n),function(n){0===--S[n]&&j.push(n)});if(t!==p)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}function l(t){var e=[];return C(n,function(n,r){Ft(n)&&Q(n,t,0)>=0&&e.push(r)}),e}"function"==typeof t&&(e=t,t=null),e=y(e||h);var s=E(n),p=s.length;if(!p)return e(null);t||(t=p);var v={},d=0,m=!1,g={},b=[],j=[],S={};C(n,function(t,e){if(!Ft(t))return r(e,[t]),void j.push(e);var u=t.slice(0,t.length-1),o=u.length;return 0===o?(r(e,t),void j.push(e)):(S[e]=o,void D(u,function(c){if(!n[c])throw new Error("async.auto task `"+e+"` has a non-existent dependency in "+u.join(", "));i(c,function(){o--,0===o&&r(e,t)})}))}),a(),o()},Ue="[object Symbol]",ze=1/0,Ve=ft?ft.prototype:void 0,Pe=Ve?Ve.toString:void 0,qe="\\ud800-\\udfff",De="\\u0300-\\u036f\\ufe20-\\ufe23",Re="\\u20d0-\\u20f0",Ce="\\ufe0e\\ufe0f",$e="\\u200d",We=RegExp("["+$e+qe+De+Re+Ce+"]"),Ne="\\ud800-\\udfff",Qe="\\u0300-\\u036f\\ufe20-\\ufe23",Ge="\\u20d0-\\u20f0",He="\\ufe0e\\ufe0f",Je="["+Ne+"]",Ke="["+Qe+Ge+"]",Xe="\\ud83c[\\udffb-\\udfff]",Ye="(?:"+Ke+"|"+Xe+")",Ze="[^"+Ne+"]",nr="(?:\\ud83c[\\udde6-\\uddff]){2}",tr="[\\ud800-\\udbff][\\udc00-\\udfff]",er="\\u200d",rr=Ye+"?",ur="["+He+"]?",or="(?:"+er+"(?:"+[Ze,nr,tr].join("|")+")"+ur+rr+")*",ir=ur+rr+or,cr="(?:"+[Ze+Ke+"?",Ke,nr,tr,Je].join("|")+")",fr=RegExp(Xe+"(?="+Xe+")|"+cr+ir,"g"),ar=/^\s+|\s+$/g,lr=/^(function)?\s*[^\(]*\(\s*([^\)]*)\)/m,sr=/,/,pr=/(=.+)?(\s*)$/,hr=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,yr="function"==typeof setImmediate&&setImmediate,vr="object"==typeof process&&"function"==typeof process.nextTick;le=yr?setImmediate:vr?process.nextTick:an;var dr=ln(le);sn.prototype.removeLink=function(n){return n.prev?n.prev.next=n.next:this.head=n.next,n.next?n.next.prev=n.prev:this.tail=n.prev,n.prev=n.next=null,this.length-=1,n},sn.prototype.empty=sn,sn.prototype.insertAfter=function(n,t){t.prev=n,t.next=n.next,n.next?n.next.prev=t:this.tail=t,n.next=t,this.length+=1},sn.prototype.insertBefore=function(n,t){t.prev=n.prev,t.next=n,n.prev?n.prev.next=t:this.head=t,n.prev=t,this.length+=1},sn.prototype.unshift=function(n){this.head?this.insertBefore(this.head,n):pn(this,n)},sn.prototype.push=function(n){this.tail?this.insertAfter(this.tail,n):pn(this,n)},sn.prototype.shift=function(){return this.head&&this.removeLink(this.head)},sn.prototype.pop=function(){return this.tail&&this.removeLink(this.tail)};var mr,gr=M(B,1),br=u(function(n){return u(function(t){var e=this,r=t[t.length-1];"function"==typeof r?t.pop():r=h,vn(n,t,function(n,t,r){t.apply(e,n.concat([u(function(n,t){r(n,t)})]))},function(n,t){r.apply(e,[n].concat(t))})})}),jr=u(function(n){return br.apply(null,n.reverse())}),Sr=z(dn),kr=mn(dn),wr=u(function(n){var t=[null].concat(n);return ut(function(n,e){return e.apply(this,t)})}),xr=gn(Ee,r,bn),Or=gn(B,r,bn),Er=gn(gr,r,bn),Lr=jn("dir"),Ar=M(Ln,1),Tr=gn(Ee,Tn,Tn),Fr=gn(B,Tn,Tn),Ir=M(Fr,1),_r=z(Bn),Br=P(Bn),Mr=M(Br,1),Ur=jn("log"),zr=M(Un,1/0),Vr=M(Un,1);mr=vr?process.nextTick:yr?setImmediate:an;var Pr=ln(mr),qr=function(n,t){return hn(function(t,e){n(t[0],e)},t,1)},Dr=function(n,t){var e=qr(n,t);return e.push=function(n,t,r){if(null==r&&(r=h),"function"!=typeof r)throw new Error("task callback must be a function");if(e.started=!0,Ft(n)||(n=[n]),0===n.length)return dr(function(){e.drain()});t=t||0;for(var u=e._tasks.head;u&&t>=u.priority;)u=u.next;for(var o=0,i=n.length;o<i;o++){var c={data:n[o],priority:t,callback:r};u?e._tasks.insertBefore(u,c):e._tasks.push(c)}dr(e.process)},delete e.unshift,e},Rr=Array.prototype.slice,Cr=z(Wn),$r=P(Wn),Wr=M($r,1),Nr=function(n,t){return t||(t=n,n=null),ut(function(e,r){function u(n){t.apply(null,e.concat([n]))}n?Gn(n,u,r):Gn(u,r)})},Qr=gn(Ee,Boolean,r),Gr=gn(B,Boolean,r),Hr=M(Gr,1),Jr=Math.ceil,Kr=Math.max,Xr=M(Yn,1/0),Yr=M(Yn,1),Zr=function(n,t){function e(o){if(r===n.length)return t.apply(null,[null].concat(o));var i=I(u(function(n,r){return n?t.apply(null,[n].concat(r)):void e(r)}));o.push(i);var c=n[r++];c.apply(null,o)}if(t=y(t||h),!Ft(n))return t(new Error("First argument to waterfall must be an array of functions"));if(!n.length)return t();var r=0;e([])},nu={applyEach:Ae,applyEachSeries:Ie,apply:_e,asyncify:q,auto:Me,autoInject:fn,cargo:yn,compose:jr,concat:Sr,concatSeries:kr,constant:wr,detect:xr,detectLimit:Or,detectSeries:Er,dir:Lr,doDuring:Sn,doUntil:wn,doWhilst:kn,during:xn,each:En,eachLimit:Ln,eachOf:Ee,eachOfLimit:B,eachOfSeries:gr,eachSeries:Ar,ensureAsync:An,every:Tr,everyLimit:Fr,everySeries:Ir,filter:_r,filterLimit:Br,filterSeries:Mr,forever:Mn,log:Ur,map:Le,mapLimit:Te,mapSeries:Fe,mapValues:zr,mapValuesLimit:Un,mapValuesSeries:Vr,memoize:Vn,nextTick:Pr,parallel:qn,parallelLimit:Dn,priorityQueue:Dr,queue:qr,race:Rn,reduce:vn,reduceRight:Cn,reflect:$n,reflectAll:Nn,reject:Cr,rejectLimit:$r,rejectSeries:Wr,retry:Gn,retryable:Nr,seq:br,series:Hn,setImmediate:dr,some:Qr,someLimit:Gr,someSeries:Hr,sortBy:Jn,timeout:Kn,times:Xr,timesLimit:Yn,timesSeries:Yr,transform:Zn,unmemoize:nt,until:et,waterfall:Zr,whilst:tt,all:Tr,any:Qr,forEach:En,forEachSeries:Ar,forEachLimit:Ln,forEachOf:Ee,forEachOfSeries:gr,forEachOfLimit:B,inject:vn,foldl:vn,foldr:Cn,select:_r,selectLimit:Br,selectSeries:Mr,wrapSync:q};n.default=nu,n.applyEach=Ae,n.applyEachSeries=Ie,n.apply=_e,n.asyncify=q,n.auto=Me,n.autoInject=fn,n.cargo=yn,n.compose=jr,n.concat=Sr,n.concatSeries=kr,n.constant=wr,n.detect=xr,n.detectLimit=Or,n.detectSeries=Er,n.dir=Lr,n.doDuring=Sn,n.doUntil=wn,n.doWhilst=kn,n.during=xn,n.each=En,n.eachLimit=Ln,n.eachOf=Ee,n.eachOfLimit=B,n.eachOfSeries=gr,n.eachSeries=Ar,n.ensureAsync=An,n.every=Tr,n.everyLimit=Fr,n.everySeries=Ir,n.filter=_r,n.filterLimit=Br,n.filterSeries=Mr,n.forever=Mn,n.log=Ur,n.map=Le,n.mapLimit=Te,n.mapSeries=Fe,n.mapValues=zr,n.mapValuesLimit=Un,n.mapValuesSeries=Vr,n.memoize=Vn,n.nextTick=Pr,n.parallel=qn,n.parallelLimit=Dn,n.priorityQueue=Dr,n.queue=qr,n.race=Rn,n.reduce=vn,n.reduceRight=Cn,n.reflect=$n,n.reflectAll=Nn,n.reject=Cr,n.rejectLimit=$r,n.rejectSeries=Wr,n.retry=Gn,n.retryable=Nr,n.seq=br,n.series=Hn,n.setImmediate=dr,n.some=Qr,n.someLimit=Gr,n.someSeries=Hr,n.sortBy=Jn,n.timeout=Kn,n.times=Xr,n.timesLimit=Yn,n.timesSeries=Yr,n.transform=Zn,n.unmemoize=nt,n.until=et,n.waterfall=Zr,n.whilst=tt,n.all=Tr,n.allLimit=Fr,n.allSeries=Ir,n.any=Qr,n.anyLimit=Gr,n.anySeries=Hr,n.find=xr,n.findLimit=Or,n.findSeries=Er,n.forEach=En,n.forEachSeries=Ar,n.forEachLimit=Ln,n.forEachOf=Ee,n.forEachOfSeries=gr,n.forEachOfLimit=B,n.inject=vn,n.foldl=vn,n.foldr=Cn,n.select=_r,n.selectLimit=Br,n.selectSeries=Mr,n.wrapSync=q,Object.defineProperty(n,"__esModule",{value:!0})});
//# sourceMappingURL=async.min.map