Skip to content

Instantly share code, notes, and snippets.

@kayhadrin
Created January 4, 2014 00:33
Show Gist options
  • Save kayhadrin/8249646 to your computer and use it in GitHub Desktop.
Save kayhadrin/8249646 to your computer and use it in GitHub Desktop.
requirebin sketch
var MemDB = require('memdb');
var db = MemDB();
console.log('memdb db = ', db);
require=function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);throw Error("Cannot find module '"+a+"'")}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return o(n?n:e)},l,l.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;r.length>a;a++)o(r[a]);return o}({mtC6qQ:[function(e,t){function n(e,t){return"function"==typeof e&&(t=e,e={}),"string"==typeof e&&(e={}),e=e||{},e.db=function(e){return new o(e)},r("mem",e,t)}var r=e("levelup"),o=e("memdown");t.exports=n},{levelup:5,memdown:56}],memdb:[function(e,t){t.exports=e("mtC6qQ")},{}],3:[function(e,t){function n(e){this._levelup=e,this.batch=e.db.batch(),this.ops=[]}var r=e("./util"),o=e("./errors").WriteError,i=r.getOptions,a=r.dispatchError;n.prototype.put=function(e,t,n){n=i(this._levelup,n);var a=r.encodeKey(e,n),s=r.encodeValue(t,n);try{this.batch.put(a,s)}catch(u){throw new o(u)}return this.ops.push({type:"put",key:a,value:s}),this},n.prototype.del=function(e,t){t=i(this._levelup,t);var n=r.encodeKey(e,t);try{this.batch.del(n)}catch(a){throw new o(a)}return this.ops.push({type:"del",key:n}),this},n.prototype.clear=function(){try{this.batch.clear()}catch(e){throw new o(e)}return this.ops=[],this},n.prototype.write=function(e){var t=this._levelup,n=this.ops;try{this.batch.write(function(r){return r?a(t,new o(r),e):(t.emit("batch",n),e&&e(),void 0)})}catch(r){throw new o(r)}},t.exports=n},{"./errors":4,"./util":7}],4:[function(e,t){var n=e("errno").create,r=n("LevelUPError"),o=n("NotFoundError",r);o.prototype.notFound=!0,o.prototype.status=404,t.exports={LevelUPError:r,InitializationError:n("InitializationError",r),OpenError:n("OpenError",r),ReadError:n("ReadError",r),WriteError:n("WriteError",r),NotFoundError:o,EncodingError:n("EncodingError",r)}},{errno:41}],5:[function(e,t){function n(e,t){return"function"==typeof e?e:t}function r(e,t,n){if(!(this instanceof r))return new r(e,t,n);var o;if(a.call(this),this.setMaxListeners(1/0),"function"==typeof e?(t="object"==typeof t?t:{},t.db=e,e=null):"object"==typeof e&&"function"==typeof e.db&&(t=e,e=null),"function"==typeof t&&(n=t,t={}),(!t||"function"!=typeof t.db)&&"string"!=typeof e){if(o=new y("Must provide a location for the database"),n)return i.nextTick(function(){n(o)});throw o}t=_(this,t),this.options=u(E,t),this._status="new",l(this,"location",e,"e"),this.open(n)}function o(e){return function(t,n){k()[e](t,n||function(){})}}var i=e("__browserify_process"),a=e("events").EventEmitter,s=e("util").inherits,u=e("xtend"),l=e("prr"),c=e("deferred-leveldown"),f=e("./errors").WriteError,d=e("./errors").ReadError,h=e("./errors").NotFoundError,p=e("./errors").OpenError,g=e("./errors").EncodingError,y=e("./errors").InitializationError,b=e("./read-stream"),m=e("./write-stream"),v=e("./util"),w=e("./batch"),_=v.getOptions,E=v.defaultOptions,k=v.getLevelDOWN,S=v.dispatchError;s(r,a),r.prototype.open=function(e){var t,n,r=this;return this.isOpen()?(e&&i.nextTick(function(){e(null,r)}),this):this._isOpening()?e&&this.once("open",function(){e(null,r)}):(this.emit("opening"),this._status="opening",this.db=new c(this.location),t=this.options.db||k(),n=t(this.location),n.open(this.options,function(t){return t?S(r,new p(t),e):(r.db.setDb(n),r.db=n,r._status="open",e&&e(null,r),r.emit("open"),r.emit("ready"),void 0)}),void 0)},r.prototype.close=function(e){var t=this;if(this.isOpen())this._status="closing",this.db.close(function(){t._status="closed",t.emit("closed"),e&&e.apply(null,arguments)}),this.emit("closing"),this.db=null;else{if("closed"==this._status&&e)return i.nextTick(e);"closing"==this._status&&e?this.once("closed",e):this._isOpening()&&this.once("open",function(){t.close(e)})}},r.prototype.isOpen=function(){return"open"==this._status},r.prototype._isOpening=function(){return"opening"==this._status},r.prototype.isClosed=function(){return/^clos/.test(this._status)},r.prototype.get=function(e,t,r){var o,i=this;return r=n(t,r),"function"!=typeof r?S(this,new d("get() requires key and callback arguments")):this._isOpening()||this.isOpen()?(t=v.getOptions(this,t),o=v.encodeKey(e,t),t.asBuffer=v.isValueAsBuffer(t),this.db.get(o,t,function(n,o){if(n)return n=/notfound/i.test(n)?new h("Key not found in database ["+e+"]",n):new d(n),S(i,n,r);if(r){try{o=v.decodeValue(o,t)}catch(a){return r(new g(a))}r(null,o)}}),void 0):S(this,new d("Database is not open"),r)},r.prototype.put=function(e,t,r,o){var i,a,s=this;return o=n(r,o),null===e||void 0===e||null===t||void 0===t?S(this,new f("put() requires key and value arguments"),o):this._isOpening()||this.isOpen()?(r=_(this,r),i=v.encodeKey(e,r),a=v.encodeValue(t,r),this.db.put(i,a,r,function(n){return n?S(s,new f(n),o):(s.emit("put",e,t),o&&o(),void 0)}),void 0):S(this,new f("Database is not open"),o)},r.prototype.del=function(e,t,r){var o,i=this;return r=n(t,r),null===e||void 0===e?S(this,new f("del() requires a key argument"),r):this._isOpening()||this.isOpen()?(t=_(this,t),o=v.encodeKey(e,t),this.db.del(o,t,function(t){return t?S(i,new f(t),r):(i.emit("del",e),r&&r(),void 0)}),void 0):S(this,new f("Database is not open"),r)},r.prototype.batch=function(e,t,r){var o,i,a,s=this;return arguments.length?(r=n(t,r),Array.isArray(e)?this._isOpening()||this.isOpen()?(t=_(this,t),o=t.keyEncoding,i=t.valueEncoding,a=e.map(function(e){if(void 0===e.type||void 0===e.key)return{};var n,r=e.keyEncoding||o,a=e.valueEncoding||e.encoding||i;return"utf8"!=r&&"binary"!=r||"utf8"!=a&&"binary"!=a?(n={type:e.type,key:v.encodeKey(e.key,t,e)},void 0!==e.value&&(n.value=v.encodeValue(e.value,t,e)),n):e}),this.db.batch(a,t,function(t){return t?S(s,new f(t),r):(s.emit("batch",e),r&&r(),void 0)}),void 0):S(this,new f("Database is not open"),r):S(this,new f("batch() requires an array argument"),r)):new w(this)},r.prototype.approximateSize=function(e,t,n){var r,o,i=this;return null===e||void 0===e||null===t||void 0===t||"function"!=typeof n?S(this,new d("approximateSize() requires start, end and callback arguments"),n):(r=v.encodeKey(e,this.options),o=v.encodeKey(t,this.options),this._isOpening()||this.isOpen()?(this.db.approximateSize(r,o,function(e,t){return e?S(i,new p(e),n):(n&&n(null,t),void 0)}),void 0):S(this,new f("Database is not open"),n))},r.prototype.readStream=r.prototype.createReadStream=function(e){var t=this;return e=u(this.options,e),new b(e,this,function(e){return t.db.iterator(e)})},r.prototype.keyStream=r.prototype.createKeyStream=function(e){return this.createReadStream(u(e,{keys:!0,values:!1}))},r.prototype.valueStream=r.prototype.createValueStream=function(e){return this.createReadStream(u(e,{keys:!1,values:!0}))},r.prototype.writeStream=r.prototype.createWriteStream=function(e){return new m(u(e),this)},r.prototype.toString=function(){return"LevelUP"},t.exports=r,t.exports.copy=v.copy,t.exports.destroy=o("destroy"),t.exports.repair=o("repair")},{"./batch":3,"./errors":4,"./read-stream":6,"./util":7,"./write-stream":8,__browserify_process:86,"deferred-leveldown":23,events:83,prr:42,util:98,xtend:50}],6:[function(e,t){function n(e,t,o){if(!(this instanceof n))return new n(e,t,o);r.call(this,{objectMode:!0,highWaterMark:e.highWaterMark}),this._db=t,e=this._options=i(u,e),this._keyEncoding=e.keyEncoding||e.encoding,this._valueEncoding=e.valueEncoding||e.encoding,this._options.start!==void 0&&(this._options.start=s.encodeKey(this._options.start,this._options)),this._options.end!==void 0&&(this._options.end=s.encodeKey(this._options.end,this._options)),"number"!=typeof this._options.limit&&(this._options.limit=-1),this._options.keyAsBuffer=s.isKeyAsBuffer(this._options),this._options.valueAsBuffer=s.isValueAsBuffer(this._options),this._makeData=this._options.keys&&this._options.values?l:this._options.keys?c:this._options.values?f:d;var a=this;this._db.isOpen()?this._iterator=o(this._options):this._db.once("ready",function(){a._iterator=o(a._options)})}var r=e("readable-stream").Readable,o=e("util").inherits,i=e("xtend"),a=e("./errors").EncodingError,s=e("./util"),u={keys:!0,values:!0},l=function(e,t){return{key:s.decodeKey(e,this._options),value:s.decodeValue(t,this._options)}},c=function(e){return s.decodeKey(e,this._options)},f=function(e,t){return s.decodeValue(t,this._options)},d=function(){return null};o(n,r),n.prototype._read=function h(){var e=this;return e._db.isOpen()?(e._destroyed||e._iterator.next(function(t,n,r){if(t||void 0===n&&void 0===r)return t||e._destroyed||e.push(null),e._cleanup(t);try{r=e._makeData(n,r)}catch(o){return e._cleanup(new a(o))}e._destroyed||e.push(r)}),void 0):e._db.once("ready",function(){h.call(e)})},n.prototype._cleanup=function(e){if(!this._destroyed){this._destroyed=!0;var t=this;e&&t.emit("error",e),t._iterator.end(function(){t._iterator=null,t.emit("close")})}},n.prototype.destroy=function(){this._cleanup()},n.prototype.toString=function(){return"LevelUP.ReadStream"},t.exports=n},{"./errors":4,"./util":7,"readable-stream":48,util:98,xtend:50}],7:[function(e,t){function n(e,t,n){e.readStream().pipe(t.writeStream()).on("close",n?n:function(){}).on("error",n?n:function(e){throw e})}function r(e,t){var n="string"==typeof t;return!n&&t&&t.encoding&&!t.valueEncoding&&(t.valueEncoding=t.encoding),g(e&&e.options||{},n?_[t]||_[v.valueEncoding]:t)}function o(){if(p)return p;var t,n=e("../package.json").devDependencies.leveldown,r="Could not locate LevelDOWN, try `npm install leveldown`";try{t=e("leveldown/package").version}catch(o){throw new y(r)}if(!e("semver").satisfies(t,n))throw new y("Installed version of LevelDOWN ("+t+") does not match required version ("+n+")");try{return p=e("leveldown")}catch(o){throw new y(r)}}function i(e,t,n){return"function"==typeof n?n(t):e.emit("error",t)}function a(e,t){var n=t&&t.keyEncoding||e.keyEncoding||"utf8";return w[n]||n}function s(e,t){var n=t&&(t.valueEncoding||t.encoding)||e.valueEncoding||e.encoding||"utf8";return w[n]||n}function u(e,t,n){return a(t,n).encode(e)}function l(e,t,n){return s(t,n).encode(e)}function c(e,t){return a(t).decode(e)}function f(e,t){return s(t).decode(e)}function d(e,t){return s(e,t).buffer}function h(e,t){return a(e,t).buffer}var p,g=e("xtend"),y=e("./errors").LevelUPError,b=e("bops"),m=["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le"],v={createIfMissing:!0,errorIfExists:!1,keyEncoding:"utf8",valueEncoding:"utf8",compression:!0},w=function(){function e(e){return void 0===e||null===e||b.is(e)}var t={};return t.utf8=t["utf-8"]={encode:function(t){return e(t)?t:t+""},decode:function(e){return e},buffer:!1,type:"utf8"},t.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},m.forEach(function(n){t[n]||(t[n]={encode:function(t){return e(t)?t:b.from(t,n)},decode:function(e){return b.from(e,n)},buffer:!0,type:n})}),t}(),_=function(){var e={};return m.forEach(function(t){e[t]={valueEncoding:t}}),e}();t.exports={defaultOptions:v,copy:n,getOptions:r,getLevelDOWN:o,dispatchError:i,encodeKey:u,encodeValue:l,isValueAsBuffer:d,isKeyAsBuffer:h,decodeValue:f,decodeKey:c}},{"../package.json":55,"./errors":4,bops:9,leveldown:82,"leveldown/package":82,semver:82,xtend:50}],8:[function(e,t){function n(e,t){if(!(this instanceof n))return new n(e,t);i.call(this),this._options=s(f,c(t,e)),this._db=t,this._buffer=[],this._status="init",this._end=!1,this.writable=!0,this.readable=!1;var r=this,o=function(){r.writable&&(r._status="ready",r.emit("ready"),r._process())};t.isOpen()?l(o):t.once("ready",o)}var r=e("__browserify_process"),o="undefined"!=typeof self?self:"undefined"!=typeof window?window:{},i=e("stream").Stream,a=e("util").inherits,s=e("xtend"),u=e("concat-stream"),l=o.setImmediate||r.nextTick,c=e("./util").getOptions,f={type:"put"};a(n,i),n.prototype.write=function(e){return this.writable?(this._buffer.push(e),"init"!=this._status&&this._processDelayed(),this._options.maxBufferLength&&this._buffer.length>this._options.maxBufferLength?(this._writeBlock=!0,!1):!0):!1},n.prototype.end=function(e){var t=this;e&&this.write(e),l(function(){t._end=!0,t._process()})},n.prototype.destroy=function(){this.writable=!1,this.end()},n.prototype.destroySoon=function(){this.end()},n.prototype.add=function(e){return e.props?(e.props.Directory?e.pipe(this._db.writeStream(this._options)):(e.props.File||e.File||"File"==e.type)&&this._write(e),!0):void 0},n.prototype._processDelayed=function(){var e=this;l(function(){e._process()})},n.prototype._process=function(){var e,t=this,n=function(e){return t.writable?("closed"!=t._status&&(t._status="ready"),e?(t.writable=!1,t.emit("error",e)):(t._process(),void 0)):void 0};return"ready"!=t._status&&t.writable?(t._buffer.length&&"closed"!=t._status&&t._processDelayed(),void 0):t._buffer.length&&t.writable?(t._status="writing",e=t._buffer,t._buffer=[],t._db.batch(e.map(function(e){return{type:e.type||t._options.type,key:e.key,value:e.value,keyEncoding:e.keyEncoding||t._options.keyEncoding,valueEncoding:e.valueEncoding||e.encoding||t._options.valueEncoding}}),n),t._writeBlock&&(t._writeBlock=!1,t.emit("drain")),void 0):(t._end&&"closed"!=t._status&&(t._status="closed",t.writable=!1,t.emit("close")),void 0)},n.prototype._write=function(e){var t=e.path||e.props.path,n=this;t&&e.pipe(u(function(e,r){return e?(n.writable=!1,n.emit("error",e)):(n._options.fstreamRoot&&t.indexOf(n._options.fstreamRoot)>-1&&(t=t.substr(n._options.fstreamRoot.length+1)),n.write({key:t,value:r}),void 0)}))},n.prototype.toString=function(){return"LevelUP.WriteStream"},t.exports=n},{"./util":7,__browserify_process:86,"concat-stream":22,stream:90,util:98,xtend:50}],9:[function(e,t){function n(e,t){for(var n in e)t[n]=e[n]}var r={};t.exports=r,r.from=e("./from.js"),r.to=e("./to.js"),r.is=e("./is.js"),r.subarray=e("./subarray.js"),r.join=e("./join.js"),r.copy=e("./copy.js"),r.create=e("./create.js"),n(e("./read.js"),r),n(e("./write.js"),r)},{"./copy.js":12,"./create.js":13,"./from.js":14,"./is.js":15,"./join.js":16,"./read.js":18,"./subarray.js":19,"./to.js":20,"./write.js":21}],10:[function(e,t){(function(){"use strict";function e(e){var t,n,o,i,a,s;if(e.length%4>0)throw"Invalid string. Length must be a multiple of 4";for(a=e.indexOf("="),a=a>0?e.length-a:0,s=[],o=a>0?e.length-4:e.length,t=0,n=0;o>t;t+=4,n+=3)i=r.indexOf(e[t])<<18|r.indexOf(e[t+1])<<12|r.indexOf(e[t+2])<<6|r.indexOf(e[t+3]),s.push((16711680&i)>>16),s.push((65280&i)>>8),s.push(255&i);return 2===a?(i=r.indexOf(e[t])<<2|r.indexOf(e[t+1])>>4,s.push(255&i)):1===a&&(i=r.indexOf(e[t])<<10|r.indexOf(e[t+1])<<4|r.indexOf(e[t+2])>>2,s.push(255&i>>8),s.push(255&i)),s}function n(e){function t(e){return r[63&e>>18]+r[63&e>>12]+r[63&e>>6]+r[63&e]}var n,o,i,a=e.length%3,s="";for(n=0,i=e.length-a;i>n;n+=3)o=(e[n]<<16)+(e[n+1]<<8)+e[n+2],s+=t(o);switch(a){case 1:o=e[e.length-1],s+=r[o>>2],s+=r[63&o<<4],s+="==";break;case 2:o=(e[e.length-2]<<8)+e[e.length-1],s+=r[o>>10],s+=r[63&o>>4],s+=r[63&o<<2],s+="="}return s}var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports.toByteArray=e,t.exports.fromByteArray=n})()},{}],11:[function(e,t){function n(e,t,n){t=void 0===t?0:t,n=void 0===n?e.length:n;var u,c,f=0,d=128,h=0;for(a.length=i.length=0;e.length>f;)c=e[f],!h&&c&d?(u=r(c),h+=u,8>u&&(a[a.length]=c&l[6-u])):h?(a[a.length]=c&l[6],--h,!h&&a.length&&(i[i.length]=s(o(a,u)),a.length=0)):i[i.length]=s(c),++f;return a.length&&!h&&(i[i.length]=s(o(a,u)),a.length=0),i.join("")}function r(e){for(var t=0;7>t&&e&u[t];++t);return t}function o(e){for(var t=0,n=0,r=e.length;r>n;++n)t|=e[n]<<6*(r-n-1);return t}t.exports=n;var i=[],a=[],s=String.fromCharCode,u=[64,32,16,8,4,2,1],l=[0,1,3,7,15,31,63,127]},{}],12:[function(e,t){function n(e,t,n,i,a){return n=3>arguments.length?0:n,i=4>arguments.length?0:i,a=5>arguments.length?e.length:a,a!==i&&0!==t.length&&0!==e.length?(a>e.length&&(a=e.length),a-i>t.length-n&&(a=t.length-n+i),e.buffer!==t.buffer?r(e,t,n,i,a):o(e,t,n,i,a)):void 0}function r(e,t,n,r,o){for(var i=o-r+n,a=n,s=r;i>a;++a,++s)t[a]=e[s]}function o(e,t,n,r,o){for(var a=o+r,s=new Uint8Array(i.call(e,r,a)),u=0;a>r;++r,++u)t[n++]=s[u]}t.exports=n;var i=[].slice},{}],13:[function(e,t){t.exports=function(e){return new Uint8Array(e)}},{}],14:[function(e,t){function n(e,t){return Array.isArray(e)?new Uint8Array(e):l[t||"utf8"](e)}function r(e){for(var t=e.length/2,n=new Uint8Array(t),r="",o=0,i=e.length;i>o;++o)r+=e.charAt(o),o>0&&1===o%2&&(n[o>>>1]=parseInt(r,16),r="");return n}function o(e){for(var t,n=[],r=0,o=e.length;o>r;++r)t=a(e,r),t!==!1&&(128>t?n[n.length]=t:i(n,t));return new Uint8Array(n)}function i(e,t){var n,r,o,i,a=t,s=0;do++s;while(a>>>=1);for(n=0|Math.ceil((s-1)/5),r=[0,0,192,224,240,248,252][n],i=[0,0,3,4,5,6,7][n],o|=r,s=7-i+6*(n-1);s;)o|=+!!(t&1<<s)<<7-i,++i,0===i%8&&(e[e.length]=o,o=128,i=2),--s;i&&(o|=+!!(1&t)<<7-i,e[e.length]=o)}function a(e,t){t=t||0;var n,r,o=e.charCodeAt(t);if(o>=55296&&56319>=o){if(n=e.charCodeAt(t+1),r=o,isNaN(n))throw Error("High surrogate not followed by low surrogate");return 1024*(r-55296)+(n-56320)+65536}return o>=56320&&57343>=o?!1:o}function s(e){return new Uint8Array(u.toByteArray(e))}t.exports=n;var u=e("base64-js"),l={hex:r,utf8:o,base64:s}},{"base64-js":10}],15:[function(e,t){t.exports=function(e){return e instanceof Uint8Array}},{}],16:[function(e,t){function n(e,t){if(!e.length)return new Uint8Array(0);for(var n=void 0!==t?t:r(e),o=new Uint8Array(n),i=e[0],a=i.length,s=0,u=0,l=0;n>l;)u!==a?o[l++]=i[u++]:(u=0,++s,i=e[s],a=i&&i.length);return o}function r(e){for(var t=0,n=0,r=e.length;r>n;++n)t+=e[n].byteLength;return t}t.exports=n},{}],17:[function(e,t){function n(e){return new DataView(e.buffer,0)}function r(e){var t=i.get(e.buffer);return t||i.set(e.buffer,t=new DataView(e.buffer,0)),t}var o,i;t.exports=o={},i="undefined"==typeof WeakMap?null:new WeakMap,o.get=i?r:n},{}],18:[function(e,t){function n(e,t){return e[t]}function r(e,t){var n=e[t];return 128>n?n:n-256}function o(e,t){var n=y.get(e);return n.getUint16(t+e.byteOffset,!0)}function i(e,t){var n=y.get(e);return n.getUint32(t+e.byteOffset,!0)}function a(e,t){var n=y.get(e);return n.getInt16(t+e.byteOffset,!0)}function s(e,t){var n=y.get(e);return n.getInt32(t+e.byteOffset,!0)}function u(e,t){var n=y.get(e);return n.getFloat32(t+e.byteOffset,!0)}function l(e,t){var n=y.get(e);return n.getFloat64(t+e.byteOffset,!0)}function c(e,t){var n=y.get(e);return n.getUint16(t+e.byteOffset,!1)}function f(e,t){var n=y.get(e);return n.getUint32(t+e.byteOffset,!1)}function d(e,t){var n=y.get(e);return n.getInt16(t+e.byteOffset,!1)}function h(e,t){var n=y.get(e);return n.getInt32(t+e.byteOffset,!1)}function p(e,t){var n=y.get(e);return n.getFloat32(t+e.byteOffset,!1)}function g(e,t){var n=y.get(e);return n.getFloat64(t+e.byteOffset,!1)}t.exports={readUInt8:n,readInt8:r,readUInt16LE:o,readUInt32LE:i,readInt16LE:a,readInt32LE:s,readFloatLE:u,readDoubleLE:l,readUInt16BE:c,readUInt32BE:f,readInt16BE:d,readInt32BE:h,readFloatBE:p,readDoubleBE:g};var y=e("./mapped.js")},{"./mapped.js":17}],19:[function(e,t){function n(e,t,n){return e.subarray(t||0,n||e.length)}t.exports=n},{}],20:[function(e,t){function n(e,t){return u[t||"utf8"](e)}function r(e){for(var t,n="",r=0,o=e.length;o>r;++r)t=e[r],n+=((240&t)>>>4).toString(16),n+=(15&t).toString(16);return n}function o(e){return s(e)}function i(e){return a.fromByteArray(e)}t.exports=n;var a=e("base64-js"),s=e("to-utf8"),u={hex:r,utf8:o,base64:i}},{"base64-js":10,"to-utf8":11}],21:[function(e,t){function n(e,t,n){return e[n]=t}function r(e,t,n){return e[n]=0>t?t+256:t}function o(e,t,n){var r=y.get(e);return r.setUint16(n+e.byteOffset,t,!0)}function i(e,t,n){var r=y.get(e);return r.setUint32(n+e.byteOffset,t,!0)}function a(e,t,n){var r=y.get(e);return r.setInt16(n+e.byteOffset,t,!0)}function s(e,t,n){var r=y.get(e);return r.setInt32(n+e.byteOffset,t,!0)}function u(e,t,n){var r=y.get(e);return r.setFloat32(n+e.byteOffset,t,!0)}function l(e,t,n){var r=y.get(e);return r.setFloat64(n+e.byteOffset,t,!0)}function c(e,t,n){var r=y.get(e);return r.setUint16(n+e.byteOffset,t,!1)}function f(e,t,n){var r=y.get(e);return r.setUint32(n+e.byteOffset,t,!1)}function d(e,t,n){var r=y.get(e);return r.setInt16(n+e.byteOffset,t,!1)}function h(e,t,n){var r=y.get(e);return r.setInt32(n+e.byteOffset,t,!1)}function p(e,t,n){var r=y.get(e);return r.setFloat32(n+e.byteOffset,t,!1)}function g(e,t,n){var r=y.get(e);return r.setFloat64(n+e.byteOffset,t,!1)}t.exports={writeUInt8:n,writeInt8:r,writeUInt16LE:o,writeUInt32LE:i,writeInt16LE:a,writeInt32LE:s,writeFloatLE:u,writeDoubleLE:l,writeUInt16BE:c,writeUInt32BE:f,writeInt16BE:d,writeInt32BE:h,writeFloatBE:p,writeDoubleBE:g};var y=e("./mapped.js")},{"./mapped.js":17}],22:[function(e,t){function n(e){o.Stream.call(this),this.writable=!0,e&&(this.cb=e),this.body=[],this.on("error",function(e){this.cb&&this.cb(e)})}var r=e("__browserify_Buffer"),o=e("stream"),i=e("util");i.inherits(n,o.Stream),n.prototype.write=function(e){this.body.push(e)},n.prototype.destroy=function(){},n.prototype.arrayConcat=function(e){return 0===e.length?[]:1===e.length?e[0]:e.reduce(function(e,t){return e.concat(t)})},n.prototype.isArray=function(e){return Array.isArray(e)},n.prototype.getBody=function(){return 0!==this.body.length?"string"==typeof this.body[0]?this.body.join(""):this.isArray(this.body[0])?this.arrayConcat(this.body):r!==void 0&&r.isBuffer(this.body[0])?r.concat(this.body):this.body:void 0},n.prototype.end=function(){this.cb&&this.cb(!1,this.getBody())},t.exports=function(e){return new n(e)},t.exports.ConcatStream=n},{__browserify_Buffer:85,stream:90,util:98}],23:[function(e,t){function n(e){a.call(this,"string"==typeof e?e:""),this._db=void 0,this._operations=[]}var r=e("__browserify_process"),o=e("util"),i=e("bops"),a=e("abstract-leveldown").AbstractLevelDOWN;o.inherits(n,a),n.prototype.setDb=function(e){this._db=e,this._operations.forEach(function(t){e[t.method].apply(e,t.args)})},n.prototype._open=function(e,t){return r.nextTick(t)},n.prototype._operation=function(e,t){return this._db?this._db[e].apply(this._db,t):(this._operations.push({method:e,args:t}),void 0)},"put get del batch approximateSize".split(" ").forEach(function(e){n.prototype["_"+e]=function(){this._operation(e,arguments)}}),n.prototype._isBuffer=function(e){return i.is(e)},n.prototype._iterator=function(){throw new TypeError("not implemented")},t.exports=n},{__browserify_process:86,"abstract-leveldown":26,bops:27,util:98}],24:[function(e,t){function n(e){this._db=e,this._operations=[],this._written=!1}var r=e("__browserify_process");n.prototype._checkWritten=function(){if(this._written)throw Error("write() already called on this batch")},n.prototype.put=function(e,t){this._checkWritten();var n=this._db._checkKeyValue(e,"key",this._db._isBuffer);if(n)throw n;if(n=this._db._checkKeyValue(t,"value",this._db._isBuffer))throw n;return this._db._isBuffer(e)||(e+=""),this._db._isBuffer(t)||(t+=""),"function"==typeof this._put?this._put(e,t):this._operations.push({type:"put",key:e,value:t}),this},n.prototype.del=function(e){this._checkWritten();var t=this._db._checkKeyValue(e,"key",this._db._isBuffer);if(t)throw t;return this._db._isBuffer(e)||(e+=""),"function"==typeof this._del?this._del(e):this._operations.push({type:"del",key:e}),this},n.prototype.clear=function(){return this._checkWritten(),this._operations=[],"function"==typeof this._clear&&this._clear(),this},n.prototype.write=function(e,t){if(this._checkWritten(),"function"==typeof e&&(t=e),"function"!=typeof t)throw Error("write() requires a callback argument");return"object"!=typeof e&&(e={}),this._written=!0,"function"==typeof this._write?this._write(t):"function"==typeof this._db._batch?this._db._batch(this._operations,e,t):(r.nextTick(t),void 0)},t.exports=n},{__browserify_process:86}],25:[function(e,t){function n(e){this.db=e,this._ended=!1,this._nexting=!1}var r=e("__browserify_process");n.prototype.next=function(e){var t=this;if("function"!=typeof e)throw Error("next() requires a callback argument");return t._ended?e(Error("cannot call next() after end()")):t._nexting?e(Error("cannot call next() before previous next() has completed")):(t._nexting=!0,"function"==typeof t._next?t._next(function(){t._nexting=!1,e.apply(null,arguments)}):(r.nextTick(function(){t._nexting=!1,e()}),void 0))},n.prototype.end=function(e){if("function"!=typeof e)throw Error("end() requires a callback argument");return this._ended?e(Error("end() already called on iterator")):(this._ended=!0,"function"==typeof this._end?this._end(e):(r.nextTick(e),void 0))},t.exports=n},{__browserify_process:86}],26:[function(e,t){function n(e){if(!arguments.length||void 0===e)throw Error("constructor requires at least a location argument");if("string"!=typeof e)throw Error("constructor requires a location string argument");this.location=e}var r=e("__browserify_process"),o=e("__browserify_Buffer"),i=e("./abstract-iterator"),a=e("./abstract-chained-batch");n.prototype.open=function(e,t){if("function"==typeof e&&(t=e),"function"!=typeof t)throw Error("open() requires a callback argument");return"object"!=typeof e&&(e={}),"function"==typeof this._open?this._open(e,t):(r.nextTick(t),void 0)},n.prototype.close=function(e){if("function"!=typeof e)throw Error("close() requires a callback argument");return"function"==typeof this._close?this._close(e):(r.nextTick(e),void 0)},n.prototype.get=function(e,t,n){var o=this;if("function"==typeof t&&(n=t),"function"!=typeof n)throw Error("get() requires a callback argument");var i=o._checkKeyValue(e,"key",o._isBuffer);return i?n(i):(o._isBuffer(e)||(e+=""),"object"!=typeof t&&(t={}),"function"==typeof o._get?o._get(e,t,n):(r.nextTick(function(){n(Error("NotFound"))}),void 0))},n.prototype.put=function(e,t,n,o){if("function"==typeof n&&(o=n),"function"!=typeof o)throw Error("put() requires a callback argument");var i=this._checkKeyValue(e,"key",this._isBuffer);return i?o(i):(i=this._checkKeyValue(t,"value",this._isBuffer))?o(i):(this._isBuffer(e)||(e+=""),this._isBuffer(t)||r.browser||(t+=""),"object"!=typeof n&&(n={}),"function"==typeof this._put?this._put(e,t,n,o):(r.nextTick(o),void 0))},n.prototype.del=function(e,t,n){if("function"==typeof t&&(n=t),"function"!=typeof n)throw Error("del() requires a callback argument");var o=this._checkKeyValue(e,"key",this._isBuffer);return o?n(o):(this._isBuffer(e)||(e+=""),"object"!=typeof t&&(t={}),"function"==typeof this._del?this._del(e,t,n):(r.nextTick(n),void 0))},n.prototype.batch=function(e,t,n){if(!arguments.length)return this._chainedBatch();if("function"==typeof t&&(n=t),"function"!=typeof n)throw Error("batch(array) requires a callback argument");if(!Array.isArray(e))return n(Error("batch(array) requires an array argument"));"object"!=typeof t&&(t={});for(var o,i,a=0,s=e.length;s>a;a++)if(o=e[a],"object"==typeof o){if(i=this._checkKeyValue(o.type,"type",this._isBuffer))return n(i);if(i=this._checkKeyValue(o.key,"key",this._isBuffer))return n(i);if("put"==o.type&&(i=this._checkKeyValue(o.value,"value",this._isBuffer)))return n(i)}return"function"==typeof this._batch?this._batch(e,t,n):(r.nextTick(n),void 0)},n.prototype.approximateSize=function(e,t,n){if(null==e||null==t||"function"==typeof e||"function"==typeof t)throw Error("approximateSize() requires valid `start`, `end` and `callback` arguments");if("function"!=typeof n)throw Error("approximateSize() requires a callback argument");return this._isBuffer(e)||(e+=""),this._isBuffer(t)||(t+=""),"function"==typeof this._approximateSize?this._approximateSize(e,t,n):(r.nextTick(function(){n(null,0)}),void 0)},n.prototype.iterator=function(e){return"object"!=typeof e&&(e={}),"function"==typeof this._iterator?this._iterator(e):new i(this)},n.prototype._chainedBatch=function(){return new a(this)},n.prototype._isBuffer=function(e){return o.isBuffer(e)},n.prototype._checkKeyValue=function(e,t){if(null===e||void 0===e)return Error(t+" cannot be `null` or `undefined`");if(null===e||void 0===e)return Error(t+" cannot be `null` or `undefined`");if(this._isBuffer(e)){if(0===e.length)return Error(t+" cannot be an empty Buffer")}else if(""==e+"")return Error(t+" cannot be an empty String")},t.exports.AbstractLevelDOWN=n,t.exports.AbstractIterator=i,t.exports.AbstractChainedBatch=a},{"./abstract-chained-batch":24,"./abstract-iterator":25,__browserify_Buffer:85,__browserify_process:86}],27:[function(e,t,n){arguments[4][9][0].apply(n,arguments)},{"./copy.js":30,"./create.js":31,"./from.js":32,"./is.js":33,"./join.js":34,"./read.js":36,"./subarray.js":37,"./to.js":38,"./write.js":39}],28:[function(e,t){t.exports=e(10)},{}],29:[function(e,t){t.exports=e(11)},{}],30:[function(e,t){t.exports=e(12)},{}],31:[function(e,t){t.exports=e(13)},{}],32:[function(e,t){function n(e,t){return Array.isArray(e)?new Uint8Array(e):s[t||"utf8"](e)}function r(e){for(var t=e.length/2,n=new Uint8Array(t),r="",o=0,i=e.length;i>o;++o)r+=e.charAt(o),o>0&&1===o%2&&(n[o>>>1]=parseInt(r,16),r="");return n}function o(e){for(var t,n,r=[],o=0,i=e.length;i>o;++o)if(n=e.charCodeAt(o),128&n){t=encodeURIComponent(e.charAt(o)).substr(1).split("%");for(var a=0,s=t.length;s>a;++a)r[r.length]=parseInt(t[a],16)}else r[r.length]=n;return new Uint8Array(r)}function i(e){return new Uint8Array(a.toByteArray(e))}t.exports=n;var a=e("base64-js"),s={hex:r,utf8:o,base64:i}},{"base64-js":28}],33:[function(e,t){t.exports=e(15)},{}],34:[function(e,t){t.exports=e(16)},{}],35:[function(e,t){t.exports=e(17)},{}],36:[function(e,t){t.exports=e(18)},{"./mapped.js":35}],37:[function(e,t){t.exports=e(19)},{}],38:[function(e,t){t.exports=e(20)},{"base64-js":28,"to-utf8":29}],39:[function(e,t){t.exports=e(21)},{"./mapped.js":35}],40:[function(e,t){function n(e,t,n){i(this,{type:e,name:e,cause:"string"!=typeof t?t:n,message:t&&"string"!=typeof t?t.message:t},"ewr")}function r(e,t){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,arguments.callee),n.call(this,"CustomError",e,t)}function o(e,t,o){var i=function(r,o){n.call(this,t,r,o),"FilesystemError"==t&&(this.code=this.cause.code,this.path=this.cause.path,this.errno=this.cause.errno,this.message=(e.errno[this.cause.errno]?e.errno[this.cause.errno].description:this.cause.message)+(this.cause.path?" ["+this.cause.path+"]":"")),Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,arguments.callee)};return i.prototype=o?new o:new r,i}const i=e("prr");r.prototype=Error(),t.exports=function(e){var t=function(t,n){return o(e,t,n)};return{CustomError:r,FilesystemError:t("FilesystemError"),createError:t}}},{prr:42}],41:[function(e,t){var n=t.exports.all=[{errno:-1,code:"UNKNOWN",description:"unknown error"},{errno:0,code:"OK",description:"success"},{errno:1,code:"EOF",description:"end of file"},{errno:2,code:"EADDRINFO",description:"getaddrinfo error"},{errno:3,code:"EACCES",description:"permission denied"},{errno:4,code:"EAGAIN",description:"resource temporarily unavailable"},{errno:5,code:"EADDRINUSE",description:"address already in use"},{errno:6,code:"EADDRNOTAVAIL",description:"address not available"},{errno:7,code:"EAFNOSUPPORT",description:"address family not supported"},{errno:8,code:"EALREADY",description:"connection already in progress"},{errno:9,code:"EBADF",description:"bad file descriptor"},{errno:10,code:"EBUSY",description:"resource busy or locked"},{errno:11,code:"ECONNABORTED",description:"software caused connection abort"},{errno:12,code:"ECONNREFUSED",description:"connection refused"},{errno:13,code:"ECONNRESET",description:"connection reset by peer"},{errno:14,code:"EDESTADDRREQ",description:"destination address required"},{errno:15,code:"EFAULT",description:"bad address in system call argument"},{errno:16,code:"EHOSTUNREACH",description:"host is unreachable"},{errno:17,code:"EINTR",description:"interrupted system call"},{errno:18,code:"EINVAL",description:"invalid argument"},{errno:19,code:"EISCONN",description:"socket is already connected"},{errno:20,code:"EMFILE",description:"too many open files"},{errno:21,code:"EMSGSIZE",description:"message too long"},{errno:22,code:"ENETDOWN",description:"network is down"},{errno:23,code:"ENETUNREACH",description:"network is unreachable"},{errno:24,code:"ENFILE",description:"file table overflow"},{errno:25,code:"ENOBUFS",description:"no buffer space available"},{errno:26,code:"ENOMEM",description:"not enough memory"},{errno:27,code:"ENOTDIR",description:"not a directory"},{errno:28,code:"EISDIR",description:"illegal operation on a directory"},{errno:29,code:"ENONET",description:"machine is not on the network"},{errno:31,code:"ENOTCONN",description:"socket is not connected"},{errno:32,code:"ENOTSOCK",description:"socket operation on non-socket"},{errno:33,code:"ENOTSUP",description:"operation not supported on socket"},{errno:34,code:"ENOENT",description:"no such file or directory"},{errno:35,code:"ENOSYS",description:"function not implemented"},{errno:36,code:"EPIPE",description:"broken pipe"},{errno:37,code:"EPROTO",description:"protocol error"},{errno:38,code:"EPROTONOSUPPORT",description:"protocol not supported"},{errno:39,code:"EPROTOTYPE",description:"protocol wrong type for socket"},{errno:40,code:"ETIMEDOUT",description:"connection timed out"},{errno:41,code:"ECHARSET",description:"invalid Unicode character"},{errno:42,code:"EAIFAMNOSUPPORT",description:"address family for hostname not supported"},{errno:44,code:"EAISERVICE",description:"servname not supported for ai_socktype"},{errno:45,code:"EAISOCKTYPE",description:"ai_socktype not supported"},{errno:46,code:"ESHUTDOWN",description:"cannot send after transport endpoint shutdown"},{errno:47,code:"EEXIST",description:"file already exists"},{errno:48,code:"ESRCH",description:"no such process"},{errno:49,code:"ENAMETOOLONG",description:"name too long"},{errno:50,code:"EPERM",description:"operation not permitted"},{errno:51,code:"ELOOP",description:"too many symbolic links encountered"},{errno:52,code:"EXDEV",description:"cross-device link not permitted"},{errno:53,code:"ENOTEMPTY",description:"directory not empty"},{errno:54,code:"ENOSPC",description:"no space left on device"},{errno:55,code:"EIO",description:"i/o error"},{errno:56,code:"EROFS",description:"read-only file system"},{errno:57,code:"ENODEV",description:"no such device"},{errno:58,code:"ESPIPE",description:"invalid seek"},{errno:59,code:"ECANCELED",description:"operation canceled"}];
t.exports.errno={"-1":n[0],0:n[1],1:n[2],2:n[3],3:n[4],4:n[5],5:n[6],6:n[7],7:n[8],8:n[9],9:n[10],10:n[11],11:n[12],12:n[13],13:n[14],14:n[15],15:n[16],16:n[17],17:n[18],18:n[19],19:n[20],20:n[21],21:n[22],22:n[23],23:n[24],24:n[25],25:n[26],26:n[27],27:n[28],28:n[29],29:n[30],31:n[31],32:n[32],33:n[33],34:n[34],35:n[35],36:n[36],37:n[37],38:n[38],39:n[39],40:n[40],41:n[41],42:n[42],44:n[43],45:n[44],46:n[45],47:n[46],48:n[47],49:n[48],50:n[49],51:n[50],52:n[51],53:n[52],54:n[53],55:n[54],56:n[55],57:n[56],58:n[57],59:n[58]},t.exports.code={UNKNOWN:n[0],OK:n[1],EOF:n[2],EADDRINFO:n[3],EACCES:n[4],EAGAIN:n[5],EADDRINUSE:n[6],EADDRNOTAVAIL:n[7],EAFNOSUPPORT:n[8],EALREADY:n[9],EBADF:n[10],EBUSY:n[11],ECONNABORTED:n[12],ECONNREFUSED:n[13],ECONNRESET:n[14],EDESTADDRREQ:n[15],EFAULT:n[16],EHOSTUNREACH:n[17],EINTR:n[18],EINVAL:n[19],EISCONN:n[20],EMFILE:n[21],EMSGSIZE:n[22],ENETDOWN:n[23],ENETUNREACH:n[24],ENFILE:n[25],ENOBUFS:n[26],ENOMEM:n[27],ENOTDIR:n[28],EISDIR:n[29],ENONET:n[30],ENOTCONN:n[31],ENOTSOCK:n[32],ENOTSUP:n[33],ENOENT:n[34],ENOSYS:n[35],EPIPE:n[36],EPROTO:n[37],EPROTONOSUPPORT:n[38],EPROTOTYPE:n[39],ETIMEDOUT:n[40],ECHARSET:n[41],EAIFAMNOSUPPORT:n[42],EAISERVICE:n[43],EAISOCKTYPE:n[44],ESHUTDOWN:n[45],EEXIST:n[46],ESRCH:n[47],ENAMETOOLONG:n[48],EPERM:n[49],ELOOP:n[50],EXDEV:n[51],ENOTEMPTY:n[52],ENOSPC:n[53],EIO:n[54],EROFS:n[55],ENODEV:n[56],ESPIPE:n[57],ECANCELED:n[58]},t.exports.custom=e("./custom")(t.exports),t.exports.create=t.exports.custom.createError},{"./custom":40}],42:[function(e,t){(function(e,n,r){t!==void 0&&t.exports?t.exports=r():n[e]=r()})("prr",this,function(){var e="function"==typeof Object.defineProperty?function(e,t,n){return Object.defineProperty(e,t,n),e}:function(e,t,n){return e[t]=n.value,e},t=function(e,t){var n="object"==typeof t,r=!n&&"string"==typeof t,o=function(e){return n?!!t[e]:r?t.indexOf(e[0])>-1:!1};return{enumerable:o("enumerable"),configurable:o("configurable"),writable:o("writable"),value:e}},n=function(n,r,o,i){var a;if(i=t(o,i),"object"==typeof r){for(a in r)Object.hasOwnProperty.call(r,a)&&(i.value=r[a],e(n,a,i));return n}return e(n,r,i)};return n})},{}],43:[function(e,t){function n(e){return this instanceof n?(a.call(this,e),s.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",r),void 0):new n(e)}function r(){this.allowHalfOpen||this._writableState.ended||o.nextTick(this.end.bind(this))}var o=e("__browserify_process");t.exports=n;var i=e("util"),a=e("./_stream_readable"),s=e("./_stream_writable");i.inherits(n,a),Object.keys(s.prototype).forEach(function(e){n.prototype[e]||(n.prototype[e]=s.prototype[e])})},{"./_stream_readable":45,"./_stream_writable":47,__browserify_process:86,util:98}],44:[function(e,t){function n(e){return this instanceof n?(r.call(this,e),void 0):new n(e)}t.exports=n;var r=e("./_stream_transform"),o=e("util");o.inherits(n,r),n.prototype._transform=function(e,t,n){n(null,e)}},{"./_stream_transform":46,util:98}],45:[function(e,t){function n(t){t=t||{};var n=t.highWaterMark;this.highWaterMark=n||0===n?n:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!t.objectMode,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(k||(k=e("string_decoder").StringDecoder),this.decoder=new k(t.encoding),this.encoding=t.encoding)}function r(e){return this instanceof r?(this._readableState=new n(e,this),this.readable=!0,S.call(this),void 0):new r(e)}function o(e,t,n,r,o){var a=u(t,n);if(a)e.emit("error",a);else if(null===n||void 0===n)t.reading=!1,t.ended||l(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!o){var s=Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&o){var s=Error("stream.unshift() after end event");e.emit("error",s)}else!t.decoder||o||r||(n=t.decoder.write(n)),t.length+=t.objectMode?1:n.length,o?t.buffer.unshift(n):(t.reading=!1,t.buffer.push(n)),t.needReadable&&c(e),d(e,t);else o||(t.reading=!1);return i(t)}function i(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function a(e){if(e>=j)e=j;else{e--;for(var t=1;32>t;t<<=1)e|=e>>t;e++}return e}function s(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:isNaN(e)||null===e?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:0>=e?0:(e>t.highWaterMark&&(t.highWaterMark=a(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function u(e,t){var n=null;return _.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||n||(n=new TypeError("Invalid non-string/buffer chunk")),n}function l(e,t){if(t.decoder&&!t.ended){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.length>0?c(e):v(e)}function c(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,t.sync?w.nextTick(function(){f(e)}):f(e))}function f(e){e.emit("readable")}function d(e,t){t.readingMore||(t.readingMore=!0,w.nextTick(function(){h(e,t)}))}function h(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function p(e){return function(){var t=e._readableState;t.awaitDrain--,0===t.awaitDrain&&g(e)}}function g(e){function t(e){var t=e.write(n);!1===t&&r.awaitDrain++}var n,r=e._readableState;for(r.awaitDrain=0;r.pipesCount&&null!==(n=e.read());)if(1===r.pipesCount?t(r.pipes,0,null):r.pipes.forEach(t),e.emit("data",n),r.awaitDrain>0)return;return 0===r.pipesCount?(r.flowing=!1,E.listenerCount(e,"data")>0&&b(e),void 0):(r.ranOut=!0,void 0)}function y(){this._readableState.ranOut&&(this._readableState.ranOut=!1,g(this))}function b(e,t){var n=e._readableState;if(n.flowing)throw Error("Cannot switch to old mode now.");var r=t||!1,o=!1;e.readable=!0,e.pipe=S.prototype.pipe,e.on=e.addListener=S.prototype.on,e.on("readable",function(){o=!0;for(var t;!r&&null!==(t=e.read());)e.emit("data",t);null===t&&(o=!1,e._readableState.needReadable=!0)}),e.pause=function(){r=!0,this.emit("pause")},e.resume=function(){r=!1,o?w.nextTick(function(){e.emit("readable")}):this.read(0),this.emit("resume")},e.emit("readable")}function m(e,t){var n,r=t.buffer,o=t.length,i=!!t.decoder,a=!!t.objectMode;if(0===r.length)return null;if(0===o)n=null;else if(a)n=r.shift();else if(!e||e>=o)n=i?r.join(""):_.concat(r,o),r.length=0;else if(r[0].length>e){var s=r[0];n=s.slice(0,e),r[0]=s.slice(e)}else if(e===r[0].length)n=r.shift();else{n=i?"":new _(e);for(var u=0,l=0,c=r.length;c>l&&e>u;l++){var s=r[0],f=Math.min(e-u,s.length);i?n+=s.slice(0,f):s.copy(n,u,0,f),s.length>f?r[0]=s.slice(f):r.shift(),u+=f}}return n}function v(e){var t=e._readableState;if(t.length>0)throw Error("endReadable called on non-empty stream");!t.endEmitted&&t.calledRead&&(t.ended=!0,w.nextTick(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}var w=e("__browserify_process"),_=e("__browserify_Buffer");t.exports=r,r.ReadableState=n;var E=e("events").EventEmitter;E.listenerCount||(E.listenerCount=function(e,t){return e.listeners(t).length});var k,S=e("stream"),x=e("util");x.inherits(r,S),r.prototype.push=function(e,t){var n=this._readableState;return"string"!=typeof e||n.objectMode||(t=t||n.defaultEncoding,t!==n.encoding&&(e=new _(e,t),t="")),o(this,n,e,t,!1)},r.prototype.unshift=function(e){var t=this._readableState;return o(this,t,e,"",!0)},r.prototype.setEncoding=function(t){k||(k=e("string_decoder").StringDecoder),this._readableState.decoder=new k(t),this._readableState.encoding=t};var j=8388608;r.prototype.read=function(e){var t=this._readableState;t.calledRead=!0;var n=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return c(this),null;if(e=s(e,t),0===e&&t.ended)return 0===t.length&&v(this),null;var r=t.needReadable;t.length-e<=t.highWaterMark&&(r=!0),(t.ended||t.reading)&&(r=!1),r&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),r&&!t.reading&&(e=s(n,t));var o;return o=e>0?m(e,t):null,null===o&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),t.ended&&!t.endEmitted&&0===t.length&&v(this),o},r.prototype._read=function(){this.emit("error",Error("not implemented"))},r.prototype.pipe=function(e,t){function n(e){e===l&&o()}function r(){e.end()}function o(){e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("drain",h),e.removeListener("error",i),e.removeListener("unpipe",n),l.removeListener("end",r),l.removeListener("end",o),(!e._writableState||e._writableState.needDrain)&&h()}function i(t){u(),e.removeListener("error",i),0===E.listenerCount(e,"error")&&e.emit("error",t)}function a(){e.removeListener("finish",s),u()}function s(){e.removeListener("close",a),u()}function u(){l.unpipe(e)}var l=this,c=this._readableState;switch(c.pipesCount){case 0:c.pipes=e;break;case 1:c.pipes=[c.pipes,e];break;default:c.pipes.push(e)}c.pipesCount+=1;var f=(!t||t.end!==!1)&&e!==w.stdout&&e!==w.stderr,d=f?r:o;c.endEmitted?w.nextTick(d):l.once("end",d),e.on("unpipe",n);var h=p(l);return e.on("drain",h),e._events.error?Array.isArray(e._events.error)?e._events.error.unshift(i):e._events.error=[i,e._events.error]:e.on("error",i),e.once("close",a),e.once("finish",s),e.emit("pipe",l),c.flowing||(this.on("readable",y),c.flowing=!0,w.nextTick(function(){g(l)})),e},r.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,this.removeListener("readable",y),t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,this.removeListener("readable",y),t.flowing=!1;for(var o=0;r>o;o++)n[o].emit("unpipe",this);return this}var o=t.pipes.indexOf(e);return-1===o?this:(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},r.prototype.on=function(e,t){var n=S.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||b(this),"readable"===e&&this.readable){var r=this._readableState;r.readableListening||(r.readableListening=!0,r.emittedReadable=!1,r.needReadable=!0,r.reading?r.length&&c(this,r):this.read(0))}return n},r.prototype.addListener=r.prototype.on,r.prototype.resume=function(){b(this),this.read(0),this.emit("resume")},r.prototype.pause=function(){b(this,!0),this.emit("pause")},r.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(o){if(t.decoder&&(o=t.decoder.write(o)),o&&(t.objectMode||o.length)){var i=r.push(o);i||(n=!0,e.pause())}});for(var o in e)"function"==typeof e[o]&&this[o]===void 0&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));var i=["error","close","destroy","pause","resume"];return i.forEach(function(t){e.on(t,r.emit.bind(r,t))}),r._read=function(){n&&(n=!1,e.resume())},r},r._fromList=m},{__browserify_Buffer:85,__browserify_process:86,events:83,stream:90,string_decoder:96,util:98}],46:[function(e,t){function n(e,t){this.afterTransform=function(e,n){return r(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function r(e,t,n){var r=e._transformState;r.transforming=!1;var o=r.writecb;if(!o)return e.emit("error",Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!==n&&void 0!==n&&e.push(n),o&&o(t);var i=e._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&e._read(i.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);a.call(this,e),this._transformState=new n(e,this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,this.once("finish",function(){"function"==typeof this._flush?this._flush(function(e){i(t,e)}):i(t)})}function i(e,t){if(t)return e.emit("error",t);var n=e._writableState;e._readableState;var r=e._transformState;if(n.length)throw Error("calling transform done when ws.length != 0");if(r.transforming)throw Error("calling transform done when still transforming");return e.push(null)}t.exports=o;var a=e("./_stream_duplex"),s=e("util");s.inherits(o,a),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,a.prototype.push.call(this,e,t)},o.prototype._transform=function(){throw Error("not implemented")},o.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},o.prototype._read=function(){var e=this._transformState;e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0}},{"./_stream_duplex":43,util:98}],47:[function(e,t){function n(e,t,n){this.chunk=e,this.encoding=t,this.callback=n}function r(e,t){e=e||{};var n=e.highWaterMark;this.highWaterMark=n||0===n?n:16384,this.objectMode=!!e.objectMode,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var r=e.decodeStrings===!1;this.decodeStrings=!r,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){d(t,e)},this.writecb=null,this.writelen=0,this.buffer=[]}function o(t){return this instanceof o||this instanceof e("./_stream_duplex")?(this._writableState=new r(t,this),this.writable=!0,E.call(this),void 0):new o(t)}function i(e,t,n){var r=Error("write after end");e.emit("error",r),v.nextTick(function(){n(r)})}function a(e,t,n,r){var o=!0;if(!w.isBuffer(n)&&"string"!=typeof n&&null!==n&&void 0!==n&&!t.objectMode){var i=new TypeError("Invalid non-string/buffer chunk");e.emit("error",i),v.nextTick(function(){r(i)}),o=!1}return o}function s(e,t,n){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=new w(t,n)),t}function u(e,t,r,o,i){r=s(t,r,o);var a=t.objectMode?1:r.length;t.length+=a;var u=t.length<t.highWaterMark;return t.needDrain=!u,t.writing?t.buffer.push(new n(r,o,i)):l(e,t,a,r,o,i),u}function l(e,t,n,r,o,i){t.writelen=n,t.writecb=i,t.writing=!0,t.sync=!0,e._write(r,o,t.onwrite),t.sync=!1}function c(e,t,n,r,o){n?v.nextTick(function(){o(r)}):o(r),e.emit("error",r)}function f(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function d(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if(f(n),t)c(e,n,r,t,o);else{var i=y(e,n);i||n.bufferProcessing||!n.buffer.length||g(e,n),r?v.nextTick(function(){h(e,n,i,o)}):h(e,n,i,o)}}function h(e,t,n,r){n||p(e,t),r(),n&&b(e,t)}function p(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function g(e,t){t.bufferProcessing=!0;for(var n=0;t.buffer.length>n;n++){var r=t.buffer[n],o=r.chunk,i=r.encoding,a=r.callback,s=t.objectMode?1:o.length;if(l(e,t,s,o,i,a),t.writing){n++;break}}t.bufferProcessing=!1,t.buffer.length>n?t.buffer=t.buffer.slice(n):t.buffer.length=0}function y(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function b(e,t){var n=y(e,t);return n&&(t.finished=!0,e.emit("finish")),n}function m(e,t,n){t.ending=!0,b(e,t),n&&(t.finished?v.nextTick(n):e.once("finish",n)),t.ended=!0}var v=e("__browserify_process"),w=e("__browserify_Buffer");t.exports=o,o.WritableState=r;var _=e("util");e("assert");var E=e("stream");_.inherits(o,E),o.prototype.pipe=function(){this.emit("error",Error("Cannot pipe. Not readable."))},o.prototype.write=function(e,t,n){var r=this._writableState,o=!1;return"function"==typeof t&&(n=t,t=null),w.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=function(){}),r.ended?i(this,r,n):a(this,r,e,n)&&(o=u(this,r,e,t,n)),o},o.prototype._write=function(e,t,n){n(Error("not implemented"))},o.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),e!==void 0&&null!==e&&this.write(e,t),r.ending||r.finished||m(this,r,n)}},{"./_stream_duplex":43,__browserify_Buffer:85,__browserify_process:86,assert:79,stream:90,util:98}],48:[function(e,t,n){n=t.exports=e("./lib/_stream_readable.js"),n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":43,"./lib/_stream_passthrough.js":44,"./lib/_stream_readable.js":45,"./lib/_stream_transform.js":46,"./lib/_stream_writable.js":47}],49:[function(e,t){function n(e){return null!==e&&("object"==typeof e||"function"==typeof e)}t.exports=n},{}],50:[function(e,t){function n(){for(var e={},t=0;arguments.length>t;t++){var n=arguments[t];if(o(n))for(var i=r(n),a=0;i.length>a;a++){var s=i[a];e[s]=n[s]}}return e}var r=e("object-keys"),o=e("./has-keys");t.exports=n},{"./has-keys":49,"object-keys":52}],51:[function(e,t){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=function(e){var t="function"==typeof e&&!(e instanceof RegExp)||"[object Function]"===r.call(e);return t||"undefined"==typeof window||(t=e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt),t};t.exports=function(e,t){if(!o(t))throw new TypeError("iterator must be a function");var r,i,a="string"==typeof e,s=e.length,u=arguments.length>2?arguments[2]:null;if(s===+s)for(r=0;s>r;r++)null===u?t(a?e.charAt(r):e[r],r,e):t.call(u,a?e.charAt(r):e[r],r,e);else for(i in e)n.call(e,i)&&(null===u?t(e[i],i,e):t.call(u,e[i],i,e))}},{}],52:[function(e,t){t.exports=Object.keys||e("./shim")},{"./shim":54}],53:[function(e,t){var n=Object.prototype.toString;t.exports=function(e){var t=n.call(e),r="[object Arguments]"===t;return r||(r="[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===n.call(e.callee)),r}},{}],54:[function(e,t){(function(){"use strict";var n,r=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=e("./foreach"),a=e("./isArguments"),s=!{toString:null}.propertyIsEnumerable("toString"),u=function(){}.propertyIsEnumerable("prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];n=function(e){var t=null!==e&&"object"==typeof e,n="[object Function]"===o.call(e),c=a(e),f=[];if(!t&&!n&&!c)throw new TypeError("Object.keys called on a non-object");if(c)i(e,function(e){f.push(e)});else{var d,h=u&&n;for(d in e)h&&"prototype"===d||!r.call(e,d)||f.push(d)}if(s){var p=e.constructor,g=p&&p.prototype===e;i(l,function(t){g&&"constructor"===t||!r.call(e,t)||f.push(t)})}return f},t.exports=n})()},{"./foreach":51,"./isArguments":53}],55:[function(e,t){t.exports={name:"levelup",description:"Fast & simple storage - a Node.js-style LevelDB wrapper",version:"0.18.2",contributors:[{name:"Rod Vagg",email:"r@va.gg",url:"https://github.com/rvagg"},{name:"John Chesley",email:"john@chesl.es",url:"https://github.com/chesles/"},{name:"Jake Verbaten",email:"raynos2@gmail.com",url:"https://github.com/raynos"},{name:"Dominic Tarr",email:"dominic.tarr@gmail.com",url:"https://github.com/dominictarr"},{name:"Max Ogden",email:"max@maxogden.com",url:"https://github.com/maxogden"},{name:"Lars-Magnus Skog",email:"lars.magnus.skog@gmail.com",url:"https://github.com/ralphtheninja"},{name:"David Björklund",email:"david.bjorklund@gmail.com",url:"https://github.com/kesla"},{name:"Julian Gruber",email:"julian@juliangruber.com",url:"https://github.com/juliangruber"},{name:"Paolo Fragomeni",email:"paolo@async.ly",url:"https://github.com/hij1nx"},{name:"Anton Whalley",email:"anton.whalley@nearform.com",url:"https://github.com/No9"},{name:"Matteo Collina",email:"matteo.collina@gmail.com",url:"https://github.com/mcollina"},{name:"Pedro Teixeira",email:"pedro.teixeira@gmail.com",url:"https://github.com/pgte"},{name:"James Halliday",email:"mail@substack.net",url:"https://github.com/substack"}],repository:{type:"git",url:"https://github.com/rvagg/node-levelup.git"},homepage:"https://github.com/rvagg/node-levelup",keywords:["leveldb","stream","database","db","store","storage","json"],main:"lib/levelup.js",dependencies:{errno:"~0.1.0","concat-stream":"~0.1.1","readable-stream":"~1.0.17",xtend:"~2.1.1",prr:"~0.0.0",semver:"~2.2.1",bops:"~0.1.0","deferred-leveldown":"~0.1.0"},devDependencies:{leveldown:"~0.10.0",bustermove:"*",tap:"*",referee:"*",rimraf:"*",async:"*",fstream:"*",tar:"*",mkfiletree:"*",readfiletree:"*","slow-stream":">=0.0.4",delayed:"*",boganipsum:"*",du:"*",memdown:"*","msgpack-js":"*"},browser:{leveldown:!1,"leveldown/package":!1,semver:!1},scripts:{test:"tap test/*-test.js --stderr",functionaltests:"node ./test/functional/fstream-test.js && node ./test/functional/binary-data-test.js && node ./test/functional/compat-test.js",alltests:"npm test && npm run-script functionaltests"},license:"MIT",readme:"LevelUP\n=======\n\n![LevelDB Logo](https://twimg0-a.akamaihd.net/profile_images/3360574989/92fc472928b444980408147e5e5db2fa_bigger.png)\n\nFast & simple storage - a Node.js-style LevelDB wrapper\n-------------------------------------------------------\n\n[![Build Status](https://secure.travis-ci.org/rvagg/node-levelup.png)](http://travis-ci.org/rvagg/node-levelup)\n\n[![NPM](https://nodei.co/npm/levelup.png?stars&downloads)](https://nodei.co/npm/levelup/) [![NPM](https://nodei.co/npm-dl/levelup.png)](https://nodei.co/npm/levelup/)\n\n\n * <a href=\"#intro\">Introduction</a>\n * <a href=\"#leveldown\">Relationship to LevelDOWN</a>\n * <a href=\"#platforms\">Tested &amp; supported platforms</a>\n * <a href=\"#basic\">Basic usage</a>\n * <a href=\"#api\">API</a>\n * <a href=\"#events\">Events</a>\n * <a href=\"#json\">JSON data</a>\n * <a href=\"#custom_encodings\">Custom encodings</a>\n * <a href=\"#extending\">Extending LevelUP</a>\n * <a href=\"#multiproc\">Multi-process access</a>\n * <a href=\"#support\">Getting support</a>\n * <a href=\"#contributing\">Contributing</a>\n * <a href=\"#licence\">Licence &amp; copyright</a>\n\n<a name=\"intro\"></a>\nIntroduction\n------------\n\n**[LevelDB](http://code.google.com/p/leveldb/)** is a simple key/value data store built by Google, inspired by BigTable. It's used in Google Chrome and many other products. LevelDB supports arbitrary byte arrays as both keys and values, singular *get*, *put* and *delete* operations, *batched put and delete*, bi-directional iterators and simple compression using the very fast [Snappy](http://code.google.com/p/snappy/) algorithm.\n\n**LevelUP** aims to expose the features of LevelDB in a **Node.js-friendly way**. All standard `Buffer` encoding types are supported, as is a special JSON encoding. LevelDB's iterators are exposed as a Node.js-style **readable stream** a matching **writeable stream** converts writes to *batch* operations.\n\nLevelDB stores entries **sorted lexicographically by keys**. This makes LevelUP's <a href=\"#createReadStream\"><code>ReadStream</code></a> interface a very powerful query mechanism.\n\n**LevelUP** is an **OPEN Open Source Project**, see the <a href=\"#contributing\">Contributing</a> section to find out what this means.\n\n<a name=\"leveldown\"></a>\nRelationship to LevelDOWN\n-------------------------\n\nLevelUP is designed to be backed by **[LevelDOWN](https://github.com/rvagg/node-leveldown/)** which provides a pure C++ binding to LevelDB and can be used as a stand-alone package if required.\n\n**As of version 0.9, LevelUP no longer requires LevelDOWN as a dependency so you must `npm install leveldown` when you install LevelUP.**\n\nLevelDOWN is now optional because LevelUP can be used with alternative backends, such as **[level.js](https://github.com/maxogden/level.js)** in the browser or [MemDOWN](https://github.com/rvagg/node-memdown) for a pure in-memory store.\n\nLevelUP will look for LevelDOWN and throw an error if it can't find it in its Node `require()` path. It will also tell you if the installed version of LevelDOWN is incompatible.\n\n**The [level](https://github.com/level/level) package is available as an alternative installation mechanism.** Install it instead to automatically get both LevelUP & LevelDOWN. It exposes LevelUP on its export (i.e. you can `var leveldb = require('level')`).\n\n\n<a name=\"platforms\"></a>\nTested & supported platforms\n----------------------------\n\n * **Linux**: including ARM platforms such as Raspberry Pi *and Kindle!*\n * **Mac OS**\n * **Solaris**: including Joyent's SmartOS & Nodejitsu\n * **Windows**: Node 0.10 and above only. See installation instructions for *node-gyp's* dependencies [here](https://github.com/TooTallNate/node-gyp#installation), you'll need these (free) components from Microsoft to compile and run any native Node add-on in Windows.\n\n<a name=\"basic\"></a>\nBasic usage\n-----------\n\nFirst you need to install LevelUP!\n\n```sh\n$ npm install levelup leveldown\n```\n\nOr\n\n```sh\n$ npm install level\n```\n\n*(this second option requires you to use LevelUP by calling `var levelup = require('level')`)*\n\n\nAll operations are asynchronous although they don't necessarily require a callback if you don't need to know when the operation was performed.\n\n```js\nvar levelup = require('levelup')\n\n// 1) Create our database, supply location and options.\n// This will create or open the underlying LevelDB store.\nvar db = levelup('./mydb')\n\n// 2) put a key & value\ndb.put('name', 'LevelUP', function (err) {\n if (err) return console.log('Ooops!', err) // some kind of I/O error\n\n // 3) fetch by key\n db.get('name', function (err, value) {\n if (err) return console.log('Ooops!', err) // likely the key was not found\n\n // ta da!\n console.log('name=' + value)\n })\n})\n```\n\n<a name=\"api\"></a>\n## API\n\n * <a href=\"#ctor\"><code><b>levelup()</b></code></a>\n * <a href=\"#open\"><code>db.<b>open()</b></code></a>\n * <a href=\"#close\"><code>db.<b>close()</b></code></a>\n * <a href=\"#put\"><code>db.<b>put()</b></code></a>\n * <a href=\"#get\"><code>db.<b>get()</b></code></a>\n * <a href=\"#del\"><code>db.<b>del()</b></code></a>\n * <a href=\"#batch\"><code>db.<b>batch()</b></code> *(array form)*</a>\n * <a href=\"#batch_chained\"><code>db.<b>batch()</b></code> *(chained form)*</a>\n * <a href=\"#isOpen\"><code>db.<b>isOpen()</b></code></a>\n * <a href=\"#isClosed\"><code>db.<b>isClosed()</b></code></a>\n * <a href=\"#createReadStream\"><code>db.<b>createReadStream()</b></code></a>\n * <a href=\"#createKeyStream\"><code>db.<b>createKeyStream()</b></code></a>\n * <a href=\"#createValueStream\"><code>db.<b>createValueStream()</b></code></a>\n * <a href=\"#createWriteStream\"><code>db.<b>createWriteStream()</b></code></a>\n\n### Special operations exposed by LevelDOWN\n\n * <a href=\"#approximateSize\"><code>db.db.<b>approximateSize()</b></code></a>\n * <a href=\"#getProperty\"><code>db.db.<b>getProperty()</b></code></a>\n * <a href=\"#destroy\"><code><b>leveldown.destroy()</b></code></a>\n * <a href=\"#repair\"><code><b>leveldown.repair()</b></code></a>\n\n\n--------------------------------------------------------\n<a name=\"ctor\"></a>\n### levelup(location[, options[, callback]])\n### levelup(options[, callback ])\n### levelup(db[, callback ])\n<code>levelup()</code> is the main entry point for creating a new LevelUP instance and opening the underlying store with LevelDB.\n\nThis function returns a new instance of LevelUP and will also initiate an <a href=\"#open\"><code>open()</code></a> operation. Opening the database is an asynchronous operation which will trigger your callback if you provide one. The callback should take the form: `function (err, db) {}` where the `db` is the LevelUP instance. If you don't provide a callback, any read & write operations are simply queued internally until the database is fully opened.\n\nThis leads to two alternative ways of managing a new LevelUP instance:\n\n```js\nlevelup(location, options, function (err, db) {\n if (err) throw err\n db.get('foo', function (err, value) {\n if (err) return console.log('foo does not exist')\n console.log('got foo =', value)\n })\n})\n\n// vs the equivalent:\n\nvar db = levelup(location, options) // will throw if an error occurs\ndb.get('foo', function (err, value) {\n if (err) return console.log('foo does not exist')\n console.log('got foo =', value)\n})\n```\n\nThe `location` argument is available as a read-only property on the returned LevelUP instance.\n\nThe `levelup(options, callback)` form (with optional `callback`) is only available where you provide a valid `'db'` property on the options object (see below). Only for back-ends that don't require a `location` argument, such as [MemDOWN](https://github.com/rvagg/memdown).\n\nFor example:\n\n```js\nvar levelup = require('levelup')\nvar memdown = require('memdown')\nvar db = levelup({ db: memdown })\n```\n\nThe `levelup(db, callback)` form (with optional `callback`) is only available where `db` is a factory function, as would be provided as a `'db'` property on an `options` object (see below). Only for back-ends that don't require a `location` argument, such as [MemDOWN](https://github.com/rvagg/memdown).\n\nFor example:\n\n```js\nvar levelup = require('levelup')\nvar memdown = require('memdown')\nvar db = levelup(memdown)\n```\n\n#### `options`\n\n`levelup()` takes an optional options object as its second argument; the following properties are accepted:\n\n* `'createIfMissing'` *(boolean, default: `true`)*: If `true`, will initialise an empty database at the specified location if one doesn't already exist. If `false` and a database doesn't exist you will receive an error in your `open()` callback and your database won't open.\n\n* `'errorIfExists'` *(boolean, default: `false`)*: If `true`, you will receive an error in your `open()` callback if the database exists at the specified location.\n\n* `'compression'` *(boolean, default: `true`)*: If `true`, all *compressible* data will be run through the Snappy compression algorithm before being stored. Snappy is very fast and shouldn't gain much speed by disabling so leave this on unless you have good reason to turn it off.\n\n* `'cacheSize'` *(number, default: `8 * 1024 * 1024`)*: The size (in bytes) of the in-memory [LRU](http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used) cache with frequently used uncompressed block contents. \n\n* `'keyEncoding'` and `'valueEncoding'` *(string, default: `'utf8'`)*: The encoding of the keys and values passed through Node.js' `Buffer` implementation (see [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end)).\n <p><code>'utf8'</code> is the default encoding for both keys and values so you can simply pass in strings and expect strings from your <code>get()</code> operations. You can also pass <code>Buffer</code> objects as keys and/or values and conversion will be performed.</p>\n <p>Supported encodings are: hex, utf8, ascii, binary, base64, ucs2, utf16le.</p>\n <p><code>'json'</code> encoding is also supported, see below.</p>\n\n* `'db'` *(object, default: LevelDOWN)*: LevelUP is backed by [LevelDOWN](https://github.com/rvagg/node-leveldown/) to provide an interface to LevelDB. You can completely replace the use of LevelDOWN by providing a \"factory\" function that will return a LevelDOWN API compatible object given a `location` argument. For further information, see [MemDOWN](https://github.com/rvagg/node-memdown/), a fully LevelDOWN API compatible replacement that uses a memory store rather than LevelDB. Also see [Abstract LevelDOWN](http://github.com/rvagg/node-abstract-leveldown), a partial implementation of the LevelDOWN API that can be used as a base prototype for a LevelDOWN substitute.\n\nAdditionally, each of the main interface methods accept an optional options object that can be used to override `'keyEncoding'` and `'valueEncoding'`.\n\n--------------------------------------------------------\n<a name=\"open\"></a>\n### db.open([callback])\n<code>open()</code> opens the underlying LevelDB store. In general **you should never need to call this method directly** as it's automatically called by <a href=\"#ctor\"><code>levelup()</code></a>.\n\nHowever, it is possible to *reopen* a database after it has been closed with <a href=\"#close\"><code>close()</code></a>, although this is not generally advised.\n\n--------------------------------------------------------\n<a name=\"close\"></a>\n### db.close([callback])\n<code>close()</code> closes the underlying LevelDB store. The callback will receive any error encountered during closing as the first argument.\n\nYou should always clean up your LevelUP instance by calling `close()` when you no longer need it to free up resources. A LevelDB store cannot be opened by multiple instances of LevelDB/LevelUP simultaneously.\n\n--------------------------------------------------------\n<a name=\"put\"></a>\n### db.put(key, value[, options][, callback])\n<code>put()</code> is the primary method for inserting data into the store. Both the `key` and `value` can be arbitrary data objects.\n\nThe callback argument is optional but if you don't provide one and an error occurs then expect the error to be thrown.\n\n#### `options`\n\nEncoding of the `key` and `value` objects will adhere to `'keyEncoding'` and `'valueEncoding'` options provided to <a href=\"#ctor\"><code>levelup()</code></a>, although you can provide alternative encoding settings in the options for `put()` (it's recommended that you stay consistent in your encoding of keys and values in a single store).\n\nIf you provide a `'sync'` value of `true` in your `options` object, LevelDB will perform a synchronous write of the data; although the operation will be asynchronous as far as Node is concerned. Normally, LevelDB passes the data to the operating system for writing and returns immediately, however a synchronous write will use `fsync()` or equivalent so your callback won't be triggered until the data is actually on disk. Synchronous filesystem writes are **significantly** slower than asynchronous writes but if you want to be absolutely sure that the data is flushed then you can use `'sync': true`.\n\n--------------------------------------------------------\n<a name=\"get\"></a>\n### db.get(key[, options][, callback])\n<code>get()</code> is the primary method for fetching data from the store. The `key` can be an arbitrary data object. If it doesn't exist in the store then the callback will receive an error as its first argument. A not-found err object will be of type `'NotFoundError'` so you can `err.type == 'NotFoundError'` or you can perform a truthy test on the property `err.notFound`.\n\n```js\ndb.get('foo', function (err, value) {\n if (err) {\n if (err.notFound) {\n // handle a 'NotFoundError' here\n return\n }\n // I/O or other error, pass it up the callback chain\n return callback(err)\n }\n\n // .. handle `value` here\n})\n```\n\n#### `options`\n\nEncoding of the `key` object will adhere to the `'keyEncoding'` option provided to <a href=\"#ctor\"><code>levelup()</code></a>, although you can provide alternative encoding settings in the options for `get()` (it's recommended that you stay consistent in your encoding of keys and values in a single store).\n\nLevelDB will by default fill the in-memory LRU Cache with data from a call to get. Disabling this is done by setting `fillCache` to `false`. \n\n--------------------------------------------------------\n<a name=\"del\"></a>\n### db.del(key[, options][, callback])\n<code>del()</code> is the primary method for removing data from the store.\n\n#### `options`\n\nEncoding of the `key` object will adhere to the `'keyEncoding'` option provided to <a href=\"#ctor\"><code>levelup()</code></a>, although you can provide alternative encoding settings in the options for `del()` (it's recommended that you stay consistent in your encoding of keys and values in a single store).\n\nA `'sync'` option can also be passed, see <a href=\"#put\"><code>put()</code></a> for details on how this works.\n\n--------------------------------------------------------\n<a name=\"batch\"></a>\n### db.batch(array[, options][, callback]) *(array form)*\n<code>batch()</code> can be used for very fast bulk-write operations (both *put* and *delete*). The `array` argument should contain a list of operations to be executed sequentially, although as a whole they are performed as an atomic operation inside LevelDB. Each operation is contained in an object having the following properties: `type`, `key`, `value`, where the *type* is either `'put'` or `'del'`. In the case of `'del'` the `'value'` property is ignored. Any entries with a `'key'` of `null` or `undefined` will cause an error to be returned on the `callback` and any `'type': 'put'` entry with a `'value'` of `null` or `undefined` will return an error.\n\n```js\nvar ops = [\n { type: 'del', key: 'father' }\n , { type: 'put', key: 'name', value: 'Yuri Irsenovich Kim' }\n , { type: 'put', key: 'dob', value: '16 February 1941' }\n , { type: 'put', key: 'spouse', value: 'Kim Young-sook' }\n , { type: 'put', key: 'occupation', value: 'Clown' }\n]\n\ndb.batch(ops, function (err) {\n if (err) return console.log('Ooops!', err)\n console.log('Great success dear leader!')\n})\n```\n\n#### `options`\n\nSee <a href=\"#put\"><code>put()</code></a> for a discussion on the `options` object. You can overwrite default `'keyEncoding'` and `'valueEncoding'` and also specify the use of `sync` filesystem operations.\n\nIn addition to encoding options for the whole batch you can also overwrite the encoding per operation, like:\n\n```js\nvar ops = [{\n type : 'put'\n , key : new Buffer([1, 2, 3])\n , value : { some: 'json' }\n , keyEncoding : 'binary'\n , valueEncoding : 'json'\n}]\n```\n\n--------------------------------------------------------\n<a name=\"batch_chained\"></a>\n### db.batch() *(chained form)*\n<code>batch()</code>, when called with no arguments will return a `Batch` object which can be used to build, and eventually commit, an atomic LevelDB batch operation. Depending on how it's used, it is possible to obtain greater performance when using the chained form of `batch()` over the array form.\n\n```js\ndb.batch()\n .del('father')\n .put('name', 'Yuri Irsenovich Kim')\n .put('dob', '16 February 1941')\n .put('spouse', 'Kim Young-sook')\n .put('occupation', 'Clown')\n .write(function () { console.log('Done!') })\n```\n\n<b><code>batch.put(key, value[, options])</code></b>\n\nQueue a *put* operation on the current batch, not committed until a `write()` is called on the batch.\n\nThe optional `options` argument can be used to override the default `'keyEncoding'` and/or `'valueEncoding'`.\n\nThis method may `throw` a `WriteError` if there is a problem with your put (such as the `value` being `null` or `undefined`).\n\n<b><code>batch.del(key[, options])</code></b>\n\nQueue a *del* operation on the current batch, not committed until a `write()` is called on the batch.\n\nThe optional `options` argument can be used to override the default `'keyEncoding'`.\n\nThis method may `throw` a `WriteError` if there is a problem with your delete.\n\n<b><code>batch.clear()</code></b>\n\nClear all queued operations on the current batch, any previous operations will be discarded.\n\n<b><code>batch.write([callback])</code></b>\n\nCommit the queued operations for this batch. All operations not *cleared* will be written to the database atomically, that is, they will either all succeed or fail with no partial commits. The optional `callback` will be called when the operation has completed with an *error* argument if an error has occurred; if no `callback` is supplied and an error occurs then this method will `throw` a `WriteError`.\n\n\n--------------------------------------------------------\n<a name=\"isOpen\"></a>\n### db.isOpen()\n\nA LevelUP object can be in one of the following states:\n\n * *\"new\"* - newly created, not opened or closed\n * *\"opening\"* - waiting for the database to be opened\n * *\"open\"* - successfully opened the database, available for use\n * *\"closing\"* - waiting for the database to be closed\n * *\"closed\"* - database has been successfully closed, should not be used\n\n`isOpen()` will return `true` only when the state is \"open\".\n\n--------------------------------------------------------\n<a name=\"isClosed\"></a>\n### db.isClosed()\n\n*See <a href=\"#put\"><code>isOpen()</code></a>*\n\n`isClosed()` will return `true` only when the state is \"closing\" *or* \"closed\", it can be useful for determining if read and write operations are permissible.\n\n--------------------------------------------------------\n<a name=\"createReadStream\"></a>\n### db.createReadStream([options])\n\nYou can obtain a **ReadStream** of the full database by calling the `createReadStream()` method. The resulting stream is a complete Node.js-style [Readable Stream](http://nodejs.org/docs/latest/api/stream.html#stream_readable_stream) where `'data'` events emit objects with `'key'` and `'value'` pairs.\n\n```js\ndb.createReadStream()\n .on('data', function (data) {\n console.log(data.key, '=', data.value)\n })\n .on('error', function (err) {\n console.log('Oh my!', err)\n })\n .on('close', function () {\n console.log('Stream closed')\n })\n .on('end', function () {\n console.log('Stream closed')\n })\n```\n\nThe standard `pause()`, `resume()` and `destroy()` methods are implemented on the ReadStream, as is `pipe()` (see below). `'data'`, '`error'`, `'end'` and `'close'` events are emitted.\n\nAdditionally, you can supply an options object as the first parameter to `createReadStream()` with the following options:\n\n* `'start'`: the key you wish to start the read at. By default it will start at the beginning of the store. Note that the *start* doesn't have to be an actual key that exists, LevelDB will simply find the *next* key, greater than the key you provide.\n\n* `'end'`: the key you wish to end the read on. By default it will continue until the end of the store. Again, the *end* doesn't have to be an actual key as an (inclusive) `<=`-type operation is performed to detect the end. You can also use the `destroy()` method instead of supplying an `'end'` parameter to achieve the same effect.\n\n* `'reverse'` *(boolean, default: `false`)*: a boolean, set to true if you want the stream to go in reverse order. Beware that due to the way LevelDB works, a reverse seek will be slower than a forward seek.\n\n* `'keys'` *(boolean, default: `true`)*: whether the `'data'` event should contain keys. If set to `true` and `'values'` set to `false` then `'data'` events will simply be keys, rather than objects with a `'key'` property. Used internally by the `createKeyStream()` method.\n\n* `'values'` *(boolean, default: `true`)*: whether the `'data'` event should contain values. If set to `true` and `'keys'` set to `false` then `'data'` events will simply be values, rather than objects with a `'value'` property. Used internally by the `createValueStream()` method.\n\n* `'limit'` *(number, default: `-1`)*: limit the number of results collected by this stream. This number represents a *maximum* number of results and may not be reached if you get to the end of the store or your `'end'` value first. A value of `-1` means there is no limit.\n\n* `'fillCache'` *(boolean, default: `false`)*: wheather LevelDB's LRU-cache should be filled with data read.\n\n* `'keyEncoding'` / `'valueEncoding'` *(string)*: the encoding applied to each read piece of data.\n\n--------------------------------------------------------\n<a name=\"createKeyStream\"></a>\n### db.createKeyStream([options])\n\nA **KeyStream** is a **ReadStream** where the `'data'` events are simply the keys from the database so it can be used like a traditional stream rather than an object stream.\n\nYou can obtain a KeyStream either by calling the `createKeyStream()` method on a LevelUP object or by passing passing an options object to `createReadStream()` with `keys` set to `true` and `values` set to `false`.\n\n```js\ndb.createKeyStream()\n .on('data', function (data) {\n console.log('key=', data)\n })\n\n// same as:\ndb.createReadStream({ keys: true, values: false })\n .on('data', function (data) {\n console.log('key=', data)\n })\n```\n\n--------------------------------------------------------\n<a name=\"createValueStream\"></a>\n### db.createValueStream([options])\n\nA **ValueStream** is a **ReadStream** where the `'data'` events are simply the values from the database so it can be used like a traditional stream rather than an object stream.\n\nYou can obtain a ValueStream either by calling the `createValueStream()` method on a LevelUP object or by passing passing an options object to `createReadStream()` with `values` set to `true` and `keys` set to `false`.\n\n```js\ndb.createValueStream()\n .on('data', function (data) {\n console.log('value=', data)\n })\n\n// same as:\ndb.createReadStream({ keys: false, values: true })\n .on('data', function (data) {\n console.log('value=', data)\n })\n```\n\n--------------------------------------------------------\n<a name=\"createWriteStream\"></a>\n### db.createWriteStream([options])\n\nA **WriteStream** can be obtained by calling the `createWriteStream()` method. The resulting stream is a complete Node.js-style [Writable Stream](http://nodejs.org/docs/latest/api/stream.html#stream_writable_stream) which accepts objects with `'key'` and `'value'` pairs on its `write()` method.\n\nThe WriteStream will buffer writes and submit them as a `batch()` operations where writes occur *within the same tick*.\n\n```js\nvar ws = db.createWriteStream()\n\nws.on('error', function (err) {\n console.log('Oh my!', err)\n})\nws.on('close', function () {\n console.log('Stream closed')\n})\n\nws.write({ key: 'name', value: 'Yuri Irsenovich Kim' })\nws.write({ key: 'dob', value: '16 February 1941' })\nws.write({ key: 'spouse', value: 'Kim Young-sook' })\nws.write({ key: 'occupation', value: 'Clown' })\nws.end()\n```\n\nThe standard `write()`, `end()`, `destroy()` and `destroySoon()` methods are implemented on the WriteStream. `'drain'`, `'error'`, `'close'` and `'pipe'` events are emitted.\n\nYou can specify encodings both for the whole stream and individual entries:\n\nTo set the encoding for the whole stream, provide an options object as the first parameter to `createWriteStream()` with `'keyEncoding'` and/or `'valueEncoding'`.\n\nTo set the encoding for an individual entry:\n\n```js\nwriteStream.write({\n key : new Buffer([1, 2, 3])\n , value : { some: 'json' }\n , keyEncoding : 'binary'\n , valueEncoding : 'json'\n})\n```\n\n#### write({ type: 'put' })\n\nIf individual `write()` operations are performed with a `'type'` property of `'del'`, they will be passed on as `'del'` operations to the batch.\n\n```js\nvar ws = db.createWriteStream()\n\nws.on('error', function (err) {\n console.log('Oh my!', err)\n})\nws.on('close', function () {\n console.log('Stream closed')\n})\n\nws.write({ type: 'del', key: 'name' })\nws.write({ type: 'del', key: 'dob' })\nws.write({ type: 'put', key: 'spouse' })\nws.write({ type: 'del', key: 'occupation' })\nws.end()\n```\n\n#### db.createWriteStream({ type: 'del' })\n\nIf the *WriteStream* is created with a `'type'` option of `'del'`, all `write()` operations will be interpreted as `'del'`, unless explicitly specified as `'put'`.\n\n```js\nvar ws = db.createWriteStream({ type: 'del' })\n\nws.on('error', function (err) {\n console.log('Oh my!', err)\n})\nws.on('close', function () {\n console.log('Stream closed')\n})\n\nws.write({ key: 'name' })\nws.write({ key: 'dob' })\n// but it can be overridden\nws.write({ type: 'put', key: 'spouse', value: 'Ri Sol-ju' })\nws.write({ key: 'occupation' })\nws.end()\n```\n\n#### Pipes and Node Stream compatibility\n\nA ReadStream can be piped directly to a WriteStream, allowing for easy copying of an entire database. A simple `copy()` operation is included in LevelUP that performs exactly this on two open databases:\n\n```js\nfunction copy (srcdb, dstdb, callback) {\n srcdb.createReadStream().pipe(dstdb.createWriteStream()).on('close', callback)\n}\n```\n\nThe ReadStream is also [fstream](https://github.com/isaacs/fstream)-compatible which means you should be able to pipe to and from fstreams. So you can serialize and deserialize an entire database to a directory where keys are filenames and values are their contents, or even into a *tar* file using [node-tar](https://github.com/isaacs/node-tar). See the [fstream functional test](https://github.com/rvagg/node-levelup/blob/master/test/functional/fstream-test.js) for an example. *(Note: I'm not really sure there's a great use-case for this but it's a fun example and it helps to harden the stream implementations.)*\n\nKeyStreams and ValueStreams can be treated like standard streams of raw data. If `'keyEncoding'` or `'valueEncoding'` is set to `'binary'` the `'data'` events will simply be standard Node `Buffer` objects straight out of the data store.\n\n\n--------------------------------------------------------\n<a name='approximateSize'></a>\n### db.db.approximateSize(start, end, callback)\n<code>approximateSize()</code> can used to get the approximate number of bytes of file system space used by the range `[start..end)`. The result may not include recently written data.\n\n```js\nvar db = require('level')('./huge.db')\n\ndb.db.approximateSize('a', 'c', function (err, size) {\n if (err) return console.error('Ooops!', err)\n console.log('Approximate size of range is %d', size)\n})\n```\n\n**Note:** `approximateSize()` is available via [LevelDOWN](https://github.com/rvagg/node-leveldown/), which by default is accessible as the `db` property of your LevelUP instance. This is a specific LevelDB operation and is not likely to be available where you replace LevelDOWN with an alternative back-end via the `'db'` option.\n\n\n--------------------------------------------------------\n<a name='getProperty'></a>\n### db.db.getProperty(property)\n<code>getProperty</code> can be used to get internal details from LevelDB. When issued with a valid property string, a readable string will be returned (this method is synchronous).\n\nCurrently, the only valid properties are:\n\n* <b><code>'leveldb.num-files-at-levelN'</code></b>: returns the number of files at level *N*, where N is an integer representing a valid level (e.g. \"0\").\n\n* <b><code>'leveldb.stats'</code></b>: returns a multi-line string describing statistics about LevelDB's internal operation.\n\n* <b><code>'leveldb.sstables'</code></b>: returns a multi-line string describing all of the *sstables* that make up contents of the current database.\n\n\n```js\nvar db = require('level')('./huge.db')\nconsole.log(db.db.getProperty('leveldb.num-files-at-level3'))\n// → '243'\n```\n\n**Note:** `getProperty()` is available via [LevelDOWN](https://github.com/rvagg/node-leveldown/), which by default is accessible as the `db` property of your LevelUP instance. This is a specific LevelDB operation and is not likely to be available where you replace LevelDOWN with an alternative back-end via the `'db'` option.\n\n\n--------------------------------------------------------\n<a name=\"destroy\"></a>\n### leveldown.destroy(location, callback)\n<code>destroy()</code> is used to completely remove an existing LevelDB database directory. You can use this function in place of a full directory *rm* if you want to be sure to only remove LevelDB-related files. If the directory only contains LevelDB files, the directory itself will be removed as well. If there are additional, non-LevelDB files in the directory, those files, and the directory, will be left alone.\n\nThe callback will be called when the destroy operation is complete, with a possible `error` argument.\n\n**Note:** `destroy()` is available via [LevelDOWN](https://github.com/rvagg/node-leveldown/) which you will have to have available to `require()`, e.g.:\n\n```js\nrequire('leveldown').destroy('./huge.db', function () { console.log('done!') })\n```\n\n--------------------------------------------------------\n<a name=\"repair\"></a>\n### leveldown.repair(location, callback)\n<code>repair()</code> can be used to attempt a restoration of a damaged LevelDB store. From the LevelDB documentation:\n\n> If a DB cannot be opened, you may attempt to call this method to resurrect as much of the contents of the database as possible. Some data may be lost, so be careful when calling this function on a database that contains important information.\n\nYou will find information on the *repair* operation in the *LOG* file inside the store directory. \n\nA `repair()` can also be used to perform a compaction of the LevelDB log into table files.\n\nThe callback will be called when the repair operation is complete, with a possible `error` argument.\n\n**Note:** `destroy()` is available via [LevelDOWN](https://github.com/rvagg/node-leveldown/) which you will have to have available to `require()`, e.g.:\n\n```js\nrequire('leveldown').repair('./huge.db', function () { console.log('done!') })\n```\n\n--------------------------------------------------------\n\n<a name=\"events\"></a>\nEvents\n------\n\nLevelUP emits events when the callbacks to the corresponding methods are called.\n\n* `db.emit('put', key, value)` emitted when a new value is `'put'`\n* `db.emit('del', key)` emitted when a value is deleted\n* `db.emit('batch', ary)` emitted when a batch operation has executed\n* `db.emit('ready')` emitted when the database has opened (`'open'` is synonym)\n* `db.emit('closed')` emitted when the database has closed\n* `db.emit('opening')` emitted when the database is opening\n* `db.emit('closing')` emitted when the database is closing\n\nIf you do not pass a callback to an async function, and there is an error, LevelUP will `emit('error', err)` instead.\n\n<a name=\"json\"></a>\nJSON data\n---------\n\nYou specify `'json'` encoding for both keys and/or values, you can then supply JavaScript objects to LevelUP and receive them from all fetch operations, including ReadStreams. LevelUP will automatically *stringify* your objects and store them as *utf8* and parse the strings back into objects before passing them back to you.\n\n<a name=\"custom_encodings\"></a>\nCustom encodings\n----------------\n\nA custom encoding may be provided by passing in an object as an value for `keyEncoding` or `valueEncoding` (wherever accepted), it must have the following properties:\n\n```js\n{\n encode : function (val) { ... }\n , decode : function (val) { ... }\n , buffer : boolean // encode returns a buffer-like and decode accepts a buffer\n , type : String // name of this encoding type.\n}\n```\n\n*\"buffer-like\"* means either a `Buffer` if running in Node, or a Uint8Array if in a browser. Use [bops](https://github.com/chrisdickinson/bops) to get portable binary operations.\n\n<a name=\"extending\"></a>\nExtending LevelUP\n-----------------\n\nA list of <a href=\"https://github.com/rvagg/node-levelup/wiki/Modules\"><b>Node.js LevelDB modules and projects</b></a> can be found in the wiki.\n\nWhen attempting to extend the functionality of LevelUP, it is recommended that you consider using [level-hooks](https://github.com/dominictarr/level-hooks) and/or [level-sublevel](https://github.com/dominictarr/level-sublevel). **level-sublevel** is particularly helpful for keeping additional, extension-specific, data in a LevelDB store. It allows you to partition a LevelUP instance into multiple sub-instances that each correspond to discrete namespaced key ranges.\n\n<a name=\"multiproc\"></a>\nMulti-process access\n--------------------\n\nLevelDB is thread-safe but is **not** suitable for accessing with multiple processes. You should only ever have a LevelDB database open from a single Node.js process. Node.js clusters are made up of multiple processes so a LevelUP instance cannot be shared between them either.\n\nSee the <a href=\"https://github.com/rvagg/node-levelup/wiki/Modules\"><b>wiki</b></a> for some LevelUP extensions, including [multilevel](https://github.com/juliangruber/multilevel), that may help if you require a single data store to be shared across processes.\n\n<a name=\"support\"></a>\nGetting support\n---------------\n\nThere are multiple ways you can find help in using LevelDB in Node.js:\n\n * **IRC:** you'll find an active group of LevelUP users in the **##leveldb** channel on Freenode, including most of the contributors to this project.\n * **Mailing list:** there is an active [Node.js LevelDB](https://groups.google.com/forum/#!forum/node-levelup) Google Group.\n * **GitHub:** you're welcome to open an issue here on this GitHub repository if you have a question.\n\n<a name=\"contributing\"></a>\nContributing\n------------\n\nLevelUP is an **OPEN Open Source Project**. This means that:\n\n> Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.\n\nSee the [CONTRIBUTING.md](https://github.com/rvagg/node-levelup/blob/master/CONTRIBUTING.md) file for more details.\n\n### Contributors\n\nLevelUP is only possible due to the excellent work of the following contributors:\n\n<table><tbody>\n<tr><th align=\"left\">Rod Vagg</th><td><a href=\"https://github.com/rvagg\">GitHub/rvagg</a></td><td><a href=\"http://twitter.com/rvagg\">Twitter/@rvagg</a></td></tr>\n<tr><th align=\"left\">John Chesley</th><td><a href=\"https://github.com/chesles/\">GitHub/chesles</a></td><td><a href=\"http://twitter.com/chesles\">Twitter/@chesles</a></td></tr>\n<tr><th align=\"left\">Jake Verbaten</th><td><a href=\"https://github.com/raynos\">GitHub/raynos</a></td><td><a href=\"http://twitter.com/raynos2\">Twitter/@raynos2</a></td></tr>\n<tr><th align=\"left\">Dominic Tarr</th><td><a href=\"https://github.com/dominictarr\">GitHub/dominictarr</a></td><td><a href=\"http://twitter.com/dominictarr\">Twitter/@dominictarr</a></td></tr>\n<tr><th align=\"left\">Max Ogden</th><td><a href=\"https://github.com/maxogden\">GitHub/maxogden</a></td><td><a href=\"http://twitter.com/maxogden\">Twitter/@maxogden</a></td></tr>\n<tr><th align=\"left\">Lars-Magnus Skog</th><td><a href=\"https://github.com/ralphtheninja\">GitHub/ralphtheninja</a></td><td><a href=\"http://twitter.com/ralphtheninja\">Twitter/@ralphtheninja</a></td></tr>\n<tr><th align=\"left\">David Björklund</th><td><a href=\"https://github.com/kesla\">GitHub/kesla</a></td><td><a href=\"http://twitter.com/david_bjorklund\">Twitter/@david_bjorklund</a></td></tr>\n<tr><th align=\"left\">Julian Gruber</th><td><a href=\"https://github.com/juliangruber\">GitHub/juliangruber</a></td><td><a href=\"http://twitter.com/juliangruber\">Twitter/@juliangruber</a></td></tr>\n<tr><th align=\"left\">Paolo Fragomeni</th><td><a href=\"https://github.com/hij1nx\">GitHub/hij1nx</a></td><td><a href=\"http://twitter.com/hij1nx\">Twitter/@hij1nx</a></td></tr>\n<tr><th align=\"left\">Anton Whalley</th><td><a href=\"https://github.com/No9\">GitHub/No9</a></td><td><a href=\"https://twitter.com/antonwhalley\">Twitter/@antonwhalley</a></td></tr>\n<tr><th align=\"left\">Matteo Collina</th><td><a href=\"https://github.com/mcollina\">GitHub/mcollina</a></td><td><a href=\"https://twitter.com/matteocollina\">Twitter/@matteocollina</a></td></tr>\n<tr><th align=\"left\">Pedro Teixeira</th><td><a href=\"https://github.com/pgte\">GitHub/pgte</a></td><td><a href=\"https://twitter.com/pgte\">Twitter/@pgte</a></td></tr>\n<tr><th align=\"left\">James Halliday</th><td><a href=\"https://github.com/substack\">GitHub/substack</a></td><td><a href=\"https://twitter.com/substack\">Twitter/@substack</a></td></tr>\n</tbody></table>\n\n### Windows\n\nA large portion of the Windows support comes from code by [Krzysztof Kowalczyk](http://blog.kowalczyk.info/) [@kjk](https://twitter.com/kjk), see his Windows LevelDB port [here](http://code.google.com/r/kkowalczyk-leveldb/). If you're using LevelUP on Windows, you should give him your thanks!\n\n\n<a name=\"licence\"></a>\nLicence &amp; copyright\n-------------------\n\nCopyright (c) 2012-2013 LevelUP contributors (listed above).\n\nLevelUP is licensed under an MIT +no-false-attribs license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.\n\n=======\n*LevelUP builds on the excellent work of the LevelDB and Snappy teams from Google and additional contributors. LevelDB and Snappy are both issued under the [New BSD Licence](http://opensource.org/licenses/BSD-3-Clause).*\n",readmeFilename:"README.md",bugs:{url:"https://github.com/rvagg/node-levelup/issues"},_id:"levelup@0.18.2",_from:"levelup@~0.18.1"}
},{}],56:[function(e,t){function n(e){return"string"==typeof e?e:JSON.stringify(e)}function r(e,t){c.call(this,e),this._reverse=t.reverse,this._limit=t.limit,this._count=0,this._end=t.end,this._start=t.start,this._gt=t.gt,this._gte=t.gte,this._lt=t.lt,this._lte=t.lte;var n;if(this._start){for(n=0;this.db._keys.length>n;n++)if(this.db._keys[n]>=this._start){this._pos=n,this.db._keys[n]!=this._start?this._reverse&&--this._pos:t.exclusiveStart&&(this._pos+=this._reverse?-1:1);break}null!=this._pos||this._reverse||(this._pos=-1)}t.start&&this._pos||(this._pos=this._reverse?this.db._keys.length-1:0)}function o(e){return this instanceof o?(l.call(this,"string"==typeof e?e:""),this._store={},this._keys=[],void 0):new o(e)}var i=e("__browserify_process"),a="undefined"!=typeof self?self:"undefined"!=typeof window?window:{},s=e("util"),u=e("bops"),l=e("abstract-leveldown").AbstractLevelDOWN,c=e("abstract-leveldown").AbstractIterator,f=function(){},d=a.setImmediate||i.nextTick;s.inherits(r,c),r.prototype._next=function(e){var t,r=this,o=r.db._keys[r._pos];return r._pos>=r.db._keys.length||0>r._pos?d(e):r._end&&(r._reverse?r._end>o:o>r._end)?d(e):r._limit&&r._limit>0&&r._count++>=r._limit?d(e):this._lt&&o>=this._lt||this._lte&&o>this._lte||this._gt&&this._gt>=o||this._gte&&this._gte>o?d(e):(t=r.db._store[n(o)],r._pos+=r._reverse?-1:1,d(function(){e(null,o,t)}),void 0)},s.inherits(o,l),o.prototype._open=function(e,t){var n=this;d(function(){t(null,n)})},o.prototype._put=function(e,t,r,o){-1==this._keys.indexOf(e)&&(this._keys.push(e),this._keys.sort()),e=n(e),this._store[e]=t,d(o)},o.prototype._get=function(e,t,r){var o=this._store[n(e)];return void 0===o?d(function(){r(Error("NotFound"))}):(t.asBuffer===!1||u.is(o)||(o=u.from(o+"")),d(function(){r(null,o)}),void 0)},o.prototype._del=function(e,t,r){for(var o=0;this._keys.length>o;o++)if(this._keys[o]==e){this._keys.splice(o,1);break}delete this._store[n(e)],d(r)},o.prototype._batch=function(e,t,n){var r,o,i,a=0;if(Array.isArray(e))for(;e.length>a;a++)if(e[a]){if(o=u.is(e[a].key)?e[a].key:e[a].key+"",r=this._checkKeyValue(o,"key"))return d(function(){n(r)});if("del"===e[a].type)this._del(e[a].key,t,f);else if("put"===e[a].type){if(i=u.is(e[a].value)?e[a].value:e[a].value+"",r=this._checkKeyValue(i,"value"))return d(function(){n(r)});this._put(o,i,t,f)}}d(n)},o.prototype._iterator=function(e){return new r(this,e)},o.prototype._isBuffer=function(e){return u.is(e)},t.exports=o},{__browserify_process:86,"abstract-leveldown":59,bops:66,util:98}],57:[function(e,t){t.exports=e(24)},{__browserify_process:86}],58:[function(e,t){t.exports=e(25)},{__browserify_process:86}],59:[function(e,t){function n(e){if(!arguments.length||void 0===e)throw Error("constructor requires at least a location argument");if("string"!=typeof e)throw Error("constructor requires a location string argument");this.location=e}var r=e("__browserify_process"),o=e("__browserify_Buffer"),i=e("xtend"),a=e("./abstract-iterator"),s=e("./abstract-chained-batch");n.prototype.open=function(e,t){if("function"==typeof e&&(t=e),"function"!=typeof t)throw Error("open() requires a callback argument");return"object"!=typeof e&&(e={}),"function"==typeof this._open?this._open(e,t):(r.nextTick(t),void 0)},n.prototype.close=function(e){if("function"!=typeof e)throw Error("close() requires a callback argument");return"function"==typeof this._close?this._close(e):(r.nextTick(e),void 0)},n.prototype.get=function(e,t,n){var o;if("function"==typeof t&&(n=t),"function"!=typeof n)throw Error("get() requires a callback argument");return(o=this._checkKeyValue(e,"key",this._isBuffer))?n(o):(this._isBuffer(e)||(e+=""),"object"!=typeof t&&(t={}),"function"==typeof this._get?this._get(e,t,n):(r.nextTick(function(){n(Error("NotFound"))}),void 0))},n.prototype.put=function(e,t,n,o){var i;if("function"==typeof n&&(o=n),"function"!=typeof o)throw Error("put() requires a callback argument");return(i=this._checkKeyValue(e,"key",this._isBuffer))?o(i):(i=this._checkKeyValue(t,"value",this._isBuffer))?o(i):(this._isBuffer(e)||(e+=""),this._isBuffer(t)||r.browser||(t+=""),"object"!=typeof n&&(n={}),"function"==typeof this._put?this._put(e,t,n,o):(r.nextTick(o),void 0))},n.prototype.del=function(e,t,n){var o;if("function"==typeof t&&(n=t),"function"!=typeof n)throw Error("del() requires a callback argument");return(o=this._checkKeyValue(e,"key",this._isBuffer))?n(o):(this._isBuffer(e)||(e+=""),"object"!=typeof t&&(t={}),"function"==typeof this._del?this._del(e,t,n):(r.nextTick(n),void 0))},n.prototype.batch=function(e,t,n){if(!arguments.length)return this._chainedBatch();if("function"==typeof t&&(n=t),"function"!=typeof n)throw Error("batch(array) requires a callback argument");if(!Array.isArray(e))return n(Error("batch(array) requires an array argument"));"object"!=typeof t&&(t={});for(var o,i,a=0,s=e.length;s>a;a++)if(o=e[a],"object"==typeof o){if(i=this._checkKeyValue(o.type,"type",this._isBuffer))return n(i);if(i=this._checkKeyValue(o.key,"key",this._isBuffer))return n(i);if("put"==o.type&&(i=this._checkKeyValue(o.value,"value",this._isBuffer)))return n(i)}return"function"==typeof this._batch?this._batch(e,t,n):(r.nextTick(n),void 0)},n.prototype.approximateSize=function(e,t,n){if(null==e||null==t||"function"==typeof e||"function"==typeof t)throw Error("approximateSize() requires valid `start`, `end` and `callback` arguments");if("function"!=typeof n)throw Error("approximateSize() requires a callback argument");return this._isBuffer(e)||(e+=""),this._isBuffer(t)||(t+=""),"function"==typeof this._approximateSize?this._approximateSize(e,t,n):(r.nextTick(function(){n(null,0)}),void 0)},n.prototype._setupIteratorOptions=function(e){var t=this;return e=i(e),["start","end","gt","gte","lt","lte"].forEach(function(n){e[n]&&t._isBuffer(e[n])&&0===e[n].length&&delete e[n]}),e.reverse=!!e.reverse,e.reverse&&e.lt&&(e.start=e.lt),e.reverse&&e.lte&&(e.start=e.lte),!e.reverse&&e.gt&&(e.start=e.gt),!e.reverse&&e.gte&&(e.start=e.gte),(e.reverse&&e.lt&&!e.lte||!e.reverse&&e.gt&&!e.gte)&&(e.exclusiveStart=!0),e},n.prototype.iterator=function(e){return"object"!=typeof e&&(e={}),e=this._setupIteratorOptions(e),"function"==typeof this._iterator?this._iterator(e):new a(this)},n.prototype._chainedBatch=function(){return new s(this)},n.prototype._isBuffer=function(e){return o.isBuffer(e)},n.prototype._checkKeyValue=function(e,t){if(null===e||void 0===e)return Error(t+" cannot be `null` or `undefined`");if(null===e||void 0===e)return Error(t+" cannot be `null` or `undefined`");if(this._isBuffer(e)){if(0===e.length)return Error(t+" cannot be an empty Buffer")}else if(""==e+"")return Error(t+" cannot be an empty String")},t.exports.AbstractLevelDOWN=n,t.exports.AbstractIterator=a,t.exports.AbstractChainedBatch=s},{"./abstract-chained-batch":57,"./abstract-iterator":58,__browserify_Buffer:85,__browserify_process:86,xtend:61}],60:[function(e,t){t.exports=e(49)},{}],61:[function(e,t,n){arguments[4][50][0].apply(n,arguments)},{"./has-keys":60,"object-keys":63}],62:[function(e,t){t.exports=e(51)},{}],63:[function(e,t,n){arguments[4][52][0].apply(n,arguments)},{"./shim":65}],64:[function(e,t){t.exports=e(53)},{}],65:[function(e,t){t.exports=e(54)},{"./foreach":62,"./isArguments":64}],66:[function(e,t,n){arguments[4][9][0].apply(n,arguments)},{"./copy.js":69,"./create.js":70,"./from.js":71,"./is.js":72,"./join.js":73,"./read.js":75,"./subarray.js":76,"./to.js":77,"./write.js":78}],67:[function(e,t){t.exports=e(10)},{}],68:[function(e,t){t.exports=e(11)},{}],69:[function(e,t){t.exports=e(12)},{}],70:[function(e,t){t.exports=e(13)},{}],71:[function(e,t){t.exports=e(14)},{"base64-js":67}],72:[function(e,t){t.exports=e(15)},{}],73:[function(e,t){t.exports=e(16)},{}],74:[function(e,t){t.exports=e(17)},{}],75:[function(e,t){t.exports=e(18)},{"./mapped.js":74}],76:[function(e,t){t.exports=e(19)},{}],77:[function(e,t){t.exports=e(20)},{"base64-js":67,"to-utf8":68}],78:[function(e,t){t.exports=e(21)},{"./mapped.js":74}],79:[function(e,t){function n(e,t){return d.isUndefined(t)?""+t:!d.isNumber(t)||!isNaN(t)&&isFinite(t)?d.isFunction(t)||d.isRegExp(t)?""+t:t:""+t}function r(e,t){return d.isString(e)?t>e.length?e:e.slice(0,t):e}function o(e){return r(JSON.stringify(e.actual,n),128)+" "+e.operator+" "+r(JSON.stringify(e.expected,n),128)}function i(e,t,n,r,o){throw new p.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:o})}function a(e,t){e||i(e,!0,t,"==",p.ok)}function s(e,t){if(e===t)return!0;if(d.isBuffer(e)&&d.isBuffer(t)){if(e.length!=t.length)return!1;for(var n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0}return d.isDate(e)&&d.isDate(t)?e.getTime()===t.getTime():d.isRegExp(e)&&d.isRegExp(t)?e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase:d.isObject(e)||d.isObject(t)?l(e,t):e==t}function u(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function l(e,t){if(d.isNullOrUndefined(e)||d.isNullOrUndefined(t))return!1;if(e.prototype!==t.prototype)return!1;if(u(e))return u(t)?(e=h.call(e),t=h.call(t),s(e,t)):!1;try{var n,r,o=Object.keys(e),i=Object.keys(t)}catch(a){return!1}if(o.length!=i.length)return!1;for(o.sort(),i.sort(),r=o.length-1;r>=0;r--)if(o[r]!=i[r])return!1;for(r=o.length-1;r>=0;r--)if(n=o[r],!s(e[n],t[n]))return!1;return!0}function c(e,t){return e&&t?"[object RegExp]"==Object.prototype.toString.call(t)?t.test(e):e instanceof t?!0:t.call({},e)===!0?!0:!1:!1}function f(e,t,n,r){var o;d.isString(n)&&(r=n,n=null);try{t()}catch(a){o=a}if(r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!o&&i(o,n,"Missing expected exception"+r),!e&&c(o,n)&&i(o,n,"Got unwanted exception"+r),e&&o&&n&&!c(o,n)||!e&&o)throw o}var d=e("./node_modules/util"),h=Array.prototype.slice,p=t.exports=a;p.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=o(this),this.generatedMessage=!0);var t=e.stackStartFunction||i;Error.captureStackTrace&&Error.captureStackTrace(this,t)},d.inherits(p.AssertionError,Error),p.fail=i,p.ok=a,p.equal=function(e,t,n){e!=t&&i(e,t,n,"==",p.equal)},p.notEqual=function(e,t,n){e==t&&i(e,t,n,"!=",p.notEqual)},p.deepEqual=function(e,t,n){s(e,t)||i(e,t,n,"deepEqual",p.deepEqual)},p.notDeepEqual=function(e,t,n){s(e,t)&&i(e,t,n,"notDeepEqual",p.notDeepEqual)},p.strictEqual=function(e,t,n){e!==t&&i(e,t,n,"===",p.strictEqual)},p.notStrictEqual=function(e,t,n){e===t&&i(e,t,n,"!==",p.notStrictEqual)},p.throws=function(){f.apply(this,[!0].concat(h.call(arguments)))},p.doesNotThrow=function(){f.apply(this,[!1].concat(h.call(arguments)))},p.ifError=function(e){if(e)throw e}},{"./node_modules/util":81}],80:[function(e,t){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.binarySlice}},{}],81:[function(e,t,n){function r(e,t){var r={seen:[],stylize:i};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),p(t)?r.showHidden=t:t&&n._extend(r,t),w(r.showHidden)&&(r.showHidden=!1),w(r.depth)&&(r.depth=2),w(r.colors)&&(r.colors=!1),w(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),s(r,e,r.depth)}function o(e,t){var n=r.styles[t];return n?"["+r.colors[n][0]+"m"+e+"["+r.colors[n][1]+"m":e}function i(e){return e}function a(e){var t={};return e.forEach(function(e){t[e]=!0}),t}function s(e,t,r){if(e.customInspect&&t&&x(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var o=t.inspect(r,e);return m(o)||(o=s(e,o,r)),o}var i=u(e,t);if(i)return i;var p=Object.keys(t),g=a(p);if(e.showHidden&&(p=Object.getOwnPropertyNames(t)),0===p.length){if(x(t)){var y=t.name?": "+t.name:"";return e.stylize("[Function"+y+"]","special")}if(_(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(k(t))return e.stylize(Date.prototype.toString.call(t),"date");if(S(t))return l(t)}var b="",v=!1,w=["{","}"];if(h(t)&&(v=!0,w=["[","]"]),x(t)){var E=t.name?": "+t.name:"";b=" [Function"+E+"]"}if(_(t)&&(b=" "+RegExp.prototype.toString.call(t)),k(t)&&(b=" "+Date.prototype.toUTCString.call(t)),S(t)&&(b=" "+l(t)),0===p.length&&(!v||0==t.length))return w[0]+b+w[1];if(0>r)return _(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var j;return j=v?c(e,t,r,g,p):p.map(function(n){return f(e,t,r,g,n,v)}),e.seen.pop(),d(j,b,w)}function u(e,t){if(w(t))return e.stylize("undefined","undefined");if(m(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return b(t)?e.stylize(""+t,"number"):p(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function c(e,t,n,r,o){for(var i=[],a=0,s=t.length;s>a;++a)I(t,a+"")?i.push(f(e,t,n,r,a+"",!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(f(e,t,n,r,o,!0))}),i}function f(e,t,n,r,o,i){var a,u,l;if(l=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},l.get?u=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(u=e.stylize("[Setter]","special")),I(r,o)||(a="["+o+"]"),u||(0>e.seen.indexOf(l.value)?(u=g(n)?s(e,l.value,null):s(e,l.value,n-1),u.indexOf("\n")>-1&&(u=i?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n"))):u=e.stylize("[Circular]","special")),w(a)){if(i&&o.match(/^\d+$/))return u;a=JSON.stringify(""+o),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+u}function d(e,t,n){var r=0,o=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function h(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function g(e){return null===e}function y(e){return null==e}function b(e){return"number"==typeof e}function m(e){return"string"==typeof e}function v(e){return"symbol"==typeof e}function w(e){return void 0===e}function _(e){return E(e)&&"[object RegExp]"===O(e)}function E(e){return"object"==typeof e&&null!==e}function k(e){return E(e)&&"[object Date]"===O(e)}function S(e){return E(e)&&("[object Error]"===O(e)||e instanceof Error)}function x(e){return"function"==typeof e}function j(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||e===void 0}function O(e){return Object.prototype.toString.call(e)}function L(e){return 10>e?"0"+e.toString(10):e.toString(10)}function B(){var e=new Date,t=[L(e.getHours()),L(e.getMinutes()),L(e.getSeconds())].join(":");return[e.getDate(),R[e.getMonth()],t].join(" ")}function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var T=e("__browserify_process"),D="undefined"!=typeof self?self:"undefined"!=typeof window?window:{},N=/%[sdj%]/g;n.format=function(e){if(!m(e)){for(var t=[],n=0;arguments.length>n;n++)t.push(r(arguments[n]));return t.join(" ")}for(var n=1,o=arguments,i=o.length,a=(e+"").replace(N,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return o[n++]+"";case"%d":return Number(o[n++]);case"%j":try{return JSON.stringify(o[n++])}catch(t){return"[Circular]"}default:return e}}),s=o[n];i>n;s=o[++n])a+=g(s)||!E(s)?" "+s:" "+r(s);return a},n.deprecate=function(e,t){function r(){if(!o){if(T.throwDeprecation)throw Error(t);T.traceDeprecation?console.trace(t):console.error(t),o=!0}return e.apply(this,arguments)}if(w(D.process))return function(){return n.deprecate(e,t).apply(this,arguments)};if(T.noDeprecation===!0)return e;var o=!1;return r};var A,U={};n.debuglog=function(e){if(w(A)&&(A=T.env.NODE_DEBUG||""),e=e.toUpperCase(),!U[e])if(RegExp("\\b"+e+"\\b","i").test(A)){var t=T.pid;U[e]=function(){var r=n.format.apply(n,arguments);console.error("%s %d: %s",e,t,r)}}else U[e]=function(){};return U[e]},n.inspect=r,r.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},r.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=h,n.isBoolean=p,n.isNull=g,n.isNullOrUndefined=y,n.isNumber=b,n.isString=m,n.isSymbol=v,n.isUndefined=w,n.isRegExp=_,n.isObject=E,n.isDate=k,n.isError=S,n.isFunction=x,n.isPrimitive=j,n.isBuffer=e("./support/isBuffer");var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",B(),n.format.apply(n,arguments))},n.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},n._extend=function(e,t){if(!t||!E(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}},{"./support/isBuffer":80,__browserify_process:86}],82:[function(){},{}],83:[function(e,t,n){var r=e("__browserify_process");r.EventEmitter||(r.EventEmitter=function(){});var o=n.EventEmitter=r.EventEmitter,i="function"==typeof Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=10;o.prototype.setMaxListeners=function(e){this._events||(this._events={}),this._events.maxListeners=e},o.prototype.emit=function(e){if("error"===e&&(!this._events||!this._events.error||i(this._events.error)&&!this._events.error.length))throw arguments[1]instanceof Error?arguments[1]:Error("Uncaught, unspecified 'error' event.");if(!this._events)return!1;var t=this._events[e];if(!t)return!1;if("function"==typeof t){switch(arguments.length){case 1:t.call(this);break;case 2:t.call(this,arguments[1]);break;case 3:t.call(this,arguments[1],arguments[2]);break;default:var n=Array.prototype.slice.call(arguments,1);t.apply(this,n)}return!0}if(i(t)){for(var n=Array.prototype.slice.call(arguments,1),r=t.slice(),o=0,a=r.length;a>o;o++)r[o].apply(this,n);return!0}return!1},o.prototype.addListener=function(e,t){if("function"!=typeof t)throw Error("addListener only takes instances of Function");if(this._events||(this._events={}),this.emit("newListener",e,t),this._events[e])if(i(this._events[e])){if(!this._events[e].warned){var n;n=void 0!==this._events.maxListeners?this._events.maxListeners:a,n&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),console.trace())}this._events[e].push(t)}else this._events[e]=[this._events[e],t];else this._events[e]=t;return this},o.prototype.on=o.prototype.addListener,o.prototype.once=function(e,t){var n=this;return n.on(e,function r(){n.removeListener(e,r),t.apply(this,arguments)}),this},o.prototype.removeListener=function(e,t){if("function"!=typeof t)throw Error("removeListener only takes instances of Function");if(!this._events||!this._events[e])return this;var n=this._events[e];if(i(n)){var r=n.indexOf(t);if(0>r)return this;n.splice(r,1),0==n.length&&delete this._events[e]}else this._events[e]===t&&delete this._events[e];return this},o.prototype.removeAllListeners=function(e){return e&&this._events&&this._events[e]&&(this._events[e]=null),this},o.prototype.listeners=function(e){return this._events||(this._events={}),this._events[e]||(this._events[e]=[]),i(this._events[e])||(this._events[e]=[this._events[e]]),this._events[e]}},{__browserify_process:86}],84:[function(e,t){t.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],85:[function(e,t){e=function n(t,r,o){function i(s,u){if(!r[s]){if(!t[s]){var l="function"==typeof e&&e;if(!u&&l)return l(s,!0);if(a)return a(s,!0);throw Error("Cannot find module '"+s+"'")}var c=r[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return i(n?n:e)},c,c.exports,n,t,r,o)}return r[s].exports}for(var a="function"==typeof e&&e,s=0;o.length>s;s++)i(o[s]);return i}({PcZj9L:[function(e,t,n){function r(e,t){var n=typeof e;if("base64"===t&&"string"===n)for(e=ut(e);0!==e.length%4;)e+="=";var o;if("number"===n)o=ht(e);else if("string"===n)o=r.byteLength(e,t);else{if("object"!==n)throw Error("First argument needs to be a number, array or string.");o=ht(e.length)}var i=ft(new Uint8Array(o));if(r.isBuffer(e))i.set(e);else if(pt(e))for(var a=0;o>a;a++)i[a]=r.isBuffer(e)?e.readUInt8(a):e[a];else"string"===n&&i.write(e,0,t);return i}function o(e,t,n,o){n=Number(n)||0;var i=e.length-n;o?(o=Number(o),o>i&&(o=i)):o=i;var a=t.length;if(0!==a%2)throw Error("Invalid hex string");o>a/2&&(o=a/2);for(var s=0;o>s;s++){var u=parseInt(t.substr(2*s,2),16);if(isNaN(u))throw Error("Invalid hex string");e[n+s]=u}return r._charsWritten=2*s,s}function i(e,t,n,o){return r._charsWritten=vt(yt(t),e,n,o)}function a(e,t,n,o){return r._charsWritten=vt(bt(t),e,n,o)}function s(e,t,n,r){return a(e,t,n,r)}function u(e,t,n,o){return r._charsWritten=vt(mt(t),e,n,o)}function l(e,t,n,r){if(isFinite(t))isFinite(n)||(r=n,n=void 0);else{var l=r;r=t,t=n,n=l}t=Number(t)||0;var c=this.length-t;switch(n?(n=Number(n),n>c&&(n=c)):n=c,r=((r||"utf8")+"").toLowerCase()){case"hex":return o(this,e,t,n);case"utf8":case"utf-8":return i(this,e,t,n);case"ascii":return a(this,e,t,n);case"binary":return s(this,e,t,n);case"base64":return u(this,e,t,n);default:throw Error("Unknown encoding")}}function c(e,t,n){var r=this instanceof ct?this._proxy:this;if(e=((e||"utf8")+"").toLowerCase(),t=Number(t)||0,n=void 0!==n?Number(n):n=r.length,n===t)return"";switch(e){case"hex":return b(r,t,n);case"utf8":case"utf-8":return p(r,t,n);case"ascii":return g(r,t,n);case"binary":return y(r,t,n);case"base64":return h(r,t,n);default:throw Error("Unknown encoding")}}function f(){return{type:"Buffer",data:Array.prototype.slice.call(this,0)}}function d(e,t,n,r){var o=this;if(n||(n=0),r||0===r||(r=this.length),t||(t=0),r!==n&&0!==e.length&&0!==o.length){if(n>r)throw Error("sourceEnd < sourceStart");if(0>t||t>=e.length)throw Error("targetStart out of bounds");if(0>n||n>=o.length)throw Error("sourceStart out of bounds");if(0>r||r>o.length)throw Error("sourceEnd out of bounds");r>this.length&&(r=this.length),r-n>e.length-t&&(r=e.length-t+n);for(var i=0;r-n>i;i++)e[i+t]=this[i+n]}}function h(t,n,r){var o=t.slice(n,r);return e("base64-js").fromByteArray(o)}function p(e,t,n){for(var r=e.slice(t,n),o="",i="",a=0;r.length>a;)127>=r[a]?(o+=wt(i)+String.fromCharCode(r[a]),i=""):i+="%"+r[a].toString(16),a++;return o+wt(i)}function g(e,t,n){for(var r=e.slice(t,n),o="",i=0;r.length>i;i++)o+=String.fromCharCode(r[i]);return o}function y(e,t,n){return g(e,t,n)}function b(e,t,n){var r=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var o="",i=t;n>i;i++)o+=gt(e[i]);return o}function m(e,t){var n=this.length;return e=dt(e,n,0),t=dt(t,n,n),ft(this.subarray(e,t))}function v(e,t){var n=this;return t||(St(void 0!==e&&null!==e,"missing offset"),St(n.length>e,"Trying to read beyond buffer length")),e>=n.length?void 0:n[e]}function w(e,t,n,r){r||(St("boolean"==typeof n,"missing or invalid endian"),St(void 0!==t&&null!==t,"missing offset"),St(e.length>t+1,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){if(t+1===o){var i=new DataView(new ArrayBuffer(2));return i.setUint8(0,e[o-1]),i.getUint16(0,n)}return e._dataview.getUint16(t,n)}}function _(e,t){return w(this,e,!0,t)}function E(e,t){return w(this,e,!1,t)}function k(e,t,n,r){r||(St("boolean"==typeof n,"missing or invalid endian"),St(void 0!==t&&null!==t,"missing offset"),St(e.length>t+3,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){if(t+3>=o){for(var i=new DataView(new ArrayBuffer(4)),a=0;o>a+t;a++)i.setUint8(a,e[a+t]);return i.getUint32(0,n)}return e._dataview.getUint32(t,n)}}function S(e,t){return k(this,e,!0,t)}function x(e,t){return k(this,e,!1,t)}function j(e,t){var n=this;return t||(St(void 0!==e&&null!==e,"missing offset"),St(n.length>e,"Trying to read beyond buffer length")),e>=n.length?void 0:n._dataview.getInt8(e)}function O(e,t,n,r){r||(St("boolean"==typeof n,"missing or invalid endian"),St(void 0!==t&&null!==t,"missing offset"),St(e.length>t+1,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){if(t+1===o){var i=new DataView(new ArrayBuffer(2));return i.setUint8(0,e[o-1]),i.getInt16(0,n)}return e._dataview.getInt16(t,n)}}function L(e,t){return O(this,e,!0,t)}function B(e,t){return O(this,e,!1,t)}function I(e,t,n,r){r||(St("boolean"==typeof n,"missing or invalid endian"),St(void 0!==t&&null!==t,"missing offset"),St(e.length>t+3,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){if(t+3>=o){for(var i=new DataView(new ArrayBuffer(4)),a=0;o>a+t;a++)i.setUint8(a,e[a+t]);return i.getInt32(0,n)}return e._dataview.getInt32(t,n)}}function T(e,t){return I(this,e,!0,t)}function D(e,t){return I(this,e,!1,t)}function N(e,t,n,r){return r||(St("boolean"==typeof n,"missing or invalid endian"),St(e.length>t+3,"Trying to read beyond buffer length")),e._dataview.getFloat32(t,n)}function A(e,t){return N(this,e,!0,t)}function U(e,t){return N(this,e,!1,t)}function R(e,t,n,r){return r||(St("boolean"==typeof n,"missing or invalid endian"),St(e.length>t+7,"Trying to read beyond buffer length")),e._dataview.getFloat64(t,n)}function C(e,t){return R(this,e,!0,t)}function M(e,t){return R(this,e,!1,t)}function P(e,t,n){var r=this;n||(St(void 0!==e&&null!==e,"missing value"),St(void 0!==t&&null!==t,"missing offset"),St(r.length>t,"trying to write beyond buffer length"),_t(e,255)),t>=r.length||(r[t]=e)}function W(e,t,n,r,o){o||(St(void 0!==t&&null!==t,"missing value"),St("boolean"==typeof r,"missing or invalid endian"),St(void 0!==n&&null!==n,"missing offset"),St(e.length>n+1,"trying to write beyond buffer length"),_t(t,65535));var i=e.length;if(!(n>=i))if(n+1===i){var a=new DataView(new ArrayBuffer(2));a.setUint16(0,t,r),e[n]=a.getUint8(0)}else e._dataview.setUint16(n,t,r)}function F(e,t,n){W(this,e,t,!0,n)}function q(e,t,n){W(this,e,t,!1,n)}function z(e,t,n,r,o){o||(St(void 0!==t&&null!==t,"missing value"),St("boolean"==typeof r,"missing or invalid endian"),St(void 0!==n&&null!==n,"missing offset"),St(e.length>n+3,"trying to write beyond buffer length"),_t(t,4294967295));var i=e.length;if(!(n>=i))if(n+3>=i){var a=new DataView(new ArrayBuffer(4));a.setUint32(0,t,r);for(var s=0;i>s+n;s++)e[s+n]=a.getUint8(s)}else e._dataview.setUint32(n,t,r)}function V(e,t,n){z(this,e,t,!0,n)}function K(e,t,n){z(this,e,t,!1,n)}function H(e,t,n){var r=this;n||(St(void 0!==e&&null!==e,"missing value"),St(void 0!==t&&null!==t,"missing offset"),St(r.length>t,"Trying to write beyond buffer length"),Et(e,127,-128)),t>=r.length||r._dataview.setInt8(t,e)}function G(e,t,n,r,o){o||(St(void 0!==t&&null!==t,"missing value"),St("boolean"==typeof r,"missing or invalid endian"),St(void 0!==n&&null!==n,"missing offset"),St(e.length>n+1,"Trying to write beyond buffer length"),Et(t,32767,-32768));var i=e.length;if(!(n>=i))if(n+1===i){var a=new DataView(new ArrayBuffer(2));a.setInt16(0,t,r),e[n]=a.getUint8(0)}else e._dataview.setInt16(n,t,r)}function J(e,t,n){G(this,e,t,!0,n)}function Y(e,t,n){G(this,e,t,!1,n)}function $(e,t,n,r,o){o||(St(void 0!==t&&null!==t,"missing value"),St("boolean"==typeof r,"missing or invalid endian"),St(void 0!==n&&null!==n,"missing offset"),St(e.length>n+3,"Trying to write beyond buffer length"),Et(t,2147483647,-2147483648));var i=e.length;if(!(n>=i))if(n+3>=i){var a=new DataView(new ArrayBuffer(4));a.setInt32(0,t,r);for(var s=0;i>s+n;s++)e[s+n]=a.getUint8(s)}else e._dataview.setInt32(n,t,r)}function X(e,t,n){$(this,e,t,!0,n)}function Z(e,t,n){$(this,e,t,!1,n)}function Q(e,t,n,r,o){o||(St(void 0!==t&&null!==t,"missing value"),St("boolean"==typeof r,"missing or invalid endian"),St(void 0!==n&&null!==n,"missing offset"),St(e.length>n+3,"Trying to write beyond buffer length"),kt(t,3.4028234663852886e38,-3.4028234663852886e38));var i=e.length;if(!(n>=i))if(n+3>=i){var a=new DataView(new ArrayBuffer(4));a.setFloat32(0,t,r);for(var s=0;i>s+n;s++)e[s+n]=a.getUint8(s)}else e._dataview.setFloat32(n,t,r)}function et(e,t,n){Q(this,e,t,!0,n)}function tt(e,t,n){Q(this,e,t,!1,n)}function nt(e,t,n,r,o){o||(St(void 0!==t&&null!==t,"missing value"),St("boolean"==typeof r,"missing or invalid endian"),St(void 0!==n&&null!==n,"missing offset"),St(e.length>n+7,"Trying to write beyond buffer length"),kt(t,1.7976931348623157e308,-1.7976931348623157e308));var i=e.length;if(!(n>=i))if(n+7>=i){var a=new DataView(new ArrayBuffer(8));a.setFloat64(0,t,r);for(var s=0;i>s+n;s++)e[s+n]=a.getUint8(s)}else e._dataview.setFloat64(n,t,r)}function rt(e,t,n){nt(this,e,t,!0,n)}function ot(e,t,n){nt(this,e,t,!1,n)}function it(e,t,n){if(e||(e=0),t||(t=0),n||(n=this.length),"string"==typeof e&&(e=e.charCodeAt(0)),"number"!=typeof e||isNaN(e))throw Error("value is not a number");if(t>n)throw Error("end < start");if(n!==t&&0!==this.length){if(0>t||t>=this.length)throw Error("start out of bounds");if(0>n||n>this.length)throw Error("end out of bounds");for(var r=t;n>r;r++)this[r]=e}}function at(){for(var e=[],t=this.length,r=0;t>r;r++)if(e[r]=gt(this[r]),r===n.INSPECT_MAX_BYTES){e[r+1]="...";break}return"<Buffer "+e.join(" ")+">"}function st(){return new r(this).buffer}function ut(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function lt(){var e=new Uint8Array(0);e.foo=function(){return 42};try{return 42===e.foo()}catch(t){return!1}}function ct(e){this._arr=e,0!==e.byteLength&&(this._dataview=new DataView(e.buffer,e.byteOffset,e.byteLength))}function ft(e){if(void 0===xt&&(xt=lt()),xt)return e.write=l,e.toString=c,e.toLocaleString=c,e.toJSON=f,e.copy=d,e.slice=m,e.readUInt8=v,e.readUInt16LE=_,e.readUInt16BE=E,e.readUInt32LE=S,e.readUInt32BE=x,e.readInt8=j,e.readInt16LE=L,e.readInt16BE=B,e.readInt32LE=T,e.readInt32BE=D,e.readFloatLE=A,e.readFloatBE=U,e.readDoubleLE=C,e.readDoubleBE=M,e.writeUInt8=P,e.writeUInt16LE=F,e.writeUInt16BE=q,e.writeUInt32LE=V,e.writeUInt32BE=K,e.writeInt8=H,e.writeInt16LE=J,e.writeInt16BE=Y,e.writeInt32LE=X,e.writeInt32BE=Z,e.writeFloatLE=et,e.writeFloatBE=tt,e.writeDoubleLE=rt,e.writeDoubleBE=ot,e.fill=it,e.inspect=at,e.toArrayBuffer=st,e._isBuffer=!0,0!==e.byteLength&&(e._dataview=new DataView(e.buffer,e.byteOffset,e.byteLength)),e;var t=new ct(e),n=new Proxy(t,jt);return t._proxy=n,n}function dt(e,t,n){return"number"!=typeof e?n:(e=~~e,e>=t?t:e>=0?e:(e+=t,e>=0?e:0))}function ht(e){return e=~~Math.ceil(+e),0>e?0:e}function pt(e){return Array.isArray(e)||r.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function gt(e){return 16>e?"0"+e.toString(16):e.toString(16)}function yt(e){for(var t=[],n=0;e.length>n;n++)if(127>=e.charCodeAt(n))t.push(e.charCodeAt(n));else for(var r=encodeURIComponent(e.charAt(n)).substr(1).split("%"),o=0;r.length>o;o++)t.push(parseInt(r[o],16));return t}function bt(e){for(var t=[],n=0;e.length>n;n++)t.push(255&e.charCodeAt(n));return t}function mt(t){return e("base64-js").toByteArray(t)}function vt(e,t,n,r){for(var o=0;r>o&&!(o+n>=t.length||o>=e.length);)t[o+n]=e[o],o++;return o}function wt(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function _t(e,t){St("number"==typeof e,"cannot write a non-number as a number"),St(e>=0,"specified a negative value for writing an unsigned value"),St(t>=e,"value is larger than maximum value for type"),St(Math.floor(e)===e,"value has a fractional component")}function Et(e,t,n){St("number"==typeof e,"cannot write a non-number as a number"),St(t>=e,"value larger than maximum allowed value"),St(e>=n,"value smaller than minimum allowed value"),St(Math.floor(e)===e,"value has a fractional component")
}function kt(e,t,n){St("number"==typeof e,"cannot write a non-number as a number"),St(t>=e,"value larger than maximum allowed value"),St(e>=n,"value smaller than minimum allowed value")}function St(e,t){if(!e)throw Error(t||"Failed assertion")}n.Buffer=r,n.SlowBuffer=r,n.INSPECT_MAX_BYTES=50,r.poolSize=8192;var xt;r.isEncoding=function(e){switch((e+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},r.isBuffer=function(e){return e&&e._isBuffer},r.byteLength=function(e,t){switch(t||"utf8"){case"hex":return e.length/2;case"utf8":case"utf-8":return yt(e).length;case"ascii":case"binary":return e.length;case"base64":return mt(e).length;default:throw Error("Unknown encoding")}},r.concat=function(e,t){if(!Array.isArray(e))throw Error("Usage: Buffer.concat(list, [totalLength])\nlist should be an Array.");var n,o;if(0===e.length)return new r(0);if(1===e.length)return e[0];if("number"!=typeof t)for(t=0,n=0;e.length>n;n++)o=e[n],t+=o.length;var i=new r(t),a=0;for(n=0;e.length>n;n++)o=e[n],o.copy(i,a),a+=o.length;return i},ct.prototype.write=l,ct.prototype.toString=c,ct.prototype.toLocaleString=c,ct.prototype.toJSON=f,ct.prototype.copy=d,ct.prototype.slice=m,ct.prototype.readUInt8=v,ct.prototype.readUInt16LE=_,ct.prototype.readUInt16BE=E,ct.prototype.readUInt32LE=S,ct.prototype.readUInt32BE=x,ct.prototype.readInt8=j,ct.prototype.readInt16LE=L,ct.prototype.readInt16BE=B,ct.prototype.readInt32LE=T,ct.prototype.readInt32BE=D,ct.prototype.readFloatLE=A,ct.prototype.readFloatBE=U,ct.prototype.readDoubleLE=C,ct.prototype.readDoubleBE=M,ct.prototype.writeUInt8=P,ct.prototype.writeUInt16LE=F,ct.prototype.writeUInt16BE=q,ct.prototype.writeUInt32LE=V,ct.prototype.writeUInt32BE=K,ct.prototype.writeInt8=H,ct.prototype.writeInt16LE=J,ct.prototype.writeInt16BE=Y,ct.prototype.writeInt32LE=X,ct.prototype.writeInt32BE=Z,ct.prototype.writeFloatLE=et,ct.prototype.writeFloatBE=tt,ct.prototype.writeDoubleLE=rt,ct.prototype.writeDoubleBE=ot,ct.prototype.fill=it,ct.prototype.inspect=at,ct.prototype.toArrayBuffer=st,ct.prototype._isBuffer=!0,ct.prototype.subarray=function(){return this._arr.subarray.apply(this._arr,arguments)},ct.prototype.set=function(){return this._arr.set.apply(this._arr,arguments)};var jt={get:function(e,t){return t in e?e[t]:e._arr[t]},set:function(e,t,n){e._arr[t]=n}}},{"base64-js":3}],"native-buffer-browserify":[function(e,t){t.exports=e("PcZj9L")},{}],3:[function(e,t){(function(){"use strict";function e(e){var t,n,o,i,a,s;if(e.length%4>0)throw"Invalid string. Length must be a multiple of 4";for(a=e.indexOf("="),a=a>0?e.length-a:0,s=[],o=a>0?e.length-4:e.length,t=0,n=0;o>t;t+=4,n+=3)i=r.indexOf(e[t])<<18|r.indexOf(e[t+1])<<12|r.indexOf(e[t+2])<<6|r.indexOf(e[t+3]),s.push((16711680&i)>>16),s.push((65280&i)>>8),s.push(255&i);return 2===a?(i=r.indexOf(e[t])<<2|r.indexOf(e[t+1])>>4,s.push(255&i)):1===a&&(i=r.indexOf(e[t])<<10|r.indexOf(e[t+1])<<4|r.indexOf(e[t+2])>>2,s.push(255&i>>8),s.push(255&i)),s}function n(e){function t(e){return r[63&e>>18]+r[63&e>>12]+r[63&e>>6]+r[63&e]}var n,o,i,a=e.length%3,s="";for(n=0,i=e.length-a;i>n;n+=3)o=(e[n]<<16)+(e[n+1]<<8)+e[n+2],s+=t(o);switch(a){case 1:o=e[e.length-1],s+=r[o>>2],s+=r[63&o<<4],s+="==";break;case 2:o=(e[e.length-2]<<8)+e[e.length-1],s+=r[o>>10],s+=r[63&o>>4],s+=r[63&o<<2],s+="="}return s}var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports.toByteArray=e,t.exports.fromByteArray=n})()},{}]},{},[]),t.exports=e("native-buffer-browserify").Buffer},{}],86:[function(e,t){var n=t.exports={};n.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",function(e){if(e.source===window&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var t=n.shift();t()}},!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.binding=function(){throw Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw Error("process.chdir is not supported")}},{}],87:[function(e,t,n){function r(e,t){var n=typeof e;if("base64"===t&&"string"===n)for(e=ut(e);0!==e.length%4;)e+="=";var o;if("number"===n)o=ht(e);else if("string"===n)o=r.byteLength(e,t);else{if("object"!==n)throw Error("First argument needs to be a number, array or string.");o=ht(e.length)}var i=ft(new Uint8Array(o));if(r.isBuffer(e))i.set(e);else if(pt(e))for(var a=0;o>a;a++)i[a]=r.isBuffer(e)?e.readUInt8(a):e[a];else"string"===n&&i.write(e,0,t);return i}function o(e,t,n,o){n=Number(n)||0;var i=e.length-n;o?(o=Number(o),o>i&&(o=i)):o=i;var a=t.length;if(0!==a%2)throw Error("Invalid hex string");o>a/2&&(o=a/2);for(var s=0;o>s;s++){var u=parseInt(t.substr(2*s,2),16);if(isNaN(u))throw Error("Invalid hex string");e[n+s]=u}return r._charsWritten=2*s,s}function i(e,t,n,o){return r._charsWritten=vt(yt(t),e,n,o)}function a(e,t,n,o){return r._charsWritten=vt(bt(t),e,n,o)}function s(e,t,n,r){return a(e,t,n,r)}function u(e,t,n,o){return r._charsWritten=vt(mt(t),e,n,o)}function l(e,t,n,r){if(isFinite(t))isFinite(n)||(r=n,n=void 0);else{var l=r;r=t,t=n,n=l}t=Number(t)||0;var c=this.length-t;switch(n?(n=Number(n),n>c&&(n=c)):n=c,r=((r||"utf8")+"").toLowerCase()){case"hex":return o(this,e,t,n);case"utf8":case"utf-8":return i(this,e,t,n);case"ascii":return a(this,e,t,n);case"binary":return s(this,e,t,n);case"base64":return u(this,e,t,n);default:throw Error("Unknown encoding")}}function c(e,t,n){var r=this instanceof ct?this._proxy:this;if(e=((e||"utf8")+"").toLowerCase(),t=Number(t)||0,n=void 0!==n?Number(n):n=r.length,n===t)return"";switch(e){case"hex":return b(r,t,n);case"utf8":case"utf-8":return p(r,t,n);case"ascii":return g(r,t,n);case"binary":return y(r,t,n);case"base64":return h(r,t,n);default:throw Error("Unknown encoding")}}function f(){return{type:"Buffer",data:Array.prototype.slice.call(this,0)}}function d(e,t,n,r){var o=this;if(n||(n=0),r||0===r||(r=this.length),t||(t=0),r!==n&&0!==e.length&&0!==o.length){if(n>r)throw Error("sourceEnd < sourceStart");if(0>t||t>=e.length)throw Error("targetStart out of bounds");if(0>n||n>=o.length)throw Error("sourceStart out of bounds");if(0>r||r>o.length)throw Error("sourceEnd out of bounds");r>this.length&&(r=this.length),r-n>e.length-t&&(r=e.length-t+n);for(var i=0;r-n>i;i++)e[i+t]=this[i+n]}}function h(t,n,r){var o=t.slice(n,r);return e("base64-js").fromByteArray(o)}function p(e,t,n){for(var r=e.slice(t,n),o="",i="",a=0;r.length>a;)127>=r[a]?(o+=wt(i)+String.fromCharCode(r[a]),i=""):i+="%"+r[a].toString(16),a++;return o+wt(i)}function g(e,t,n){for(var r=e.slice(t,n),o="",i=0;r.length>i;i++)o+=String.fromCharCode(r[i]);return o}function y(e,t,n){return g(e,t,n)}function b(e,t,n){var r=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var o="",i=t;n>i;i++)o+=gt(e[i]);return o}function m(e,t){var n=this.length;return e=dt(e,n,0),t=dt(t,n,n),ft(this.subarray(e,t))}function v(e,t){var n=this;return t||(St(void 0!==e&&null!==e,"missing offset"),St(n.length>e,"Trying to read beyond buffer length")),e>=n.length?void 0:n[e]}function w(e,t,n,r){r||(St("boolean"==typeof n,"missing or invalid endian"),St(void 0!==t&&null!==t,"missing offset"),St(e.length>t+1,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){if(t+1===o){var i=new DataView(new ArrayBuffer(2));return i.setUint8(0,e[o-1]),i.getUint16(0,n)}return e._dataview.getUint16(t,n)}}function _(e,t){return w(this,e,!0,t)}function E(e,t){return w(this,e,!1,t)}function k(e,t,n,r){r||(St("boolean"==typeof n,"missing or invalid endian"),St(void 0!==t&&null!==t,"missing offset"),St(e.length>t+3,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){if(t+3>=o){for(var i=new DataView(new ArrayBuffer(4)),a=0;o>a+t;a++)i.setUint8(a,e[a+t]);return i.getUint32(0,n)}return e._dataview.getUint32(t,n)}}function S(e,t){return k(this,e,!0,t)}function x(e,t){return k(this,e,!1,t)}function j(e,t){var n=this;return t||(St(void 0!==e&&null!==e,"missing offset"),St(n.length>e,"Trying to read beyond buffer length")),e>=n.length?void 0:n._dataview.getInt8(e)}function O(e,t,n,r){r||(St("boolean"==typeof n,"missing or invalid endian"),St(void 0!==t&&null!==t,"missing offset"),St(e.length>t+1,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){if(t+1===o){var i=new DataView(new ArrayBuffer(2));return i.setUint8(0,e[o-1]),i.getInt16(0,n)}return e._dataview.getInt16(t,n)}}function L(e,t){return O(this,e,!0,t)}function B(e,t){return O(this,e,!1,t)}function I(e,t,n,r){r||(St("boolean"==typeof n,"missing or invalid endian"),St(void 0!==t&&null!==t,"missing offset"),St(e.length>t+3,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){if(t+3>=o){for(var i=new DataView(new ArrayBuffer(4)),a=0;o>a+t;a++)i.setUint8(a,e[a+t]);return i.getInt32(0,n)}return e._dataview.getInt32(t,n)}}function T(e,t){return I(this,e,!0,t)}function D(e,t){return I(this,e,!1,t)}function N(e,t,n,r){return r||(St("boolean"==typeof n,"missing or invalid endian"),St(e.length>t+3,"Trying to read beyond buffer length")),e._dataview.getFloat32(t,n)}function A(e,t){return N(this,e,!0,t)}function U(e,t){return N(this,e,!1,t)}function R(e,t,n,r){return r||(St("boolean"==typeof n,"missing or invalid endian"),St(e.length>t+7,"Trying to read beyond buffer length")),e._dataview.getFloat64(t,n)}function C(e,t){return R(this,e,!0,t)}function M(e,t){return R(this,e,!1,t)}function P(e,t,n){var r=this;n||(St(void 0!==e&&null!==e,"missing value"),St(void 0!==t&&null!==t,"missing offset"),St(r.length>t,"trying to write beyond buffer length"),_t(e,255)),t>=r.length||(r[t]=e)}function W(e,t,n,r,o){o||(St(void 0!==t&&null!==t,"missing value"),St("boolean"==typeof r,"missing or invalid endian"),St(void 0!==n&&null!==n,"missing offset"),St(e.length>n+1,"trying to write beyond buffer length"),_t(t,65535));var i=e.length;if(!(n>=i))if(n+1===i){var a=new DataView(new ArrayBuffer(2));a.setUint16(0,t,r),e[n]=a.getUint8(0)}else e._dataview.setUint16(n,t,r)}function F(e,t,n){W(this,e,t,!0,n)}function q(e,t,n){W(this,e,t,!1,n)}function z(e,t,n,r,o){o||(St(void 0!==t&&null!==t,"missing value"),St("boolean"==typeof r,"missing or invalid endian"),St(void 0!==n&&null!==n,"missing offset"),St(e.length>n+3,"trying to write beyond buffer length"),_t(t,4294967295));var i=e.length;if(!(n>=i))if(n+3>=i){var a=new DataView(new ArrayBuffer(4));a.setUint32(0,t,r);for(var s=0;i>s+n;s++)e[s+n]=a.getUint8(s)}else e._dataview.setUint32(n,t,r)}function V(e,t,n){z(this,e,t,!0,n)}function K(e,t,n){z(this,e,t,!1,n)}function H(e,t,n){var r=this;n||(St(void 0!==e&&null!==e,"missing value"),St(void 0!==t&&null!==t,"missing offset"),St(r.length>t,"Trying to write beyond buffer length"),Et(e,127,-128)),t>=r.length||r._dataview.setInt8(t,e)}function G(e,t,n,r,o){o||(St(void 0!==t&&null!==t,"missing value"),St("boolean"==typeof r,"missing or invalid endian"),St(void 0!==n&&null!==n,"missing offset"),St(e.length>n+1,"Trying to write beyond buffer length"),Et(t,32767,-32768));var i=e.length;if(!(n>=i))if(n+1===i){var a=new DataView(new ArrayBuffer(2));a.setInt16(0,t,r),e[n]=a.getUint8(0)}else e._dataview.setInt16(n,t,r)}function J(e,t,n){G(this,e,t,!0,n)}function Y(e,t,n){G(this,e,t,!1,n)}function $(e,t,n,r,o){o||(St(void 0!==t&&null!==t,"missing value"),St("boolean"==typeof r,"missing or invalid endian"),St(void 0!==n&&null!==n,"missing offset"),St(e.length>n+3,"Trying to write beyond buffer length"),Et(t,2147483647,-2147483648));var i=e.length;if(!(n>=i))if(n+3>=i){var a=new DataView(new ArrayBuffer(4));a.setInt32(0,t,r);for(var s=0;i>s+n;s++)e[s+n]=a.getUint8(s)}else e._dataview.setInt32(n,t,r)}function X(e,t,n){$(this,e,t,!0,n)}function Z(e,t,n){$(this,e,t,!1,n)}function Q(e,t,n,r,o){o||(St(void 0!==t&&null!==t,"missing value"),St("boolean"==typeof r,"missing or invalid endian"),St(void 0!==n&&null!==n,"missing offset"),St(e.length>n+3,"Trying to write beyond buffer length"),kt(t,3.4028234663852886e38,-3.4028234663852886e38));var i=e.length;if(!(n>=i))if(n+3>=i){var a=new DataView(new ArrayBuffer(4));a.setFloat32(0,t,r);for(var s=0;i>s+n;s++)e[s+n]=a.getUint8(s)}else e._dataview.setFloat32(n,t,r)}function et(e,t,n){Q(this,e,t,!0,n)}function tt(e,t,n){Q(this,e,t,!1,n)}function nt(e,t,n,r,o){o||(St(void 0!==t&&null!==t,"missing value"),St("boolean"==typeof r,"missing or invalid endian"),St(void 0!==n&&null!==n,"missing offset"),St(e.length>n+7,"Trying to write beyond buffer length"),kt(t,1.7976931348623157e308,-1.7976931348623157e308));var i=e.length;if(!(n>=i))if(n+7>=i){var a=new DataView(new ArrayBuffer(8));a.setFloat64(0,t,r);for(var s=0;i>s+n;s++)e[s+n]=a.getUint8(s)}else e._dataview.setFloat64(n,t,r)}function rt(e,t,n){nt(this,e,t,!0,n)}function ot(e,t,n){nt(this,e,t,!1,n)}function it(e,t,n){if(e||(e=0),t||(t=0),n||(n=this.length),"string"==typeof e&&(e=e.charCodeAt(0)),"number"!=typeof e||isNaN(e))throw Error("value is not a number");if(t>n)throw Error("end < start");if(n!==t&&0!==this.length){if(0>t||t>=this.length)throw Error("start out of bounds");if(0>n||n>this.length)throw Error("end out of bounds");for(var r=t;n>r;r++)this[r]=e}}function at(){for(var e=[],t=this.length,r=0;t>r;r++)if(e[r]=gt(this[r]),r===n.INSPECT_MAX_BYTES){e[r+1]="...";break}return"<Buffer "+e.join(" ")+">"}function st(){return new r(this).buffer}function ut(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function lt(){var e=new Uint8Array(0);e.foo=function(){return 42};try{return 42===e.foo()}catch(t){return!1}}function ct(e){this._arr=e,0!==e.byteLength&&(this._dataview=new DataView(e.buffer,e.byteOffset,e.byteLength))}function ft(e){if(void 0===xt&&(xt=lt()),xt)return e.write=l,e.toString=c,e.toLocaleString=c,e.toJSON=f,e.copy=d,e.slice=m,e.readUInt8=v,e.readUInt16LE=_,e.readUInt16BE=E,e.readUInt32LE=S,e.readUInt32BE=x,e.readInt8=j,e.readInt16LE=L,e.readInt16BE=B,e.readInt32LE=T,e.readInt32BE=D,e.readFloatLE=A,e.readFloatBE=U,e.readDoubleLE=C,e.readDoubleBE=M,e.writeUInt8=P,e.writeUInt16LE=F,e.writeUInt16BE=q,e.writeUInt32LE=V,e.writeUInt32BE=K,e.writeInt8=H,e.writeInt16LE=J,e.writeInt16BE=Y,e.writeInt32LE=X,e.writeInt32BE=Z,e.writeFloatLE=et,e.writeFloatBE=tt,e.writeDoubleLE=rt,e.writeDoubleBE=ot,e.fill=it,e.inspect=at,e.toArrayBuffer=st,e._isBuffer=!0,0!==e.byteLength&&(e._dataview=new DataView(e.buffer,e.byteOffset,e.byteLength)),e;var t=new ct(e),n=new Proxy(t,jt);return t._proxy=n,n}function dt(e,t,n){return"number"!=typeof e?n:(e=~~e,e>=t?t:e>=0?e:(e+=t,e>=0?e:0))}function ht(e){return e=~~Math.ceil(+e),0>e?0:e}function pt(e){return Array.isArray(e)||r.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function gt(e){return 16>e?"0"+e.toString(16):e.toString(16)}function yt(e){for(var t=[],n=0;e.length>n;n++)if(127>=e.charCodeAt(n))t.push(e.charCodeAt(n));else for(var r=encodeURIComponent(e.charAt(n)).substr(1).split("%"),o=0;r.length>o;o++)t.push(parseInt(r[o],16));return t}function bt(e){for(var t=[],n=0;e.length>n;n++)t.push(255&e.charCodeAt(n));return t}function mt(t){return e("base64-js").toByteArray(t)}function vt(e,t,n,r){for(var o=0;r>o&&!(o+n>=t.length||o>=e.length);)t[o+n]=e[o],o++;return o}function wt(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function _t(e,t){St("number"==typeof e,"cannot write a non-number as a number"),St(e>=0,"specified a negative value for writing an unsigned value"),St(t>=e,"value is larger than maximum value for type"),St(Math.floor(e)===e,"value has a fractional component")}function Et(e,t,n){St("number"==typeof e,"cannot write a non-number as a number"),St(t>=e,"value larger than maximum allowed value"),St(e>=n,"value smaller than minimum allowed value"),St(Math.floor(e)===e,"value has a fractional component")}function kt(e,t,n){St("number"==typeof e,"cannot write a non-number as a number"),St(t>=e,"value larger than maximum allowed value"),St(e>=n,"value smaller than minimum allowed value")}function St(e,t){if(!e)throw Error(t||"Failed assertion")}n.Buffer=r,n.SlowBuffer=r,n.INSPECT_MAX_BYTES=50,r.poolSize=8192;var xt;r.isEncoding=function(e){switch((e+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},r.isBuffer=function(e){return e&&e._isBuffer},r.byteLength=function(e,t){switch(t||"utf8"){case"hex":return e.length/2;case"utf8":case"utf-8":return yt(e).length;case"ascii":case"binary":return e.length;case"base64":return mt(e).length;default:throw Error("Unknown encoding")}},r.concat=function(e,t){if(!Array.isArray(e))throw Error("Usage: Buffer.concat(list, [totalLength])\nlist should be an Array.");var n,o;if(0===e.length)return new r(0);if(1===e.length)return e[0];if("number"!=typeof t)for(t=0,n=0;e.length>n;n++)o=e[n],t+=o.length;var i=new r(t),a=0;for(n=0;e.length>n;n++)o=e[n],o.copy(i,a),a+=o.length;return i},ct.prototype.write=l,ct.prototype.toString=c,ct.prototype.toLocaleString=c,ct.prototype.toJSON=f,ct.prototype.copy=d,ct.prototype.slice=m,ct.prototype.readUInt8=v,ct.prototype.readUInt16LE=_,ct.prototype.readUInt16BE=E,ct.prototype.readUInt32LE=S,ct.prototype.readUInt32BE=x,ct.prototype.readInt8=j,ct.prototype.readInt16LE=L,ct.prototype.readInt16BE=B,ct.prototype.readInt32LE=T,ct.prototype.readInt32BE=D,ct.prototype.readFloatLE=A,ct.prototype.readFloatBE=U,ct.prototype.readDoubleLE=C,ct.prototype.readDoubleBE=M,ct.prototype.writeUInt8=P,ct.prototype.writeUInt16LE=F,ct.prototype.writeUInt16BE=q,ct.prototype.writeUInt32LE=V,ct.prototype.writeUInt32BE=K,ct.prototype.writeInt8=H,ct.prototype.writeInt16LE=J,ct.prototype.writeInt16BE=Y,ct.prototype.writeInt32LE=X,ct.prototype.writeInt32BE=Z,ct.prototype.writeFloatLE=et,ct.prototype.writeFloatBE=tt,ct.prototype.writeDoubleLE=rt,ct.prototype.writeDoubleBE=ot,ct.prototype.fill=it,ct.prototype.inspect=at,ct.prototype.toArrayBuffer=st,ct.prototype._isBuffer=!0,ct.prototype.subarray=function(){return this._arr.subarray.apply(this._arr,arguments)},ct.prototype.set=function(){return this._arr.set.apply(this._arr,arguments)};var jt={get:function(e,t){return t in e?e[t]:e._arr[t]},set:function(e,t,n){e._arr[t]=n}}},{"base64-js":88}],88:[function(e,t){t.exports=e(10)},{}],89:[function(e,t){function n(e){return this instanceof n?(a.call(this,e),s.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",r),void 0):new n(e)}function r(){if(!this.allowHalfOpen&&!this._writableState.ended){var e=this;i(function(){e.end()})}}t.exports=n;var o=e("inherits"),i=e("setimmediate"),a=e("./readable.js"),s=e("./writable.js");o(n,a),n.prototype.pipe=s.prototype.pipe,n.prototype.write=s.prototype.write,n.prototype.end=s.prototype.end,n.prototype._write=s.prototype._write},{"./readable.js":93,"./writable.js":95,inherits:84,setimmediate:91}],90:[function(e,t){function n(){r.call(this)}t.exports=n;var r=e("events").EventEmitter,o=e("inherits");o(n,r),n.Readable=e("./readable.js"),n.Writable=e("./writable.js"),n.Duplex=e("./duplex.js"),n.Transform=e("./transform.js"),n.PassThrough=e("./passthrough.js"),n.Stream=n,n.prototype.pipe=function(e,t){function n(t){e.writable&&!1===e.write(t)&&l.pause&&l.pause()}function o(){l.readable&&l.resume&&l.resume()}function i(){c||(c=!0,e.end())}function a(){c||(c=!0,"function"==typeof e.destroy&&e.destroy())}function s(e){if(u(),0===r.listenerCount(this,"error"))throw e}function u(){l.removeListener("data",n),e.removeListener("drain",o),l.removeListener("end",i),l.removeListener("close",a),l.removeListener("error",s),e.removeListener("error",s),l.removeListener("end",u),l.removeListener("close",u),e.removeListener("close",u)}var l=this;l.on("data",n),e.on("drain",o),e._isStdio||t&&t.end===!1||(l.on("end",i),l.on("close",a));var c=!1;return l.on("error",s),e.on("error",s),l.on("end",u),l.on("close",u),e.on("close",u),e.emit("pipe",l),e}},{"./duplex.js":89,"./passthrough.js":92,"./readable.js":93,"./transform.js":94,"./writable.js":95,events:83,inherits:84}],91:[function(require,module,exports){var process=require("__browserify_process"),global="undefined"!=typeof self?self:"undefined"!=typeof window?window:{};(function(global,undefined){"use strict";function canUseNextTick(){return"object"==typeof process&&"[object process]"===Object.prototype.toString.call(process)}function canUseMessageChannel(){return!!global.MessageChannel}function canUsePostMessage(){if(!global.postMessage||global.importScripts)return!1;var e=!0,t=global.onmessage;return global.onmessage=function(){e=!1},global.postMessage("","*"),global.onmessage=t,e}function canUseReadyStateChange(){return"document"in global&&"onreadystatechange"in global.document.createElement("script")}function installNextTickImplementation(e){e.setImmediate=function(){var e=tasks.addFromSetImmediateArguments(arguments);return process.nextTick(function(){tasks.runIfPresent(e)}),e}}function installMessageChannelImplementation(e){var t=new global.MessageChannel;t.port1.onmessage=function(e){var t=e.data;tasks.runIfPresent(t)},e.setImmediate=function(){var e=tasks.addFromSetImmediateArguments(arguments);return t.port2.postMessage(e),e}}function installPostMessageImplementation(e){function t(e,t){return"string"==typeof e&&e.substring(0,t.length)===t}function n(e){if(e.source===global&&t(e.data,r)){var n=e.data.substring(r.length);tasks.runIfPresent(n)}}var r="com.bn.NobleJS.setImmediate"+Math.random();global.addEventListener?global.addEventListener("message",n,!1):global.attachEvent("onmessage",n),e.setImmediate=function(){var e=tasks.addFromSetImmediateArguments(arguments);return global.postMessage(r+e,"*"),e}}function installReadyStateChangeImplementation(e){e.setImmediate=function(){var e=tasks.addFromSetImmediateArguments(arguments),t=global.document.createElement("script");return t.onreadystatechange=function(){tasks.runIfPresent(e),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},global.document.documentElement.appendChild(t),e}}function installSetTimeoutImplementation(e){e.setImmediate=function(){var e=tasks.addFromSetImmediateArguments(arguments);return global.setTimeout(function(){tasks.runIfPresent(e)},0),e}}var tasks=function(){function Task(e,t){this.handler=e,this.args=t}Task.prototype.run=function(){if("function"==typeof this.handler)this.handler.apply(undefined,this.args);else{var scriptSource=""+this.handler;eval(scriptSource)}};var nextHandle=1,tasksByHandle={},currentlyRunningATask=!1;return{addFromSetImmediateArguments:function(e){var t=e[0],n=Array.prototype.slice.call(e,1),r=new Task(t,n),o=nextHandle++;return tasksByHandle[o]=r,o},runIfPresent:function(e){if(currentlyRunningATask)global.setTimeout(function(){tasks.runIfPresent(e)},0);else{var t=tasksByHandle[e];if(t){currentlyRunningATask=!0;try{t.run()}finally{delete tasksByHandle[e],currentlyRunningATask=!1}}}},remove:function(e){delete tasksByHandle[e]}}}();if(!global.setImmediate){var attachTo="function"==typeof Object.getPrototypeOf&&"setTimeout"in Object.getPrototypeOf(global)?Object.getPrototypeOf(global):global;canUseNextTick()?installNextTickImplementation(attachTo):canUsePostMessage()?installPostMessageImplementation(attachTo):canUseMessageChannel()?installMessageChannelImplementation(attachTo):canUseReadyStateChange()?installReadyStateChangeImplementation(attachTo):installSetTimeoutImplementation(attachTo),attachTo.clearImmediate=tasks.remove}})("object"==typeof global&&global?global:this)},{__browserify_process:86}],92:[function(e,t){function n(e){return this instanceof n?(r.call(this,e),void 0):new n(e)}t.exports=n;var r=e("./transform.js"),o=e("inherits");o(n,r),n.prototype._transform=function(e,t,n){n(null,e)}},{"./transform.js":94,inherits:84}],93:[function(e,t){function n(t){t=t||{};var n=t.highWaterMark;this.highWaterMark=n||0===n?n:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!t.objectMode,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(k||(k=e("string_decoder").StringDecoder),this.decoder=new k(t.encoding),this.encoding=t.encoding)}function r(e){return this instanceof r?(this._readableState=new n(e,this),this.readable=!0,x.call(this),void 0):new r(e)}function o(e,t,n,r,o){var a=u(t,n);if(a)e.emit("error",a);else if(null===n||void 0===n)t.reading=!1,t.ended||l(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!o){var s=Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&o){var s=Error("stream.unshift() after end event");e.emit("error",s)}else!t.decoder||o||r||(n=t.decoder.write(n)),t.length+=t.objectMode?1:n.length,o?t.buffer.unshift(n):(t.reading=!1,t.buffer.push(n)),t.needReadable&&c(e),d(e,t);else o||(t.reading=!1);return i(t)}function i(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function a(e){if(e>=B)e=B;else{e--;for(var t=1;32>t;t<<=1)e|=e>>t;e++}return e}function s(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:isNaN(e)||null===e?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:0>=e?0:(e>t.highWaterMark&&(t.highWaterMark=a(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function u(e,t){var n=null;return j.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||n||(n=new TypeError("Invalid non-string/buffer chunk")),n}function l(e,t){if(t.decoder&&!t.ended){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.length>0?c(e):v(e)}function c(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,t.sync?O(function(){f(e)}):f(e))}function f(e){e.emit("readable")}function d(e,t){t.readingMore||(t.readingMore=!0,O(function(){h(e,t)}))}function h(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function p(e){return function(){var t=e._readableState;t.awaitDrain--,0===t.awaitDrain&&g(e)}}function g(e){function t(e){var t=e.write(n);!1===t&&r.awaitDrain++}var n,r=e._readableState;for(r.awaitDrain=0;r.pipesCount&&null!==(n=e.read());)if(1===r.pipesCount?t(r.pipes,0,null):w(r.pipes,t),e.emit("data",n),r.awaitDrain>0)return;return 0===r.pipesCount?(r.flowing=!1,S.listenerCount(e,"data")>0&&b(e),void 0):(r.ranOut=!0,void 0)}function y(){this._readableState.ranOut&&(this._readableState.ranOut=!1,g(this))}function b(e,t){var n=e._readableState;if(n.flowing)throw Error("Cannot switch to old mode now.");var r=t||!1,o=!1;e.readable=!0,e.pipe=x.prototype.pipe,e.on=e.addListener=x.prototype.on,e.on("readable",function(){o=!0;for(var t;!r&&null!==(t=e.read());)e.emit("data",t);null===t&&(o=!1,e._readableState.needReadable=!0)}),e.pause=function(){r=!0,this.emit("pause")},e.resume=function(){r=!1,o?O(function(){e.emit("readable")}):this.read(0),this.emit("resume")},e.emit("readable")}function m(e,t){var n,r=t.buffer,o=t.length,i=!!t.decoder,a=!!t.objectMode;if(0===r.length)return null;if(0===o)n=null;else if(a)n=r.shift();else if(!e||e>=o)n=i?r.join(""):j.concat(r,o),r.length=0;else if(r[0].length>e){var s=r[0];n=s.slice(0,e),r[0]=s.slice(e)}else if(e===r[0].length)n=r.shift();else{n=i?"":new j(e);for(var u=0,l=0,c=r.length;c>l&&e>u;l++){var s=r[0],f=Math.min(e-u,s.length);i?n+=s.slice(0,f):s.copy(n,u,0,f),s.length>f?r[0]=s.slice(f):r.shift(),u+=f}}return n}function v(e){var t=e._readableState;if(t.length>0)throw Error("endReadable called on non-empty stream");!t.endEmitted&&t.calledRead&&(t.ended=!0,O(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function w(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n],n)}function _(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}var E=e("__browserify_process");t.exports=r,r.ReadableState=n;var k,S=e("events").EventEmitter,x=e("./index.js"),j=e("buffer").Buffer,O=e("setimmediate"),L=e("inherits");L(r,x),r.prototype.push=function(e,t){var n=this._readableState;return"string"!=typeof e||n.objectMode||(t=t||n.defaultEncoding,t!==n.encoding&&(e=new j(e,t),t="")),o(this,n,e,t,!1)},r.prototype.unshift=function(e){var t=this._readableState;return o(this,t,e,"",!0)},r.prototype.setEncoding=function(t){k||(k=e("string_decoder").StringDecoder),this._readableState.decoder=new k(t),this._readableState.encoding=t};var B=8388608;r.prototype.read=function(e){var t=this._readableState;t.calledRead=!0;var n=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return c(this),null;if(e=s(e,t),0===e&&t.ended)return 0===t.length&&v(this),null;var r=t.needReadable;t.length-e<=t.highWaterMark&&(r=!0),(t.ended||t.reading)&&(r=!1),r&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),r&&!t.reading&&(e=s(n,t));var o;return o=e>0?m(e,t):null,null===o&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),t.ended&&!t.endEmitted&&0===t.length&&v(this),o},r.prototype._read=function(){this.emit("error",Error("not implemented"))},r.prototype.pipe=function(e,t){function n(e){e===l&&o()}function r(){e.end()}function o(){e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("drain",h),e.removeListener("error",i),e.removeListener("unpipe",n),l.removeListener("end",r),l.removeListener("end",o),(!e._writableState||e._writableState.needDrain)&&h()}function i(t){u(),0===b&&0===S.listenerCount(e,"error")&&e.emit("error",t)}function a(){e.removeListener("finish",s),u()}function s(){e.removeListener("close",a),u()}function u(){l.unpipe(e)}var l=this,c=this._readableState;switch(c.pipesCount){case 0:c.pipes=e;break;case 1:c.pipes=[c.pipes,e];break;default:c.pipes.push(e)}c.pipesCount+=1;var f=(!t||t.end!==!1)&&e!==E.stdout&&e!==E.stderr,d=f?r:o;c.endEmitted?O(d):l.once("end",d),e.on("unpipe",n);var h=p(l);e.on("drain",h);var b=S.listenerCount(e,"error");return e.once("error",i),e.once("close",a),e.once("finish",s),e.emit("pipe",l),c.flowing||(this.on("readable",y),c.flowing=!0,O(function(){g(l)})),e},r.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,this.removeListener("readable",y),t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,this.removeListener("readable",y),t.flowing=!1;for(var o=0;r>o;o++)n[o].emit("unpipe",this);return this}var o=_(t.pipes,e);return-1===o?this:(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},r.prototype.on=function(e,t){var n=x.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||b(this),"readable"===e&&this.readable){var r=this._readableState;r.readableListening||(r.readableListening=!0,r.emittedReadable=!1,r.needReadable=!0,r.reading?r.length&&c(this,r):this.read(0))}return n},r.prototype.addListener=r.prototype.on,r.prototype.resume=function(){b(this),this.read(0),this.emit("resume")},r.prototype.pause=function(){b(this,!0),this.emit("pause")},r.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(o){if(t.decoder&&(o=t.decoder.write(o)),o&&(t.objectMode||o.length)){var i=r.push(o);i||(n=!0,e.pause())}});for(var o in e)"function"==typeof e[o]&&this[o]===void 0&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)
}}(o));var i=["error","close","destroy","pause","resume"];return w(i,function(t){e.on(t,function(e){return r.emit.apply(r,t,e)})}),r._read=function(){n&&(n=!1,e.resume())},r},r._fromList=m},{"./index.js":90,__browserify_process:86,buffer:87,events:83,inherits:84,setimmediate:91,string_decoder:96}],94:[function(e,t){function n(e,t){this.afterTransform=function(e,n){return r(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function r(e,t,n){var r=e._transformState;r.transforming=!1;var o=r.writecb;if(!o)return e.emit("error",Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!==n&&void 0!==n&&e.push(n),o&&o(t);var i=e._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&e._read(i.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);a.call(this,e),this._transformState=new n(e,this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,this.once("finish",function(){"function"==typeof this._flush?this._flush(function(e){i(t,e)}):i(t)})}function i(e,t){if(t)return e.emit("error",t);var n=e._writableState;e._readableState;var r=e._transformState;if(n.length)throw Error("calling transform done when ws.length != 0");if(r.transforming)throw Error("calling transform done when still transforming");return e.push(null)}t.exports=o;var a=e("./duplex.js"),s=e("inherits");s(o,a),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,a.prototype.push.call(this,e,t)},o.prototype._transform=function(){throw Error("not implemented")},o.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},o.prototype._read=function(){var e=this._transformState;e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0}},{"./duplex.js":89,inherits:84}],95:[function(e,t){function n(e,t,n){this.chunk=e,this.encoding=t,this.callback=n}function r(e,t){e=e||{};var n=e.highWaterMark;this.highWaterMark=n||0===n?n:16384,this.objectMode=!!e.objectMode,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var r=e.decodeStrings===!1;this.decodeStrings=!r,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){d(t,e)},this.writecb=null,this.writelen=0,this.buffer=[]}function o(e){return this instanceof o||this instanceof w.Duplex?(this._writableState=new r(e,this),this.writable=!0,w.call(this),void 0):new o(e)}function i(e,t,n){var r=Error("write after end");e.emit("error",r),_(function(){n(r)})}function a(e,t,n,r){var o=!0;if(!E.isBuffer(n)&&"string"!=typeof n&&null!==n&&void 0!==n&&!t.objectMode){var i=new TypeError("Invalid non-string/buffer chunk");e.emit("error",i),_(function(){r(i)}),o=!1}return o}function s(e,t,n){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=new E(t,n)),t}function u(e,t,r,o,i){r=s(t,r,o);var a=t.objectMode?1:r.length;t.length+=a;var u=t.length<t.highWaterMark;return t.needDrain=!u,t.writing?t.buffer.push(new n(r,o,i)):l(e,t,a,r,o,i),u}function l(e,t,n,r,o,i){t.writelen=n,t.writecb=i,t.writing=!0,t.sync=!0,e._write(r,o,t.onwrite),t.sync=!1}function c(e,t,n,r,o){n?_(function(){o(r)}):o(r),e.emit("error",r)}function f(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function d(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if(f(n),t)c(e,n,r,t,o);else{var i=y(e,n);i||n.bufferProcessing||!n.buffer.length||g(e,n),r?_(function(){h(e,n,i,o)}):h(e,n,i,o)}}function h(e,t,n,r){n||p(e,t),r(),n&&b(e,t)}function p(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function g(e,t){t.bufferProcessing=!0;for(var n=0;t.buffer.length>n;n++){var r=t.buffer[n],o=r.chunk,i=r.encoding,a=r.callback,s=t.objectMode?1:o.length;if(l(e,t,s,o,i,a),t.writing){n++;break}}t.bufferProcessing=!1,t.buffer.length>n?t.buffer=t.buffer.slice(n):t.buffer.length=0}function y(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function b(e,t){var n=y(e,t);return n&&(t.finished=!0,e.emit("finish")),n}function m(e,t,n){t.ending=!0,b(e,t),n&&(t.finished?_(n):e.once("finish",n)),t.ended=!0}t.exports=o,o.WritableState=r;var v=e("inherits"),w=e("./index.js"),_=e("setimmediate"),E=e("buffer").Buffer;v(o,w),o.prototype.pipe=function(){this.emit("error",Error("Cannot pipe. Not readable."))},o.prototype.write=function(e,t,n){var r=this._writableState,o=!1;return"function"==typeof t&&(n=t,t=null),E.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=function(){}),r.ended?i(this,r,n):a(this,r,e,n)&&(o=u(this,r,e,t,n)),o},o.prototype._write=function(e,t,n){n(Error("not implemented"))},o.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),e!==void 0&&null!==e&&this.write(e,t),r.ending||r.finished||m(this,r,n)}},{"./index.js":90,buffer:87,inherits:84,setimmediate:91}],96:[function(e,t,n){function r(e){if(e&&!s.isEncoding(e))throw Error("Unknown encoding: "+e)}function o(e){return e.toString(this.encoding)}function i(e){var t=this.charReceived=e.length%2;return this.charLength=t?2:0,t}function a(e){var t=this.charReceived=e.length%3;return this.charLength=t?3:0,t}var s=e("buffer").Buffer,u=n.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),r(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=i;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=a;break;default:return this.write=o,void 0}this.charBuffer=new s(6),this.charReceived=0,this.charLength=0};u.prototype.write=function(e){for(var t="",n=0;this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,n,r),this.charReceived+=r-n,n=r,this.charReceived<this.charLength)return"";t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var o=t.charCodeAt(t.length-1);if(!(o>=55296&&56319>=o)){if(this.charReceived=this.charLength=0,r==e.length)return t;e=e.slice(r,e.length);break}this.charLength+=this.surrogateSize,t=""}var i=this.detectIncompleteChar(e),a=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-i,a),this.charReceived=i,a-=i),t+=e.toString(this.encoding,0,a);var a=t.length-1,o=t.charCodeAt(a);if(o>=55296&&56319>=o){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),this.charBuffer.write(t.charAt(t.length-1),this.encoding),t.substring(0,a)}return t},u.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&6==n>>5){this.charLength=2;break}if(2>=t&&14==n>>4){this.charLength=3;break}if(3>=t&&30==n>>3){this.charLength=4;break}}return t},u.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,o=this.encoding;t+=r.slice(0,n).toString(o)}return t}},{buffer:87}],97:[function(e,t){t.exports=e(80)},{}],98:[function(e,t,n){function r(e,t){var r={seen:[],stylize:i};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),p(t)?r.showHidden=t:t&&n._extend(r,t),w(r.showHidden)&&(r.showHidden=!1),w(r.depth)&&(r.depth=2),w(r.colors)&&(r.colors=!1),w(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),s(r,e,r.depth)}function o(e,t){var n=r.styles[t];return n?"["+r.colors[n][0]+"m"+e+"["+r.colors[n][1]+"m":e}function i(e){return e}function a(e){var t={};return e.forEach(function(e){t[e]=!0}),t}function s(e,t,r){if(e.customInspect&&t&&x(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var o=t.inspect(r,e);return m(o)||(o=s(e,o,r)),o}var i=u(e,t);if(i)return i;var p=Object.keys(t),g=a(p);if(e.showHidden&&(p=Object.getOwnPropertyNames(t)),0===p.length){if(x(t)){var y=t.name?": "+t.name:"";return e.stylize("[Function"+y+"]","special")}if(_(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(k(t))return e.stylize(Date.prototype.toString.call(t),"date");if(S(t))return l(t)}var b="",v=!1,w=["{","}"];if(h(t)&&(v=!0,w=["[","]"]),x(t)){var E=t.name?": "+t.name:"";b=" [Function"+E+"]"}if(_(t)&&(b=" "+RegExp.prototype.toString.call(t)),k(t)&&(b=" "+Date.prototype.toUTCString.call(t)),S(t)&&(b=" "+l(t)),0===p.length&&(!v||0==t.length))return w[0]+b+w[1];if(0>r)return _(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var j;return j=v?c(e,t,r,g,p):p.map(function(n){return f(e,t,r,g,n,v)}),e.seen.pop(),d(j,b,w)}function u(e,t){if(w(t))return e.stylize("undefined","undefined");if(m(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return b(t)?e.stylize(""+t,"number"):p(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function c(e,t,n,r,o){for(var i=[],a=0,s=t.length;s>a;++a)I(t,a+"")?i.push(f(e,t,n,r,a+"",!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(f(e,t,n,r,o,!0))}),i}function f(e,t,n,r,o,i){var a,u,l;if(l=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},l.get?u=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(u=e.stylize("[Setter]","special")),I(r,o)||(a="["+o+"]"),u||(0>e.seen.indexOf(l.value)?(u=g(n)?s(e,l.value,null):s(e,l.value,n-1),u.indexOf("\n")>-1&&(u=i?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n"))):u=e.stylize("[Circular]","special")),w(a)){if(i&&o.match(/^\d+$/))return u;a=JSON.stringify(""+o),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+u}function d(e,t,n){var r=0,o=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function h(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function g(e){return null===e}function y(e){return null==e}function b(e){return"number"==typeof e}function m(e){return"string"==typeof e}function v(e){return"symbol"==typeof e}function w(e){return void 0===e}function _(e){return E(e)&&"[object RegExp]"===O(e)}function E(e){return"object"==typeof e&&null!==e}function k(e){return E(e)&&"[object Date]"===O(e)}function S(e){return E(e)&&("[object Error]"===O(e)||e instanceof Error)}function x(e){return"function"==typeof e}function j(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||e===void 0}function O(e){return Object.prototype.toString.call(e)}function L(e){return 10>e?"0"+e.toString(10):e.toString(10)}function B(){var e=new Date,t=[L(e.getHours()),L(e.getMinutes()),L(e.getSeconds())].join(":");return[e.getDate(),R[e.getMonth()],t].join(" ")}function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var T=e("__browserify_process"),D="undefined"!=typeof self?self:"undefined"!=typeof window?window:{},N=/%[sdj%]/g;n.format=function(e){if(!m(e)){for(var t=[],n=0;arguments.length>n;n++)t.push(r(arguments[n]));return t.join(" ")}for(var n=1,o=arguments,i=o.length,a=(e+"").replace(N,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return o[n++]+"";case"%d":return Number(o[n++]);case"%j":try{return JSON.stringify(o[n++])}catch(t){return"[Circular]"}default:return e}}),s=o[n];i>n;s=o[++n])a+=g(s)||!E(s)?" "+s:" "+r(s);return a},n.deprecate=function(e,t){function r(){if(!o){if(T.throwDeprecation)throw Error(t);T.traceDeprecation?console.trace(t):console.error(t),o=!0}return e.apply(this,arguments)}if(w(D.process))return function(){return n.deprecate(e,t).apply(this,arguments)};if(T.noDeprecation===!0)return e;var o=!1;return r};var A,U={};n.debuglog=function(e){if(w(A)&&(A=T.env.NODE_DEBUG||""),e=e.toUpperCase(),!U[e])if(RegExp("\\b"+e+"\\b","i").test(A)){var t=T.pid;U[e]=function(){var r=n.format.apply(n,arguments);console.error("%s %d: %s",e,t,r)}}else U[e]=function(){};return U[e]},n.inspect=r,r.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},r.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=h,n.isBoolean=p,n.isNull=g,n.isNullOrUndefined=y,n.isNumber=b,n.isString=m,n.isSymbol=v,n.isUndefined=w,n.isRegExp=_,n.isObject=E,n.isDate=k,n.isError=S,n.isFunction=x,n.isPrimitive=j,n.isBuffer=e("./support/isBuffer");var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",B(),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!E(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}},{"./support/isBuffer":97,__browserify_process:86,inherits:84}]},{},[]);var MemDB=require("memdb"),db=MemDB();console.log("memdb db = ",db);
<style type='text/css'>html, body { margin: 0; padding: 0; border: 0; }
body, html { height: 100%; width: 100%; }</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment