(function(){"use strict";functiona(a){return"function"==typeofa||"object"==typeofa&&null!==a}functionb(a){return"function"==typeofa}functionc(a){return"object"==typeofa&&null!==a}functiond(){}functione(a,b){for(varc=0,d=a.length;d>c;c++)if(a[c]===b)returnc;return-1}functionf(a){varb=a._promiseCallbacks;returnb||(b=a._promiseCallbacks={}),b}functiong(a,b){return"onerror"===a?voidva.on("error",b):2!==arguments.length?va[a]:void(va[a]=b)}functionh(){setTimeout(function(){for(vara,b=0;b<wa.length;b++){a=wa[b];varc=a.payload;c.guid=c.key+c.id,c.childGuid=c.key+c.childId,c.error&&(c.stack=c.error.stack),va.trigger(a.name,a.payload)}wa.length=0},50)}functioni(a,b,c){1===wa.push({name:a,payload:{key:b._guidKey,id:b._id,eventName:a,detail:b._result,childId:c&&c._id,label:b._label,timeStamp:sa(),error:va["instrument-with-stack"]?newError(b._label):null}})&&h()}functionj(){returnnewTypeError("A promises callback cannot return that same promise.")}functionk(){}functionl(a){try{returna.then}catch(b){returnBa.error=b,Ba}}functionm(a,b,c,d){try{a.call(b,c,d)}catch(e){returne}}functionn(a,b,c){va.async(function(a){vard=!1,e=m(c,b,function(c){d||(d=!0,b!==c?q(a,c):s(a,c))},function(b){d||(d=!0,t(a,b))},"Settle: "+(a._label||" unknown promise"));!d&&e&&(d=!0,t(a,e))},a)}functiono(a,b){b._state===za?s(a,b._result):b._state===Aa?(b._onError=null,t(a,b._result)):u(b,void0,function(c){b!==c?q(a,c):s(a,c)},function(b){t(a,b)})}functionp(a,c){if(c.constructor===a.constructor)o(a,c);else{vard=l(c);d===Ba?t(a,Ba.error):void0===d?s(a,c):b(d)?n(a,c,d):s(a,c)}}functionq(b,c){b===c?s(b,c):a(c)?p(b,c):s(b,c)}functionr(a){a._onError&&a._onError(a._result),v(a)}functions(a,b){a._state===ya&&(a._result=b,a._state=za,0===a._subscribers.length?va.instrument&&xa("fulfilled",a):va.async(v,a))}functiont(a,b){a._state===ya&&(a._state=Aa,a._result=b,va.async(r,a))}functionu(a,b,c,d){vare=a._subscribers,f=e.length;a._onError=null,e[f]=b,e[f+za]=c,e[f+Aa]=d,0===f&&a._state&&va.async(v,a)}functionv(a){varb=a._subscribers,c=a._state;if(va.instrument&&xa(c===za?"fulfilled":"rejected",a),0!==b.length){for(vard,e,f=a._result,g=0;g<b.length;g+=3)d=b[g],e=b[g+c],d?y(c,d,e,f):e(f);a._subscribers.length=0}}functionw(){this.error=null}functionx(a,b){try{returna(b)}catch(c){returnCa.error=c,Ca}}functiony(a,c,d,e){varf,g,h,i,k=b(d);if(k){if(f=x(d,e),f===Ca?(i=!0,g=f.error,f=null):h=!0,c===f)returnvoidt(c,j())}elsef=e,h=!0;c._state!==ya||(k&&h?q(c,f):i?t(c,g):a===za?s(c,f):a===Aa&&t(c,f))}functionz(a,b){varc=!1;try{b(function(b){c||(c=!0,q(a,b))},function(b){c||(c=!0,t(a,b))})}catch(d){t(a,d)}}functionA(a,b,c){returna===za?{state:"fulfilled",value:c}:{state:"rejected",reason:c}}functionB(a,b,c,d){vare=this;e._instanceConstructor=a,e.promise=newa(k,d),e._abortOnReject=c,e._validateInput(b)?(e._input=b,e.length=b.length,e._remaining=b.length,e._init(),0===e.length?s(e.promise,e._result):(e.length=e.length||0,e._enumerate(),0===e._remaining&&s(e.promise,e._result))):t(e.promise,e._validationError())}functionC(a,b){returnnewDa(this,a,!0,b).promise}functionD(a,b){functionc(a){q(f,a)}functiond(a){t(f,a)}vare=this,f=newe(k,b);if(!ra(a))returnt(f,newTypeError("You must pass an array to race.")),f;for(varg=a.length,h=0;f._state===ya&&g>h;h++)u(e.resolve(a[h]),void0,c,d);returnf}functionE(a,b){varc=this;if(a&&"object"==typeofa&&a.constructor===c)returna;vard=newc(k,b);returnq(d,a),d}functionF(a,b){varc=this,d=newc(k,b);returnt(d,a),d}functionG(){thrownewTypeError("You must pass a resolver function as the first argument to the promise constructor")}functionH(){thrownewTypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}functionI(a,c){vard=this;d._id=Ja++,d._label=c,d._state=void0,d._result=void0,d._subscribers=[],va.instrument&&xa("created",d),k!==a&&(b(a)||G(),dinstanceofI||H(),z(d,a))}functionJ(a,b,c){this._superConstructor(a,b,!1,c)}functionK(a,b){returnnewJ(Ka,a,b).promise}functionL(a,b){returnKa.all(a