Comparing version 6.3.0 to 6.4.0
@@ -7,2 +7,13 @@ # Change Log | ||
## [6.4.0] - 2017-10-14 | ||
- Improvement for `InCache` instance and `on` method, now are chainable | ||
- Added | ||
- events | ||
- `beforeLoad` | ||
- `beforeSave` | ||
- instance parameter to events | ||
- `load` | ||
- `save` | ||
- Bug fix | ||
## [6.3.0] - 2017-09-30 | ||
@@ -9,0 +20,0 @@ - Added |
@@ -1,2 +0,2 @@ | ||
// [AIV] InCache Build version: 6.3.0 | ||
var incache=function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2)}([function(e,t,r){"use strict";var n,i="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};n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":i(window))&&(n=window)}e.exports=n},function(e,t,r){"use strict";(function(e){function n(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(n()<t)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=o.prototype):(null===e&&(e=new o(t)),e.length=t),e}function o(e,t,r){if(!(o.TYPED_ARRAY_SUPPORT||this instanceof o))return new o(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return s(this,e,t,r)}function s(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?c(e,t,r,n):"string"==typeof t?h(e,t,r):p(e,t)}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t,r,n){return a(t),t<=0?i(e,t):void 0!==r?"string"==typeof n?i(e,t).fill(r,n):i(e,t).fill(r):i(e,t)}function f(e,t){if(a(t),e=i(e,t<0?0:0|y(t)),!o.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function h(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!o.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(t,r);e=i(e,n);var s=e.write(t,r);return s!==n&&(e=e.slice(0,s)),e}function l(e,t){var r=t.length<0?0:0|y(t.length);e=i(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function c(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),o.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=o.prototype):e=l(e,t),e}function p(e,t){if(o.isBuffer(t)){var r=0|y(t.length);return e=i(e,r),0===e.length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||H(t.length)?i(e,0):l(e,t);if("Buffer"===t.type&&W(t.data))return l(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function y(e){if(e>=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function d(e){return+e!=e&&(e=0),o.alloc(+e)}function v(e,t){if(o.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(n)return V(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return B(this,t,r);case"base64":return R(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function w(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:_(e,t,r,n,i);if("number"==typeof t)return t&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):_(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function _(e,t,r,n,i){function o(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}var f;if(i){var h=-1;for(f=r;f<a;f++)if(o(e,f)===o(t,-1===h?0:f-h)){if(-1===h&&(h=f),f-h+1===u)return h*s}else-1!==h&&(f-=f-h),h=-1}else for(r+u>a&&(r=a-u),f=r;f>=0;f--){for(var l=!0,c=0;c<u;c++)if(o(e,f+c)!==o(t,c)){l=!1;break}if(l)return f}return-1}function b(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[r+s]=a}return s}function E(e,t,r,n){return X(V(t,e.length-r),e,r,n)}function A(e,t,r,n){return X(q(t),e,r,n)}function S(e,t,r,n){return A(e,t,r,n)}function O(e,t,r,n){return X(J(t),e,r,n)}function P(e,t,r,n){return X(K(t,e.length-r),e,r,n)}function R(e,t,r){return 0===t&&r===e.length?Z.fromByteArray(e):Z.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o=e[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=r){var u,f,h,l;switch(a){case 1:o<128&&(s=o);break;case 2:u=e[i+1],128==(192&u)&&(l=(31&o)<<6|63&u)>127&&(s=l);break;case 3:u=e[i+1],f=e[i+2],128==(192&u)&&128==(192&f)&&(l=(15&o)<<12|(63&u)<<6|63&f)>2047&&(l<55296||l>57343)&&(s=l);break;case 4:u=e[i+1],f=e[i+2],h=e[i+3],128==(192&u)&&128==(192&f)&&128==(192&h)&&(l=(15&o)<<18|(63&u)<<12|(63&f)<<6|63&h)>65535&&l<1114112&&(s=l)}}null===s?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=a}return T(n)}function T(e){var t=e.length;if(t<=$)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=$));return r}function k(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function B(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function C(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=z(e[o]);return i}function L(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function I(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function U(e,t,r,n,i,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function D(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function M(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function j(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Y(e,t,r,n,i){return i||j(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(e,t,r,n,23,4),r+4}function N(e,t,r,n,i){return i||j(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(e,t,r,n,52,8),r+8}function F(e){if(e=G(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function G(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function z(e){return e<16?"0"+e.toString(16):e.toString(16)}function V(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function K(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function J(e){return Z.toByteArray(F(e))}function X(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function H(e){return e!==e}var Z=r(15),Q=r(16),W=r(17);t.Buffer=o,t.SlowBuffer=d,t.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=n(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,r){return s(null,e,t,r)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,r){return u(null,e,t,r)},o.allocUnsafe=function(e){return f(null,e)},o.allocUnsafeSlow=function(e){return f(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!W(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(!o.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},o.byteLength=v,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},o.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?x(this,0,e):m.apply(this,arguments)},o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},o.prototype.compare=function(e,t,r,n,i){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var s=i-n,a=r-t,u=Math.min(s,a),f=this.slice(n,i),h=e.slice(t,r),l=0;l<u;++l)if(f[l]!==h[l]){s=f[l],a=h[l];break}return s<a?-1:a<s?1:0},o.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return w(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return w(this,e,t,r,!1)},o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":return A(this,e,t,r);case"latin1":case"binary":return S(this,e,t,r);case"base64":return O(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;o.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n;if(o.TYPED_ARRAY_SUPPORT)n=this.subarray(e,t),n.__proto__=o.prototype;else{var i=t-e;n=new o(i,void 0);for(var s=0;s<i;++s)n[s]=this[s+e]}return n},o.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},o.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),Q.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),Q.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),Q.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),Q.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t|=0,r|=0,!n){U(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t|=0,r|=0,!n){U(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):M(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);U(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);U(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):M(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,r){return Y(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return Y(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,s=n-r;if(this===e&&r<t&&t<n)for(i=s-1;i>=0;--i)e[i+t]=this[i+r];else if(s<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i<s;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+s),t);return s},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var s;if("number"==typeof e)for(s=t;s<r;++s)this[s]=e;else{var a=o.isBuffer(e)?e:V(new o(e,n).toString()),u=a.length;for(s=0;s<r-t;++s)this[s+t]=a[s%u]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(t,r(0))},function(e,t,r){"use strict";e.exports=r(3)},function(e,t,r){"use strict";(function(t,n){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(5),a=r(6),u=r(10),f=r(11),h=r(14),l=r(19),c=r(21),p=c.SAVE_MODE,y=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),Object.defineProperties(this,{_root:{writable:!0,enumerable:!1},_storage:{writable:!0,enumerable:!1},_memory:{writable:!0,enumerable:!1},_emitter:{value:new a},_opts:{writable:!0,enumerable:!1},_timerExpiryCheck:{value:null,writable:!0,enumerable:!1},_timerSaveCheck:{value:null,writable:!0,enumerable:!1},GLOBAL_KEY:{writable:!0,enumerable:!1},_lastChange:{value:null,writable:!0,enumerable:!1},_lastChangeDetected:{value:null,writable:!0,enumerable:!1},_lastSave:{value:null,writable:!0,enumerable:!1},_saving:{value:!1,writable:!0,enumerable:!1},_loading:{value:!1,writable:!0,enumerable:!1}}),this.GLOBAL_KEY="___InCache___storage___global___key___",this.DEFAULT_CONFIG={storeName:"",autoLoad:!0,autoSave:!1,autoSaveMode:p.TERMINATE,autoSavePeriod:5,save:!1,clone:!1,preserve:!1,deleteOnExpires:!0,filePath:".incache",maxAge:0,maxRecordNumber:0,expires:null,silent:!1,share:!1,autoRemovePeriod:0,nullIfNotFound:!1,global:{silent:!1,life:0}},this._onRemoved=function(){},this._onCreated=function(){},this._onUpdated=function(){},this.on("_change",function(e){t._lastChange=(new Date).getTime(),t._opts.silent||t._emitter.fire("change",e)}),this.setConfig(r)}return o(e,[{key:"_checkExceeded",value:function(){var e=Object.keys(this._memory.data);if(this._opts.maxRecordNumber>0&&e.length>this._opts.maxRecordNumber){var t=e.length-this._opts.maxRecordNumber;this._emitter.fire("exceed",t),this.bulkRemove(e.slice(0,t),!0)}}},{key:"load",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._opts.filePath;return new Promise(function(r,n){if(!s.isServer())return n("operation not allowed");if(e._loading)return n("loading locked");e._loading=!0;try{var i=u.readFileSync(t);e._memory.data=JSON.parse(i.toString()),e._loading=!1,r(),e._emitter.fireAsync("load",null)}catch(t){t=t.message,e._loading=!1,n(t),e._emitter.fireAsync("load",t)}})}},{key:"save",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._opts.filePath;return new Promise(function(r,n){if(!s.isServer())return n("operation not allowed");if(e._saving)return n("saving locked");e._saving=!0;try{u.writeFileSync(t,JSON.stringify(e._memory.data)),e._lastSave=(new Date).getTime(),e._saving=!1,r(),e._emitter.fireAsync("save",null)}catch(t){t=t.message,e._saving=!1,n(t),e._emitter.fireAsync("save",t)}})}},{key:"setConfig",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(r.global&&(s.deprecated(r.global.life,"global.life is deprecated use maxAge instead"),s.deprecated(r.global.silent,"global.silent is deprecated use silent instead")),s.defaults(r,this.DEFAULT_CONFIG),this._opts=r,this._root=r.share?s.isServer()?t:window:{},r.storeName&&(this.GLOBAL_KEY+=r.storeName),this._root[this.GLOBAL_KEY]||(this._root[this.GLOBAL_KEY]={data:{}}),this._memory=this._root[this.GLOBAL_KEY],s.isServer()&&(r.autoLoad&&this.load().then().catch(function(e){}),r.autoSave||r.save))if(r.autoSaveMode===p.TERMINATE){var i=function(){o.save().then().catch(function(e){})},o=this;n.removeListener("exit",i),n.removeListener("SIGINT",i),n.stdin.resume(),n.on("exit",i),n.on("SIGINT",i)}else r.autoSaveMode===p.TIMER&&(this._timerSaveCheck&&(clearInterval(this._timerSaveCheck),this._timerSaveCheck=null),r.autoSavePeriod&&(this._timerSaveCheck=setInterval(function(){e._lastChange!==e._lastChangeDetected&&(e._lastChangeDetected=e._lastChange,e.save().then().catch(function(e){}))},1e3*r.autoSavePeriod)));this._timerExpiryCheck&&(clearInterval(this._timerExpiryCheck),this._timerExpiryCheck=null),r.autoRemovePeriod&&(this._timerExpiryCheck=setInterval(function(){var t=e.removeExpired();t.length&&e._emitter.fire("expired",t)},1e3*r.autoRemovePeriod))}},{key:"getConfig",value:function(){return this._opts}},{key:"set",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if((r.silent||!1!==this._emitter.fireTheFirst("beforeSet",e,t))&&(r=s.defaults(r,this._opts),!this.has(e)||!this._memory.data[e].isPreserved)){r.clone&&(t=h(t));var n={id:null,isNew:!0,isPreserved:r.preserve,toDelete:r.deleteOnExpires,hits:0,lastHit:null,createdOn:null,updatedOn:null,expiresOn:null,value:t};return r.expires&&(s.is(r.expires,"date")||s.is(r.expires,"string"))?n.expiresOn=new Date(r.expires):r.maxAge&&s.is(r.maxAge,"number")?n.expiresOn=s.addMSToNow(r.maxAge):r.life&&s.is(r.life,"number")&&(s.deprecated(r.life,"life is deprecated use maxAge instead"),n.expiresOn=s.addSecondsToNow(r.life)),this.has(e)?(n.isNew=!1,n.hits=this._memory.data[e].hits,n.id=this._memory.data[e].id,n.createdOn=this._memory.data[e].createdOn,n.updatedOn=new Date,r.silent||(this._onUpdated.call(this,e,n),this._emitter.fire("update",e,n))):(n.id=f(),n.createdOn=new Date,r.silent||(this._onCreated.call(this,e,n),this._emitter.fire("create",e,n))),this._memory.data[e]=n,r.silent||this._emitter.fire("set",e,n),this._checkExceeded(),this._emitter.fire("_change","set"),n}}},{key:"get",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.has(e)?!this._opts.autoRemovePeriod&&this.expired(e)&&this._memory.data[e].toDelete?(this.remove(e,!0),this._opts.nullIfNotFound?null:void 0):(this._memory.data[e].hits+=1,this._memory.data[e].lastHit=new Date,t?this._memory.data[e].value:this._memory.data[e]):this._opts.nullIfNotFound?null:void 0}},{key:"remove",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(t||!1!==this._emitter.fireTheFirst("beforeRemove",e))&&(delete this._memory.data[e],t||(this._onRemoved.call(this,e),this._emitter.fire("remove",e)),this._emitter.fire("_change","remove"))}},{key:"removeFrom",value:function(e,t){if(!this.has(e))return null;if(s.is(t,"undefined"))throw new Error("where cannot be undefined");if(!this._memory.data[e].isPreserved){var r=this.get(e);if(!s.is(r,"array"))throw new Error("value must be an array");var n=r.length;for(var i in r)if(r.hasOwnProperty(i)){var o=[];for(var a in t)t.hasOwnProperty(a)&&(s.is(t,"object")?o.push(void 0!==r[i][a]&&r[i][a]===t[a]):o.push(r[i]===t));o.length&&-1===o.indexOf(!1)&&r.splice(i,1)}n!==r.length&&this.set(e,r)}}},{key:"removeExpired",value:function(){var e=[];for(var t in this._memory.data)this._memory.data.hasOwnProperty(t)&&this.expired(t)&&this._memory.data[t].toDelete&&(this.remove(t,!0),e.push(t));return e}},{key:"addTo",value:function(e,t){if(this.has(e)){var r=this.get(e);if(!this._memory.data[e].isPreserved){if(!s.is(r,"array"))throw new Error("object must be an array");return r.push(t),this.set(e,r)}}}},{key:"prependTo",value:function(e,t){if(this.has(e)&&!this._memory.data[e].isPreserved){var r=this.get(e);if(!s.is(r,"array"))throw new Error("object must be an array");return r.unshift(t),this.set(e,r)}}},{key:"updateIn",value:function(e,t,r){if(this.has(e)){if(s.is(t,"undefined"))throw new Error("value cannot be undefined");if(s.is(r,"undefined"))throw new Error("where cannot be undefined");if(!this._memory.data[e].isPreserved){var n=this.get(e);if(!s.is(n,"array"))throw new Error("value must be an array");var i=!1;for(var o in n)if(n.hasOwnProperty(o)){var a=[];for(var u in r)r.hasOwnProperty(u)&&(s.is(r,"object")?a.push(void 0!==n[o][u]&&n[o][u]===r[u]):a.push(n[o]===r));a.length&&-1===a.indexOf(!1)&&(i=!0,n[o]=t)}i&&this.set(e,n)}}}},{key:"bulkSet",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!s.is(e,"array"))throw new Error("records must be an array of object, e.g. {key: foo, value: bar}");if(t||!1!==this._emitter.fireTheFirst("beforeBulkSet",e)){for(var r=0;r<e.length;r++){if(s.is(e[r].key,"undefined")||s.is(e[r].value,"undefined"))throw new Error("key and value properties are required");this.set(e[r].key,e[r].value,{silent:!0,fromBulk:!0})}t||this._emitter.fire("bulkSet",e)}}},{key:"bulkRemove",value:function(e,t){if(!s.is(e,"array"))throw new Error("keys must be an array of keys");if(t||!1!==this._emitter.fireTheFirst("beforeBulkRemove",e)){for(var r=0;r<e.length;r++)this.remove(e[r],!0);t||this._emitter.fire("bulkRemove",e)}}},{key:"clean",value:function(e){if(!s.is(e,"string"))throw new Error("key must be a string");for(var t in this._memory.data)this._memory.data.hasOwnProperty(t)&&-1!==t.indexOf(e)&&(delete this._memory.data[t],this._emitter.fire("_change","clean"))}},{key:"all",value:function(){var e=[];for(var t in this._memory.data)this._memory.data.hasOwnProperty(t)&&(!this._opts.autoRemovePeriod&&this.expired(t)&&this._memory.data[t].toDelete?this.remove(t,!0):e.push({key:t,value:this._memory.data[t].value}));return e}},{key:"count",value:function(){return this.removeExpired(),Object.keys(this._memory.data).length}},{key:"expired",value:function(e){if(this._memory.data[e]&&this._memory.data[e].expiresOn){return new Date>new Date(this._memory.data[e].expiresOn)}return!1}},{key:"clear",value:function(){this._memory.data={},this._emitter.fire("_change","clear")}},{key:"has",value:function(e){return this._memory.data.hasOwnProperty(e)}},{key:"destroy",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];this.remove.apply(this,t)}},{key:"on",value:function(e,t){this._emitter.on.call(this._emitter,e,t)}},{key:"stats",value:function(){return{count:this.count(),size:l(this._memory.data)}}},{key:"onRemoved",value:function(e){this._onRemoved=e}},{key:"onCreated",value:function(e){this._onCreated=e}},{key:"onUpdated",value:function(e){this._onUpdated=e}}]),e}();e.exports=y,e.exports.SAVE_MODE=p}).call(t,r(0),r(4))},function(e,t,r){"use strict";function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function s(e){if(c===clearTimeout)return clearTimeout(e);if((c===i||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(e);try{return c(e)}catch(t){try{return c.call(null,e)}catch(t){return c.call(this,e)}}}function a(){v&&y&&(v=!1,y.length?d=y.concat(d):m=-1,d.length&&u())}function u(){if(!v){var e=o(a);v=!0;for(var t=d.length;t;){for(y=d,d=[];++m<t;)y&&y[m].run();m=-1,t=d.length}y=null,v=!1,s(e)}}function f(e,t){this.fun=e,this.array=t}function h(){}var l,c,p=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{c="function"==typeof clearTimeout?clearTimeout:i}catch(e){c=i}}();var y,d=[],v=!1,m=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];d.push(new f(e,t)),1!==d.length||v||o(u)},f.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=h,p.addListener=h,p.once=h,p.off=h,p.removeListener=h,p.removeAllListeners=h,p.emit=h,p.prependListener=h,p.prependOnceListener=h,p.listeners=function(e){return[]},p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t,r){"use strict";var n="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},i={};i.is=function(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object "+t+"]".toLowerCase()},i.defaults=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e.hasOwnProperty(r)?"object"===n(e[r])&&i.defaults(e[r],t[r]):e[r]=t[r]);return e},i.addSecondsToNow=function(e){var t=new Date;return new Date(t.setSeconds(t.getSeconds()+e))},i.addMSToNow=function(e){var t=new Date;return new Date(t.setMilliseconds(t.getMilliseconds()+e))},i.isServer=function(){return"undefined"==typeof window},i.deprecated=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"warn";return void 0!==e&&(console[r](t||e),!0)},e.exports=i},function(e,t,r){"use strict";e.exports=r(7)},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(8),s=r(9),a=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,e),this.defaultClassOpts={maxListeners:10,asyncDelay:10},this.defaultListenerOpts={maxCalls:0,prepend:!1},this.opts=o.defaults(t,this.defaultClassOpts),this.events={}}return i(e,[{key:"_createEvent",value:function(e,t,r){if(this.events[e]||(this.events[e]=[]),this.opts.maxListeners){var n=this.opts.maxListeners;if(this.events[e].length>=n)throw new Error(s[3]+n)}t.opts=o.defaults(r,this.defaultListenerOpts),t.info={calls:0},r.prepend?this.events[e].unshift(t):this.events[e].push(t),this._created.call(this,e,t,r)}},{key:"_callEvent",value:function(e,t,r){return t.opts.maxCalls&&t.info.calls++>=t.opts.maxCalls?void this.off(e,t):(this._catchAll.call(this,r),t.apply(this,r))}},{key:"_created",value:function(){}},{key:"_removed",value:function(){}},{key:"_catchAll",value:function(){}},{key:"on",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!o.is(e,"string"))throw new Error(s[0]);if(e=e.trim(),!e.length)throw new Error(s[4]);if(o.is(t,"array")){for(var n in t)if(t.hasOwnProperty(n)){if(!o.is(t[n],"function"))throw new Error(s[1]);this._createEvent(e,t[n],r)}}else{if(!o.is(t,"function"))throw new Error(s[1]);this._createEvent(e,t,r)}return this}},{key:"once",value:function(e,t){return this.on(e,t,{maxCalls:1})}},{key:"fire",value:function(e){if(this.exists(e)){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=0;i<this.events[e].length;i++)this._callEvent(e,this.events[e][i],r)}return this}},{key:"fireTheFirst",value:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(this.exists(e))return this._callEvent(e,this.events[e][0],r)}},{key:"fireAsync",value:function(e){for(var t=this,r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];n.unshift(e),setTimeout(function(){t.fire.apply(t,n)},this.opts.asyncDelay)}},{key:"off",value:function(e,t){if(!o.is(e,"string"))throw new Error(s[0]);if(this.events[e])if("function"==typeof t)for(var r=0;r<this.events[e].length;r++)this.events[e][r]===t&&(this.events[e].splice(r,1),this._removed.call(this,e,t));else delete this.events[e],this._removed.call(this,e);return this}},{key:"prependListener",value:function(e,t){return this.on(e,t,{prepend:!0})}},{key:"prependOnceListener",value:function(e,t){return this.on(e,t,{maxCalls:1,prepend:!0})}},{key:"clear",value:function(){return this.events=[],this}},{key:"getListenersCount",value:function(e){return this.getListeners(e).length}},{key:"getListeners",value:function(e){if(!o.is(e,"string"))throw new Error(s[0]);if(!this.exists(e))throw new Error(s[5]);return this.events[e]}},{key:"getEvents",value:function(){return this.events}},{key:"exists",value:function(e){if(!o.is(e,"string"))throw new Error(s[0]);return!o.is(this.events[e],"undefined")}},{key:"getMaxListeners",value:function(){return this.opts.maxListeners}},{key:"setMaxListeners",value:function(e){if(!o.is(e,"number"))throw new Error(s[2]);return this.opts.maxListeners=e,this}},{key:"onCatchAll",value:function(e){return this._catchAll=e,this}},{key:"onCreated",value:function(e){return this._created=e,this}},{key:"onRemoved",value:function(e){return this._removed=e,this}}]),e}();e.exports=a,e.exports._error=s},function(e,t,r){"use strict";var n="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},i={};i.is=function(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object "+t+"]".toLowerCase()},i.defaults=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e.hasOwnProperty(r)?"object"===n(e[r])&&i.defaults(e[r],t[r]):e[r]=t[r]);return e},e.exports=i},function(e,t,r){"use strict";e.exports=["event name is required and must be a string","listener is required and must be a function or an array of function","value must be a number","increase maxListeners per event: ","event name not valid","event not found"]},function(e,t,r){"use strict"},function(e,t,r){"use strict";function n(e,t,r){var n=t&&r||0,i=t||[];e=e||{};var s=void 0!==e.clockseq?e.clockseq:u,l=void 0!==e.msecs?e.msecs:(new Date).getTime(),c=void 0!==e.nsecs?e.nsecs:h+1,p=l-f+(c-h)/1e4;if(p<0&&void 0===e.clockseq&&(s=s+1&16383),(p<0||l>f)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=l,h=c,u=s,l+=122192928e5;var y=(1e4*(268435455&l)+c)%4294967296;i[n++]=y>>>24&255,i[n++]=y>>>16&255,i[n++]=y>>>8&255,i[n++]=255&y;var d=l/4294967296*1e4&268435455;i[n++]=d>>>8&255,i[n++]=255&d,i[n++]=d>>>24&15|16,i[n++]=d>>>16&255,i[n++]=s>>>8|128,i[n++]=255&s;for(var v=e.node||a,m=0;m<6;++m)i[n+m]=v[m];return t||o(i)}var i=r(12),o=r(13),s=i(),a=[1|s[0],s[1],s[2],s[3],s[4],s[5]],u=16383&(s[6]<<8|s[7]),f=0,h=0;e.exports=n},function(e,t,r){"use strict";(function(t){var r,n=t.crypto||t.msCrypto;if(n&&n.getRandomValues){var i=new Uint8Array(16);r=function(){return n.getRandomValues(i),i}}if(!r){var o=new Array(16);r=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}e.exports=r}).call(t,r(0))},function(e,t,r){"use strict";function n(e,t){var r=t||0,n=i;return n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]}for(var i=[],o=0;o<256;++o)i[o]=(o+256).toString(16).substr(1);e.exports=n},function(e,t,r){"use strict";(function(e,t){var r="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},n=function(){function t(e,t){return null!=t&&e instanceof t}function n(i,o,s,a,c){function p(i,s){if(null===i)return null;if(0===s)return i;var m,g;if("object"!=(void 0===i?"undefined":r(i)))return i;if(t(i,f))m=new f;else if(t(i,h))m=new h;else if(t(i,l))m=new l(function(e,t){i.then(function(t){e(p(t,s-1))},function(e){t(p(e,s-1))})});else if(n.__isArray(i))m=[];else if(n.__isRegExp(i))m=new RegExp(i.source,u(i)),i.lastIndex&&(m.lastIndex=i.lastIndex);else if(n.__isDate(i))m=new Date(i.getTime());else{if(v&&e.isBuffer(i))return m=new e(i.length),i.copy(m),m;t(i,Error)?m=Object.create(i):void 0===a?(g=Object.getPrototypeOf(i),m=Object.create(g)):(m=Object.create(a),g=a)}if(o){var w=y.indexOf(i);if(-1!=w)return d[w];y.push(i),d.push(m)}t(i,f)&&i.forEach(function(e,t){var r=p(t,s-1),n=p(e,s-1);m.set(r,n)}),t(i,h)&&i.forEach(function(e){var t=p(e,s-1);m.add(t)});for(var _ in i){var b;g&&(b=Object.getOwnPropertyDescriptor(g,_)),b&&null==b.set||(m[_]=p(i[_],s-1))}if(Object.getOwnPropertySymbols)for(var E=Object.getOwnPropertySymbols(i),_=0;_<E.length;_++){var A=E[_],S=Object.getOwnPropertyDescriptor(i,A);(!S||S.enumerable||c)&&(m[A]=p(i[A],s-1),S.enumerable||Object.defineProperty(m,A,{enumerable:!1}))}if(c)for(var O=Object.getOwnPropertyNames(i),_=0;_<O.length;_++){var P=O[_],S=Object.getOwnPropertyDescriptor(i,P);S&&S.enumerable||(m[P]=p(i[P],s-1),Object.defineProperty(m,P,{enumerable:!1}))}return m}"object"===(void 0===o?"undefined":r(o))&&(s=o.depth,a=o.prototype,c=o.includeNonEnumerable,o=o.circular);var y=[],d=[],v=void 0!==e;return void 0===o&&(o=!0),void 0===s&&(s=1/0),p(i,s)}function i(e){return Object.prototype.toString.call(e)}function o(e){return"object"===(void 0===e?"undefined":r(e))&&"[object Date]"===i(e)}function s(e){return"object"===(void 0===e?"undefined":r(e))&&"[object Array]"===i(e)}function a(e){return"object"===(void 0===e?"undefined":r(e))&&"[object RegExp]"===i(e)}function u(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}var f;try{f=Map}catch(e){f=function(){}}var h;try{h=Set}catch(e){h=function(){}}var l;try{l=Promise}catch(e){l=function(){}}return n.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},n.__objToStr=i,n.__isDate=o,n.__isArray=s,n.__isRegExp=a,n.__getRegExpFlags=u,n}();"object"===r(t)&&t.exports&&(t.exports=n)}).call(t,r(1).Buffer,r(18)(e))},function(e,t,r){"use strict";function n(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-n(e)}function o(e){var t,r,i,o,s,a=e.length;o=n(e),s=new l(3*a/4-o),r=o>0?a-4:a;var u=0;for(t=0;t<r;t+=4)i=h[e.charCodeAt(t)]<<18|h[e.charCodeAt(t+1)]<<12|h[e.charCodeAt(t+2)]<<6|h[e.charCodeAt(t+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=h[e.charCodeAt(t)]<<2|h[e.charCodeAt(t+1)]>>4,s[u++]=255&i):1===o&&(i=h[e.charCodeAt(t)]<<10|h[e.charCodeAt(t+1)]<<4|h[e.charCodeAt(t+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}function s(e){return f[e>>18&63]+f[e>>12&63]+f[e>>6&63]+f[63&e]}function a(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(s(n));return i.join("")}function u(e){for(var t,r=e.length,n=r%3,i="",o=[],s=0,u=r-n;s<u;s+=16383)o.push(a(e,s,s+16383>u?u:s+16383));return 1===n?(t=e[r-1],i+=f[t>>2],i+=f[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=f[t>>10],i+=f[t>>4&63],i+=f[t<<2&63],i+="="),o.push(i),o.join("")}t.byteLength=i,t.toByteArray=o,t.fromByteArray=u;for(var f=[],h=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,y=c.length;p<y;++p)f[p]=c[p],h[c.charCodeAt(p)]=p;h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},function(e,t,r){"use strict";t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,f=u>>1,h=-7,l=r?i-1:0,c=r?-1:1,p=e[t+l];for(l+=c,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+e[t+l],l+=c,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+e[t+l],l+=c,h-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=f}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,f=8*o-i-1,h=(1<<f)-1,l=h>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,y=n?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+l>=1?c/u:c*Math.pow(2,1-l),t*u>=2&&(s++,u/=2),s+l>=h?(a=0,s=h):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=y,a/=256,i-=8);for(s=s<<i|a,f+=i;f>0;e[r+p]=255&s,p+=y,s/=256,f-=8);e[r+p-y]|=128*d}},function(e,t,r){"use strict";var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,r){"use strict";e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";function n(e){if(null!==e&&"object"===(void 0===e?"undefined":i(e))){if(s.isBuffer(e))return e.length;var t=0;for(var r in e)if(Object.hasOwnProperty.call(e,r)){t+=n(r);try{t+=n(e[r])}catch(e){e instanceof RangeError&&(t=0)}}return t}return"string"==typeof e?e.length*o.STRING:"boolean"==typeof e?o.BOOLEAN:"number"==typeof e?o.NUMBER:0}var i="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},o=r(20),s=r(1).Buffer;e.exports=n},function(e,t,r){"use strict";e.exports={STRING:2,BOOLEAN:4,NUMBER:8}},function(e,t,r){"use strict";t.SAVE_MODE=Object.defineProperties({},{TERMINATE:{value:"terminate",enumerable:!0},TIMER:{value:"timer",enumerable:!0}}),t.REMOVE_EXCEED=Object.defineProperties({},{OLDER:{value:"older",enumerable:!0},USAGE:{value:"usage",enumerable:!0},NONE:{value:"none",enumerable:!0}})}]); | ||
// [AIV] InCache Build version: 6.4.0 | ||
var incache=function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2)}([function(e,t,r){"use strict";var n,i="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};n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":i(window))&&(n=window)}e.exports=n},function(e,t,r){"use strict";(function(e){function n(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(n()<t)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=o.prototype):(null===e&&(e=new o(t)),e.length=t),e}function o(e,t,r){if(!(o.TYPED_ARRAY_SUPPORT||this instanceof o))return new o(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return s(this,e,t,r)}function s(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?c(e,t,r,n):"string"==typeof t?h(e,t,r):p(e,t)}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t,r,n){return a(t),t<=0?i(e,t):void 0!==r?"string"==typeof n?i(e,t).fill(r,n):i(e,t).fill(r):i(e,t)}function f(e,t){if(a(t),e=i(e,t<0?0:0|y(t)),!o.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function h(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!o.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(t,r);e=i(e,n);var s=e.write(t,r);return s!==n&&(e=e.slice(0,s)),e}function l(e,t){var r=t.length<0?0:0|y(t.length);e=i(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function c(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),o.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=o.prototype):e=l(e,t),e}function p(e,t){if(o.isBuffer(t)){var r=0|y(t.length);return e=i(e,r),0===e.length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||H(t.length)?i(e,0):l(e,t);if("Buffer"===t.type&&W(t.data))return l(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function y(e){if(e>=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function d(e){return+e!=e&&(e=0),o.alloc(+e)}function v(e,t){if(o.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(n)return V(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return B(this,t,r);case"base64":return R(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function w(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:_(e,t,r,n,i);if("number"==typeof t)return t&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):_(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function _(e,t,r,n,i){function o(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}var f;if(i){var h=-1;for(f=r;f<a;f++)if(o(e,f)===o(t,-1===h?0:f-h)){if(-1===h&&(h=f),f-h+1===u)return h*s}else-1!==h&&(f-=f-h),h=-1}else for(r+u>a&&(r=a-u),f=r;f>=0;f--){for(var l=!0,c=0;c<u;c++)if(o(e,f+c)!==o(t,c)){l=!1;break}if(l)return f}return-1}function b(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[r+s]=a}return s}function E(e,t,r,n){return X(V(t,e.length-r),e,r,n)}function A(e,t,r,n){return X(q(t),e,r,n)}function S(e,t,r,n){return A(e,t,r,n)}function O(e,t,r,n){return X(J(t),e,r,n)}function P(e,t,r,n){return X(K(t,e.length-r),e,r,n)}function R(e,t,r){return 0===t&&r===e.length?Z.fromByteArray(e):Z.fromByteArray(e.slice(t,r))}function T(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o=e[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=r){var u,f,h,l;switch(a){case 1:o<128&&(s=o);break;case 2:u=e[i+1],128==(192&u)&&(l=(31&o)<<6|63&u)>127&&(s=l);break;case 3:u=e[i+1],f=e[i+2],128==(192&u)&&128==(192&f)&&(l=(15&o)<<12|(63&u)<<6|63&f)>2047&&(l<55296||l>57343)&&(s=l);break;case 4:u=e[i+1],f=e[i+2],h=e[i+3],128==(192&u)&&128==(192&f)&&128==(192&h)&&(l=(15&o)<<18|(63&u)<<12|(63&f)<<6|63&h)>65535&&l<1114112&&(s=l)}}null===s?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=a}return x(n)}function x(e){var t=e.length;if(t<=$)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=$));return r}function k(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function B(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function C(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=z(e[o]);return i}function L(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function I(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function U(e,t,r,n,i,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function D(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function M(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function j(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Y(e,t,r,n,i){return i||j(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(e,t,r,n,23,4),r+4}function N(e,t,r,n,i){return i||j(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(e,t,r,n,52,8),r+8}function F(e){if(e=G(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function G(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function z(e){return e<16?"0"+e.toString(16):e.toString(16)}function V(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function K(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function J(e){return Z.toByteArray(F(e))}function X(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function H(e){return e!==e}var Z=r(15),Q=r(16),W=r(17);t.Buffer=o,t.SlowBuffer=d,t.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=n(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,r){return s(null,e,t,r)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,r){return u(null,e,t,r)},o.allocUnsafe=function(e){return f(null,e)},o.allocUnsafeSlow=function(e){return f(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!W(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(!o.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},o.byteLength=v,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},o.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?T(this,0,e):m.apply(this,arguments)},o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},o.prototype.compare=function(e,t,r,n,i){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var s=i-n,a=r-t,u=Math.min(s,a),f=this.slice(n,i),h=e.slice(t,r),l=0;l<u;++l)if(f[l]!==h[l]){s=f[l],a=h[l];break}return s<a?-1:a<s?1:0},o.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return w(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return w(this,e,t,r,!1)},o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":return A(this,e,t,r);case"latin1":case"binary":return S(this,e,t,r);case"base64":return O(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;o.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n;if(o.TYPED_ARRAY_SUPPORT)n=this.subarray(e,t),n.__proto__=o.prototype;else{var i=t-e;n=new o(i,void 0);for(var s=0;s<i;++s)n[s]=this[s+e]}return n},o.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},o.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),Q.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),Q.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),Q.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),Q.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t|=0,r|=0,!n){U(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t|=0,r|=0,!n){U(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):M(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);U(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);U(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):M(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||U(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,r){return Y(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return Y(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,s=n-r;if(this===e&&r<t&&t<n)for(i=s-1;i>=0;--i)e[i+t]=this[i+r];else if(s<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i<s;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+s),t);return s},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var s;if("number"==typeof e)for(s=t;s<r;++s)this[s]=e;else{var a=o.isBuffer(e)?e:V(new o(e,n).toString()),u=a.length;for(s=0;s<r-t;++s)this[s+t]=a[s%u]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(t,r(0))},function(e,t,r){"use strict";e.exports=r(3)},function(e,t,r){"use strict";(function(t,n){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(5),a=r(6),u=r(10),f=r(11),h=r(14),l=r(19),c=r(21),p=c.SAVE_MODE,y=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i(this,e),Object.defineProperties(this,{_root:{writable:!0,enumerable:!1},_storage:{writable:!0,enumerable:!1},_memory:{writable:!0,enumerable:!1},_emitter:{value:new a},_opts:{writable:!0,enumerable:!1},_timerExpiryCheck:{value:null,writable:!0,enumerable:!1},_timerSaveCheck:{value:null,writable:!0,enumerable:!1},GLOBAL_KEY:{writable:!0,enumerable:!1},_lastChange:{value:null,writable:!0,enumerable:!1},_lastChangeDetected:{value:null,writable:!0,enumerable:!1},_lastSave:{value:null,writable:!0,enumerable:!1},_saving:{value:!1,writable:!0,enumerable:!1},_loading:{value:!1,writable:!0,enumerable:!1}}),this.GLOBAL_KEY="___InCache___storage___global___key___",this.DEFAULT_CONFIG={storeName:"",autoLoad:!0,autoSave:!1,autoSaveMode:p.TERMINATE,autoSavePeriod:5,save:!1,clone:!1,preserve:!1,deleteOnExpires:!0,filePath:".incache",maxAge:0,maxRecordNumber:0,expires:null,silent:!1,share:!1,autoRemovePeriod:0,nullIfNotFound:!1,global:{silent:!1,life:0}},this._onRemoved=function(){},this._onCreated=function(){},this._onUpdated=function(){},this.on("_change",function(e){t._lastChange=(new Date).getTime(),t._opts.silent||t._emitter.fire("change",e)}),this.setConfig(r),this}return o(e,[{key:"_checkExceeded",value:function(){var e=Object.keys(this._memory.data);if(this._opts.maxRecordNumber>0&&e.length>this._opts.maxRecordNumber){var t=e.length-this._opts.maxRecordNumber;this._emitter.fire("exceed",t),this.bulkRemove(e.slice(0,t),!0)}}},{key:"load",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._opts.filePath;return new Promise(function(r,n){if(!s.isServer())return n("operation not allowed");if(e._loading)return n("loading locked");if(!1===e._emitter.fireTheFirst("beforeLoad",e))return n();e._loading=!0;try{var i=u.readFileSync(t);e._memory.data=JSON.parse(i.toString()),e._loading=!1,r(e),e._emitter.fireAsync("load",null,e)}catch(t){t=t.message,e._loading=!1,n(t),e._emitter.fireAsync("load",t,e)}})}},{key:"save",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._opts.filePath;return new Promise(function(r,n){if(!s.isServer())return n("operation not allowed");if(e._saving)return n("saving locked");if(!1===e._emitter.fireTheFirst("beforeSave",e))return n();e._saving=!0;try{u.writeFileSync(t,JSON.stringify(e._memory.data)),e._lastSave=(new Date).getTime(),e._saving=!1,r(e),e._emitter.fireAsync("save",null,e)}catch(t){t=t.message,e._saving=!1,n(t),e._emitter.fireAsync("save",t,e)}})}},{key:"setConfig",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(r.global&&(s.deprecated(r.global.life,"global.life is deprecated use maxAge instead"),s.deprecated(r.global.silent,"global.silent is deprecated use silent instead")),s.defaults(r,this.DEFAULT_CONFIG),this._opts=r,this._root=r.share?s.isServer()?t:window:{},r.storeName&&(this.GLOBAL_KEY+=r.storeName),this._root[this.GLOBAL_KEY]||(this._root[this.GLOBAL_KEY]={data:{}}),this._memory=this._root[this.GLOBAL_KEY],s.isServer()&&(r.autoLoad&&this.load().then().catch(function(e){}),r.autoSave||r.save))if(r.autoSaveMode===p.TERMINATE){var i=function(){o.save().then().catch(function(e){})},o=this;n.removeListener("exit",i),n.removeListener("SIGINT",i),n.on("exit",i),n.on("SIGINT",i)}else r.autoSaveMode===p.TIMER&&(this._timerSaveCheck&&(clearInterval(this._timerSaveCheck),this._timerSaveCheck=null),r.autoSavePeriod&&(this._timerSaveCheck=setInterval(function(){e._lastChange!==e._lastChangeDetected&&(e._lastChangeDetected=e._lastChange,e.save().then().catch(function(e){}))},1e3*r.autoSavePeriod)));this._timerExpiryCheck&&(clearInterval(this._timerExpiryCheck),this._timerExpiryCheck=null),r.autoRemovePeriod&&(this._timerExpiryCheck=setInterval(function(){var t=e.removeExpired();t.length&&e._emitter.fire("expired",t)},1e3*r.autoRemovePeriod))}},{key:"getConfig",value:function(){return this._opts}},{key:"set",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if((r.silent||!1!==this._emitter.fireTheFirst("beforeSet",e,t))&&(r=s.defaults(r,this._opts),!this.has(e)||!this._memory.data[e].isPreserved)){r.clone&&(t=h(t));var n={id:null,isNew:!0,isPreserved:r.preserve,toDelete:r.deleteOnExpires,hits:0,lastHit:null,createdOn:null,updatedOn:null,expiresOn:null,value:t};return r.expires&&(s.is(r.expires,"date")||s.is(r.expires,"string"))?n.expiresOn=new Date(r.expires):r.maxAge&&s.is(r.maxAge,"number")?n.expiresOn=s.addMSToNow(r.maxAge):r.life&&s.is(r.life,"number")&&(s.deprecated(r.life,"life is deprecated use maxAge instead"),n.expiresOn=s.addSecondsToNow(r.life)),this.has(e)?(n.isNew=!1,n.hits=this._memory.data[e].hits,n.id=this._memory.data[e].id,n.createdOn=this._memory.data[e].createdOn,n.updatedOn=new Date,r.silent||(this._onUpdated.call(this,e,n),this._emitter.fire("update",e,n))):(n.id=f(),n.createdOn=new Date,r.silent||(this._onCreated.call(this,e,n),this._emitter.fire("create",e,n))),this._memory.data[e]=n,r.silent||this._emitter.fire("set",e,n),this._checkExceeded(),this._emitter.fire("_change","set"),n}}},{key:"get",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.has(e)?!this._opts.autoRemovePeriod&&this.expired(e)&&this._memory.data[e].toDelete?(this.remove(e,!0),this._opts.nullIfNotFound?null:void 0):(this._memory.data[e].hits+=1,this._memory.data[e].lastHit=new Date,t?this._memory.data[e].value:this._memory.data[e]):this._opts.nullIfNotFound?null:void 0}},{key:"remove",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(t||!1!==this._emitter.fireTheFirst("beforeRemove",e))&&(delete this._memory.data[e],t||(this._onRemoved.call(this,e),this._emitter.fire("remove",e)),this._emitter.fire("_change","remove"))}},{key:"removeFrom",value:function(e,t){if(!this.has(e))return null;if(s.is(t,"undefined"))throw new Error("where cannot be undefined");if(!this._memory.data[e].isPreserved){var r=this.get(e);if(!s.is(r,"array"))throw new Error("value must be an array");var n=r.length;for(var i in r)if(r.hasOwnProperty(i)){var o=[];for(var a in t)t.hasOwnProperty(a)&&(s.is(t,"object")?o.push(void 0!==r[i][a]&&r[i][a]===t[a]):o.push(r[i]===t));o.length&&-1===o.indexOf(!1)&&r.splice(i,1)}n!==r.length&&this.set(e,r)}}},{key:"removeExpired",value:function(){var e=[];for(var t in this._memory.data)this._memory.data.hasOwnProperty(t)&&this.expired(t)&&this._memory.data[t].toDelete&&(this.remove(t,!0),e.push(t));return e}},{key:"addTo",value:function(e,t){if(this.has(e)){var r=this.get(e);if(!this._memory.data[e].isPreserved){if(!s.is(r,"array"))throw new Error("object must be an array");return r.push(t),this.set(e,r)}}}},{key:"prependTo",value:function(e,t){if(this.has(e)&&!this._memory.data[e].isPreserved){var r=this.get(e);if(!s.is(r,"array"))throw new Error("object must be an array");return r.unshift(t),this.set(e,r)}}},{key:"updateIn",value:function(e,t,r){if(this.has(e)){if(s.is(t,"undefined"))throw new Error("value cannot be undefined");if(s.is(r,"undefined"))throw new Error("where cannot be undefined");if(!this._memory.data[e].isPreserved){var n=this.get(e);if(!s.is(n,"array"))throw new Error("value must be an array");var i=!1;for(var o in n)if(n.hasOwnProperty(o)){var a=[];for(var u in r)r.hasOwnProperty(u)&&(s.is(r,"object")?a.push(void 0!==n[o][u]&&n[o][u]===r[u]):a.push(n[o]===r));a.length&&-1===a.indexOf(!1)&&(i=!0,n[o]=t)}i&&this.set(e,n)}}}},{key:"bulkSet",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!s.is(e,"array"))throw new Error("records must be an array of object, e.g. {key: foo, value: bar}");if(t||!1!==this._emitter.fireTheFirst("beforeBulkSet",e)){for(var r=0;r<e.length;r++){if(s.is(e[r].key,"undefined")||s.is(e[r].value,"undefined"))throw new Error("key and value properties are required");this.set(e[r].key,e[r].value,{silent:!0,fromBulk:!0})}t||this._emitter.fire("bulkSet",e)}}},{key:"bulkRemove",value:function(e,t){if(!s.is(e,"array"))throw new Error("keys must be an array of keys");if(t||!1!==this._emitter.fireTheFirst("beforeBulkRemove",e)){for(var r=0;r<e.length;r++)this.remove(e[r],!0);t||this._emitter.fire("bulkRemove",e)}}},{key:"clean",value:function(e){if(!s.is(e,"string"))throw new Error("key must be a string");for(var t in this._memory.data)this._memory.data.hasOwnProperty(t)&&-1!==t.indexOf(e)&&(delete this._memory.data[t],this._emitter.fire("_change","clean"))}},{key:"all",value:function(){var e=[];for(var t in this._memory.data)this._memory.data.hasOwnProperty(t)&&(!this._opts.autoRemovePeriod&&this.expired(t)&&this._memory.data[t].toDelete?this.remove(t,!0):e.push({key:t,value:this._memory.data[t].value}));return e}},{key:"count",value:function(){return this.removeExpired(),Object.keys(this._memory.data).length}},{key:"expired",value:function(e){if(this._memory.data[e]&&this._memory.data[e].expiresOn){return new Date>new Date(this._memory.data[e].expiresOn)}return!1}},{key:"clear",value:function(){this._memory.data={},this._emitter.fire("_change","clear")}},{key:"has",value:function(e){return this._memory.data.hasOwnProperty(e)}},{key:"destroy",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];this.remove.apply(this,t)}},{key:"on",value:function(e,t){return this._emitter.on.call(this._emitter,e,t),this}},{key:"stats",value:function(){return{count:this.count(),size:l(this._memory.data)}}},{key:"onRemoved",value:function(e){this._onRemoved=e}},{key:"onCreated",value:function(e){this._onCreated=e}},{key:"onUpdated",value:function(e){this._onUpdated=e}}]),e}();e.exports=y,e.exports.SAVE_MODE=p}).call(t,r(0),r(4))},function(e,t,r){"use strict";function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function s(e){if(c===clearTimeout)return clearTimeout(e);if((c===i||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(e);try{return c(e)}catch(t){try{return c.call(null,e)}catch(t){return c.call(this,e)}}}function a(){v&&y&&(v=!1,y.length?d=y.concat(d):m=-1,d.length&&u())}function u(){if(!v){var e=o(a);v=!0;for(var t=d.length;t;){for(y=d,d=[];++m<t;)y&&y[m].run();m=-1,t=d.length}y=null,v=!1,s(e)}}function f(e,t){this.fun=e,this.array=t}function h(){}var l,c,p=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{c="function"==typeof clearTimeout?clearTimeout:i}catch(e){c=i}}();var y,d=[],v=!1,m=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];d.push(new f(e,t)),1!==d.length||v||o(u)},f.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=h,p.addListener=h,p.once=h,p.off=h,p.removeListener=h,p.removeAllListeners=h,p.emit=h,p.prependListener=h,p.prependOnceListener=h,p.listeners=function(e){return[]},p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t,r){"use strict";var n="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},i={};i.is=function(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object "+t+"]".toLowerCase()},i.defaults=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e.hasOwnProperty(r)?"object"===n(e[r])&&i.defaults(e[r],t[r]):e[r]=t[r]);return e},i.addSecondsToNow=function(e){var t=new Date;return new Date(t.setSeconds(t.getSeconds()+e))},i.addMSToNow=function(e){var t=new Date;return new Date(t.setMilliseconds(t.getMilliseconds()+e))},i.isServer=function(){return"undefined"==typeof window},i.deprecated=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"warn";return void 0!==e&&(console[r](t||e),!0)},e.exports=i},function(e,t,r){"use strict";e.exports=r(7)},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(8),s=r(9),a=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,e),this.defaultClassOpts={maxListeners:10,asyncDelay:10},this.defaultListenerOpts={maxCalls:0,prepend:!1},this.opts=o.defaults(t,this.defaultClassOpts),this.events={}}return i(e,[{key:"_createEvent",value:function(e,t,r){if(this.events[e]||(this.events[e]=[]),this.opts.maxListeners){var n=this.opts.maxListeners;if(this.events[e].length>=n)throw new Error(s[3]+n)}t.opts=o.defaults(r,this.defaultListenerOpts),t.info={calls:0},r.prepend?this.events[e].unshift(t):this.events[e].push(t),this._created.call(this,e,t,r)}},{key:"_callEvent",value:function(e,t,r){return t.opts.maxCalls&&t.info.calls++>=t.opts.maxCalls?void this.off(e,t):(this._catchAll.call(this,r),t.apply(this,r))}},{key:"_created",value:function(){}},{key:"_removed",value:function(){}},{key:"_catchAll",value:function(){}},{key:"on",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!o.is(e,"string"))throw new Error(s[0]);if(e=e.trim(),!e.length)throw new Error(s[4]);if(o.is(t,"array")){for(var n in t)if(t.hasOwnProperty(n)){if(!o.is(t[n],"function"))throw new Error(s[1]);this._createEvent(e,t[n],r)}}else{if(!o.is(t,"function"))throw new Error(s[1]);this._createEvent(e,t,r)}return this}},{key:"once",value:function(e,t){return this.on(e,t,{maxCalls:1})}},{key:"fire",value:function(e){if(this.exists(e)){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=0;i<this.events[e].length;i++)this._callEvent(e,this.events[e][i],r)}return this}},{key:"fireTheFirst",value:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(this.exists(e))return this._callEvent(e,this.events[e][0],r)}},{key:"fireAsync",value:function(e){for(var t=this,r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];n.unshift(e),setTimeout(function(){t.fire.apply(t,n)},this.opts.asyncDelay)}},{key:"off",value:function(e,t){if(!o.is(e,"string"))throw new Error(s[0]);if(this.events[e])if("function"==typeof t)for(var r=0;r<this.events[e].length;r++)this.events[e][r]===t&&(this.events[e].splice(r,1),this._removed.call(this,e,t));else delete this.events[e],this._removed.call(this,e);return this}},{key:"prependListener",value:function(e,t){return this.on(e,t,{prepend:!0})}},{key:"prependOnceListener",value:function(e,t){return this.on(e,t,{maxCalls:1,prepend:!0})}},{key:"clear",value:function(){return this.events=[],this}},{key:"getListenersCount",value:function(e){return this.getListeners(e).length}},{key:"getListeners",value:function(e){if(!o.is(e,"string"))throw new Error(s[0]);if(!this.exists(e))throw new Error(s[5]);return this.events[e]}},{key:"getEvents",value:function(){return this.events}},{key:"exists",value:function(e){if(!o.is(e,"string"))throw new Error(s[0]);return!o.is(this.events[e],"undefined")}},{key:"getMaxListeners",value:function(){return this.opts.maxListeners}},{key:"setMaxListeners",value:function(e){if(!o.is(e,"number"))throw new Error(s[2]);return this.opts.maxListeners=e,this}},{key:"onCatchAll",value:function(e){return this._catchAll=e,this}},{key:"onCreated",value:function(e){return this._created=e,this}},{key:"onRemoved",value:function(e){return this._removed=e,this}}]),e}();e.exports=a,e.exports._error=s},function(e,t,r){"use strict";var n="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},i={};i.is=function(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object "+t+"]".toLowerCase()},i.defaults=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e.hasOwnProperty(r)?"object"===n(e[r])&&i.defaults(e[r],t[r]):e[r]=t[r]);return e},e.exports=i},function(e,t,r){"use strict";e.exports=["event name is required and must be a string","listener is required and must be a function or an array of function","value must be a number","increase maxListeners per event: ","event name not valid","event not found"]},function(e,t,r){"use strict"},function(e,t,r){"use strict";function n(e,t,r){var n=t&&r||0,i=t||[];e=e||{};var s=void 0!==e.clockseq?e.clockseq:u,l=void 0!==e.msecs?e.msecs:(new Date).getTime(),c=void 0!==e.nsecs?e.nsecs:h+1,p=l-f+(c-h)/1e4;if(p<0&&void 0===e.clockseq&&(s=s+1&16383),(p<0||l>f)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=l,h=c,u=s,l+=122192928e5;var y=(1e4*(268435455&l)+c)%4294967296;i[n++]=y>>>24&255,i[n++]=y>>>16&255,i[n++]=y>>>8&255,i[n++]=255&y;var d=l/4294967296*1e4&268435455;i[n++]=d>>>8&255,i[n++]=255&d,i[n++]=d>>>24&15|16,i[n++]=d>>>16&255,i[n++]=s>>>8|128,i[n++]=255&s;for(var v=e.node||a,m=0;m<6;++m)i[n+m]=v[m];return t||o(i)}var i=r(12),o=r(13),s=i(),a=[1|s[0],s[1],s[2],s[3],s[4],s[5]],u=16383&(s[6]<<8|s[7]),f=0,h=0;e.exports=n},function(e,t,r){"use strict";(function(t){var r,n=t.crypto||t.msCrypto;if(n&&n.getRandomValues){var i=new Uint8Array(16);r=function(){return n.getRandomValues(i),i}}if(!r){var o=new Array(16);r=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}e.exports=r}).call(t,r(0))},function(e,t,r){"use strict";function n(e,t){var r=t||0,n=i;return n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]}for(var i=[],o=0;o<256;++o)i[o]=(o+256).toString(16).substr(1);e.exports=n},function(e,t,r){"use strict";(function(e,t){var r="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},n=function(){function t(e,t){return null!=t&&e instanceof t}function n(i,o,s,a,c){function p(i,s){if(null===i)return null;if(0===s)return i;var m,g;if("object"!=(void 0===i?"undefined":r(i)))return i;if(t(i,f))m=new f;else if(t(i,h))m=new h;else if(t(i,l))m=new l(function(e,t){i.then(function(t){e(p(t,s-1))},function(e){t(p(e,s-1))})});else if(n.__isArray(i))m=[];else if(n.__isRegExp(i))m=new RegExp(i.source,u(i)),i.lastIndex&&(m.lastIndex=i.lastIndex);else if(n.__isDate(i))m=new Date(i.getTime());else{if(v&&e.isBuffer(i))return m=new e(i.length),i.copy(m),m;t(i,Error)?m=Object.create(i):void 0===a?(g=Object.getPrototypeOf(i),m=Object.create(g)):(m=Object.create(a),g=a)}if(o){var w=y.indexOf(i);if(-1!=w)return d[w];y.push(i),d.push(m)}t(i,f)&&i.forEach(function(e,t){var r=p(t,s-1),n=p(e,s-1);m.set(r,n)}),t(i,h)&&i.forEach(function(e){var t=p(e,s-1);m.add(t)});for(var _ in i){var b;g&&(b=Object.getOwnPropertyDescriptor(g,_)),b&&null==b.set||(m[_]=p(i[_],s-1))}if(Object.getOwnPropertySymbols)for(var E=Object.getOwnPropertySymbols(i),_=0;_<E.length;_++){var A=E[_],S=Object.getOwnPropertyDescriptor(i,A);(!S||S.enumerable||c)&&(m[A]=p(i[A],s-1),S.enumerable||Object.defineProperty(m,A,{enumerable:!1}))}if(c)for(var O=Object.getOwnPropertyNames(i),_=0;_<O.length;_++){var P=O[_],S=Object.getOwnPropertyDescriptor(i,P);S&&S.enumerable||(m[P]=p(i[P],s-1),Object.defineProperty(m,P,{enumerable:!1}))}return m}"object"===(void 0===o?"undefined":r(o))&&(s=o.depth,a=o.prototype,c=o.includeNonEnumerable,o=o.circular);var y=[],d=[],v=void 0!==e;return void 0===o&&(o=!0),void 0===s&&(s=1/0),p(i,s)}function i(e){return Object.prototype.toString.call(e)}function o(e){return"object"===(void 0===e?"undefined":r(e))&&"[object Date]"===i(e)}function s(e){return"object"===(void 0===e?"undefined":r(e))&&"[object Array]"===i(e)}function a(e){return"object"===(void 0===e?"undefined":r(e))&&"[object RegExp]"===i(e)}function u(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}var f;try{f=Map}catch(e){f=function(){}}var h;try{h=Set}catch(e){h=function(){}}var l;try{l=Promise}catch(e){l=function(){}}return n.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},n.__objToStr=i,n.__isDate=o,n.__isArray=s,n.__isRegExp=a,n.__getRegExpFlags=u,n}();"object"===r(t)&&t.exports&&(t.exports=n)}).call(t,r(1).Buffer,r(18)(e))},function(e,t,r){"use strict";function n(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-n(e)}function o(e){var t,r,i,o,s,a=e.length;o=n(e),s=new l(3*a/4-o),r=o>0?a-4:a;var u=0;for(t=0;t<r;t+=4)i=h[e.charCodeAt(t)]<<18|h[e.charCodeAt(t+1)]<<12|h[e.charCodeAt(t+2)]<<6|h[e.charCodeAt(t+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=h[e.charCodeAt(t)]<<2|h[e.charCodeAt(t+1)]>>4,s[u++]=255&i):1===o&&(i=h[e.charCodeAt(t)]<<10|h[e.charCodeAt(t+1)]<<4|h[e.charCodeAt(t+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}function s(e){return f[e>>18&63]+f[e>>12&63]+f[e>>6&63]+f[63&e]}function a(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(s(n));return i.join("")}function u(e){for(var t,r=e.length,n=r%3,i="",o=[],s=0,u=r-n;s<u;s+=16383)o.push(a(e,s,s+16383>u?u:s+16383));return 1===n?(t=e[r-1],i+=f[t>>2],i+=f[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=f[t>>10],i+=f[t>>4&63],i+=f[t<<2&63],i+="="),o.push(i),o.join("")}t.byteLength=i,t.toByteArray=o,t.fromByteArray=u;for(var f=[],h=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,y=c.length;p<y;++p)f[p]=c[p],h[c.charCodeAt(p)]=p;h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},function(e,t,r){"use strict";t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,f=u>>1,h=-7,l=r?i-1:0,c=r?-1:1,p=e[t+l];for(l+=c,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+e[t+l],l+=c,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+e[t+l],l+=c,h-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=f}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,f=8*o-i-1,h=(1<<f)-1,l=h>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,y=n?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+l>=1?c/u:c*Math.pow(2,1-l),t*u>=2&&(s++,u/=2),s+l>=h?(a=0,s=h):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=y,a/=256,i-=8);for(s=s<<i|a,f+=i;f>0;e[r+p]=255&s,p+=y,s/=256,f-=8);e[r+p-y]|=128*d}},function(e,t,r){"use strict";var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,r){"use strict";e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";function n(e){if(null!==e&&"object"===(void 0===e?"undefined":i(e))){if(s.isBuffer(e))return e.length;var t=0;for(var r in e)if(Object.hasOwnProperty.call(e,r)){t+=n(r);try{t+=n(e[r])}catch(e){e instanceof RangeError&&(t=0)}}return t}return"string"==typeof e?e.length*o.STRING:"boolean"==typeof e?o.BOOLEAN:"number"==typeof e?o.NUMBER:0}var i="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},o=r(20),s=r(1).Buffer;e.exports=n},function(e,t,r){"use strict";e.exports={STRING:2,BOOLEAN:4,NUMBER:8}},function(e,t,r){"use strict";t.SAVE_MODE=Object.defineProperties({},{TERMINATE:{value:"terminate",enumerable:!0},TIMER:{value:"timer",enumerable:!0}}),t.REMOVE_EXCEED=Object.defineProperties({},{OLDER:{value:"older",enumerable:!0},USAGE:{value:"usage",enumerable:!0},NONE:{value:"none",enumerable:!0}})}]); |
{ | ||
"name": "incache", | ||
"version": "6.3.0", | ||
"version": "6.4.0", | ||
"description": "Powerful key/value in-memory storage or on disk to persist some data", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -23,2 +23,5 @@ const helper = require('./helper'); | ||
/** | ||
* @class | ||
*/ | ||
class InCache { | ||
@@ -53,2 +56,3 @@ | ||
* @constructor | ||
* @returns {InCache} | ||
*/ | ||
@@ -168,2 +172,4 @@ constructor(opts = {}) { | ||
this.setConfig(opts); | ||
return this; | ||
} | ||
@@ -184,2 +190,3 @@ | ||
* @param [path=opts.filePath] {string} file path | ||
* @fires InCache#beforeLoad | ||
* @fires InCache#load | ||
@@ -195,2 +202,7 @@ * @returns {Promise} | ||
/* istanbul ignore else */ | ||
if (this._emitter.fireTheFirst('beforeLoad', this) === false) { | ||
return reject(); | ||
} | ||
this._loading = true; | ||
@@ -202,4 +214,4 @@ | ||
this._loading = false; | ||
resolve(); | ||
this._emitter.fireAsync('load', null); | ||
resolve(this); | ||
this._emitter.fireAsync('load', null, this); | ||
} catch (err) { | ||
@@ -209,3 +221,3 @@ err = err.message; | ||
reject(err); | ||
this._emitter.fireAsync('load', err); | ||
this._emitter.fireAsync('load', err, this); | ||
} | ||
@@ -219,2 +231,3 @@ } | ||
* @param [path=opts.filePath] {string} file path | ||
* @fires InCache#beforeSave | ||
* @fires InCache#save | ||
@@ -230,2 +243,7 @@ * @returns {Promise} | ||
/* istanbul ignore else */ | ||
if (this._emitter.fireTheFirst('beforeSave', this) === false) { | ||
return reject(); | ||
} | ||
this._saving = true; | ||
@@ -237,4 +255,4 @@ | ||
this._saving = false; | ||
resolve(); | ||
this._emitter.fireAsync('save', null); | ||
resolve(this); | ||
this._emitter.fireAsync('save', null, this); | ||
} catch (err) { | ||
@@ -244,3 +262,3 @@ err = err.message; | ||
reject(err); | ||
this._emitter.fireAsync('save', err); | ||
this._emitter.fireAsync('save', err, this); | ||
} | ||
@@ -315,3 +333,3 @@ } | ||
process.stdin.resume(); | ||
//process.stdin.resume(); | ||
process.on('exit', pWrite); | ||
@@ -399,3 +417,3 @@ process.on('SIGINT', pWrite); | ||
* @fires InCache#set | ||
* @example | ||
* @examples | ||
* inCache.set('my key', 'my value'); | ||
@@ -483,3 +501,3 @@ * inCache.set('my object', {a: 1, b: 2}); | ||
* @returns {InCache~record|*|null|undefined} | ||
* @example | ||
* @examples | ||
* inCache.get('my key'); | ||
@@ -507,3 +525,3 @@ */ | ||
* @fires InCache#remove | ||
* @example | ||
* @examples | ||
* inCache.remove('my key'); | ||
@@ -527,3 +545,3 @@ */ | ||
* @param where {*} | ||
* @example | ||
* @examples | ||
* inCache.set('myArray', ['hello', 'world']); | ||
@@ -574,3 +592,3 @@ * inCache.removeFrom('myArray', 'hello'); //-> ['world']; | ||
* @since 4.1.0 | ||
* @example | ||
* @examples | ||
* inCache.set('my key 1', 'my value'); | ||
@@ -600,3 +618,3 @@ * inCache.set('my key 2', 'my value', {maxAge: 1000}); | ||
* @returns {InCache~record|undefined} | ||
* @example | ||
* @examples | ||
* inCache.set('myArray', ['hello', 'world']); | ||
@@ -627,3 +645,3 @@ * inCache.addTo('myArray', 'ciao'); //-> ['hello', 'world', 'ciao']; | ||
* @returns {InCache~record|undefined} | ||
* @example | ||
* @examples | ||
* inCache.set('myArray', ['hello', 'world']); | ||
@@ -656,3 +674,3 @@ * inCache.prependTo('myArray', 'ciao'); //-> ['ciao', 'hello', 'world']; | ||
* @param where {*} | ||
* @example | ||
* @examples | ||
* inCache.set('myArray', ['hello', 'world']); | ||
@@ -713,3 +731,3 @@ * inCache.updateIn('myArray', 'ciao', 'hello'); //-> ['ciao', 'world']; | ||
* @fires InCache#bulkSet | ||
* @example | ||
* @examples | ||
* inCache.bulkSet([ | ||
@@ -747,3 +765,3 @@ * {key: 'my key 1', value: 'my value 1'}, | ||
* @fires InCache#bulkRemove | ||
* @example | ||
* @examples | ||
* inCache.bulkRemove(['key1', 'key2', 'key3']); | ||
@@ -771,3 +789,3 @@ */ | ||
* @param key {string} a string that is relative to a group of keys | ||
* @example | ||
* @examples | ||
* inCache.set('/api/users/foo', 'Mario Rossi'); | ||
@@ -853,3 +871,3 @@ * inCache.set('/api/users/bar', 'Antonio Bianchi'); | ||
* @returns {boolean} | ||
* @example | ||
* @examples | ||
* inCache.has('my key'); | ||
@@ -875,5 +893,7 @@ */ | ||
* @param callback {Function} callback | ||
* @returns {InCache} | ||
*/ | ||
on(eventName, callback) { | ||
this._emitter.on.call(this._emitter, eventName, callback); | ||
return this; | ||
} | ||
@@ -975,5 +995,13 @@ | ||
/** | ||
* Triggered before load (only if `autoLoad` is false) | ||
* @event InCache#beforeLoad | ||
* @param me {InCache} | ||
* @since 6.4.0 | ||
*/ | ||
/** | ||
* Triggered after load invocation | ||
* @event InCache#load | ||
* @param err {null|string} error message, if no errors occurred is null | ||
* @param me {InCache} | ||
* @since 6.0.0 | ||
@@ -983,5 +1011,13 @@ */ | ||
/** | ||
* Triggered before save | ||
* @event InCache#beforeSave | ||
* @param me {InCache} | ||
* @since 6.4.0 | ||
*/ | ||
/** | ||
* Triggered after save invocation | ||
* @event InCache#save | ||
* @param err {null|string} error message, if no errors occurred is null | ||
* @param me {InCache} | ||
* @since 6.0.0 | ||
@@ -1010,3 +1046,3 @@ */ | ||
* @deprecated | ||
* @example | ||
* @examples | ||
* inCache.onRemoved((key)=>{ | ||
@@ -1031,3 +1067,3 @@ * console.log('removed', key); | ||
* @deprecated | ||
* @example | ||
* @examples | ||
* inCache.onCreated((key, record)=>{ | ||
@@ -1053,3 +1089,3 @@ * console.log('created', key, record); | ||
* @deprecated | ||
* @example | ||
* @examples | ||
* inCache.onUpdated((key, record)=>{ | ||
@@ -1056,0 +1092,0 @@ * console.log('updated', key, record); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
234420
4990