text: (function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.RSVP=t.RSVP||{})})(this,function(t){"use strict";function e(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function r(t){var e=t._promiseCallbacks;e||(e=t._promiseCallbacks={});return e}function n(t,e){if("onerror"!==t){if(2!==arguments.length)return bt[t];bt[t]=e}else bt.on("error",e)}function o(t){return"function"==typeof t||"object"==typeof t&&null!==t}function i(t){return"function"==typeof t}function u(t){return"object"==typeof t&&null!==t}function s(){}function a(){setTimeout(function(){for(var t=0;t<St.length;t++){var e=St[t],r=e.payload;r.guid=r.key+r.id;r.childGuid=r.key+r.childId;r.error&&(r.stack=r.error.stack);bt.trigger(e.name,e.payload)}St.length=0},50)}function c(t,e,r){1===St.push({name:t,payload:{key:e._guidKey,id:e._id,eventName:t,detail:e._result,childId:r&&r._id,label:e._label,timeStamp:At(),error:bt["instrument-with-stack"]?new Error(e._label):null}})&&a()}function f(t,e){var r=this;if(t&&"object"==typeof t&&t.constructor===r)return t;var n=new r(h,e);m(n,t);return n}function l(){return new TypeError("A promises callback cannot return that same promise.")}function h(){}function p(t){try{return t.then}catch(e){Rt.error=e;return Rt}}function v(t,e,r,n){try{t.call(e,r,n)}catch(o){return o}}function d(t,e,r){bt.async(function(t){var n=!1,o=v(r,e,function(r){if(!n){n=!0;e!==r?m(t,r,void 0):g(t,r)}},function(e){if(!n){n=!0;b(t,e)}},"Settle: "+(t._label||" unknown promise"));if(!n&&o){n=!0;b(t,o)}},t)}function _(t,e){if(e._state===Ot)g(t,e._result);else if(e._state===Ct){e._onError=null;b(t,e._result)}else E(e,void 0,function(r){e!==r?m(t,r,void 0):g(t,r)},function(e){return b(t,e)})}function y(t,e,r){if(e.constructor===t.constructor&&r===O&&t.constructor.resolve===f)_(t,e);else if(r===Rt){b(t,Rt.error);Rt.error=null}else void 0===r?g(t,e):i(r)?d(t,e,r):g(t,e)}function m(t,e){t===e?g(t,e):o(e)?y(t,e,p(e)):g(t,e)}function w(t){t._onError&&t._onError(t._result);j(t)}function g(t,e){if(t._state===kt){t._result=e;t._state=Ot;0===t._subscribers.length?bt.instrument&&c("fulfilled",t):bt.async(j,t)}}function b(t,e){if(t._state===kt){t._state=Ct;t._result=e;bt.async(w,t)}}function E(t,e,r,n){var o=t._subscribers,i=o.length;t._onError=null;o[i]=e;o[i+Ot]=r;o[i+Ct]=n;0===i&&t._state&&bt.async(j,t)}function j(t){var e=t._subscribers,r=t._state;bt.instrument&&c(r===Ot?"fulfilled":"rejected",t);if(0!==e.length){for(var n=void 0,o=void 0,i=t._result,u=0;u<e.length;u+=3){n=e[u];o=e[u+r];n?S(r,n,o,i):o(i)}t._subscribers.length=0}}function A(){this.error=null}function T(t,e){try{return t(e)}catch(r){Mt.error=r;return Mt}}function S(t,e,r,n){var o=i(r),u=void 0,s=void 0,a=void 0,c=void 0;if(o){u=T(r,n);if(u===Mt){c=!0;s=u.error;u.error=null}else a=!0;if(e===u){b(e,l());return}}else{u=n;a=!0}e._state!==kt||(o&&a?m(e,u):c?b(e,s):t===Ot?g(e,u):t===Ct&&b(e,u))}function k(t,e){var r=!1;try{e(function(e){if(!r){r=!0;m(t,e)}},function(e){if(!r){r=!0;b(t,e)}})}catch(n){b(t,n)}}function O(t,e,r){var n=arguments,o=this,i=o._state;if(i===Ot&&!t||i===Ct&&!e){bt.instrument&&c("chained",o,o);return o}o._onError=null;var u=new o.constructor(h,r),s=o._result;bt.instrument&&c("chained",o,u);i?function(){var t=n[i-1];bt.async(function(){return S(i,u,t,s)})}():E(o,u,t,e);return u}function C(t,e,r){return t===Ot?{state:"fulfilled",value:r}:{state:"rejected",reason:r}}function R(t,e,r,n){this._instanceConstructor=t;this.promise=new t(h,n);this._abortOnReject=r;if(this._validateInput(e)){this._input=e;this.length=e.length;this._remaining=e.length;this._init();if(0===this.length)g(this.promise,this._result);else{this.length=this.length||0;this._enumerate();0===this._remaining&&g(this.promise,this._result)}}else b(this.promise,this._validationError())}function M(t,e){return new R(this,t,(!0),e).promise}function P(t,e){var r=this,n=new r(h,e);if(!jt(t)){b(n,new TypeError("You must pass an array to race."));return n}for(var o=0;n._state===kt&&o<t.length;o++)E(r.resolve(t[o]),void 0,function(t){return m(n,t)},function(t){return b(n,t)});return n}function I(t,e){var r=this,n=new r(h,e);b(n,t);return n}function x(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function N(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function Y(t,e){this._id=It++;this._label=e;this._state=void 0;this._result=void 0;this._subscribers=[];bt.instrument&&c("created",this);if(h!==t){"function"!=typeof t&&x();this instanceof Y?k(this,t):N()}}function D(){this.value=void 0}function K(t){try{return t.then}catch(e){xt.value=e;return xt}}function U(t,e,r){try{t.apply(e,r)}catch(n){xt.value=n;return xt}}function q(t,e){for(var r={},n=t.length,o=new Array(n),i=0;i<n;i++)o[i]=t[i];for(var u=0;u<e.length;u++){var s=e[u];r[s]=o[u+1]}return r}function V(t){for(var e=t.length,r=new Array(e-1),n=1;n<e;n++)r[n-1]=t[n];return r}function F(t,e){return{then:function(r,n){return t.call(e,r,n)}}}function G(t,e){var r=function(){for(var r=this,n=arguments.length,o=new Array(n+1),i=!1,u=0;u<n;++u){var s=arguments[u];if(!i){i=$(s);if(i===Nt){var a=new Y(h);b(a,Nt.value);return a}i&&i!==!0&&(s=F(i,s))}o[u]=s}var c=new Y(h);o[n]=function(t,r){t?b(c,t):void 0===e?m(c,r):e===!0?m(c,V(arguments)):jt(e)?m(c,q(arguments,e)):m(c,r)};return i?W(c,o,t,r):L(c,o,t,r)};r.__proto__=t;return r}function L(t,e,r,n){var o=U(r,n,e);o===xt&&b(t,o.value);return t}function W(t,e,r,n){return Y.all(e).then(function(e){var o=U(r,n,e);o===xt&&b(t,o.value);return t})}function $(t){return!(!t||"object"!=typeof t)&&(t.constructor===Y||K(t))}function z(t,e){return Y.all(t,e)}function B(t,e,r){this._superConstructor(t,e,!1,r)}function H(t,e){return new B(Y,t,e).promise}function J(t,e){return Y.race(t,e)}function Q(t,e,r){this._superConstructor(t,e,!0,r)}function X(t,e){return new Q(Y,t,e).promise}function Z(t,e,r){this._superConstructor(t,e,!1,r)}function tt(t,e){return new Z(Y,t,e).promise}function et(t){setTimeout(function(){throw t});throw t}function rt(t){var e={resolve:void 0,reject:void 0};e.promise=new Y(function(t,r){e.resolve=t;e.reject=r},t);return e}function nt(t,e,r){return Y.all(t,r).then(function(t){if(!i(e))throw new TypeError("You must pass a function as map's second argument.");for(var n=t.length,o=new Array(n),u=0;u<n;u++)o[u]=e(t[u]);return Y.all(o,r)})}function ot(t,e){return Y.resolve(t,e)}function it(t,e){return Y.reject(t,e)}function ut(t,e){return Y.all(t,e)}function st(t,e){return Y.resolve(t,e).then(function(t){return ut(t,e)})}function at(t,e,r){var n=jt(t)?ut(t,r):st(t,r);return n.then(function(t){if(!i(e))throw new TypeError("You must pass a function as filter's second argument.");for(var n=t.length,o=new Array(n),u=0;u<n;u++)o[u]=e(t[u]);return ut(o,r).then(function(e){for(var r=new Array(n),o=0,i=0;i<n;i++)if(e[i]){r[o]=t[i];o++}r.length=o;return r})})}function ct(t,e){Gt[Yt]=t;Gt[Yt+1]=e;Yt+=2;2===Yt&&Lt()}function ft(){var t=process.nextTick,e=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);Array.isArray(e)&&"0"===e[1]&&"10"===e[2]&&(t=setImmediate);return function(){return t(dt)}}function lt(){return"undefined"!=typeof Dt?function(){Dt(dt)}:vt()}function ht(){var t=0,e=new qt(dt),r=document.createTextNode("");e.observe(r,{characterData:!0});return function(){return r.data=t=++t%2}}function pt(){var t=new MessageChannel;t.port1.onmessage=dt;return function(){return t.port2.postMessage(0)}}function vt(){return function(){return setTimeout(dt,1)}}function dt(){for(var t=0;t<Yt;t+=2){var e=Gt[t],r=Gt[t+1];e(r);Gt[t]=void 0;Gt[t+1]=void 0}Yt=0}function _t(){try{var t=require,e=t("vertx");Dt=e.runOnLoop||e.runOnContext;return lt()}catch(r){return vt()}}function yt(t,e,r){e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r;return t}function mt(){bt.on.apply(bt,arguments)}function wt(){bt.off.apply(bt,arguments)}var gt={mixin:function(t){t.on=this.on;t.off=this.off;t.trigger=this.trigger;t._promiseCallbacks=void 0;return t},on:function(t,n){if("function"!=typeof n)throw new TypeError("Callback must be a function");var o=r(this),i=void 0;i=o[t];i||(i=o[t]=[]);e(i,n)===-1&&i.push(n)},off:function(t,n){var o=r(this),i=void 0,u=void 0;if(n){i=o[t];u=e(i,n);u!==-1&&i.splice(u,1)}else o[t]=[]},trigger:function(t,e,n){var o=r(this),i=void 0,u=void 0;if(i=o[t])for(var s=0;s<i.length;s++){u=i[s];u(e,n)}}},bt={instrument:!1};gt.mixin(bt);var Et=void 0;Et=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var jt=Et,At=Date.now||function(){return(new Date).getTime()},Tt=Object.create||function(t){if(arguments.length>1)throw new Error("Second argument not supported");if("object"!=typeof t)throw new TypeError("Argument must be an object");s.prototype=t;return new s},St=[],kt=void 0,Ot=1,Ct=2,Rt=new A,Mt=new A;R.prototype._validateInput=function(t){return jt(t)};R.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")};R.prototype._init=function(){this._result=new Array(this.length)};R.prototype._enumerate=function(){for(var t=this.length,e=this.promise,r=this._input,n=0;e._state===kt&&n<t;n++)this._eachEntry(r[n],n)};R.prototype._settleMaybeThenable=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===f){var o=p(t);if(o===O&&t._state!==kt){t._onError=null;this._settledAt(t._state,e,t._result)}else if("function"!=typeof o){this._remaining--;this._result[e]=this._makeResult(Ot,e,t)}else if(r===Y){var i=new r(h);y(i,t,o);this._willSettleAt(i,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)};R.prototype._eachEntry=function(t,e){if(u(t))this._settleMaybeThenable(t,e);else{this._remaining--;this._result[e]=this._makeResult(Ot,e,t)}};R.prototype._settledAt=function(t,e,r){var n=this.promise;if(n._state===kt){this._remaining--;this._abortOnReject&&t===Ct?b(n,r):this._result[e]=this._makeResult(t,e,r)}0===this._remaining&&g(n,this._result)};R.prototype._makeResult=function(t,e,r){return r};R.prototype._willSettleAt=function(t,e){var r=this;E(t,void 0,function(t){return r._settledAt(Ot,e,t)},function(t){return r._settledAt(Ct,e,t)})};var Pt="rsvp_"+At()+"-",It=0;Y.cast=f;Y.all=M;Y.race=P;Y.resolve=f;Y.reject=I;Y.prototype={constructor:Y,_guidKey:Pt,_onError:function(t){var e=this;bt.after(function(){e._onError&&bt.trigger("error",t,e._label)})},then:O,"catch":function(t,e){return this.then(void 0,t,e)},"finally":function(t,e){var r=this,n=r.constructor;return r.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){throw e})},e)}};var xt=new D,Nt=new D;B.prototype=Tt(R.prototype);B.prototype._superConstructor=R;B.prototype._makeResult=C;B.prototype._validationError=function(){return new Error("allSettled must be called with an array")};Q.prototype=Tt(R.prototype);Q.prototype._superConstructor=R;Q.prototype._init=function(){this._result={}};Q.prototype._validateInput=function(t){return t&&"object"==typeof t};Q.prototype._validationError=function(){return new Error("Promise.hash must be called with an object")};Q.prototype._enumerate=function(){var t=this,e=t.promise,r=t._input,n=[];for(var o in r)e._state===kt&&Object.prototype.hasOwnProperty.call(r,o)&&n.push({position:o,entry:r[o]});var i=n.length;t._remaining=i;for(var u=void 0,s=0;e._state===kt&&s<i;s++){u=n[s];t._eachEntry(u.entry,u.position)}};Z.prototype=Tt(Q.prototype);Z.prototype._superConstructor=R;Z.prototype._makeResult=C;Z.prototype._validationError=function(){return new Error("hashSettled must be called with an object")};var Yt=0,Dt=void 0,Kt="undefined"!=typeof window?window:void 0,Ut=Kt||{},qt=Ut.MutationObserver||Ut.WebKitMutationObserver,Vt="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),Ft="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Gt=new Array(1e3),Lt=void 0;Lt=Vt?ft():qt?ht():Ft?pt():void 0===Kt&&"function"==typeof require?_t():vt();var Wt=void 0;if("object"==typeof self)Wt=self;else{if("object"!=typeof global)throw new Error("no global: `self` or `global` found");Wt=global}var $t;bt.async=ct;bt.after=function(t){return setTimeout(t,0)};var zt=ot,Bt=function(t,e){return bt.async(t,e)};if("undefined"!=typeof window&&"object"==typeof window.__PROMISE_INSTRUMENTATION__){var Ht=window.__PROMISE_INSTRUMENTATION__;n("instrument",!0);for(var Jt in Ht)Ht.hasOwnProperty(Jt)&&mt(Jt,Ht[Jt])}var Qt=($t={asap:ct,cast:zt,Promise:Y,EventTarget:gt,all:z,allSettled:H,race:J,hash:X,hashSettled:tt,rethrow:et,defer:rt,denodeify:G,configure:n,on:mt,off:wt,resolve:ot,reject:it,map:nt},yt($t,"async",Bt),yt($t,"filter",at),$t);t["default"]=Qt;t.asap=ct;t.cast=zt;t.Promise=Y;t.EventTarget=gt;t.all=z;t.allSettled=H;t.race=J;t.hash=X;t.hashSettled=tt;t.rethrow=et;t.defer=rt;t.denodeify=G;t.configure=n;t.on=mt;t.off=wt;t.resolve=ot;t.reject=it;t.map=nt;t.async=Bt;t.filter=at;Object.defineProperty(t,"__esModule",{value:!0})});