seventh
Advanced tools
Comparing version 0.7.32 to 0.7.33
@@ -1,1 +0,1 @@ | ||
(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.Promise7th=e()}})(function(){var e,t,n;return function(){function e(t,n,r){function i(l,s){if(!n[l]){if(!t[l]){var a="function"==typeof require&&require;if(!s&&a)return a(l,!0);if(o)return o(l,!0);var u=new Error("Cannot find module '"+l+"'");throw u.code="MODULE_NOT_FOUND",u}var f=n[l]={exports:{}};t[l][0].call(f.exports,function(e){var n=t[l][1][e];return i(n||e)},f,f.exports,e,t,n,r)}return n[l].exports}for(var o="function"==typeof require&&require,l=0;l<r.length;l++)i(r[l]);return i}return e}()({1:[function(e,t,n){"use strict";var r=e("./seventh.js");r.promisifyNodeApi=((e,t,n,i,o)=>{var l;t=t||"Async";n=n||"AsyncAll";i=i||(e=>e[0]!=="_"&&!e.endsWith("Sync"));if(o){l=[];for(let t in e){if(typeof e[t]==="function"){l.push(t)}}}else{l=Object.keys(e)}l.filter(t=>{if(typeof e[t]!=="function"){return false}for(let n in e[t].prototype){return false}return i(t,e)}).forEach(i=>{const o=i+t;const l=i+n;if(!e[o]){e[o]=r.promisify(e[i],e)}if(!e[l]){e[l]=r.promisifyAll(e[i],e)}})});r.promisifyAnyNodeApi=((e,t,n,i)=>{r.promisifyNodeApi(e,t,n,i,true)})},{"./seventh.js":7}],2:[function(e,t,n){"use strict";var r=e("./seventh.js");const i={};function o(){}r.all=(e=>{var t=-1,n=false,i=0,o=Infinity,l,s=[],a=new r;for(l of e){if(n){break}t++;(()=>{const e=t;r.resolve(l).then(t=>{if(n){return}s[e]=t;i++;if(i>=o){n=true;a._resolveValue(s)}},e=>{if(n){return}n=true;a.reject(e)})})()}o=t+1;if(!o){a._resolveValue(s)}return a});r._allArray=(e=>{var t=e.length;if(!t){r._resolveValue([])}var n,i={settled:false,count:0,length:t,values:[],allPromise:new r};for(n=0;!i.settled&&n<t;n++){r._allArrayOne(e[n],n,i)}return i.allPromise});r._allArrayOne=((e,t,n)=>{r._bareThen(e,e=>{if(n.settled){return}n.values[t]=e;n.count++;if(n.count>=n.length){n.settled=true;n.allPromise._resolveValue(n.values)}},e=>{if(n.settled){return}n.settled=true;n.allPromise.reject(e)})});r.every=r.map=((e,t)=>{var n=-1,i=false,o=0,l=Infinity,s,a=[],u=new r;for(s of e){if(i){break}n++;(()=>{const e=n;r.resolve(s).then(n=>{if(i){return}return t(n,e)}).then(t=>{if(i){return}a[e]=t;o++;if(o>=l){i=true;u._resolveValue(a)}},e=>{if(i){return}i=true;u.reject(e)})})()}l=n+1;if(!l){u._resolveValue(a)}return u});r.any=(e=>{var t=-1,n=false,i=0,o=Infinity,l,s=[],a=new r;for(l of e){if(n){break}t++;(()=>{const e=t;r.resolve(l).then(e=>{if(n){return}n=true;a._resolveValue(e)},t=>{if(n){return}s[e]=t;i++;if(i>=o){n=true;a.reject(s)}})})()}o=t+1;if(!o){a.reject(new RangeError("Promise.any(): empty array"))}return a});r.some=((e,t)=>{var n=-1,i=false,o=0,l=Infinity,s,a=[],u=new r;for(s of e){if(i){break}n++;(()=>{const e=n;r.resolve(s).then(n=>{if(i){return}return t(n,e)}).then(e=>{if(i){return}i=true;u._resolveValue(e)},t=>{if(i){return}a[e]=t;o++;if(o>=l){i=true;u.reject(a)}})})()}l=n+1;if(!l){u.reject(new RangeError("Promise.any(): empty array"))}return u});r.filter=((e,t)=>{var n=-1,o=false,l=0,s=Infinity,a,u=[],f=new r;for(a of e){if(o){break}n++;(()=>{const e=n;r.resolve(a).then(n=>{if(o){return}u[e]=n;return t(n,e)}).then(t=>{if(o){return}l++;if(!t){u[e]=i}if(l>=s){o=true;u=u.filter(e=>e!==i);f._resolveValue(u)}},e=>{if(o){return}o=true;f.reject(e)})})()}s=n+1;if(!s){f._resolveValue(u)}else if(l>=s){o=true;u=u.filter(e=>e!==i);f._resolveValue(u)}return f});r.foreach=r.forEach=function(e,t,n){var i=-1,l=arguments.length>=3,s=e[Symbol.iterator](),a=new r,u=r.resolve(n);if(r.warnUnhandledRejection){r._handleAll(e)}var f=()=>{u.then(e=>{let{value:n,done:o}=s.next();i++;if(o){a.resolve(e)}else{u=r.resolve(n).then(l?n=>t(e,n,i):e=>t(e,i));f()}},e=>{a.reject(e);for(;;){let{value:e,done:t}=s.next();if(t){break}if(r.isThenable(e)){e.then(o,o)}}})};f();return a};r.reduce=((e,t,n)=>{return r.forEach(e,t,n)});r.mapObject=((e,t)=>{var n=false,i=0,o,l,s=Object.keys(e),a=s.length,u,f={},c=new r;for(o=0;!n&&o<a;o++){l=s[o];u=e[l];(()=>{const e=l;r.resolve(u).then(r=>{if(n){return}return t(r,e)}).then(t=>{if(n){return}f[e]=t;i++;if(i>=a){n=true;c._resolveValue(f)}},e=>{if(n){return}n=true;c.reject(e)})})()}if(!a){c._resolveValue(f)}return c});r.concurrent=((e,t,n)=>{var i=-1,o=false,l=0,s=0,a=Infinity,u,f=false,c=[],h=t[Symbol.iterator](),d=new r;if(r.warnUnhandledRejection){r._handleAll(t)}e=e||1;const v=()=>{while(!f&&l<e){({value:u,done:f}=h.next());if(f){a=i+1;if(s>=a){o=true;d._resolveValue(c);return}break}if(o){break}i++;(()=>{const t=i;l++;r.resolve(u).then(e=>{if(o){return}return n(e,t)}).then(n=>{if(o){return}c[t]=n;s++;l--;if(s>=a){o=true;d._resolveValue(c);return}if(l<e){v();return}},e=>{if(o){return}o=true;d.reject(e)})})()}};v();if(i<0){d._resolveValue(c)}return d});r.race=(e=>{var t=false,n,i=new r;for(n of e){if(t){break}r.resolve(n).then(e=>{if(t){return}t=true;i._resolveValue(e)},e=>{if(t){return}t=true;i.reject(e)})}return i})},{"./seventh.js":7}],3:[function(e,t,n){(function(n,r,i){"use strict";const o=r.Promise;var l;if(!n.browser){l=n.nextTick}else{e("setimmediate");l=i}function s(e){this.fn=e;this._then=s._dormantThen;this.value=null;this.thenHandlers=null;this.handledRejection=null;if(this.fn){this._exec()}}t.exports=s;s.Native=o;s.warnUnhandledRejection=true;s.prototype._exec=function(){this._then=s._pendingThen;try{this.fn(e=>{this.resolve(e)},e=>{this.reject(e)})}catch(e){this.reject(e)}};s.prototype.resolve=s.prototype.fulfill=function(e){if(this._then.settled){return this}if(s.isThenable(e)){this._execThenPromise(e);return this}return this._resolveValue(e)};s.prototype._resolveValue=function(e){this._then=s._fulfilledThen;this.value=e;if(this.thenHandlers&&this.thenHandlers.length){this._execFulfillHandlers()}return this};s.prototype._execThenPromise=function(e){try{e.then(e=>{this.resolve(e)},e=>{this.reject(e)})}catch(e){this.reject(e)}};s.prototype.reject=function(e){if(this._then.settled){return this}this._then=s._rejectedThen;this.value=e;if(this.thenHandlers&&this.thenHandlers.length){this._execRejectionHandlers()}else if(s.warnUnhandledRejection&&!this.handledRejection){this._unhandledRejection()}return this};s.prototype._execFulfillHandlers=function(){var e,t=this.thenHandlers.length;for(e=0;e<t;e+=3){if(this.thenHandlers[e+1]){this._execOneFulfillHandler(this.thenHandlers[e],this.thenHandlers[e+1])}else{this.thenHandlers[e].resolve(this.value)}}};s.prototype._execOneFulfillHandler=function(e,t){try{e.resolve(t(this.value))}catch(t){e.reject(t)}};s.prototype._execRejectionHandlers=function(){var e,t=this.thenHandlers.length;for(e=0;e<t;e+=3){if(this.thenHandlers[e+2]){this._execOneRejectHandler(this.thenHandlers[e],this.thenHandlers[e+2])}else{this.thenHandlers[e].reject(this.value)}}};s.prototype._execOneRejectHandler=function(e,t){try{e.resolve(t(this.value))}catch(t){e.reject(t)}};s.prototype.resolveTimeout=s.prototype.fulfillTimeout=function(e,t){setTimeout(()=>this.resolve(t),e)};s.prototype.rejectTimeout=function(e,t){setTimeout(()=>this.reject(t),e)};s._dormantThen=function(e,t){if(this.fn){this._exec();return this._then(e,t)}var n=new s;if(!this.thenHandlers){this.thenHandlers=[n,e,t]}else{this.thenHandlers[this.thenHandlers.length]=n;this.thenHandlers[this.thenHandlers.length]=e;this.thenHandlers[this.thenHandlers.length]=t}return n};s._dormantThen.settled=false;s._pendingThen=function(e,t){var n=new s;if(!this.thenHandlers){this.thenHandlers=[n,e,t]}else{this.thenHandlers[this.thenHandlers.length]=n;this.thenHandlers[this.thenHandlers.length]=e;this.thenHandlers[this.thenHandlers.length]=t}return n};s._pendingThen.settled=false;s._fulfilledThen=function(e){if(!e){return this}var t=new s;l(()=>{try{t.resolve(e(this.value))}catch(e){t.reject(e)}});return t};s._fulfilledThen.settled=true;s._rejectedThen=function(e,t){if(!t){return this}this.handledRejection=true;var n=new s;l(()=>{try{n.resolve(t(this.value))}catch(e){n.reject(e)}});return n};s._rejectedThen.settled=true;s.prototype.then=function(e,t){return this._then(e,t)};s.prototype.catch=function(e=(()=>undefined)){return this._then(undefined,e)};s.prototype.finally=function(e){return this._then(e,e)};s.prototype.tap=s.prototype.tapThen=function(e){this._then(e,undefined);return this};s.prototype.tapCatch=function(e){this._then(undefined,e);return this};s.prototype.tapFinally=function(e){this._then(e,e);return this};s.prototype.fatal=function(){this._then(undefined,e=>{l(()=>{throw e})})};s.prototype.done=function(e,t){this._then(e,t).fatal();return this};s.prototype.callback=function(e){this._then(t=>{e(undefined,t)},t=>{e(t)}).fatal();return this};s.prototype.callbackAll=function(e){this._then(t=>{if(Array.isArray(t)){e(undefined,...t)}else{e(undefined,t)}},t=>{e(t)}).fatal();return this};s.callback=function(e){return new s((t,n)=>{e((e,r)=>{if(e){n(e)}else{t(r)}})})};s.callbackAll=function(e){return new s((t,n)=>{e((e,...r)=>{if(e){n(e)}else{t(r)}})})};s.prototype.toPromise=s.prototype.propagate=function(e){this._then(t=>{e.resolve(t)},t=>{e.reject(t)});return this};s.propagate=function(e,t){e.then(e=>{t.resolve(e)},e=>{t.reject(e)});return e};s.finally=function(e,t){return e.then(t,t)};s.resolve=s.fulfill=function(e){if(s.isThenable(e)){return s.fromThenable(e)}return s._resolveValue(e)};s._resolveValue=function(e){var t=new s;t._then=s._fulfilledThen;t.value=e;return t};s.reject=function(e){var t=new s;t._then=s._rejectedThen;t.value=e;return t};s.resolveTimeout=s.fulfillTimeout=function(e,t){return new s(n=>setTimeout(()=>n(t),e))};s.rejectTimeout=function(e,t){return new s((n,r)=>setTimeout(()=>r(t),e))};s.resolveNextTick=s.fulfillNextTick=function(e){return new s(t=>l(()=>t(e)))};s.rejectNextTick=function(e){return new s((t,n)=>l(()=>n(e)))};s.dormant=function(e){var t=new s;t.fn=e;return t};s.try=function(e){try{return s.resolve(e())}catch(e){return s.reject(e)}};s.isThenable=function(e){return e&&typeof e==="object"&&typeof e.then==="function"};s.fromThenable=function(e){if(e instanceof s){return e}return new s((t,n)=>{e.then(e=>{t(e)},e=>{n(e)})})};s._bareThen=function(e,t,n){if(e&&typeof e==="object"){if(e instanceof s){if(e._then===s._fulfilledThen){t(e.value)}else if(e._then===s._rejectedThen){n(e.value)}else{e._then(t,n)}}else if(typeof e.then==="function"){e.then(t,n)}else{t(e)}}else{t(e)}};s._handleAll=function(e){var t;for(t of e){if(s.isThenable(t)){t.handledRejection=true}}};s.prototype._unhandledRejection=function(){this.handledRejection=false;const e=e=>setTimeout(e,0);if(this.value instanceof Error){e(()=>{if(this.handledRejection===false){this.value.message="Unhandled promise rejection: "+this.value.message;console.error(this.value)}})}else{let t=new Error("Unhandled promise rejection");e(()=>{if(this.handledRejection===false){console.error(t);console.error("Rejection reason:",this.value)}})}};s.prototype.getStatus=function(){switch(this._then){case s._dormantThen:return"dormant";case s._pendingThen:return"pending";case s._fulfilledThen:return"fulfilled";case s._rejectedThen:return"rejected"}};s.prototype.inspect=function(){switch(this._then){case s._dormantThen:return"Promise { <DORMANT> }";case s._pendingThen:return"Promise { <PENDING> }";case s._fulfilledThen:return"Promise { <FULFILLED> "+this.value+" }";case s._rejectedThen:return"Promise { <REJECTED> "+this.value+" }"}};s.resolved=s.dummy=s.resolve();if(n.browser){s.prototype.resolveAtAnimationFrame=function(e){window.requestAnimationFrame(()=>this.resolve(e))};s.prototype.rejectAtAnimationFrame=function(e){window.requestAnimationFrame(()=>this.reject(e))};s.resolveAtAnimationFrame=function(e){return new s(t=>window.requestAnimationFrame(()=>t(e)))};s.rejectAtAnimationFrame=function(e){return new s((t,n)=>window.requestAnimationFrame(()=>n(e)))}}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("timers").setImmediate)},{_process:10,setimmediate:9,timers:11}],4:[function(e,t,n){"use strict";var r=e("./seventh.js");r.promisifyAll=((e,t)=>{if(t){return(...n)=>{return new r((r,i)=>{e.call(t,...n,(e,...t)=>{if(e){if(t.length&&e instanceof Error){e.args=t}i(e)}else{r(t)}})})}}return function(...t){return new r((n,r)=>{e.call(this,...t,(e,...t)=>{if(e){if(t.length&&e instanceof Error){e.args=t}r(e)}else{n(t)}})})}});r.promisify=((e,t)=>{if(t){return(...n)=>{return new r((r,i)=>{e.call(t,...n,(e,t)=>{if(e){if(t!==undefined&&e instanceof Error){e.arg=t}i(e)}else{r(t)}})})}}return function(...t){return new r((n,r)=>{e.call(this,...t,(e,t)=>{if(e){if(t!==undefined&&e instanceof Error){e.arg=t}r(e)}else{n(t)}})})}});r.returnValueInterceptor=((e,t,n)=>{return function(...r){var i=t.call(n||this,...r);e(i);return i}});r.once=((e,t)=>{var n=false;var r;return function(...i){if(!n){n=true;r=e.call(t||this,...i)}return r}});r.serialize=((e,t)=>{var n=new r.resolve;return function(...i){var o=new r;n.finally(()=>{r.propagate(e.call(t||this,...i),o)});n=o;return o}});r.debounce=((e,t)=>{var n=null;const i=()=>{n=null};return function(...o){if(n){return n}n=e.call(t||this,...o);r.finally(n,i);return n}});r.debounceDelay=((e,t,n)=>{var i=null;const o=()=>{setTimeout(()=>i=null,e)};return function(...e){if(i){return i}i=t.call(n||this,...e);r.finally(i,o);return i}});r.debounceUpdate=((e,t)=>{var n=null;var i=null;var o=null;const l=()=>{var t,s;n=null;if(i){t=i;i=null;s=o;o=null;n=e.call(...t);r.propagate(n,s);r.finally(n,l);return n}};return function(...s){var a=t||this;if(n){if(!o){o=new r}i=[a,...s];return o}n=e.call(a,...s);r.finally(n,l);return n}});r.NO_DELAY={};r.debounceSync=((e,t)=>{var n=new Map;const i=e=>{var t=n.get(e);if(!t){t={inProgress:null,inProgressIsFull:null,last:null,lastTime:null,lastFullSync:null,lastFullSyncTime:null,nextFullSyncPromise:null,nextFullSyncWith:null};n.set(e,t)}return t};const o=(e,n)=>{var i,l,s,a=new Date;e.inProgress=null;if(n>=2){e.lastFullSyncTime=e.lastTime=a}else if(n>=1){e.lastTime=a}if(e.nextFullSyncWith){if(t.delay&&e.lastFullSyncTime&&(i=a-e.lastFullSyncTime-t.delay)<0){e.inProgress=r.resolveTimeout(-i+1);e.inProgress.finally(()=>o(e,0));return e.nextFullSyncPromise}l=e.nextFullSyncWith;e.nextFullSyncWith=null;s=e.nextFullSyncPromise;e.nextFullSyncPromise=null;e.lastFullSync=e.last=e.inProgress=t.fn.call(...l);r.propagate(e.inProgress,s);r.finally(e.inProgress,()=>o(e,2));return e.inProgress}};const l=function(t,...n){var l=false,s=e.thisBinding||this,a=i(t);if(n[n.length-1]===r.NO_DELAY){l=true;n.length--}if(a.inProgress){return a.inProgress}if(!l&&e.delay&&a.lastTime&&new Date-a.lastTime<e.delay){return a.last}a.last=a.inProgress=e.fn.call(s,t,...n);a.inProgressIsFull=false;r.finally(a.inProgress,()=>o(a,1));return a.inProgress};const s=function(e,...n){var l,s=false,a=t.thisBinding||this,u=i(e);if(n[n.length-1]===r.NO_DELAY){s=true;n.length--}if(!u.inProgress&&!s&&t.delay&&u.lastFullSyncTime&&(l=new Date-u.lastFullSyncTime-t.delay)<0){u.inProgress=r.resolveTimeout(-l+1);r.finally(u.inProgress,()=>o(u,0))}if(u.inProgress){if(!u.nextFullSyncPromise){u.nextFullSyncPromise=new r}u.nextFullSyncWith=[a,e,...n];return u.nextFullSyncPromise}u.lastFullSync=u.last=u.inProgress=t.fn.call(a,e,...n);r.finally(u.inProgress,()=>o(u,2));return u.inProgress};return[l,s]});r.timeout=((e,t,n)=>{return function(...r){var i=t.call(n||this,...r);setTimeout(()=>i.reject(new Error("Timeout")),e);return i}});r.variableTimeout=((e,t)=>{return function(n,...r){var i=e.call(t||this,...r);setTimeout(()=>i.reject(new Error("Timeout")),n);return i}})},{"./seventh.js":7}],5:[function(e,t,n){(function(t){"use strict";var n=e("./seventh.js");var r=false;n.asyncExit=function(e,i){if(r){return}r=true;var o=t.listeners("asyncExit");if(!o.length){t.exit(e);return}if(i===undefined){i=1e3}const l=t=>{if(t.length<3){t(e,i);return n.dummy}return new n(n=>{t(e,i,()=>{n()})})};n.map(o,l).finally(()=>t.exit(e));setTimeout(()=>t.exit(e),i)};n.resolveSafeTimeout=function(e,t){return new n(n=>{setTimeout(()=>{setTimeout(()=>{setTimeout(()=>{setTimeout(()=>n(t),0)},e/2)},e/2)},0)})}}).call(this,e("_process"))},{"./seventh.js":7,_process:10}],6:[function(e,t,n){"use strict";var r=e("./seventh.js");r.parasite=(()=>{var e=["tap","tapCatch","finally","fatal","done","callback","callbackAll"];e.forEach(e=>r.Native.prototype[e]=r.prototype[e]);r.Native.prototype._then=r.Native.prototype.then})},{"./seventh.js":7}],7:[function(e,t,n){"use strict";const r=e("./core.js");t.exports=r;e("./batch.js");e("./wrapper.js");e("./decorators.js");e("./api.js");e("./parasite.js");e("./misc.js")},{"./api.js":1,"./batch.js":2,"./core.js":3,"./decorators.js":4,"./misc.js":5,"./parasite.js":6,"./wrapper.js":8}],8:[function(e,t,n){"use strict";var r=e("./seventh.js");r.timeLimit=((e,t)=>{return new r((n,i)=>{if(typeof t==="function"){t=t()}r.resolve(t).then(n,i);setTimeout(()=>i(new Error("Timeout")),e)})});r.retry=((e,t)=>{var n=e.retries||1,i=e.coolDown||0,o=e.raiseFactor||1,l=e.maxCoolDown||Infinity,s=e.timeout||0,a=e.catch||null;const u=()=>{return(s?r.timeLimit(s,t):t()).catch(e=>{if(!n--){throw e}var t=i;i=Math.min(i*o,l);if(a){return r.resolve(a(e)).then(()=>r.resolveTimeout(t).then(u))}return r.resolveTimeout(t).then(u)})};return u()});r.onceEvent=((e,t)=>{return new r(n=>e.once(t,n))});r.onceEventAll=((e,t)=>{return new r(n=>e.once(t,(...e)=>n(e)))});r.onceEventOrError=((e,t,n)=>{return new r((r,i)=>{var o;var l=t=>{e.removeListener("error",s);if(o){for(let t in o){e.removeListener(t,o[t])}}r(t)};var s=n=>{e.removeListener(t,l);if(o){for(let t in o){e.removeListener(t,o[t])}}i(n)};e.once(t,l);e.once("error",s);if(n){if(!Array.isArray(n)){n=[n]}o={};n.forEach(n=>{var r=(...r)=>{e.removeListener("error",s);e.removeListener(t,l);var o=new Error("Received an excluded event: "+n);o.event=n;o.eventArgs=r;i(o)};e.once(n,r);o[n]=r})}})});r.onceEventAllOrError=((e,t,n)=>{return new r((r,i)=>{var o;var l=(...t)=>{e.removeListener("error",s);if(o){for(let t in o){e.removeListener(t,o[t])}}r(t)};var s=n=>{e.removeListener(t,l);if(o){for(let t in o){e.removeListener(t,o[t])}}i(n)};e.once(t,l);e.once("error",s);if(n){if(!Array.isArray(n)){n=[n]}o={};n.forEach(n=>{var r=(...r)=>{e.removeListener("error",s);e.removeListener(t,l);var o=new Error("Received an excluded event: "+n);o.event=n;o.eventArgs=r;i(o)};e.once(n,r);o[n]=r})}})})},{"./seventh.js":7}],9:[function(e,t,n){(function(e,t){(function(t,n){"use strict";if(t.setImmediate){return}var r=1;var i={};var o=false;var l=t.document;var s;function a(e){if(typeof e!=="function"){e=new Function(""+e)}var t=new Array(arguments.length-1);for(var n=0;n<t.length;n++){t[n]=arguments[n+1]}var o={callback:e,args:t};i[r]=o;s(r);return r++}function u(e){delete i[e]}function f(e){var t=e.callback;var r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r);break}}function c(e){if(o){setTimeout(c,0,e)}else{var t=i[e];if(t){o=true;try{f(t)}finally{u(e);o=false}}}}function h(){s=function(t){e.nextTick(function(){c(t)})}}function d(){if(t.postMessage&&!t.importScripts){var e=true;var n=t.onmessage;t.onmessage=function(){e=false};t.postMessage("","*");t.onmessage=n;return e}}function v(){var e="setImmediate$"+Math.random()+"$";var n=function(n){if(n.source===t&&typeof n.data==="string"&&n.data.indexOf(e)===0){c(+n.data.slice(e.length))}};if(t.addEventListener){t.addEventListener("message",n,false)}else{t.attachEvent("onmessage",n)}s=function(n){t.postMessage(e+n,"*")}}function m(){var e=new MessageChannel;e.port1.onmessage=function(e){var t=e.data;c(t)};s=function(t){e.port2.postMessage(t)}}function p(){var e=l.documentElement;s=function(t){var n=l.createElement("script");n.onreadystatechange=function(){c(t);n.onreadystatechange=null;e.removeChild(n);n=null};e.appendChild(n)}}function y(){s=function(e){setTimeout(c,0,e)}}var T=Object.getPrototypeOf&&Object.getPrototypeOf(t);T=T&&T.setTimeout?T:t;if({}.toString.call(t.process)==="[object process]"){h()}else if(d()){v()}else if(t.MessageChannel){m()}else if(l&&"onreadystatechange"in l.createElement("script")){p()}else{y()}T.setImmediate=a;T.clearImmediate=u})(typeof self==="undefined"?typeof t==="undefined"?this:t:self)}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{_process:10}],10:[function(e,t,n){var r=t.exports={};var i;var o;function l(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){i=setTimeout}else{i=l}}catch(e){i=l}try{if(typeof clearTimeout==="function"){o=clearTimeout}else{o=s}}catch(e){o=s}})();function a(e){if(i===setTimeout){return setTimeout(e,0)}if((i===l||!i)&&setTimeout){i=setTimeout;return setTimeout(e,0)}try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}function u(e){if(o===clearTimeout){return clearTimeout(e)}if((o===s||!o)&&clearTimeout){o=clearTimeout;return clearTimeout(e)}try{return o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}var f=[];var c=false;var h;var d=-1;function v(){if(!c||!h){return}c=false;if(h.length){f=h.concat(f)}else{d=-1}if(f.length){m()}}function m(){if(c){return}var e=a(v);c=true;var t=f.length;while(t){h=f;f=[];while(++d<t){if(h){h[d].run()}}d=-1;t=f.length}h=null;c=false;u(e)}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1){for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}}f.push(new p(e,t));if(f.length===1&&!c){a(m)}};function p(e,t){this.fun=e;this.array=t}p.prototype.run=function(){this.fun.apply(null,this.array)};r.title="browser";r.browser=true;r.env={};r.argv=[];r.version="";r.versions={};function y(){}r.on=y;r.addListener=y;r.once=y;r.off=y;r.removeListener=y;r.removeAllListeners=y;r.emit=y;r.prependListener=y;r.prependOnceListener=y;r.listeners=function(e){return[]};r.binding=function(e){throw new Error("process.binding is not supported")};r.cwd=function(){return"/"};r.chdir=function(e){throw new Error("process.chdir is not supported")};r.umask=function(){return 0}},{}],11:[function(e,t,n){(function(t,r){var i=e("process/browser.js").nextTick;var o=Function.prototype.apply;var l=Array.prototype.slice;var s={};var a=0;n.setTimeout=function(){return new u(o.call(setTimeout,window,arguments),clearTimeout)};n.setInterval=function(){return new u(o.call(setInterval,window,arguments),clearInterval)};n.clearTimeout=n.clearInterval=function(e){e.close()};function u(e,t){this._id=e;this._clearFn=t}u.prototype.unref=u.prototype.ref=function(){};u.prototype.close=function(){this._clearFn.call(window,this._id)};n.enroll=function(e,t){clearTimeout(e._idleTimeoutId);e._idleTimeout=t};n.unenroll=function(e){clearTimeout(e._idleTimeoutId);e._idleTimeout=-1};n._unrefActive=n.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;if(t>=0){e._idleTimeoutId=setTimeout(function t(){if(e._onTimeout)e._onTimeout()},t)}};n.setImmediate=typeof t==="function"?t:function(e){var t=a++;var r=arguments.length<2?false:l.call(arguments,1);s[t]=true;i(function i(){if(s[t]){if(r){e.apply(null,r)}else{e.call(null)}n.clearImmediate(t)}});return t};n.clearImmediate=typeof r==="function"?r:function(e){delete s[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":10,timers:11}]},{},[7])(7)}); | ||
(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.Promise7th=e()}})(function(){var e,t,n;return function(){function e(t,n,r){function i(l,s){if(!n[l]){if(!t[l]){var a="function"==typeof require&&require;if(!s&&a)return a(l,!0);if(o)return o(l,!0);var u=new Error("Cannot find module '"+l+"'");throw u.code="MODULE_NOT_FOUND",u}var f=n[l]={exports:{}};t[l][0].call(f.exports,function(e){var n=t[l][1][e];return i(n||e)},f,f.exports,e,t,n,r)}return n[l].exports}for(var o="function"==typeof require&&require,l=0;l<r.length;l++)i(r[l]);return i}return e}()({1:[function(e,t,n){"use strict";var r=e("./seventh.js");r.promisifyNodeApi=((e,t,n,i,o)=>{var l;t=t||"Async";n=n||"AsyncAll";i=i||(e=>e[0]!=="_"&&!e.endsWith("Sync"));if(o){l=[];for(let t in e){if(typeof e[t]==="function"){l.push(t)}}}else{l=Object.keys(e)}l.filter(t=>{if(typeof e[t]!=="function"){return false}for(let n in e[t].prototype){return false}return i(t,e)}).forEach(i=>{const o=i+t;const l=i+n;if(!e[o]){e[o]=r.promisify(e[i],e)}if(!e[l]){e[l]=r.promisifyAll(e[i],e)}})});r.promisifyAnyNodeApi=((e,t,n,i)=>{r.promisifyNodeApi(e,t,n,i,true)})},{"./seventh.js":7}],2:[function(e,t,n){"use strict";var r=e("./seventh.js");const i={};function o(){}r.all=(e=>{var t=-1,n=false,i=0,o=Infinity,l,s=[],a=new r;for(l of e){if(n){break}t++;(()=>{const e=t;r.resolve(l).then(t=>{if(n){return}s[e]=t;i++;if(i>=o){n=true;a._resolveValue(s)}},e=>{if(n){return}n=true;a.reject(e)})})()}o=t+1;if(!o){a._resolveValue(s)}return a});r._allArray=(e=>{var t=e.length;if(!t){r._resolveValue([])}var n,i={settled:false,count:0,length:t,values:[],allPromise:new r};for(n=0;!i.settled&&n<t;n++){r._allArrayOne(e[n],n,i)}return i.allPromise});r._allArrayOne=((e,t,n)=>{r._bareThen(e,e=>{if(n.settled){return}n.values[t]=e;n.count++;if(n.count>=n.length){n.settled=true;n.allPromise._resolveValue(n.values)}},e=>{if(n.settled){return}n.settled=true;n.allPromise.reject(e)})});r.every=r.map=((e,t)=>{var n=-1,i=false,o=0,l=Infinity,s,a=[],u=new r;for(s of e){if(i){break}n++;(()=>{const e=n;r.resolve(s).then(n=>{if(i){return}return t(n,e)}).then(t=>{if(i){return}a[e]=t;o++;if(o>=l){i=true;u._resolveValue(a)}},e=>{if(i){return}i=true;u.reject(e)})})()}l=n+1;if(!l){u._resolveValue(a)}return u});r.any=(e=>{var t=-1,n=false,i=0,o=Infinity,l,s=[],a=new r;for(l of e){if(n){break}t++;(()=>{const e=t;r.resolve(l).then(e=>{if(n){return}n=true;a._resolveValue(e)},t=>{if(n){return}s[e]=t;i++;if(i>=o){n=true;a.reject(s)}})})()}o=t+1;if(!o){a.reject(new RangeError("Promise.any(): empty array"))}return a});r.some=((e,t)=>{var n=-1,i=false,o=0,l=Infinity,s,a=[],u=new r;for(s of e){if(i){break}n++;(()=>{const e=n;r.resolve(s).then(n=>{if(i){return}return t(n,e)}).then(e=>{if(i){return}i=true;u._resolveValue(e)},t=>{if(i){return}a[e]=t;o++;if(o>=l){i=true;u.reject(a)}})})()}l=n+1;if(!l){u.reject(new RangeError("Promise.any(): empty array"))}return u});r.filter=((e,t)=>{var n=-1,o=false,l=0,s=Infinity,a,u=[],f=new r;for(a of e){if(o){break}n++;(()=>{const e=n;r.resolve(a).then(n=>{if(o){return}u[e]=n;return t(n,e)}).then(t=>{if(o){return}l++;if(!t){u[e]=i}if(l>=s){o=true;u=u.filter(e=>e!==i);f._resolveValue(u)}},e=>{if(o){return}o=true;f.reject(e)})})()}s=n+1;if(!s){f._resolveValue(u)}else if(l>=s){o=true;u=u.filter(e=>e!==i);f._resolveValue(u)}return f});r.foreach=r.forEach=function(e,t,n){var i=-1,l=arguments.length>=3,s=e[Symbol.iterator](),a=new r,u=r.resolve(n);if(r.warnUnhandledRejection){r._handleAll(e)}var f=()=>{u.then(e=>{let{value:n,done:o}=s.next();i++;if(o){a.resolve(e)}else{u=r.resolve(n).then(l?n=>t(e,n,i):e=>t(e,i));f()}},e=>{a.reject(e);for(;;){let{value:e,done:t}=s.next();if(t){break}if(r.isThenable(e)){e.then(o,o)}}})};f();return a};r.reduce=((e,t,n)=>{return r.forEach(e,t,n)});r.mapObject=((e,t)=>{var n=false,i=0,o,l,s=Object.keys(e),a=s.length,u,f={},c=new r;for(o=0;!n&&o<a;o++){l=s[o];u=e[l];(()=>{const e=l;r.resolve(u).then(r=>{if(n){return}return t(r,e)}).then(t=>{if(n){return}f[e]=t;i++;if(i>=a){n=true;c._resolveValue(f)}},e=>{if(n){return}n=true;c.reject(e)})})()}if(!a){c._resolveValue(f)}return c});r.concurrent=((e,t,n)=>{var i=-1,o=false,l=0,s=0,a=Infinity,u,f=false,c=[],h=t[Symbol.iterator](),d=new r;if(r.warnUnhandledRejection){r._handleAll(t)}e=e||1;const v=()=>{while(!f&&l<e){({value:u,done:f}=h.next());if(f){a=i+1;if(s>=a){o=true;d._resolveValue(c);return}break}if(o){break}i++;(()=>{const t=i;l++;r.resolve(u).then(e=>{if(o){return}return n(e,t)}).then(n=>{if(o){return}c[t]=n;s++;l--;if(s>=a){o=true;d._resolveValue(c);return}if(l<e){v();return}},e=>{if(o){return}o=true;d.reject(e)})})()}};v();if(i<0){d._resolveValue(c)}return d});r.race=(e=>{var t=false,n,i=new r;for(n of e){if(t){break}r.resolve(n).then(e=>{if(t){return}t=true;i._resolveValue(e)},e=>{if(t){return}t=true;i.reject(e)})}return i})},{"./seventh.js":7}],3:[function(e,t,n){(function(n,r,i){"use strict";const o=r.Promise;var l;if(!n.browser){l=n.nextTick}else{e("setimmediate");l=i}function s(e){this.fn=e;this._then=s._dormantThen;this.value=null;this.thenHandlers=null;this.handledRejection=null;if(this.fn){this._exec()}}t.exports=s;s.Native=o;s.warnUnhandledRejection=true;s.prototype._exec=function(){this._then=s._pendingThen;try{this.fn(e=>{this.resolve(e)},e=>{this.reject(e)})}catch(e){this.reject(e)}};s.prototype.resolve=s.prototype.fulfill=function(e){if(this._then.settled){return this}if(s.isThenable(e)){this._execThenPromise(e);return this}return this._resolveValue(e)};s.prototype._resolveValue=function(e){this._then=s._fulfilledThen;this.value=e;if(this.thenHandlers&&this.thenHandlers.length){this._execFulfillHandlers()}return this};s.prototype._execThenPromise=function(e){try{e.then(e=>{this.resolve(e)},e=>{this.reject(e)})}catch(e){this.reject(e)}};s.prototype.reject=function(e){if(this._then.settled){return this}this._then=s._rejectedThen;this.value=e;if(this.thenHandlers&&this.thenHandlers.length){this._execRejectionHandlers()}else if(s.warnUnhandledRejection&&!this.handledRejection){this._unhandledRejection()}return this};s.prototype._execFulfillHandlers=function(){var e,t=this.thenHandlers.length;for(e=0;e<t;e+=3){if(this.thenHandlers[e+1]){this._execOneFulfillHandler(this.thenHandlers[e],this.thenHandlers[e+1])}else{this.thenHandlers[e].resolve(this.value)}}};s.prototype._execOneFulfillHandler=function(e,t){try{e.resolve(t(this.value))}catch(t){e.reject(t)}};s.prototype._execRejectionHandlers=function(){var e,t=this.thenHandlers.length;for(e=0;e<t;e+=3){if(this.thenHandlers[e+2]){this._execOneRejectHandler(this.thenHandlers[e],this.thenHandlers[e+2])}else{this.thenHandlers[e].reject(this.value)}}};s.prototype._execOneRejectHandler=function(e,t){try{e.resolve(t(this.value))}catch(t){e.reject(t)}};s.prototype.resolveTimeout=s.prototype.fulfillTimeout=function(e,t){setTimeout(()=>this.resolve(t),e)};s.prototype.rejectTimeout=function(e,t){setTimeout(()=>this.reject(t),e)};s._dormantThen=function(e,t){if(this.fn){this._exec();return this._then(e,t)}var n=new s;if(!this.thenHandlers){this.thenHandlers=[n,e,t]}else{this.thenHandlers[this.thenHandlers.length]=n;this.thenHandlers[this.thenHandlers.length]=e;this.thenHandlers[this.thenHandlers.length]=t}return n};s._dormantThen.settled=false;s._pendingThen=function(e,t){var n=new s;if(!this.thenHandlers){this.thenHandlers=[n,e,t]}else{this.thenHandlers[this.thenHandlers.length]=n;this.thenHandlers[this.thenHandlers.length]=e;this.thenHandlers[this.thenHandlers.length]=t}return n};s._pendingThen.settled=false;s._fulfilledThen=function(e){if(!e){return this}var t=new s;l(()=>{try{t.resolve(e(this.value))}catch(e){t.reject(e)}});return t};s._fulfilledThen.settled=true;s._rejectedThen=function(e,t){if(!t){return this}this.handledRejection=true;var n=new s;l(()=>{try{n.resolve(t(this.value))}catch(e){n.reject(e)}});return n};s._rejectedThen.settled=true;s.prototype.then=function(e,t){return this._then(e,t)};s.prototype.catch=function(e=(()=>undefined)){return this._then(undefined,e)};s.prototype.finally=function(e){return this._then(e,e)};s.prototype.tap=s.prototype.tapThen=function(e){this._then(e,undefined);return this};s.prototype.tapCatch=function(e){this._then(undefined,e);return this};s.prototype.tapFinally=function(e){this._then(e,e);return this};s.prototype.fatal=function(){this._then(undefined,e=>{l(()=>{throw e})})};s.prototype.done=function(e,t){this._then(e,t).fatal();return this};s.prototype.callback=function(e){this._then(t=>{e(undefined,t)},t=>{e(t)}).fatal();return this};s.prototype.callbackAll=function(e){this._then(t=>{if(Array.isArray(t)){e(undefined,...t)}else{e(undefined,t)}},t=>{e(t)}).fatal();return this};s.callback=function(e){return new s((t,n)=>{e((e,r)=>{if(e){n(e)}else{t(r)}})})};s.callbackAll=function(e){return new s((t,n)=>{e((e,...r)=>{if(e){n(e)}else{t(r)}})})};s.prototype.toPromise=s.prototype.propagate=function(e){this._then(t=>{e.resolve(t)},t=>{e.reject(t)});return this};s.propagate=function(e,t){e.then(e=>{t.resolve(e)},e=>{t.reject(e)});return e};s.finally=function(e,t){return e.then(t,t)};s.resolve=s.fulfill=function(e){if(s.isThenable(e)){return s.fromThenable(e)}return s._resolveValue(e)};s._resolveValue=function(e){var t=new s;t._then=s._fulfilledThen;t.value=e;return t};s.reject=function(e){var t=new s;t._then=s._rejectedThen;t.value=e;return t};s.resolveTimeout=s.fulfillTimeout=function(e,t){return new s(n=>setTimeout(()=>n(t),e))};s.rejectTimeout=function(e,t){return new s((n,r)=>setTimeout(()=>r(t),e))};s.resolveNextTick=s.fulfillNextTick=function(e){return new s(t=>l(()=>t(e)))};s.rejectNextTick=function(e){return new s((t,n)=>l(()=>n(e)))};s.dormant=function(e){var t=new s;t.fn=e;return t};s.try=function(e){try{return s.resolve(e())}catch(e){return s.reject(e)}};s.isThenable=function(e){return e&&typeof e==="object"&&typeof e.then==="function"};s.fromThenable=function(e){if(e instanceof s){return e}return new s((t,n)=>{e.then(e=>{t(e)},e=>{n(e)})})};s._bareThen=function(e,t,n){if(e&&typeof e==="object"){if(e instanceof s){if(e._then===s._fulfilledThen){t(e.value)}else if(e._then===s._rejectedThen){n(e.value)}else{e._then(t,n)}}else if(typeof e.then==="function"){e.then(t,n)}else{t(e)}}else{t(e)}};s._handleAll=function(e){var t;for(t of e){if(s.isThenable(t)){t.handledRejection=true}}};s.prototype._unhandledRejection=function(){this.handledRejection=false;const e=e=>setTimeout(e,0);if(this.value instanceof Error){e(()=>{if(this.handledRejection===false){this.value.message="Unhandled promise rejection: "+this.value.message;console.error(this.value)}})}else{let t=new Error("Unhandled promise rejection");e(()=>{if(this.handledRejection===false){console.error(t);console.error("Rejection reason:",this.value)}})}};s.prototype.getStatus=function(){switch(this._then){case s._dormantThen:return"dormant";case s._pendingThen:return"pending";case s._fulfilledThen:return"fulfilled";case s._rejectedThen:return"rejected"}};s.prototype.inspect=function(){switch(this._then){case s._dormantThen:return"Promise { <DORMANT> }";case s._pendingThen:return"Promise { <PENDING> }";case s._fulfilledThen:return"Promise { <FULFILLED> "+this.value+" }";case s._rejectedThen:return"Promise { <REJECTED> "+this.value+" }"}};s.resolved=s.dummy=s.resolve();if(n.browser){s.prototype.resolveAtAnimationFrame=function(e){window.requestAnimationFrame(()=>this.resolve(e))};s.prototype.rejectAtAnimationFrame=function(e){window.requestAnimationFrame(()=>this.reject(e))};s.resolveAtAnimationFrame=function(e){return new s(t=>window.requestAnimationFrame(()=>t(e)))};s.rejectAtAnimationFrame=function(e){return new s((t,n)=>window.requestAnimationFrame(()=>n(e)))}}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("timers").setImmediate)},{_process:10,setimmediate:9,timers:11}],4:[function(e,t,n){"use strict";var r=e("./seventh.js");r.promisifyAll=((e,t)=>{if(t){return(...n)=>{return new r((r,i)=>{e.call(t,...n,(e,...t)=>{if(e){if(t.length&&e instanceof Error){e.args=t}i(e)}else{r(t)}})})}}return function(...t){return new r((n,r)=>{e.call(this,...t,(e,...t)=>{if(e){if(t.length&&e instanceof Error){e.args=t}r(e)}else{n(t)}})})}});r.promisify=((e,t)=>{if(t){return(...n)=>{return new r((r,i)=>{e.call(t,...n,(e,t)=>{if(e){if(t!==undefined&&e instanceof Error){e.arg=t}i(e)}else{r(t)}})})}}return function(...t){return new r((n,r)=>{e.call(this,...t,(e,t)=>{if(e){if(t!==undefined&&e instanceof Error){e.arg=t}r(e)}else{n(t)}})})}});r.returnValueInterceptor=((e,t,n)=>{return function(...r){var i=t.call(n||this,...r);e(i);return i}});r.once=((e,t)=>{var n=false;var r;return function(...i){if(!n){n=true;r=e.call(t||this,...i)}return r}});r.serialize=((e,t)=>{var n=new r.resolve;return function(...i){var o=new r;n.finally(()=>{r.propagate(e.call(t||this,...i),o)});n=o;return o}});r.debounce=((e,t)=>{var n=null;const i=()=>{n=null};return function(...o){if(n){return n}n=e.call(t||this,...o);r.finally(n,i);return n}});r.debounceDelay=((e,t,n)=>{var i=null;const o=()=>{setTimeout(()=>i=null,e)};return function(...e){if(i){return i}i=t.call(n||this,...e);r.finally(i,o);return i}});r.debounceUpdate=((e,t)=>{var n=null;var i=null;var o=null;const l=()=>{var t,s;n=null;if(i){t=i;i=null;s=o;o=null;n=e.call(...t);r.propagate(n,s);r.finally(n,l);return n}};return function(...s){var a=t||this;if(n){if(!o){o=new r}i=[a,...s];return o}n=e.call(a,...s);r.finally(n,l);return n}});r.NO_DELAY={};r.debounceSync=((e,t)=>{var n=new Map;const i=e=>{var t=n.get(e);if(!t){t={inProgress:null,inProgressIsFull:null,last:null,lastTime:null,lastFullSync:null,lastFullSyncTime:null,nextFullSyncPromise:null,nextFullSyncWith:null};n.set(e,t)}return t};const o=(e,n)=>{var i,l,s,a=new Date;e.inProgress=null;if(n>=2){e.lastFullSyncTime=e.lastTime=a}else if(n>=1){e.lastTime=a}if(e.nextFullSyncWith){if(t.delay&&e.lastFullSyncTime&&(i=a-e.lastFullSyncTime-t.delay)<0){e.inProgress=r.resolveTimeout(-i+1);e.inProgress.finally(()=>o(e,0));return e.nextFullSyncPromise}l=e.nextFullSyncWith;e.nextFullSyncWith=null;s=e.nextFullSyncPromise;e.nextFullSyncPromise=null;e.lastFullSync=e.last=e.inProgress=t.fn.call(...l);r.propagate(e.inProgress,s);r.finally(e.inProgress,()=>o(e,2));return e.inProgress}};const l=function(t,...n){var l=false,s=e.thisBinding||this,a=i(t);if(n[n.length-1]===r.NO_DELAY){l=true;n.length--}if(a.inProgress){return a.inProgress}if(!l&&e.delay&&a.lastTime&&new Date-a.lastTime<e.delay){if(typeof e.onDebounce==="function"){e.onDebounce(t,...n)}return a.last}a.last=a.inProgress=e.fn.call(s,t,...n);a.inProgressIsFull=false;r.finally(a.inProgress,()=>o(a,1));return a.inProgress};const s=function(e,...n){var l,s=false,a=t.thisBinding||this,u=i(e);if(n[n.length-1]===r.NO_DELAY){s=true;n.length--}if(!u.inProgress&&!s&&t.delay&&u.lastFullSyncTime&&(l=new Date-u.lastFullSyncTime-t.delay)<0){u.inProgress=r.resolveTimeout(-l+1);r.finally(u.inProgress,()=>o(u,0))}if(u.inProgress){if(!u.nextFullSyncPromise){u.nextFullSyncPromise=new r}u.nextFullSyncWith=[a,e,...n];return u.nextFullSyncPromise}u.lastFullSync=u.last=u.inProgress=t.fn.call(a,e,...n);r.finally(u.inProgress,()=>o(u,2));return u.inProgress};return[l,s]});r.timeout=((e,t,n)=>{return function(...r){var i=t.call(n||this,...r);setTimeout(()=>i.reject(new Error("Timeout")),e);return i}});r.variableTimeout=((e,t)=>{return function(n,...r){var i=e.call(t||this,...r);setTimeout(()=>i.reject(new Error("Timeout")),n);return i}})},{"./seventh.js":7}],5:[function(e,t,n){(function(t){"use strict";var n=e("./seventh.js");var r=false;n.asyncExit=function(e,i){if(r){return}r=true;var o=t.listeners("asyncExit");if(!o.length){t.exit(e);return}if(i===undefined){i=1e3}const l=t=>{if(t.length<3){t(e,i);return n.dummy}return new n(n=>{t(e,i,()=>{n()})})};n.map(o,l).finally(()=>t.exit(e));setTimeout(()=>t.exit(e),i)};n.resolveSafeTimeout=function(e,t){return new n(n=>{setTimeout(()=>{setTimeout(()=>{setTimeout(()=>{setTimeout(()=>n(t),0)},e/2)},e/2)},0)})}}).call(this,e("_process"))},{"./seventh.js":7,_process:10}],6:[function(e,t,n){"use strict";var r=e("./seventh.js");r.parasite=(()=>{var e=["tap","tapCatch","finally","fatal","done","callback","callbackAll"];e.forEach(e=>r.Native.prototype[e]=r.prototype[e]);r.Native.prototype._then=r.Native.prototype.then})},{"./seventh.js":7}],7:[function(e,t,n){"use strict";const r=e("./core.js");t.exports=r;e("./batch.js");e("./wrapper.js");e("./decorators.js");e("./api.js");e("./parasite.js");e("./misc.js")},{"./api.js":1,"./batch.js":2,"./core.js":3,"./decorators.js":4,"./misc.js":5,"./parasite.js":6,"./wrapper.js":8}],8:[function(e,t,n){"use strict";var r=e("./seventh.js");r.timeLimit=((e,t)=>{return new r((n,i)=>{if(typeof t==="function"){t=t()}r.resolve(t).then(n,i);setTimeout(()=>i(new Error("Timeout")),e)})});r.retry=((e,t)=>{var n=e.retries||1,i=e.coolDown||0,o=e.raiseFactor||1,l=e.maxCoolDown||Infinity,s=e.timeout||0,a=e.catch||null;const u=()=>{return(s?r.timeLimit(s,t):t()).catch(e=>{if(!n--){throw e}var t=i;i=Math.min(i*o,l);if(a){return r.resolve(a(e)).then(()=>r.resolveTimeout(t).then(u))}return r.resolveTimeout(t).then(u)})};return u()});r.onceEvent=((e,t)=>{return new r(n=>e.once(t,n))});r.onceEventAll=((e,t)=>{return new r(n=>e.once(t,(...e)=>n(e)))});r.onceEventOrError=((e,t,n)=>{return new r((r,i)=>{var o;var l=t=>{e.removeListener("error",s);if(o){for(let t in o){e.removeListener(t,o[t])}}r(t)};var s=n=>{e.removeListener(t,l);if(o){for(let t in o){e.removeListener(t,o[t])}}i(n)};e.once(t,l);e.once("error",s);if(n){if(!Array.isArray(n)){n=[n]}o={};n.forEach(n=>{var r=(...r)=>{e.removeListener("error",s);e.removeListener(t,l);var o=new Error("Received an excluded event: "+n);o.event=n;o.eventArgs=r;i(o)};e.once(n,r);o[n]=r})}})});r.onceEventAllOrError=((e,t,n)=>{return new r((r,i)=>{var o;var l=(...t)=>{e.removeListener("error",s);if(o){for(let t in o){e.removeListener(t,o[t])}}r(t)};var s=n=>{e.removeListener(t,l);if(o){for(let t in o){e.removeListener(t,o[t])}}i(n)};e.once(t,l);e.once("error",s);if(n){if(!Array.isArray(n)){n=[n]}o={};n.forEach(n=>{var r=(...r)=>{e.removeListener("error",s);e.removeListener(t,l);var o=new Error("Received an excluded event: "+n);o.event=n;o.eventArgs=r;i(o)};e.once(n,r);o[n]=r})}})})},{"./seventh.js":7}],9:[function(e,t,n){(function(e,t){(function(t,n){"use strict";if(t.setImmediate){return}var r=1;var i={};var o=false;var l=t.document;var s;function a(e){if(typeof e!=="function"){e=new Function(""+e)}var t=new Array(arguments.length-1);for(var n=0;n<t.length;n++){t[n]=arguments[n+1]}var o={callback:e,args:t};i[r]=o;s(r);return r++}function u(e){delete i[e]}function f(e){var t=e.callback;var r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r);break}}function c(e){if(o){setTimeout(c,0,e)}else{var t=i[e];if(t){o=true;try{f(t)}finally{u(e);o=false}}}}function h(){s=function(t){e.nextTick(function(){c(t)})}}function d(){if(t.postMessage&&!t.importScripts){var e=true;var n=t.onmessage;t.onmessage=function(){e=false};t.postMessage("","*");t.onmessage=n;return e}}function v(){var e="setImmediate$"+Math.random()+"$";var n=function(n){if(n.source===t&&typeof n.data==="string"&&n.data.indexOf(e)===0){c(+n.data.slice(e.length))}};if(t.addEventListener){t.addEventListener("message",n,false)}else{t.attachEvent("onmessage",n)}s=function(n){t.postMessage(e+n,"*")}}function m(){var e=new MessageChannel;e.port1.onmessage=function(e){var t=e.data;c(t)};s=function(t){e.port2.postMessage(t)}}function p(){var e=l.documentElement;s=function(t){var n=l.createElement("script");n.onreadystatechange=function(){c(t);n.onreadystatechange=null;e.removeChild(n);n=null};e.appendChild(n)}}function y(){s=function(e){setTimeout(c,0,e)}}var T=Object.getPrototypeOf&&Object.getPrototypeOf(t);T=T&&T.setTimeout?T:t;if({}.toString.call(t.process)==="[object process]"){h()}else if(d()){v()}else if(t.MessageChannel){m()}else if(l&&"onreadystatechange"in l.createElement("script")){p()}else{y()}T.setImmediate=a;T.clearImmediate=u})(typeof self==="undefined"?typeof t==="undefined"?this:t:self)}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{_process:10}],10:[function(e,t,n){var r=t.exports={};var i;var o;function l(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){i=setTimeout}else{i=l}}catch(e){i=l}try{if(typeof clearTimeout==="function"){o=clearTimeout}else{o=s}}catch(e){o=s}})();function a(e){if(i===setTimeout){return setTimeout(e,0)}if((i===l||!i)&&setTimeout){i=setTimeout;return setTimeout(e,0)}try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}function u(e){if(o===clearTimeout){return clearTimeout(e)}if((o===s||!o)&&clearTimeout){o=clearTimeout;return clearTimeout(e)}try{return o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}var f=[];var c=false;var h;var d=-1;function v(){if(!c||!h){return}c=false;if(h.length){f=h.concat(f)}else{d=-1}if(f.length){m()}}function m(){if(c){return}var e=a(v);c=true;var t=f.length;while(t){h=f;f=[];while(++d<t){if(h){h[d].run()}}d=-1;t=f.length}h=null;c=false;u(e)}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1){for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}}f.push(new p(e,t));if(f.length===1&&!c){a(m)}};function p(e,t){this.fun=e;this.array=t}p.prototype.run=function(){this.fun.apply(null,this.array)};r.title="browser";r.browser=true;r.env={};r.argv=[];r.version="";r.versions={};function y(){}r.on=y;r.addListener=y;r.once=y;r.off=y;r.removeListener=y;r.removeAllListeners=y;r.emit=y;r.prependListener=y;r.prependOnceListener=y;r.listeners=function(e){return[]};r.binding=function(e){throw new Error("process.binding is not supported")};r.cwd=function(){return"/"};r.chdir=function(e){throw new Error("process.chdir is not supported")};r.umask=function(){return 0}},{}],11:[function(e,t,n){(function(t,r){var i=e("process/browser.js").nextTick;var o=Function.prototype.apply;var l=Array.prototype.slice;var s={};var a=0;n.setTimeout=function(){return new u(o.call(setTimeout,window,arguments),clearTimeout)};n.setInterval=function(){return new u(o.call(setInterval,window,arguments),clearInterval)};n.clearTimeout=n.clearInterval=function(e){e.close()};function u(e,t){this._id=e;this._clearFn=t}u.prototype.unref=u.prototype.ref=function(){};u.prototype.close=function(){this._clearFn.call(window,this._id)};n.enroll=function(e,t){clearTimeout(e._idleTimeoutId);e._idleTimeout=t};n.unenroll=function(e){clearTimeout(e._idleTimeoutId);e._idleTimeout=-1};n._unrefActive=n.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;if(t>=0){e._idleTimeoutId=setTimeout(function t(){if(e._onTimeout)e._onTimeout()},t)}};n.setImmediate=typeof t==="function"?t:function(e){var t=a++;var r=arguments.length<2?false:l.call(arguments,1);s[t]=true;i(function i(){if(s[t]){if(r){e.apply(null,r)}else{e.call(null)}n.clearImmediate(t)}});return t};n.clearImmediate=typeof r==="function"?r:function(e){delete s[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":10,timers:11}]},{},[7])(7)}); |
/* | ||
Seventh | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -6,0 +6,0 @@ The MIT License (MIT) |
/* | ||
Seventh | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -6,0 +6,0 @@ The MIT License (MIT) |
/* | ||
Seventh | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -6,0 +6,0 @@ The MIT License (MIT) |
/* | ||
Seventh | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -269,2 +269,3 @@ The MIT License (MIT) | ||
for update/fullSync, it waits for that delay before synchronizing again | ||
onDebounce: *ONLY* for GET ATM, a callback called when debounced | ||
*/ | ||
@@ -344,2 +345,3 @@ Promise.debounceSync = ( getParams , fullSyncParams ) => { | ||
if ( ! noDelay && getParams.delay && resourceData.lastTime && new Date() - resourceData.lastTime < getParams.delay ) { | ||
if ( typeof getParams.onDebounce === 'function' ) { getParams.onDebounce( resourceId , ... args ) ; } | ||
return resourceData.last ; | ||
@@ -346,0 +348,0 @@ } |
/* | ||
Seventh | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -6,0 +6,0 @@ The MIT License (MIT) |
/* | ||
Seventh | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -6,0 +6,0 @@ The MIT License (MIT) |
/* | ||
Seventh | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -6,0 +6,0 @@ The MIT License (MIT) |
/* | ||
Seventh | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -6,0 +6,0 @@ The MIT License (MIT) |
{ | ||
"name": "seventh", | ||
"version": "0.7.32", | ||
"version": "0.7.33", | ||
"description": "A lean Promises and Async lib for ES6/ES7", | ||
@@ -54,3 +54,3 @@ "main": "lib/seventh.js", | ||
2017, | ||
2019 | ||
2020 | ||
], | ||
@@ -57,0 +57,0 @@ "owner": "Cédric Ronvel" |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -8,0 +8,0 @@ The MIT License (MIT) |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -8,0 +8,0 @@ The MIT License (MIT) |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -8,0 +8,0 @@ The MIT License (MIT) |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -8,0 +8,0 @@ The MIT License (MIT) |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -8,0 +8,0 @@ The MIT License (MIT) |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -8,0 +8,0 @@ The MIT License (MIT) |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -8,0 +8,0 @@ The MIT License (MIT) |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -8,0 +8,0 @@ The MIT License (MIT) |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -8,0 +8,0 @@ The MIT License (MIT) |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -8,0 +8,0 @@ The MIT License (MIT) |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -8,0 +8,0 @@ The MIT License (MIT) |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -8,0 +8,0 @@ The MIT License (MIT) |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -8,0 +8,0 @@ The MIT License (MIT) |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -8,0 +8,0 @@ The MIT License (MIT) |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -8,0 +8,0 @@ The MIT License (MIT) |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -8,0 +8,0 @@ The MIT License (MIT) |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
Copyright (c) 2017 - 2019 Cédric Ronvel | ||
Copyright (c) 2017 - 2020 Cédric Ronvel | ||
@@ -8,0 +8,0 @@ The MIT License (MIT) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
271934
6685