quadre-git
Version:
Integration of Git into Quadre
2 lines • 77.1 kB
JavaScript
define(function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=r(25)();o.noConflict=n,t.exports=o},function(t,e,r){(function(e){"use strict";function n(){try{var t=T;return T=null,t.apply(this,arguments)}catch(t){return F.e=t,F}}function i(t){return T=t,n}function o(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function s(t){return!o(t)}function a(t){return o(t)?new Error(v(t)):t}function c(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;r<n;++r)i[r]=t[r];return i[r]=e,i}function u(t,e,r){if(!k.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var n=Object.getOwnPropertyDescriptor(t,e);return null!=n?null==n.get&&null==n.set?n.value:r:void 0}function l(t,e,r){if(o(t))return t;var n={value:r,configurable:!0,enumerable:!1,writable:!0};return k.defineProperty(t,e,n),t}function h(t){throw t}function f(t){try{if("function"==typeof t){var e=k.names(t.prototype),r=k.isES5&&e.length>1,n=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=x.test(t+"")&&k.names(t).length>0;if(r||n||i)return!0}return!1}catch(t){return!1}}function p(t){function e(){}e.prototype=t;for(var r=8;r--;)new e;return t}function _(t){return R.test(t)}function d(t,e,r){for(var n=new Array(t),i=0;i<t;++i)n[i]=e+i+r;return n}function v(t){try{return t+""}catch(t){return"[no string representation]"}}function y(t){try{l(t,"isOperational",!0)}catch(t){}}function g(t){return null!=t&&(t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0)}function m(t){return t instanceof Error&&k.propertyIsWritable(t,"stack")}function b(t){return{}.toString.call(t)}function w(t,e,r){for(var n=k.names(t),i=0;i<n.length;++i){var o=n[i];if(r(o))try{k.defineProperty(e,o,k.getDescriptor(t,o))}catch(t){}}}var k=r(5),j="undefined"==typeof navigator,E=function(){try{var t={};return k.defineProperty(t,"f",{get:function(){return 3}}),3===t.f}catch(t){return!1}}(),F={e:{}},T,C=function(t,e){function r(){this.constructor=t,this.constructor$=e;for(var r in e.prototype)n.call(e.prototype,r)&&"$"!==r.charAt(r.length-1)&&(this[r+"$"]=e.prototype[r])}var n={}.hasOwnProperty;return r.prototype=e.prototype,t.prototype=new r,t.prototype},P=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(var r=0;r<t.length;++r)if(t[r]===e)return!0;return!1};if(k.isES5){var r=Object.getOwnPropertyNames;return function(t){for(var n=[],i=Object.create(null);null!=t&&!e(t);){var o;try{o=r(t)}catch(t){return n}for(var s=0;s<o.length;++s){var a=o[s];if(!i[a]){i[a]=!0;var c=Object.getOwnPropertyDescriptor(t,a);null!=c&&null==c.get&&null==c.set&&n.push(a)}}t=k.getPrototypeOf(t)}return n}}var n={}.hasOwnProperty;return function(r){if(e(r))return[];var i=[];t:for(var o in r)if(n.call(r,o))i.push(o);else{for(var s=0;s<t.length;++s)if(n.call(t[s],o))continue t;i.push(o)}return i}}(),x=/this\s*\.\s*\S+\s*=/,R=/^[a-z$_][a-z$_0-9]*$/i,A=function(){return"stack"in new Error?function(t){return m(t)?t:new Error(v(t))}:function(t){if(m(t))return t;try{throw new Error(v(t))}catch(t){return t}}}(),S={isClass:f,isIdentifier:_,inheritedDataKeys:P,getDataPropertyOrDefault:u,thrower:h,isArray:k.isArray,haveGetters:E,notEnumerableProp:l,isPrimitive:o,isObject:s,canEvaluate:j,errorObj:F,tryCatch:i,inherits:C,withAppended:c,maybeWrapAsError:a,toFastProperties:p,filledRange:d,toString:v,canAttachTrace:m,ensureErrorObject:A,originatesFromRejection:g,markAsOriginatingFromRejection:y,classString:b,copyDescriptors:w,hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:"undefined"!=typeof e&&"[object process]"===b(e).toLowerCase()};S.isRecentNode=S.isNode&&function(){var t=e.versions.node.split(".").map(Number);return 0===t[0]&&t[1]>10||t[0]>0}(),S.isNode&&S.toFastProperties(e);try{throw new Error}catch(t){S.lastLineError=t}t.exports=S}).call(e,r(4))},function(t,e,r){"use strict";function n(t,e){function r(n){return this instanceof r?(h(this,"message","string"==typeof n?n:e),h(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new r(n)}return l(r,Error),r}function i(t){return this instanceof i?(h(this,"name","OperationalError"),h(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(h(this,"message",t.message),h(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,s,a=r(5),c=a.freeze,u=r(1),l=u.inherits,h=u.notEnumerableProp,f=n("Warning","warning"),p=n("CancellationError","cancellation error"),_=n("TimeoutError","timeout error"),d=n("AggregateError","aggregate error");try{o=TypeError,s=RangeError}catch(t){o=n("TypeError","type error"),s=n("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),y=0;y<v.length;++y)"function"==typeof Array.prototype[v[y]]&&(d.prototype[v[y]]=Array.prototype[v[y]]);a.defineProperty(d.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),d.prototype.isOperational=!0;var g=0;d.prototype.toString=function(){var t=Array(4*g+1).join(" "),e="\n"+t+"AggregateError of:\n";g++,t=Array(4*g+1).join(" ");for(var r=0;r<this.length;++r){for(var n=this[r]===this?"[Circular AggregateError]":this[r]+"",i=n.split("\n"),o=0;o<i.length;++o)i[o]=t+i[o];n=i.join("\n"),e+=n+"\n"}return g--,e},l(i,Error);var m=Error.__BluebirdErrorTypes__;m||(m=c({CancellationError:p,TimeoutError:_,OperationalError:i,RejectionError:i,AggregateError:d}),h(Error,"__BluebirdErrorTypes__",m)),t.exports={Error:Error,TypeError:o,RangeError:s,CancellationError:m.CancellationError,OperationalError:m.OperationalError,TimeoutError:m.TimeoutError,AggregateError:m.AggregateError,Warning:f}},function(t,e,r){"use strict";function n(){this._isTickUsed=!1,this._lateQueue=new u(16),this._normalQueue=new u(16),this._trampolineEnabled=!0;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=c.isStatic?c(this.drainQueues):c}function i(t,e,r){this._lateQueue.push(t,e,r),this._queueTick()}function o(t,e,r){this._normalQueue.push(t,e,r),this._queueTick()}function s(t){this._normalQueue._pushOne(t),this._queueTick()}var a;try{throw new Error}catch(t){a=t}var c=r(32),u=r(29),l=r(1);n.prototype.disableTrampolineIfNecessary=function(){l.hasDevTools&&(this._trampolineEnabled=!1)},n.prototype.enableTrampoline=function(){this._trampolineEnabled||(this._trampolineEnabled=!0,this._schedule=function(t){setTimeout(t,0)})},n.prototype.haveItemsQueued=function(){return this._normalQueue.length()>0},n.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(t){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")}},l.hasDevTools?(c.isStatic&&(c=function(t){setTimeout(t,0)}),n.prototype.invokeLater=function(t,e,r){this._trampolineEnabled?i.call(this,t,e,r):this._schedule(function(){setTimeout(function(){t.call(e,r)},100)})},n.prototype.invoke=function(t,e,r){this._trampolineEnabled?o.call(this,t,e,r):this._schedule(function(){t.call(e,r)})},n.prototype.settlePromises=function(t){this._trampolineEnabled?s.call(this,t):this._schedule(function(){t._settlePromises()})}):(n.prototype.invokeLater=i,n.prototype.invoke=o,n.prototype.settlePromises=s),n.prototype.invokeFirst=function(t,e,r){this._normalQueue.unshift(t,e,r),this._queueTick()},n.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var r=t.shift(),n=t.shift();e.call(r,n)}else e._settlePromises()}},n.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._drainQueue(this._lateQueue)},n.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},n.prototype._reset=function(){this._isTickUsed=!1},t.exports=new n,t.exports.firstLineError=a},function(t,e){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function o(t){if(h===clearTimeout)return clearTimeout(t);if((h===n||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function s(){d&&p&&(d=!1,p.length?_=p.concat(_):v=-1,_.length&&a())}function a(){if(!d){var t=i(s);d=!0;for(var e=_.length;e;){for(p=_,_=[];++v<e;)p&&p[v].run();v=-1,e=_.length}p=null,d=!1,o(t)}}function c(t,e){this.fun=t,this.array=e}function u(){}var l,h,f=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:r}catch(t){l=r}try{h="function"==typeof clearTimeout?clearTimeout:n}catch(t){h=n}}();var p,_=[],d=!1,v=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];_.push(new c(t,e)),1!==_.length||d||i(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=u,f.addListener=u,f.once=u,f.off=u,f.removeListener=u,f.removeAllListeners=u,f.emit=u,f.prependListener=u,f.prependOnceListener=u,f.listeners=function(t){return[]},f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(t,e){var r=function(){"use strict";return void 0===this}();if(r)t.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:r,propertyIsWritable:function(t,e){var r=Object.getOwnPropertyDescriptor(t,e);return!(r&&!r.writable&&!r.set)}};else{var n={}.hasOwnProperty,i={}.toString,o={}.constructor.prototype,s=function(t){var e=[];for(var r in t)n.call(t,r)&&e.push(r);return e},a=function(t,e){return{value:t[e]}},c=function(t,e,r){return t[e]=r.value,t},u=function(t){return t},l=function(t){try{return Object(t).constructor.prototype}catch(t){return o}},h=function(t){try{return"[object Array]"===i.call(t)}catch(t){return!1}};t.exports={isArray:h,keys:s,names:s,defineProperty:c,getDescriptor:a,freeze:u,getPrototypeOf:l,isES5:r,propertyIsWritable:function(){return!0}}}},function(t,e,r){"use strict";function n(t){return t instanceof Error&&p.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(n(t)){e=new h(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var r=p.keys(t),i=0;i<r.length;++i){var o=r[i];_.test(o)||(e[o]=t[o])}return e}return a.markAsOriginatingFromRejection(t),t}function o(t){return function(e,r){if(null!==t){if(e){var n=i(c(e));t._attachExtraTrace(n),t._reject(n)}else if(arguments.length>2){for(var o=arguments.length,s=new Array(o-1),a=1;a<o;++a)s[a-1]=arguments[a];t._fulfill(s)}else t._fulfill(r);t=null}}}var s,a=r(1),c=a.maybeWrapAsError,u=r(2),l=u.TimeoutError,h=u.OperationalError,f=a.haveGetters,p=r(5),_=/^(?:name|message|stack|cause)$/;if(s=f?function(t){this.promise=t}:function(t){this.promise=t,this.asCallback=o(t),this.callback=this.asCallback},f){var d={get:function(){return o(this.promise)}};p.defineProperty(s.prototype,"asCallback",d),p.defineProperty(s.prototype,"callback",d)}s._nodebackForPromise=o,s.prototype.toString=function(){return"[object PromiseResolver]"},s.prototype.resolve=s.prototype.fulfill=function(t){if(!(this instanceof s))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._resolveCallback(t)},s.prototype.reject=function(t){if(!(this instanceof s))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._rejectCallback(t)},s.prototype.progress=function(t){if(!(this instanceof s))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._progress(t)},s.prototype.cancel=function(t){this.promise.cancel(t)},s.prototype.timeout=function(){this.reject(new l("timeout"))},s.prototype.isResolved=function(){return this.promise.isResolved()},s.prototype.toJSON=function(){return this.promise.toJSON()},t.exports=s},function(t,e){"use strict";t.exports=function(t){function e(t){var e=new r(t),n=e.promise();return e.setHowMany(1),e.setUnwrap(),e.init(),n}var r=t._SomePromiseArray;t.any=function(t){return e(t)},t.prototype.any=function(){return e(this)}}},function(t,e){"use strict";t.exports=function(t,e,r){var n=function(t,e){this._reject(e)},i=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(n,n,null,this,t)},o=function(t,e){this._isPending()&&this._resolveCallback(e.target)},s=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(n){var a=r(n),c=new t(e);c._propagateFrom(this,1);var u=this._target();if(c._setBoundTo(a),a instanceof t){var l={promiseRejectionQueued:!1,promise:c,target:u,bindingPromise:a};u._then(e,i,c._progress,c,l),a._then(o,s,c._progress,c,l)}else c._resolveCallback(u);return c},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=131072|this._bitField,this._boundTo=t):this._bitField=this._bitField&-131073},t.prototype._isBound=function(){return 131072===(131072&this._bitField)},t.bind=function(n,i){var o=r(n),s=new t(e);return s._setBoundTo(o),o instanceof t?o._then(function(){s._resolveCallback(i)},s._reject,s._progress,s,null):s._resolveCallback(i),s}}},function(t,e,r){"use strict";var n=Object.create;if(n){var i=n(null),o=n(null);i[" size"]=o[" size"]=0}t.exports=function(t){function e(e,r){var n;if(null!=e&&(n=e[r]),"function"!=typeof n){var i="Object "+l.classString(e)+" has no method '"+l.toString(r)+"'";throw new t.TypeError(i)}return n}function n(t){var r=this.pop(),n=e(t,r);return n.apply(t,this)}function s(t){return t[this]}function a(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}var c,u,l=r(1),h=l.canEvaluate,f=l.isIdentifier,p=function(t){return new Function("ensureMethod"," \n\t return function(obj) { \n\t 'use strict' \n\t var len = this.length; \n\t ensureMethod(obj, 'methodName'); \n\t switch(len) { \n\t case 1: return obj.methodName(this[0]); \n\t case 2: return obj.methodName(this[0], this[1]); \n\t case 3: return obj.methodName(this[0], this[1], this[2]); \n\t case 0: return obj.methodName(); \n\t default: \n\t return obj.methodName.apply(obj, this); \n\t } \n\t }; \n\t ".replace(/methodName/g,t))(e)},_=function(t){return new Function("obj"," \n\t 'use strict'; \n\t return obj.propertyName; \n\t ".replace("propertyName",t))},d=function(t,e,r){var n=r[t];if("function"!=typeof n){if(!f(t))return null;if(n=e(t),r[t]=n,r[" size"]++,r[" size"]>512){for(var i=Object.keys(r),o=0;o<256;++o)delete r[i[o]];r[" size"]=i.length-256}}return n};c=function(t){return d(t,p,i)},u=function(t){return d(t,_,o)},t.prototype.call=function(t){for(var e=arguments.length,r=new Array(e-1),i=1;i<e;++i)r[i-1]=arguments[i];if(h){var o=c(t);if(null!==o)return this._then(o,void 0,void 0,r,void 0)}return r.push(t),this._then(n,void 0,void 0,r,void 0)},t.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=a;else if(h){var n=u(t);e=null!==n?n:s}else e=s;return this._then(e,void 0,void 0,t,void 0)}}},function(t,e,r){"use strict";t.exports=function(t){var e=r(2),n=r(3),i=e.CancellationError;t.prototype._cancel=function(t){if(!this.isCancellable())return this;for(var e,r=this;void 0!==(e=r._cancellationParent)&&e.isCancellable();)r=e;this._unsetCancellable(),r._target()._rejectCallback(t,!1,!0)},t.prototype.cancel=function(t){return this.isCancellable()?(void 0===t&&(t=new i),n.invokeLater(this._cancel,this,t),this):this},t.prototype.cancellable=function(){return this._cancellable()?this:(n.enableTrampoline(),this._setCancellable(),this._cancellationParent=void 0,this)},t.prototype.uncancellable=function(){var t=this.then();return t._unsetCancellable(),t},t.prototype.fork=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);return n._setCancellable(),n._cancellationParent=void 0,n}}},function(t,e,r){(function(e){"use strict";t.exports=function(){function t(e){this._parent=e;var r=this._length=1+(void 0===e?0:e._length);w(this,t),r>32&&this.uncycle()}function n(t,e){for(var r=0;r<e.length-1;++r)e[r].push("From previous event:"),e[r]=e[r].join("\n");return r<e.length&&(e[r]=e[r].join("\n")),t+"\n"+e.join("\n")}function i(t){for(var e=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}function o(t){for(var e=t[0],r=1;r<t.length;++r){for(var n=t[r],i=e.length-1,o=e[i],s=-1,a=n.length-1;a>=0;--a)if(n[a]===o){s=a;break}for(var a=s;a>=0;--a){var c=n[a];if(e[i]!==c)break;e.pop(),i--}e=n}}function s(t){for(var e=[],r=0;r<t.length;++r){var n=t[r],i=d.test(n)||" (No stack trace)"===n,o=i&&g(n);i&&!o&&(y&&" "!==n.charAt(0)&&(n=" "+n),e.push(n))}return e}function a(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),r=0;r<e.length;++r){var n=e[r];if(" (No stack trace)"===n||d.test(n))break}return r>0&&(e=e.slice(r)),e}function c(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t.toString();var r=/\[object [a-zA-Z0-9$_]+\]/;if(r.test(e))try{var n=JSON.stringify(t);e=n}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+u(e)+">, no stack trace)"}function u(t){var e=41;return t.length<e?t:t.substr(0,e-3)+"..."}function l(t){var e=t.match(m);if(e)return{fileName:e[1],line:parseInt(e[2],10)}}var h,f=r(3),p=r(1),_=/[\\\/]bluebird[\\\/]js[\\\/](main|debug|zalgo|instrumented)/,d=null,v=null,y=!1;p.inherits(t,Error),t.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;t=this._length=n;for(var n=t-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(var n=0;n<t;++n){var s=e[n].stack,a=r[s];if(void 0!==a&&a!==n){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var c=n>0?e[n-1]:this;a<t-1?(c._parent=e[a+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void 0,c._length=1);for(var u=c._length+1,l=n-2;l>=0;--l)e[l]._length=u,u++;return}}}},t.prototype.parent=function(){return this._parent},t.prototype.hasParent=function(){return void 0!==this._parent},t.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var r=t.parseStackAndMessage(e),a=r.message,c=[r.stack],u=this;void 0!==u;)c.push(s(u.stack.split("\n"))),u=u._parent;o(c),i(c),p.notEnumerableProp(e,"stack",n(a,c)),p.notEnumerableProp(e,"__stackCleaned__",!0)}},t.parseStackAndMessage=function(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?a(t):[" (No stack trace)"],{message:r,stack:s(e)}},t.formatAndLogError=function(t,e){if("undefined"!=typeof console){var r;if("object"==typeof t||"function"==typeof t){var n=t.stack;r=e+v(n,t)}else r=e+String(t);"function"==typeof h?h(r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(r)}},t.unhandledRejection=function(e){t.formatAndLogError(e,"^--- With additional stack trace: ")},t.isSupported=function(){return"function"==typeof w},t.fireRejectionEvent=function(e,r,n,i){var o=!1;try{"function"==typeof r&&(o=!0,"rejectionHandled"===e?r(i):r(n,i))}catch(t){f.throwLater(t)}var s=!1;try{s=k(e,n,i)}catch(t){s=!0,f.throwLater(t)}var a=!1;if(b)try{a=b(e.toLowerCase(),{reason:n,promise:i})}catch(t){a=!0,f.throwLater(t)}s||o||a||"unhandledRejection"!==e||t.formatAndLogError(n,"Unhandled rejection ")};var g=function(){return!1},m=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;t.setBounds=function(e,r){if(t.isSupported()){for(var n,i,o=e.stack.split("\n"),s=r.stack.split("\n"),a=-1,c=-1,u=0;u<o.length;++u){var h=l(o[u]);if(h){n=h.fileName,a=h.line;break}}for(var u=0;u<s.length;++u){var h=l(s[u]);if(h){i=h.fileName,c=h.line;break}}a<0||c<0||!n||!i||n!==i||a>=c||(g=function(t){if(_.test(t))return!0;var e=l(t);return!!(e&&e.fileName===n&&a<=e.line&&e.line<=c)})}};var b,w=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():c(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit=Error.stackTraceLimit+6,d=t,v=e;var r=Error.captureStackTrace;return g=function(t){return _.test(t)},function(t,e){Error.stackTraceLimit=Error.stackTraceLimit+6,r(t,e),Error.stackTraceLimit=Error.stackTraceLimit-6}}var n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return d=/@/,v=e,y=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(t){i="stack"in t}return"stack"in n||!i||"number"!=typeof Error.stackTraceLimit?(v=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?c(e):e.toString()},null):(d=t,v=e,function(t){Error.stackTraceLimit=Error.stackTraceLimit+6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit=Error.stackTraceLimit-6})}([]),k=function(){if(p.isNode)return function(t,r,n){return"rejectionHandled"===t?e.emit(t,n):e.emit(t,r,n)};var t=!1,r=!0;try{var n=new self.CustomEvent("test");t=n instanceof CustomEvent}catch(t){}if(!t)try{var i=document.createEvent("CustomEvent");i.initCustomEvent("testingtheevent",!1,!0,{}),self.dispatchEvent(i)}catch(t){r=!1}r&&(b=function(e,r){var n;return t?n=new self.CustomEvent(e,{detail:r,bubbles:!1,cancelable:!0}):self.dispatchEvent&&(n=document.createEvent("CustomEvent"),n.initCustomEvent(e,!1,!0,r)),!!n&&!self.dispatchEvent(n)});var o={};return o.unhandledRejection="onunhandledRejection".toLowerCase(),o.rejectionHandled="onrejectionHandled".toLowerCase(),function(t,e,r){var n=o[t],i=self[n];return!!i&&("rejectionHandled"===t?i.call(self,r):i.call(self,e,r),!0)}}();return"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(h=function(t){console.warn(t)},p.isNode&&e.stderr.isTTY?h=function(t){e.stderr.write("[31m"+t+"[39m\n")}:p.isNode||"string"!=typeof(new Error).stack||(h=function(t){console.warn("%c"+t,"color: red")})),t}}).call(e,r(4))},function(t,e,r){"use strict";t.exports=function(t){function e(t,e,r){this._instances=t,this._callback=e,this._promise=r}function n(t,e){var r={},n=s(t).call(r,e);if(n===a)return n;var i=c(r);return i.length?(a.e=new u("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"),a):n}var i=r(1),o=r(2),s=i.tryCatch,a=i.errorObj,c=r(5).keys,u=o.TypeError;return e.prototype.doFilter=function(e){for(var r=this._callback,i=this._promise,o=i._boundValue(),c=0,u=this._instances.length;c<u;++c){var l=this._instances[c],h=l===Error||null!=l&&l.prototype instanceof Error;if(h&&e instanceof l){var f=s(r).call(o,e);return f===a?(t.e=f.e,t):f}if("function"==typeof l&&!h){var p=n(l,e);if(p===a){e=a.e;break}if(p){var f=s(r).call(o,e);return f===a?(t.e=f.e,t):f}}}return t.e=e,t},e}},function(t,e){"use strict";t.exports=function(t,e,r){function n(){this._trace=new e(o())}function i(){if(r())return new n}function o(){var t=s.length-1;if(t>=0)return s[t]}var s=[];return n.prototype._pushContext=function(){r()&&void 0!==this._trace&&s.push(this._trace)},n.prototype._popContext=function(){r()&&void 0!==this._trace&&s.pop()},t.prototype._peekContext=o,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,i}},function(t,e,r){(function(e){"use strict";t.exports=function(t,n){var i,o,s=t._getDomain,a=r(3),c=r(2).Warning,u=r(1),l=u.canAttachTrace,h=u.isNode&&(!!e.env.BLUEBIRD_DEBUG||"development"===e.env.NODE_ENV);return u.isNode&&0==e.env.BLUEBIRD_DEBUG&&(h=!1),h&&a.disableTrampolineIfNecessary(),t.prototype._ignoreRejections=function(){this._unsetRejectionIsUnhandled(),this._bitField=16777216|this._bitField},t.prototype._ensurePossibleRejectionHandled=function(){0===(16777216&this._bitField)&&(this._setRejectionIsUnhandled(),a.invokeLater(this._notifyUnhandledRejection,this,void 0))},t.prototype._notifyUnhandledRejectionIsHandled=function(){n.fireRejectionEvent("rejectionHandled",i,void 0,this)},t.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._getCarriedStackTrace()||this._settledValue;this._setUnhandledRejectionIsNotified(),n.fireRejectionEvent("unhandledRejection",o,t,this)}},t.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=524288|this._bitField},t.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=this._bitField&-524289},t.prototype._isUnhandledRejectionNotified=function(){return(524288&this._bitField)>0},t.prototype._setRejectionIsUnhandled=function(){this._bitField=2097152|this._bitField},t.prototype._unsetRejectionIsUnhandled=function(){this._bitField=this._bitField&-2097153,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},t.prototype._isRejectionUnhandled=function(){return(2097152&this._bitField)>0},t.prototype._setCarriedStackTrace=function(t){this._bitField=1048576|this._bitField,this._fulfillmentHandler0=t},t.prototype._isCarryingStackTrace=function(){return(1048576&this._bitField)>0},t.prototype._getCarriedStackTrace=function(){return this._isCarryingStackTrace()?this._fulfillmentHandler0:void 0},t.prototype._captureStackTrace=function(){return h&&(this._trace=new n(this._peekContext())),this},t.prototype._attachExtraTrace=function(t,e){if(h&&l(t)){var r=this._trace;if(void 0!==r&&e&&(r=r._parent),void 0!==r)r.attachExtraTrace(t);else if(!t.__stackCleaned__){var i=n.parseStackAndMessage(t);u.notEnumerableProp(t,"stack",i.message+"\n"+i.stack.join("\n")),u.notEnumerableProp(t,"__stackCleaned__",!0)}}},t.prototype._warn=function(t){var e=new c(t),r=this._peekContext();if(r)r.attachExtraTrace(e);else{var i=n.parseStackAndMessage(e);e.stack=i.message+"\n"+i.stack.join("\n")}n.formatAndLogError(e,"")},t.onPossiblyUnhandledRejection=function(t){var e=s();o="function"==typeof t?null===e?t:e.bind(t):void 0},t.onUnhandledRejectionHandled=function(t){var e=s();i="function"==typeof t?null===e?t:e.bind(t):void 0},t.longStackTraces=function(){if(a.haveItemsQueued()&&h===!1)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/DT1qyG\n");h=n.isSupported(),h&&a.disableTrampolineIfNecessary()},t.hasLongStackTraces=function(){return h&&n.isSupported()},n.isSupported()||(t.longStackTraces=function(){},h=!1),function(){return h}}}).call(e,r(4))},function(t,e,r){"use strict";var n=r(1),i=n.isPrimitive;t.exports=function(t){var e=function(){return this},r=function(){throw this},n=function(){},o=function(){throw void 0},s=function(t,e){return 1===e?function(){throw t}:2===e?function(){return t}:void 0};t.prototype.return=t.prototype.thenReturn=function(r){return void 0===r?this.then(n):i(r)?this._then(s(r,2),void 0,void 0,void 0,void 0):(r instanceof t&&r._ignoreRejections(),this._then(e,void 0,void 0,r,void 0))},t.prototype.throw=t.prototype.thenThrow=function(t){return void 0===t?this.then(o):i(t)?this._then(s(t,1),void 0,void 0,void 0,void 0):this._then(r,void 0,void 0,t,void 0)}}},function(t,e){"use strict";t.exports=function(t,e){var r=t.reduce;t.prototype.each=function(t){return r(this,t,null,e)},t.each=function(t,n){return r(t,n,null,e)}}},function(t,e){"use strict";t.exports=function(t,e){var r=t.map;t.prototype.filter=function(t,n){return r(this,t,n,e)},t.filter=function(t,n,i){return r(t,n,i,e)}}},function(t,e,r){"use strict";t.exports=function(t,e,n){function i(){return this}function o(){throw this}function s(t){return function(){return t}}function a(t){return function(){throw t}}function c(t,e,r){var n;return n=f(e)?r?s(e):a(e):r?i:o,t._then(n,p,void 0,e,void 0)}function u(r){var i=this.promise,o=this.handler,s=i._isBound()?o.call(i._boundValue()):o();if(void 0!==s){var a=n(s,i);if(a instanceof t)return a=a._target(),c(a,r,i.isFulfilled())}return i.isRejected()?(e.e=r,e):r}function l(e){var r=this.promise,i=this.handler,o=r._isBound()?i.call(r._boundValue(),e):i(e);if(void 0!==o){var s=n(o,r);if(s instanceof t)return s=s._target(),c(s,e,!0)}return e}var h=r(1),f=h.isPrimitive,p=h.thrower;t.prototype._passThroughHandler=function(t,e){if("function"!=typeof t)return this.then();var r={promise:this,handler:t};return this._then(e?u:l,e?u:void 0,void 0,r,void 0)},t.prototype.lastly=t.prototype.finally=function(t){return this._passThroughHandler(t,!0)},t.prototype.tap=function(t){return this._passThroughHandler(t,!1)}}},function(t,e,r){"use strict";t.exports=function(t,e,n,i){function o(e,r,n){for(var o=0;o<r.length;++o){n._pushContext();var s=h(r[o])(e);if(n._popContext(),s===l){n._pushContext();var a=t.reject(l.e);return n._popContext(),a}var c=i(s,n);if(c instanceof t)return c}return null}function s(e,r,i,o){var s=this._promise=new t(n);s._captureStackTrace(),this._stack=o,this._generatorFunction=e,this._receiver=r,this._generator=void 0,this._yieldHandlers="function"==typeof i?[i].concat(f):f}var a=r(2),c=a.TypeError,u=r(1),l=u.errorObj,h=u.tryCatch,f=[];s.prototype.promise=function(){return this._promise},s.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._next(void 0)},s.prototype._continue=function(e){if(e===l)return this._promise._rejectCallback(e.e,!1,!0);var r=e.value;if(e.done===!0)this._promise._resolveCallback(r);else{var n=i(r,this._promise);if(!(n instanceof t)&&(n=o(n,this._yieldHandlers,this._promise),null===n))return void this._throw(new c("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/4Y4pDk\n\n".replace("%s",r)+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")));n._then(this._next,this._throw,void 0,this,null)}},s.prototype._throw=function(t){this._promise._attachExtraTrace(t),this._promise._pushContext();var e=h(this._generator.throw).call(this._generator,t);this._promise._popContext(),this._continue(e)},s.prototype._next=function(t){this._promise._pushContext();var e=h(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},t.coroutine=function(t,e){if("function"!=typeof t)throw new c("generatorFunction must be a function\n\n See http://goo.gl/6Vqhm0\n");var r=Object(e).yieldHandler,n=s,i=(new Error).stack;return function(){
var e=t.apply(this,arguments),o=new n(void 0,void 0,r,i);return o._generator=e,o._next(void 0),o.promise()}},t.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new c("fn must be a function\n\n See http://goo.gl/916lJJ\n");f.push(t)},t.spawn=function(r){if("function"!=typeof r)return e("generatorFunction must be a function\n\n See http://goo.gl/6Vqhm0\n");var n=new s(r,this),i=n.promise();return n._run(t.spawn),i}}},function(t,e,r){"use strict";t.exports=function(t,e,n,i){var o,s=r(1),a=s.canEvaluate,c=s.tryCatch,u=s.errorObj;if(a){for(var l=function(t){return new Function("value","holder"," \n\t 'use strict'; \n\t holder.pIndex = value; \n\t holder.checkFulfillment(this); \n\t ".replace(/Index/g,t))},h=function(t){for(var e=[],r=1;r<=t;++r)e.push("holder.p"+r);return new Function("holder"," \n\t 'use strict'; \n\t var callback = holder.fn; \n\t return callback(values); \n\t ".replace(/values/g,e.join(", ")))},f=[],p=[void 0],_=1;_<=5;++_)f.push(l(_)),p.push(h(_));var d=function(t,e){this.p1=this.p2=this.p3=this.p4=this.p5=null,this.fn=e,this.total=t,this.now=0};d.prototype.callers=p,d.prototype.checkFulfillment=function(t){var e=this.now;e++;var r=this.total;if(e>=r){var n=this.callers[r];t._pushContext();var i=c(n)(this);t._popContext(),i===u?t._rejectCallback(i.e,!1,!0):t._resolveCallback(i)}else this.now=e};var o=function(t){this._reject(t)}}t.join=function(){var r,s=arguments.length-1;if(s>0&&"function"==typeof arguments[s]&&(r=arguments[s],s<6&&a)){var c=new t(i);c._captureStackTrace();for(var u=new d(s,r),l=f,h=0;h<s;++h){var p=n(arguments[h],c);p instanceof t?(p=p._target(),p._isPending()?p._then(l[h],o,void 0,c,u):p._isFulfilled()?l[h].call(c,p._value(),u):c._reject(p._reason())):l[h].call(c,p,u)}return c}for(var _=arguments.length,v=new Array(_),y=0;y<_;++y)v[y]=arguments[y];r&&v.pop();var c=new e(v).promise();return void 0!==r?c.spread(r):c}}},function(t,e,r){"use strict";t.exports=function(t,e,n,i,o){function s(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace();var i=u();this._callback=null===i?e:i.bind(e),this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=r>=1?[]:d,l.invoke(a,this,void 0)}function a(){this._init$(void 0,-2)}function c(t,e,r,n){var i="object"==typeof r&&null!==r?r.concurrency:0;return i="number"==typeof i&&isFinite(i)&&i>=1?i:0,new s(t,e,i,n)}var u=t._getDomain,l=r(3),h=r(1),f=h.tryCatch,p=h.errorObj,_={},d=[];h.inherits(s,e),s.prototype._init=function(){},s.prototype._promiseFulfilled=function(e,r){var n=this._values,o=this.length(),s=this._preservedValues,a=this._limit;if(n[r]===_){if(n[r]=e,a>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return}else{if(a>=1&&this._inFlight>=a)return n[r]=e,void this._queue.push(r);null!==s&&(s[r]=e);var c=this._callback,u=this._promise._boundValue();this._promise._pushContext();var l=f(c).call(u,e,r,o);if(this._promise._popContext(),l===p)return this._reject(l.e);var h=i(l,this._promise);if(h instanceof t){if(h=h._target(),h._isPending())return a>=1&&this._inFlight++,n[r]=_,h._proxyPromiseArray(this,r);if(!h._isFulfilled())return this._reject(h._reason());l=h._value()}n[r]=l}var d=++this._totalResolved;d>=o&&(null!==s?this._filter(n,s):this._resolve(n))},s.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var n=t.pop();this._promiseFulfilled(r[n],n)}},s.prototype._filter=function(t,e){for(var r=e.length,n=new Array(r),i=0,o=0;o<r;++o)t[o]&&(n[i++]=e[o]);n.length=i,this._resolve(n)},s.prototype.preservedValues=function(){return this._preservedValues},t.prototype.map=function(t,e){return"function"!=typeof t?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):c(this,t,e,null).promise()},t.map=function(t,e,r,i){return"function"!=typeof e?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):c(t,e,r,i).promise()}}},function(t,e,r){"use strict";t.exports=function(t,e,n,i){var o=r(1),s=o.tryCatch;t.method=function(r){if("function"!=typeof r)throw new t.TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");return function(){var n=new t(e);n._captureStackTrace(),n._pushContext();var i=s(r).apply(this,arguments);return n._popContext(),n._resolveFromSyncValue(i),n}},t.attempt=t.try=function(r,n,a){if("function"!=typeof r)return i("fn must be a function\n\n See http://goo.gl/916lJJ\n");var c=new t(e);c._captureStackTrace(),c._pushContext();var u=o.isArray(n)?s(r).apply(a,n):s(r).call(a,n);return c._popContext(),c._resolveFromSyncValue(u),c},t.prototype._resolveFromSyncValue=function(t){t===o.errorObj?this._rejectCallback(t.e,!1,!0):this._resolveCallback(t,!0)}}},function(t,e,r){"use strict";t.exports=function(t){function e(t,e){var r=this;if(!o.isArray(t))return n.call(r,t,e);var i=a(e).apply(r._boundValue(),[null].concat(t));i===c&&s.throwLater(i.e)}function n(t,e){var r=this,n=r._boundValue(),i=void 0===t?a(e).call(n,null):a(e).call(n,null,t);i===c&&s.throwLater(i.e)}function i(t,e){var r=this;if(!t){var n=r._target(),i=n._getCarriedStackTrace();i.cause=t,t=i}var o=a(e).call(r._boundValue(),t);o===c&&s.throwLater(o.e)}var o=r(1),s=r(3),a=o.tryCatch,c=o.errorObj;t.prototype.asCallback=t.prototype.nodeify=function(t,r){if("function"==typeof t){var o=n;void 0!==r&&Object(r).spread&&(o=e),this._then(o,i,void 0,this,t)}return this}}},function(t,e,r){"use strict";t.exports=function(t,e){var n=r(1),i=r(3),o=n.tryCatch,s=n.errorObj;t.prototype.progressed=function(t){return this._then(void 0,void 0,t,void 0,void 0)},t.prototype._progress=function(t){this._isFollowingOrFulfilledOrRejected()||this._target()._progressUnchecked(t)},t.prototype._progressHandlerAt=function(t){return 0===t?this._progressHandler0:this[(t<<2)+t-5+2]},t.prototype._doProgressWith=function(e){var r=e.value,i=e.handler,a=e.promise,c=e.receiver,u=o(i).call(c,r);if(u===s){if(null!=u.e&&"StopProgressPropagation"!==u.e.name){var l=n.canAttachTrace(u.e)?u.e:new Error(n.toString(u.e));a._attachExtraTrace(l),a._progress(u.e)}}else u instanceof t?u._then(a._progress,null,null,a,void 0):a._progress(u)},t.prototype._progressUnchecked=function(r){for(var n=this._length(),o=this._progress,s=0;s<n;s++){var a=this._progressHandlerAt(s),c=this._promiseAt(s);if(c instanceof t)"function"==typeof a?i.invoke(this._doProgressWith,this,{handler:a,promise:c,receiver:this._receiverAt(s),value:r}):i.invoke(o,c,r);else{var u=this._receiverAt(s);"function"==typeof a?a.call(u,r,c):u instanceof e&&!u._isResolved()&&u._promiseProgressed(r,c)}}}}},function(t,e,r){(function(e){"use strict";t.exports=function(){function n(t){if("function"!=typeof t)throw new p("the promise constructor requires a resolver function\n\n See http://goo.gl/EC22Yn\n");if(this.constructor!==n)throw new p("the promise constructor cannot be invoked directly\n\n See http://goo.gl/KsIlge\n");this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._progressHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._settledValue=void 0,t!==_&&this._resolveFromResolver(t)}function i(t){var e=new n(_);e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._progressHandler0=t,e._promise0=t,e._receiver0=t,e._settledValue=t}var o,s=function(){return new p("circular promise resolution chain\n\n See http://goo.gl/LhFpo0\n")},a=function(){return new n.PromiseInspection(this._target())},c=function(t){return n.reject(new p(t))},u=r(1);o=u.isNode?function(){var t=e.domain;return void 0===t&&(t=null),t}:function(){return null},u.notEnumerableProp(n,"_getDomain",o);var l={},h=r(3),f=r(2),p=n.TypeError=f.TypeError;n.RangeError=f.RangeError,n.CancellationError=f.CancellationError,n.TimeoutError=f.TimeoutError,n.OperationalError=f.OperationalError,n.RejectionError=f.OperationalError,n.AggregateError=f.AggregateError;var _=function(){},d={},v={e:null},y=r(36)(n,_),g=r(26)(n,_,y,c),m=r(11)(),b=r(14)(n,m),w=r(13)(n,m,b),k=r(12)(v),j=r(6),E=j._nodebackForPromise,F=u.errorObj,T=u.tryCatch;return n.prototype.toString=function(){return"[object Promise]"},n.prototype.caught=n.prototype.catch=function(t){var e=arguments.length;if(e>1){var r,i=new Array(e-1),o=0;for(r=0;r<e-1;++r){var s=arguments[r];if("function"!=typeof s)return n.reject(new p("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"));i[o++]=s}i.length=o,t=arguments[r];var a=new k(i,t,this);return this._then(void 0,a.doFilter,void 0,a,void 0)}return this._then(void 0,t,void 0,void 0,void 0)},n.prototype.reflect=function(){return this._then(a,a,void 0,this,void 0)},n.prototype.then=function(t,e,r){if(b()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+u.classString(t);arguments.length>1&&(n+=", "+u.classString(e)),this._warn(n)}return this._then(t,e,r,void 0,void 0)},n.prototype.done=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);n._setIsFinal()},n.prototype.spread=function(t,e){return this.all()._then(t,e,void 0,d,void 0)},n.prototype.isCancellable=function(){return!this.isResolved()&&this._cancellable()},n.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},n.prototype.all=function(){return new g(this).promise()},n.prototype.error=function(t){return this.caught(u.originatesFromRejection,t)},n.getNewLibraryCopy=t.exports,n.is=function(t){return t instanceof n},n.fromNode=function(t){var e=new n(_),r=T(t)(E(e));return r===F&&e._rejectCallback(r.e,!0,!0),e},n.all=function(t){return new g(t).promise()},n.defer=n.pending=function(){var t=new n(_);return new j(t)},n.cast=function(t){var e=y(t);if(!(e instanceof n)){var r=e;e=new n(_),e._fulfillUnchecked(r)}return e},n.resolve=n.fulfilled=n.cast,n.reject=n.rejected=function(t){var e=new n(_);return e._captureStackTrace(),e._rejectCallback(t,!0),e},n.setScheduler=function(t){if("function"!=typeof t)throw new p("fn must be a function\n\n See http://goo.gl/916lJJ\n");var e=h._schedule;return h._schedule=t,e},n.prototype._then=function(t,e,r,i,s){var a=void 0!==s,c=a?s:new n(_);a||(c._propagateFrom(this,5),c._captureStackTrace());var u=this._target();u!==this&&(void 0===i&&(i=this._boundTo),a||c._setIsMigrated());var l=u._addCallbacks(t,e,r,c,i,o());return u._isResolved()&&!u._isSettlePromisesQueued()&&h.invoke(u._settlePromiseAtPostResolution,u,l),c},n.prototype._settlePromiseAtPostResolution=function(t){this._isRejectionUnhandled()&&this._unsetRejectionIsUnhandled(),this._settlePromiseAt(t)},n.prototype._length=function(){return 131071&this._bitField},n.prototype._isFollowingOrFulfilledOrRejected=function(){return(939524096&this._bitField)>0},n.prototype._isFollowing=function(){return 536870912===(536870912&this._bitField)},n.prototype._setLength=function(t){this._bitField=this._bitField&-131072|131071&t},n.prototype._setFulfilled=function(){this._bitField=268435456|this._bitField},n.prototype._setRejected=function(){this._bitField=134217728|this._bitField},n.prototype._setFollowing=function(){this._bitField=536870912|this._bitField},n.prototype._setIsFinal=function(){this._bitField=33554432|this._bitField},n.prototype._isFinal=function(){return(33554432&this._bitField)>0},n.prototype._cancellable=function(){return(67108864&this._bitField)>0},n.prototype._setCancellable=function(){this._bitField=67108864|this._bitField},n.prototype._unsetCancellable=function(){this._bitField=this._bitField&-67108865},n.prototype._setIsMigrated=function(){this._bitField=4194304|this._bitField},n.prototype._unsetIsMigrated=function(){this._bitField=this._bitField&-4194305},n.prototype._isMigrated=function(){return(4194304&this._bitField)>0},n.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[5*t-5+4];if(e!==l)return void 0===e&&this._isBound()?this._boundValue():e},n.prototype._promiseAt=function(t){return 0===t?this._promise0:this[5*t-5+3]},n.prototype._fulfillmentHandlerAt=function(t){return 0===t?this._fulfillmentHandler0:this[5*t-5+0]},n.prototype._rejectionHandlerAt=function(t){return 0===t?this._rejectionHandler0:this[5*t-5+1]},n.prototype._boundValue=function(){var t=this._boundTo;return void 0!==t&&t instanceof n?t.isFulfilled()?t.value():void 0:t},n.prototype._migrateCallbacks=function(t,e){var r=t._fulfillmentHandlerAt(e),i=t._rejectionHandlerAt(e),o=t._progressHandlerAt(e),s=t._promiseAt(e),a=t._receiverAt(e);s instanceof n&&s._setIsMigrated(),void 0===a&&(a=l),this._addCallbacks(r,i,o,s,a,null)},n.prototype._addCallbacks=function(t,e,r,n,i,o){var s=this._length();if(s>=131066&&(s=0,this._setLength(0)),0===s)this._promise0=n,void 0!==i&&(this._receiver0=i),"function"!=typeof t||this._isCarryingStackTrace()||(this._fulfillmentHandler0=null===o?t:o.bind(t)),"function"==typeof e&&(this._rejectionHandler0=null===o?e:o.bind(e)),"function"==typeof r&&(this._progressHandler0=null===o?r:o.bind(r));else{var a=5*s-5;this[a+3]=n,this[a+4]=i,"function"==typeof t&&(this[a+0]=null===o?t:o.bind(t)),"function"==typeof e&&(this[a+1]=null===o?e:o.bind(e)),"function"==typeof r&&(this[a+2]=null===o?r:o.bind(r))}return this._setLength(s+1),s},n.prototype._setProxyHandlers=function(t,e){var r=this._length();if(r>=131066&&(r=0,this._setLength(0)),0===r)this._promise0=e,this._receiver0=t;else{var n=5*r-5;this[n+3]=e,this[n+4]=t}this._setLength(r+1)},n.prototype._proxyPromiseArray=function(t,e){this._setProxyHandlers(t,e)},n.prototype._resolveCallback=function(t,e){if(!this._isFollowingOrFulfilledOrRejected()){if(t===this)return this._rejectCallback(s(),!1,!0);var r=y(t,this);if(!(r instanceof n))return this._fulfill(t);var i=1|(e?4:0);this._propagateFrom(r,i);var o=r._target();if(o._isPending()){for(var a=this._length(),c=0;c<a;++c)o._migrateCallbacks(this,c);this._setFollowing(),this._setLength(0),this._setFollowee(o)}else o._isFulfilled()?this._fulfillUnchecked(o._value()):this._rejectUnchecked(o._reason(),o._getCarriedStackTrace())}},n.prototype._rejectCallback=function(t,e,r){r||u.markAsOriginatingFromRejection(t);var n=u.ensureErrorObject(t),i=n===t;this._attachExtraTrace(n,!!e&&i),this._reject(t,i?void 0:n)},n.prototype._resolveFromResolver=function(t){var e=this;this._captureStackTrace(),this._pushContext();var r=!0,n=T(t)(function(t){null!==e&&(e._resolveCallback(t),e=null)},function(t){null!==e&&(e._rejectCallback(t,r),e=null)});r=!1,this._popContext(),void 0!==n&&n===F&&null!==e&&(e._rejectCallback(n.e,!0,!0),e=null)},n.prototype._settlePromiseFromHandler=function(t,e,r,n){if(!n._isRejected()){n._pushContext();var i;if(i=e!==d||this._isRejected()?T(t).call(e,r):T(t).apply(this._boundValue(),r),n._popContext(),i===F||i===n||i===v){var o=i===n?s():i.e;n._rejectCallback(o,!1,!0)}else n._resolveCallback(i)}},n.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},n.prototype._followee=function(){return this._rejectionHandler0},n.prototype._setFollowee=function(t){this._rejectionHandler0=t},n.prototype._cleanValues=function(){this._cancellable()&&(this._cancellationParent=void 0)},n.prototype._propagateFrom=function(t,e){(1&e)>0&&t._cancellable()&&(this._setCancellable(),this._cancellationParent=t),(4&e)>0&&t._isBound()&&this._setBoundTo(t._boundTo)},n.prototype._fulfill=function(t){this._isFollowingOrFulfilledOrRejected()||this._fulfillUnchecked(t)},n.prototype._reject=function(t,e){this._isFollowingOrFulfilledOrRejected()||this._rejectUnchecked(t,e)},n.prototype._settlePromiseAt=function(t){var e=this._promiseAt(t),r=e instanceof n;if(r&&e._isMigrated())return e._unsetIsMigrated(),h.invoke(this._settlePromiseAt,this,t);var i=this._isFulfilled()?this._fulfillmentHandlerAt(t):this._rejectionHandlerAt(t),o=this._isCarryingStackTrace()?this._getCarriedStackTrace():void 0,s=this._settledValue,a=this._receiverAt(t);this._clearCallbackDataAtIndex(t),"function"==typeof i?r?this._settlePromiseFromHandler(i,a,s,e):i.call(a,s,e):a instanceof g?a._isResolved()||(this._isFulfilled()?a._promiseFulfilled(s,e):a._promiseRejected(s,e)):r&&(this._isFulfilled()?e._fulfill(s):e._reject(s,o)),t>=4&&4===(31&t)&&h.invokeLater(this._setLength,this,0)},n.prototype._clearCallbackDataAtIndex=function(t){if(0===t)this._isCarryingStackTrace()||(this._fulfillmentHandler0=void 0),this._rejectionHandler0=this._progressHandler0=this._receiver0=this._promise0=void 0;else{var e=5*t-5;this[e+3]=this[e+4]=this[e+0]=this[e+1]=this[e+2]=void 0}},n.prototype._isSettlePromisesQueued=function(){return(this._bitField&-1073741824)===-1073741824},n.prototype._setSettlePromisesQueued=function(){this._bitField=this._bitField|-1073741824},n.prototype._unsetSettlePromisesQueued=function(){this._bitField=1073741823&this._bitField},n.prototype._queueSettlePromises=function(){h.settlePromises(this),this._setSettlePromisesQueued()},n.prototype._fulfillUnchecked=function(t){if(t===this){var e=s();return this._attachExtraTrace(e),this._rejectUnchecked(e,void 0)}this._setFulfilled(),this._settledValue=t,this._cleanValues(),this._length()>0&&this._queueSettlePromises()},n.prototype._rejectUncheckedCheckError=function(t){var e=u.ensureErrorObject(t);this._rejectUnchecked(t,e===t?void 0:e)},n.prototype._rejectUnchecked=function(t,e){if(t===this){var r=s();return this._attachExtraTrace(r),this._rejectUnchecked(r)}return this._setRejected(),this._settledValue=t,this._cleanValues(),this._isFinal()?void h.throwLater(function(t){thro