UNPKG

next

Version:

The React Framework

1 lines 7.21 kB
module.exports=(()=>{"use strict";var e={961:e=>{var t=typeof Reflect==="object"?Reflect:null;var n=t&&typeof t.apply==="function"?t.apply:function ReflectApply(e,t,n){return Function.prototype.apply.call(e,t,n)};var r;if(t&&typeof t.ownKeys==="function"){r=t.ownKeys}else if(Object.getOwnPropertySymbols){r=function ReflectOwnKeys(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}}else{r=function ReflectOwnKeys(e){return Object.getOwnPropertyNames(e)}}function ProcessEmitWarning(e){if(console&&console.warn)console.warn(e)}var i=Number.isNaN||function NumberIsNaN(e){return e!==e};function EventEmitter(){EventEmitter.init.call(this)}e.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._eventsCount=0;EventEmitter.prototype._maxListeners=undefined;var o=10;Object.defineProperty(EventEmitter,"defaultMaxListeners",{enumerable:true,get:function(){return o},set:function(e){if(typeof e!=="number"||e<0||i(e)){throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".")}o=e}});EventEmitter.init=function(){if(this._events===undefined||this._events===Object.getPrototypeOf(this)._events){this._events=Object.create(null);this._eventsCount=0}this._maxListeners=this._maxListeners||undefined};EventEmitter.prototype.setMaxListeners=function setMaxListeners(e){if(typeof e!=="number"||e<0||i(e)){throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".")}this._maxListeners=e;return this};function $getMaxListeners(e){if(e._maxListeners===undefined)return EventEmitter.defaultMaxListeners;return e._maxListeners}EventEmitter.prototype.getMaxListeners=function getMaxListeners(){return $getMaxListeners(this)};EventEmitter.prototype.emit=function emit(e){var t=[];for(var r=1;r<arguments.length;r++)t.push(arguments[r]);var i=e==="error";var o=this._events;if(o!==undefined)i=i&&o.error===undefined;else if(!i)return false;if(i){var s;if(t.length>0)s=t[0];if(s instanceof Error){throw s}var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));u.context=s;throw u}var f=o[e];if(f===undefined)return false;if(typeof f==="function"){n(f,this,t)}else{var a=f.length;var v=arrayClone(f,a);for(var r=0;r<a;++r)n(v[r],this,t)}return true};function _addListener(e,t,n,r){var i;var o;var s;if(typeof n!=="function"){throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n)}o=e._events;if(o===undefined){o=e._events=Object.create(null);e._eventsCount=0}else{if(o.newListener!==undefined){e.emit("newListener",t,n.listener?n.listener:n);o=e._events}s=o[t]}if(s===undefined){s=o[t]=n;++e._eventsCount}else{if(typeof s==="function"){s=o[t]=r?[n,s]:[s,n]}else if(r){s.unshift(n)}else{s.push(n)}i=$getMaxListeners(e);if(i>0&&s.length>i&&!s.warned){s.warned=true;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners "+"added. Use emitter.setMaxListeners() to "+"increase limit");u.name="MaxListenersExceededWarning";u.emitter=e;u.type=t;u.count=s.length;ProcessEmitWarning(u)}}return e}EventEmitter.prototype.addListener=function addListener(e,t){return _addListener(this,e,t,false)};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.prependListener=function prependListener(e,t){return _addListener(this,e,t,true)};function onceWrapper(){var e=[];for(var t=0;t<arguments.length;t++)e.push(arguments[t]);if(!this.fired){this.target.removeListener(this.type,this.wrapFn);this.fired=true;n(this.listener,this.target,e)}}function _onceWrap(e,t,n){var r={fired:false,wrapFn:undefined,target:e,type:t,listener:n};var i=onceWrapper.bind(r);i.listener=n;r.wrapFn=i;return i}EventEmitter.prototype.once=function once(e,t){if(typeof t!=="function"){throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}this.on(e,_onceWrap(this,e,t));return this};EventEmitter.prototype.prependOnceListener=function prependOnceListener(e,t){if(typeof t!=="function"){throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}this.prependListener(e,_onceWrap(this,e,t));return this};EventEmitter.prototype.removeListener=function removeListener(e,t){var n,r,i,o,s;if(typeof t!=="function"){throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}r=this._events;if(r===undefined)return this;n=r[e];if(n===undefined)return this;if(n===t||n.listener===t){if(--this._eventsCount===0)this._events=Object.create(null);else{delete r[e];if(r.removeListener)this.emit("removeListener",e,n.listener||t)}}else if(typeof n!=="function"){i=-1;for(o=n.length-1;o>=0;o--){if(n[o]===t||n[o].listener===t){s=n[o].listener;i=o;break}}if(i<0)return this;if(i===0)n.shift();else{spliceOne(n,i)}if(n.length===1)r[e]=n[0];if(r.removeListener!==undefined)this.emit("removeListener",e,s||t)}return this};EventEmitter.prototype.off=EventEmitter.prototype.removeListener;EventEmitter.prototype.removeAllListeners=function removeAllListeners(e){var t,n,r;n=this._events;if(n===undefined)return this;if(n.removeListener===undefined){if(arguments.length===0){this._events=Object.create(null);this._eventsCount=0}else if(n[e]!==undefined){if(--this._eventsCount===0)this._events=Object.create(null);else delete n[e]}return this}if(arguments.length===0){var i=Object.keys(n);var o;for(r=0;r<i.length;++r){o=i[r];if(o==="removeListener")continue;this.removeAllListeners(o)}this.removeAllListeners("removeListener");this._events=Object.create(null);this._eventsCount=0;return this}t=n[e];if(typeof t==="function"){this.removeListener(e,t)}else if(t!==undefined){for(r=t.length-1;r>=0;r--){this.removeListener(e,t[r])}}return this};function _listeners(e,t,n){var r=e._events;if(r===undefined)return[];var i=r[t];if(i===undefined)return[];if(typeof i==="function")return n?[i.listener||i]:[i];return n?unwrapListeners(i):arrayClone(i,i.length)}EventEmitter.prototype.listeners=function listeners(e){return _listeners(this,e,true)};EventEmitter.prototype.rawListeners=function rawListeners(e){return _listeners(this,e,false)};EventEmitter.listenerCount=function(e,t){if(typeof e.listenerCount==="function"){return e.listenerCount(t)}else{return listenerCount.call(e,t)}};EventEmitter.prototype.listenerCount=listenerCount;function listenerCount(e){var t=this._events;if(t!==undefined){var n=t[e];if(typeof n==="function"){return 1}else if(n!==undefined){return n.length}}return 0}EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?r(this._events):[]};function arrayClone(e,t){var n=new Array(t);for(var r=0;r<t;++r)n[r]=e[r];return n}function spliceOne(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function unwrapListeners(e){var t=new Array(e.length);for(var n=0;n<t.length;++n){t[n]=e[n].listener||e[n]}return t}}};var t={};function __nccwpck_require__(n){if(t[n]){return t[n].exports}var r=t[n]={exports:{}};var i=true;try{e[n](r,r.exports,__nccwpck_require__);i=false}finally{if(i)delete t[n]}return r.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(961)})();