/* @preserve * The MIT License (MIT) * * Copyright (c) 2013-2018 Petka Antonov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *//** * bluebird build version 3.5.4 * Features enabled: core * Features disabled: race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each*/!function(t){if("object"==typeofexports&&"undefined"!=typeofmodule)module.exports=t();elseif("function"==typeofdefine&&define.amd)define([],t);else{vare;"undefined"!=typeofwindow?e=window:"undefined"!=typeofglobal?e=global:"undefined"!=typeofself&&(e=self),e.Promise=t()}}(function(){vart,e,n;returnfunctionr(t,e,n){functioni(a,s){if(!e[a]){if(!t[a]){varc="function"==typeof_dereq_&&_dereq_;if(!s&&c)returnc(a,!0);if(o)returno(a,!0);varl=newError("Cannot find module '"+a+"'");throwl.code="MODULE_NOT_FOUND",l}varu=e[a]={exports:{}};t[a][0].call(u.exports,function(e){varn=t[a][1][e];returni(n?n:e)},u,u.exports,r,t,e,n)}returne[a].exports}for(varo="function"==typeof_dereq_&&_dereq_,a=0;a<n.length;a++)i(n[a]);returni}({1:[function(t,e,n){"use strict";functionr(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=newf(16),this._normalQueue=newf(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;vart=this;this.drainQueues=function(){t._drainQueues()},this._schedule=p}functioni(t,e,n){this._lateQueue.push(t,e,n),this._queueTick()}functiono(t,e,n){this._normalQueue.push(t,e,n),this._queueTick()}functiona(t){this._normalQueue._pushOne(t),this._queueTick()}functions(t){for(;t.length()>0;)c(t)}functionc(t){vare=t.shift();if("function"!=typeofe)e._settlePromises();else{varn=t.shift(),r=t.shift();e.call(n,r)}}varl;try{thrownewError}catch(u){l=u}varp=t("./schedule"),f=t("./queue"),h=t("./util");r.prototype.setScheduler=function(t){vare=this._schedule;returnthis._schedule=t,this._customScheduler=!0,e},r.prototype.hasCustomScheduler=function(){returnthis._customScheduler},r.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},r.prototype.disableTrampolineIfNecessary=function(){h.hasDevTools&&(this._trampolineEnabled=!1)},r.prototype.haveItemsQueued=function(){returnthis._isTickUsed||this._haveDrainedQueues},r.prototype.fatalError=function(t,e){e?(process.stderr.write("Fatal "+(tinstanceofError?t.stack:t)+"\n"),process.exit(2)):this.throwLater(t)},r.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throwe}),"undefined"!=typeofsetTimeout)setTimeout(function(){t(e)},0);elsetry{this._schedule(function(){t(e)})}catch(n){thrownewError("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},h.hasDevTools?(r.prototype.invokeLater=function(t,e,n){this._trampolineEnabled?i.call(this,t,e,n):this._schedule(function(){setTimeout(function(){t.call(e,n)},100)})},r.prototype.invoke=function(t,e,n){this._trampolineEnabled?o.call(this,t,e,n):this._schedule(function(){t.call(e,n)})},r.prototype.settlePromises=function(t){this._trampolineEnabled?a.call(this,t):this._schedule(function(){t._settlePromises()})}):(r.prototype.invokeLater=i,r.prototype.invoke=o,r.prototype.settlePromises=a),r.prototype._drainQueues=function(){s(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,s(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=r,e.exports.firstLineError=l},{"./queue":17,"./schedule":18,"./util":21}],2:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){vari=!1,o=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},s=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());varl=n(o),u=newt(e);u._propagateFrom(this,1);varp=this._target();if(u._setBoundTo(l),linstanceoft){varf={promiseRejectionQueued:!1,promise:u,target:p,bindingPromise:l};p._then(e,a,void0,u,f),l._then(s,c,void0,u,f),u._setOnCancel(l)}elseu._resolveCallback(p);returnu},t.prototype._setBoundTo=function(t){void0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return2097152===(2097152&this._bitField)},t.bind=function(e,n){returnt.resolve(n).bind(e)}}},{}],3:[function(t,e,n){"use strict";functionr(){try{Promise===o&&(Promise=i)}catch(t){}returno}vari;"undefined"!=typeofPromise&&(i=Promise);varo=t("./promise")();o.noConflict=r,e.exports=o},{"./promise":15}],4:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){varo=t("./util"),a=o.tryCatch,s=o.errorObj,c=e._async;e.prototype["break"]=e.prototype.cancel=function(){if(!i.cancellation())returnthis._warn("cancellation is disabled");for(vart=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}varn=t._cancellationParent;if(null==n||!n._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){returnvoid0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){returnt===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void0},e.prototype._isCancellable=function(){returnthis.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){returnthis.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(varn=0;n<t.length;++n)this._doInvokeOnCancel(t[n],e);elseif(void0!==t)if("function"==typeoft){if(!e){varr=a(t).call(this._boundValue());r===s&&(this._attachExtraTrace(r.e),c.throwLater(r.e))}}elset._resultCancelled(this)},e.prototype._invokeOnCancel=function(){vart=this._onCancel();this._unsetOnCancel(),c.invoke(this._doInvokeOnCancel,this,t)},e.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},e.prototype._resultCancelled=function(){this.cancel()}}},{"./util":21}],5:[function(t,e,n){"use strict";e.exports=function(e){functionn(t,n,s){returnfunction(c){varl=s._boundValue();t:for(varu=0;u<t.length;++u){varp=t[u];if(p===Error||null!=p&&p.prototypeinstanceofError){if(cinstanceofp)returno(n).call(l,c)}elseif("function"==typeofp){varf=o(p).call(l,c);if(f===a)returnf;if(f)returno(n).call(l,c)}elseif(r.isObject(c)){for(varh=i(p),_=0;_<h.length;++_){vard=h[_];if(p[d]!=c[d])continuet}returno(n).call(l,c)}}returne}}varr=t("./util"),i=t("./es5").keys,o=r.tryCatch,a=r.errorObj;returnn}},{"./es5":10,"./util":21}],6:[function(t,e,n){"use strict";e.exports=function(t){functione(){this._trace=newe.CapturedTrace(r())}functionn(){returni?newe:void0}functionr(){vart=o.length-1;returnt>=0?o[t]:void0}vari=!1,o=[];returnt.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){returnnull},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void0!==this._trace){vart=o.pop(),e=t._promiseCreated;returnt._promiseCreated=null,e}returnnull},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){varn=t.prototype._pushContext,o=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,c=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=c,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){vart=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],7:[function(t,e,n){"use strict";e.exports=function(e,n){functionr(t,e){return{promise:e}}functioni(){return!1}functiono(t,e,n){varr=this;try{t(e,n,function(t){if("function"!=typeoft)thrownewTypeError("onCancel must be a function, got: "+H.toString(t));r._attachCancellationCallback(t)})}catch(i){returni}}functiona(t){if(!this._isCancellable())returnthis;vare=this._onCancel();void0!==e?H.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}functions(){returnthis._onCancelField}functionc(t){this._onCancelField=t}functionl(){this._cancellationParent=void0,this._onCancelField=void0}functionu(t,e){if(0!==(1&e)){this._cancellationParent=t;varn=t._branchesRemainingToCancel;void0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}functionp(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}functionf(){vart=this._boundTo;returnvoid0!==t&&tinstanceofe?t.isFulfilled()?t.value():void0:t}functionh(){this._trace=newO(this._peekContext())}function_(t,e){if(V(t)){varn=this._trace;if(void0!==n&&e&&(n=n._parent),void0!==n)n.attachExtraTrace(t);elseif(!t.__stackCleaned__){varr=k(t);H.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),H.notEnumerableProp(t,"__stackCleaned__",!0)}}}functiond(){this._trace=void0}functionv(t,e,n,r,i){if(void0===t&&null!==e&&J){if(void0!==i&&i._returnedNonUndefined())return;if(0===(65535&r._bitField))return;n&&(n+=" ");varo="",a="";if(e._trace){for(vars=e._trace.stack.split("\n"),c=w(s),l=c.length-1;l>=0;--l){varu=c[l];if(!q.test(u)){varp=u.match(G);p&&(o="at "+p[1]+":"+p[2]+":"+p[3]+" ");break}}if(c.length>0)for(varf=c[0],l=0;l<s.length;++l)if(s[l]===f){l>0&&(a="\n"+s[l-1]);break}}varh="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+a;r._warn(h,!0,e)}}functiony(t,e){varn=t+" is deprecated and will be removed in a future version.";returne&&(n+=" Use "+e+" instead."),g(n)}functiong(t,n,r){if(st.warnings){vari,o=newI(t);if(n)r._attachExtraTrace(o);elseif(st.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(o);else{vara=k(o);o.stack=a.message+"\n"+a.stack.join("\n")}nt("warning",o)||j(o,"",!0)}}functionm(t,e){for(varn=0;n<e.length-1;++n)e[n].push("From previous event:"),e[n]=e[n].join("\n");returnn<e.length&&(e[n]=e[n].join("\n")),t+"\n"+e.join("\n")}functionb(t){for(vare=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--)}functionC(t){for(vare=t[0],n=1;n<t.length;++n){for(varr=t[n],i=e.length-1,o=e[i],a=-1,s=r.length-1;s>=0;--s)if(r[s]===o){a=s;break}for(vars=a;s>=0;--s){varc=r[s];if(e[i]!==c)break;e.pop(),i--}e=r}}functionw(t){for(vare=[],n=0;n<t.length;++n){varr=t[n],i=" (No stack trace)"===r||M.test(r),o=i&&it(r);i&&!o&&($&&" "!==r.charAt(0)&&(r=" "+r),e.push(r))}returne}functionE(t){for(vare=t.stack.replace(/\s+$/g,"").split("\n"),n=0;n<e.length;++n){varr=e[n];if(" (No stack trace)"===r||M.test(r))break}returnn>0&&"SyntaxError"!=t.name&&(e=e.slice(n)),e}functionk(t){vare=t.stack,n=t.toString();returne="string"==typeofe&&e.length>0?E(t):[" (No stack trace)"],{message:n,stack:"SyntaxError"==t.name?e:w(e)}}functionj(t,e,n){if("undefined"!=typeofconsole){varr;if(H.isObject(t)){vari=t.stack;r=e+W(i,t)}elser=e+String(t);"function"==typeofL?L(r,n):("function"==typeofconsole.log||"object"==typeofconsole.log)&&console.log(r)}}functionF(t,e,n,r){vari=!1;try{"function"==typeofe&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(o){U.throwLater(o)}"unhandledRejection"===t?nt(t,n,r)||i||j(n,"Unhandled rejection "):nt(t,r)}functionT(t){vare;if("function"==typeoft)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeoft.toString?t.toString():H.toString(t);varn=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(e))try{varr=JSON.stringify(t);e=r}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+P(e)+">, no stack trace)"}functionP(t){vare=41;returnt.length<e?t:t.substr(0,e-3)+"..."}functionR(){return"function"==typeofat}functionS(t){vare=t.match(ot);returne?{fileName:e[1],line:parseInt(e[2],10)}:void0}functionx(t,e){if(R()){for(varn,r,i=t.stack.split("\n"),o=e.stack.split("\n"),a=-1,s=-1,c=0;c<i.length;++c){varl=S(i[c]);if(l){n=l.fileName,a=l.line;break}}for(varc=0;c<o.length;++c){varl=S(o[c]);if(l){r=l.fileName,s=l.line;break}}0>a||0>s||!n||!r||n!==r||a>=s||(it=function(t){if(Q.test(t))return!0;vare=S(t);returne&&e.fileName===n&&a<=e.line&&e.line<=s?!0:!1})}}functionO(t){this._parent=t,this._promisesCreated=0;vare=this._length=1+(void0===t?0:t._length);at(this,O),e>32&&this.uncycle()}varA,N,L,B=e._getDomain,U=e._async,I=t("./errors").Warning,H=t("./util"),D=t("./es5"),V=H.canAttachTrace,Q=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,q=/\((?:timers\.js):\d+:\d+\)/,G=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,M=null,W=null,$=!1,z=!(0==H.env("BLUEBIRD_DEBUG")||!H.env("BLUEBIRD_DEBUG")&&"development"!==H.env("NODE_ENV")),X=!(0==H.env("BLUEBIRD_WARNINGS")||!z&&!H.env("BLUEBIRD_WARNINGS")),K=!(0==H.env("BLUEBIRD_LONG_STACK_TRACES")||!z&&!H.env("BLUEBIRD_LONG_STACK_TRACES")),J=0!=H.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(X||!!H.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){vart=this._target();t._bitField=-1048577&t._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){if(0===(524288&this._bitField)){this._setRejectionIsUnhandled();vart=this;setTimeout(function(){t._notifyUnhandledRejection()},1)}},e.prototype._notifyUnhandledRejectionIsHandled=function(){F("rejectionHandled",A,void0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return0!==(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){vart=this._settledValue();this._setUnhandledRejectionIsNotified(),F("unhandledRejection",N,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){returng(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){vare=B();N="function"==typeoft?null===e?t:H.domainBind(e,t):void0},e.onUnhandledRejectionHandled=function(t){vare=B();A="function"==typeoft?null===e?t:H.domainBind(e,t):void0};varY=function(){};e.longStackTraces=function(){if(U.haveItemsQueued()&&!st.longStackTraces)thrownewError("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!st.longStackTraces&&R()){vart=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace,i=e.prototype._dereferenceTrace;st.longStackTraces=!0,Y=function(){if(U.haveItemsQueued()&&!st.longStackTraces)thrownewError("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,e.prototype._dereferenceTrace=i,n.deactivateLongStackTraces(),U.enableTrampoline(),st.longStackTraces=!1},e.prototype._captureStackTrace=h,e.prototype._attachExtraTrace=_,e.prototype._dereferenceTrace=d,n.activateLongStackTraces(),U.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){returnst.longStackTraces&&R()};varZ=function(){try{if("function"==typeofCustomEvent){vart=newCustomEvent("CustomEvent");returnH.global.dispatchEvent(t),function(t,e){varn={detail:e,cancelable:!0};D.defineProperty(n,"promise",{value:e.promise}),D.defineProperty(n,"reason",{value:e.reason});varr=newCustomEvent(t.toLowerCase(),n);return!H.global.dispatchEvent(r)}}if("function"==typeofEvent){vart=newEvent("CustomEvent");returnH.global.dispatchEvent(t),function(t,e){varn=newEvent(t.toLowerCase(),{cancelable:!0});returnn.detail=e,D.defineProperty(n,"promise",{value:e.promise}),D.defineProperty(n,"reason",{value:e.reason}),!H.global.dispatchEvent(n)}}vart=document.createEvent("CustomEvent");returnt.initCustomEvent("testingtheevent",!1,!0,{}),H.global.dispatchEvent(t),function(t,e){varn=document.createEvent("CustomEvent");returnn.initCustomEvent(t.toLowerCase(),!1,!0,e),!H.global.dispatchEvent(n)}}catch(e){}returnfunction(){return!1}}(),tt=function(){returnH.isNode?function(){returnprocess.emit.apply(process,arguments)}:H.global?function(t){vare="on"+t.toLowerCase(),n=H.global[e];returnn?(n.apply(H.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}(),et={promiseCreated:r,promiseFulfilled:r,promiseRejected:r,promiseResolved:r,promiseCancelled:r,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:r},nt=function(t){vare=!1;try{e=tt.apply(null,arguments)}catch(n){U.throwLater(n),e=!0}varr=!1;try{r=Z(t,et[t].apply(null,arguments))}catch(n){U.throwLater(n),r=!0}returnr||e};e.config=function(t){if(t=Object(t),"longStackTraces"int&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&Y()),"warnings"int){varn=t.warnings;st.warnings=!!n,J=st.warnings,H.isObject(n)&&"wForgottenReturn"inn&&(J=!!n.wForgottenReturn)}if("cancellation"int&&t.cancellation&&!st.cancellation){if(U.haveItemsQueued())thrownewError("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=l,e.prototype._propagateFrom=u,e.prototype._onCancel=s,e.prototype._setOnCancel=c,e.prototype._attachCancellationCallback=a,e.prototype._execute=o,rt=u,st.cancellation=!0}return"monitoring"int&&(t.monitoring&&!st.monitoring?(st.monitoring=!0,e.prototype._fireEvent=nt):!t.monitoring&&st.monitoring&&(st.monitoring=!1,e.prototype._fireEvent=i)),e},e.prototype._fireEvent=i,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(r){returnr}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._dereferenceTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};varrt=p,it=function(){return!1},ot=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;H.inherits(O,Error),n.CapturedTrace=O,O.prototype.uncycle=function(){vart=this._length;if(!(2>t)){for(vare=[],n={},r=0,i=this;void0!==i;++r)e.push(i),i=i._parent;t=this._length=r;for(varr=t-1;r>=0;--r){varo=e[r].stack;void0===n[o]&&(n[o]=r)}for(varr=0;t>r;++r){vara=e[r].stack,s=n[a];if(void0!==s&&s!==r){s>0&&(e[s-1]._parent=void0,e[s-1]._length=1),e[r]._parent=void0,e[r]._length=1;varc=r>0?e[r-1]:this;t-1>s?(c._parent=e[s+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void0,c._length=1);for(varl=c._length+1,u=r-2;u>=0;--u)e[u]._length=l,l++;return}}}},O.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(vare=k(t),n=e.message,r=[e.stack],i=this;void0!==i;)r.push(w(i.stack.split("\n"))),i=i._parent;C(r),b(r),H.notEnumerableProp(t,"stack",m(n,r)),H.notEnumerableProp(t,"__stackCleaned__",!0)}};varat=function(){vart=/^\s*at\s*/,e=function(t,e){return"string"==typeoft?t:void0!==e.name&&void0!==e.message?e.toString():T(e)};if("number"==typeofError.stackTraceLimit&&"function"==typeofError.captureStackTrace){Error.stackTraceLimit+=6,M=t,W=e;varn=Error.captureStackTrace;returnit=function(t){returnQ.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}varr=newError;if("string"==typeofr.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)returnM=/@/,W=e,$=!0,function(t){t.stack=(newError).stack};vari;try{thrownewError}catch(o){i="stack"ino}return"stack"inr||!i||"number"!=typeofError.stackTraceLimit?(W=function(t,e){return"string"==typeoft?t:"object"!=typeofe&&"function"!=typeofe||void0===e.name||void0===e.message?T(e):e.toString()},null):(M=t,W=e,function(t){Error.stackTraceLimit+=6;try{thrownewError}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeofconsole&&"undefined"!=typeofconsole.warn&&(L=function(t){console.warn(t)},H.isNode&&process.stderr.isTTY?L=function(t,e){varn=e?"[33m":"[31m";console.warn(n+t+"[0m\n")}:H.isNode||"string"!=typeof(newError).stack||(L=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));varst={warnings:X,longStackTraces:!1,cancellation:!1,monitoring:!1};returnK&&e.longStackTraces(),{longStackTraces:function(){returnst.longStackTraces},warnings:function(){returnst.warnings},cancellation:function(){returnst.cancellation},monitoring:function(){returnst.monitoring},propagateFromFunction:function(){returnrt},boundValueFunction:function(){returnf},checkForgottenReturns:v,setBounds:x,warn:g,deprecated:y,CapturedTrace:O,fireDomEvent:Z,fireGlobalEvent:tt}}},{"./errors":9,"./es5":10,"./util":21}],8:[function(t,e,n){"use strict";e.exports=function(t){functione(){returnthis.value}functionn(){throwthis.reason}t.prototype["return"]=t.prototype.thenReturn=function(n){returnninstanceoft&&n.suppressUnhandledRejections(),this._then(e,void0,void0,{value:n},void0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){returnthis._then(n,void0,void0,{reason:t},void0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)returnthis._then(void0,n,void0,{reason:t},void0);vare=arguments[1],r=function(){throwe};returnthis.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)returnninstanceoft&&n.suppressUnhandledRejections(),this._then(void0,e,void0,{value:n},void0);varr=arguments[1];rinstanceoft&&r.suppressUnhandledRejections();vari=function(){returnr};returnthis.caught(n,i)}}},{}],9:[function(t,e,n){"use strict";functionr(t,e){functionn(r){returnthisinstanceofn?(p(this,"message","string"==typeofr?r:e),p(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):newn(r)}returnu(n,Error),n}functioni(t){returnthisinstanceofi?(p(this,"name","OperationalError"),p(this,"message",t),this.cause=t,this.isOperational=!0,void(tinstanceofError?(p(this,"message",t.message),p(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):newi(t)}varo,a,s=t("./es5"),c=s.freeze,l=t("./util"),u=l.inherits,p=l.notEnumerableProp,f=r("Warning","warning"),h=r("CancellationError","cancellation error"),_=r("TimeoutError","timeout error"),d=r("AggregateError","aggregate error");try{o=TypeError,a=RangeError}catch(v){o=r("TypeError","type error"),a=r("RangeError","range error")}for(vary="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g<y.length;++g)"function"==typeofArray.prototype[y[g]]&&(d.prototype[y[g]]=Array.prototype[y[g]]);s.defineProperty(d.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),d.prototype.isOperational=!0;varm=0;d.prototype.toString=function(){vart=Array(4*m+1).join(" "),e="\n"+t+"AggregateError of:\n";m++,t=Array(4*m+1).join(" ");for(varn=0;n<this.length;++n){for(varr=this[n]===this?"[Circular AggregateError]":this[n]+"",i=r.split("\n"),o=0;o<i.length;++o)i[o]=t+i[o];r=i.join("\n"),e+=r+"\n"}returnm--,e},u(i,Error);varb=Error.__BluebirdErrorTypes__;b||(b=c({CancellationError:h,TimeoutError:_,OperationalError:i,RejectionError:i,AggregateError:d}),s.defineProperty(Error,"__BluebirdErrorTypes__",{value:b,writable:!1,enumerable:!1,configurable:!1})),e.exports={Error:Error,TypeError:o,RangeError:a,CancellationError:b.CancellationError,OperationalError:b.OperationalError,TimeoutError:b.TimeoutError,AggregateError:b.AggregateError,Warning:f}},{"./es5":10,"./util":21}],10:[function(t,e,n){varr=function(){"use strict";returnvoid0===this}();if(r)e.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){varn=Object.getOwnPropertyDescriptor(t,e);return!(n&&!n.writable&&!n.set)}};else{vari={}.hasOwnProperty,o={}.toString,a={}.constructor.prototype,s=function(t){vare=[];for(varnint)i.call(t,n)&&e.push(n);returne},c=function(t,e){return{value:t[e]}},l=function(t,e,n){returnt[e]=n.value,t},u=function(t){returnt},p=function(t){try{returnObject(t).constructor.prototype}catch(e){returna}},f=function(t){try{return"[object Array]"===o.call(t)}catch(e){return!1}};e.exports={isArray:f,keys:s,names:s,defineProperty:l,getDescriptor:c,freeze:u,getPrototypeOf:p,isES5:r,propertyIsWritable:function(){return!0}}}},{}],11:[function(t,e,n){"use strict";e.exports=function(e,n,r){functioni(t,e,n){this.promise=t,this.type=e,this.handler=n,this.called=!1,this.cancelPromise=null}functiono(t){this.finallyHandler=t}functiona(t,e){returnnull!=t.cancelPromise?(arguments.length>1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0):!1}functions(){returnl.call(this,this.promise._target()._settledValue())}functionc(t){returna(this,t)?void0:(f.e=t,f)}functionl(t){vari=this.promise,l=this.handler;if(!this.called){this.called=!0;varu=this.isFinallyHandler()?l.call(i._boundValue()):l.call(i._boundValue(),t);if(u===r)returnu;if(void0!==u){i._setReturnedNonUndefined();varh=n(u,i);if(hinstanceofe){if(null!=this.cancelPromise){if(h._isCancelled()){var_=newp("late cancellation observer");returni._attachExtraTrace(_),f.e=_,f}h.isPending()&&h._attachCancellationCallback(newo(this))}returnh._then(s,c,void0,this,void0)}}}returni.isRejected()?(a(this),f.e=t,f):(a(this),t)}varu=t("./util"),p=e.CancellationError,f=u.errorObj,h=t("./catch_filter")(r);returni.prototype.isFinallyHandler=function(){return0===this.type},o.prototype._resultCancelled=function(){a(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,r){return"function"!=typeoft?this.then():this._then(n,r,void0,newi(this,e,t),void0)},e.prototype.lastly=e.prototype["finally"]=function(t){returnthis._passThrough(t,0,l,l)},e.prototype.tap=function(t){returnthis._passThrough(t,1,l)},e.prototype.tapCatch=function(t){varn=arguments.length;if(1===n)returnthis._passThrough(t,1,void0,l);varr,i=newArray(n-1),o=0;for(r=0;n-1>r;++r){vara=arguments[r];if(!u.isObject(a))returne.reject(newTypeError("tapCatch statement predicate: expecting an object but got "+u.classString(a)));i[o++]=a}i.length=o;vars=arguments[r];returnthis._passThrough(h(i,s,this),1,void0,l)},i}},{"./catch_filter":5,"./util":21}],12:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,a){vars=t("./util");s.canEvaluate,s.tryCatch,s.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":21}],13:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){vara=t("./util"),s=a.tryCatch;e.method=function(t){if("function"!=typeoft)thrownewe.TypeError("expecting a function but got "+a.classString(t));returnfunction(){varr=newe(n);r._captureStackTrace(),r._pushContext();vari=s(t).apply(this,arguments),a=r._popContext();returno.checkForgottenReturns(i,a,"Promise.method",r),r._resolveFromSyncValue(i),r}},e.attempt=e["try"]=function(t){if("function"!=typeoft)returni("expecting a function but got "+a.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=a.isArray(l)?s(t).apply(u,l):s(t).call(u,l)}elsec=s(t)();varp=r._popContext();returno.checkForgottenReturns(c,p,"Promise.try",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":21}],14:[function(t,e,n){"use strict";functionr(t){returntinstanceofError&&u.getPrototypeOf(t)===Error.prototype}functioni(t){vare;if(r(t)){e=newl(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(varn=u.keys(t),i=0;i<n.length;++i){varo=n[i];p.test(o)||(e[o]=t[o])}returne}returna.markAsOriginatingFromRejection(t),t}functiono(t,e){returnfunction(n,r){if(null!==t){if(n){varo=i(s(n));t._attachExtraTrace(o),t._reject(o)}elseif(e){vara=[].slice.call(arguments,1);t._fulfill(a)}elset._fulfill(r);t=null}}}vara=t("./util"),s=a.maybeWrapAsError,c=t("./errors"),l=c.OperationalError,u=t("./es5"),p=/^(?:name|message|stack|cause)$/;e.exports=o},{"./errors":9,"./es5":10,"./util":21}],15:[function(t,e,n){"use strict";e.exports=function(){functionn(){}functionr(t,e){if(null==t||t.constructor!==i)thrownewg("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n");if("function"!=typeofe)thrownewg("expecting a function but got "+h.classString(e))}functioni(t){t!==b&&r(this,t),this._bitField=0,this._fulfillmentHandler0=void0,this._rejectionHandler0=void0,this._promise0=void0,this._receiver0=void0,this._resolveFromExecutor(t),this._promiseCreated(),this._fireEvent("promiseCreated",this)}functiono(t){this.promise._resolveCallback(t)}functiona(t){this.promise._rejectCallback(t,!1)}functions(t){vare=newi(b);e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._promise0=t,e._receiver0=t}varc,l=function(){returnnewg("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},u=function(){returnnewi.PromiseInspection(this._target())},p=function(t){returni.reject(newg(t))},f={},h=t("./util");c=h.isNode?function(){vart=process.domain;returnvoid0===t&&(t=null),t}:function(){returnnull},h.notEnumerableProp(i,"_getDomain",c);var_=t("./es5"),d=t("./async"),v=newd;_.defineProperty(i,"_async",{value:v});vary=t("./errors"),g=i.TypeError=y.TypeError;i.RangeError=y.RangeError;varm=i.CancellationError=y.CancellationError;i.TimeoutError=y.TimeoutError,i.OperationalError=y.OperationalError,i.RejectionError=y.OperationalError,i.AggregateError=y.AggregateError;varb=function(){},C={},w={},E=t("./thenables")(i,b),k=t("./promise_array")(i,b,E,p,n),j=t("./context")(i),F=(j.create,t("./debuggability")(i,j)),T=(F.CapturedTrace,t("./finally")(i,E,w)),P=t("./catch_filter")(w),R=t("./nodeback"),S=h.errorObj,x=h.tryCatch;returni.prototype.toString=function(){return"[object Promise]"},i.prototype.caught=i.prototype["catch"]=function(t){vare=arguments.length;if(e>1){varn,r=newArray(e-1),i=0;for(n=0;e-1>n;++n){varo=arguments[n];if(!h.isObject(o))returnp("Catch statement predicate: expecting an object but got "+h.classString(o));r[i++]=o}returnr.length=i,t=arguments[n],this.then(void0,P(r,t,this))}returnthis.then(void0,t)},i.prototype.reflect=function(){returnthis._then(u,u,void0,this,void0)},i.prototype.then=function(t,e){if(F.warnings()&&arguments.length>0&&"function"!=typeoft&&"function"!=typeofe){varn=".then() only accepts functions but was passed: "+h.classString(t);arguments.length>1&&(n+=", "+h.classString(e)),this._warn(n)}returnthis._then(t,e,void0,void0,void0)},i.prototype.done=function(t,e){varn=this._then(t,e,void0,void0,void0);n._setIsFinal()},i.prototype.spread=function(t){return"function"!=typeoft?p("expecting a function but got "+h.classString(t)):this.all()._then(t,void0,void0,C,void0)},i.prototype.toJSON=function(){vart={isFulfilled:!1,isRejected:!1,fulfillmentValue:void0,rejectionReason:void0};returnthis.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},i.prototype.all=function(){returnarguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),newk(this).promise()},i.prototype.error=function(t){returnthis.caught(h.originatesFromRejection,t)},i.getNewLibraryCopy=e.exports,i.is=function(t){returntinstanceofi},i.fromNode=i.fromCallback=function(t){vare=newi(b);e._captureStackTrace();varn=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,r=x(t)(R(e,n));returnr===S&&e._rejectCallback(r.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},i.all=function(t){returnnewk(t).promise()},i.cast=function(t){vare=E(t);returneinstanceofi||(e=newi(b),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},i.resolve=i.fulfilled=i.cast,i.reject=i.rejected=function(t){vare=newi(b);returne._captureStackTrace(),e._rejectCallback(t,!0),e},i.setScheduler=function(t){if("function"!=typeoft)thrownewg("expecting a function but got "+h.classString(t));returnv.setScheduler(t)},i.prototype._then=function(t,e,n,r,o){vara=void0!==o,s=a?o:newi(b),l=this._target(),u=l._bitField;a||(s._propagateFrom(this,3),s._captureStackTrace(),void0===r&&0!==(2097152&this._bitField)&&(r=0!==(50397184&u)?this._boundValue():l===this?void0:this._boundTo),this._fireEvent("promiseChained",this,s));varp=c();if(0!==(50397184&u)){varf,_,d=l._settlePromiseCtx;0!==(33554432&u)?(_=l._rejectionHandler0,f=t):0!==(16777216&u)?(_=l._fulfillmentHandler0,f=e,l._unsetRejectionIsUnhandled()):(d=l._settlePromiseLateCancellationObserver,_=newm("late cancellation observer"),l._attachExtraTrace(_),f=e),v.invoke(d,l,{handler:null===p?f:"function"==typeoff&&h.domainBind(p,f),promise:s,receiver:r,value:_})}elsel._addCallbacks(t,e,s,r,p);returns},i.prototype._length=function(){return65535&this._bitField},i.prototype._isFateSealed=function(){return0!==(117506048&this._bitField)},i.prototype._isFollowing=function(){return67108864===(67108864&this._bitField)},i.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},i.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},i.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},i.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},i.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},i.prototype._isFinal=function(){return(4194304&this._bitField)>0},i.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},i.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},i.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},i.prototype._setAsyncGuaranteed=function(){v.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},i.prototype._receiverAt=function(t){vare=0===t?this._receiver0:this[4*t-4+3];returne===f?void0:void0===e&&this._isBound()?this._boundValue():e},i.prototype._promiseAt=function(t){returnthis[4*t-4+2]},i.prototype._fulfillmentHandlerAt=function(t){returnthis[4*t-4+0]},i.prototype._rejectionHandlerAt=function(t){returnthis[4*t-4+1]},i.prototype._boundValue=function(){},i.prototype._migrateCallback0=function(t){vare=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void0===i&&(i=f),this._addCallbacks(e,n,r,i,null)},i.prototype._migrateCallbackAt=function(t,e){varn=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void0===o&&(o=f),this._addCallbacks(n,r,i,o,null)},i.prototype._addCallbacks=function(t,e,n,r,i){varo=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeoft&&(this._fulfillmentHandler0=null===i?t:h.domainBind(i,t)),"function"==typeofe&&(this._rejectionHandler0=null===i?e:h.domainBind(i,e));else{vara=4*o-4;this[a+2]=n,this[a+3]=r,"function"==typeoft&&(this[a+0]=null===i?t:h.domainBind(i,t)),"function"==typeofe&&(this[a+1]=null===i?e:h.domainBind(i,e))}returnthis._setLength(o+1),o},i.prototype._proxy=function(t,e){this._addCallbacks(void0,void0,e,t,null)},i.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)returnthis._rejectCallback(l(),!1);varn=E(t,this);if(!(ninstanceofi))returnthis._fulfill(t);e&&this._propagateFrom(n,2);varr=n._target();if(r===this)returnvoidthis._reject(l());varo=r._bitField;if(0===(50397184&o)){vara=this._length();a>0&&r._migrateCallback0(this);for(vars=1;a>s;++s)r._migrateCallbackAt(this,s);this._setFollowing(),this._setLength(0),this._setFollowee(r)}elseif(0!==(33554432&o))this._fulfill(r._value());elseif(0!==(16777216&o))this._reject(r._reason());else{varc=newm("late cancellation observer");r._attachExtraTrace(c),this._reject(c)}}},i.prototype._rejectCallback=function(t,e,n){varr=h.ensureErrorObject(t),i=r===t;if(!i&&!n&&F.warnings()){varo="a promise was rejected with a non-error: "+h.classString(t);this._warn(o,!0)}this._attachExtraTrace(r,e?i:!1),this._reject(t)},i.prototype._resolveFromExecutor=function(t){if(t!==b){vare=this;this._captureStackTrace(),this._pushContext();varn=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void0!==r&&e._rejectCallback(r,!0)}},i.prototype._settlePromiseFromHandler=function(t,e,n,r){vari=r._bitField;if(0===(65536&i)){r._pushContext();varo;e===C?n&&"number"==typeofn.length?o=x(t).apply(this._boundValue(),n):(o=S,o.e=newg("cannot .spread() a non-array: "+h.classString(n))):o=x(t).call(e,n);vara=r._popContext();i=r._bitField,0===(65536&i)&&(o===w?r._reject(n):o===S?r._rejectCallback(o.e,!1):(F.checkForgottenReturns(o,a,"",r,this),r._resolveCallback(o)))}},i.prototype._target=function(){for(vart=this;t._isFollowing();)t=t._followee();returnt},i.prototype._followee=function(){returnthis._rejectionHandler0},i.prototype._setFollowee=function(t){this._rejectionHandler0=t},i.prototype._settlePromise=function(t,e,r,o){vara=tinstanceofi,s=this._bitField,c=0!==(134217728&s);0!==(65536&s)?(a&&t._invokeInternalOnCancel(),rinstanceofT&&r.isFinallyHandler()?(r.cancelPromise=t,x(e).call(r,o)===S&&t._reject(S.e)):e===u?t._fulfill(u.call(r)):rinstanceofn?r._promiseCancelled(t):a||tinstanceofk?t._cancel():r.cancel()):"function"==typeofe?a?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,r,o,t)):e.call(r,o,t):rinstanceofn?r._isResolved()||(0!==(33554432&s)?r._promiseFulfilled(o,t):r._promiseRejected(o,t)):a&&(c&&t._setAsyncGuaranteed(),0!==(33554432&s)?t._fulfill(o):t._reject(o))},i.prototype._settlePromiseLateCancellationObserver=function(t){vare=t.handler,n=t.promise,r=t.receiver,o=t.value;"function"==typeofe?ninstanceofi?this._settlePromiseFromHandler(e,r,o,n):e.call(r,o,n):ninstanceofi&&n._reject(o)},i.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},i.prototype._settlePromise0=function(t,e,n){varr=this._promise0,i=this._receiverAt(0);this._promise0=void0,this._receiver0=void0,this._settlePromise(r,t,i,e)},i.prototype._clearCallbackDataAtIndex=function(t){vare=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void0},i.prototype._fulfill=function(t){vare=this._bitField;if(!((117506048&e)>>>16)){if(t===this){varn=l();returnthis._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():v.settlePromises(this),this._dereferenceTrace())}},i.prototype._reject=function(t){vare=this._bitField;if(!((117506048&e)>>>16))returnthis._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?v.fatalError(t,h.isNode):void((65535&e)>0?v.settlePromises(this):this._ensurePossibleRejectionHandled())},i.prototype._fulfillPromises=function(t,e){for(varn=1;t>n;n++){varr=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._rejectPromises=function(t,e){for(varn=1;t>n;n++){varr=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._settlePromises=function(){vart=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){varn=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{varr=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},i.prototype._settledValue=function(){vart=this._bitField;return0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void0},i.defer=i.pending=function(){F.deprecated("Promise.defer","new Promise");vart=newi(b);return{promise:t,resolve:o,reject:a}},h.notEnumerableProp(i,"_makeSelfResolutionError",l),t("./method")(i,b,E,p,F),t("./bind")(i,b,E,F),t("./cancel")(i,k,p,F),t("./direct_resolve")(i),t("./synchronous_inspection")(i),t("./join")(i,k,E,b,v,c),i.Promise=i,i.version="3.5.4",h.toFastProperties(i),h.toFastProperties(i.prototype),s({a:1}),s({b:2}),s({c:3}),s(1),s(function(){}),s(void0),s(!1),s(newi(b)),F.setBounds(d.firstLineError,h.lastLineError),i}},{"./async":1,"./bind":2,"./cancel":4,"./catch_filter":5,"./context":6,"./debuggability":7,"./direct_resolve":8,"./errors":9,"./es5":10,"./finally":11,"./join":12,"./method":13,"./nodeback":14,"./promise_array":16,"./synchronous_inspection":19,"./thenables":20,"./util":21}],16:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){functiona(t){switch(t){case-2:return[];case-3:return{};case-6:returnnewMap}}functions(t){varr=this._promise=newe(n);tinstanceofe&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void0,-2)}varc=t("./util");c.isArray;returnc.inherits(s,o),s.prototype.length=function(){returnthis._length},s.prototype.promise=function(){returnthis._promise},s.prototype._init=functionl(t,n){varo=r(this._values,this._promise);if(oinstanceofe){o=o._target();vars=o._bitField;if(this._values=o,0===(50397184&s))returnthis._promise._setAsyncGuaranteed(),o._then(l,this._reject,void0,this,n);if(0===(33554432&s))return0!==(16777216&s)?this._reject(o._reason()):this._cancel();o=o._value()}if(o=c.asArray(o),null===o){varu=i("expecting an array or an iterable object but got "+c.classString(o)).reason();returnvoidthis._promise._rejectCallback(u,!1)}return0===o.length?void(-5===n?this._resolveEmptyArray():this._resolve(a(n))):voidthis._iterate(o)},s.prototype._iterate=function(t){varn=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?newArray(n):this._values;for(vari=this._promise,o=!1,a=null,s=0;n>s;++s){varc=r(t[s],i);cinstanceofe?(c=c._target(),a=c._bitField):a=null,o?null!==a&&c.suppressUnhandledRejections():null!==a?0===(50397184&a)?(c._proxy(this,s),this._values[s]=c):o=0!==(33554432&a)?this._promiseFulfilled(c._value(),s):0!==(16777216&a)?this._promiseRejected(c._reason(),s):this._promiseCancelled(s):o=this._promiseFulfilled(c,s)}o||i._setAsyncGuaranteed()},s.prototype._isResolved=function(){returnnull===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},s.prototype._promiseFulfilled=function(t,e){this._values[e]=t;varn=++this._totalResolved;returnn>=this._length?(this._resolve(this._values),!0):!1},s.prototype._promiseCancelled=function(){returnthis._cancel(),!0},s.prototype._promiseRejected=function(t){returnthis._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){vart=this._values;if(this._cancel(),tinstanceofe)t.cancel();elsefor(varn=0;n<t.length;++n)t[n]instanceofe&&t[n].cancel()}},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(t){returnt},s}},{"./util":21}],17:[function(t,e,n){"use strict";functionr(t,e,n,r,i){for(varo=0;i>o;++o)n[o+r]=t[o+e],t[o+e]=void0}functioni(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){returnthis._capacity<t},i.prototype._pushOne=function(t){vare=this.length();this._checkCapacity(e+1);varn=this._front+e&this._capacity-1;this[n]=t,this._length=e+1},i.prototype.push=function(t,e,n){varr=this.length()+3;if(this._willBeOverCapacity(r))returnthis._pushOne(t),this._pushOne(e),voidthis._pushOne(n);vari=this._front+r-3;this._checkCapacity(r);varo=this._capacity-1;this[i+0&o]=t,this[i+1&o]=e,this[i+2&o]=n,this._length=r},i.prototype.shift=function(){vart=this._front,e=this[t];returnthis[t]=void0,this._front=t+1&this._capacity-1,this._length--,e},i.prototype.length=function(){returnthis._length},i.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},i.prototype._resizeTo=function(t){vare=this._capacity;this._capacity=t;varn=this._front,i=this._length,o=n+i&e-1;r(this,0,this,e,o)},e.exports=i},{}],18:[function(t,e,n){"use strict";varr,i=t("./util"),o=function(){thrownewError("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")},a=i.getNativePromise();if(i.isNode&&"undefined"==typeofMutationObserver){vars=global.setImmediate,c=process.nextTick;r=i.isRecentNode?function(t){s.call(global,t)}:function(t){c.call(process,t)}}elseif("function"==typeofa&&"function"==typeofa.resolve){varl=a.resolve();r=function(t){l.then(t)}}elser="undefined"==typeofMutationObserver||"undefined"!=typeofwindow&&window.navigator&&(window.navigator.standalone||window.cordova)?"undefined"!=typeofsetImmediate?function(t){setImmediate(t)}:"undefined"!=typeofsetTimeout?function(t){setTimeout(t,0)}:o:function(){vart=document.createElement("div"),e={attributes:!0},n=!1,r=document.createElement("div"),i=newMutationObserver(function(){t.classList.toggle("foo"),n=!1});i.observe(r,e);varo=function(){n||(n=!0,r.classList.toggle("foo"))};returnfunction(n){varr=newMutationObserver(function(){r.disconnect(),n()});r.observe(t,e),o()}}();e.exports=r},{"./util":21}],19:[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)},a=e.prototype.isPending=function(){return0===(50397184&this._bitField)},s=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(){returna.call(this._target())},t.prototype.isRejected=function(){returno.call(this._target())},t.prototype.isFulfilled=function(){returni.call(this._target())},t.prototype.isResolved=function(){returns.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._settledValue()},t.PromiseInspection=e}},{}],20:[function(t,e,n){"use strict";e.exports=function(e,n){functionr(t,r){if(u(t)){if(tinstanceofe)returnt;vari=o(t);if(i===l){r&&r._pushContext();varc=e.reject(i.e);returnr&&r._popContext(),c}if("function"==typeofi){if(a(t)){varc=newe(n);returnt._then(c._fulfill,c._reject,void0,c,null),c}returns(t,i,r)}}returnt}functioni(t){returnt.then}functiono(t){try{returni(t)}catch(e){returnl.e=e,l}}functiona(t){try{returnp.call(t,"_promise0")}catch(e){return!1}}functions(t,r,i){functiono(t){s&&(s._resolveCallback(t),s=null)}functiona(t){s&&(s._rejectCallback(t,p,!0),s=null)}vars=newe(n),u=s;i&&i._pushContext(),s._captureStackTrace(),i&&i._popContext();varp=!0,f=c.tryCatch(r).call(t,o,a);returnp=!1,s&&f===l&&(s._rejectCallback(f.e,!0,!0),s=null),u}varc=t("./util"),l=c.errorObj,u=c.isObject,p={}.hasOwnProperty;returnr}},{"./util":21}],21:[function(t,e,n){"use strict";functionr(){try{vart=R;returnR=null,t.apply(this,arguments)}catch(e){returnP.e=e,P}}functioni(t){returnR=t,r}functiono(t){returnnull==t||t===!0||t===!1||"string"==typeoft||"number"==typeoft}functiona(t){return"function"==typeoft||"object"==typeoft&&null!==t}functions(t){returno(t)?newError(v(t)):t}functionc(t,e){varn,r=t.length,i=newArray(r+1);for(n=0;r>n;++n)i[n]=t[n];returni[n]=e,i}functionl(t,e,n){if(!F.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void0;varr=Object.getOwnPropertyDescriptor(t,e);returnnull!=r?null==r.get&&null==r.set?r.value:n:void0}functionu(t,e,n){if(o(t))returnt;varr={value:n,configurable:!0,enumerable:!1,writable:!0};returnF.defineProperty(t,e,r),t}functionp(t){throwt}functionf(t){try{if("function"==typeoft){vare=F.names(t.prototype),n=F.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=A.test(t+"")&&F.names(t).length>0;if(n||r||i)return!0}return!1}catch(o){return!1}}functionh(t){functione(){}functionn(){returntypeofr.foo}e.prototype=t;varr=newe;returnn(),n(),t}function_(t){returnN.test(t)}functiond(t,e,n){for(varr=newArray(t),i=0;t>i;++i)r[i]=e+i+n;returnr}functionv(t){try{returnt+""}catch(e){return"[no string representation]"}}functiony(t){returntinstanceofError||null!==t&&"object"==typeoft&&"string"==typeoft.message&&"string"==typeoft.name}functiong(t){try{u(t,"isOperational",!0)}catch(e){}}functionm(t){returnnull==t?!1:tinstanceofError.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}functionb(t){returny(t)&&F.propertyIsWritable(t,"stack")}functionC(t){return{}.toString.call(t)}functionw(t,e,n){for(varr=F.names(t),i=0;i<r.length;++i){varo=r[i];if(n(o))try{F.defineProperty(e,o,F.getDescriptor(t,o))}catch(a){}}}functionE(t){returnH?process.env[t]:void0}functionk(){if("function"==typeofPromise)try{vart=newPromise(function(){});if("[object Promise]"==={}.toString.call(t))returnPromise}catch(e){}}functionj(t,e){returnt.bind(e)}varF=t("./es5"),T="undefined"==typeofnavigator,P={e:{}},R,S="undefined"!=typeofself?self:"undefined"!=typeofwindow?window:"undefined"!=typeofglobal?global:void0!==this?this:null,x=function(t,e){functionn(){this.constructor=t,this.constructor$=e;for(varnine.prototype)r.call(e.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=e.prototype[n])}varr={}.hasOwnProperty;returnn.prototype=e.prototype,t.prototype=newn,t.prototype},O=function(){vart=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(varn=0;n<t.length;++n)if(t[n]===e)return!0;return!1};if(F.isES5){varn=Object.getOwnPropertyNames;returnfunction(t){for(varr=[],i=Object.create(null);null!=t&&!e(t);){varo;try{o=n(t)}catch(a){returnr}for(vars=0;s<o.length;++s){varc=o[s];if(!i[c]){i[c]=!0;varl=Object.getOwnPropertyDescriptor(t,c);null!=l&&null==l.get&&null==l.set&&r.push(c)}}t=F.getPrototypeOf(t)}returnr}}varr={}.hasOwnProperty;returnfunction(n){if(e(n))return[];vari=[];t:for(varoinn)if(r.call(n,o))i.push(o);else{for(vara=0;a<t.length;++a)if(r.call(t[a],o))continuet;i.push(o)}returni}}(),A=/this\s*\.\s*\S+\s*=/,N=/^[a-z$_][a-z$_0-9]*$/i,L=function(){return"stack"innewError?function(t){returnb(t)?t:newError(v(t))}:function(t){if(b(t))returnt;try{thrownewError(v(t))}catch(e){returne}}}(),B=function(t){returnF.isArray(t)?t:null};if("undefined"!=typeofSymbol&&Symbol.iterator){varU="function"==typeofArray.from?function(t){returnArray.from(t)}:function(t){for(vare,n=[],r=t[Symbol.iterator]();!(e=r.next()).done;)n.push(e.value);returnn};B=function(t){returnF.isArray(t)?t:null!=t&&"function"==typeoft[Symbol.iterator]?U(t):null}}varI="undefined"!=typeofprocess&&"[object process]"===C(process).toLowerCase(),H="undefined"!=typeofprocess&&"undefined"!=typeofprocess.env,D={isClass:f,isIdentifier:_,inheritedDataKeys:O,getDataPropertyOrDefault:l,thrower:p,isArray:F.isArray,asArray:B,notEnumerableProp:u,isPrimitive:o,isObject:a,isError:y,canEvaluate:T,errorObj:P,tryCatch:i,inherits:x,withAppended:c,maybeWrapAsError:s,toFastProperties:h,filledRange:d,toString:v,canAttachTrace:b,ensureErrorObject:L,originatesFromRejection:m,markAsOriginatingFromRejection:g,classString:C,copyDescriptors:w,hasDevTools:"undefined"!=typeofchrome&&chrome&&"function"==typeofchrome.loadTimes,isNode:I,hasEnvVariables:H,env:E,global:S,getNativePromise:k,domainBind:j};D.isRecentNode=D.isNode&&function(){vart;returnprocess.versions&&process.versions.node?t=process.versions.node.split(".").map(Number):process.version&&(t=process.version.split(".").map(Number)),0===t[0]&&t[1]>10||t[0]>0}(),D.isNode&&D.toFastProperties(process);try{thrownewError}catch(V){D.lastLineError=V}e.exports=D},{"./es5":10}]},{},[3])(3)}),"undefined"!=typeofwindow&&null!==window?window.P=window.Promise:"undefined"!=typeofself&&null!==self&&(self.P=self.Promise);