UNPKG

dhtmlx-scheduler

Version:

JavaScript event calendar. Allows to manage events and appointments in different views

35 lines 459 kB
/*! * @license * * dhtmlxScheduler v.6.0.3 Standard * * To use dhtmlxScheduler in non-GPL projects (and get Pro version of the product), please obtain Commercial/Enterprise or Ultimate license on our site https://dhtmlx.com/docs/products/dhtmlxScheduler/#licensing or contact us at sales@dhtmlx.com * * (c) XB Software Ltd. * */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("dhtmlxscheduler",[],t):"object"==typeof exports?exports.dhtmlxscheduler=t():e.dhtmlxscheduler=t()}(window,function(){return function(e){var t={};function a(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,a),i.l=!0,i.exports}return a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)a.d(n,i,function(t){return e[t]}.bind(null,i));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/codebase/",a(a.s=9)}([function(e,t,a){"use strict";(function(e){var a;a="undefined"!=typeof window?window:e,t.a=a}).call(this,a(1))},function(e,t){function a(e){"@babel/helpers - typeof";return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":a(window))&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){return function(){var e={};for(var t in this._events){var a=this._events[t];-1==a.id.toString().indexOf("#")&&(e[a.id]=a)}return e}.bind(e)}},function(e,t){e.exports=function(e){if("string"==typeof e||"number"==typeof e)return e;var t="";for(var a in e){var n="";e.hasOwnProperty(a)&&(n=a+"="+(n="string"==typeof e[a]?encodeURIComponent(e[a]):"number"==typeof e[a]?e[a]:encodeURIComponent(JSON.stringify(e[a]))),t.length&&(n="&"+n),t+=n)}return t}},function(e,t,a){"use strict";a.r(t)},function(e,t){var a,n,i=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(a===setTimeout)return setTimeout(e,0);if((a===r||!a)&&setTimeout)return a=setTimeout,setTimeout(e,0);try{return a(e,0)}catch(t){try{return a.call(null,e,0)}catch(t){return a.call(this,e,0)}}}!function(){try{a="function"==typeof setTimeout?setTimeout:r}catch(e){a=r}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var _,d=[],l=!1,c=-1;function u(){l&&_&&(l=!1,_.length?d=_.concat(d):c=-1,d.length&&h())}function h(){if(!l){var e=s(u);l=!0;for(var t=d.length;t;){for(_=d,d=[];++c<t;)_&&_[c].run();c=-1,t=d.length}_=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)t[a-1]=arguments[a];d.push(new f(e,t)),1!==d.length||l||s(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,a){(function(a,n,i){var r,o,s;function _(e){"@babel/helpers - typeof";return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)} /* @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. * */!function(a){"object"==_(t)&&void 0!==e?e.exports=a():(o=[],void 0===(s="function"==typeof(r=a)?r.apply(t,o):r)||(e.exports=s))}(function(){var e,t,r;return function e(t,a,n){function i(o,s){if(!a[o]){if(!t[o]){var _="function"==typeof _dereq_&&_dereq_;if(!s&&_)return _(o,!0);if(r)return r(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var l=a[o]={exports:{}};t[o][0].call(l.exports,function(e){var a=t[o][1][e];return i(a||e)},l,l.exports,e,t,a,n)}return a[o].exports}for(var r="function"==typeof _dereq_&&_dereq_,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(e,t,n){"use strict";var i;try{throw new Error}catch(e){i=e}var r=e("./schedule"),o=e("./queue");function s(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new o(16),this._normalQueue=new o(16),this._haveDrainedQueues=!1;var e=this;this.drainQueues=function(){e._drainQueues()},this._schedule=r}function _(e){for(;e.length()>0;)d(e)}function d(e){var t=e.shift();if("function"!=typeof t)t._settlePromises();else{var a=e.shift(),n=e.shift();t.call(a,n)}}s.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t},s.prototype.hasCustomScheduler=function(){return this._customScheduler},s.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},s.prototype.fatalError=function(e,t){t?(a.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n"),a.exit(2)):this.throwLater(e)},s.prototype.throwLater=function(e,t){if(1===arguments.length&&(t=e,e=function(){throw t}),"undefined"!=typeof setTimeout)setTimeout(function(){e(t)},0);else try{this._schedule(function(){e(t)})}catch(e){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},s.prototype.invokeLater=function(e,t,a){this._lateQueue.push(e,t,a),this._queueTick()},s.prototype.invoke=function(e,t,a){this._normalQueue.push(e,t,a),this._queueTick()},s.prototype.settlePromises=function(e){this._normalQueue._pushOne(e),this._queueTick()},s.prototype._drainQueues=function(){_(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,_(this._lateQueue)},s.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},s.prototype._reset=function(){this._isTickUsed=!1},t.exports=s,t.exports.firstLineError=i},{"./queue":17,"./schedule":18}],2:[function(e,t,a){"use strict";t.exports=function(e,t,a,n){var i=!1,r=function(e,t){this._reject(t)},o=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(r,r,null,this,e)},s=function(e,t){0==(50397184&this._bitField)&&this._resolveCallback(t.target)},_=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(r){i||(i=!0,e.prototype._propagateFrom=n.propagateFromFunction(),e.prototype._boundValue=n.boundValueFunction());var d=a(r),l=new e(t);l._propagateFrom(this,1);var c=this._target();if(l._setBoundTo(d),d instanceof e){var u={promiseRejectionQueued:!1,promise:l,target:c,bindingPromise:d};c._then(t,o,void 0,l,u),d._then(s,_,void 0,l,u),l._setOnCancel(d)}else l._resolveCallback(c);return l},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=-2097153&this._bitField},e.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},e.bind=function(t,a){return e.resolve(a).bind(t)}}},{}],3:[function(e,t,a){"use strict";var n;"undefined"!=typeof Promise&&(n=Promise);var i=e("./promise")();i.noConflict=function(){try{Promise===i&&(Promise=n)}catch(e){}return i},t.exports=i},{"./promise":15}],4:[function(e,t,a){"use strict";t.exports=function(t,a,n,i){var r=e("./util"),o=r.tryCatch,s=r.errorObj,_=t._async;t.prototype.break=t.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var a=e._cancellationParent;if(null==a||!a._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=a}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),_.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(e,t){if(r.isArray(e))for(var a=0;a<e.length;++a)this._doInvokeOnCancel(e[a],t);else if(void 0!==e)if("function"==typeof e){if(!t){var n=o(e).call(this._boundValue());n===s&&(this._attachExtraTrace(n.e),_.throwLater(n.e))}}else e._resultCancelled(this)},t.prototype._invokeOnCancel=function(){var e=this._onCancel();this._unsetOnCancel(),_.invoke(this._doInvokeOnCancel,this,e)},t.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},t.prototype._resultCancelled=function(){this.cancel()}}},{"./util":21}],5:[function(e,t,a){"use strict";t.exports=function(t){var a=e("./util"),n=e("./es5").keys,i=a.tryCatch,r=a.errorObj;return function(e,o,s){return function(_){var d=s._boundValue();e:for(var l=0;l<e.length;++l){var c=e[l];if(c===Error||null!=c&&c.prototype instanceof Error){if(_ instanceof c)return i(o).call(d,_)}else if("function"==typeof c){var u=i(c).call(d,_);if(u===r)return u;if(u)return i(o).call(d,_)}else if(a.isObject(_)){for(var h=n(c),f=0;f<h.length;++f){var p=h[f];if(c[p]!=_[p])continue e}return i(o).call(d,_)}}return t}}}},{"./es5":10,"./util":21}],6:[function(e,t,a){"use strict";t.exports=function(e){var t=!1,a=[];function n(){this._trace=new n.CapturedTrace(i())}function i(){var e=a.length-1;if(e>=0)return a[e]}return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},n.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,a.push(this._trace))},n.prototype._popContext=function(){if(void 0!==this._trace){var e=a.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},n.CapturedTrace=null,n.create=function(){if(t)return new n},n.deactivateLongStackTraces=function(){},n.activateLongStackTraces=function(){var a=e.prototype._pushContext,r=e.prototype._popContext,o=e._peekContext,s=e.prototype._peekContext,_=e.prototype._promiseCreated;n.deactivateLongStackTraces=function(){e.prototype._pushContext=a,e.prototype._popContext=r,e._peekContext=o,e.prototype._peekContext=s,e.prototype._promiseCreated=_,t=!1},t=!0,e.prototype._pushContext=n.prototype._pushContext,e.prototype._popContext=n.prototype._popContext,e._peekContext=e.prototype._peekContext=i,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},n}},{}],7:[function(e,t,n){"use strict";t.exports=function(t,n,i,r){var o,s,d,l,c=t._async,u=e("./errors").Warning,h=e("./util"),f=e("./es5"),p=h.canAttachTrace,v=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,g=/\((?:timers\.js):\d+:\d+\)/,m=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,y=null,b=null,x=!1,k=!(0==h.env("BLUEBIRD_DEBUG")),w=!(0==h.env("BLUEBIRD_WARNINGS")||!k&&!h.env("BLUEBIRD_WARNINGS")),E=!(0==h.env("BLUEBIRD_LONG_STACK_TRACES")||!k&&!h.env("BLUEBIRD_LONG_STACK_TRACES")),S=0!=h.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(w||!!h.env("BLUEBIRD_W_FORGOTTEN_RETURN"));!function(){var e=[];function a(){for(var t=0;t<e.length;++t)e[t]._notifyUnhandledRejection();n()}function n(){e.length=0}l=function(t){e.push(t),setTimeout(a,1)},f.defineProperty(t,"_unhandledRejectionCheck",{value:a}),f.defineProperty(t,"_unhandledRejectionClear",{value:n})}(),t.prototype.suppressUnhandledRejections=function(){var e=this._target();e._bitField=-1048577&e._bitField|524288},t.prototype._ensurePossibleRejectionHandled=function(){0==(524288&this._bitField)&&(this._setRejectionIsUnhandled(),l(this))},t.prototype._notifyUnhandledRejectionIsHandled=function(){K("rejectionHandled",o,void 0,this)},t.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},t.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},t.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var e=this._settledValue();this._setUnhandledRejectionIsNotified(),K("unhandledRejection",s,e,this)}},t.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},t.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},t.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},t.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},t.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},t.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},t.prototype._warn=function(e,t,a){return q(e,t,a||this)},t.onPossiblyUnhandledRejection=function(e){var a=t._getContext();s=h.contextBind(a,e)},t.onUnhandledRejectionHandled=function(e){var a=t._getContext();o=h.contextBind(a,e)};var D=function(){};t.longStackTraces=function(){if(c.haveItemsQueued()&&!ne.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!ne.longStackTraces&&X()){var e=t.prototype._captureStackTrace,a=t.prototype._attachExtraTrace,i=t.prototype._dereferenceTrace;ne.longStackTraces=!0,D=function(){if(c.haveItemsQueued()&&!ne.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");t.prototype._captureStackTrace=e,t.prototype._attachExtraTrace=a,t.prototype._dereferenceTrace=i,n.deactivateLongStackTraces(),ne.longStackTraces=!1},t.prototype._captureStackTrace=B,t.prototype._attachExtraTrace=V,t.prototype._dereferenceTrace=U,n.activateLongStackTraces()}},t.hasLongStackTraces=function(){return ne.longStackTraces&&X()};var N={unhandledrejection:{before:function(){var e=h.global.onunhandledrejection;return h.global.onunhandledrejection=null,e},after:function(e){h.global.onunhandledrejection=e}},rejectionhandled:{before:function(){var e=h.global.onrejectionhandled;return h.global.onrejectionhandled=null,e},after:function(e){h.global.onrejectionhandled=e}}},C=function(){var e=function(e,t){if(!e)return!h.global.dispatchEvent(t);var a;try{return a=e.before(),!h.global.dispatchEvent(t)}finally{e.after(a)}};try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return h.global.dispatchEvent(t),function(t,a){t=t.toLowerCase();var n=new CustomEvent(t,{detail:a,cancelable:!0});return f.defineProperty(n,"promise",{value:a.promise}),f.defineProperty(n,"reason",{value:a.reason}),e(N[t],n)}}if("function"==typeof Event){t=new Event("CustomEvent");return h.global.dispatchEvent(t),function(t,a){t=t.toLowerCase();var n=new Event(t,{cancelable:!0});return n.detail=a,f.defineProperty(n,"promise",{value:a.promise}),f.defineProperty(n,"reason",{value:a.reason}),e(N[t],n)}}return(t=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),h.global.dispatchEvent(t),function(t,a){t=t.toLowerCase();var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!0,a),e(N[t],n)}}catch(e){}return function(){return!1}}(),T=h.isNode?function(){return a.emit.apply(a,arguments)}:h.global?function(e){var t="on"+e.toLowerCase(),a=h.global[t];return!!a&&(a.apply(h.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function A(e,t){return{promise:t}}var M={promiseCreated:A,promiseFulfilled:A,promiseRejected:A,promiseResolved:A,promiseCancelled:A,promiseChained:function(e,t,a){return{promise:t,child:a}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,a){return{reason:t,promise:a}},rejectionHandled:A},O=function(e){var t=!1;try{t=T.apply(null,arguments)}catch(e){c.throwLater(e),t=!0}var a=!1;try{a=C(e,M[e].apply(null,arguments))}catch(e){c.throwLater(e),a=!0}return a||t};function H(){return!1}function j(e,t,a){var n=this;try{e(t,a,function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+h.toString(e));n._attachCancellationCallback(e)})}catch(e){return e}}function L(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?h.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function $(){return this._onCancelField}function P(e){this._onCancelField=e}function z(){this._cancellationParent=void 0,this._onCancelField=void 0}function F(e,t){if(0!=(1&t)){this._cancellationParent=e;var a=e._branchesRemainingToCancel;void 0===a&&(a=0),e._branchesRemainingToCancel=a+1}0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}t.config=function(e){if("longStackTraces"in(e=Object(e))&&(e.longStackTraces?t.longStackTraces():!e.longStackTraces&&t.hasLongStackTraces()&&D()),"warnings"in e){var a=e.warnings;ne.warnings=!!a,S=ne.warnings,h.isObject(a)&&"wForgottenReturn"in a&&(S=!!a.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!ne.cancellation){if(c.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");t.prototype._clearCancellationData=z,t.prototype._propagateFrom=F,t.prototype._onCancel=$,t.prototype._setOnCancel=P,t.prototype._attachCancellationCallback=L,t.prototype._execute=j,I=F,ne.cancellation=!0}if("monitoring"in e&&(e.monitoring&&!ne.monitoring?(ne.monitoring=!0,t.prototype._fireEvent=O):!e.monitoring&&ne.monitoring&&(ne.monitoring=!1,t.prototype._fireEvent=H)),"asyncHooks"in e&&h.nodeSupportsAsyncResource){var n=ne.asyncHooks,o=!!e.asyncHooks;n!==o&&(ne.asyncHooks=o,o?i():r())}return t},t.prototype._fireEvent=H,t.prototype._execute=function(e,t,a){try{e(t,a)}catch(e){return e}},t.prototype._onCancel=function(){},t.prototype._setOnCancel=function(e){},t.prototype._attachCancellationCallback=function(e){},t.prototype._captureStackTrace=function(){},t.prototype._attachExtraTrace=function(){},t.prototype._dereferenceTrace=function(){},t.prototype._clearCancellationData=function(){},t.prototype._propagateFrom=function(e,t){};var I=function(e,t){0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)};function R(){var e=this._boundTo;return void 0!==e&&e instanceof t?e.isFulfilled()?e.value():void 0:e}function B(){this._trace=new te(this._peekContext())}function V(e,t){if(p(e)){var a=this._trace;if(void 0!==a&&t&&(a=a._parent),void 0!==a)a.attachExtraTrace(e);else if(!e.__stackCleaned__){var n=Y(e);h.notEnumerableProp(e,"stack",n.message+"\n"+n.stack.join("\n")),h.notEnumerableProp(e,"__stackCleaned__",!0)}}}function U(){this._trace=void 0}function q(e,a,n){if(ne.warnings){var i,r=new u(e);if(a)n._attachExtraTrace(r);else if(ne.longStackTraces&&(i=t._peekContext()))i.attachExtraTrace(r);else{var o=Y(r);r.stack=o.message+"\n"+o.stack.join("\n")}O("warning",r)||W(r,"",!0)}}function J(e){for(var t=[],a=0;a<e.length;++a){var n=e[a],i=" (No stack trace)"===n||y.test(n),r=i&&Q(n);i&&!r&&(x&&" "!==n.charAt(0)&&(n=" "+n),t.push(n))}return t}function Y(e){var t=e.stack,a=e.toString();return t="string"==typeof t&&t.length>0?function(e){for(var t=e.stack.replace(/\s+$/g,"").split("\n"),a=0;a<t.length;++a){var n=t[a];if(" (No stack trace)"===n||y.test(n))break}return a>0&&"SyntaxError"!=e.name&&(t=t.slice(a)),t}(e):[" (No stack trace)"],{message:a,stack:"SyntaxError"==e.name?t:J(t)}}function W(e,t,a){if("undefined"!=typeof console){var n;if(h.isObject(e)){var i=e.stack;n=t+b(i,e)}else n=t+String(e);"function"==typeof d?d(n,a):"function"!=typeof console.log&&"object"!==_(console.log)||console.log(n)}}function K(e,t,a,n){var i=!1;try{"function"==typeof t&&(i=!0,"rejectionHandled"===e?t(n):t(a,n))}catch(e){c.throwLater(e)}"unhandledRejection"===e?O(e,a,n)||i||W(a,"Unhandled rejection "):O(e,n)}function G(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{t=e&&"function"==typeof e.toString?e.toString():h.toString(e);if(/\[object [a-zA-Z0-9$_]+\]/.test(t))try{t=JSON.stringify(e)}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+function(e){if(e.length<41)return e;return e.substr(0,38)+"..."}(t)+">, no stack trace)"}function X(){return"function"==typeof ae}var Q=function(){return!1},Z=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function ee(e){var t=e.match(Z);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function te(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);ae(this,te),t>32&&this.uncycle()}h.inherits(te,Error),n.CapturedTrace=te,te.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],a={},n=0,i=this;void 0!==i;++n)t.push(i),i=i._parent;for(n=(e=this._length=n)-1;n>=0;--n){var r=t[n].stack;void 0===a[r]&&(a[r]=n)}for(n=0;n<e;++n){var o=a[t[n].stack];if(void 0!==o&&o!==n){o>0&&(t[o-1]._parent=void 0,t[o-1]._length=1),t[n]._parent=void 0,t[n]._length=1;var s=n>0?t[n-1]:this;o<e-1?(s._parent=t[o+1],s._parent.uncycle(),s._length=s._parent._length+1):(s._parent=void 0,s._length=1);for(var _=s._length+1,d=n-2;d>=0;--d)t[d]._length=_,_++;return}}}},te.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=Y(e),a=t.message,n=[t.stack],i=this;void 0!==i;)n.push(J(i.stack.split("\n"))),i=i._parent;!function(e){for(var t=e[0],a=1;a<e.length;++a){for(var n=e[a],i=t.length-1,r=t[i],o=-1,s=n.length-1;s>=0;--s)if(n[s]===r){o=s;break}for(s=o;s>=0;--s){var _=n[s];if(t[i]!==_)break;t.pop(),i--}t=n}}(n),function(e){for(var t=0;t<e.length;++t)(0===e[t].length||t+1<e.length&&e[t][0]===e[t+1][0])&&(e.splice(t,1),t--)}(n),h.notEnumerableProp(e,"stack",function(e,t){for(var a=0;a<t.length-1;++a)t[a].push("From previous event:"),t[a]=t[a].join("\n");return a<t.length&&(t[a]=t[a].join("\n")),e+"\n"+t.join("\n")}(a,n)),h.notEnumerableProp(e,"__stackCleaned__",!0)}};var ae=function(){var e=/^\s*at\s*/,t=function(e,t){return"string"==typeof e?e:void 0!==t.name&&void 0!==t.message?t.toString():G(t)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,y=e,b=t;var a=Error.captureStackTrace;return Q=function(e){return v.test(e)},function(e,t){Error.stackTraceLimit+=6,a(e,t),Error.stackTraceLimit-=6}}var n,i=new Error;if("string"==typeof i.stack&&i.stack.split("\n")[0].indexOf("stackDetection@")>=0)return y=/@/,b=t,x=!0,function(e){e.stack=(new Error).stack};try{throw new Error}catch(e){n="stack"in e}return"stack"in i||!n||"number"!=typeof Error.stackTraceLimit?(b=function(e,t){return"string"==typeof e?e:"object"!==_(t)&&"function"!=typeof t||void 0===t.name||void 0===t.message?G(t):t.toString()},null):(y=e,b=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(d=function(e){console.warn(e)},h.isNode&&a.stderr.isTTY?d=function(e,t){var a=t?"":"";console.warn(a+e+"\n")}:h.isNode||"string"!=typeof(new Error).stack||(d=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}));var ne={warnings:w,longStackTraces:!1,cancellation:!1,monitoring:!1,asyncHooks:!1};return E&&t.longStackTraces(),{asyncHooks:function(){return ne.asyncHooks},longStackTraces:function(){return ne.longStackTraces},warnings:function(){return ne.warnings},cancellation:function(){return ne.cancellation},monitoring:function(){return ne.monitoring},propagateFromFunction:function(){return I},boundValueFunction:function(){return R},checkForgottenReturns:function(e,t,a,n,i){if(void 0===e&&null!==t&&S){if(void 0!==i&&i._returnedNonUndefined())return;if(0==(65535&n._bitField))return;a&&(a+=" ");var r="",o="";if(t._trace){for(var s=t._trace.stack.split("\n"),_=J(s),d=_.length-1;d>=0;--d){var l=_[d];if(!g.test(l)){var c=l.match(m);c&&(r="at "+c[1]+":"+c[2]+":"+c[3]+" ");break}}if(_.length>0){var u=_[0];for(d=0;d<s.length;++d)if(s[d]===u){d>0&&(o="\n"+s[d-1]);break}}}var h="a promise was created in a "+a+"handler "+r+"but was not returned from it, see http://goo.gl/rRqMUw"+o;n._warn(h,!0,t)}},setBounds:function(e,t){if(X()){for(var a,n,i=(e.stack||"").split("\n"),r=(t.stack||"").split("\n"),o=-1,s=-1,_=0;_<i.length;++_)if(d=ee(i[_])){a=d.fileName,o=d.line;break}for(_=0;_<r.length;++_){var d;if(d=ee(r[_])){n=d.fileName,s=d.line;break}}o<0||s<0||!a||!n||a!==n||o>=s||(Q=function(e){if(v.test(e))return!0;var t=ee(e);return!!(t&&t.fileName===a&&o<=t.line&&t.line<=s)})}},warn:q,deprecated:function(e,t){var a=e+" is deprecated and will be removed in a future version.";return t&&(a+=" Use "+t+" instead."),q(a)},CapturedTrace:te,fireDomEvent:C,fireGlobalEvent:T}}},{"./errors":9,"./es5":10,"./util":21}],8:[function(e,t,a){"use strict";t.exports=function(e){function t(){return this.value}function a(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(a){return a instanceof e&&a.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:a},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(a,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,a,void 0,{reason:e},void 0);var t=arguments[1];return this.caught(e,function(){throw t})},e.prototype.catchReturn=function(a){if(arguments.length<=1)return a instanceof e&&a.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:a},void 0);var n=arguments[1];n instanceof e&&n.suppressUnhandledRejections();return this.caught(a,function(){return n})}}},{}],9:[function(e,t,a){"use strict";var n,i,r=e("./es5"),o=r.freeze,s=e("./util"),_=s.inherits,d=s.notEnumerableProp;function l(e,t){function a(n){if(!(this instanceof a))return new a(n);d(this,"message","string"==typeof n?n:t),d(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return _(a,Error),a}var c=l("Warning","warning"),u=l("CancellationError","cancellation error"),h=l("TimeoutError","timeout error"),f=l("AggregateError","aggregate error");try{n=TypeError,i=RangeError}catch(e){n=l("TypeError","type error"),i=l("RangeError","range error")}for(var p="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),v=0;v<p.length;++v)"function"==typeof Array.prototype[p[v]]&&(f.prototype[p[v]]=Array.prototype[p[v]]);r.defineProperty(f.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),f.prototype.isOperational=!0;var g=0;function m(e){if(!(this instanceof m))return new m(e);d(this,"name","OperationalError"),d(this,"message",e),this.cause=e,this.isOperational=!0,e instanceof Error?(d(this,"message",e.message),d(this,"stack",e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}f.prototype.toString=function(){var e=Array(4*g+1).join(" "),t="\n"+e+"AggregateError of:\n";g++,e=Array(4*g+1).join(" ");for(var a=0;a<this.length;++a){for(var n=this[a]===this?"[Circular AggregateError]":this[a]+"",i=n.split("\n"),r=0;r<i.length;++r)i[r]=e+i[r];t+=(n=i.join("\n"))+"\n"}return g--,t},_(m,Error);var y=Error.__BluebirdErrorTypes__;y||(y=o({CancellationError:u,TimeoutError:h,OperationalError:m,RejectionError:m,AggregateError:f}),r.defineProperty(Error,"__BluebirdErrorTypes__",{value:y,writable:!1,enumerable:!1,configurable:!1})),t.exports={Error:Error,TypeError:n,RangeError:i,CancellationError:y.CancellationError,OperationalError:y.OperationalError,TimeoutError:y.TimeoutError,AggregateError:y.AggregateError,Warning:c}},{"./es5":10,"./util":21}],10:[function(e,t,a){var n=function(){"use strict";return void 0===this}();if(n)t.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:n,propertyIsWritable:function(e,t){var a=Object.getOwnPropertyDescriptor(e,t);return!(a&&!a.writable&&!a.set)}};else{var i={}.hasOwnProperty,r={}.toString,o={}.constructor.prototype,s=function(e){var t=[];for(var a in e)i.call(e,a)&&t.push(a);return t};t.exports={isArray:function(e){try{return"[object Array]"===r.call(e)}catch(e){return!1}},keys:s,names:s,defineProperty:function(e,t,a){return e[t]=a.value,e},getDescriptor:function(e,t){return{value:e[t]}},freeze:function(e){return e},getPrototypeOf:function(e){try{return Object(e).constructor.prototype}catch(e){return o}},isES5:n,propertyIsWritable:function(){return!0}}}},{}],11:[function(e,t,a){"use strict";t.exports=function(t,a,n){var i=e("./util"),r=t.CancellationError,o=i.errorObj,s=e("./catch_filter")(n);function _(e,t,a){this.promise=e,this.type=t,this.handler=a,this.called=!1,this.cancelPromise=null}function d(e){this.finallyHandler=e}function l(e,t){return null!=e.cancelPromise&&(arguments.length>1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function c(){return h.call(this,this.promise._target()._settledValue())}function u(e){if(!l(this,e))return o.e=e,o}function h(e){var i=this.promise,s=this.handler;if(!this.called){this.called=!0;var _=this.isFinallyHandler()?s.call(i._boundValue()):s.call(i._boundValue(),e);if(_===n)return _;if(void 0!==_){i._setReturnedNonUndefined();var h=a(_,i);if(h instanceof t){if(null!=this.cancelPromise){if(h._isCancelled()){var f=new r("late cancellation observer");return i._attachExtraTrace(f),o.e=f,o}h.isPending()&&h._attachCancellationCallback(new d(this))}return h._then(c,u,void 0,this,void 0)}}}return i.isRejected()?(l(this),o.e=e,o):(l(this),e)}return _.prototype.isFinallyHandler=function(){return 0===this.type},d.prototype._resultCancelled=function(){l(this.finallyHandler)},t.prototype._passThrough=function(e,t,a,n){return"function"!=typeof e?this.then():this._then(a,n,void 0,new _(this,t,e),void 0)},t.prototype.lastly=t.prototype.finally=function(e){return this._passThrough(e,0,h,h)},t.prototype.tap=function(e){return this._passThrough(e,1,h)},t.prototype.tapCatch=function(e){var a=arguments.length;if(1===a)return this._passThrough(e,1,void 0,h);var n,r=new Array(a-1),o=0;for(n=0;n<a-1;++n){var _=arguments[n];if(!i.isObject(_))return t.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+i.classString(_)));r[o++]=_}r.length=o;var d=arguments[n];return this._passThrough(s(r,d,this),1,void 0,h)},_}},{"./catch_filter":5,"./util":21}],12:[function(e,t,a){"use strict";t.exports=function(t,a,n,i,r){var o=e("./util");o.canEvaluate,o.tryCatch,o.errorObj;t.join=function(){var e,t=arguments.length-1;t>0&&"function"==typeof arguments[t]&&(e=arguments[t]);var n=[].slice.call(arguments);e&&n.pop();var i=new a(n).promise();return void 0!==e?i.spread(e):i}}},{"./util":21}],13:[function(e,t,a){"use strict";t.exports=function(t,a,n,i,r){var o=e("./util"),s=o.tryCatch;t.method=function(e){if("function"!=typeof e)throw new t.TypeError("expecting a function but got "+o.classString(e));return function(){var n=new t(a);n._captureStackTrace(),n._pushContext();var i=s(e).apply(this,arguments),o=n._popContext();return r.checkForgottenReturns(i,o,"Promise.method",n),n._resolveFromSyncValue(i),n}},t.attempt=t.try=function(e){if("function"!=typeof e)return i("expecting a function but got "+o.classString(e));var n,_=new t(a);if(_._captureStackTrace(),_._pushContext(),arguments.length>1){r.deprecated("calling Promise.try with more than 1 argument");var d=arguments[1],l=arguments[2];n=o.isArray(d)?s(e).apply(l,d):s(e).call(l,d)}else n=s(e)();var c=_._popContext();return r.checkForgottenReturns(n,c,"Promise.try",_),_._resolveFromSyncValue(n),_},t.prototype._resolveFromSyncValue=function(e){e===o.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},{"./util":21}],14:[function(e,t,a){"use strict";var n=e("./util"),i=n.maybeWrapAsError,r=e("./errors").OperationalError,o=e("./es5");var s=/^(?:name|message|stack|cause)$/;function _(e){var t;if(function(e){return e instanceof Error&&o.getPrototypeOf(e)===Error.prototype}(e)){(t=new r(e)).name=e.name,t.message=e.message,t.stack=e.stack;for(var a=o.keys(e),i=0;i<a.length;++i){var _=a[i];s.test(_)||(t[_]=e[_])}return t}return n.markAsOriginatingFromRejection(e),e}t.exports=function(e,t){return function(a,n){if(null!==e){if(a){var r=_(i(a));e._attachExtraTrace(r),e._reject(r)}else if(t){var o=[].slice.call(arguments,1);e._fulfill(o)}else e._fulfill(n);e=null}}}},{"./errors":9,"./es5":10,"./util":21}],15:[function(e,t,n){"use strict";t.exports=function(){var n=function(){return new m("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},i=function(){return new O.PromiseInspection(this._target())},r=function(e){return O.reject(new m(e))};function o(){}var s={},_=e("./util");_.setReflectHandler(i);var d=function(){var e=a.domain;return void 0===e?null:e},l=function(){return{domain:d(),async:null}},c=_.isNode&&_.nodeSupportsAsyncResource?e("async_hooks").AsyncResource:null,u=function(){return{domain:d(),async:new c("Bluebird::Promise")}},h=_.isNode?l:function(){return null};_.notEnumerableProp(O,"_getContext",h);var f=e("./es5"),p=e("./async"),v=new p;f.defineProperty(O,"_async",{value:v});var g=e("./errors"),m=O.TypeError=g.TypeError;O.RangeError=g.RangeError;var y=O.CancellationError=g.CancellationError;O.TimeoutError=g.TimeoutError,O.OperationalError=g.OperationalError,O.RejectionError=g.OperationalError,O.AggregateError=g.AggregateError;var b=function(){},x={},k={},w=e("./thenables")(O,b),E=e("./promise_array")(O,b,w,r,o),S=e("./context")(O),D=(S.create,e("./debuggability")(O,S,function(){h=u,_.notEnumerableProp(O,"_getContext",u)},function(){h=l,_.notEnumerableProp(O,"_getContext",l)})),N=(D.CapturedTrace,e("./finally")(O,w,k)),C=e("./catch_filter")(k),T=e("./nodeback"),A=_.errorObj,M=_.tryCatch;function O(e){e!==b&&function(e,t){if(null==e||e.constructor!==O)throw new m("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n");if("function"!=typeof t)throw new m("expecting a function but got "+_.classString(t))}(this,e),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(e),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function H(e){this.promise._resolveCallback(e)}function j(e){this.promise._rejectCallback(e,!1)}function L(e){var t=new O(b);t._fulfillmentHandler0=e,t._rejectionHandler0=e,t._promise0=e,t._receiver0=e}return O.prototype.toString=function(){return"[object Promise]"},O.prototype.caught=O.prototype.catch=function(e){var t=arguments.length;if(t>1){var a,n=new Array(t-1),i=0;for(a=0;a<t-1;++a){var o=arguments[a];if(!_.isObject(o))return r("Catch statement predicate: expecting an object but got "+_.classString(o));n[i++]=o}if(n.length=i,"function"!=typeof(e=arguments[a]))throw new m("The last argument to .catch() must be a function, got "+_.toString(e));return this.then(void 0,C(n,e,this))}return this.then(void 0,e)},O.prototype.reflect=function(){return this._then(i,i,void 0,this,void 0)},O.prototype.then=function(e,t){if(D.warnings()&&arguments.length>0&&"function"!=typeof e&&"function"!=typeof t){var a=".then() only accepts functions but was passed: "+_.classString(e);arguments.length>1&&(a+=", "+_.classString(t)),this._warn(a)}return this._then(e,t,void 0,void 0,void 0)},O.prototype.done=function(e,t){this._then(e,t,void 0,void 0,void 0)._setIsFinal()},O.prototype.spread=function(e){return"function"!=typeof e?r("expecting a function but got "+_.classString(e)):this.all()._then(e,void 0,void 0,x,void 0)},O.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},O.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new E(this).promise()},O.prototype.error=function(e){return this.caught(_.originatesFromRejection,e)},O.getNewLibraryCopy=t.exports,O.is=function(e){return e instanceof O},O.fromNode=O.fromCallback=function(e){var t=new O(b);t._captureStackTrace();var a=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=M(e)(T(t,a));return n===A&&t._rejectCallback(n.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},O.all=function(e){return new E(e).promise()},O.cast=function(e){var t=w(e);return t instanceof O||((t=new O(b))._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},O.resolve=O.fulfilled=O.cast,O.reject=O.rejected=function(e){var t=new O(b);return t._captureStackTrace(),t._rejectCallback(e,!0),t},O.setScheduler=function(e){if("function"!=typeof e)throw new m("expecting a function but got "+_.classString(e));return v.setScheduler(e)},O.prototype._then=function(e,t,a,n,i){var r=void 0!==i,o=r?i:new O(b),s=this._target(),d=s._bitField;r||(o._propagateFrom(this,3),o._captureStackTrace(),void 0===n&&0!=(2097152&this._bitField)&&(n=0!=(50397184&d)?this._boundValue():s===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,o));var l=h();if(0!=(50397184&d)){var c,u,f=s._settlePromiseCtx;0!=(33554432&d)?(u=s._rejectionHandler0,c=e):0!=(16777216&d)?(u=s._fulfillmentHandler0,c=t,s._unsetRejectionIsUnhandled()):(f=s._settlePromiseLateCancellationObserver,u=new y("late cancellation observer"),s._attachExtraTrace(u),c=t),v.invoke(f,s,{handler:_.contextBind(l,c),promise:o,receiver:n,value:u})}else s._addCallbacks(e,t,o,n,l);return o},O.prototype._length=function(){return 65535&this._bitField},O.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},O.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},O.prototype._setLength=function(e){this._bitField=-65536&this._bitField|65535&e},O.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},O.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},O.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},O.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},O.prototype._isFinal=function(){return(4194304&this._bitField)>0},O.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},O.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},O.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},O.prototype._setAsyncGuaranteed=function(){if(!v.hasCustomScheduler()){var e=this._bitField;this._bitField=e|(536870912&e)>>2^134217728}},O.prototype._setNoAsyncGuarantee=function(){this._bitField=-134217729&(536870912|this._bitField)},O.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==s)return void 0===t&&this._isBound()?this._boundValue():t},O.prototype._promiseAt=function(e){return this[4*e-4+2]},O.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},O.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},O.prototype._boundValue=function(){},O.prototype._migrateCallback0=function(e){e._bitField;var t=e._fulfillmentHandler0,a=e._rejectionHandler0,n=e._promise0,i=e._receiverAt(0);void 0===i&&(i=s),this._addCallbacks(t,a,n,i,null)},O.prototype._migrateCallbackAt=function(e,t){var a=e._fulfillmentHandlerAt(t),n=e._rejectionHandlerAt(t),i=e._promiseAt(t),r=e._receiverAt(t);void 0===r&&(r=s),this._addCallbacks(a,n,i,r,null)},O.prototype._addCallbacks=function(e,t,a,n,i){var r=this._length();if(r>=65531&&(r=0,this._setLength(0)),0===r)this._promise0=a,this._receiver0=n,"function"==typeof e&&(this._fulfillmentHandler0=_.contextBind(i,e)),"function"==typeof t&&(this._rejectionHandler0=_.contextBind(i,t));else{var o=4*r-4;this[o+2]=a,this[o+3]=n,"function"==typeof e&&(this[o+0]=_.contextBind(i,e)),"function"==typeof t&&(this[o+1]=_.contextBind(i,t))}return this._setLength(r+1),r},O.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},O.prototype._resolveCallback=function(e,t){if(0==(117506048&this._bitField)){if(e===this)return this._rejectCallback(n(),!1);var a=w(e,this);if(!(a instanceof O))return this._fulfill(e);t&&this._propagateFrom(a,2);var i=a._target();if(i!==this){var r=i._bitField;if(0==(50397184&r)){var o=this._length();o>0&&i._migrateCallback0(this);for(var s=1;s<o;++s)i._migrateCallbackAt(this,s);this._setFollowing(),this._setLength(0),this._setFollowee(a)}else if(0!=(33554432&r))this._fulfill(i._value());else if(0!=(16777216&r))this._reject(i._reason());else{var _=new y("late cancellation observer");i._attachExtraTrace(_),this._reject(_)}}else this._reject(n())}},O.prototype._rejectCallback=function(e,t,a){var n=_.ensureErrorObject(e),i=n===e;if(!i&&!a&&D.warnings()){var r="a promise was rejected with a non-error: "+_.classString(e);this._warn(r,!0)}this._attachExtraTrace(n,!!t&&i),this._reject(e)},O.prototype._resolveFromExecutor=function(e){if(e!==b){var t=this;this._captureStackTrace(),this._pushContext();var a=!0,n=this._execute(e,function(e){t._resolveCallback(e)},function(e){t._rejectCallback(e,a)});a=!1,this._popContext(),void 0!==n&&t._rejectCallback(n,!0)}},O.prototype._settlePromiseFromHandler=function(e,t,a,n){var i=n._bitField;if(0==(65536&i)){var r;n._pushContext(),t===x?a&&"number"==typeof a.length?r=M(e).apply(this._boundValue(),a):(r=A).e=new m("cannot .spread() a non-array: "+_.classString(a)):r=M(e).call(t,a);var o=n._popContext();0==(65536&(i=n._bitField))&&(r===k?n._reject(a):r===A?n._rejectCallback(r.e,!1):(D.checkForgottenReturns(r,o,"",n,this),n._resolveCallback(r)))}},O.prototype._target=function(){for(var e=this;e._isFollowing();)e=e._followee();return e},O.prototype._followee=function(){return this._rejectionHandler0},O.prototype._setFollowee=function(e){this._rejectionHandler0=e},O.prototype._settlePromise=function(e,t,a,n){var r=e instanceof O,s=this._bitField,_=0!=(134217728&s);0!=(65536&s)?(r&&e._invokeInternalOnCancel(),a instanceof N&&a.isFinallyHandler()?(a.cancelPromise=e,M(t).call(a,n)===A&&e._reject(A.e)):t===i?e._fulfill(i.call(a)):a instanceof o?a._promiseCancelled(e):r||e instanceof E?e._cancel():a.cancel()):"function"==typeof t?r?(_&&e._setAsyncGuaranteed(),this._settlePromiseFromHandler(t,a,n,e)):t.call(a,n,e):a instanceof o?a._isResolved()||(0!=(33554432&s)?a._promiseFulfilled(n,e):a._promiseRejected(n,e)):r&&(_&&e._setAsyncGuaranteed(),0!=(33554432&s)?e._fulfill(n):e._reject(n))},O.prototype._settlePromiseLateCancellationObserver=function(e){var t=e.handler,a=e.promise,n=e.receiver,i=e.value;"function"==typeof t?a instanceof O?this._settlePromiseFromHandler(t,n,i,a):t.call(n,i,a):a instanceof O&&a._reject(i)},O.prototype._settlePromiseCtx=function(e){this._settlePromise(e.promise,e.handler,e.receiver,e.value)},O.prototype._settlePromise0=function(e,t,a){var n=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(n,e,i,t)},O.prototype._clearCallbackDataAtIndex=function(e){var t=4*e-4;this[t+2]=this[t+3]=this[t+0]=this[t+1]=void 0},O.prototype._fulfill=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(e===this){var a=n();return this._attachExtraTrace(a),this._reject(a)}this._setFulfilled(),this._rejectionHandler0=e,(65535&t)>0&&(0!=(134217728&t)?this._settlePromises():v.settlePromises(this),this._dereferenceTrace())}},O.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return v.fatalError(e,_.isNode);(65535&t)>0?v.settlePromises(this):this._ensurePossibleRejectionHandled()}},O.prototype._fulfillPromises=function(e,t){for(var a=1;a<e;a++){var n=this._fulfillmentHandlerAt(a),i=this._promiseAt(a),r=this._receiverAt(a);this._clearCallbackDataAtIndex(a),this._settlePromise(i,n,r,t)}},O.prototype._rejectPromises=function(e,t){for(var a=1;a<e;a++){var n=this._rejectionHandlerAt(a),i=this._promiseAt(a),r=this._receiverAt(a);this._clearCallbackDataAtIndex(a),this._settlePromise(i,n,r,t)}},O.prototype._settlePromises=function(){var e=this._bitField,t=65535&e;if(t>0){if(0!=(16842752&e)){var a=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,a,e),this._rejectPromises(t,a)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,e),this._fulfillPromises(t,n)}this._setLength(0)}this._clearCancellationData()},O.prototype._settledValue=function(){var e=this._bitField;return 0!=(33554432&e)?this._rejectionHandler0:0!=(16777216&e)?this._fulfillmentHandler0:void 0},"undefined"!=typeof Symbol&&Symbol.toStringTag&&f.defineProperty(O.prototype,Symbol.toStringTag,{get:function(){return"Object"}}),O.defer=O.pending=function(){return D.deprecated("Promise.defer","new Promise"),{promise:new O(b),resolve:H,reject:j}},_.notEnumerableProp(O,"_makeSelfResolutionError",n),e("./method")(O,b,w,r,D),e("./bind")(O,b,w,D),e("./cancel")(O,E,r,D),e("./direct_resolve")(O),e("./synchronous_inspection")(O),e("./join")(O,E,w,b,v),O.Promise=O,O.version="3.7.2",_.toFastProperties(O),_.toFastProperties(O.prototype),L({a:1}),L({b:2}),L({c:3}),L(1),L(function(){}),L(void 0),L(!1),L(new O(b)),D.setBounds(p.firstLineError,_.lastLineError),O}},{"./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,async_hooks:void 0}],16:[function(e,t,a){"use strict";t.exports=function(t,a,n,i,r){var o=e("./util");o.isArray;function s(e){var n=this._promise=new t(a);e instanceof t&&(n._propagateFrom(e,3),e.suppressUnhandledRejections()),n._setOnCancel(this),this._values=e,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return o.inherits(s,r),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function e(a,r){var s=n(this._values,this._promise);if(s instanceof t){var _=(s=s._target())._bitField;if(this._values=s,0==(50397184&_))return this._promise._setAsyncGuaranteed(),s._then(e,this._reject,void 0,this,r);if(0==(33554432&_))return 0!=(16777216&_)?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=o.asArray(s)))0!==s.length?this._iterate(s):-5===r?this._resolveEmptyArray():this._resolve(function(e){switch(e){case-2:return[];case-3:return{};case-6:return new Map}}(r));else{var d=i("expecting an array or an iterable object but got "+o.classString(s)).reason();this._promise._rejectCallback(d,!1)}},s.prototype._iterate=function(e){var a=this.getActualLength(e.length);this._length=a,this._values=this.shouldCopyValues()?new Array(a):this._values;for(var i=this._promise,r=!1,o=null,s=0;s<a;++s){var _=n(e[s],i);o=_ instanceof t?(_=_._target())._bitField:null,r?null!==o&&_.suppressUnhandledRejections():null!==o?0==(50397184&o)?(_._proxy(this,s),this._values[s]=_):r=0!=(33554432&o)?this._promiseFulfilled(_._value(),s):0!=(16777216&o)?this._promiseRejected(_._reason(),s):this._promiseCancelled(s):r=this._promiseFulfilled(_,s)}r||i._setAsyncGuaranteed()},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(e){this._values=n