o._promiseFulfilled(void0),s}},e.coroutine.addYieldHandler=function(t){if("function"!=typeoft)thrownewu("expecting a function but got "+p.classString(t));_.push(t)},e.spawn=function(t){if(s.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeoft)returnn("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");varr=newc(t,this),i=r.promise();returnr._run(e.spawn),i}}},{"./errors":12,"./util":36}],17:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){vara=t("./util");a.canEvaluate,a.tryCatch,a.errorObj;e.join=function(){vart,e=arguments.length-1;if(e>0&&"function"==typeofarguments[e]){t=arguments[e];varr}vari=[].slice.call(arguments);t&&i.pop();varr=newn(i).promise();returnvoid0!==t?r.spread(t):r}}},{"./util":36}],18:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){functiona(t,e,n,r){this.constructor$(t),this._promise._captureStackTrace();vari=l();this._callback=null===i?e:u.domainBind(i,e),this._preservedValues=r===o?newArray(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],f.invoke(this._asyncInit,this,void0)}functionc(t,n,i,o){if("function"!=typeofn)returnr("expecting a function but got "+u.classString(n));vars=0;if(void0!==i){if("object"!=typeofi||null===i)returne.reject(newTypeError("options argument must be an object but it is "+u.classString(i)));if("number"!=typeofi.concurrency)returne.reject(newTypeError("'concurrency' must be a number but it is "+u.classString(i.concurrency)));s=i.concurrency}returns="number"==typeofs&&isFinite(s)&&s>=1?s:0,newa(t,n,s,o).promise()}varl=e._getDomain,u=t("./util"),p=u.tryCatch,h=u.errorObj,f=e._async;u.inherits(a,n),a.prototype._asyncInit=function(){this._init$(void0,-2)},a.prototype._init=function(){},a.prototype._promiseFulfilled=function(t,n){varr=this._values,o=this.length(),a=this._preservedValues,c=this._limit;if(0>n){if(n=-1*n-1,r[n]=t,c>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(c>=1&&this._inFlight>=c)returnr[n]=t,this._queue.push(n),!1;null!==a&&(a[n]=t);varl=this._promise,u=this._callback,f=l._boundValue();l._pushContext();var_=p(u).call(f,t,n,o),d=l._popContext();if(s.checkForgottenReturns(_,d,null!==a?"Promise.filter":"Promise.map",l),_===h)returnthis._reject(_.e),!0;varv=i(_,this._promise);if(vinstanceofe){v=v._target();vary=v._bitField;if(0===(50397184&y))returnc>=1&&this._inFlight++,r[n]=v,v._proxy(this,-1*(n+1)),!1;if(0===(33554432&y))return0!==(16777216&y)?(this._reject(v._reason()),!0):(this._cancel(),!0);_=v._value()}r[n]=_}varm=++this._totalResolved;returnm>=o?(null!==a?this._filter(r,a):this._resolve(r),!0):!1},a.prototype._drainQueue=function(){for(vart=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;varr=t.pop();this._promiseFulfilled(n[r],r)}},a.prototype._filter=function(t,e){for(varn=e.length,r=newArray(n),i=0,o=0;n>o;++o)t[o]&&(r[i++]=e[o]);r.length=i,this._resolve(r)},a.prototype.preservedValues=function(){returnthis._preservedValues},e.prototype.map=function(t,e){returnc(this,t,e,null)},e.map=function(t,e,n,r){returnc(t,e,n,r)}}},{"./util":36}],19:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){vars=t("./util"),a=s.tryCatch;e.method=function(t){if("function"!=typeoft)thrownewe.TypeError("expecting a function but got "+s.classString(t));returnfunction(){varr=newe(n);r._captureStackTrace(),r._pushContext();vari=a(t).apply(this,arguments),s=r._popContext();returno.checkForgottenReturns(i,s,"Promise.method",r),r._resolveFromSyncValue(i),r}},e.attempt=e["try"]=function(t){if("function"!=typeoft)returni("expecting a function but got "+s.classString(t));varr=newe(n);r._captureStackTrace(),r._pushContext();varc;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");varl=arguments[1],u=arguments[2];c=s.isArray(l)?a(t).apply(u,l):a(t).call(u,l)}elsec=a(t)();varp=r._popContext();returno.checkForgottenReturns(c,p,"Promise.try",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncV
if((0|e)!==e||0>e)returnr("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");varn=newi(t),o=n.promise();returnn.setHowMany(e),n.init(),o}vars=t("./util"),a=t("./errors").RangeError,c=t("./errors").AggregateError,l=s.isArray,u={};s.inherits(i,n),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)returnvoidthis._resolve([]);this._init$(void0,-5);vart=l(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){returnthis._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){returnthis._addFulfilled(t),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1},i.prototype._promiseRejected=function(t){returnthis._addRejected(t),this._checkOutcome()},i.prototype._promiseCancelled=function(){returnthis._valuesinstanceofe||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(vart=newc,e=this.length();e<this._values.length;++e)this._values[e]!==u&&t.push(this._values[e]);returnt.length>0?this._reject(t):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){returnthis._totalResolved},i.prototype._rejected=function(){returnthis._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){returnthis.length()-this._rejected()},i.prototype._getRangeError=function(t){vare="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";returnnewa(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){returno(t,e)},e.prototype.some=function(t){returno(this,t)},e._SomePromiseArray=i}},{"./errors":12,"./util":36}],32:[function(t,e,n){"use strict";e.exports=function(t){functione(t){void0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void0):(this._bitField=0,this._settledValueField=void0)}e.prototype._settledValue=function(){returnthis._settledValueField};varn=e.prototype.value=function(){if(!this.isFulfilled())thrownewTypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");returnthis._settledValue()},r=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())thrownewTypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");returnthis._settledValue()},i=e.prototype.isFulfilled=function(){return0!==(33554432&this._bitField)},o=e.prototype.isRejected=function(){return0!==(16777216&this._bitField)},s=e.prototype.isPending=function(){return0===(50397184&this._bitField)},a=e.prototype.isResolved=function(){return0!==(50331648&this._bitField)};e.prototype.isCancelled=function(){return0!==(8454144&this._bitField)},t.prototype.__isCancelled=function(){return65536===(65536&this._bitField)},t.prototype._isCancelled=function(){returnthis._target().__isCancelled()},t.prototype.isCancelled=function(){return0!==(8454144&this._target()._bitField)},t.prototype.isPending=function(){returns.call(this._target())},t.prototype.isRejected=function(){returno.call(this._target())},t.prototype.isFulfilled=function(){returni.call(this._target())},t.prototype.isResolved=function(){returna.call(this._target())},t.prototype.value=function(){returnn.call(this._target())},t.prototype.reason=function(){vart=this._target();returnt._unsetRejectionIsUnhandled(),r.call(t)},t.prototype._value=function(){returnthis._settledValue()},t.prototype._reason=function(){returnthis._unsetRejectionIsUnhandled(),this._settledValu