Skip to content

Instantly share code, notes, and snippets.

@calvinmetcalf
Created April 2, 2014 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calvinmetcalf/9934394 to your computer and use it in GitHub Desktop.
Save calvinmetcalf/9934394 to your computer and use it in GitHub Desktop.
requirebin sketch
var test = require('tape');
var PouchDB = require('pouchdb');
var immediate = require('immediate');
test('benchmarking', function (t) {
var db;
t.test('setup', function (t){
new PouchDB('test').then(function (d) {
d.destroy().then(function () {
new PouchDB('test').then(function (d) {
db = d;
console.time('inserts');
t.end();
});
});
});
});
t.test('meat', function(t) {
t.plan(10);
var num = 10;
function after(err){
if (err) {
t.error(err);
}
t.ok(num--);
if (num) {
immediate(function (){
db.put({'yo': 'dawg'}, '' + num, after);
});
}
}
db.put({'yo': 'dawg'}, '' + num, after);
});
t.test('teardown', function (t){
console.timeEnd('inserts');
db.destroy(function() {
t.end();
});
});
});
require=function e(t,n,r){function o(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);throw Error("Cannot find module '"+s+"'")}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return o(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;r.length>s;s++)o(r[s]);return o}({1:[function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function o(e){return"number"==typeof e}function i(e){return"object"==typeof e&&null!==e}function s(e){return void 0===e}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!o(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,o,a,u,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length))throw t=arguments[1],t instanceof Error?t:TypeError('Uncaught, unspecified "error" event.');if(n=this._events[e],s(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(o=arguments.length,a=Array(o-1),u=1;o>u;u++)a[u-1]=arguments[u];n.apply(this,a)}else if(i(n)){for(o=arguments.length,a=Array(o-1),u=1;o>u;u++)a[u-1]=arguments[u];for(c=n.slice(),o=c.length,u=0;o>u;u++)c[u].apply(this,a)}return!0},n.prototype.addListener=function(e,t){var o;if(!r(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?i(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,i(this._events[e])&&!this._events[e].warned){var o;o=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,o&&o>0&&this._events[e].length>o&&(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())}return this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),o||(o=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var o=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,o,s,a;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],s=n.length,o=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(n)){for(a=s;a-->0;)if(n[a]===t||n[a].listener&&n[a].listener===t){o=a;break}if(0>o)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.listenerCount=function(e,t){var n;return n=e._events&&e._events[t]?r(e._events[t])?1:e._events[t].length:0}},{}],2:[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}},{}],3:[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){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var r=n.shift();r()}},!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")}},{}],4:[function(e,t,n){function r(e,t,n){if(!(this instanceof r))return new r(e,t,n);var o=typeof e;if("base64"===t&&"string"===o)for(e=j(e);0!==e.length%4;)e+="=";var i;if("number"===o)i=L(e);else if("string"===o)i=r.byteLength(e,t);else{if("object"!==o)throw Error("First argument needs to be a number, array or string.");i=L(e.length)}var s;r._useTypedArrays?s=O(new Uint8Array(i)):(s=this,s.length=i,s._isBuffer=!0);var a;if(r._useTypedArrays&&"function"==typeof Uint8Array&&e instanceof Uint8Array)s._set(e);else if(N(e))for(a=0;i>a;a++)s[a]=r.isBuffer(e)?e.readUInt8(a):e[a];else if("string"===o)s.write(e,0,t);else if("number"===o&&!r._useTypedArrays&&!n)for(a=0;i>a;a++)s[a]=0;return s}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 s=t.length;F(0===s%2,"Invalid hex string"),o>s/2&&(o=s/2);for(var a=0;o>a;a++){var u=parseInt(t.substr(2*a,2),16);F(!isNaN(u),"Invalid hex string"),e[n+a]=u}return r._charsWritten=2*a,a}function i(e,t,n,o){var i=r._charsWritten=C(T(t),e,n,o);return i}function s(e,t,n,o){var i=r._charsWritten=C(R(t),e,n,o);return i}function a(e,t,n,r){return s(e,t,n,r)}function u(e,t,n,o){var i=r._charsWritten=C(B(t),e,n,o);return i}function c(e,t,n){return 0===t&&n===e.length?W.fromByteArray(e):W.fromByteArray(e.slice(t,n))}function l(e,t,n){var r="",o="";n=Math.min(e.length,n);for(var i=t;n>i;i++)127>=e[i]?(r+=q(o)+String.fromCharCode(e[i]),o=""):o+="%"+e[i].toString(16);return r+q(o)}function d(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;n>o;o++)r+=String.fromCharCode(e[o]);return r}function f(e,t,n){return d(e,t,n)}function h(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+=D(e[i]);return o}function p(e,t,n,r){r||(F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==t&&null!==t,"missing offset"),F(e.length>t+1,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){var i;return n?(i=e[t],o>t+1&&(i|=e[t+1]<<8)):(i=e[t]<<8,o>t+1&&(i|=e[t+1])),i}}function v(e,t,n,r){r||(F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==t&&null!==t,"missing offset"),F(e.length>t+3,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){var i;return n?(o>t+2&&(i=e[t+2]<<16),o>t+1&&(i|=e[t+1]<<8),i|=e[t],o>t+3&&(i+=e[t+3]<<24>>>0)):(o>t+1&&(i=e[t+1]<<16),o>t+2&&(i|=e[t+2]<<8),o>t+3&&(i|=e[t+3]),i+=e[t]<<24>>>0),i}}function g(e,t,n,r){r||(F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==t&&null!==t,"missing offset"),F(e.length>t+1,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){var i=p(e,t,n,!0),s=32768&i;return s?-1*(65535-i+1):i}}function m(e,t,n,r){r||(F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==t&&null!==t,"missing offset"),F(e.length>t+3,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){var i=v(e,t,n,!0),s=2147483648&i;return s?-1*(4294967295-i+1):i}}function y(e,t,n,r){return r||(F("boolean"==typeof n,"missing or invalid endian"),F(e.length>t+3,"Trying to read beyond buffer length")),z.read(e,t,n,23,4)}function b(e,t,n,r){return r||(F("boolean"==typeof n,"missing or invalid endian"),F(e.length>t+7,"Trying to read beyond buffer length")),z.read(e,t,n,52,8)}function w(e,t,n,r,o){o||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(e.length>n+1,"trying to write beyond buffer length"),M(t,65535));var i=e.length;if(!(n>=i))for(var s=0,a=Math.min(i-n,2);a>s;s++)e[n+s]=(t&255<<8*(r?s:1-s))>>>8*(r?s:1-s)}function _(e,t,n,r,o){o||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(e.length>n+3,"trying to write beyond buffer length"),M(t,4294967295));var i=e.length;if(!(n>=i))for(var s=0,a=Math.min(i-n,4);a>s;s++)e[n+s]=255&t>>>8*(r?s:3-s)}function E(e,t,n,r,o){o||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(e.length>n+1,"Trying to write beyond buffer length"),U(t,32767,-32768));var i=e.length;n>=i||(t>=0?w(e,t,n,r,o):w(e,65535+t+1,n,r,o))}function k(e,t,n,r,o){o||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(e.length>n+3,"Trying to write beyond buffer length"),U(t,2147483647,-2147483648));var i=e.length;n>=i||(t>=0?_(e,t,n,r,o):_(e,4294967295+t+1,n,r,o))}function S(e,t,n,r,o){o||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(e.length>n+3,"Trying to write beyond buffer length"),P(t,3.4028234663852886e38,-3.4028234663852886e38));var i=e.length;n>=i||z.write(e,t,n,r,23,4)}function x(e,t,n,r,o){o||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(e.length>n+7,"Trying to write beyond buffer length"),P(t,1.7976931348623157e308,-1.7976931348623157e308));var i=e.length;n>=i||z.write(e,t,n,r,52,8)}function j(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function O(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=K.get,e.set=K.set,e.write=K.write,e.toString=K.toString,e.toLocaleString=K.toString,e.toJSON=K.toJSON,e.copy=K.copy,e.slice=K.slice,e.readUInt8=K.readUInt8,e.readUInt16LE=K.readUInt16LE,e.readUInt16BE=K.readUInt16BE,e.readUInt32LE=K.readUInt32LE,e.readUInt32BE=K.readUInt32BE,e.readInt8=K.readInt8,e.readInt16LE=K.readInt16LE,e.readInt16BE=K.readInt16BE,e.readInt32LE=K.readInt32LE,e.readInt32BE=K.readInt32BE,e.readFloatLE=K.readFloatLE,e.readFloatBE=K.readFloatBE,e.readDoubleLE=K.readDoubleLE,e.readDoubleBE=K.readDoubleBE,e.writeUInt8=K.writeUInt8,e.writeUInt16LE=K.writeUInt16LE,e.writeUInt16BE=K.writeUInt16BE,e.writeUInt32LE=K.writeUInt32LE,e.writeUInt32BE=K.writeUInt32BE,e.writeInt8=K.writeInt8,e.writeInt16LE=K.writeInt16LE,e.writeInt16BE=K.writeInt16BE,e.writeInt32LE=K.writeInt32LE,e.writeInt32BE=K.writeInt32BE,e.writeFloatLE=K.writeFloatLE,e.writeFloatBE=K.writeFloatBE,e.writeDoubleLE=K.writeDoubleLE,e.writeDoubleBE=K.writeDoubleBE,e.fill=K.fill,e.inspect=K.inspect,e.toArrayBuffer=K.toArrayBuffer,e}function A(e,t,n){return"number"!=typeof e?n:(e=~~e,e>=t?t:e>=0?e:(e+=t,e>=0?e:0))}function L(e){return e=~~Math.ceil(+e),0>e?0:e}function I(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function N(e){return I(e)||r.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function D(e){return 16>e?"0"+e.toString(16):e.toString(16)}function T(e){for(var t=[],n=0;e.length>n;n++){var r=e.charCodeAt(n);if(127>=r)t.push(e.charCodeAt(n));else{var o=n;r>=55296&&57343>=r&&n++;for(var i=encodeURIComponent(e.slice(o,n+1)).substr(1).split("%"),s=0;i.length>s;s++)t.push(parseInt(i[s],16))}}return t}function R(e){for(var t=[],n=0;e.length>n;n++)t.push(255&e.charCodeAt(n));return t}function B(e){return W.toByteArray(e)}function C(e,t,n,r){for(var o=0;r>o&&!(o+n>=t.length||o>=e.length);o++)t[o+n]=e[o];return o}function q(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function M(e,t){F("number"==typeof e,"cannot write a non-number as a number"),F(e>=0,"specified a negative value for writing an unsigned value"),F(t>=e,"value is larger than maximum value for type"),F(Math.floor(e)===e,"value has a fractional component")}function U(e,t,n){F("number"==typeof e,"cannot write a non-number as a number"),F(t>=e,"value larger than maximum allowed value"),F(e>=n,"value smaller than minimum allowed value"),F(Math.floor(e)===e,"value has a fractional component")}function P(e,t,n){F("number"==typeof e,"cannot write a non-number as a number"),F(t>=e,"value larger than maximum allowed value"),F(e>=n,"value smaller than minimum allowed value")}function F(e,t){if(!e)throw Error(t||"Failed assertion")}var W=e("base64-js"),z=e("ieee754");n.Buffer=r,n.SlowBuffer=r,n.INSPECT_MAX_BYTES=50,r.poolSize=8192,r._useTypedArrays=function(){if("undefined"==typeof Uint8Array||"undefined"==typeof ArrayBuffer)return!1;try{var e=new Uint8Array(0);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray}catch(t){return!1}}(),r.isEncoding=function(e){switch((e+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},r.isBuffer=function(e){return!(null===e||void 0===e||!e._isBuffer)},r.byteLength=function(e,t){var n;switch(e+="",t||"utf8"){case"hex":n=e.length/2;break;case"utf8":case"utf-8":n=T(e).length;break;case"ascii":case"binary":case"raw":n=e.length;break;case"base64":n=B(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*e.length;break;default:throw Error("Unknown encoding")}return n},r.concat=function(e,t){if(F(I(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new r(0);if(1===e.length)return e[0];var n;if("number"!=typeof t)for(t=0,n=0;e.length>n;n++)t+=e[n].length;var o=new r(t),i=0;for(n=0;e.length>n;n++){var s=e[n];s.copy(o,i),i+=s.length}return o},r.prototype.write=function(e,t,n,r){if(isFinite(t))isFinite(n)||(r=n,n=void 0);else{var c=r;r=t,t=n,n=c}t=Number(t)||0;var l=this.length-t;switch(n?(n=Number(n),n>l&&(n=l)):n=l,r=((r||"utf8")+"").toLowerCase()){case"hex":return o(this,e,t,n);case"utf8":case"utf-8":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i(this,e,t,n);case"ascii":return s(this,e,t,n);case"binary":return a(this,e,t,n);case"base64":return u(this,e,t,n);default:throw Error("Unknown encoding")}},r.prototype.toString=function(e,t,n){var r=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 h(r,t,n);case"utf8":case"utf-8":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l(r,t,n);case"ascii":return d(r,t,n);case"binary":return f(r,t,n);case"base64":return c(r,t,n);default:throw Error("Unknown encoding")}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},r.prototype.copy=function(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){F(r>=n,"sourceEnd < sourceStart"),F(t>=0&&e.length>t,"targetStart out of bounds"),F(n>=0&&o.length>n,"sourceStart out of bounds"),F(r>=0&&o.length>=r,"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]}},r.prototype.slice=function(e,t){var n=this.length;if(e=A(e,n,0),t=A(t,n,n),r._useTypedArrays)return O(this.subarray(e,t));for(var o=t-e,i=new r(o,void 0,!0),s=0;o>s;s++)i[s]=this[s+e];return i},r.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},r.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},r.prototype.readUInt8=function(e,t){return t||(F(void 0!==e&&null!==e,"missing offset"),F(this.length>e,"Trying to read beyond buffer length")),e>=this.length?void 0:this[e]},r.prototype.readUInt16LE=function(e,t){return p(this,e,!0,t)},r.prototype.readUInt16BE=function(e,t){return p(this,e,!1,t)},r.prototype.readUInt32LE=function(e,t){return v(this,e,!0,t)},r.prototype.readUInt32BE=function(e,t){return v(this,e,!1,t)},r.prototype.readInt8=function(e,t){if(t||(F(void 0!==e&&null!==e,"missing offset"),F(this.length>e,"Trying to read beyond buffer length")),!(e>=this.length)){var n=128&this[e];return n?-1*(255-this[e]+1):this[e]}},r.prototype.readInt16LE=function(e,t){return g(this,e,!0,t)},r.prototype.readInt16BE=function(e,t){return g(this,e,!1,t)},r.prototype.readInt32LE=function(e,t){return m(this,e,!0,t)},r.prototype.readInt32BE=function(e,t){return m(this,e,!1,t)},r.prototype.readFloatLE=function(e,t){return y(this,e,!0,t)},r.prototype.readFloatBE=function(e,t){return y(this,e,!1,t)},r.prototype.readDoubleLE=function(e,t){return b(this,e,!0,t)},r.prototype.readDoubleBE=function(e,t){return b(this,e,!1,t)},r.prototype.writeUInt8=function(e,t,n){n||(F(void 0!==e&&null!==e,"missing value"),F(void 0!==t&&null!==t,"missing offset"),F(this.length>t,"trying to write beyond buffer length"),M(e,255)),t>=this.length||(this[t]=e)},r.prototype.writeUInt16LE=function(e,t,n){w(this,e,t,!0,n)},r.prototype.writeUInt16BE=function(e,t,n){w(this,e,t,!1,n)},r.prototype.writeUInt32LE=function(e,t,n){_(this,e,t,!0,n)},r.prototype.writeUInt32BE=function(e,t,n){_(this,e,t,!1,n)},r.prototype.writeInt8=function(e,t,n){n||(F(void 0!==e&&null!==e,"missing value"),F(void 0!==t&&null!==t,"missing offset"),F(this.length>t,"Trying to write beyond buffer length"),U(e,127,-128)),t>=this.length||(e>=0?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n))},r.prototype.writeInt16LE=function(e,t,n){E(this,e,t,!0,n)},r.prototype.writeInt16BE=function(e,t,n){E(this,e,t,!1,n)},r.prototype.writeInt32LE=function(e,t,n){k(this,e,t,!0,n)},r.prototype.writeInt32BE=function(e,t,n){k(this,e,t,!1,n)},r.prototype.writeFloatLE=function(e,t,n){S(this,e,t,!0,n)},r.prototype.writeFloatBE=function(e,t,n){S(this,e,t,!1,n)},r.prototype.writeDoubleLE=function(e,t,n){x(this,e,t,!0,n)},r.prototype.writeDoubleBE=function(e,t,n){x(this,e,t,!1,n)},r.prototype.fill=function(e,t,n){if(e||(e=0),t||(t=0),n||(n=this.length),"string"==typeof e&&(e=e.charCodeAt(0)),F("number"==typeof e&&!isNaN(e),"value is not a number"),F(n>=t,"end < start"),n!==t&&0!==this.length){F(t>=0&&this.length>t,"start out of bounds"),F(n>=0&&this.length>=n,"end out of bounds");for(var r=t;n>r;r++)this[r]=e}},r.prototype.inspect=function(){for(var e=[],t=this.length,r=0;t>r;r++)if(e[r]=D(this[r]),r===n.INSPECT_MAX_BYTES){e[r+1]="...";break}return"<Buffer "+e.join(" ")+">"},r.prototype.toArrayBuffer=function(){if("function"==typeof Uint8Array){if(r._useTypedArrays)return new r(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;n>t;t+=1)e[t]=this[t];return e.buffer}throw Error("Buffer.toArrayBuffer not supported in this browser")};var K=r.prototype},{"base64-js":5,ieee754:6}],5:[function(e,t){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(){"use strict";function e(e){var t=e.charCodeAt(0);return t===s?62:t===a?63:u>t?-1:u+10>t?t-u+26+26:l+26>t?t-l:c+26>t?t-c+26:void 0}function r(t){function n(e){c[d++]=e}var r,o,s,a,u,c;if(t.length%4>0)throw Error("Invalid string. Length must be a multiple of 4");var l=t.length;u="="===t.charAt(l-2)?2:"="===t.charAt(l-1)?1:0,c=new i(3*t.length/4-u),s=u>0?t.length-4:t.length;var d=0;for(r=0,o=0;s>r;r+=4,o+=3)a=e(t.charAt(r))<<18|e(t.charAt(r+1))<<12|e(t.charAt(r+2))<<6|e(t.charAt(r+3)),n((16711680&a)>>16),n((65280&a)>>8),n(255&a);return 2===u?(a=e(t.charAt(r))<<2|e(t.charAt(r+1))>>4,n(255&a)):1===u&&(a=e(t.charAt(r))<<10|e(t.charAt(r+1))<<4|e(t.charAt(r+2))>>2,n(255&a>>8),n(255&a)),c}function o(e){function t(e){return n.charAt(e)}function r(e){return t(63&e>>18)+t(63&e>>12)+t(63&e>>6)+t(63&e)}var o,i,s,a=e.length%3,u="";for(o=0,s=e.length-a;s>o;o+=3)i=(e[o]<<16)+(e[o+1]<<8)+e[o+2],u+=r(i);switch(a){case 1:i=e[e.length-1],u+=t(i>>2),u+=t(63&i<<4),u+="==";break;case 2:i=(e[e.length-2]<<8)+e[e.length-1],u+=t(i>>10),u+=t(63&i>>4),u+=t(63&i<<2),u+="="}return u}var i="undefined"!=typeof Uint8Array?Uint8Array:Array;"0".charCodeAt(0);var s="+".charCodeAt(0),a="/".charCodeAt(0),u="0".charCodeAt(0),c="a".charCodeAt(0),l="A".charCodeAt(0);t.exports.toByteArray=r,t.exports.fromByteArray=o})()},{}],6:[function(e,t,n){n.read=function(e,t,n,r,o){var i,s,a=8*o-r-1,u=(1<<a)-1,c=u>>1,l=-7,d=n?o-1:0,f=n?-1:1,h=e[t+d];for(d+=f,i=h&(1<<-l)-1,h>>=-l,l+=a;l>0;i=256*i+e[t+d],d+=f,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=r;l>0;s=256*s+e[t+d],d+=f,l-=8);if(0===i)i=1-c;else{if(i===u)return s?0/0:1/0*(h?-1:1);s+=Math.pow(2,r),i-=c}return(h?-1:1)*s*Math.pow(2,i-r)},n.write=function(e,t,n,r,o,i){var s,a,u,c=8*i-o-1,l=(1<<c)-1,d=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,v=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),1>t*(u=Math.pow(2,-s))&&(s--,u*=2),t+=s+d>=1?f/u:f*Math.pow(2,1-d),t*u>=2&&(s++,u/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(t*u-1)*Math.pow(2,o),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,o),s=0));o>=8;e[n+h]=255&a,h+=p,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;e[n+h]=255&s,h+=p,s/=256,c-=8);e[n+h-p]|=128*v}},{}],7:[function(e,t,n){(function(e){function t(e,t){for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;e.length>r;r++)t(e[r],r,e)&&n.push(e[r]);return n}var o=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(e){return o.exec(e).slice(1)};n.resolve=function(){for(var n="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var s=i>=0?arguments[i]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(n=s+"/"+n,o="/"===s.charAt(0))}return n=t(r(n.split("/"),function(e){return!!e}),!o).join("/"),(o?"/":"")+n||"."},n.normalize=function(e){var o=n.isAbsolute(e),i="/"===s(e,-1);return e=t(r(e.split("/"),function(e){return!!e}),!o).join("/"),e||o||(e="."),e&&i&&(e+="/"),(o?"/":"")+e},n.isAbsolute=function(e){return"/"===e.charAt(0)},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(r(e,function(e){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},n.relative=function(e,t){function r(e){for(var t=0;e.length>t&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=n.resolve(e).substr(1),t=n.resolve(t).substr(1);for(var o=r(e.split("/")),i=r(t.split("/")),s=Math.min(o.length,i.length),a=s,u=0;s>u;u++)if(o[u]!==i[u]){a=u;break}for(var c=[],u=a;o.length>u;u++)c.push("..");return c=c.concat(i.slice(a)),c.join("/")},n.sep="/",n.delimiter=":",n.dirname=function(e){var t=i(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},n.basename=function(e,t){var n=i(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},n.extname=function(e){return i(e)[3]};var s="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return 0>t&&(t=e.length+t),e.substr(t,n)}}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":3}],8:[function(e,t){function n(e){return this instanceof n?(s.call(this,e),a.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("process/browser.js").nextTick,s=e("./readable.js"),a=e("./writable.js");o(n,s),n.prototype.write=a.prototype.write,n.prototype.end=a.prototype.end,n.prototype._write=a.prototype._write},{"./readable.js":12,"./writable.js":14,inherits:2,"process/browser.js":10}],9:[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)&&c.pause&&c.pause()}function o(){c.readable&&c.resume&&c.resume()}function i(){l||(l=!0,e.end())}function s(){l||(l=!0,"function"==typeof e.destroy&&e.destroy())}function a(e){if(u(),0===r.listenerCount(this,"error"))throw e}function u(){c.removeListener("data",n),e.removeListener("drain",o),c.removeListener("end",i),c.removeListener("close",s),c.removeListener("error",a),e.removeListener("error",a),c.removeListener("end",u),c.removeListener("close",u),e.removeListener("close",u)}var c=this;c.on("data",n),e.on("drain",o),e._isStdio||t&&t.end===!1||(c.on("end",i),c.on("close",s));var l=!1;return c.on("error",a),e.on("error",a),c.on("end",u),c.on("close",u),e.on("close",u),e.emit("pipe",c),e}},{"./duplex.js":8,"./passthrough.js":11,"./readable.js":12,"./transform.js":13,"./writable.js":14,events:1,inherits:2}],10:[function(e,t){t.exports=e(3)},{}],11:[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":13,inherits:2}],12:[function(e,t){(function(n){function r(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 o(e){return this instanceof o?(this._readableState=new r(e,this),this.readable=!0,x.call(this),void 0):new o(e)}function i(e,t,n,r,o){var i=c(t,n);if(i)e.emit("error",i);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 a=Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&o){var a=Error("stream.unshift() after end event");e.emit("error",a)}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&&d(e),h(e,t);else o||(t.reading=!1);return s(t)}function s(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function a(e){if(e>=L)e=L;else{e--;for(var t=1;32>t;t<<=1)e|=e>>t;e++}return e}function u(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 c(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?d(e):w(e)}function d(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 h(e,t){t.readingMore||(t.readingMore=!0,O(function(){p(e,t)}))}function p(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 v(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,t),e.emit("data",n),r.awaitDrain>0)return;return 0===r.pipesCount?(r.flowing=!1,S.listenerCount(e,"data")>0&&y(e),void 0):(r.ranOut=!0,void 0)}function m(){this._readableState.ranOut&&(this._readableState.ranOut=!1,g(this))}function y(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 b(e,t){var n,r=t.buffer,o=t.length,i=!!t.decoder,s=!!t.objectMode;if(0===r.length)return null;if(0===o)n=null;else if(s)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 a=r[0];n=a.slice(0,e),r[0]=a.slice(e)}else if(e===r[0].length)n=r.shift();else{n=i?"":new j(e);for(var u=0,c=0,l=r.length;l>c&&e>u;c++){var a=r[0],d=Math.min(e-u,a.length);i?n+=a.slice(0,d):a.copy(n,u,0,d),a.length>d?r[0]=a.slice(d):r.shift(),u+=d}}return n}function w(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 _(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n],n)}function E(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}t.exports=o,o.ReadableState=r;var k,S=e("events").EventEmitter,x=e("./index.js"),j=e("buffer").Buffer,O=e("process/browser.js").nextTick,A=e("inherits");A(o,x),o.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="")),i(this,n,e,t,!1)},o.prototype.unshift=function(e){var t=this._readableState;return i(this,t,e,"",!0)},o.prototype.setEncoding=function(t){k||(k=e("string_decoder").StringDecoder),this._readableState.decoder=new k(t),this._readableState.encoding=t};var L=8388608;o.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 d(this),null;if(e=u(e,t),0===e&&t.ended)return 0===t.length&&w(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=u(n,t));var o;return o=e>0?b(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&&w(this),o},o.prototype._read=function(){this.emit("error",Error("not implemented"))},o.prototype.pipe=function(e,t){function r(e){e===l&&i()}function o(){e.end()}function i(){e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("drain",p),e.removeListener("error",s),e.removeListener("unpipe",r),l.removeListener("end",o),l.removeListener("end",i),(!e._writableState||e._writableState.needDrain)&&p()}function s(t){c(),0===y&&0===S.listenerCount(e,"error")&&e.emit("error",t)}function a(){e.removeListener("finish",u),c()}function u(){e.removeListener("close",a),c()}function c(){l.unpipe(e)}var l=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)
}d.pipesCount+=1;var f=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr,h=f?o:i;d.endEmitted?O(h):l.once("end",h),e.on("unpipe",r);var p=v(l);e.on("drain",p);var y=S.listenerCount(e,"error");return e.once("error",s),e.once("close",a),e.once("finish",u),e.emit("pipe",l),d.flowing||(this.on("readable",m),d.flowing=!0,O(function(){g(l)})),e},o.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",m),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",m),t.flowing=!1;for(var o=0;r>o;o++)n[o].emit("unpipe",this);return this}var o=E(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)},o.prototype.on=function(e,t){var n=x.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||y(this),"readable"===e&&this.readable){var r=this._readableState;r.readableListening||(r.readableListening=!0,r.emittedReadable=!1,r.needReadable=!0,r.reading?r.length&&d(this,r):this.read(0))}return n},o.prototype.addListener=o.prototype.on,o.prototype.resume=function(){y(this),this.read(0),this.emit("resume")},o.prototype.pause=function(){y(this,!0),this.emit("pause")},o.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,function(t){e.on(t,function(e){return r.emit.apply(r,t,e)})}),r._read=function(){n&&(n=!1,e.resume())},r},o._fromList=b}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"./index.js":9,"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":3,buffer:4,events:1,inherits:2,"process/browser.js":10,string_decoder:15}],13:[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);s.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 s=e("./duplex.js"),a=e("inherits");a(o,s),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.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":8,inherits:2}],14:[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){f(t,e)},this.writecb=null,this.writelen=0,this.buffer=[]}function o(e){return this instanceof o||this instanceof E.Duplex?(this._writableState=new r(e,this),this.writable=!0,E.call(this),void 0):new o(e)}function i(e,t,n){var r=Error("write after end");e.emit("error",r),k(function(){n(r)})}function s(e,t,n,r){var o=!0;if(!S.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),k(function(){r(i)}),o=!1}return o}function a(e,t,n){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=new S(t,n)),t}function u(e,t,r,o,i){r=a(t,r,o);var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;return t.needDrain=!u,t.writing?t.buffer.push(new n(r,o,i)):c(e,t,s,r,o,i),u}function c(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 l(e,t,n,r,o){n?k(function(){o(r)}):o(r),e.emit("error",r)}function d(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function f(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if(d(n),t)l(e,n,r,t,o);else{var i=g(e,n);i||n.bufferProcessing||!n.buffer.length||v(e,n),r?k(function(){h(e,n,i,o)}):h(e,n,i,o)}}function h(e,t,n,r){n||p(e,t),r(),n&&m(e,t)}function p(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function v(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,s=r.callback,a=t.objectMode?1:o.length;if(c(e,t,a,o,i,s),t.writing){n++;break}}t.bufferProcessing=!1,t.buffer.length>n?t.buffer=t.buffer.slice(n):t.buffer.length=0}function g(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function m(e,t){var n=g(e,t);return n&&(t.finished=!0,e.emit("finish")),n}function y(e,t,n){t.ending=!0,m(e,t),n&&(t.finished?k(n):e.once("finish",n)),t.ended=!0}t.exports=o,o.WritableState=r;var b="undefined"!=typeof Uint8Array?function(e){return e instanceof Uint8Array}:function(e){return e&&e.constructor&&"Uint8Array"===e.constructor.name},w="undefined"!=typeof ArrayBuffer?function(e){return e instanceof ArrayBuffer}:function(e){return e&&e.constructor&&"ArrayBuffer"===e.constructor.name},_=e("inherits"),E=e("./index.js"),k=e("process/browser.js").nextTick,S=e("buffer").Buffer;_(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),!S.isBuffer(e)&&b(e)&&(e=new S(e)),w(e)&&"undefined"!=typeof Uint8Array&&(e=new S(new Uint8Array(e))),S.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=function(){}),r.ended?i(this,r,n):s(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||y(this,r,n)}},{"./index.js":9,buffer:4,inherits:2,"process/browser.js":10}],15:[function(e,t,n){function r(e){if(e&&!a.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 s(e){var t=this.charReceived=e.length%3;return this.charLength=t?3:0,t}var a=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=s;break;default:return this.write=o,void 0}this.charBuffer=new a(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),s=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-i,s),this.charReceived=i,s-=i),t+=e.toString(this.encoding,0,s);var s=t.length-1,o=t.charCodeAt(s);if(o>=55296&&56319>=o){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),this.charBuffer.write(t.charAt(t.length-1),this.encoding),t.substring(0,s)}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:4}],16:[function(e,t){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],17:[function(e,t,n){(function(t,r){function o(e,t){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),v(t)?r.showHidden=t:t&&n._extend(r,t),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=i),u(r,e,r.depth)}function i(e,t){var n=o.styles[t];return n?"["+o.colors[n][0]+"m"+e+"["+o.colors[n][1]+"m":e}function s(e){return e}function a(e){var t={};return e.forEach(function(e){t[e]=!0}),t}function u(e,t,r){if(e.customInspect&&t&&j(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var o=t.inspect(r,e);return b(o)||(o=u(e,o,r)),o}var i=c(e,t);if(i)return i;var s=Object.keys(t),v=a(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),x(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(t);if(0===s.length){if(j(t)){var g=t.name?": "+t.name:"";return e.stylize("[Function"+g+"]","special")}if(E(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(S(t))return e.stylize(Date.prototype.toString.call(t),"date");if(x(t))return l(t)}var m="",y=!1,w=["{","}"];if(p(t)&&(y=!0,w=["[","]"]),j(t)){var _=t.name?": "+t.name:"";m=" [Function"+_+"]"}if(E(t)&&(m=" "+RegExp.prototype.toString.call(t)),S(t)&&(m=" "+Date.prototype.toUTCString.call(t)),x(t)&&(m=" "+l(t)),0===s.length&&(!y||0==t.length))return w[0]+m+w[1];if(0>r)return E(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var k;return k=y?d(e,t,r,v,s):s.map(function(n){return f(e,t,r,v,n,y)}),e.seen.pop(),h(k,m,w)}function c(e,t){if(_(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return y(t)?e.stylize(""+t,"number"):v(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,n,r,o){for(var i=[],s=0,a=t.length;a>s;++s)N(t,s+"")?i.push(f(e,t,n,r,s+"",!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 s,a,c;if(c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},c.get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),N(r,o)||(s="["+o+"]"),a||(0>e.seen.indexOf(c.value)?(a=g(n)?u(e,c.value,null):u(e,c.value,n-1),a.indexOf("\n")>-1&&(a=i?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),_(s)){if(i&&o.match(/^\d+$/))return a;s=JSON.stringify(""+o),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function h(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 p(e){return Array.isArray(e)}function v(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return null==e}function y(e){return"number"==typeof e}function b(e){return"string"==typeof e}function w(e){return"symbol"==typeof e}function _(e){return void 0===e}function E(e){return k(e)&&"[object RegExp]"===A(e)}function k(e){return"object"==typeof e&&null!==e}function S(e){return k(e)&&"[object Date]"===A(e)}function x(e){return k(e)&&("[object Error]"===A(e)||e instanceof Error)}function j(e){return"function"==typeof e}function O(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||e===void 0}function A(e){return Object.prototype.toString.call(e)}function L(e){return 10>e?"0"+e.toString(10):e.toString(10)}function I(){var e=new Date,t=[L(e.getHours()),L(e.getMinutes()),L(e.getSeconds())].join(":");return[e.getDate(),B[e.getMonth()],t].join(" ")}function N(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var D=/%[sdj%]/g;n.format=function(e){if(!b(e)){for(var t=[],n=0;arguments.length>n;n++)t.push(o(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,i=r.length,s=(e+"").replace(D,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return r[n++]+"";case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}}),a=r[n];i>n;a=r[++n])s+=g(a)||!k(a)?" "+a:" "+o(a);return s},n.deprecate=function(e,o){function i(){if(!s){if(t.throwDeprecation)throw Error(o);t.traceDeprecation?console.trace(o):console.error(o),s=!0}return e.apply(this,arguments)}if(_(r.process))return function(){return n.deprecate(e,o).apply(this,arguments)};if(t.noDeprecation===!0)return e;var s=!1;return i};var T,R={};n.debuglog=function(e){if(_(T)&&(T=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!R[e])if(RegExp("\\b"+e+"\\b","i").test(T)){var r=t.pid;R[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else R[e]=function(){};return R[e]},n.inspect=o,o.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]},o.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=p,n.isBoolean=v,n.isNull=g,n.isNullOrUndefined=m,n.isNumber=y,n.isString=b,n.isSymbol=w,n.isUndefined=_,n.isRegExp=E,n.isObject=k,n.isDate=S,n.isError=x,n.isFunction=j,n.isPrimitive=O,n.isBuffer=e("./support/isBuffer");var B=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",I(),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!k(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":16,"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":3,inherits:2}],tape:[function(e,t){t.exports=e("btr7vf")},{}],btr7vf:[function(e,t,n){(function(r){function o(e){e||(e={});var t=i({autoclose:s(e.autoclose,!1)}),n=t.createStream({objectMode:e.objectMode}),o=n.pipe(e.stream||a());d&&o.on("error",function(){t._exitCode=1});var u=!1;if(n.on("end",function(){u=!0}),e.exit===!1)return t;if(!d||!f)return t;var c;return r.on("uncaughtException",function(e){if(!e||"EPIPE"!==e.code||"EPIPE"!==e.errno||"write"!==e.syscall)throw c=e,e}),r.on("exit",function(e){if(!c){if(!u)for(var n=t._results._only,o=0;t._tests.length>o;o++){var i=t._tests[o];n&&i.name!==n||i._exit()}t.close(),r.exit(e||t._exitCode)}}),t}function i(e){e||(e={});var t=c();e.autoclose!==!1&&t.once("done",function(){t.close()});var n=function(e,r,o){var i=new u(e,r,o);return n._tests.push(i),function s(e){e.on("test",function(e){s(e)}),e.on("result",function(e){e.ok||(n._exitCode=1)})}(i),t.push(i),i};n._results=t,n._tests=[],n.createStream=function(e){return t.createStream(e)};var r=!1;return n.only=function(e){if(r)throw Error("there can only be one only test");return t.only(e),r=!0,n.apply(null,arguments)},n._exitCode=0,n.close=function(){t.close()},n}var s=e("defined"),a=e("./lib/default_stream"),u=e("./lib/test"),c=e("./lib/results"),l=e("through"),d=r!==void 0&&r&&"function"==typeof r.on&&r.browser!==!0,f=r!==void 0&&r&&"function"==typeof r.exit;"undefined"!=typeof setImmediate?setImmediate:r.nextTick,n=t.exports=function(){function e(e){return e||(e={}),e.autoclose=!d,t||(t=o(e)),t}var t,n=function(){return e().apply(this,arguments)};return n.only=function(){return e().only.apply(this,arguments)},n.createStream=function(n){if(n||(n={}),!t){var r=l();return e({stream:r,objectMode:n.objectMode}),r}return t.createStream(n)},n}(),n.createHarness=i,n.Test=u,n.test=n,n.test.skip=u.skip}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"./lib/default_stream":20,"./lib/results":21,"./lib/test":22,"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":3,defined:26,through:30}],20:[function(e,t){var n=e("through");t.exports=function(){function e(e){for(var n=0;e.length>n;n++){var o="string"==typeof e?e.charAt(n):String.fromCharCode(e[n]);"\n"===o?t():r+=o}}function t(){try{console.log(r)}catch(e){o.emit("error",e)}r=""}var r="",o=n(e,t);return o}},{through:30}],21:[function(e,t){(function(n){function r(){return this instanceof r?(this.count=0,this.fail=0,this.pass=0,this._stream=c(),this.tests=[],void 0):new r}function o(e,t){var n="";if(n+=(e.ok?"ok ":"not ok ")+t,n+=e.name?" "+(""+e.name).replace(/\s+/g," "):"",e.skip?n+=" # SKIP":e.todo&&(n+=" # TODO"),n+="\n",e.ok)return n;var r=" ",o=r+" ";if(n+=r+"---\n",n+=o+"operator: "+e.operator+"\n",s(e,"expected")||s(e,"actual")){var i=d(e.expected),a=d(e.actual);Math.max(i.length,a.length)>65?(n+=o+"expected:\n"+o+" "+i+"\n",n+=o+"actual:\n"+o+" "+a+"\n"):(n+=o+"expected: "+i+"\n",n+=o+"actual: "+a+"\n")}if(e.at&&(n+=o+"at: "+e.at+"\n"),"error"===e.operator&&e.actual&&e.actual.stack){var u=(e.actual.stack+"").split("\n");n+=o+"stack:\n",n+=o+" "+u[0]+"\n";for(var c=1;u.length>c;c++)n+=o+u[c]+"\n"}return n+=r+"...\n"}function i(e){if(!e._only)return e.tests.shift();do{var t=e.tests.shift();if(t&&e._only===t.name)return t}while(0!==e.tests.length)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var a=e("events").EventEmitter,u=e("inherits"),c=e("through"),l=e("resumer"),d=e("object-inspect"),f="undefined"!=typeof setImmediate?setImmediate:n.nextTick;t.exports=r,u(r,a),r.prototype.createStream=function(e){e||(e={});var t,n=this,r=0;return e.objectMode?(t=c(),n.on("_push",function o(e,n){n||(n={});var i=r++;e.once("prerun",function(){var r={type:"test",name:e.name,id:i};n.parent&&(r.parent=n.parent),t.queue(r)}),e.on("test",function(e){o(e,{parent:i})}),e.on("result",function(e){e.test=i,e.type="assert",t.queue(e)}),e.on("end",function(){t.queue({type:"end",test:i})})}),n.on("done",function(){t.queue(null)})):(t=l(),t.queue("TAP version 13\n"),n._stream.pipe(t)),f(function s(){for(var e;e=i(n);)if(e.run(),!e.ended)return e.once("end",function(){f(s)});n.emit("done")}),t},r.prototype.push=function(e){var t=this;t.tests.push(e),t._watch(e),t.emit("_push",e)},r.prototype.only=function(e){this._only&&(self.count++,self.fail++,write("not ok "+self.count+" already called .only()\n")),this._only=e},r.prototype._watch=function(e){var t=this,n=function(e){t._stream.queue(e)};e.once("prerun",function(){n("# "+e.name+"\n")}),e.on("result",function(e){return"string"==typeof e?(n("# "+e+"\n"),void 0):(n(o(e,t.count+1)),t.count++,e.ok?t.pass++:t.fail++,void 0)}),e.on("test",function(e){t._watch(e)})},r.prototype.close=function(){var e=this;e.closed&&e._stream.emit("error",Error("ALREADY CLOSED")),e.closed=!0;var t=function(t){e._stream.queue(t)};t("\n1.."+e.count+"\n"),t("# tests "+e.count+"\n"),t("# pass "+e.pass+"\n"),e.fail?t("# fail "+e.fail+"\n"):t("\n# ok\n"),e._stream.queue(null)}}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":3,events:1,inherits:27,"object-inspect":28,resumer:29,through:30}],22:[function(e,t){(function(n,r){function o(e,t,n){var r=this,i=f(e,t,n);this.readable=!0,this.name=i.name||"(anonymous)",this.assertCount=0,this.pendingCount=0,this._skip=i.opts.skip||!1,this._plan=void 0,this._cb=i.cb,this._progeny=[],this._ok=!0,this.end=function(){return o.prototype.end.apply(r,arguments)}}function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e("stream");var s=e("deep-equal"),a=e("defined"),u=e("path"),c=e("util").inherits,l=e("events").EventEmitter;t.exports=o;var d="undefined"!=typeof setImmediate?setImmediate:n.nextTick;c(o,l);var f=function(){for(var e,t="(anonymous)",n={},r=0;arguments.length>r;r++){var o=arguments[r],i=typeof o;"string"===i?t=o:"object"===i?n=o||n:"function"===i&&(e=o)}return{name:t,opts:n,cb:e}};o.prototype.run=function(){if(!this._cb||this._skip)return this._end();this.emit("prerun");try{this._cb(this)}catch(e){return this.error(e),this._end(),void 0}this.emit("run")},o.prototype.test=function(e,t,n){var r=this,i=new o(e,t,n);this._progeny.push(i),this.pendingCount++,this.emit("test",i),i.on("prerun",function(){r.assertCount++}),r._pendingAsserts()||d(function(){r._end()}),d(function(){r._plan||r.pendingCount!=r._progeny.length||r._end()})},o.prototype.comment=function(e){this.emit("result",e.trim().replace(/^#\s*/,""))},o.prototype.plan=function(e){this._plan=e,this.emit("plan",e)},o.prototype.end=function(e){arguments.length>=1&&this.ifError(e),this.calledEnd&&this.fail(".end() called twice"),this.calledEnd=!0,this._end()},o.prototype._end=function(){var e=this;if(this._progeny.length){var t=this._progeny.shift();return t.on("end",function(){e._end()}),t.run(),void 0}this.ended||this.emit("end");var n=this._pendingAsserts();!this._planError&&void 0!==this._plan&&n&&(this._planError=!0,this.fail("plan != count",{expected:this._plan,actual:this.assertCount})),this.ended=!0},o.prototype._exit=function(){void 0===this._plan||this._planError||this.assertCount===this._plan?this.ended||this.fail("test exited without ending",{exiting:!0}):(this._planError=!0,this.fail("plan != count",{expected:this._plan,actual:this.assertCount,exiting:!0}))},o.prototype._pendingAsserts=function(){return void 0===this._plan?1:this._plan-(this._progeny.length+this.assertCount)},o.prototype._assert=function(e,t){var n=this,o=t.extra||{},s={id:n.assertCount++,ok:Boolean(e),skip:a(o.skip,t.skip),name:a(o.message,t.message,"(unnamed assert)"),operator:a(o.operator,t.operator)};(i(t,"actual")||i(o,"actual"))&&(s.actual=a(o.actual,t.actual)),(i(t,"expected")||i(o,"expected"))&&(s.expected=a(o.expected,t.expected)),this._ok=Boolean(this._ok&&e),e||(s.error=a(o.error,t.error,Error(s.name)));for(var c=Error("exception"),l=(c.stack||"").split("\n"),f=u.dirname(r)+"/",h=0;l.length>h;h++){var p=/^\s*\bat\s+(.+)/.exec(l[h]);if(p){var v=p[1].split(/\s+/),g=/(\/[^:\s]+:(\d+)(?::(\d+))?)/.exec(v[1]);if((g||(g=/(\/[^:\s]+:(\d+)(?::(\d+))?)/.exec(v[3])))&&g[1].slice(0,f.length)!==f){s.functionName=v[0],s.file=g[1],s.line=Number(g[2]),g[3]&&(s.column=g[3]),s.at=p[1];break}}}n.emit("result",s);var m=n._pendingAsserts();m||(o.exiting?n._end():d(function(){n._end()})),!n._planError&&0>m&&(n._planError=!0,n.fail("plan != count",{expected:n._plan,actual:n._plan-m}))},o.prototype.fail=function(e,t){this._assert(!1,{message:e,operator:"fail",extra:t})},o.prototype.pass=function(e,t){this._assert(!0,{message:e,operator:"pass",extra:t})},o.prototype.skip=function(e,t){this._assert(!0,{message:e,operator:"skip",skip:!0,extra:t})},o.prototype.ok=o.prototype["true"]=o.prototype.assert=function(e,t,n){this._assert(e,{message:t,operator:"ok",expected:!0,actual:e,extra:n})},o.prototype.notOk=o.prototype["false"]=o.prototype.notok=function(e,t,n){this._assert(!e,{message:t,operator:"notOk",expected:!1,actual:e,extra:n})},o.prototype.error=o.prototype.ifError=o.prototype.ifErr=o.prototype.iferror=function(e,t,n){this._assert(!e,{message:a(t,e+""),operator:"error",actual:e,extra:n})},o.prototype.equal=o.prototype.equals=o.prototype.isEqual=o.prototype.is=o.prototype.strictEqual=o.prototype.strictEquals=function(e,t,n,r){this._assert(e===t,{message:a(n,"should be equal"),operator:"equal",actual:e,expected:t,extra:r})},o.prototype.notEqual=o.prototype.notEquals=o.prototype.notStrictEqual=o.prototype.notStrictEquals=o.prototype.isNotEqual=o.prototype.isNot=o.prototype.not=o.prototype.doesNotEqual=o.prototype.isInequal=function(e,t,n,r){this._assert(e!==t,{message:a(n,"should not be equal"),operator:"notEqual",actual:e,notExpected:t,extra:r})},o.prototype.deepEqual=o.prototype.deepEquals=o.prototype.isEquivalent=o.prototype.same=function(e,t,n,r){this._assert(s(e,t,{strict:!0}),{message:a(n,"should be equivalent"),operator:"deepEqual",actual:e,expected:t,extra:r})},o.prototype.deepLooseEqual=o.prototype.looseEqual=o.prototype.looseEquals=function(e,t,n,r){this._assert(s(e,t),{message:a(n,"should be equivalent"),operator:"deepLooseEqual",actual:e,expected:t,extra:r})},o.prototype.notDeepEqual=o.prototype.notEquivalent=o.prototype.notDeeply=o.prototype.notSame=o.prototype.isNotDeepEqual=o.prototype.isNotDeeply=o.prototype.isNotEquivalent=o.prototype.isInequivalent=function(e,t,n,r){this._assert(!s(e,t,{strict:!0}),{message:a(n,"should not be equivalent"),operator:"notDeepEqual",actual:e,notExpected:t,extra:r})},o.prototype.notDeepLooseEqual=o.prototype.notLooseEqual=o.prototype.notLooseEquals=function(e,t,n,r){this._assert(s(e,t),{message:a(n,"should be equivalent"),operator:"notDeepLooseEqual",actual:e,expected:t,extra:r})},o.prototype["throws"]=function(e,t,n,r){"string"==typeof t&&(n=t,t=void 0);var o=void 0;try{e()}catch(i){o={error:i};var s=i.message;delete i.message,i.message=s}var u=o;t instanceof RegExp&&(u=t.test(o&&o.error),t+=""),this._assert(u,{message:a(n,"should throw"),operator:"throws",actual:o&&o.error,expected:t,error:!u&&o&&o.error,extra:r})},o.prototype.doesNotThrow=function(e,t,n,r){"string"==typeof t&&(n=t,t=void 0);var o=void 0;try{e()}catch(i){o={error:i}}this._assert(!o,{message:a(n,"should not throw"),operator:"throws",actual:o&&o.error,expected:t,error:o&&o.error,extra:r})},o.skip=function(){var e=f.apply(null,arguments);return e.opts.skip=!0,o(e.name,e.opts,e.cb)}}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"/lib")},{"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":3,"deep-equal":23,defined:26,events:1,path:7,stream:9,util:17}],23:[function(e,t){function n(e){return null===e||void 0===e}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length?"function"!=typeof e.copy||"function"!=typeof e.slice?!1:e.length>0&&"number"!=typeof e[0]?!1:!0:!1}function o(e,t,o){var c,l;if(n(e)||n(t))return!1;if(e.prototype!==t.prototype)return!1;if(a(e))return a(t)?(e=i.call(e),t=i.call(t),u(e,t,o)):!1;if(r(e)){if(!r(t))return!1;if(e.length!==t.length)return!1;for(c=0;e.length>c;c++)if(e[c]!==t[c])return!1;return!0}try{var d=s(e),f=s(t)}catch(h){return!1}if(d.length!=f.length)return!1;for(d.sort(),f.sort(),c=d.length-1;c>=0;c--)if(d[c]!=f[c])return!1;for(c=d.length-1;c>=0;c--)if(l=d[c],!u(e[l],t[l],o))return!1;return!0}var i=Array.prototype.slice,s=e("./lib/keys.js"),a=e("./lib/is_arguments.js"),u=t.exports=function(e,t,n){return n||(n={}),e===t?!0:e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:o(e,t,n)}},{"./lib/is_arguments.js":24,"./lib/keys.js":25}],24:[function(e,t,n){function r(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function o(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var i="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();n=t.exports=i?r:o,n.supported=r,n.unsupported=o},{}],25:[function(e,t,n){function r(e){var t=[];for(var n in e)t.push(n);return t}n=t.exports="function"==typeof Object.keys?Object.keys:r,n.shim=r},{}],26:[function(e,t){t.exports=function(){for(var e=0;arguments.length>e;e++)if(void 0!==arguments[e])return arguments[e]}},{}],27:[function(e,t){t.exports=e(2)},{}],28:[function(e,t){function n(e){return(e+"").replace(/"/g,"&quot;")}function r(e){return"[object Array]"==={}.toString.call(e)}function o(e){return"[object Date]"==={}.toString.call(e)}function i(e){return"[object RegExp]"==={}.toString.call(e)}function s(e,t){return{}.hasOwnProperty?{}.hasOwnProperty.call(e,t):t in e}function a(e){if(e.name)return e.name;var t=(""+e).match(/^function\s*([\w$]+)/);return t?t[1]:void 0}function u(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function c(e){return e&&"object"==typeof e?"undefined"!=typeof HTMLElement?e instanceof HTMLElement:"string"==typeof e.nodeName&&"function"==typeof e.getAttribute:!1}function l(e){function t(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(16>t?"0":"")+t.toString(16)}var n=e.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,t);return"'"+n+"'"}t.exports=function d(e,t,f,h){function p(e,n){return n&&(h=h.slice(),h.push(n)),d(e,t,f+1,h)}t||(t={});var v=void 0===t.depth?5:t.depth;if(void 0===f&&(f=0),f>v&&v>0)return"...";if(void 0===h)h=[];else if(u(h,e)>=0)return"[Circular]";if("string"==typeof e)return l(e);if("function"==typeof e){var g=a(e);return"[Function"+(g?": "+g:"")+"]"}if(null===e)return"null";if(c(e)){for(var m="<"+(e.nodeName+"").toLowerCase(),y=e.attributes||[],b=0;y.length>b;b++)m+=" "+y[b].name+'="'+n(y[b].value)+'"';return m+=">",e.childNodes&&e.childNodes.length&&(m+="..."),m+="</"+(e.tagName+"").toLowerCase()+">"}if(r(e)){if(0===e.length)return"[]";for(var w=Array(e.length),b=0;e.length>b;b++)w[b]=s(e,b)?p(e[b],e):"";return"[ "+w.join(", ")+" ]"}if("object"==typeof e&&"function"==typeof e.inspect)return e.inspect();if("object"!=typeof e||o(e)||i(e))return e+"";var w=[],_=[];for(var E in e)s(e,E)&&_.push(E);_.sort();for(var b=0;_.length>b;b++){var E=_[b];/[^\w$]/.test(E)?w.push(p(E)+": "+p(e[E],e)):w.push(E+": "+p(e[E],e))}return 0===w.length?"{}":"{ "+w.join(", ")+" }"
}},{}],29:[function(e,t){(function(n){var r=e("through"),o="undefined"!=typeof setImmediate?setImmediate:n.nextTick;t.exports=function(e,t){var n=r(e,t);n.pause();var i=n.resume,s=n.pause,a=!1;return n.pause=function(){return a=!0,s.apply(this,arguments)},n.resume=function(){return a=!1,i.apply(this,arguments)},o(function(){a||n.resume()}),n}}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":3,through:30}],30:[function(e,t,n){(function(r){function o(e,t,n){function o(){for(;c.length&&!d.paused;){var e=c.shift();if(null===e)return d.emit("end");d.emit("data",e)}}function s(){d.writable=!1,t.call(d),!d.readable&&d.autoDestroy&&d.destroy()}e=e||function(e){this.queue(e)},t=t||function(){this.queue(null)};var a=!1,u=!1,c=[],l=!1,d=new i;return d.readable=d.writable=!0,d.paused=!1,d.autoDestroy=!(n&&n.autoDestroy===!1),d.write=function(t){return e.call(this,t),!d.paused},d.queue=d.push=function(e){return l?d:(null==e&&(l=!0),c.push(e),o(),d)},d.on("end",function(){d.readable=!1,!d.writable&&d.autoDestroy&&r.nextTick(function(){d.destroy()})}),d.end=function(e){return a?void 0:(a=!0,arguments.length&&d.write(e),s(),d)},d.destroy=function(){return u?void 0:(u=!0,a=!0,c.length=0,d.writable=d.readable=!1,d.emit("close"),d)},d.pause=function(){return d.paused?void 0:(d.paused=!0,d)},d.resume=function(){return d.paused&&(d.paused=!1,d.emit("resume")),o(),d.paused||d.emit("drain"),d},d}var i=e("stream");n=t.exports=o,o.through=o}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":3,stream:9}]},{},[]),require=function e(t,n,r){function o(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);throw Error("Cannot find module '"+s+"'")}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return o(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;r.length>s;s++)o(r[s]);return o}({1:[function(e,t,n){"use strict";n.test=function(){return!1}},{}],"6exqm7":[function(e,t){"use strict";function n(){var e,t=0,n=i;for(i=[];e=n[t++];)e()}for(var r,o=[e("./nextTick"),e("./mutation"),e("./postMessage"),e("./messageChannel"),e("./stateChange"),e("./timeout")],i=[],s=-1,a=o.length;a>++s;)if(o[s].test()){r=o[s].install(n);break}t.exports=function(e){var t,o,s,a=e;if(arguments.length>1&&"function"==typeof e){for(s=Array(arguments.length-1),o=0;++o<arguments.length;)s[o-1]=arguments[o];a=function(){e.apply(void 0,s)}}return 1===(t=i.push(a))&&r(n),t},t.exports.clear=function(e){return i.length>=e&&(i[e-1]=function(){}),this}},{"./messageChannel":4,"./mutation":5,"./nextTick":1,"./postMessage":6,"./stateChange":7,"./timeout":8}],immediate:[function(e,t){t.exports=e("6exqm7")},{}],4:[function(e,t,n){(function(e){"use strict";n.test=function(){return e.MessageChannel!==void 0},n.install=function(t){var n=new e.MessageChannel;return n.port1.onmessage=t,function(){n.port2.postMessage(0)}}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],5:[function(e,t,n){(function(e){"use strict";var t=e.MutationObserver||e.WebKitMutationObserver;n.test=function(){return t},n.install=function(n){var r=new t(n),o=e.document.createElement("div");return r.observe(o,{attributes:!0}),e.addEventListener("unload",function(){r.disconnect(),r=null},!1),function(){o.setAttribute("drainQueue","drainQueue")}}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],6:[function(e,t,n){(function(e){"use strict";n.test=function(){if(!e.postMessage||e.importScripts)return!1;var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t},n.install=function(t){function n(n){n.source===e&&n.data===r&&t()}var r="com.calvinmetcalf.setImmediate"+Math.random();return e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),function(){e.postMessage(r,"*")}}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],7:[function(e,t,n){(function(e){"use strict";n.test=function(){return"document"in e&&"onreadystatechange"in e.document.createElement("script")},n.install=function(t){return function(){var n=e.document.createElement("script");return n.onreadystatechange=function(){t(),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},e.document.documentElement.appendChild(n),t}}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],8:[function(e,t,n){"use strict";n.test=function(){return!0},n.install=function(e){return function(){setTimeout(e,0)}}},{}]},{},[]),require=function e(t,n,r){function o(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);throw Error("Cannot find module '"+s+"'")}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return o(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;r.length>s;s++)o(r[s]);return o}({1:[function(){},{}],2:[function(e,t){t.exports=e(1)},{}],3:[function(e,t){function n(e,t){if(0!==e.length%s){var n=e.length+(s-e.length%s);e=i.concat([e,a],n)}for(var r=[],o=t?e.readInt32BE:e.readInt32LE,u=0;e.length>u;u+=s)r.push(o.call(e,u));return r}function r(e,t,n){for(var r=new i(t),o=n?r.writeInt32BE:r.writeInt32LE,s=0;e.length>s;s++)o.call(r,e[s],4*s,!0);return r}function o(e,t,o,s){i.isBuffer(e)||(e=new i(e));var a=t(n(e,s),e.length*u);return r(a,o,s)}var i=e("buffer").Buffer,s=4,a=new i(s);a.fill(0);var u=8;t.exports={hash:o}},{buffer:12}],4:[function(e,t,n){function r(e,t,n){a.isBuffer(t)||(t=new a(t)),a.isBuffer(n)||(n=new a(n)),t.length>h?t=e(t):h>t.length&&(t=a.concat([t,p],h));for(var r=new a(h),o=new a(h),i=0;h>i;i++)r[i]=54^t[i],o[i]=92^t[i];var s=e(a.concat([r,n]));return e(a.concat([o,s]))}function o(e,t){e=e||"sha1";var n=f[e],o=[],s=0;return n||i("algorithm:",e,"is not yet supported"),{update:function(e){return a.isBuffer(e)||(e=new a(e)),o.push(e),s+=e.length,this},digest:function(e){var i=a.concat(o),s=t?r(n,t,i):n(i);return o=null,e?s.toString(e):s}}}function i(){var e=[].slice.call(arguments).join(" ");throw Error([e,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}function s(e,t){for(var n in e)t(e[n],n)}var a=e("buffer").Buffer,u=e("./sha"),c=e("./sha256"),l=e("./rng"),d=e("./md5"),f={sha1:u,sha256:c,md5:d},h=64,p=new a(h);p.fill(0),n.createHash=function(e){return o(e)},n.createHmac=function(e,t){return o(e,t)},n.randomBytes=function(e,t){if(!t||!t.call)return new a(l(e));try{t.call(this,void 0,new a(l(e)))}catch(n){t(n)}},s(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],function(e){n[e]=function(){i("sorry,",e,"is not implemented yet")}})},{"./md5":5,"./rng":6,"./sha":7,"./sha256":8,buffer:12}],5:[function(e,t){function n(e,t){e[t>>5]|=128<<t%32,e[(t+64>>>9<<4)+14]=t;for(var n=1732584193,r=-271733879,c=-1732584194,l=271733878,d=0;e.length>d;d+=16){var f=n,h=r,p=c,v=l;n=o(n,r,c,l,e[d+0],7,-680876936),l=o(l,n,r,c,e[d+1],12,-389564586),c=o(c,l,n,r,e[d+2],17,606105819),r=o(r,c,l,n,e[d+3],22,-1044525330),n=o(n,r,c,l,e[d+4],7,-176418897),l=o(l,n,r,c,e[d+5],12,1200080426),c=o(c,l,n,r,e[d+6],17,-1473231341),r=o(r,c,l,n,e[d+7],22,-45705983),n=o(n,r,c,l,e[d+8],7,1770035416),l=o(l,n,r,c,e[d+9],12,-1958414417),c=o(c,l,n,r,e[d+10],17,-42063),r=o(r,c,l,n,e[d+11],22,-1990404162),n=o(n,r,c,l,e[d+12],7,1804603682),l=o(l,n,r,c,e[d+13],12,-40341101),c=o(c,l,n,r,e[d+14],17,-1502002290),r=o(r,c,l,n,e[d+15],22,1236535329),n=i(n,r,c,l,e[d+1],5,-165796510),l=i(l,n,r,c,e[d+6],9,-1069501632),c=i(c,l,n,r,e[d+11],14,643717713),r=i(r,c,l,n,e[d+0],20,-373897302),n=i(n,r,c,l,e[d+5],5,-701558691),l=i(l,n,r,c,e[d+10],9,38016083),c=i(c,l,n,r,e[d+15],14,-660478335),r=i(r,c,l,n,e[d+4],20,-405537848),n=i(n,r,c,l,e[d+9],5,568446438),l=i(l,n,r,c,e[d+14],9,-1019803690),c=i(c,l,n,r,e[d+3],14,-187363961),r=i(r,c,l,n,e[d+8],20,1163531501),n=i(n,r,c,l,e[d+13],5,-1444681467),l=i(l,n,r,c,e[d+2],9,-51403784),c=i(c,l,n,r,e[d+7],14,1735328473),r=i(r,c,l,n,e[d+12],20,-1926607734),n=s(n,r,c,l,e[d+5],4,-378558),l=s(l,n,r,c,e[d+8],11,-2022574463),c=s(c,l,n,r,e[d+11],16,1839030562),r=s(r,c,l,n,e[d+14],23,-35309556),n=s(n,r,c,l,e[d+1],4,-1530992060),l=s(l,n,r,c,e[d+4],11,1272893353),c=s(c,l,n,r,e[d+7],16,-155497632),r=s(r,c,l,n,e[d+10],23,-1094730640),n=s(n,r,c,l,e[d+13],4,681279174),l=s(l,n,r,c,e[d+0],11,-358537222),c=s(c,l,n,r,e[d+3],16,-722521979),r=s(r,c,l,n,e[d+6],23,76029189),n=s(n,r,c,l,e[d+9],4,-640364487),l=s(l,n,r,c,e[d+12],11,-421815835),c=s(c,l,n,r,e[d+15],16,530742520),r=s(r,c,l,n,e[d+2],23,-995338651),n=a(n,r,c,l,e[d+0],6,-198630844),l=a(l,n,r,c,e[d+7],10,1126891415),c=a(c,l,n,r,e[d+14],15,-1416354905),r=a(r,c,l,n,e[d+5],21,-57434055),n=a(n,r,c,l,e[d+12],6,1700485571),l=a(l,n,r,c,e[d+3],10,-1894986606),c=a(c,l,n,r,e[d+10],15,-1051523),r=a(r,c,l,n,e[d+1],21,-2054922799),n=a(n,r,c,l,e[d+8],6,1873313359),l=a(l,n,r,c,e[d+15],10,-30611744),c=a(c,l,n,r,e[d+6],15,-1560198380),r=a(r,c,l,n,e[d+13],21,1309151649),n=a(n,r,c,l,e[d+4],6,-145523070),l=a(l,n,r,c,e[d+11],10,-1120210379),c=a(c,l,n,r,e[d+2],15,718787259),r=a(r,c,l,n,e[d+9],21,-343485551),n=u(n,f),r=u(r,h),c=u(c,p),l=u(l,v)}return[n,r,c,l]}function r(e,t,n,r,o,i){return u(c(u(u(t,e),u(r,i)),o),n)}function o(e,t,n,o,i,s,a){return r(t&n|~t&o,e,t,i,s,a)}function i(e,t,n,o,i,s,a){return r(t&o|n&~o,e,t,i,s,a)}function s(e,t,n,o,i,s,a){return r(t^n^o,e,t,i,s,a)}function a(e,t,n,o,i,s,a){return r(n^(t|~o),e,t,i,s,a)}function u(e,t){var n=(65535&e)+(65535&t),r=(e>>16)+(t>>16)+(n>>16);return r<<16|65535&n}function c(e,t){return e<<t|e>>>32-t}var l=e("./helpers");t.exports=function(e){return l.hash(e,n,16)}},{"./helpers":3}],6:[function(e,t){(function(){var e,n,r=this;e=function(e){for(var t,t,n=Array(e),r=0;e>r;r++)0==(3&r)&&(t=4294967296*Math.random()),n[r]=255&t>>>((3&r)<<3);return n},r.crypto&&crypto.getRandomValues&&(n=function(e){var t=new Uint8Array(e);return crypto.getRandomValues(t),t}),t.exports=n||e})()},{}],7:[function(e,t){function n(e,t){e[t>>5]|=128<<24-t%32,e[(t+64>>9<<4)+15]=t;for(var n=Array(80),a=1732584193,u=-271733879,c=-1732584194,l=271733878,d=-1009589776,f=0;e.length>f;f+=16){for(var h=a,p=u,v=c,g=l,m=d,y=0;80>y;y++){n[y]=16>y?e[f+y]:s(n[y-3]^n[y-8]^n[y-14]^n[y-16],1);var b=i(i(s(a,5),r(y,u,c,l)),i(i(d,n[y]),o(y)));d=l,l=c,c=s(u,30),u=a,a=b}a=i(a,h),u=i(u,p),c=i(c,v),l=i(l,g),d=i(d,m)}return[a,u,c,l,d]}function r(e,t,n,r){return 20>e?t&n|~t&r:40>e?t^n^r:60>e?t&n|t&r|n&r:t^n^r}function o(e){return 20>e?1518500249:40>e?1859775393:60>e?-1894007588:-899497514}function i(e,t){var n=(65535&e)+(65535&t),r=(e>>16)+(t>>16)+(n>>16);return r<<16|65535&n}function s(e,t){return e<<t|e>>>32-t}var a=e("./helpers");t.exports=function(e){return a.hash(e,n,20,!0)}},{"./helpers":3}],8:[function(e,t){var n=e("./helpers"),r=function(e,t){var n=(65535&e)+(65535&t),r=(e>>16)+(t>>16)+(n>>16);return r<<16|65535&n},o=function(e,t){return e>>>t|e<<32-t},i=function(e,t){return e>>>t},s=function(e,t,n){return e&t^~e&n},a=function(e,t,n){return e&t^e&n^t&n},u=function(e){return o(e,2)^o(e,13)^o(e,22)},c=function(e){return o(e,6)^o(e,11)^o(e,25)},l=function(e){return o(e,7)^o(e,18)^i(e,3)},d=function(e){return o(e,17)^o(e,19)^i(e,10)},f=function(e,t){var n,o,i,f,h,p,v,g,m,y,b,w,_=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],E=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],k=Array(64);e[t>>5]|=128<<24-t%32,e[(t+64>>9<<4)+15]=t;for(var m=0;e.length>m;m+=16){n=E[0],o=E[1],i=E[2],f=E[3],h=E[4],p=E[5],v=E[6],g=E[7];for(var y=0;64>y;y++)k[y]=16>y?e[y+m]:r(r(r(d(k[y-2]),k[y-7]),l(k[y-15])),k[y-16]),b=r(r(r(r(g,c(h)),s(h,p,v)),_[y]),k[y]),w=r(u(n),a(n,o,i)),g=v,v=p,p=h,h=r(f,b),f=i,i=o,o=n,n=r(b,w);E[0]=r(n,E[0]),E[1]=r(o,E[1]),E[2]=r(i,E[2]),E[3]=r(f,E[3]),E[4]=r(h,E[4]),E[5]=r(p,E[5]),E[6]=r(v,E[6]),E[7]=r(g,E[7])}return E};t.exports=function(e){return n.hash(e,f,32,!0)}},{"./helpers":3}],9:[function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function o(e){return"number"==typeof e}function i(e){return"object"==typeof e&&null!==e}function s(e){return void 0===e}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!o(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,o,a,u,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length))throw t=arguments[1],t instanceof Error?t:TypeError('Uncaught, unspecified "error" event.');if(n=this._events[e],s(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(o=arguments.length,a=Array(o-1),u=1;o>u;u++)a[u-1]=arguments[u];n.apply(this,a)}else if(i(n)){for(o=arguments.length,a=Array(o-1),u=1;o>u;u++)a[u-1]=arguments[u];for(c=n.slice(),o=c.length,u=0;o>u;u++)c[u].apply(this,a)}return!0},n.prototype.addListener=function(e,t){var o;if(!r(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?i(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,i(this._events[e])&&!this._events[e].warned){var o;o=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,o&&o>0&&this._events[e].length>o&&(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())}return this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),o||(o=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var o=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,o,s,a;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],s=n.length,o=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(n)){for(a=s;a-->0;)if(n[a]===t||n[a].listener&&n[a].listener===t){o=a;break}if(0>o)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.listenerCount=function(e,t){var n;return n=e._events&&e._events[t]?r(e._events[t])?1:e._events[t].length:0}},{}],10:[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}},{}],11:[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){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var r=n.shift();r()}},!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")}},{}],12:[function(e,t,n){function r(e,t,n){if(!(this instanceof r))return new r(e,t,n);var o=typeof e;if("base64"===t&&"string"===o)for(e=j(e);0!==e.length%4;)e+="=";var i;if("number"===o)i=L(e);else if("string"===o)i=r.byteLength(e,t);else{if("object"!==o)throw Error("First argument needs to be a number, array or string.");i=L(e.length)}var s;r._useTypedArrays?s=O(new Uint8Array(i)):(s=this,s.length=i,s._isBuffer=!0);var a;if(r._useTypedArrays&&"function"==typeof Uint8Array&&e instanceof Uint8Array)s._set(e);else if(N(e))for(a=0;i>a;a++)s[a]=r.isBuffer(e)?e.readUInt8(a):e[a];else if("string"===o)s.write(e,0,t);else if("number"===o&&!r._useTypedArrays&&!n)for(a=0;i>a;a++)s[a]=0;return s}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 s=t.length;F(0===s%2,"Invalid hex string"),o>s/2&&(o=s/2);for(var a=0;o>a;a++){var u=parseInt(t.substr(2*a,2),16);F(!isNaN(u),"Invalid hex string"),e[n+a]=u}return r._charsWritten=2*a,a}function i(e,t,n,o){var i=r._charsWritten=C(T(t),e,n,o);return i}function s(e,t,n,o){var i=r._charsWritten=C(R(t),e,n,o);return i}function a(e,t,n,r){return s(e,t,n,r)}function u(e,t,n,o){var i=r._charsWritten=C(B(t),e,n,o);return i}function c(e,t,n){return 0===t&&n===e.length?W.fromByteArray(e):W.fromByteArray(e.slice(t,n))}function l(e,t,n){var r="",o="";n=Math.min(e.length,n);for(var i=t;n>i;i++)127>=e[i]?(r+=q(o)+String.fromCharCode(e[i]),o=""):o+="%"+e[i].toString(16);return r+q(o)}function d(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;n>o;o++)r+=String.fromCharCode(e[o]);return r}function f(e,t,n){return d(e,t,n)}function h(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+=D(e[i]);return o}function p(e,t,n,r){r||(F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==t&&null!==t,"missing offset"),F(e.length>t+1,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){var i;return n?(i=e[t],o>t+1&&(i|=e[t+1]<<8)):(i=e[t]<<8,o>t+1&&(i|=e[t+1])),i}}function v(e,t,n,r){r||(F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==t&&null!==t,"missing offset"),F(e.length>t+3,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){var i;return n?(o>t+2&&(i=e[t+2]<<16),o>t+1&&(i|=e[t+1]<<8),i|=e[t],o>t+3&&(i+=e[t+3]<<24>>>0)):(o>t+1&&(i=e[t+1]<<16),o>t+2&&(i|=e[t+2]<<8),o>t+3&&(i|=e[t+3]),i+=e[t]<<24>>>0),i}}function g(e,t,n,r){r||(F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==t&&null!==t,"missing offset"),F(e.length>t+1,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){var i=p(e,t,n,!0),s=32768&i;return s?-1*(65535-i+1):i}}function m(e,t,n,r){r||(F("boolean"==typeof n,"missing or invalid endian"),F(void 0!==t&&null!==t,"missing offset"),F(e.length>t+3,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){var i=v(e,t,n,!0),s=2147483648&i;return s?-1*(4294967295-i+1):i}}function y(e,t,n,r){return r||(F("boolean"==typeof n,"missing or invalid endian"),F(e.length>t+3,"Trying to read beyond buffer length")),z.read(e,t,n,23,4)}function b(e,t,n,r){return r||(F("boolean"==typeof n,"missing or invalid endian"),F(e.length>t+7,"Trying to read beyond buffer length")),z.read(e,t,n,52,8)}function w(e,t,n,r,o){o||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(e.length>n+1,"trying to write beyond buffer length"),M(t,65535));var i=e.length;if(!(n>=i))for(var s=0,a=Math.min(i-n,2);a>s;s++)e[n+s]=(t&255<<8*(r?s:1-s))>>>8*(r?s:1-s)}function _(e,t,n,r,o){o||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(e.length>n+3,"trying to write beyond buffer length"),M(t,4294967295));var i=e.length;if(!(n>=i))for(var s=0,a=Math.min(i-n,4);a>s;s++)e[n+s]=255&t>>>8*(r?s:3-s)}function E(e,t,n,r,o){o||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(e.length>n+1,"Trying to write beyond buffer length"),U(t,32767,-32768));var i=e.length;n>=i||(t>=0?w(e,t,n,r,o):w(e,65535+t+1,n,r,o))}function k(e,t,n,r,o){o||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(e.length>n+3,"Trying to write beyond buffer length"),U(t,2147483647,-2147483648));var i=e.length;n>=i||(t>=0?_(e,t,n,r,o):_(e,4294967295+t+1,n,r,o))}function S(e,t,n,r,o){o||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(e.length>n+3,"Trying to write beyond buffer length"),P(t,3.4028234663852886e38,-3.4028234663852886e38));var i=e.length;n>=i||z.write(e,t,n,r,23,4)}function x(e,t,n,r,o){o||(F(void 0!==t&&null!==t,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(void 0!==n&&null!==n,"missing offset"),F(e.length>n+7,"Trying to write beyond buffer length"),P(t,1.7976931348623157e308,-1.7976931348623157e308));var i=e.length;n>=i||z.write(e,t,n,r,52,8)}function j(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function O(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=K.get,e.set=K.set,e.write=K.write,e.toString=K.toString,e.toLocaleString=K.toString,e.toJSON=K.toJSON,e.copy=K.copy,e.slice=K.slice,e.readUInt8=K.readUInt8,e.readUInt16LE=K.readUInt16LE,e.readUInt16BE=K.readUInt16BE,e.readUInt32LE=K.readUInt32LE,e.readUInt32BE=K.readUInt32BE,e.readInt8=K.readInt8,e.readInt16LE=K.readInt16LE,e.readInt16BE=K.readInt16BE,e.readInt32LE=K.readInt32LE,e.readInt32BE=K.readInt32BE,e.readFloatLE=K.readFloatLE,e.readFloatBE=K.readFloatBE,e.readDoubleLE=K.readDoubleLE,e.readDoubleBE=K.readDoubleBE,e.writeUInt8=K.writeUInt8,e.writeUInt16LE=K.writeUInt16LE,e.writeUInt16BE=K.writeUInt16BE,e.writeUInt32LE=K.writeUInt32LE,e.writeUInt32BE=K.writeUInt32BE,e.writeInt8=K.writeInt8,e.writeInt16LE=K.writeInt16LE,e.writeInt16BE=K.writeInt16BE,e.writeInt32LE=K.writeInt32LE,e.writeInt32BE=K.writeInt32BE,e.writeFloatLE=K.writeFloatLE,e.writeFloatBE=K.writeFloatBE,e.writeDoubleLE=K.writeDoubleLE,e.writeDoubleBE=K.writeDoubleBE,e.fill=K.fill,e.inspect=K.inspect,e.toArrayBuffer=K.toArrayBuffer,e}function A(e,t,n){return"number"!=typeof e?n:(e=~~e,e>=t?t:e>=0?e:(e+=t,e>=0?e:0))}function L(e){return e=~~Math.ceil(+e),0>e?0:e}function I(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function N(e){return I(e)||r.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function D(e){return 16>e?"0"+e.toString(16):e.toString(16)}function T(e){for(var t=[],n=0;e.length>n;n++){var r=e.charCodeAt(n);if(127>=r)t.push(e.charCodeAt(n));else{var o=n;r>=55296&&57343>=r&&n++;for(var i=encodeURIComponent(e.slice(o,n+1)).substr(1).split("%"),s=0;i.length>s;s++)t.push(parseInt(i[s],16))}}return t}function R(e){for(var t=[],n=0;e.length>n;n++)t.push(255&e.charCodeAt(n));return t}function B(e){return W.toByteArray(e)}function C(e,t,n,r){for(var o=0;r>o&&!(o+n>=t.length||o>=e.length);o++)t[o+n]=e[o];return o}function q(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function M(e,t){F("number"==typeof e,"cannot write a non-number as a number"),F(e>=0,"specified a negative value for writing an unsigned value"),F(t>=e,"value is larger than maximum value for type"),F(Math.floor(e)===e,"value has a fractional component")}function U(e,t,n){F("number"==typeof e,"cannot write a non-number as a number"),F(t>=e,"value larger than maximum allowed value"),F(e>=n,"value smaller than minimum allowed value"),F(Math.floor(e)===e,"value has a fractional component")}function P(e,t,n){F("number"==typeof e,"cannot write a non-number as a number"),F(t>=e,"value larger than maximum allowed value"),F(e>=n,"value smaller than minimum allowed value")}function F(e,t){if(!e)throw Error(t||"Failed assertion")}var W=e("base64-js"),z=e("ieee754");n.Buffer=r,n.SlowBuffer=r,n.INSPECT_MAX_BYTES=50,r.poolSize=8192,r._useTypedArrays=function(){if("undefined"==typeof Uint8Array||"undefined"==typeof ArrayBuffer)return!1;try{var e=new Uint8Array(0);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray}catch(t){return!1}}(),r.isEncoding=function(e){switch((e+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},r.isBuffer=function(e){return!(null===e||void 0===e||!e._isBuffer)},r.byteLength=function(e,t){var n;switch(e+="",t||"utf8"){case"hex":n=e.length/2;break;case"utf8":case"utf-8":n=T(e).length;break;case"ascii":case"binary":case"raw":n=e.length;break;case"base64":n=B(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*e.length;break;default:throw Error("Unknown encoding")}return n},r.concat=function(e,t){if(F(I(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new r(0);if(1===e.length)return e[0];var n;if("number"!=typeof t)for(t=0,n=0;e.length>n;n++)t+=e[n].length;var o=new r(t),i=0;for(n=0;e.length>n;n++){var s=e[n];s.copy(o,i),i+=s.length}return o},r.prototype.write=function(e,t,n,r){if(isFinite(t))isFinite(n)||(r=n,n=void 0);else{var c=r;r=t,t=n,n=c}t=Number(t)||0;var l=this.length-t;switch(n?(n=Number(n),n>l&&(n=l)):n=l,r=((r||"utf8")+"").toLowerCase()){case"hex":return o(this,e,t,n);case"utf8":case"utf-8":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i(this,e,t,n);case"ascii":return s(this,e,t,n);case"binary":return a(this,e,t,n);case"base64":return u(this,e,t,n);default:throw Error("Unknown encoding")}},r.prototype.toString=function(e,t,n){var r=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 h(r,t,n);case"utf8":case"utf-8":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l(r,t,n);case"ascii":return d(r,t,n);case"binary":return f(r,t,n);case"base64":return c(r,t,n);default:throw Error("Unknown encoding")}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},r.prototype.copy=function(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){F(r>=n,"sourceEnd < sourceStart"),F(t>=0&&e.length>t,"targetStart out of bounds"),F(n>=0&&o.length>n,"sourceStart out of bounds"),F(r>=0&&o.length>=r,"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]}},r.prototype.slice=function(e,t){var n=this.length;if(e=A(e,n,0),t=A(t,n,n),r._useTypedArrays)return O(this.subarray(e,t));for(var o=t-e,i=new r(o,void 0,!0),s=0;o>s;s++)i[s]=this[s+e];return i},r.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},r.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},r.prototype.readUInt8=function(e,t){return t||(F(void 0!==e&&null!==e,"missing offset"),F(this.length>e,"Trying to read beyond buffer length")),e>=this.length?void 0:this[e]},r.prototype.readUInt16LE=function(e,t){return p(this,e,!0,t)},r.prototype.readUInt16BE=function(e,t){return p(this,e,!1,t)},r.prototype.readUInt32LE=function(e,t){return v(this,e,!0,t)},r.prototype.readUInt32BE=function(e,t){return v(this,e,!1,t)},r.prototype.readInt8=function(e,t){if(t||(F(void 0!==e&&null!==e,"missing offset"),F(this.length>e,"Trying to read beyond buffer length")),!(e>=this.length)){var n=128&this[e];return n?-1*(255-this[e]+1):this[e]}},r.prototype.readInt16LE=function(e,t){return g(this,e,!0,t)},r.prototype.readInt16BE=function(e,t){return g(this,e,!1,t)},r.prototype.readInt32LE=function(e,t){return m(this,e,!0,t)},r.prototype.readInt32BE=function(e,t){return m(this,e,!1,t)},r.prototype.readFloatLE=function(e,t){return y(this,e,!0,t)},r.prototype.readFloatBE=function(e,t){return y(this,e,!1,t)},r.prototype.readDoubleLE=function(e,t){return b(this,e,!0,t)},r.prototype.readDoubleBE=function(e,t){return b(this,e,!1,t)},r.prototype.writeUInt8=function(e,t,n){n||(F(void 0!==e&&null!==e,"missing value"),F(void 0!==t&&null!==t,"missing offset"),F(this.length>t,"trying to write beyond buffer length"),M(e,255)),t>=this.length||(this[t]=e)},r.prototype.writeUInt16LE=function(e,t,n){w(this,e,t,!0,n)},r.prototype.writeUInt16BE=function(e,t,n){w(this,e,t,!1,n)},r.prototype.writeUInt32LE=function(e,t,n){_(this,e,t,!0,n)},r.prototype.writeUInt32BE=function(e,t,n){_(this,e,t,!1,n)},r.prototype.writeInt8=function(e,t,n){n||(F(void 0!==e&&null!==e,"missing value"),F(void 0!==t&&null!==t,"missing offset"),F(this.length>t,"Trying to write beyond buffer length"),U(e,127,-128)),t>=this.length||(e>=0?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n))},r.prototype.writeInt16LE=function(e,t,n){E(this,e,t,!0,n)},r.prototype.writeInt16BE=function(e,t,n){E(this,e,t,!1,n)},r.prototype.writeInt32LE=function(e,t,n){k(this,e,t,!0,n)},r.prototype.writeInt32BE=function(e,t,n){k(this,e,t,!1,n)},r.prototype.writeFloatLE=function(e,t,n){S(this,e,t,!0,n)},r.prototype.writeFloatBE=function(e,t,n){S(this,e,t,!1,n)},r.prototype.writeDoubleLE=function(e,t,n){x(this,e,t,!0,n)},r.prototype.writeDoubleBE=function(e,t,n){x(this,e,t,!1,n)},r.prototype.fill=function(e,t,n){if(e||(e=0),t||(t=0),n||(n=this.length),"string"==typeof e&&(e=e.charCodeAt(0)),F("number"==typeof e&&!isNaN(e),"value is not a number"),F(n>=t,"end < start"),n!==t&&0!==this.length){F(t>=0&&this.length>t,"start out of bounds"),F(n>=0&&this.length>=n,"end out of bounds");for(var r=t;n>r;r++)this[r]=e}},r.prototype.inspect=function(){for(var e=[],t=this.length,r=0;t>r;r++)if(e[r]=D(this[r]),r===n.INSPECT_MAX_BYTES){e[r+1]="...";break}return"<Buffer "+e.join(" ")+">"},r.prototype.toArrayBuffer=function(){if("function"==typeof Uint8Array){if(r._useTypedArrays)return new r(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;n>t;t+=1)e[t]=this[t];return e.buffer}throw Error("Buffer.toArrayBuffer not supported in this browser")};var K=r.prototype},{"base64-js":13,ieee754:14}],13:[function(e,t){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(){"use strict";function e(e){var t=e.charCodeAt(0);return t===s?62:t===a?63:u>t?-1:u+10>t?t-u+26+26:l+26>t?t-l:c+26>t?t-c+26:void 0
}function r(t){function n(e){c[d++]=e}var r,o,s,a,u,c;if(t.length%4>0)throw Error("Invalid string. Length must be a multiple of 4");var l=t.length;u="="===t.charAt(l-2)?2:"="===t.charAt(l-1)?1:0,c=new i(3*t.length/4-u),s=u>0?t.length-4:t.length;var d=0;for(r=0,o=0;s>r;r+=4,o+=3)a=e(t.charAt(r))<<18|e(t.charAt(r+1))<<12|e(t.charAt(r+2))<<6|e(t.charAt(r+3)),n((16711680&a)>>16),n((65280&a)>>8),n(255&a);return 2===u?(a=e(t.charAt(r))<<2|e(t.charAt(r+1))>>4,n(255&a)):1===u&&(a=e(t.charAt(r))<<10|e(t.charAt(r+1))<<4|e(t.charAt(r+2))>>2,n(255&a>>8),n(255&a)),c}function o(e){function t(e){return n.charAt(e)}function r(e){return t(63&e>>18)+t(63&e>>12)+t(63&e>>6)+t(63&e)}var o,i,s,a=e.length%3,u="";for(o=0,s=e.length-a;s>o;o+=3)i=(e[o]<<16)+(e[o+1]<<8)+e[o+2],u+=r(i);switch(a){case 1:i=e[e.length-1],u+=t(i>>2),u+=t(63&i<<4),u+="==";break;case 2:i=(e[e.length-2]<<8)+e[e.length-1],u+=t(i>>10),u+=t(63&i>>4),u+=t(63&i<<2),u+="="}return u}var i="undefined"!=typeof Uint8Array?Uint8Array:Array;"0".charCodeAt(0);var s="+".charCodeAt(0),a="/".charCodeAt(0),u="0".charCodeAt(0),c="a".charCodeAt(0),l="A".charCodeAt(0);t.exports.toByteArray=r,t.exports.fromByteArray=o})()},{}],14:[function(e,t,n){n.read=function(e,t,n,r,o){var i,s,a=8*o-r-1,u=(1<<a)-1,c=u>>1,l=-7,d=n?o-1:0,f=n?-1:1,h=e[t+d];for(d+=f,i=h&(1<<-l)-1,h>>=-l,l+=a;l>0;i=256*i+e[t+d],d+=f,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=r;l>0;s=256*s+e[t+d],d+=f,l-=8);if(0===i)i=1-c;else{if(i===u)return s?0/0:1/0*(h?-1:1);s+=Math.pow(2,r),i-=c}return(h?-1:1)*s*Math.pow(2,i-r)},n.write=function(e,t,n,r,o,i){var s,a,u,c=8*i-o-1,l=(1<<c)-1,d=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,v=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),1>t*(u=Math.pow(2,-s))&&(s--,u*=2),t+=s+d>=1?f/u:f*Math.pow(2,1-d),t*u>=2&&(s++,u/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(t*u-1)*Math.pow(2,o),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,o),s=0));o>=8;e[n+h]=255&a,h+=p,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;e[n+h]=255&s,h+=p,s/=256,c-=8);e[n+h-p]|=128*v}},{}],15:[function(e,t,n){(function(e){function t(e,t){for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;e.length>r;r++)t(e[r],r,e)&&n.push(e[r]);return n}var o=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(e){return o.exec(e).slice(1)};n.resolve=function(){for(var n="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var s=i>=0?arguments[i]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(n=s+"/"+n,o="/"===s.charAt(0))}return n=t(r(n.split("/"),function(e){return!!e}),!o).join("/"),(o?"/":"")+n||"."},n.normalize=function(e){var o=n.isAbsolute(e),i="/"===s(e,-1);return e=t(r(e.split("/"),function(e){return!!e}),!o).join("/"),e||o||(e="."),e&&i&&(e+="/"),(o?"/":"")+e},n.isAbsolute=function(e){return"/"===e.charAt(0)},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(r(e,function(e){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},n.relative=function(e,t){function r(e){for(var t=0;e.length>t&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=n.resolve(e).substr(1),t=n.resolve(t).substr(1);for(var o=r(e.split("/")),i=r(t.split("/")),s=Math.min(o.length,i.length),a=s,u=0;s>u;u++)if(o[u]!==i[u]){a=u;break}for(var c=[],u=a;o.length>u;u++)c.push("..");return c=c.concat(i.slice(a)),c.join("/")},n.sep="/",n.delimiter=":",n.dirname=function(e){var t=i(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},n.basename=function(e,t){var n=i(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},n.extname=function(e){return i(e)[3]};var s="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return 0>t&&(t=e.length+t),e.substr(t,n)}}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11}],16:[function(e,t){function n(e){return this instanceof n?(s.call(this,e),a.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("process/browser.js").nextTick,s=e("./readable.js"),a=e("./writable.js");o(n,s),n.prototype.write=a.prototype.write,n.prototype.end=a.prototype.end,n.prototype._write=a.prototype._write},{"./readable.js":20,"./writable.js":22,inherits:10,"process/browser.js":18}],17:[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)&&c.pause&&c.pause()}function o(){c.readable&&c.resume&&c.resume()}function i(){l||(l=!0,e.end())}function s(){l||(l=!0,"function"==typeof e.destroy&&e.destroy())}function a(e){if(u(),0===r.listenerCount(this,"error"))throw e}function u(){c.removeListener("data",n),e.removeListener("drain",o),c.removeListener("end",i),c.removeListener("close",s),c.removeListener("error",a),e.removeListener("error",a),c.removeListener("end",u),c.removeListener("close",u),e.removeListener("close",u)}var c=this;c.on("data",n),e.on("drain",o),e._isStdio||t&&t.end===!1||(c.on("end",i),c.on("close",s));var l=!1;return c.on("error",a),e.on("error",a),c.on("end",u),c.on("close",u),e.on("close",u),e.emit("pipe",c),e}},{"./duplex.js":16,"./passthrough.js":19,"./readable.js":20,"./transform.js":21,"./writable.js":22,events:9,inherits:10}],18:[function(e,t){t.exports=e(11)},{}],19:[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":21,inherits:10}],20:[function(e,t){(function(n){function r(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 o(e){return this instanceof o?(this._readableState=new r(e,this),this.readable=!0,x.call(this),void 0):new o(e)}function i(e,t,n,r,o){var i=c(t,n);if(i)e.emit("error",i);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 a=Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&o){var a=Error("stream.unshift() after end event");e.emit("error",a)}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&&d(e),h(e,t);else o||(t.reading=!1);return s(t)}function s(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function a(e){if(e>=L)e=L;else{e--;for(var t=1;32>t;t<<=1)e|=e>>t;e++}return e}function u(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 c(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?d(e):w(e)}function d(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 h(e,t){t.readingMore||(t.readingMore=!0,O(function(){p(e,t)}))}function p(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 v(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,t),e.emit("data",n),r.awaitDrain>0)return;return 0===r.pipesCount?(r.flowing=!1,S.listenerCount(e,"data")>0&&y(e),void 0):(r.ranOut=!0,void 0)}function m(){this._readableState.ranOut&&(this._readableState.ranOut=!1,g(this))}function y(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 b(e,t){var n,r=t.buffer,o=t.length,i=!!t.decoder,s=!!t.objectMode;if(0===r.length)return null;if(0===o)n=null;else if(s)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 a=r[0];n=a.slice(0,e),r[0]=a.slice(e)}else if(e===r[0].length)n=r.shift();else{n=i?"":new j(e);for(var u=0,c=0,l=r.length;l>c&&e>u;c++){var a=r[0],d=Math.min(e-u,a.length);i?n+=a.slice(0,d):a.copy(n,u,0,d),a.length>d?r[0]=a.slice(d):r.shift(),u+=d}}return n}function w(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 _(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n],n)}function E(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}t.exports=o,o.ReadableState=r;var k,S=e("events").EventEmitter,x=e("./index.js"),j=e("buffer").Buffer,O=e("process/browser.js").nextTick,A=e("inherits");A(o,x),o.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="")),i(this,n,e,t,!1)},o.prototype.unshift=function(e){var t=this._readableState;return i(this,t,e,"",!0)},o.prototype.setEncoding=function(t){k||(k=e("string_decoder").StringDecoder),this._readableState.decoder=new k(t),this._readableState.encoding=t};var L=8388608;o.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 d(this),null;if(e=u(e,t),0===e&&t.ended)return 0===t.length&&w(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=u(n,t));var o;return o=e>0?b(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&&w(this),o},o.prototype._read=function(){this.emit("error",Error("not implemented"))},o.prototype.pipe=function(e,t){function r(e){e===l&&i()}function o(){e.end()}function i(){e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("drain",p),e.removeListener("error",s),e.removeListener("unpipe",r),l.removeListener("end",o),l.removeListener("end",i),(!e._writableState||e._writableState.needDrain)&&p()}function s(t){c(),0===y&&0===S.listenerCount(e,"error")&&e.emit("error",t)}function a(){e.removeListener("finish",u),c()}function u(){e.removeListener("close",a),c()}function c(){l.unpipe(e)}var l=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1;var f=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr,h=f?o:i;d.endEmitted?O(h):l.once("end",h),e.on("unpipe",r);var p=v(l);e.on("drain",p);var y=S.listenerCount(e,"error");return e.once("error",s),e.once("close",a),e.once("finish",u),e.emit("pipe",l),d.flowing||(this.on("readable",m),d.flowing=!0,O(function(){g(l)})),e},o.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",m),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",m),t.flowing=!1;for(var o=0;r>o;o++)n[o].emit("unpipe",this);return this}var o=E(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)},o.prototype.on=function(e,t){var n=x.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||y(this),"readable"===e&&this.readable){var r=this._readableState;r.readableListening||(r.readableListening=!0,r.emittedReadable=!1,r.needReadable=!0,r.reading?r.length&&d(this,r):this.read(0))}return n},o.prototype.addListener=o.prototype.on,o.prototype.resume=function(){y(this),this.read(0),this.emit("resume")},o.prototype.pause=function(){y(this,!0),this.emit("pause")},o.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,function(t){e.on(t,function(e){return r.emit.apply(r,t,e)})}),r._read=function(){n&&(n=!1,e.resume())},r},o._fromList=b}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"./index.js":17,"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11,buffer:12,events:9,inherits:10,"process/browser.js":18,string_decoder:23}],21:[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);s.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 s=e("./duplex.js"),a=e("inherits");a(o,s),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.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":16,inherits:10}],22:[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){f(t,e)},this.writecb=null,this.writelen=0,this.buffer=[]}function o(e){return this instanceof o||this instanceof E.Duplex?(this._writableState=new r(e,this),this.writable=!0,E.call(this),void 0):new o(e)}function i(e,t,n){var r=Error("write after end");e.emit("error",r),k(function(){n(r)})}function s(e,t,n,r){var o=!0;if(!S.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),k(function(){r(i)}),o=!1}return o}function a(e,t,n){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=new S(t,n)),t}function u(e,t,r,o,i){r=a(t,r,o);var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;return t.needDrain=!u,t.writing?t.buffer.push(new n(r,o,i)):c(e,t,s,r,o,i),u}function c(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 l(e,t,n,r,o){n?k(function(){o(r)}):o(r),e.emit("error",r)}function d(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function f(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if(d(n),t)l(e,n,r,t,o);else{var i=g(e,n);i||n.bufferProcessing||!n.buffer.length||v(e,n),r?k(function(){h(e,n,i,o)}):h(e,n,i,o)}}function h(e,t,n,r){n||p(e,t),r(),n&&m(e,t)}function p(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function v(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,s=r.callback,a=t.objectMode?1:o.length;if(c(e,t,a,o,i,s),t.writing){n++;break}}t.bufferProcessing=!1,t.buffer.length>n?t.buffer=t.buffer.slice(n):t.buffer.length=0}function g(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function m(e,t){var n=g(e,t);return n&&(t.finished=!0,e.emit("finish")),n}function y(e,t,n){t.ending=!0,m(e,t),n&&(t.finished?k(n):e.once("finish",n)),t.ended=!0}t.exports=o,o.WritableState=r;var b="undefined"!=typeof Uint8Array?function(e){return e instanceof Uint8Array}:function(e){return e&&e.constructor&&"Uint8Array"===e.constructor.name},w="undefined"!=typeof ArrayBuffer?function(e){return e instanceof ArrayBuffer}:function(e){return e&&e.constructor&&"ArrayBuffer"===e.constructor.name},_=e("inherits"),E=e("./index.js"),k=e("process/browser.js").nextTick,S=e("buffer").Buffer;_(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),!S.isBuffer(e)&&b(e)&&(e=new S(e)),w(e)&&"undefined"!=typeof Uint8Array&&(e=new S(new Uint8Array(e))),S.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=function(){}),r.ended?i(this,r,n):s(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||y(this,r,n)}},{"./index.js":17,buffer:12,inherits:10,"process/browser.js":18}],23:[function(e,t,n){function r(e){if(e&&!a.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 s(e){var t=this.charReceived=e.length%3;return this.charLength=t?3:0,t}var a=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=s;break;default:return this.write=o,void 0}this.charBuffer=new a(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),s=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-i,s),this.charReceived=i,s-=i),t+=e.toString(this.encoding,0,s);var s=t.length-1,o=t.charCodeAt(s);if(o>=55296&&56319>=o){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),this.charBuffer.write(t.charAt(t.length-1),this.encoding),t.substring(0,s)}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:12}],24:[function(e,t){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],25:[function(e,t,n){(function(t,r){function o(e,t){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),v(t)?r.showHidden=t:t&&n._extend(r,t),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=i),u(r,e,r.depth)}function i(e,t){var n=o.styles[t];return n?"["+o.colors[n][0]+"m"+e+"["+o.colors[n][1]+"m":e}function s(e){return e}function a(e){var t={};return e.forEach(function(e){t[e]=!0}),t}function u(e,t,r){if(e.customInspect&&t&&j(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var o=t.inspect(r,e);return b(o)||(o=u(e,o,r)),o}var i=c(e,t);if(i)return i;var s=Object.keys(t),v=a(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),x(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(t);if(0===s.length){if(j(t)){var g=t.name?": "+t.name:"";return e.stylize("[Function"+g+"]","special")}if(E(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(S(t))return e.stylize(Date.prototype.toString.call(t),"date");if(x(t))return l(t)}var m="",y=!1,w=["{","}"];if(p(t)&&(y=!0,w=["[","]"]),j(t)){var _=t.name?": "+t.name:"";m=" [Function"+_+"]"}if(E(t)&&(m=" "+RegExp.prototype.toString.call(t)),S(t)&&(m=" "+Date.prototype.toUTCString.call(t)),x(t)&&(m=" "+l(t)),0===s.length&&(!y||0==t.length))return w[0]+m+w[1];if(0>r)return E(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var k;return k=y?d(e,t,r,v,s):s.map(function(n){return f(e,t,r,v,n,y)}),e.seen.pop(),h(k,m,w)}function c(e,t){if(_(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return y(t)?e.stylize(""+t,"number"):v(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,n,r,o){for(var i=[],s=0,a=t.length;a>s;++s)N(t,s+"")?i.push(f(e,t,n,r,s+"",!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 s,a,c;if(c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},c.get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),N(r,o)||(s="["+o+"]"),a||(0>e.seen.indexOf(c.value)?(a=g(n)?u(e,c.value,null):u(e,c.value,n-1),a.indexOf("\n")>-1&&(a=i?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),_(s)){if(i&&o.match(/^\d+$/))return a;s=JSON.stringify(""+o),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function h(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 p(e){return Array.isArray(e)}function v(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return null==e}function y(e){return"number"==typeof e}function b(e){return"string"==typeof e}function w(e){return"symbol"==typeof e}function _(e){return void 0===e}function E(e){return k(e)&&"[object RegExp]"===A(e)}function k(e){return"object"==typeof e&&null!==e}function S(e){return k(e)&&"[object Date]"===A(e)}function x(e){return k(e)&&("[object Error]"===A(e)||e instanceof Error)}function j(e){return"function"==typeof e}function O(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||e===void 0}function A(e){return Object.prototype.toString.call(e)}function L(e){return 10>e?"0"+e.toString(10):e.toString(10)}function I(){var e=new Date,t=[L(e.getHours()),L(e.getMinutes()),L(e.getSeconds())].join(":");return[e.getDate(),B[e.getMonth()],t].join(" ")}function N(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var D=/%[sdj%]/g;n.format=function(e){if(!b(e)){for(var t=[],n=0;arguments.length>n;n++)t.push(o(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,i=r.length,s=(e+"").replace(D,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return r[n++]+"";case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}}),a=r[n];i>n;a=r[++n])s+=g(a)||!k(a)?" "+a:" "+o(a);return s},n.deprecate=function(e,o){function i(){if(!s){if(t.throwDeprecation)throw Error(o);t.traceDeprecation?console.trace(o):console.error(o),s=!0}return e.apply(this,arguments)}if(_(r.process))return function(){return n.deprecate(e,o).apply(this,arguments)};if(t.noDeprecation===!0)return e;var s=!1;return i};var T,R={};n.debuglog=function(e){if(_(T)&&(T=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!R[e])if(RegExp("\\b"+e+"\\b","i").test(T)){var r=t.pid;R[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else R[e]=function(){};return R[e]},n.inspect=o,o.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]},o.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=p,n.isBoolean=v,n.isNull=g,n.isNullOrUndefined=m,n.isNumber=y,n.isString=b,n.isSymbol=w,n.isUndefined=_,n.isRegExp=E,n.isObject=k,n.isDate=S,n.isError=x,n.isFunction=j,n.isPrimitive=O,n.isBuffer=e("./support/isBuffer");var B=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",I(),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!k(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":24,"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11,inherits:10}],26:[function(require,module,exports){"use strict";function arrayFirst(e,t){for(var n=0;e.length>n;n++)if(t(e[n],n)===!0)return e[n];return!1}function yankError(e){return function(t,n){t||n[0].error?e(t||n[0]):e(null,n[0])}}function computeHeight(e){var t={},n=[];return merge.traverseRevTree(e,function(e,r,o,i){var s=r+"-"+o;return e&&(t[s]=0),void 0!==i&&n.push({from:i,to:s}),s}),n.reverse(),n.forEach(function(e){t[e.from]=void 0===t[e.from]?1+t[e.to]:Math.min(t[e.from],1+t[e.to])}),t}function AbstractPouchDB(){var e=this;EventEmitter.call(this),e.autoCompact=function(t){return e.auto_compaction?function(n,r){if(n)t(n);else{var o=r.length,i=function(){o--,o||t(null,r)};r.forEach(function(t){t.ok?e.compactDocument(t.id,1,i):i()})}}:t};var t,n=0,r=["change","delete","create","update"];this.on("newListener",function(o){if(~r.indexOf(o)){if(n)return n++,void 0;n++;var i=0;t=this.changes({conflicts:!0,include_docs:!0,continuous:!0,since:"latest",onChange:function(t){i>=t.seq||(i=t.seq,e.emit("change",t),t.doc._deleted?e.emit("delete",t):"1"===t.doc._rev.split("-")[0]?e.emit("create",t):e.emit("update",t))}})}}),this.on("removeListener",function(e){~r.indexOf(e)&&(n--,n||t.cancel())})}function processChange(e,t,n){var r=[{rev:e._rev}];"all_docs"===n.style&&(r=merge.collectLeaves(t.rev_tree).map(function(e){return{rev:e.rev}}));var o={id:t.id,changes:r,doc:e};return utils.isDeleted(t,e._rev)&&(o.deleted=!0),n.conflicts&&(o.doc._conflicts=merge.collectConflicts(t),o.doc._conflicts.length||delete o.doc._conflicts),o}function doChanges(api,opts,promise){var callback=opts.complete;if(opts=utils.extend(!0,{},opts),"live"in opts&&!("continuous"in opts)&&(opts.continuous=opts.live),opts.processChange=processChange,opts.since||(opts.since=0),"latest"===opts.since)return api.info(function(e,t){return promise.isCancelled?(callback(null,{status:"cancelled"}),void 0):e?(callback(e),void 0):(opts.since=t.update_seq-1,doChanges(api,opts,promise,callback),void 0)}),void 0;if("http"!==api.type()&&opts.filter&&"string"==typeof opts.filter)if("_view"===opts.filter){if(!opts.view||"string"!=typeof opts.view){var err=errors.error(errors.BAD_REQUEST,"`view` filter parameter is not provided.");return callback(err),void 0}var viewName=opts.view.split("/");api.get("_design/"+viewName[0],function(err,ddoc){if(promise.isCancelled)return callback(null,{status:"cancelled"}),void 0;if(err)return callback(err),void 0;if(ddoc&&ddoc.views&&ddoc.views[viewName[1]]){var filter=eval("(function () { return function (doc) { var emitted = false; var emit = function (a, b) { emitted = true; }; var view = "+ddoc.views[viewName[1]].map+";"+" view(doc);"+" if (emitted) {"+" return true;"+" }"+" }"+"})()");return opts.filter=filter,doChanges(api,opts,promise,callback),void 0}var msg=ddoc.views?"missing json key: "+viewName[1]:"missing json key: views";return err=err||errors.error(errors.MISSING_DOC,msg),callback(err),void 0
})}else{var filterName=opts.filter.split("/");api.get("_design/"+filterName[0],function(err,ddoc){if(promise.isCancelled)return callback(null,{status:"cancelled"}),void 0;if(err)return callback(err),void 0;if(ddoc&&ddoc.filters&&ddoc.filters[filterName[1]]){var filter=eval("(function () { return "+ddoc.filters[filterName[1]]+" })()");return opts.filter=filter,doChanges(api,opts,promise,callback),void 0}var msg=ddoc&&ddoc.filters?"missing json key: "+filterName[1]:"missing json key: filters";return err=err||errors.error(errors.MISSING_DOC,msg),callback(err),void 0})}else{"descending"in opts||(opts.descending=!1),opts.limit=0===opts.limit?1:opts.limit,opts.complete=callback;var newPromise=api._changes(opts);if(newPromise&&"function"==typeof newPromise.cancel){var cancel=promise.cancel;promise.cancel=utils.getArguments(function(e){newPromise.cancel(),cancel.apply(this,e)})}}}var utils=require("./utils"),merge=require("./merge"),errors=require("./deps/errors"),EventEmitter=require("events").EventEmitter;utils.inherits(AbstractPouchDB,EventEmitter),module.exports=AbstractPouchDB,AbstractPouchDB.prototype.post=utils.adapterFun("post",function(e,t,n){return"function"==typeof t&&(n=t,t={}),"object"!=typeof e||Array.isArray(e)?n(errors.NOT_AN_OBJECT):this.bulkDocs({docs:[e]},t,this.autoCompact(yankError(n)))}),AbstractPouchDB.prototype.put=utils.adapterFun("put",utils.getArguments(function(e){var t,n,r,o,i=e.shift(),s="_id"in i;if("object"!=typeof i||Array.isArray(i))return o=e.pop(),o(errors.NOT_AN_OBJECT);for(i=utils.extend(!0,{},i);;)if(t=e.shift(),n=typeof t,"string"!==n||s?"string"!==n||!s||"_rev"in i?"object"===n?r=t:"function"===n&&(o=t):i._rev=t:(i._id=t,s=!0),!e.length)break;r=r||{};var a=utils.invalidIdError(i._id);return a?o(a):this.bulkDocs({docs:[i]},r,this.autoCompact(yankError(o)))})),AbstractPouchDB.prototype.putAttachment=utils.adapterFun("putAttachment",function(e,t,n,r,o,i){function s(e){e._attachments=e._attachments||{},e._attachments[t]={content_type:o,data:r},a.put(e,i)}var a=this;"function"==typeof o&&(i=o,o=r,r=n,n=null),o===void 0&&(o=r,r=n,n=null),a.get(e,function(t,r){return t&&t.error===errors.MISSING_DOC.error?(s({_id:e}),void 0):t?(i(t),void 0):r._rev!==n?(i(errors.REV_CONFLICT),void 0):(s(r),void 0)})}),AbstractPouchDB.prototype.removeAttachment=utils.adapterFun("removeAttachment",function(e,t,n,r){var o=this;o.get(e,function(e,i){return e?(r(e),void 0):i._rev!==n?(r(errors.REV_CONFLICT),void 0):i._attachments?(delete i._attachments[t],0===Object.keys(i._attachments).length&&delete i._attachments,o.put(i,r),void 0):r()})}),AbstractPouchDB.prototype.remove=utils.adapterFun("remove",function(e,t,n){"function"==typeof t&&(n=t,t={}),void 0===t&&(t={}),t=utils.extend(!0,{},t),t.was_delete=!0;var r={_id:e._id,_rev:e._rev};return r._deleted=!0,this.bulkDocs({docs:[r]},t,yankError(n))}),AbstractPouchDB.prototype.revsDiff=utils.adapterFun("revsDiff",function(e,t,n){function r(e,t){a[e]||(a[e]={missing:[]}),a[e].missing.push(t)}function o(t,n){var o=e[t].slice(0);merge.traverseRevTree(n,function(e,n,i,s,a){var u=n+"-"+i,c=o.indexOf(u);-1!==c&&(o.splice(c,1),"available"!==a.status&&r(t,u))}),o.forEach(function(e){r(t,e)})}"function"==typeof t&&(n=t,t={}),t=utils.extend(!0,{},t);var i=Object.keys(e),s=0,a={};i.map(function(t){this._getRevisionTree(t,function(r,u){if(r&&"not_found"===r.name&&"missing"===r.message)a[t]={missing:e[t]};else{if(r)return n(r);o(t,u)}return++s===i.length?n(null,a):void 0})},this)}),AbstractPouchDB.prototype.compactDocument=function(e,t,n){var r=this;this._getRevisionTree(e,function(o,i){if(o)return n(o);var s=computeHeight(i),a=[],u=[];Object.keys(s).forEach(function(e){s[e]>t&&a.push(e)}),merge.traverseRevTree(i,function(e,t,n,r,o){var i=t+"-"+n;"available"===o.status&&-1!==a.indexOf(i)&&(o.status="missing",u.push(i))}),r._doCompaction(e,i,u,n)})},AbstractPouchDB.prototype.compact=utils.adapterFun("compact",function(e,t){"function"==typeof e&&(t=e,e={});var n=this;this.changes({complete:function(e,r){if(e)return t(),void 0;var o=r.results.length;return o?(r.results.forEach(function(e){n.compactDocument(e.id,0,function(){o--,o||t()})}),void 0):(t(),void 0)}})}),AbstractPouchDB.prototype.get=utils.adapterFun("get",function(e,t,n){function r(){var r=[],s=o.length;return s?(o.forEach(function(o){i.get(e,{rev:o,revs:t.revs,attachments:t.attachments},function(e,t){e?r.push({missing:o}):r.push({ok:t}),s--,s||n(null,r)})}),void 0):n(null,r)}if("function"==typeof t&&(n=t,t={}),"string"!=typeof e)return n(errors.INVALID_ID);var o=[],i=this;if(!t.open_revs)return this._get(e,t,function(e,r){if(t=utils.extend(!0,{},t),e)return n(e);var o=r.doc,s=r.metadata,a=r.ctx;if(t.conflicts){var u=merge.collectConflicts(s);u.length&&(o._conflicts=u)}if(t.revs||t.revs_info){var c=merge.rootToLeaf(s.rev_tree),l=arrayFirst(c,function(e){return-1!==e.ids.map(function(e){return e.id}).indexOf(o._rev.split("-")[1])});if(l.ids.splice(l.ids.map(function(e){return e.id}).indexOf(o._rev.split("-")[1])+1),l.ids.reverse(),t.revs&&(o._revisions={start:l.pos+l.ids.length-1,ids:l.ids.map(function(e){return e.id})}),t.revs_info){var d=l.pos+l.ids.length;o._revs_info=l.ids.map(function(e){return d--,{rev:d+"-"+e.id,status:e.opts.status}})}}if(t.local_seq&&(o._local_seq=r.metadata.seq),t.attachments&&o._attachments){var f=o._attachments,h=Object.keys(f).length;if(0===h)return n(null,o);Object.keys(f).forEach(function(e){this._getAttachment(f[e],{encode:!0,ctx:a},function(t,r){o._attachments[e].data=r,--h||n(null,o)})},i)}else{if(o._attachments)for(var p in o._attachments)o._attachments.hasOwnProperty(p)&&(o._attachments[p].stub=!0);n(null,o)}});if("all"===t.open_revs)this._getRevisionTree(e,function(e,t){e&&(t=[]),o=merge.collectLeaves(t).map(function(e){return e.rev}),r()});else{if(!Array.isArray(t.open_revs))return n(errors.error(errors.UNKNOWN_ERROR,"function_clause"));o=t.open_revs;for(var s=0;o.length>s;s++){var a=o[s];if("string"!=typeof a||!/^\d+-/.test(a))return n(errors.error(errors.BAD_REQUEST,"Invalid rev format"))}r()}}),AbstractPouchDB.prototype.getAttachment=utils.adapterFun("getAttachment",function(e,t,n,r){var o=this;n instanceof Function&&(r=n,n={}),n=utils.extend(!0,{},n),this._get(e,n,function(e,i){return e?r(e):i.doc._attachments&&i.doc._attachments[t]?(n.ctx=i.ctx,o._getAttachment(i.doc._attachments[t],n,r),void 0):r(errors.MISSING_DOC)})}),AbstractPouchDB.prototype.allDocs=utils.adapterFun("allDocs",function(e,t){if("function"==typeof e&&(t=e,e={}),e=utils.extend(!0,{},e),"keys"in e){var n=["startkey","endkey","key"].filter(function(t){return t in e})[0];if(n)return t(errors.error(errors.QUERY_PARSE_ERROR,"Query parameter `"+n+"` is not compatible with multi-get")),void 0}return e.skip===void 0&&(e.skip=0),this._allDocs(e,t)}),AbstractPouchDB.prototype.changes=function(e){return utils.cancellableFun(doChanges,this,e)},AbstractPouchDB.prototype.close=utils.adapterFun("close",function(e){return this._close(e)}),AbstractPouchDB.prototype.info=utils.adapterFun("info",function(e){var t=this;this._info(function(n,r){if(n)return e(n);var o=t.prefix.length;r.db_name.length>o&&r.db_name.slice(0,o)===t.prefix&&(r.db_name=r.db_name.slice(o)),e(null,r)})}),AbstractPouchDB.prototype.id=utils.adapterFun("id",function(e){return this._id(e)}),AbstractPouchDB.prototype.type=function(){return"function"==typeof this._type?this._type():this.adapter},AbstractPouchDB.prototype.bulkDocs=utils.adapterFun("bulkDocs",function(e,t,n){if("function"==typeof t&&(n=t,t={}),t=t?utils.extend(!0,{},t):{},!e||!e.docs)return n(errors.MISSING_BULK_DOCS);if(!Array.isArray(e.docs))return n(errors.QUERY_PARSE_ERROR);for(var r=0;e.docs.length>r;++r)if("object"!=typeof e.docs[r]||Array.isArray(e.docs[r]))return n(errors.NOT_AN_OBJECT);return e=utils.extend(!0,{},e),"new_edits"in t||(t.new_edits="new_edits"in e?e.new_edits:!0),this._bulkDocs(e,t,this.autoCompact(n))})},{"./deps/errors":34,"./merge":42,"./utils":46,events:9}],27:[function(e,t){"use strict";function n(e){for(var t=n.options,r=t.parser[t.strictMode?"strict":"loose"].exec(e),o={},i=14;i--;)o[t.key[i]]=r[i]||"";return o[t.q.name]={},o[t.key[12]].replace(t.q.parser,function(e,n,r){n&&(o[t.q.name][n]=r)}),o}function r(e){return/^_(design|local)/.test(e)?e:encodeURIComponent(e)}function o(e,t){if(/http(s?):/.test(e)){var r=n(e);r.remote=!0,(r.user||r.password)&&(r.auth={username:r.user,password:r.password});var o=r.path.replace(/(^\/|\/$)/g,"").split("/");if(r.db=o.pop(),r.path=o.join("/"),t=t||{},t=u.extend(!0,{},t),r.headers=t.headers||{},t.auth||r.auth){var i=t.auth||r.auth,s=u.btoa(i.username+":"+i.password);r.headers.Authorization="Basic "+s}return t.headers&&(r.headers=t.headers),r}return{host:"",path:"/",db:e,auth:!1}}function i(e,t){return s(e,e.db+"/"+t)}function s(e,t){if(e.remote){var n=e.path?"/":"";return e.protocol+"://"+e.host+":"+e.port+"/"+e.path+n+t}return"/"+t}function a(e,t){function n(e,t){return u.ajax(u.extend({},h,e),t)}function a(e,r,o,i){r=u.extend(!0,{},r);var a=l.getHost(i),c={source:d.db,target:a.protocol===d.protocol&&a.authority===d.authority?a.db:a.source};r.continuous&&(c.continuous=!0),r.create_target&&(c.create_target=!0),r.doc_ids&&(c.doc_ids=r.doc_ids),r.filter&&"string"==typeof r.filter&&(c.filter=r.filter),r.query_params&&(c.query_params=r.query_params);var f,h={},p={headers:d.headers,method:"POST",url:s(d,"_replicate"),body:c};o.cancel=function(){this.cancelled=!0,f&&!h.ok&&f.abort(),h._local_id&&(p.body={replication_id:h._local_id}),p.body.cancel=!0,n(p,function(e,n,o){return e?t(e):(u.call(r.complete,null,h,o),void 0)})},o.cancelled||(f=n(p,function(e,n,o){return e?t(e):(h.ok=!0,n._local_id&&(h._local_id=n._local_id),u.call(r.complete,null,n,o),void 0)}))}var l=this;l.getHost=e.getHost?e.getHost:o;var d=l.getHost(e.name,e),f=i(d,"");l.getUrl=function(){return f};var h=e.ajax||{};e=u.extend(!0,{},e);var p={list:[],get:function(e,t){"function"==typeof e&&(t=e,e={count:10});var r=function(e,n){!e&&"uuids"in n?(p.list=p.list.concat(n.uuids),t(null,"OK")):t(e||c.UNKNOWN_ERROR)},o="?count="+e.count;n({headers:d.headers,method:"GET",url:s(d,"_uuids")+o},r)}},v=function(){n({headers:d.headers,method:"PUT",url:f},function(e){e&&401===e.status?n({headers:d.headers,method:"HEAD",url:f},function(e){e?t(e):t(null,l)}):e&&412!==e.status?t(e):t(null,l)})};e.skipSetup||n({headers:d.headers,method:"GET",url:f},function(e){e?404===e.status?v():t(e):t(null,l)}),l.type=function(){return"http"},l.id=u.adapterFun("id",function(e){n({headers:d.headers,method:"GET",url:s(d,"")},function(t,n){if(t)e(t);else{var r=n&&n.uuid?n.uuid+d.db:i(d,"");e(null,r)}})}),l.request=u.adapterFun("request",function(e,t){e.headers=d.headers,e.url=i(d,e.url),n(e,t)}),l.compact=u.adapterFun("compact",function(e,t){"function"==typeof e&&(t=e,e={}),e=u.extend(!0,{},e),n({headers:d.headers,url:i(d,"_compact"),method:"POST"},function(){function n(){l.info(function(r,o){o.compact_running?setTimeout(n,e.interval||200):t()})}"function"==typeof t&&n()})}),l._info=function(e){n({headers:d.headers,method:"GET",url:i(d,"")},function(t,n){t?e(t):(n.host=i(d,""),e(null,n))})},l.get=u.adapterFun("get",function(e,t,o){"function"==typeof t&&(o=t,t={}),t=u.extend(!0,{},t),void 0===t.auto_encode&&(t.auto_encode=!0);var s=[];t.revs&&s.push("revs=true"),t.revs_info&&s.push("revs_info=true"),t.local_seq&&s.push("local_seq=true"),t.open_revs&&("all"!==t.open_revs&&(t.open_revs=JSON.stringify(t.open_revs)),s.push("open_revs="+t.open_revs)),t.attachments&&s.push("attachments=true"),t.rev&&s.push("rev="+t.rev),t.conflicts&&s.push("conflicts="+t.conflicts),s=s.join("&"),s=""===s?"":"?"+s,t.auto_encode&&(e=r(e));var a={headers:d.headers,method:"GET",url:i(d,e+s)},c=e.split("/");(c.length>1&&"_design"!==c[0]&&"_local"!==c[0]||c.length>2&&"_design"===c[0]&&"_local"!==c[0])&&(a.binary=!0),n(a,function(e,t,n){return e?o(e):(o(null,t,n),void 0)})}),l.remove=u.adapterFun("remove",function(e,t,o){"function"==typeof t&&(o=t,t={}),n({headers:d.headers,method:"DELETE",url:i(d,r(e._id))+"?rev="+e._rev},o)}),l.getAttachment=u.adapterFun("getAttachment",function(e,t,n,o){"function"==typeof n&&(o=n,n={}),n=u.extend(!0,{},n),void 0===n.auto_encode&&(n.auto_encode=!0),n.auto_encode&&(e=r(e)),n.auto_encode=!1,l.get(e+"/"+t,n,o)}),l.removeAttachment=u.adapterFun("removeAttachment",function(e,t,o,s){n({headers:d.headers,method:"DELETE",url:i(d,r(e)+"/"+t)+"?rev="+o},s)}),l.putAttachment=u.adapterFun("putAttachment",function(e,t,o,s,a,u){"function"==typeof a&&(u=a,a=s,s=o,o=null),a===void 0&&(a=s,s=o,o=null);var c=r(e)+"/"+t,l=i(d,c);o&&(l+="?rev="+o);var f={headers:d.headers,method:"PUT",url:l,processData:!1,body:s,timeout:6e4};f.headers["Content-Type"]=a,n(f,u)}),l.put=u.adapterFun("put",u.getArguments(function(e){var t,o,s,a,l=e.shift(),f="_id"in l;if("object"!=typeof l||Array.isArray(l))return a=e.pop(),a(c.NOT_AN_OBJECT);for(l=u.extend(!0,{},l);;)if(t=e.shift(),o=typeof t,"string"!==o||f?"string"!==o||!f||"_rev"in l?"object"===o?s=u.extend(!0,{},t):"function"===o&&(a=t):l._rev=t:(l._id=t,f=!0),!e.length)break;s=s||{};var h=u.invalidIdError(l._id);if(h)return a(h);var p=[];s&&s.new_edits!==void 0&&p.push("new_edits="+s.new_edits),p=p.join("&"),""!==p&&(p="?"+p),n({headers:d.headers,method:"PUT",url:i(d,r(l._id))+p,body:l},a)})),l.post=u.adapterFun("post",function(e,t,n){return"function"==typeof t&&(n=t,t={}),t=u.extend(!0,{},t),"object"!=typeof e?n(c.NOT_AN_OBJECT):("_id"in e?l.put(e,t,n):p.list.length>0?(e._id=p.list.pop(),l.put(e,t,n)):p.get(function(r){return r?n(c.UNKNOWN_ERROR):(e._id=p.list.pop(),l.put(e,t,n),void 0)}),void 0)}),l.bulkDocs=u.adapterFun("bulkDocs",function(e,t,r){if("function"==typeof t&&(r=t,t={}),t||(t={}),!Array.isArray(e.docs))return r(c.error(c.NOT_AN_OBJECT,"Missing JSON list of 'docs'"));var o=e.docs.filter(function(e){return"object"!=typeof e||Array.isArray(e)});return o.length?r(c.NOT_AN_OBJECT):(e=u.extend(!0,{},e),t=u.extend(!0,{},t),t.new_edits!==void 0&&(e.new_edits=t.new_edits),n({headers:d.headers,method:"POST",url:i(d,"_bulk_docs"),body:e},r),void 0)}),l.allDocs=u.adapterFun("allDocs",function(e,t){"function"==typeof e&&(t=e,e={}),e=u.extend(!0,{},e);var r,o=[],s="GET";if(e.conflicts&&o.push("conflicts=true"),e.descending&&o.push("descending=true"),e.include_docs&&o.push("include_docs=true"),e.key&&o.push("key="+encodeURIComponent(JSON.stringify(e.key))),e.startkey&&o.push("startkey="+encodeURIComponent(JSON.stringify(e.startkey))),e.endkey&&o.push("endkey="+encodeURIComponent(JSON.stringify(e.endkey))),e.limit!==void 0&&o.push("limit="+e.limit),e.skip!==void 0&&o.push("skip="+e.skip),o=o.join("&"),""!==o&&(o="?"+o),e.keys!==void 0){var a=2e3,c="keys="+encodeURIComponent(JSON.stringify(e.keys));a>=c.length+o.length+1?o+=(-1!==o.indexOf("?")?"&":"?")+c:(s="POST",r=JSON.stringify({keys:e.keys}))}n({headers:d.headers,method:s,url:i(d,"_all_docs"+o),body:r},t)}),l._changes=function(e){var t=25;e=u.extend(!0,{},e),e.timeout=e.timeout||0;var r={timeout:2e4},o=e.limit!==void 0?e.limit:!1;0===o&&(o=1);var s=o;if(e.style&&(r.style=e.style),(e.include_docs||e.filter&&"function"==typeof e.filter)&&(r.include_docs=!0),e.continuous&&(r.feed="longpoll"),e.conflicts&&(r.conflicts=!0),e.descending&&(r.descending=!0),e.filter&&"string"==typeof e.filter&&(r.filter=e.filter,"_view"===e.filter&&e.view&&"string"==typeof e.view&&(r.view=e.view)),e.query_params&&"object"==typeof e.query_params)for(var a in e.query_params)e.query_params.hasOwnProperty(a)&&(r[a]=e.query_params[a]);var l,f,h=function(a,u){if(!e.aborted){r.since=a,e.descending?o&&(r.limit=s):r.limit=!o||s>t?t:s;var c="?"+Object.keys(r).map(function(e){return e+"="+r[e]}).join("&"),h={headers:d.headers,method:"GET",url:i(d,"_changes"+c),timeout:e.timeout};f=a,e.aborted||(l=n(h,u))}},p=10,v=0,g={results:[]},m=function(n,r){if(!e.aborted){var i=0;if(r&&r.results){i=r.results.length,g.last_seq=r.last_seq;var a={};a.query=e.query_params,r.results=r.results.filter(function(t){s--;var n=u.filterChange(e)(t);return n&&(g.results.push(t),u.call(e.onChange,t)),n})}else if(n)return e.aborted=!0,u.call(e.complete,n),void 0;r&&r.last_seq&&(f=r.last_seq);var l=o&&0>=s||r&&t>i||e.descending;if(e.continuous||!l){n?v+=1:v=0;var d=1<<v,y=p*d,b=e.maximumWait||3e4;if(y>b)return u.call(e.complete,n||c.UNKNOWN_ERROR),void 0;setTimeout(function(){h(f,m)},y)}else u.call(e.complete,null,g)}};return h(e.since||0,m),{cancel:function(){e.aborted=!0,l.abort()}}},l.revsDiff=u.adapterFun("revsDif",function(e,t,r){"function"==typeof t&&(r=t,t={}),n({headers:d.headers,method:"POST",url:i(d,"_revs_diff"),body:e},function(e,t){r(e,t)})}),l.close=u.adapterFun("close",function(e){e()}),l.replicateOnServer=function(e,t,n){return l.taskqueue.isReady?(e.info(function(r,o){a(e,t,n,o.host)}),void 0):(l.taskqueue.addTask("replicateOnServer",[e,t,n]),n)},l.destroy=u.adapterFun("destroy",function(e){n({url:i(d,""),method:"DELETE",headers:d.headers},function(t,n){t?(l.emit("error",t),e(t)):(l.emit("destroyed"),e(null,n))})})}var u=e("../utils"),c=e("../deps/errors");n.options={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},a.destroy=u.toPromise(function(e,t,n){var r=o(e,t);t=t||{},"function"==typeof t&&(n=t,t={}),t=u.extend(!0,{},t),t.headers=r.headers,t.method="DELETE",t.url=i(r,"");var s=t.ajax||{};t=u.extend({},t,s),u.ajax(t,n)}),a.valid=function(){return!0},t.exports=a},{"../deps/errors":34,"../utils":46}],28:[function(e,t){(function(n){"use strict";function r(e){return function(t){e(u.error(u.IDB_ERROR,t.target,t.type))}}function o(){var e="_pouch__checkModernIdb_"+(n.navigator&&n.navigator.appVersion),t=s.hasLocalStorage()&&n.localStorage[e];if(t)return JSON.parse(t);var r="_pouch__checkModernIdb",o=null===n.indexedDB.open(r,1).onupgradeneeded;return n.indexedDB.deleteDatabase&&n.indexedDB.deleteDatabase(r),s.hasLocalStorage()&&(n.localStorage[e]=JSON.stringify(o)),o}function i(e,t){function o(e){e.createObjectStore(p,{keyPath:"id"}).createIndex("seq","seq",{unique:!0}),e.createObjectStore(v,{autoIncrement:!0}).createIndex("_doc_id_rev","_doc_id_rev",{unique:!0}),e.createObjectStore(g,{keyPath:"digest"}),e.createObjectStore(m,{keyPath:"id",autoIncrement:!1}),e.createObjectStore(y)}function c(e){var t=e.currentTarget.transaction.objectStore(p);t.openCursor().onsuccess=function(e){var n=e.target.result;if(n){var r=n.value,o=s.isDeleted(r),i=s.isLocalId(r.id);r.deletedOrLocal=o||i?"1":"0",t.put(r),n["continue"]()}else t.createIndex("deletedOrLocal","deletedOrLocal",{unique:!1})}}function l(e,t){return e._bulk_seq-t._bulk_seq}function d(e,t,n){var r=t.keys,o="descending"in t?t.descending:!1;if(r.length){var i=[];r.forEach(function(a){var u=s.extend(!0,{},t);u.keys_request=!0,u.key=a,delete u.keys,delete u.skip,delete u.limit,f(e,u,function(s,u){if(i.push({err:s,res:u,key:a}),i.length===r.length){for(var c={},l=0;i.length>l;l++){var d=i[l];if(d.err)return n(s),void 0;c[d.key]=d}var f=[];r.forEach(function(e){var t=c[e];t.res.rows.length?f.push(t.res.rows[0]):f.push({key:e,error:"not_found"})}),o&&(f=f.reverse()),n(null,{total_rows:e,offset:t.skip,rows:"limit"in t?f.slice(t.skip,t.limit+t.skip):t.skip>0?f.slice(t.skip):f})}})})}else n(null,{offset:t.skip,rows:[],total_rows:e})}function f(e,t,r){var o="startkey"in t?t.startkey:!1,i="endkey"in t?t.endkey:!1,c="key"in t?t.key:!1,l=t.skip||0,d="number"==typeof t.limit?t.limit:-1,f="descending"in t&&t.descending?"prev":null,h=!1;f&&o&&i&&(h=i,i=!1);var g;try{g=o&&i?n.IDBKeyRange.bound(o,i):o?f?n.IDBKeyRange.upperBound(o):n.IDBKeyRange.lowerBound(o):i?f?n.IDBKeyRange.lowerBound(i):n.IDBKeyRange.upperBound(i):c?n.IDBKeyRange.only(c):null}catch(m){return"DataError"===m.name&&0===m.code?r(null,{total_rows:e,offset:t.skip,rows:[]}):r(u.error(u.IDB_ERROR,m.name,m.message))}var y=S.transaction([p,v],"readonly");y.oncomplete=function(){r(null,{total_rows:e,offset:t.skip,rows:_})};var b=y.objectStore(p),w=f?b.openCursor(g,f):b.openCursor(g),_=[];w.onsuccess=function(e){function n(e,n){if(s.isLocalId(e.id))return r["continue"]();var o={id:e.id,key:e.id,value:{rev:a.winningRev(e)}};if(t.include_docs){o.doc=n,o.doc._rev=a.winningRev(e),o.doc._doc_id_rev&&delete o.doc._doc_id_rev,t.conflicts&&(o.doc._conflicts=a.collectConflicts(e));for(var i in o.doc._attachments)o.doc._attachments.hasOwnProperty(i)&&(o.doc._attachments[i].stub=!0)}if(t.keys_request)s.isDeleted(e)&&(o.value.deleted=!0,o.doc=null),_.push(o);else if(!s.isDeleted(e)&&0>=l--){if(h&&h>o.key)return;if(_.push(o),0===--d)return}r["continue"]()}if(e.target.result){var r=e.target.result,o=r.value;if(t.include_docs){var i=y.objectStore(v).index("_doc_id_rev"),u=a.winningRev(o),c=o.id+"::"+u;i.get(c).onsuccess=function(e){n(r.value,e.target.result)}}else n(o)}}}var h=2,p="document-store",v="by-sequence",g="attach-store",m="meta-store",y="detect-blob-support",b=e.name,w=n.indexedDB.open(b,h);"openReqList"in i||(i.openReqList={}),i.openReqList[b]=w;var _=null,E=null,k=this,S=null;w.onupgradeneeded=function(e){var t=e.target.result;1>e.oldVersion&&o(t),2>e.oldVersion&&c(e)},w.onsuccess=function(e){S=e.target.result,S.onversionchange=function(){S.close()};var n=S.transaction([m,y],"readwrite"),r=n.objectStore(m).get(m);r.onsuccess=function(e){var r=!1,o=function(){null!==_&&r&&t(null,k)},i=e.target.result||{id:m};b+"_id"in i?(E=i[b+"_id"],r=!0,o()):(E=s.uuid(),i[b+"_id"]=E,n.objectStore(m).put(i).onsuccess=function(){r=!0,o()});try{n.objectStore(y).put(s.createBlob(),"key"),_=!0}catch(a){_=!1}finally{o()}}},w.onerror=r(t),k.type=function(){return"idb"},k._id=s.toPromise(function(e){e(null,E)}),k._bulkDocs=function(e,t,n){function o(e){var t=e.target.result;t.updateSeq=(t.updateSeq||0)+D,I.objectStore(m).put(t)}function c(){if(!A.length)return I.objectStore(m).get(m).onsuccess=o,void 0;var e=A.shift(),t=I.objectStore(p).get(e.metadata.id);t.onsuccess=function(t){var n=t.target.result;n?w(n,e):E(e)}}function d(){var e=[];N.sort(l),N.forEach(function(t){if(delete t._bulk_seq,t.error)return e.push(t),void 0;var n=t.metadata,r=a.winningRev(n);e.push({ok:!0,id:n.id,rev:r}),s.isLocalId(n.id)||(i.Changes.notify(b),i.Changes.notifyLocalWindows(b))}),n(null,e)}function f(e,t){if(e.stub)return t();if("string"==typeof e.data){var r;try{r=atob(e.data)}catch(o){var i=u.error(u.BAD_ARG,"Attachments need to be base64 encoded");return n(i)}if(e.digest="md5-"+s.Crypto.MD5(r),_){var a=e.content_type;r=s.fixBinary(r),e.data=s.createBlob([r],{type:a})}return t()}var c=new FileReader;c.onloadend=function(){var n=s.arrayBufferToBinaryString(this.result);e.digest="md5-"+s.Crypto.MD5(n),_||(e.data=btoa(n)),t()},c.readAsArrayBuffer(e.data)}function h(e){function t(){n++,A.length===n&&e()}if(!A.length)return e();var n=0;A.forEach(function(e){function n(){o++,o===r.length&&t()}var r=e.data&&e.data._attachments?Object.keys(e.data._attachments):[];if(!r.length)return t();var o=0;for(var i in e.data._attachments)e.data._attachments.hasOwnProperty(i)&&f(e.data._attachments[i],n)})}function y(e,t){function n(e){i||(e?(i=e,t(i)):a===u.length&&o())}function r(e){a++,n(e)}function o(){e.data._doc_id_rev=e.data._id+"::"+e.data._rev;var n=I.objectStore(v).index("_doc_id_rev");n.getKey(e.data._doc_id_rev).onsuccess=function(n){var r=n.target.result?I.objectStore(v).put(e.data,n.target.result):I.objectStore(v).put(e.data);r.onsuccess=function(n){e.metadata.seq=n.target.result,delete e.metadata.rev;var r=s.isDeleted(e.metadata),o=s.isLocalId(e.metadata.id),i=s.extend(!0,{deletedOrLocal:r||o?"1":"0"},e.metadata),a=I.objectStore(p).put(i);a.onsuccess=function(){N.push(e),s.call(t)}}}}var i=null,a=0;e.data._id=e.metadata.id,e.data._rev=e.metadata.rev,D++,s.isDeleted(e.metadata,e.metadata.rev)&&(e.data._deleted=!0);var u=e.data._attachments?Object.keys(e.data._attachments):[];for(var c in e.data._attachments)if(e.data._attachments[c].stub)a++,n();else{var l=e.data._attachments[c].data;delete e.data._attachments[c].data;var d=e.data._attachments[c].digest;x(e,d,l,r)}u.length||o()}function w(e,t){var n=a.merge(e.rev_tree,t.metadata.rev_tree[0],1e3),r=s.isDeleted(e),o=r&&s.isDeleted(t.metadata)||!r&&j&&"new_leaf"!==n.conflicts;return o?(N.push(k(u.REV_CONFLICT,t._bulk_seq)),c()):(t.metadata.rev_tree=n.tree,y(t,c),void 0)}function E(e){return"was_delete"in t&&s.isDeleted(e.metadata)?(N.push(u.MISSING_DOC),c()):(y(e,c),void 0)}function k(e,t){return e._bulk_seq=t,e}function x(e,t,n,r){var o=I.objectStore(g);o.get(t).onsuccess=function(i){var a=i.target.result&&i.target.result.refs||{},u=[e.metadata.id,e.metadata.rev].join("@"),c={digest:t,body:n,refs:a};c.refs[u]=!0,o.put(c).onsuccess=function(){s.call(r)}}}var j=t.new_edits,O=e.docs,A=O.map(function(e,t){var n=s.parseDoc(e,j);return n._bulk_seq=t,n}),L=A.filter(function(e){return e.error});if(L.length)return n(L[0]);var I,N=[],D=0;h(function(){I=S.transaction([p,v,g,m],"readwrite"),I.onerror=r(n),I.ontimeout=r(n),I.oncomplete=d,c()})},k._get=function(e,t,n){function r(){n(c,{doc:o,metadata:i,ctx:l})}var o,i,c,l;t=s.extend(!0,{},t),l=t.ctx?t.ctx:S.transaction([p,v,g],"readonly"),l.objectStore(p).get(e).onsuccess=function(e){if(i=e.target.result,!i)return c=u.MISSING_DOC,r();if(s.isDeleted(i)&&!t.rev)return c=u.error(u.MISSING_DOC,"deleted"),r();var n=a.winningRev(i),d=i.id+"::"+(t.rev?t.rev:n),f=l.objectStore(v).index("_doc_id_rev");f.get(d).onsuccess=function(e){return o=e.target.result,o&&o._doc_id_rev&&delete o._doc_id_rev,o?(r(),void 0):(c=u.MISSING_DOC,r())}}},k._getAttachment=function(e,t,n){var r,o;t=s.extend(!0,{},t),o=t.ctx?t.ctx:S.transaction([p,v,g],"readonly");var i=e.digest,a=e.content_type;o.objectStore(g).get(i).onsuccess=function(e){var o=e.target.result.body;if(t.encode)if(_){var i=new FileReader;i.onloadend=function(){var e=s.arrayBufferToBinaryString(this.result);r=btoa(e),n(null,r)},i.readAsArrayBuffer(o)}else r=o,n(null,r);else _?r=o:(o=s.fixBinary(atob(o)),r=s.createBlob([o],{type:a})),n(null,r)}},k._allDocs=function(e,t){function o(e){i=e.target.result}var i,s=S.transaction([p],"readonly"),a=s.objectStore(p).index("deletedOrLocal");a.count(n.IDBKeyRange.only("0")).onsuccess=o,s.onerror=r(t),s.oncomplete=function(){return 0===e.limit?t(null,{total_rows:i,offset:e.skip,rows:[]}):("keys"in e?d(i,e,t):f(i,e,t),void 0)}},k._info=function(e){function t(e){o=e.target.result&&e.target.result.updateSeq||0}function n(e){var n=e.target.result;return n?(n.value.deleted!==!0&&r++,n["continue"](),void 0):(i.objectStore(m).get(m).onsuccess=t,void 0)}var r=0,o=0,i=S.transaction([p,m],"readonly");i.oncomplete=function(){e(null,{db_name:b,doc_count:r,update_seq:o})},i.objectStore(p).openCursor().onsuccess=n},k._changes=function(e){function t(){d=S.transaction([p,v]),d.oncomplete=o;var t;t=c?d.objectStore(v).openCursor(n.IDBKeyRange.lowerBound(e.since,!0),c):d.objectStore(v).openCursor(n.IDBKeyRange.lowerBound(e.since,!0)),t.onsuccess=r,t.onerror=onerror}function r(t){if(!t.target.result){for(var n=0,r=f.length;r>n;n++){var o=f[n];o&&g.push(o)}return!1}var i=t.target.result,u=i.value._id,c=h[u];if(void 0!==c)return f[c].seq=i.key,f.push(f[c]),f[c]=null,h[u]=f.length-1,i["continue"]();var m=d.objectStore(p);m.get(i.value._id).onsuccess=function(t){var n=t.target.result;if(s.isLocalId(n.id))return i["continue"]();n.seq>l&&(l=n.seq);var r=a.winningRev(n),o=n.id+"::"+r,u=d.objectStore(v).index("_doc_id_rev");u.get(o).onsuccess=function(t){var o=t.target.result;delete o._doc_id_rev,o._rev=r;var s=e.processChange(o,n,e);s.seq=i.key;var a=s.id,u=h[a];void 0!==u&&(f[u]=null),f.push(s),h[a]=f.length-1,i["continue"]()}}}function o(){s.processChanges(e,g,l)}if(e=s.extend(!0,{},e),e.continuous){var u=b+":"+s.uuid();return i.Changes.addListener(b,u,k,e),i.Changes.notify(b),{cancel:function(){i.Changes.removeListener(b,u)}}}var c=e.descending?"prev":null,l=0;e.since=e.since&&!c?e.since:0;var d,f=[],h={},g=[];t()},k._close=function(e){return null===S?e(u.NOT_OPEN):(S.close(),e(),void 0)},k._getRevisionTree=function(e,t){var n=S.transaction([p],"readonly"),r=n.objectStore(p).get(e);r.onsuccess=function(e){var n=e.target.result;n?t(null,n.rev_tree):t(u.MISSING_DOC)}},k._doCompaction=function(e,t,n,r){var o=S.transaction([p,v],"readwrite"),i=o.objectStore(p);i.get(e).onsuccess=function(r){var i=r.target.result;i.rev_tree=t;var a=n.length;n.forEach(function(t){var n=o.objectStore(v).index("_doc_id_rev"),r=e+"::"+t;n.getKey(r).onsuccess=function(e){var t=e.target.result;if(t&&(o.objectStore(v)["delete"](t),a--,!a)){if(i){var n=s.isDeleted(i),r=s.isLocalId(i.id);i=s.extend(!0,{deletedOrLocal:n||r?"1":"0"},i)}o.objectStore(p).put(i)}}})},o.oncomplete=function(){s.call(r)}}}var s=e("../utils"),a=e("../merge"),u=e("../deps/errors");i.valid=function(){return n.indexedDB&&o()},i.destroy=s.toPromise(function(e,t,o){"openReqList"in i||(i.openReqList={}),i.Changes.clearListeners(e),i.openReqList[e]&&i.openReqList[e].result&&i.openReqList[e].result.close();var s=n.indexedDB.deleteDatabase(e);s.onsuccess=function(){i.openReqList[e]&&(i.openReqList[e]=null),o()},s.onerror=r(o)}),i.Changes=new s.Changes,t.exports=i}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../deps/errors":34,"../merge":42,"../utils":46}],29:[function(e,t){(function(n,r){"use strict";function o(e,t){function o(){A=L=-1,I.docStore=j.sublevel(v,{valueEncoding:"json"}),I.bySeqStore=j.sublevel(g,{valueEncoding:"json"}),I.attachmentStore=j.sublevel(m,{valueEncoding:"json"}),I.binaryStore=j.sublevel(y,{valueEncoding:"binary"}),I.bySeqStore.get(_,function(e,r){A=e?0:r,I.bySeqStore.get(E,function(e,r){L=e?0:r,I.bySeqStore.get(k,function(e,r){x=e?f.uuid():r,I.bySeqStore.put(k,x,function(){n.nextTick(function(){t(null,O)})})})})})}function p(e){return("0000000000000000"+e).slice(-16)}function S(e){return parseInt(e,10)}e=f.extend(!0,{},e);var x,j,O=this,A=0,L=0,I={},N=e.name,D=w[N]||new s;e.createIfMissing===void 0&&(e.createIfMissing=!0),w[N]=D,n.browser&&(u=e.db||u),b[N]?(j=b[N],o()):b[N]=c(a(N,e,function(n){return n?(delete b[N],t(n)):(j=b[N],e.db||e.noMigrate?o():h(N,j,o),void 0)})),O.type=function(){return"leveldb"},O._id=function(e){e(null,x)},O._info=function(t){I.bySeqStore.get(E,function(n,r){n&&(r=L),I.bySeqStore.get(_,function(n,o){return n&&(o=A),t(null,{db_name:e.name,doc_count:r,update_seq:o})})})},O._get=function(e,t,n){t=f.extend(!0,{},t),I.docStore.get(e,function(e,r){if(e||!r)return n(l.MISSING_DOC);if(f.isDeleted(r)&&!t.rev)return n(l.error(l.MISSING_DOC,"deleted"));var o=d.winningRev(r);o=t.rev?t.rev:o;var i=r.rev_map[o];I.bySeqStore.get(p(i),function(e,t){return t?(t._id=r.id,t._rev=o,n(null,{doc:t,metadata:r})):n(l.MISSING_DOC)})})},O._getAttachment=function(e,t,n){var o=e.digest;I.binaryStore.get(o,function(e,o){var i;return e&&"NotFoundError"===e.name?(i=t.encode?"":new r(""),n(null,i)):e?n(e):(i=t.encode?f.btoa(o):o,n(null,i),void 0)})},O._bulkDocs=function(e,t,r){function o(){if(0===m.length)return h();var e=m.shift();I.docStore.get(e.metadata.id,function(t,n){t&&"NotFoundError"===t.name?s(e,o):a(n,e,o)})}function s(e,n){return"was_delete"in t&&f.isDeleted(e.metadata)?(y.push(v(l.MISSING_DOC,e._bulk_seq)),n()):(L++,u(e,function(){I.bySeqStore.put(E,L,function(e){return n()})}),void 0)}function a(e,t,n){var r=d.merge(e.rev_tree,t.metadata.rev_tree[0],1e3),o=f.isDeleted(e)&&f.isDeleted(t.metadata)||!f.isDeleted(e)&&g&&"new_leaf"!==r.conflicts;return o?(y.push(v(l.REV_CONFLICT,t._bulk_seq)),n()):(t.metadata.rev_tree=r.tree,t.metadata.rev_map=e.rev_map,u(t,n),void 0)}function u(e,t){function n(e){a||(e?(a=e,t(a)):u===d.length&&s())}function o(e){u++,n(e)}function s(){A++,e.metadata.seq=e.metadata.seq||A,e.metadata.rev_map[e.metadata.rev]=e.metadata.seq,j.batch([{key:p(e.metadata.seq),value:e.data,prefix:I.bySeqStore,type:"put",valueEncoding:"json"},{key:e.metadata.id,value:e.metadata,prefix:I.docStore,type:"put",valueEncoding:"json"}],function(){return I.bySeqStore.put(_,A,function(n){return n?y.push(n):y.push(e),t()
})})}var a=null,u=0;e.data._id=e.metadata.id,f.isDeleted(e.metadata)&&(e.data._deleted=!0);for(var d=e.data._attachments?Object.keys(e.data._attachments):[],h=0;d.length>h;h++){var v=d[h];if(e.data._attachments[v].stub)u++,n();else{var g=e.data._attachments[v].data;if("string"==typeof g)try{g=f.atob(g)}catch(m){return r(f.extend({},l.BAD_ARG,{reason:"Attachments need to be base64 encoded"})),void 0}var b="md5-"+i.createHash("md5").update(g||"").digest("hex");delete e.data._attachments[v].data,e.data._attachments[v].digest=b,c(e,b,g,o)}}d.length||s()}function c(e,t,n,r){I.attachmentStore.get(t,function(o,i){if(o&&"NotFoundError"!==o.name)return r(o);var s=[e.metadata.id,e.metadata.rev].join("@"),a={};i?i.refs&&(a.refs=i.refs,a.refs[s]=!0):(a.refs={},a.refs[s]=!0),I.attachmentStore.put(t,a,function(e){return 0===n.length?r(e):(I.binaryStore.put(t,n,function(e){r(e)}),void 0)})})}function h(){var e=[];y.sort(function(e,t){return e._bulk_seq-t._bulk_seq}),y.forEach(function(t){if(delete t._bulk_seq,t.error)return e.push(t);var n=t.metadata,r=d.winningRev(n);if(e.push({ok:!0,id:n.id,rev:r}),!f.isLocalId(n.id)){var o={id:n.id,seq:n.seq,changes:d.collectLeaves(n.rev_tree),doc:t.data};o.doc._rev=r,D.emit("change",o)}}),n.nextTick(function(){r(null,e)})}function v(e,t){return e._bulk_seq=t,e}var g=t.new_edits,m=[],y=[],b=e.docs;m=b.map(function(e,t){var n=f.parseDoc(e,g);return n._bulk_seq=t,n.metadata&&!n.metadata.rev_map&&(n.metadata.rev_map={}),n});var w=m.filter(function(e){return e.error});return w.length?r(w[0]):(o(),void 0)},O.countDocs=function(e){var t=0,n=I.docStore.readStream();n.on("data",function(e){var n=e.value;f.isLocalId(n.id)||f.isDeleted(n)||t++}),n.on("error",function(t){e(t)}),n.on("end",function(){e(null,t)})},O._allDocs=function(e,t){this.countDocs(function(n,r){var o={},i=e.skip||0;if(e.startkey&&(o.start=e.startkey),e.endkey&&(o.end=e.endkey),e.key&&(o.start=o.end=e.key),e.descending){o.reverse=!0;var s=o.start;o.start=o.end,o.end=s}var a;if(a="number"==typeof e.limit?e.limit:-1,0===a||"start"in o&&"end"in o&&o.start>o.end)return t(null,{total_rows:r,offset:e.skip,rows:[]});var u=[],c={},l=I.docStore.readStream(o);l.on("data",function(t){function n(t,n){if(!f.isLocalId(t.id)){var r={id:t.id,key:t.id,value:{rev:d.winningRev(t)}};if(e.include_docs){r.doc=n,r.doc._rev=r.value.rev,e.conflicts&&(r.doc._conflicts=d.collectConflicts(t));for(var o in r.doc._attachments)r.doc._attachments.hasOwnProperty(o)&&(r.doc._attachments[o].stub=!0)}"keys"in e?e.keys.indexOf(t.id)>-1&&(f.isDeleted(t)&&(r.value.deleted=!0,r.doc=null),c[r.id]=r):f.isDeleted(t)||u.push(r)}}if(f.isDeleted(t.value)){if(!("keys"in e))return}else{if(i-->0)return;if(0===a--)return l.destroy(),void 0}var r=t.value;if(e.include_docs){var o=r.rev_map[d.winningRev(r)];I.bySeqStore.get(p(o),function(e,t){n(r,t)})}else n(r)}),l.on("error",function(){}),l.on("end",function(){}),l.on("close",function(){return"keys"in e&&(e.keys.forEach(function(e){e in c?u.push(c[e]):u.push({key:e,error:"not_found"})}),e.descending&&u.reverse()),t(null,{total_rows:r,offset:e.skip,rows:u})})})},O._changes=function(e){function t(){var t={reverse:r};t.reverse||(t.start=p(e.since?e.since+1:0));var s=I.bySeqStore.readStream(t);s.on("data",function(t){e.cancelled||f.isLocalId(t.key)||I.docStore.get(t.value._id,function(n,r){if(!f.isLocalId(r.id)){var s=t.value;s._rev=d.winningRev(r);var a=e.processChange(s,r,e);a.seq=r.seq,r.seq>i&&(i=r.seq),S(t.key)===r.rev_map[a.doc._rev]&&o.push(a)}})}).on("error",function(){}).on("close",function(){if(!e.cancelled){var t=f.filterChange(e);n=function(n){t(n)&&e.onChange(n)},e.continuous&&!e.cancelled&&D.on("change",n),o=o.sort(function(e,t){return r?t.seq-e.seq:e.seq-t.seq}),f.processChanges(e,o,i)}})}e=f.extend(!0,{},e);var n,r=e.descending,o=[],i=0;return t(),{cancel:function(){e.cancelled=!0,n&&D.removeListener("change",n)}}},O._close=function(e){return j.isClosed()?e(l.NOT_OPEN):(j.close(function(t){t?e(t):(delete b[N],e())}),void 0)},O._getRevisionTree=function(e,t){I.docStore.get(e,function(e,n){e?t(l.MISSING_DOC):t(null,n.rev_tree)})},O._doCompaction=function(e,t,n,r){I.docStore.get(e,function(e,o){if(e)return r(e);var i=o.rev_map;o.rev_tree=t,n.length||r();var s=[];s.push({key:o.id,value:o,type:"put",valueEncoding:"json",prefix:I.docStore}),n.forEach(function(e){var t=i[e];t&&s.push({key:p(t),type:"del",prefix:I.bySeqStore})}),j.batch(s,r)})},O.destroy=f.adapterFun("destroy",function(e,t){"function"==typeof e&&(t=e,e={}),j.isClosed()?u.destroy(N,t):j.close(function(e){return e?t(e):(u.destroy(N,function(e,n){e?(O.emit("error",e),t(e)):(O.emit("destroyed"),t(null,n))}),void 0)})})}var i=e("crypto"),s=e("events").EventEmitter,a=e("levelup"),u=e("leveldown"),c=e("level-sublevel"),l=e("../deps/errors"),d=e("../merge"),f=e("../utils"),h=e("../deps/migrate"),p=e("./idb"),v="document-store",g="by-sequence",m="attach-store",y="attach-binary-store",b={},w={},_="_local_last_update_seq",E="_local_doc_count",k="_local_uuid";o.valid=function(){return n&&!n.browser||p.valid()},o.destroy=f.toPromise(function(e,t,r){t=f.extend(!0,{},t),n.browser&&(u=t.db||u),b[e]?b[e].close(function(){delete b[e],u.destroy(e,r)}):u.destroy(e,r)}),o.use_prefix=!1,t.exports=o}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),e("buffer").Buffer)},{"../deps/errors":34,"../deps/migrate":38,"../merge":42,"../utils":46,"./idb":28,"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11,buffer:12,crypto:4,events:9,"level-sublevel":63,leveldown:49,levelup:77}],30:[function(e,t){(function(n){"use strict";function r(e){return"'"+e+"'"}function o(e){return function(t){var n=t&&(""+t.constructor).match(/function ([^\(]+)/),r=n&&n[1]||t.type,o=t.target||t.message;e(l.error(l.WSQ_ERROR,o,r))}}function i(e){return decodeURIComponent(window.escape(e))}function s(e,t){for(var n="",r="UTF-8"===t?2:4,o=0,s=e.length;s>o;o+=r){var a=e.substring(o,o+r);4===r&&(a=a.substring(2,4)+a.substring(0,2)),n+=String.fromCharCode(parseInt(a,16))}return n="UTF-8"===t?i(n):n}function a(e,t){function r(){u.hasLocalStorage()&&(n.localStorage["_pouch__websqldb_"+L]=!0),t(null,O)}function i(e){e.executeSql(E),e.executeSql("ALTER TABLE "+m+" ADD COLUMN deleted TINYINT(1) DEFAULT 0",[],function(){e.executeSql(w),e.executeSql("ALTER TABLE "+g+" ADD COLUMN local TINYINT(1) DEFAULT 0",[],function(){e.executeSql(_);var t="SELECT "+g+".winningseq AS seq, "+g+".json AS metadata FROM "+m+" JOIN "+g+" ON "+m+".seq = "+g+".winningseq";e.executeSql(t,[],function(e,t){for(var n=[],r=[],o=0;t.rows.length>o;o++){var i=t.rows.item(o),s=i.seq,a=JSON.parse(i.metadata);u.isDeleted(a)&&n.push(s),u.isLocalId(a.id)&&r.push(a.id)}e.executeSql("UPDATE "+g+"SET local = 1 WHERE id IN ("+r.map(function(){return"?"}).join(",")+")",r),e.executeSql("UPDATE "+m+" SET deleted = 1 WHERE seq IN ("+n.map(function(){return"?"}).join(",")+")",n)})})})}function d(e){for(;I.length>0;){var t=I.pop();t(null,A)}k(e)}function k(e){e.executeSql("SELECT dbid, hex(dbid) AS hexId FROM "+b,[],function(e,t){var n=t.rows.item(0).dbid,r=t.rows.item(0).hexId;j=r.length===2*n.length?"UTF-8":"UTF-16"})}function S(e,t){if(0===t){var n="CREATE TABLE IF NOT EXISTS "+b+" (update_seq, dbid, db_version INTEGER)",r="CREATE TABLE IF NOT EXISTS "+y+" (digest, json, body BLOB)",o="CREATE TABLE IF NOT EXISTS "+g+" (id unique, seq, json, winningseq, local TINYINT(1))",s="CREATE TABLE IF NOT EXISTS "+m+" (seq INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, doc_id_rev UNIQUE, json, deleted TINYINT(1))";e.executeSql(r),e.executeSql(o,[],function(){e.executeSql(E),e.executeSql(_)}),e.executeSql(s,[],function(){e.executeSql(w)}),e.executeSql(n,[],function(){var t="INSERT INTO "+b+" (update_seq, db_version, dbid) VALUES (?, ?, ?)";A=u.uuid(),e.executeSql(t,[0,v,A]),d(e)})}else 1===t&&(i(e),e.executeSql("UPDATE "+b+" SET db_version = "+v)),e.executeSql("SELECT dbid FROM "+b,[],function(e,t){A=t.rows.item(0).dbid,d(e)})}function x(){N.transaction(function(e){e.executeSql("SELECT sql FROM sqlite_master WHERE tbl_name = "+b,[],function(e,t){t.rows.length?/db_version/.test(t.rows.item(0).sql)?e.executeSql("SELECT db_version FROM "+b,[],function(e,t){var n=t.rows.item(0).db_version;S(e,n)}):e.executeSql("ALTER TABLE "+b+" ADD COLUMN db_version INTEGER",[],function(){S(e,1)}):S(e,0)})},o(t),r)}var j,O=this,A=null,L=e.name,I=[],N=f(L,h,L,p);return N?(u.isCordova()&&n!==void 0?n.addEventListener(L+"_pouch",function D(){n.removeEventListener(L+"_pouch",D,!1),x()},!1):x(),O.type=function(){return"websql"},O._id=u.toPromise(function(e){e(null,A)}),O._info=function(e){N.transaction(function(t){var n="SELECT COUNT(id) AS count FROM "+g;t.executeSql(n,[],function(t,n){var r=n.rows.item(0).count,o="SELECT update_seq FROM "+b;t.executeSql(o,[],function(t,n){var o=n.rows.item(0).update_seq;e(null,{db_name:L,doc_count:r,update_seq:o})})})})},O._bulkDocs=function(e,t,n){function r(e,t){return e._bulk_seq-t._bulk_seq}function i(){var e=[];T.sort(r),T.forEach(function(t){if(delete t._bulk_seq,t.error)return e.push(t),void 0;var n=t.metadata,r=c.winningRev(n);e.push({ok:!0,id:n.id,rev:r}),u.isLocalId(n.id)||(O++,a.Changes.notify(L),a.Changes.notifyLocalWindows(L))});var t="SELECT update_seq FROM "+b;D.executeSql(t,[],function(t,r){var o=r.rows.item(0).update_seq+O,i="UPDATE "+b+" SET update_seq=?";t.executeSql(i,[o],function(){n(null,e)})})}function d(e,t){if(e.stub)return t();if("string"==typeof e.data){try{e.data=atob(e.data)}catch(r){var o=l.error(l.BAD_ARG,"Attachments need to be base64 encoded");return n(o)}var i=u.fixBinary(e.data);e.data=u.createBlob([i],{type:e.content_type})}var s=new FileReader;s.onloadend=function(){var n=u.arrayBufferToBinaryString(this.result);e.data=n,e.digest="md5-"+u.Crypto.MD5(n),t()},s.readAsArrayBuffer(e.data)}function f(e){function t(){n++,A.length===n&&e()}if(!A.length)return e();var n=0;A.forEach(function(e){function n(){o++,o===r.length&&t()}var r=e.data&&e.data._attachments?Object.keys(e.data._attachments):[],o=0;if(!r.length)return t();for(var i in e.data._attachments)e.data._attachments.hasOwnProperty(i)&&d(e.data._attachments[i],n)})}function h(e,t,n){function r(){var t=e.data,n=t._id+"::"+t._rev,r=u.isDeleted(e.metadata,e.metadata.rev)?1:0,o="SELECT * FROM "+m+" WHERE doc_id_rev=?;";D.executeSql(o,[n],function(e,o){var i,a;o.rows.length?(i="UPDATE "+m+" SET json=?, deleted=? WHERE doc_id_rev=?;",a=[JSON.stringify(t),r,n],D.executeSql(i,a,function(e){s(e,o.rows.item(0).seq)})):(i="INSERT INTO "+m+" (doc_id_rev, json, deleted) VALUES (?, ?, ?);",a=[n,JSON.stringify(t),r],D.executeSql(i,a,function(e,t){s(e,t.insertId)}))})}function o(e){a||(e?(a=e,t(a)):l===d.length&&r())}function i(e){l++,o(e)}function s(r,o){e.metadata.seq=o,delete e.metadata.rev;var i=c.winningRev(e.metadata),s=n?"UPDATE "+g+" SET seq=?, json=?, winningseq=(SELECT seq FROM "+m+" WHERE doc_id_rev=?) WHERE id=?":"INSERT INTO "+g+" (id, seq, winningseq, json, local) VALUES (?, ?, ?, ?, ?);",a=JSON.stringify(e.metadata),l=e.metadata.id+"::"+i,d=u.isLocalId(e.metadata.id)?1:0,f=n?[o,a,l,e.metadata.id]:[e.metadata.id,o,o,a,d];r.executeSql(s,f,function(){T.push(e),t()})}var a=null,l=0;e.data._id=e.metadata.id,e.data._rev=e.metadata.rev,u.isDeleted(e.metadata,e.metadata.rev)&&(e.data._deleted=!0);var d=e.data._attachments?Object.keys(e.data._attachments):[];for(var f in e.data._attachments)if(e.data._attachments[f].stub)l++,o();else{var h=e.data._attachments[f].data;delete e.data._attachments[f].data;var p=e.data._attachments[f].digest;E(e,p,h,i)}d.length||r()}function p(e,t){var n=c.merge(e.rev_tree,t.metadata.rev_tree[0],1e3),r=u.isDeleted(e)&&u.isDeleted(t.metadata)||!u.isDeleted(e)&&S&&"new_leaf"!==n.conflicts;return r?(T.push(_(l.REV_CONFLICT,t._bulk_seq)),w()):(t.metadata.rev_tree=n.tree,h(t,w,!0),void 0)}function v(e){return"was_delete"in t&&u.isDeleted(e.metadata)?(T.push(l.MISSING_DOC),w()):(h(e,w,!1),void 0)}function w(){if(!A.length)return i();var e=A.shift(),t=e.metadata.id;t in R?p(R[t],e):(R[t]=e.metadata,v(e))}function _(e,t){return e._bulk_seq=t,e}function E(e,t,n,r){var o=[e.metadata.id,e.metadata.rev].join("@"),i={digest:t},s="SELECT digest, json FROM "+y+" WHERE digest=?";D.executeSql(s,[t],function(e,a){a.rows.length?(i.refs=JSON.parse(a.rows.item(0).json).refs,s="UPDATE "+y+" SET json=?, body=? WHERE digest=?",e.executeSql(s,[JSON.stringify(i),n,t],function(){r()})):(i.refs={},i.refs[o]=!0,s="INSERT INTO "+y+"(digest, json, body) VALUES (?, ?, ?)",e.executeSql(s,[t,JSON.stringify(i),n],function(){r()}))})}function k(e,t){for(var n=0;t.rows.length>n;n++){var r=t.rows.item(n),o=s(r.hexId,j);R[o]=JSON.parse(r.json)}w()}var S=t.new_edits,x=e.docs,O=0,A=x.map(function(e,t){var n=u.parseDoc(e,S);return n._bulk_seq=t,n}),I=A.filter(function(e){return e.error});if(I.length)return n(I[0]);var D,T=[],R={};f(function(){N.transaction(function(e){D=e;var t="SELECT hex(id) AS hexId, json FROM "+g+" WHERE id IN "+"("+A.map(function(){return"?"}).join(",")+")",n=A.map(function(e){return e.metadata.id});D.executeSql(t,n,k)},o(n))})},O._get=function(e,t,n){function r(){n(s,{doc:o,metadata:i,ctx:a})}t=u.extend(!0,{},t);var o,i,s;if(!t.ctx)return N.transaction(function(r){t.ctx=r,O._get(e,t,n)}),void 0;var a=t.ctx,d="SELECT * FROM "+g+" WHERE id=?";a.executeSql(d,[e],function(e,n){if(!n.rows.length)return s=l.MISSING_DOC,r();if(i=JSON.parse(n.rows.item(0).json),u.isDeleted(i)&&!t.rev)return s=l.error(l.MISSING_DOC,"deleted"),r();var d=c.winningRev(i),f=t.rev?t.rev:d;f=i.id+"::"+f;var h="SELECT * FROM "+m+" WHERE doc_id_rev=?";a.executeSql(h,[f],function(e,t){return t.rows.length?(o=JSON.parse(t.rows.item(0).json),r(),void 0):(s=l.MISSING_DOC,r())})})},O._allDocs=function(e,t){var n,r=[],i={},s=m+" JOIN "+g+" ON "+m+".seq = "+g+".winningseq",a="startkey"in e?e.startkey:!1,l="endkey"in e?e.endkey:!1,d="key"in e?e.key:!1,f="descending"in e?e.descending:!1,h="keys"in e?e.keys:!1,p="limit"in e?e.limit:!1,v="skip"in e?e.skip:!1,y=[],b=[g+".local = 0"];d!==!1?(b.push(g+".id = ?"),y.push(d)):h!==!1?(b.push(g+".id in ("+h.map(function(){return"?"}).join(",")+")"),y=y.concat(h)):(a!==!1||l!==!1)&&(a!==!1&&(b.push(g+".id "+(f?"<=":">=")+" ?"),y.push(a)),l!==!1&&(b.push(g+".id "+(f?">=":"<=")+" ?"),y.push(l)),d!==!1&&(b.push(g+".id = ?"),y.push(d))),h===!1&&b.push(m+".deleted = 0"),N.transaction(function(t){var o="SELECT COUNT("+g+".id) AS 'num' FROM "+s+" WHERE "+m+".deleted = 0 AND "+g+".local = 0";t.executeSql(o,[],function(t,o){if(n=o.rows.item(0).num,0!==p){var a="SELECT "+g+".id, "+m+".seq, "+m+".json AS data, "+g+".json AS metadata FROM "+s;b.length&&(a+=" WHERE "+b.join(" AND ")),a+=" ORDER BY "+g+".id "+(f?"DESC":"ASC"),p!==!1&&(a+=" LIMIT "+p),v!==!1&&v>0&&(p===!1&&(a+=" LIMIT -1"),a+=" OFFSET "+v),t.executeSql(a,y,function(t,n){for(var o=0,s=n.rows.length;s>o;o++){var a=n.rows.item(o),l=JSON.parse(a.metadata),d=JSON.parse(a.data);if(a={id:l.id,key:l.id,value:{rev:c.winningRev(l)}},e.include_docs){a.doc=d,a.doc._rev=c.winningRev(l),e.conflicts&&(a.doc._conflicts=c.collectConflicts(l));for(var f in a.doc._attachments)a.doc._attachments.hasOwnProperty(f)&&(a.doc._attachments[f].stub=!0)}"keys"in e?e.keys.indexOf(l.id)>-1&&(u.isDeleted(l)&&(a.value.deleted=!0,a.doc=null),i[a.id]=a):r.push(a)}})}})},o(t),function(){0!==p&&"keys"in e&&(e.keys.forEach(function(e){e in i?r.push(i[e]):r.push({key:e,error:"not_found"})}),e.descending&&r.reverse()),t(null,{total_rows:n,offset:e.skip,rows:r})})},O._changes=function(e){function t(){var t="SELECT "+g+".id, "+m+".seq, "+m+".json AS data, "+g+".json AS metadata FROM "+m+" JOIN "+g+" ON "+m+".seq = "+g+".winningseq WHERE "+g+".seq > "+e.since+" ORDER BY "+g+".seq "+(r?"DESC":"ASC");N.transaction(function(n){n.executeSql(t,[],function(t,n){for(var r=0,i=0,s=n.rows.length;s>i;i++){var a=n.rows.item(i),c=JSON.parse(a.metadata);if(!u.isLocalId(c.id)){a.seq>r&&(r=a.seq);var l=JSON.parse(a.data),d=e.processChange(l,c,e);d.seq=a.seq,o.push(d)}}u.processChanges(e,o,r)})})}if(e=u.extend(!0,{},e),e.continuous){var n=L+":"+u.uuid();return a.Changes.addListener(L,n,O,e),a.Changes.notify(L),{cancel:function(){a.Changes.removeListener(L,n)}}}var r=e.descending;e.since=e.since&&!r?e.since:0;var o=[];t()},O._close=function(e){e()},O._getAttachment=function(e,t,n){var r,o=t.ctx,i=e.digest,a=e.content_type,c="SELECT hex(body) as body FROM "+y+" WHERE digest=?";o.executeSql(c,[i],function(e,o){var i=s(o.rows.item(0).body,j);t.encode?r=btoa(i):(i=u.fixBinary(i),r=u.createBlob([i],{type:a})),n(null,r)})},O._getRevisionTree=function(e,t){N.transaction(function(n){var r="SELECT json AS metadata FROM "+g+" WHERE id = ?";n.executeSql(r,[e],function(e,n){if(n.rows.length){var r=JSON.parse(n.rows.item(0).metadata);t(null,r.rev_tree)}else t(l.MISSING_DOC)})})},O._doCompaction=function(e,t,n,r){N.transaction(function(o){var i="SELECT json AS metadata FROM "+g+" WHERE id = ?";o.executeSql(i,[e],function(o,i){if(!i.rows.length)return u.call(r);var s=JSON.parse(i.rows.item(0).metadata);s.rev_tree=t;var a="DELETE FROM "+m+" WHERE doc_id_rev IN ("+n.map(function(){return"?"}).join(",")+")",c=n.map(function(t){return e+"::"+t});o.executeSql(a,[c],function(t){var n="UPDATE "+g+" SET json = ? WHERE id = ?";t.executeSql(n,[JSON.stringify(s),e],function(){r()})})})})},void 0):t(l.UNKNOWN_ERROR)}var u=e("../utils"),c=e("../merge"),l=e("../deps/errors"),d={},f=u.getArguments(function(e){if(n!==void 0){if(n.navigator&&n.navigator.sqlitePlugin&&n.navigator.sqlitePlugin.openDatabase)return navigator.sqlitePlugin.openDatabase.apply(navigator.sqlitePlugin,e);if(n.sqlitePlugin&&n.sqlitePlugin.openDatabase)return n.sqlitePlugin.openDatabase.apply(n.sqlitePlugin,e);var t=d[e[0]];return t||(t=d[e[0]]=n.openDatabase.apply(n,e)),t}}),h=1,p=5242880,v=2,g=r("document-store"),m=r("by-sequence"),y=r("attach-store"),b=r("metadata-store"),w="CREATE INDEX IF NOT EXISTS 'by-seq-deleted-idx' ON "+m+" (seq, deleted)",_="CREATE INDEX IF NOT EXISTS 'doc-store-local-idx' ON "+g+" (local, id)",E="CREATE INDEX IF NOT EXISTS 'doc-winningseq-idx' ON "+g+" (winningseq)";a.valid=function(){if(n!==void 0){if(n.navigator&&n.navigator.sqlitePlugin&&n.navigator.sqlitePlugin.openDatabase)return!0;if(n.sqlitePlugin&&n.sqlitePlugin.openDatabase)return!0;if(n.openDatabase)return!0}return!1},a.destroy=u.toPromise(function(e,t,r){var i=f(e,h,e,p);i.transaction(function(e){e.executeSql("DROP TABLE IF EXISTS "+g,[]),e.executeSql("DROP TABLE IF EXISTS "+m,[]),e.executeSql("DROP TABLE IF EXISTS "+y,[]),e.executeSql("DROP TABLE IF EXISTS "+b,[])},o(r),function(){u.hasLocalStorage()&&delete n.localStorage["_pouch__websqldb_"+e],r()})}),a.Changes=new u.Changes,t.exports=a}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../deps/errors":34,"../merge":42,"../utils":46}],31:[function(e,t){(function(n){"use strict";function r(e){e&&n.debug&&console.error(e)}function o(e,t,n){if(!(this instanceof o))return new o(e,t,n);var c=this;("function"==typeof t||t===void 0)&&(n=t,t={}),"object"==typeof e&&(t=e,e=void 0),n===void 0&&(n=r),t=t||{};var l=n;c.auto_compaction=t.auto_compaction,c.prefix=o.prefix,s.call(c),c.taskqueue=new u;var d=new i(function(r,i){n=function(e,t){return e?i(e):(delete t.then,r(t),void 0)},t=a.extend(!0,{},t);var s,u,l=t.name||e;return function(){try{if("string"!=typeof l)throw u=Error("Missing/invalid DB name"),u.code=400,u;if(s=o.parseAdapter(l,t),t.originalName=l,t.name=s.name,t.adapter=t.adapter||s.adapter,!o.adapters[t.adapter])throw u=Error("Adapter is missing"),u.code=404,u;if(!o.adapters[t.adapter].valid())throw u=Error("Invalid Adapter"),u.code=404,u}catch(e){c.taskqueue.fail(e),c.changes=a.toPromise(function(t){t.complete&&t.complete(e)})}}(),u?i(u):(c.adapter=t.adapter,c.replicate=function(e,t,n){return a.cancellableFun(function(r,i,s){var a=o.replicate(e,t,n);s.cancel=a.cancel},c,n)},c.replicate.from=function(e,t,n){return"function"==typeof t&&(n=t,t={}),o.replicate(e,c,t,n)},c.replicate.to=function(e,t,n){return"function"==typeof t&&(n=t,t={}),o.replicate(c,e,t,n)},c.replicate.sync=function(e,t,n){return"function"==typeof t&&(n=t,t={}),a.cancellableFun(function(r,i,s){var a=o.sync(c,e,t,n);s.cancel=a.cancel},c,t)},c.destroy=a.adapterFun("destroy",function(e){var t=this;t.info(function(t,n){return t?e(t):(o.destroy(n.db_name,e),void 0)})}),o.adapters[t.adapter].call(c,t,function(e){function r(e){"destroyed"===e&&(c.emit("destroyed"),o.removeListener(t.name,r))}return e?(n&&(c.taskqueue.fail(e),n(e)),void 0):(o.on(t.name,r),c.emit("created",c),o.emit("created",t.originalName),c.taskqueue.ready(c),n(null,c),void 0)}),t.skipSetup&&c.taskqueue.ready(c),a.isCordova()&&cordova.fireWindowEvent(t.name+"_pouch",{}),void 0)});d.then(function(e){l(null,e)},l),c.then=d.then.bind(d),function(){try{c["catch"]=d["catch"].bind(d)}catch(e){}}()}var i="function"==typeof n.Promise?n.Promise:e("bluebird"),s=e("./adapter"),a=e("./utils"),u=e("./taskqueue");a.inherits(o,s),t.exports=o}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./adapter":26,"./taskqueue":45,"./utils":46,bluebird:134}],32:[function(e,t){(function(n){"use strict";function r(e,t){function r(t,n,r){if(e.binary||e.json||!e.processData||"string"==typeof t){if(!e.binary&&e.json&&"string"==typeof t)try{t=JSON.parse(t)}catch(o){return r(o)}}else t=JSON.stringify(t);Array.isArray(t)&&(t=t.map(function(e){var t;return e.ok?e:e.error&&"conflict"===e.error?(t=a.REV_CONFLICT,t.id=e.id,t):e.error&&"forbidden"===e.error?(t=a.FORBIDDEN,t.id=e.id,t.reason=e.reason,t):e.missing?(t=a.MISSING_DOC,t.missing=e.missing,t):e})),r(null,t,n)}function l(e,t){var n,r,o,i;try{n=JSON.parse(e.responseText);for(i in a)if(a.hasOwnProperty(i)&&a[i].name===n.error){o=a[i];break}o||(o=a.UNKNOWN_ERROR,e.status&&(o.status=e.status),e.statusText&&(e.name=e.statusText)),r=a.error(o,n.reason)}catch(s){for(var i in a)if(a.hasOwnProperty(i)&&a[i].status===e.status){o=a[i];break}o||(o=a.UNKNOWN_ERROR,e.status&&(o.status=e.status),e.statusText&&(e.name=e.statusText)),r=a.error(o)}t(r)}var d=!1,f=c.getArguments(function(e){d||(t.apply(this,e),d=!0)});"function"==typeof e&&(f=e,e={}),e=i(!0,{},e);var h={method:"GET",headers:{},json:!0,processData:!0,timeout:1e4,cache:!1};if(e=i(!0,h,e),"GET"===e.method&&!e.cache){var p=-1!==e.url.indexOf("?");e.url+=(p?"&":"?")+"_nonce="+u(16)}if(n.browser){var v,g;g=e.xhr?new e.xhr:new XMLHttpRequest,g.open(e.method,e.url),g.withCredentials=!0,e.json&&(e.headers.Accept="application/json",e.headers["Content-Type"]=e.headers["Content-Type"]||"application/json",e.body&&e.processData&&"string"!=typeof e.body&&(e.body=JSON.stringify(e.body))),e.binary&&(g.responseType="arraybuffer");var m=function(e,t,n){var r="";if(n){var o=new Date;o.setTime(o.getTime()+1e3*60*60*24*n),r="; expires="+o.toGMTString()}document.cookie=e+"="+t+r+"; path=/"};for(var y in e.headers)if("Cookie"===y){var b=e.headers[y].split("=");m(b[0],b[1],10)}else g.setRequestHeader(y,e.headers[y]);"body"in e||(e.body=null);var w=function(){d||(g.abort(),l(g,f))};return g.onreadystatechange=function(){if(4===g.readyState&&!d)if(clearTimeout(v),g.status>=200&&300>g.status){var t;t=e.binary?s([g.response||""],{type:g.getResponseHeader("Content-Type")}):g.responseText,r(t,g,f)}else l(g,f)},e.timeout>0&&(v=setTimeout(w,e.timeout),g.onprogress=function(){clearTimeout(v),v=setTimeout(w,e.timeout)},g.upload&&(g.upload.onprogress=g.onprogress)),g.send(e.body),{abort:w}}return e.json&&(e.binary||(e.headers.Accept="application/json"),e.headers["Content-Type"]=e.headers["Content-Type"]||"application/json"),e.binary&&(e.encoding=null,e.json=!1),e.processData||(e.json=!1),o(e,function(t,n,o){if(t)return t.status=n?n.statusCode:400,l(t,f);var i,s=n.headers["content-type"],u=o||"";e.binary||!e.json&&e.processData||"object"==typeof u||!(/json/.test(s)||/^[\s]*\{/.test(u)&&/\}[\s]*$/.test(u))||(u=JSON.parse(u)),n.statusCode>=200&&300>n.statusCode?r(u,n,f):(e.binary&&(u=JSON.parse(""+u)),i="missing"===u.reason?a.MISSING_DOC:"no_db_file"===u.reason?a.error(a.DB_MISSING,u.reason):"conflict"===u.error?a.REV_CONFLICT:a.error(a.UNKNOWN_ERROR,u.reason,u.error),i.status=n.statusCode,f(i))})}var o=e("request"),i=e("./extend.js"),s=e("./blob.js"),a=e("./errors"),u=e("../deps/uuid"),c=e("../utils");t.exports=r}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"../deps/uuid":39,"../utils":46,"./blob.js":33,"./errors":34,"./extend.js":36,"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11,request:2}],33:[function(e,t){(function(e){"use strict";function n(t,n){t=t||[],n=n||{};try{return new Blob(t,n)}catch(r){if("TypeError"!==r.name)throw r;for(var o=e.BlobBuilder||e.MSBlobBuilder||e.MozBlobBuilder||e.WebKitBlobBuilder,i=new o,s=0;t.length>s;s+=1)i.append(t[s]);return i.getBlob(n.type)}}t.exports=n}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],34:[function(e,t,n){"use strict";function r(e){this.status=e.status,this.name=e.error,this.message=e.reason,this.error=!0}r.prototype__proto__=Error.prototype,r.prototype.toString=function(){return JSON.stringify({status:this.status,name:this.name,message:this.message})},n.UNAUTHORIZED=new r({status:401,error:"unauthorized",reason:"Name or password is incorrect."}),n.MISSING_BULK_DOCS=new r({status:400,error:"bad_request",reason:"Missing JSON list of 'docs'"}),n.MISSING_DOC=new r({status:404,error:"not_found",reason:"missing"}),n.REV_CONFLICT=new r({status:409,error:"conflict",reason:"Document update conflict"}),n.INVALID_ID=new r({status:400,error:"invalid_id",reason:"_id field must contain a string"}),n.MISSING_ID=new r({status:412,error:"missing_id",reason:"_id is required for puts"}),n.RESERVED_ID=new r({status:400,error:"bad_request",reason:"Only reserved document ids may start with underscore."}),n.NOT_OPEN=new r({status:412,error:"precondition_failed",reason:"Database not open so cannot close"}),n.UNKNOWN_ERROR=new r({status:500,error:"unknown_error",reason:"Database encountered an unknown error"}),n.BAD_ARG=new r({status:500,error:"badarg",reason:"Some query argument is invalid"}),n.INVALID_REQUEST=new r({status:400,error:"invalid_request",reason:"Request was invalid"}),n.QUERY_PARSE_ERROR=new r({status:400,error:"query_parse_error",reason:"Some query parameter is invalid"}),n.DOC_VALIDATION=new r({status:500,error:"doc_validation",reason:"Bad special document member"}),n.BAD_REQUEST=new r({status:400,error:"bad_request",reason:"Something wrong with the request"}),n.NOT_AN_OBJECT=new r({status:400,error:"bad_request",reason:"Document must be a JSON object"}),n.DB_MISSING=new r({status:404,error:"not_found",reason:"Database not found"}),n.IDB_ERROR=new r({status:500,error:"indexed_db_went_bad",reason:"unknown"}),n.WSQ_ERROR=new r({status:500,error:"web_sql_went_bad",reason:"unknown"}),n.LDB_ERROR=new r({status:500,error:"levelDB_went_went_bad",reason:"unknown"}),n.FORBIDDEN=new r({status:403,error:"forbidden",reason:"Forbidden by design doc validate_doc_update function"}),n.error=function(e,t,n){function r(){this.message=t,n&&(this.name=n)}return r.prototype=e,new r(t)}},{}],35:[function(){"use strict";Object.keys||(Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}),Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),"forEach"in Array.prototype||(Array.prototype.forEach=function(e,t){for(var n=0,r=this.length;r>n;n++)n in this&&e.call(t,this[n],n,this)}),"map"in Array.prototype||(Array.prototype.map=function(e,t){for(var n=Array(this.length),r=0,o=this.length;o>r;r++)r in this&&(n[r]=e.call(t,this[r],r,this));return n})},{}],36:[function(e,t){"use strict";function n(e){return null===e?e+"":"object"==typeof e||"function"==typeof e?a[d.call(e)]||"object":typeof e}function r(e){return null!==e&&e===e.window}function o(e){if(!e||"object"!==n(e)||e.nodeType||r(e))return!1;try{if(e.constructor&&!f.call(e,"constructor")&&!f.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}var o;for(o in e);return void 0===o||f.call(e,o)}function i(e){return"function"===n(e)}function s(){var e,t,n,r,a,u,c=arguments[0]||{},l=1,d=arguments.length,f=!1;for("boolean"==typeof c&&(f=c,c=arguments[1]||{},l=2),"object"==typeof c||i(c)||(c={}),d===l&&(c=this,--l);d>l;l++)if(null!=(e=arguments[l]))for(t in e)if(!(t in Object.prototype)){if(n=c[t],r=e[t],c===r)continue;f&&r&&(o(r)||(a=h(r)))?(a?(a=!1,u=n&&h(n)?n:[]):u=n&&o(n)?n:{},c[t]=s(f,u,r)):void 0!==r&&(h(e)&&i(r)||(c[t]=r))}return c}for(var a={},u=["Boolean","Number","String","Function","Array","Date","RegExp","Object","Error"],c=0;u.length>c;c++){var l=u[c];a["[object "+l+"]"]=l.toLowerCase()}var d=a.toString,f=a.hasOwnProperty,h=Array.isArray||function(e){return"array"===n(e)};t.exports=s},{}],37:[function(e,t,n){(function(t){"use strict";var r=e("crypto");n.MD5=function(e){function n(e,t){return e<<t|e>>>32-t}function o(e,t){var n,r,o,i,s;return o=2147483648&e,i=2147483648&t,n=1073741824&e,r=1073741824&t,s=(1073741823&e)+(1073741823&t),n&r?2147483648^s^o^i:n|r?1073741824&s?3221225472^s^o^i:1073741824^s^o^i:s^o^i}function i(e,t,n){return e&t|~e&n}function s(e,t,n){return e&n|t&~n}function a(e,t,n){return e^t^n}function u(e,t,n){return t^(e|~n)}function c(e,t,r,s,a,u,c){return e=o(e,o(o(i(t,r,s),a),c)),o(n(e,u),t)}function l(e,t,r,i,a,u,c){return e=o(e,o(o(s(t,r,i),a),c)),o(n(e,u),t)}function d(e,t,r,i,s,u,c){return e=o(e,o(o(a(t,r,i),s),c)),o(n(e,u),t)}function f(e,t,r,i,s,a,c){return e=o(e,o(o(u(t,r,i),s),c)),o(n(e,a),t)}function h(e){for(var t,n=e.length,r=n+8,o=(r-r%64)/64,i=16*(o+1),s=Array(i-1),a=0,u=0;n>u;)t=(u-u%4)/4,a=8*(u%4),s[t]=s[t]|e.charCodeAt(u)<<a,u++;return t=(u-u%4)/4,a=8*(u%4),s[t]=s[t]|128<<a,s[i-2]=n<<3,s[i-1]=n>>>29,s}function p(e){var t,n,r="",o="";for(n=0;3>=n;n++)t=255&e>>>8*n,o="0"+t.toString(16),r+=o.substr(o.length-2,2);return r}if(!t.browser)return r.createHash("md5").update(e).digest("hex");var v,g,m,y,b,w,_,E,k,S=[],x=7,j=12,O=17,A=22,L=5,I=9,N=14,D=20,T=4,R=11,B=16,C=23,q=6,M=10,U=15,P=21;for(S=h(e),w=1732584193,_=4023233417,E=2562383102,k=271733878,v=0;S.length>v;v+=16)g=w,m=_,y=E,b=k,w=c(w,_,E,k,S[v+0],x,3614090360),k=c(k,w,_,E,S[v+1],j,3905402710),E=c(E,k,w,_,S[v+2],O,606105819),_=c(_,E,k,w,S[v+3],A,3250441966),w=c(w,_,E,k,S[v+4],x,4118548399),k=c(k,w,_,E,S[v+5],j,1200080426),E=c(E,k,w,_,S[v+6],O,2821735955),_=c(_,E,k,w,S[v+7],A,4249261313),w=c(w,_,E,k,S[v+8],x,1770035416),k=c(k,w,_,E,S[v+9],j,2336552879),E=c(E,k,w,_,S[v+10],O,4294925233),_=c(_,E,k,w,S[v+11],A,2304563134),w=c(w,_,E,k,S[v+12],x,1804603682),k=c(k,w,_,E,S[v+13],j,4254626195),E=c(E,k,w,_,S[v+14],O,2792965006),_=c(_,E,k,w,S[v+15],A,1236535329),w=l(w,_,E,k,S[v+1],L,4129170786),k=l(k,w,_,E,S[v+6],I,3225465664),E=l(E,k,w,_,S[v+11],N,643717713),_=l(_,E,k,w,S[v+0],D,3921069994),w=l(w,_,E,k,S[v+5],L,3593408605),k=l(k,w,_,E,S[v+10],I,38016083),E=l(E,k,w,_,S[v+15],N,3634488961),_=l(_,E,k,w,S[v+4],D,3889429448),w=l(w,_,E,k,S[v+9],L,568446438),k=l(k,w,_,E,S[v+14],I,3275163606),E=l(E,k,w,_,S[v+3],N,4107603335),_=l(_,E,k,w,S[v+8],D,1163531501),w=l(w,_,E,k,S[v+13],L,2850285829),k=l(k,w,_,E,S[v+2],I,4243563512),E=l(E,k,w,_,S[v+7],N,1735328473),_=l(_,E,k,w,S[v+12],D,2368359562),w=d(w,_,E,k,S[v+5],T,4294588738),k=d(k,w,_,E,S[v+8],R,2272392833),E=d(E,k,w,_,S[v+11],B,1839030562),_=d(_,E,k,w,S[v+14],C,4259657740),w=d(w,_,E,k,S[v+1],T,2763975236),k=d(k,w,_,E,S[v+4],R,1272893353),E=d(E,k,w,_,S[v+7],B,4139469664),_=d(_,E,k,w,S[v+10],C,3200236656),w=d(w,_,E,k,S[v+13],T,681279174),k=d(k,w,_,E,S[v+0],R,3936430074),E=d(E,k,w,_,S[v+3],B,3572445317),_=d(_,E,k,w,S[v+6],C,76029189),w=d(w,_,E,k,S[v+9],T,3654602809),k=d(k,w,_,E,S[v+12],R,3873151461),E=d(E,k,w,_,S[v+15],B,530742520),_=d(_,E,k,w,S[v+2],C,3299628645),w=f(w,_,E,k,S[v+0],q,4096336452),k=f(k,w,_,E,S[v+7],M,1126891415),E=f(E,k,w,_,S[v+14],U,2878612391),_=f(_,E,k,w,S[v+5],P,4237533241),w=f(w,_,E,k,S[v+12],q,1700485571),k=f(k,w,_,E,S[v+3],M,2399980690),E=f(E,k,w,_,S[v+10],U,4293915773),_=f(_,E,k,w,S[v+1],P,2240044497),w=f(w,_,E,k,S[v+8],q,1873313359),k=f(k,w,_,E,S[v+15],M,4264355552),E=f(E,k,w,_,S[v+6],U,2734768916),_=f(_,E,k,w,S[v+13],P,1309151649),w=f(w,_,E,k,S[v+4],q,4149444226),k=f(k,w,_,E,S[v+11],M,3174756917),E=f(E,k,w,_,S[v+2],U,718787259),_=f(_,E,k,w,S[v+9],P,3951481745),w=o(w,g),_=o(_,m),E=o(E,y),k=o(k,b);
var F=p(w)+p(_)+p(E)+p(k);return F.toLowerCase()}}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11,crypto:4}],38:[function(e,t){"use strict";var n=e("fs"),r=e("path"),o=e("levelup"),i=e("leveldown"),s=["document-store","by-sequence","attach-store","attach-binary-store"];t.exports=function(e,t,a){function u(e,n,i){var s,a=r.join(c,e);s=3===n?{valueEncoding:"binary"}:{valueEncoding:"json"};var u=t.sublevel(e,s),l=o(a,s),d=l.createReadStream(),f=u.createWriteStream();d.on("end",function(){l.close(function(e){i(e,a)})}),d.pipe(f)}var c=r.resolve(e);n.unlink(c+".uuid",function(e){if(e)return a();var t=4,r=[];s.forEach(function(e,o){u(e,o,function(e,o){return e?a(e):(r.push(o),--t||r.forEach(function(e){i.destroy(e,function(){++t===r.length&&n.rmdir(c,a)})}),void 0)})})})}},{fs:1,leveldown:49,levelup:77,path:15}],39:[function(e,t){"use strict";function n(e,t){var r,o=n.CHARS,i=[];if(t=t||o.length,e)for(r=0;e>r;r++)i[r]=o[0|Math.random()*t];else{var s;for(i[8]=i[13]=i[18]=i[23]="-",i[14]="4",r=0;36>r;r++)i[r]||(s=0|16*Math.random(),i[r]=o[19===r?8|3&s:s])}return i.join("")}n.CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),t.exports=n},{}],pouchdb:[function(e,t){t.exports=e("H76+0V")},{}],"H76+0V":[function(e,t){(function(n){"use strict";e("./deps/es5_shims");var r=e("./setup");t.exports=r,r.ajax=e("./deps/ajax"),r.extend=e("./deps/extend"),r.utils=e("./utils"),r.Errors=e("./deps/errors");var o=e("./replicate");r.replicate=o.replicate,r.sync=o.sync,r.version=e("./version");var i=e("./adapters/http");if(r.adapter("http",i),r.adapter("https",i),r.adapter("idb",e("./adapters/idb")),r.adapter("websql",e("./adapters/websql")),r.plugin(e("pouchdb-mapreduce")),!n.browser){var s=e("./adapters/leveldb");r.adapter("ldb",s),r.adapter("leveldb",s)}}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"./adapters/http":27,"./adapters/idb":28,"./adapters/leveldb":29,"./adapters/websql":30,"./deps/ajax":32,"./deps/errors":34,"./deps/es5_shims":35,"./deps/extend":36,"./replicate":43,"./setup":44,"./utils":46,"./version":47,"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11,"pouchdb-mapreduce":149}],42:[function(e,t){"use strict";function n(e){for(var t,n=e.shift(),r=[n.id,n.opts,[]],o=r;e.length;)n=e.shift(),t=[n.id,n.opts,[]],o[2].push(t),o=t;return r}function r(e,t){for(var n=[{tree1:e,tree2:t}],r=!1;n.length>0;){var o=n.pop(),i=o.tree1,s=o.tree2;(i[1].status||s[1].status)&&(i[1].status="available"===i[1].status||"available"===s[1].status?"available":"missing");for(var a=0;s[2].length>a;a++)if(i[2][0]){for(var u=!1,c=0;i[2].length>c;c++)i[2][c][0]===s[2][a][0]&&(n.push({tree1:i[2][c],tree2:s[2][a]}),u=!0);u||(r="new_branch",i[2].push(s[2][a]),i[2].sort())}else r="new_leaf",i[2][0]=s[2][a]}return{conflicts:r,tree:e}}function o(e,t,n){var o,i=[],s=!1,a=!1;return e.length?(e.forEach(function(e){if(e.pos===t.pos&&e.ids[0]===t.ids[0])o=r(e.ids,t.ids),i.push({pos:e.pos,ids:o.tree}),s=s||o.conflicts,a=!0;else if(n!==!0){var u=e.pos<t.pos?e:t,c=e.pos<t.pos?t:e,l=c.pos-u.pos,d=[],f=[];for(f.push({ids:u.ids,diff:l,parent:null,parentIdx:null});f.length>0;){var h=f.pop();0!==h.diff?h.ids&&h.ids[2].forEach(function(e,t){f.push({ids:e,diff:h.diff-1,parent:h.ids,parentIdx:t})}):h.ids[0]===c.ids[0]&&d.push(h)}var p=d[0];p?(o=r(p.ids,c.ids),p.parent[2][p.parentIdx]=o.tree,i.push({pos:u.pos,ids:u.ids}),s=s||o.conflicts,a=!0):i.push(e)}else i.push(e)}),a||i.push(t),i.sort(function(e,t){return e.pos-t.pos}),{tree:i,conflicts:s||"internal_node"}):{tree:[t],conflicts:"new_leaf"}}function i(e,t){var r=a.rootToLeaf(e).map(function(e){var r=e.ids.slice(-t);return{pos:e.pos+(e.ids.length-r.length),ids:n(r)}});return r.reduce(function(e,t){return o(e,t,!0).tree},[r.shift()])}var s=e("./deps/extend"),a={};a.merge=function(e,t,n){e=s(!0,[],e),t=s(!0,{},t);var r=o(e,t);return{tree:i(r.tree,n),conflicts:r.conflicts}},a.winningRev=function(e){var t=[];return a.traverseRevTree(e.rev_tree,function(e,n,r,o,i){e&&t.push({pos:n,id:r,deleted:!!i.deleted})}),t.sort(function(e,t){return e.deleted!==t.deleted?e.deleted>t.deleted?1:-1:e.pos!==t.pos?t.pos-e.pos:e.id<t.id?1:-1}),t[0].pos+"-"+t[0].id},a.traverseRevTree=function(e,t){var n=[];for(e.forEach(function(e){n.push({pos:e.pos,ids:e.ids})});n.length>0;){var r=n.pop(),o=r.pos,i=r.ids,s=t(0===i[2].length,o,i[0],r.ctx,i[1]);i[2].forEach(function(e){n.push({pos:o+1,ids:e,ctx:s})})}},a.collectLeaves=function(e){var t=[];return a.traverseRevTree(e,function(e,n,r,o,i){e&&t.unshift({rev:n+"-"+r,pos:n,opts:i})}),t.sort(function(e,t){return t.pos-e.pos}),t.map(function(e){delete e.pos}),t},a.collectConflicts=function(e){var t=a.winningRev(e),n=a.collectLeaves(e.rev_tree),r=[];return n.forEach(function(e){e.rev===t||e.opts.deleted||r.push(e.rev)}),r},a.rootToLeaf=function(e){var t=[];return a.traverseRevTree(e,function(e,n,r,o,i){if(o=o?o.slice(0):[],o.push({id:r,opts:i}),e){var s=n+1-o.length;t.unshift({pos:s,ids:o})}return o}),t},t.exports=a},{"./deps/extend":36}],43:[function(e,t,n){"use strict";function r(){var e=this;this.cancelled=!1,this.cancel=function(){e.cancelled=!0}}function o(){this.seq=0,this.changes=[],this.docs=[]}function i(e,t,n,r){var o=n.filter?""+n.filter:"";e.id(function(e,i){t.id(function(e,t){var s=i+t+o+JSON.stringify(n.query_params)+n.doc_ids;r("_local/"+h.Crypto.MD5(s))})})}function s(e,t,n,r){t.get(n,function(t,o){t&&404===t.status?r(null,0):t?r(t):e.get(n,function(e,t){e&&404===e.status||!e&&o.last_seq!==t.last_seq?r(null,0):e?r(e):r(null,t.last_seq)})})}function a(e,t,n,r,o){function i(e,t){e.get(n,function(o,i){if(o&&404===o.status)i={_id:n};else if(o)return t(o);i.last_seq=r,e.put(i,t)})}i(t,function(t){return t?o(t):(i(e,function(e){return e?o(e):(o(),void 0)}),void 0)})}function u(e,t,n,r,i){function u(){if(0===S.docs.length)return v();var e=S.docs;n.bulkDocs({docs:e},{new_edits:!1},function(t,n){if(t)return B.doc_write_failures+=e.length,p("target.bulkDocs completed with error",t);var r=[];return n.forEach(function(e){e.ok||(B.doc_write_failures++,r.push({status:500,error:e.error||"Unknown document write error",reason:e.reason||"Unknown reason"}))}),r.length>0?p("target.bulkDocs failed to write docs",r):(B.docs_written+=e.length,v(),void 0)})}function l(e,t){return i.cancelled?w():e?p("src.get completed with error",e):(Object.keys(t).forEach(function(e){var n=t[e].ok;n&&(B.docs_read++,S.pendingRevs++,S.docs.push(n))}),f(),void 0)}function d(e,n){t.allDocs({keys:e,include_docs:!0},function(e,t){return i.cancelled?w():e?p("src.get completed with error",e):(t.rows.forEach(function(e,t){var r=!e.doc||"1-"!==e.value.rev.slice(0,2)||e.doc._attachments&&Object.keys(e.doc._attachments).length;return r?O.push({id:"not_found"===e.error?e.key:e.id,rev:n[t]}):(B.docs_read++,S.pendingRevs++,S.docs.push(e.doc),void 0)}),f(),void 0)})}function f(){if(O.length){var e=O.shift();return c(t,l,e.id,[e.rev])}var n=S.diffs;if(0===Object.keys(n).length)return u(),void 0;var r=Object.keys(n).reduce(function(e,t){return 1===n[t].missing.length&&"1-"===n[t].missing[0].slice(0,2)&&(e.ids.push(t),e.revs.push(n[t].missing[0]),delete n[t]),e},{ids:[],revs:[]});if(r.ids.length)return d(r.ids,r.revs);var o=Object.keys(n)[0],i=n[o].missing;delete n[o],c(t,l,o,i)}function p(e,t){if(!I){B.ok=!1,B.status="aborted",B.errors.push(t),B.end_time=new Date,B.last_seq=N,x=[],j=new o;var n={status:500,error:"Replication aborted",reason:e,details:t};I=!0,h.call(r.complete,n,B),i.cancel()}}function v(){A=!0,a(t,n,e,S.seq,function(e){return A=!1,i.cancelled?w():e?p("writeCheckpoint completed with error",e):(B.last_seq=N=S.seq,h.call(r.onChange,null,B),S=void 0,y(),void 0)})}function g(e,t){return i.cancelled?w():e?p("target.revsDiff completed with error",e):0===Object.keys(t).length?(v(),void 0):(S.diffs=t,S.pendingRevs=0,f(),void 0)}function m(){var e={};S.changes.forEach(function(t){e[t.id]=t.changes.map(function(e){return e.rev})}),n.revsDiff(e,g)}function y(){if(i.cancelled)return w();if(!S){if(0===x.length)return b(),void 0;S=x.shift(),m()}}function b(){return 0===j.changes.length?(L&&0===x.length&&!S&&w(),void 0):((L||j.changes.length>=T)&&(x.push(j),j=new o,y()),void 0)}function w(){return I||i.cancelled&&(B.status="cancelled",A)?void 0:(B.status=B.status||"complete",B.end_time=new Date,B.last_seq=N,I=!0,B.errors.length>0?h.call(r.complete,B.errors[0],B):h.call(r.complete,null,B))}function _(e){return i.cancelled?w():(I||(j.seq=e.seq,j.changes.push(e),b()),void 0)}function E(e){return L=!0,i.cancelled?w():(e&&(B.status="src.changes completed with error",B.errors.push(e)),b(),void 0)}function k(){s(t,n,e,function(e,n){if(e)return p("fetchCheckpoint completed with error",e);if(N=n,i.cancelled)return w();var o={continuous:D,since:N,style:"all_docs",onChange:_,complete:E,doc_ids:R};r.filter&&(o.filter=r.filter),r.query_params&&(o.query_params=r.query_params);var s=t.changes(o),a=i.cancel;i.cancel=function(){a(),w(),s&&s.cancel instanceof Function&&s.cancel()}})}var S,x=[],j=new o,O=[],A=!1,L=!1,I=!1,N=0,D=r.continuous||r.live||!1,T=r.batch_size||1,R=r.doc_ids,B={ok:!0,start_time:new Date,docs_read:0,docs_written:0,doc_write_failures:0,errors:[]};r.since===void 0?k():a(t,n,e,r.since,function(e){return e?p("writeCheckpoint completed with error",e):(N=r.since,k(),void 0)})}function c(e,t,n,r){e.get(n,{revs:!0,open_revs:r,attachments:!0},t)}function l(e,t){return"string"==typeof e?new p(e,t):(t(null,e),void 0)}function d(e,t,n,o){n instanceof Function&&(o=n,n={}),void 0===n&&(n={}),n.complete||(n.complete=o),n=h.extend(!0,{},n),n.continuous=n.continuous||n.live;var s=new r;return l(e,function(e,r){return e?o(e):(l(t,function(e,t){if(e)return o(e);if(n.server){if("function"!=typeof r.replicateOnServer)return o({error:"Server replication not supported for "+r.type()+"adapter"});if(r.type()!==t.type())return o({error:"Server replication for different adapter types ("+r.type()+" and "+t.type()+") is not supported"});r.replicateOnServer(t,n,s)}else i(r,t,n,function(e){u(e,r,t,n,s)})}),void 0)}),s}function f(e,t,n,r){function o(e,t){return function(n,r){n&&c(),r.direction=t,e(n,r)}}function i(e,t){return t=t||function(){},function(n){return{source:e,change:t(n)}}}function s(e,t,n){return t=h.extend(!0,{},t),t.complete=o(t.complete,n),t.onChange=i(e,t.onChange),t.continuous=t.continuous||t.live,t}function a(){return l=d(e,t,s(e,n,"push"),r)}function u(){return f=d(t,e,s(t,n,"pull"),r)}function c(){l&&l.cancel(),f&&f.cancel()}var l,f;return n instanceof Function&&(r=n,n={}),void 0===n&&(n={}),r instanceof Function&&!n.complete&&(n.complete=r),{push:a(),pull:u(),cancel:c}}var h=e("./utils"),p=e("./index");n.replicate=d,n.sync=f},{"./index":"H76+0V","./utils":46}],44:[function(e,t){(function(n){"use strict";var r=e("./constructor"),o=e("./utils"),i=e("events").EventEmitter;r.adapters={},r.prefix="_pouch_";var s=new i,a=["on","addListener","emit","listeners","once","removeAllListeners","removeListener","setMaxListeners"],u=["levelalt","idb","leveldb","websql"];a.forEach(function(e){r[e]=s[e].bind(s)}),r.setMaxListeners(0),r.parseAdapter=function(e,t){var i,s,a=e.match(/([a-z\-]*):\/\/(.*)/);if(a){if(e=/http(s?)/.test(a[1])?a[1]+"://"+a[2]:a[2],i=a[1],!r.adapters[i].valid())throw"Invalid adapter";return{name:e,adapter:a[1]}}var c="idb"in r.adapters&&"websql"in r.adapters&&o.hasLocalStorage()&&n.localStorage["_pouch__websqldb_"+r.prefix+e];if(t!==void 0&&t.db)s="leveldb";else for(var l=0;u.length>l;++l)if(s=u[l],s in r.adapters){if(c&&"idb"===s)continue;break}if(s){i=r.adapters[s];var d="use_prefix"in i?i.use_prefix:!0;return{name:d?r.prefix+e:e,adapter:s}}throw"No valid adapter found"},r.destroy=o.toPromise(function(e,t,n){("function"==typeof t||t===void 0)&&(n=t,t={}),"object"==typeof e&&(t=e,e=void 0);var o=r.parseAdapter(t.name||e,t),i=o.name;r.adapters[o.adapter].destroy(i,t,function(e,t){e?n(e):(r.emit("destroyed",i),r.emit(i,"destroyed"),n(null,t))})}),r.allDbs=o.toPromise(function(e){var t=Error("allDbs method removed");t.stats="400",e(t)}),r.adapter=function(e,t){t.valid()&&(r.adapters[e]=t)},r.plugin=function(e){Object.keys(e).forEach(function(t){r.prototype[t]=e[t]})},t.exports=r}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./constructor":31,"./utils":46,events:9}],45:[function(e,t){"use strict";function n(){this.isReady=!1,this.failed=!1,this.queue=[]}t.exports=n,n.prototype.execute=function(){var e,t;if(this.failed)for(;e=this.queue.shift();)t=e.parameters[e.parameters.length-1],"function"==typeof t?t(this.failed):"changes"===e.name&&"function"==typeof t.complete&&t.complete(this.failed);else if(this.isReady)for(;e=this.queue.shift();)"function"==typeof e?e():e.task=this.db[e.name].apply(this.db,e.parameters)},n.prototype.fail=function(e){this.failed=e,this.execute()},n.prototype.ready=function(e){return this.failed?!1:0===arguments.length?this.isReady:(this.isReady=e?!0:!1,this.db=e,this.execute(),void 0)},n.prototype.addTask=function(e,t){if("function"!=typeof e){var n={name:e,parameters:t};return this.queue.push(n),this.failed&&this.execute(),n}this.queue.push(e)}},{}],46:[function(e,t,n){(function(t,r){function o(){return"undefined"!=typeof chrome&&chrome.storage!==void 0&&chrome.storage.local!==void 0}var i=e("./merge");n.extend=e("./deps/extend"),n.ajax=e("./deps/ajax"),n.createBlob=e("./deps/blob");var s=e("./deps/uuid");n.Crypto=e("./deps/md5.js");var a=e("./deps/buffer"),u=e("./deps/errors"),c=e("events").EventEmitter,l="function"==typeof r.Promise?r.Promise:e("bluebird"),d=["_id","_rev","_attachments","_deleted","_revisions","_revs_info","_conflicts","_deleted_conflicts","_local_seq","_rev_tree"];n.inherits=e("inherits"),n.uuids=function(e,t){"object"!=typeof t&&(t={});for(var n=t.length,r=t.radix,o=[];e>o.push(s(n,r)););return o},n.uuid=function(e){return n.uuids(1,e)[0]},n.invalidIdError=function(e){return e?"string"!=typeof e?u.INVALID_ID:/^_/.test(e)&&!/^_(design|local)/.test(e)?u.RESERVED_ID:void 0:u.MISSING_ID},n.getArguments=function(e){return function(){for(var t=arguments.length,n=Array(t),r=-1;t>++r;)n[r]=arguments[r];return e.call(this,n)}},n.call=n.getArguments(function(e){if(e.length){var t=e.shift();"function"==typeof t&&t.apply(this,e)}}),n.isLocalId=function(e){return/^_local/.test(e)},n.isDeleted=function(e,t){t||(t=i.winningRev(e)),t.indexOf("-")>=0&&(t=t.split("-")[1]);var n=!1;return i.traverseRevTree(e.rev_tree,function(e,r,o,i,s){o===t&&(n=!!s.deleted)}),n},n.filterChange=function(e){return function(t){var n={},r=e.filter&&"function"==typeof e.filter;if(n.query=e.query_params,e.filter&&r&&!e.filter.call(this,t.doc,n))return!1;if(e.doc_ids&&-1===e.doc_ids.indexOf(t.id))return!1;if(e.include_docs)for(var o in t.doc._attachments)t.doc._attachments.hasOwnProperty(o)&&(t.doc._attachments[o].stub=!0);else delete t.doc;return!0}},n.processChanges=function(e,t,r){t=t.filter(n.filterChange(e)),e.limit&&e.limit<t.length&&(t.length=e.limit),t.forEach(function(t){n.call(e.onChange,t)}),e.continuous||n.call(e.complete,null,{results:t,last_seq:r})},n.parseDoc=function(e,t){var r,o,i,s=null,a={status:"available"};if(e._deleted&&(a.deleted=!0),t)if(e._id||(e._id=n.uuid()),o=n.uuid({length:32,radix:16}).toLowerCase(),e._rev){if(i=/^(\d+)-(.+)$/.exec(e._rev),!i)throw"invalid value for property '_rev'";e._rev_tree=[{pos:parseInt(i[1],10),ids:[i[2],{status:"missing"},[[o,a,[]]]]}],r=parseInt(i[1],10)+1}else e._rev_tree=[{pos:1,ids:[o,a,[]]}],r=1;else if(e._revisions&&(e._rev_tree=[{pos:e._revisions.start-e._revisions.ids.length+1,ids:e._revisions.ids.reduce(function(e,t){return null===e?[t,a,[]]:[t,{status:"missing"},[e]]},null)}],r=e._revisions.start,o=e._revisions.ids[0]),!e._rev_tree){if(i=/^(\d+)-(.+)$/.exec(e._rev),!i)return u.BAD_ARG;r=parseInt(i[1],10),o=i[2],e._rev_tree=[{pos:parseInt(i[1],10),ids:[i[2],a,[]]}]}s=n.invalidIdError(e._id);for(var c in e)e.hasOwnProperty(c)&&"_"===c[0]&&-1===d.indexOf(c)&&(s=n.extend({},u.DOC_VALIDATION),s.reason+=": "+c);return e._id=decodeURIComponent(e._id),e._rev=[r,o].join("-"),s?s:Object.keys(e).reduce(function(t,n){return/^_/.test(n)&&"_attachments"!==n?t.metadata[n.slice(1)]=e[n]:t.data[n]=e[n],t},{metadata:{},data:{}})},n.isCordova=function(){return"undefined"!=typeof cordova||"undefined"!=typeof PhoneGap||"undefined"!=typeof phonegap},n.hasLocalStorage=function(){if(o())return!1;try{return r.localStorage}catch(e){return!1}},n.Changes=function(){var e={},t=new c,i=o(),s={},a=!1;return i||(a=n.hasLocalStorage()),i?chrome.storage.onChanged.addListener(function(e){null!=e.db_name&&t.emit(e.dbName.newValue)}):a&&(r.addEventListener?r.addEventListener("storage",function(e){t.emit(e.key)}):r.attachEvent("storage",function(e){t.emit(e.key)})),e.addListener=function(e,r,o,i){function a(){o.changes({include_docs:i.include_docs,conflicts:i.conflicts,continuous:!1,descending:!1,filter:i.filter,view:i.view,since:i.since,query_params:i.query_params,onChange:function(e){e.seq>i.since&&!i.cancelled&&(i.since=e.seq,n.call(i.onChange,e))}})}s[r]||(s[r]=a,t.on(e,a))},e.removeListener=function(e,n){n in s&&t.removeListener(e,s[n])},e.clearListeners=function(e){t.removeAllListeners(e)},e.notifyLocalWindows=function(e){i?chrome.storage.local.set({dbName:e}):a&&(localStorage[e]="a"===localStorage[e]?"b":"a")},e.notify=function(e){t.emit(e)},e},n.atob=t.browser&&"atob"in r?function(e){return atob(e)}:function(e){var t=new a(e,"base64");if(t.toString("base64")!==e)throw"Cannot base64 encode full string";return t.toString("binary")},n.btoa=t.browser&&"btoa"in r?function(e){return btoa(e)}:function(e){return new a(e,"binary").toString("base64")},n.fixBinary=function(e){if(!t.browser)return e;for(var n=e.length,r=new ArrayBuffer(n),o=new Uint8Array(r),i=0;n>i;i++)o[i]=e.charCodeAt(i);return r},n.once=function(e){var t=!1;return n.getArguments(function(n){if(t)throw console.trace(),Error("once called more than once");t=!0,e.apply(this,n)})},n.toPromise=function(e){return n.getArguments(function(r){var o,i=this,s="function"==typeof r[r.length-1]?r.pop():!1;s&&(o=function(e,n){t.nextTick(function(){s(e,n)})});var a=new l(function(t,o){try{var s=n.once(function(e,n){e?o(e):t(n)});r.push(s),e.apply(i,r)}catch(a){o(a)}});return o&&a.then(function(e){o(null,e)},o),a.cancel=function(){return this},a})},n.adapterFun=function(e,t){return n.toPromise(n.getArguments(function(n){return this.taskqueue.isReady?(t.apply(this,n),void 0):(this.taskqueue.addTask(e,n),void 0)}))},n.arrayBufferToBinaryString=function(e){for(var t="",n=new Uint8Array(e),r=n.byteLength,o=0;r>o;o++)t+=String.fromCharCode(n[o]);return t},n.cancellableFun=function(e,t,r){r=r?n.extend(!0,{},r):{},r.complete=r.complete||function(){};var o=n.once(r.complete),i=new l(function(e,t){r.complete=function(n,r){n?t(n):e(r)}});return i.then(function(e){o(null,e)},o),i.cancel=function(){i.isCancelled=!0,t.taskqueue.isReady&&r.complete(null,{status:"cancelled"})},t.taskqueue.isReady?(e(t,r,i),i):(t.taskqueue.addTask(function(){i.isCancelled?r.complete(null,{status:"cancelled"}):e(t,r,i)}),i)}}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./deps/ajax":32,"./deps/blob":33,"./deps/buffer":2,"./deps/errors":34,"./deps/extend":36,"./deps/md5.js":37,"./deps/uuid":39,"./merge":42,"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11,bluebird:134,events:9,inherits:48}],47:[function(e,t){t.exports=e("../package.json").version},{"../package.json":159}],48:[function(e,t){t.exports=e(10)},{}],49:[function(e,t){(function(n){function r(e){if(!(this instanceof r))return new r(e);if(!e)throw Error("constructor requires at least a location argument");this.IDBOptions={},this.location=e}t.exports=r;var o=e("idb-wrapper"),i=e("abstract-leveldown").AbstractLevelDOWN,s=e("util"),a=e("./iterator"),u=e("isbuffer"),c=e("xtend");s.inherits(r,i),r.prototype._open=function(e,t){var n=this,r={storeName:this.location,autoIncrement:!1,keyPath:null,onStoreReady:function(){t&&t(null,n.idb)},onError:function(e){t&&t(e)}};c(r,e),this.IDBOptions=r,this.idb=new o(r)},r.prototype._get=function(e,t,r){this.idb.get(e,function(o){return void 0===o?r(Error("NotFound")):(t.asBuffer===!1||n.isBuffer(o)||(o=new n(o+"")),r(null,o,e))},r)},r.prototype._del=function(e,t,n){this.idb.remove(e,n,n)},r.prototype._put=function(e,t,n,r){t instanceof ArrayBuffer&&(t=String.fromCharCode.apply(null,new Uint16Array(t)));var o=this.convertEncoding(e,t,n);this.idb.put(o.key,o.value,function(){r()},r)},r.prototype.convertEncoding=function(e,t,n){if(t){var r=""+t;"NaN"===r&&(t="NaN")}var o=n.valueEncoding,i={key:e,value:t};return!t||o&&"binary"===o||"object"!=typeof i.value&&(i.value=r),i},r.prototype.iterator=function(e){return"object"!=typeof e&&(e={}),new a(this.idb,e)},r.prototype._batch=function(e,t,n){var r,o,i,s,a=[];if(0===e.length)return setTimeout(n,0);for(r=0;e.length>r;r++){i={},s=e[r],a[r]=i;var u=this.convertEncoding(s.key,s.value,t);s.key=u.key,s.value=u.value;for(o in s)i[o]="type"===o&&"del"==s[o]?"remove":s[o]}return this.idb.batch(a,function(){n()},n)},r.prototype._close=function(e){this.idb.db.close(),e()},r.prototype._approximateSize=function(e,t,n){var r=Error("Not implemented");if(n)return n(r);throw r},r.prototype._isBuffer=function(e){return n.isBuffer(e)},r.destroy=function(e,t){if("object"==typeof e)var n=e.IDBOptions.storePrefix||"IDBWrapper-",r=e.location;else var n="IDBWrapper-",r=e;var o=indexedDB.deleteDatabase(n+r);o.onsuccess=function(){t()},o.onerror=function(e){t(e)}},r.prototype._checkKeyValue=function(e,t){return null===e||void 0===e?Error(t+" cannot be `null` or `undefined`"):null===e||void 0===e?Error(t+" cannot be `null` or `undefined`"):u(e)&&0===e.byteLength?Error(t+" cannot be an empty ArrayBuffer"):""==e+""?Error(t+" cannot be an empty String"):0===e.length?Error(t+" cannot be an empty Array"):void 0}}).call(this,e("buffer").Buffer)},{"./iterator":50,"abstract-leveldown":53,buffer:12,"idb-wrapper":54,isbuffer:55,util:25,xtend:57}],50:[function(e,t){function n(e,t){t||(t={}),this.options=t,o.call(this,e),this._order=t.reverse?"DESC":"ASC",this._start=t.start,this._limit=t.limit,this._count=0,this._end=t.end,this._done=!1,this._gt=t.gt,this._gte=t.gte,this._lt=t.lt,this._lte=t.lte}var r=e("util"),o=e("abstract-leveldown").AbstractIterator;t.exports=n,r.inherits(n,o),n.prototype.createIterator=function(){var e,t,n=this,r=n._start!==void 0&&n._end===void 0,o=n._start===void 0&&n._end!==void 0,i=n._start!==void 0&&n._end!==void 0;if(r){var s=n._start;"ASC"===n._order?e=s:t=s}else if(o){var s=n._end;"DESC"===n._order?e=s:t=s}else i&&(e=n._start,t=n._end,n._start>n._end&&(e=n._end,t=n._start));e||("undefined"!==n._gte?e=n._gte:"undefined"!==n._gt&&(e=n._gt)),t||("undefined"!==n._lte?t=n._lte:"undefined"!==n._lt&&(t=n._lt)),(e||t)&&(n._keyRange=n.options.keyRange||n.db.makeKeyRange({lower:e,upper:t})),n.iterator=n.db.iterate(function(){n.onItem.apply(n,arguments)},{keyRange:n._keyRange,autoContinue:!1,order:n._order,onError:function(e){console.log("horrible error",e)}})},n.prototype.onItem=function(e,t){if(!t&&this.callback)return this.callback(),this.callback=!1,void 0;var n=!0;this._limit&&this._limit>0&&this._count++>=this._limit&&(n=!1),(this._lt&&t.key>=this._lt||this._lte&&t.key>this._lte||this._gt&&t.key<=this._gt||this._gte&&t.key<this._gte)&&(n=!1),n&&this.callback(!1,t.key,t.value),t&&t.continue()},n.prototype._next=function(e){return e?(this._started||(this.createIterator(),this._started=!0),this.callback=e,void 0):Error("next() requires a callback argument")}},{"abstract-leveldown":53,util:25}],51:[function(e,t){(function(e){function n(e){this._db=e,this._operations=[],this._written=!1}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(t,n){if(this._checkWritten(),"function"==typeof t&&(n=t),"function"!=typeof n)throw Error("write() requires a callback argument");return"object"!=typeof t&&(t={}),this._written=!0,"function"==typeof this._write?this._write(n):"function"==typeof this._db._batch?this._db._batch(this._operations,t,n):(e.nextTick(n),void 0)},t.exports=n}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11}],52:[function(e,t){(function(e){function n(e){this.db=e,this._ended=!1,this._nexting=!1}n.prototype.next=function(t){var n=this;if("function"!=typeof t)throw Error("next() requires a callback argument");return n._ended?t(Error("cannot call next() after end()")):n._nexting?t(Error("cannot call next() before previous next() has completed")):(n._nexting=!0,"function"==typeof n._next?n._next(function(){n._nexting=!1,t.apply(null,arguments)}):(e.nextTick(function(){n._nexting=!1,t()}),void 0))},n.prototype.end=function(t){if("function"!=typeof t)throw Error("end() requires a callback argument");return this._ended?t(Error("end() already called on iterator")):(this._ended=!0,"function"==typeof this._end?this._end(t):(e.nextTick(t),void 0))},t.exports=n}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11}],53:[function(e,t){(function(n,r){function o(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 i=e("xtend"),s=e("./abstract-iterator"),a=e("./abstract-chained-batch");o.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):(n.nextTick(t),void 0)},o.prototype.close=function(e){if("function"!=typeof e)throw Error("close() requires a callback argument");return"function"==typeof this._close?this._close(e):(n.nextTick(e),void 0)},o.prototype.get=function(e,t,r){var o;if("function"==typeof t&&(r=t),"function"!=typeof r)throw Error("get() requires a callback argument");return(o=this._checkKeyValue(e,"key",this._isBuffer))?r(o):(this._isBuffer(e)||(e+=""),"object"!=typeof t&&(t={}),"function"==typeof this._get?this._get(e,t,r):(n.nextTick(function(){r(Error("NotFound"))}),void 0))},o.prototype.put=function(e,t,r,o){var i;if("function"==typeof r&&(o=r),"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)||n.browser||(t+=""),"object"!=typeof r&&(r={}),"function"==typeof this._put?this._put(e,t,r,o):(n.nextTick(o),void 0))},o.prototype.del=function(e,t,r){var o;if("function"==typeof t&&(r=t),"function"!=typeof r)throw Error("del() requires a callback argument");return(o=this._checkKeyValue(e,"key",this._isBuffer))?r(o):(this._isBuffer(e)||(e+=""),"object"!=typeof t&&(t={}),"function"==typeof this._del?this._del(e,t,r):(n.nextTick(r),void 0))},o.prototype.batch=function(e,t,r){if(!arguments.length)return this._chainedBatch();if("function"==typeof t&&(r=t),"function"!=typeof r)throw Error("batch(array) requires a callback argument");if(!Array.isArray(e))return r(Error("batch(array) requires an array argument"));"object"!=typeof t&&(t={});for(var o,i,s=0,a=e.length;a>s;s++)if(o=e[s],"object"==typeof o){if(i=this._checkKeyValue(o.type,"type",this._isBuffer))return r(i);if(i=this._checkKeyValue(o.key,"key",this._isBuffer))return r(i);if("put"==o.type&&(i=this._checkKeyValue(o.value,"value",this._isBuffer)))return r(i)}return"function"==typeof this._batch?this._batch(e,t,r):(n.nextTick(r),void 0)},o.prototype.approximateSize=function(e,t,r){if(null==e||null==t||"function"==typeof e||"function"==typeof t)throw Error("approximateSize() requires valid `start`, `end` and `callback` arguments");if("function"!=typeof r)throw Error("approximateSize() requires a callback argument");return this._isBuffer(e)||(e+=""),this._isBuffer(t)||(t+=""),"function"==typeof this._approximateSize?this._approximateSize(e,t,r):(n.nextTick(function(){r(null,0)}),void 0)},o.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},o.prototype.iterator=function(e){return"object"!=typeof e&&(e={}),e=this._setupIteratorOptions(e),"function"==typeof this._iterator?this._iterator(e):new s(this)},o.prototype._chainedBatch=function(){return new a(this)},o.prototype._isBuffer=function(e){return r.isBuffer(e)},o.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=o,t.exports.AbstractIterator=s,t.exports.AbstractChainedBatch=a}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),e("buffer").Buffer)},{"./abstract-chained-batch":51,"./abstract-iterator":52,"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11,buffer:12,xtend:57}],54:[function(e,t){(function(e,n,r){"function"==typeof define?define(n):t!==void 0&&t.exports?t.exports=n():r[e]=n()})("IDBStore",function(){"use strict";var e=function(e){throw e},t={storeName:"Store",storePrefix:"IDBWrapper-",dbVersion:1,keyPath:"id",autoIncrement:!0,onStoreReady:function(){},onError:e,indexes:[]},n=function(e,n){n===void 0&&"function"==typeof e&&(n=e),"[object Object]"!=Object.prototype.toString.call(e)&&(e={});for(var r in t)this[r]=e[r]!==void 0?e[r]:t[r];this.dbName=this.storePrefix+this.storeName,this.dbVersion=parseInt(this.dbVersion,10)||1,n&&(this.onStoreReady=n);var o="object"==typeof window?window:self;this.idb=o.indexedDB||o.webkitIndexedDB||o.mozIndexedDB,this.keyRange=o.IDBKeyRange||o.webkitIDBKeyRange||o.mozIDBKeyRange,this.features={hasAutoIncrement:!o.mozIndexedDB},this.consts={READ_ONLY:"readonly",READ_WRITE:"readwrite",VERSION_CHANGE:"versionchange",NEXT:"next",NEXT_NO_DUPLICATE:"nextunique",PREV:"prev",PREV_NO_DUPLICATE:"prevunique"},this.openDB()
};n.prototype={constructor:n,version:"1.4.1",db:null,dbName:null,dbVersion:null,store:null,storeName:null,keyPath:null,autoIncrement:null,indexes:null,features:null,onStoreReady:null,onError:null,_insertIdCount:0,openDB:function(){var e=this.idb.open(this.dbName,this.dbVersion),t=!1;e.onerror=function(e){var t=!1;"error"in e.target?t="VersionError"==e.target.error.name:"errorCode"in e.target&&(t=12==e.target.errorCode),t?this.onError(Error("The version number provided is lower than the existing one.")):this.onError(e)}.bind(this),e.onsuccess=function(e){if(!t){if(this.db)return this.onStoreReady(),void 0;if(this.db=e.target.result,"string"==typeof this.db.version)return this.onError(Error("The IndexedDB implementation in this browser is outdated. Please upgrade your browser.")),void 0;if(!this.db.objectStoreNames.contains(this.storeName))return this.onError(Error("Something is wrong with the IndexedDB implementation in this browser. Please upgrade your browser.")),void 0;var n=this.db.transaction([this.storeName],this.consts.READ_ONLY);this.store=n.objectStore(this.storeName);var r=Array.prototype.slice.call(this.getIndexList());this.indexes.forEach(function(e){var n=e.name;if(!n)return t=!0,this.onError(Error("Cannot create index: No index name given.")),void 0;if(this.normalizeIndexData(e),this.hasIndex(n)){var o=this.store.index(n),i=this.indexComplies(o,e);i||(t=!0,this.onError(Error('Cannot modify index "'+n+'" for current version. Please bump version number to '+(this.dbVersion+1)+"."))),r.splice(r.indexOf(n),1)}else t=!0,this.onError(Error('Cannot create new index "'+n+'" for current version. Please bump version number to '+(this.dbVersion+1)+"."))},this),r.length&&(t=!0,this.onError(Error('Cannot delete index(es) "'+(""+r)+'" for current version. Please bump version number to '+(this.dbVersion+1)+"."))),t||this.onStoreReady()}}.bind(this),e.onupgradeneeded=function(e){if(this.db=e.target.result,this.db.objectStoreNames.contains(this.storeName))this.store=e.target.transaction.objectStore(this.storeName);else{var n={autoIncrement:this.autoIncrement};null!==this.keyPath&&(n.keyPath=this.keyPath),this.store=this.db.createObjectStore(this.storeName,n)}var r=Array.prototype.slice.call(this.getIndexList());this.indexes.forEach(function(e){var n=e.name;if(n||(t=!0,this.onError(Error("Cannot create index: No index name given."))),this.normalizeIndexData(e),this.hasIndex(n)){var o=this.store.index(n),i=this.indexComplies(o,e);i||(this.store.deleteIndex(n),this.store.createIndex(n,e.keyPath,{unique:e.unique,multiEntry:e.multiEntry})),r.splice(r.indexOf(n),1)}else this.store.createIndex(n,e.keyPath,{unique:e.unique,multiEntry:e.multiEntry})},this),r.length&&r.forEach(function(e){this.store.deleteIndex(e)},this)}.bind(this)},deleteDatabase:function(){this.idb.deleteDatabase&&this.idb.deleteDatabase(this.dbName)},put:function(t,n,o,i){null!==this.keyPath&&(i=o,o=n,n=t),i||(i=e),o||(o=r);var s,a=!1,u=null,c=this.db.transaction([this.storeName],this.consts.READ_WRITE);return c.oncomplete=function(){var e=a?o:i;e(u)},c.onabort=i,c.onerror=i,null!==this.keyPath?(this._addIdPropertyIfNeeded(n),s=c.objectStore(this.storeName).put(n)):s=c.objectStore(this.storeName).put(n,t),s.onsuccess=function(e){a=!0,u=e.target.result},s.onerror=i,c},get:function(t,n,o){o||(o=e),n||(n=r);var i=!1,s=null,a=this.db.transaction([this.storeName],this.consts.READ_ONLY);a.oncomplete=function(){var e=i?n:o;e(s)},a.onabort=o,a.onerror=o;var u=a.objectStore(this.storeName).get(t);return u.onsuccess=function(e){i=!0,s=e.target.result},u.onerror=o,a},remove:function(t,n,o){o||(o=e),n||(n=r);var i=!1,s=null,a=this.db.transaction([this.storeName],this.consts.READ_WRITE);a.oncomplete=function(){var e=i?n:o;e(s)},a.onabort=o,a.onerror=o;var u=a.objectStore(this.storeName)["delete"](t);return u.onsuccess=function(e){i=!0,s=e.target.result},u.onerror=o,a},batch:function(t,n,o){o||(o=e),n||(n=r),"[object Array]"!=Object.prototype.toString.call(t)&&o(Error("dataArray argument must be of type Array."));var i=this.db.transaction([this.storeName],this.consts.READ_WRITE);i.oncomplete=function(){var e=u?n:o;e(u)},i.onabort=o,i.onerror=o;var s=t.length,a=!1,u=!1,c=function(){s--,0!==s||a||(a=!0,u=!0)};return t.forEach(function(e){var t=e.type,n=e.key,r=e.value,s=function(e){i.abort(),a||(a=!0,o(e,t,n))};if("remove"==t){var u=i.objectStore(this.storeName)["delete"](n);u.onsuccess=c,u.onerror=s}else if("put"==t){var l;null!==this.keyPath?(this._addIdPropertyIfNeeded(r),l=i.objectStore(this.storeName).put(r)):l=i.objectStore(this.storeName).put(r,n),l.onsuccess=c,l.onerror=s}},this),i},putBatch:function(e,t,n){var r=e.map(function(e){return{type:"put",value:e}});return this.batch(r,t,n)},removeBatch:function(e,t,n){var r=e.map(function(e){return{type:"remove",key:e}});return this.batch(r,t,n)},getBatch:function(t,n,o,i){o||(o=e),n||(n=r),i||(i="sparse"),"[object Array]"!=Object.prototype.toString.call(t)&&o(Error("keyArray argument must be of type Array."));var s=this.db.transaction([this.storeName],this.consts.READ_ONLY);s.oncomplete=function(){var e=l?n:o;e(d)},s.onabort=o,s.onerror=o;var a=[],u=t.length,c=!1,l=!1,d=null,f=function(e){e.target.result||"dense"==i?a.push(e.target.result):"sparse"==i&&a.length++,u--,0===u&&(c=!0,l=!0,d=a)};return t.forEach(function(e){var t=function(e){c=!0,d=e,o(e),s.abort()},n=s.objectStore(this.storeName).get(e);n.onsuccess=f,n.onerror=t},this),s},getAll:function(t,n){n||(n=e),t||(t=r);var o=this.db.transaction([this.storeName],this.consts.READ_ONLY),i=o.objectStore(this.storeName);return i.getAll?this._getAllNative(o,i,t,n):this._getAllCursor(o,i,t,n),o},_getAllNative:function(e,t,n,r){var o=!1,i=null;e.oncomplete=function(){var e=o?n:r;e(i)},e.onabort=r,e.onerror=r;var s=t.getAll();s.onsuccess=function(e){o=!0,i=e.target.result},s.onerror=r},_getAllCursor:function(e,t,n,r){var o=[],i=!1,s=null;e.oncomplete=function(){var e=i?n:r;e(s)},e.onabort=r,e.onerror=r;var a=t.openCursor();a.onsuccess=function(e){var t=e.target.result;t?(o.push(t.value),t["continue"]()):(i=!0,s=o)},a.onError=r},clear:function(t,n){n||(n=e),t||(t=r);var o=!1,i=null,s=this.db.transaction([this.storeName],this.consts.READ_WRITE);s.oncomplete=function(){var e=o?t:n;e(i)},s.onabort=n,s.onerror=n;var a=s.objectStore(this.storeName).clear();return a.onsuccess=function(e){o=!0,i=e.target.result},a.onerror=n,s},_addIdPropertyIfNeeded:function(e){this.features.hasAutoIncrement||void 0!==e[this.keyPath]||(e[this.keyPath]=this._insertIdCount++ +Date.now())},getIndexList:function(){return this.store.indexNames},hasIndex:function(e){return this.store.indexNames.contains(e)},normalizeIndexData:function(e){e.keyPath=e.keyPath||e.name,e.unique=!!e.unique,e.multiEntry=!!e.multiEntry},indexComplies:function(e,t){var n=["keyPath","unique","multiEntry"].every(function(n){if("multiEntry"==n&&void 0===e[n]&&t[n]===!1)return!0;if("keyPath"==n&&"[object Array]"==Object.prototype.toString.call(t[n])){var r=t.keyPath,o=e.keyPath;if("string"==typeof o)return""+r==o;if("function"!=typeof o.contains&&"function"!=typeof o.indexOf)return!1;if(o.length!==r.length)return!1;for(var i=0,s=r.length;s>i;i++)if(!(o.contains&&o.contains(r[i])||o.indexOf(-1!==r[i])))return!1;return!0}return t[n]==e[n]});return n},iterate:function(t,n){n=i({index:null,order:"ASC",autoContinue:!0,filterDuplicates:!1,keyRange:null,writeAccess:!1,onEnd:null,onError:e},n||{});var r="desc"==n.order.toLowerCase()?"PREV":"NEXT";n.filterDuplicates&&(r+="_NO_DUPLICATE");var o=!1,s=this.db.transaction([this.storeName],this.consts[n.writeAccess?"READ_WRITE":"READ_ONLY"]),a=s.objectStore(this.storeName);n.index&&(a=a.index(n.index)),s.oncomplete=function(){return o?(n.onEnd?n.onEnd():t(null),void 0):(n.onError(null),void 0)},s.onabort=n.onError,s.onerror=n.onError;var u=a.openCursor(n.keyRange,this.consts[r]);return u.onerror=n.onError,u.onsuccess=function(e){var r=e.target.result;r?(t(r.value,r,s),n.autoContinue&&r["continue"]()):o=!0},s},query:function(e,t){var n=[];return t=t||{},t.onEnd=function(){e(n)},this.iterate(function(e){n.push(e)},t)},count:function(t,n){n=i({index:null,keyRange:null},n||{});var r=n.onError||e,o=!1,s=null,a=this.db.transaction([this.storeName],this.consts.READ_ONLY);a.oncomplete=function(){var e=o?t:r;e(s)},a.onabort=r,a.onerror=r;var u=a.objectStore(this.storeName);n.index&&(u=u.index(n.index));var c=u.count(n.keyRange);return c.onsuccess=function(e){o=!0,s=e.target.result},c.onError=r,a},makeKeyRange:function(e){var t,n=e.lower!==void 0,r=e.upper!==void 0,o=e.only!==void 0;switch(!0){case o:t=this.keyRange.only(e.only);break;case n&&r:t=this.keyRange.bound(e.lower,e.upper,e.excludeLower,e.excludeUpper);break;case n:t=this.keyRange.lowerBound(e.lower,e.excludeLower);break;case r:t=this.keyRange.upperBound(e.upper,e.excludeUpper);break;default:throw Error('Cannot create KeyRange. Provide one or both of "lower" or "upper" value, or an "only" value.')}return t}};var r=function(){},o={},i=function(e,t){var n,r;for(n in t)r=t[n],r!==o[n]&&r!==e[n]&&(e[n]=r);return e};return n.version=n.prototype.version,n},this)},{}],55:[function(e,t){function n(e){return r.isBuffer(e)||/\[object (.+Array|Array.+)\]/.test(Object.prototype.toString.call(e))}var r=e("buffer").Buffer;t.exports=n},{buffer:12}],56:[function(e,t){function n(e){return null!==e&&("object"==typeof e||"function"==typeof e)}t.exports=n},{}],57:[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),s=0;i.length>s;s++){var a=i[s];e[a]=n[a]}}return e}var r=e("object-keys"),o=e("./has-keys");t.exports=n},{"./has-keys":56,"object-keys":59}],58:[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,s="string"==typeof e,a=e.length,u=arguments.length>2?arguments[2]:null;if(a===+a)for(r=0;a>r;r++)null===u?t(s?e.charAt(r):e[r],r,e):t.call(u,s?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))}},{}],59:[function(e,t){t.exports=Object.keys||e("./shim")},{"./shim":61}],60:[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}},{}],61:[function(e,t){(function(){"use strict";var n,r=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=e("./foreach"),s=e("./isArguments"),a=!{toString:null}.propertyIsEnumerable("toString"),u=function(){}.propertyIsEnumerable("prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];n=function(e){var t=null!==e&&"object"==typeof e,n="[object Function]"===o.call(e),l=s(e),d=[];if(!t&&!n&&!l)throw new TypeError("Object.keys called on a non-object");if(l)i(e,function(e){d.push(e)});else{var f,h=u&&n;for(f in e)h&&"prototype"===f||!r.call(e,f)||d.push(f)}if(a){var p=e.constructor,v=p&&p.prototype===e;i(c,function(t){v&&"constructor"===t||!r.call(e,t)||d.push(t)})}return d},t.exports=n})()},{"./foreach":58,"./isArguments":60}],62:[function(e,t){function n(e,t,n,r){var o={type:e,key:t,value:n,options:r};return r&&r.prefix&&(o.prefix=r.prefix,delete r.prefix),this._operations.push(o),this}function r(e){this._operations=[],this._sdb=e,this.put=n.bind(this,"put"),this.del=n.bind(this,"del")}var o=r.prototype;o.clear=function(){this._operations=[]},o.write=function(e){this._sdb.batch(this._operations,e)},t.exports=r},{}],63:[function(e,t){(function(n){e("events").EventEmitter,n.nextTick;var r=e("./sub"),o=e("./batch"),i=e("level-fix-range"),s=e("level-hooks");t.exports=function(e,t){function n(){}function a(e){return function(t){return t=t||{},t=i(t),t.reverse?t.start=t.start||c:t.end=t.end||c,e.call(u,t)}}n.prototype=e;var u=new n;if(u.sublevel)return u;t=t||{};var c=t.sep=t.sep||"ÿ";u._options=t,s(u),u.sublevels={},u.sublevel=function(e,t){return u.sublevels[e]?u.sublevels[e]:new r(u,e,t||this._options)},u.methods={},u.prefix=function(e){return""+(e||"")},u.pre=function(e,t){return t||(t=e,e={max:c}),u.hooks.pre(e,t)},u.post=function(e,t){return t||(t=e,e={max:c}),u.hooks.post(e,t)},u.readStream=u.createReadStream=a(u.createReadStream),u.keyStream=u.createKeyStream=a(u.createKeyStream),u.valuesStream=u.createValueStream=a(u.createValueStream);var l=u.batch;return u.batch=function(e,t,n){return Array.isArray(e)?(e.forEach(function(e){e.prefix&&("function"==typeof e.prefix.prefix?e.key=e.prefix.prefix(e.key):"string"==typeof e.prefix&&(e.key=e.prefix+e.key))}),l.call(u,e,t,n),void 0):new o(u)},u}}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"./batch":62,"./sub":74,"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11,events:9,"level-fix-range":64,"level-hooks":66}],64:[function(e,t){var n=e("clone");t.exports=function(e){e=n(e);var t=e.reverse,r=e.max||e.end,o=e.min||e.start,i=[o,r];return null!=o&&null!=r&&i.sort(),t&&(i=i.reverse()),e.start=i[0],e.end=i[1],delete e.min,delete e.max,e}},{clone:65}],65:[function(e,t){(function(e){"use strict";function n(e){return Object.prototype.toString.call(e)}function r(t,n){function i(t,n,r,s){var d;if("object"==typeof t){if(null==t)return t;for(d in u)if(u[d]===t)return l.push({resolveTo:d,child:r,i:s}),null;if(u[n]=t,o.isArray(t)){r=[];for(d in t)r[d]=i(t[d],n+"["+d+"]",r,d)}else if(o.isDate(t))r=new Date(t.getTime());else if(o.isRegExp(t))r=RegExp(t.source,o.getRegExpFlags(t)),t.lastIndex&&(r.lastIndex=t.lastIndex);else if(a&&e.isBuffer(t))r=new e(t.length),t.copy(r);else{r={},r.__proto__=t.__proto__;for(d in t)r[d]=i(t[d],n+"["+d+"]",r,d)}c[n]=r}else r=t;return r}n===void 0&&(n=!0);var s,a=e!==void 0,u={},c={},l=[];if(n){var d=i(t,"*");for(s in l){var f=l[s];f&&f.child&&f.i in f.child&&(f.child[f.i]=c[f.resolveTo])}return d}var h;if("object"==typeof t){if(null==t)return t;if("Array"===t.constructor.name){h=[];for(s in t)h[s]=r(t[s],n)}else if(o.isDate(t))h=new Date(t.getTime());else if(o.isRegExp(t))h=RegExp(t.source,o.getRegExpFlags(t)),t.lastIndex&&(h.lastIndex=t.lastIndex);else{h={},h.__proto__=t.__proto__;for(s in t)h[s]=r(t[s],n)}}else h=t;return h}var o={isArray:function(e){return Array.isArray(e)||"object"==typeof e&&"[object Array]"===n(e)},isDate:function(e){return"object"==typeof e&&"[object Date]"===n(e)},isRegExp:function(e){return"object"==typeof e&&"[object RegExp]"===n(e)},getRegExpFlags:function(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}};"object"==typeof t&&(t.exports=r),r.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t}}).call(this,e("buffer").Buffer)},{buffer:12}],66:[function(e,t){var n=e("string-range");t.exports=function(e){function t(e){return e&&("string"==typeof e?e:"string"==typeof e.prefix?e.prefix:"function"==typeof e.prefix?e.prefix():"")}function r(e){return e&&e._getKeyEncoding?e._getKeyEncoding(e):void 0}function o(e){return e&&e._getValueEncoding?e._getValueEncoding(e):void 0}function i(e,t){return function(){var n=e.indexOf(t);return~n?(e.splice(n,1),!0):!1}}function s(e){e&&e.type&&u.forEach(function(t){t.test(e.key)&&t.hook(e)})}function a(n,i,s,a){try{i.forEach(function u(e,n){c.forEach(function(s){if(s.test(e.key+"")){var a={add:function(e,a){if(e===void 0)return this;if(e===!1)return delete i[n];var c=t(e.prefix)||t(a)||s.prefix||"";if(c&&(e.prefix=c),e.key=c+e.key,s.test(e.key+""))throw Error("prehook cannot insert into own range");var l=e.keyEncoding||r(e.prefix),d=e.valueEncoding||o(e.prefix);return l&&(e.keyEncoding=l),d&&(e.valueEncoding=d),i.push(e),u(e,i.length-1),this},put:function(e,t){return"object"==typeof e&&(e.type="put"),this.add(e,t)},del:function(e,t){return"object"==typeof e&&(e.type="del"),this.add(e,t)},veto:function(){return this.add(!1)}};s.hook.call(a,e,a.add,i)}})})}catch(h){return(a||s)(h)}if(i=i.filter(function(e){return e&&e.type}),1==i.length&&!n){var p=i[0];return"put"==p.type?l.call(e,p.key,p.value,s,a):d.call(e,p.key,s,a)}return f.call(e,i,s,a)}if(!e.hooks){var u=[],c=[];e.hooks={post:function(e,t){t||(t=e,e="");var r={test:n.checker(e),hook:t};return u.push(r),i(u,r)},pre:function(e,t){t||(t=e,e="");var r={test:n.checker(e),hook:t};return c.push(r),i(c,r)},posthooks:u,prehooks:c},e.on("put",function(e,t){s({type:"put",key:e,value:t})}),e.on("del",function(e,t){s({type:"del",key:e,value:t})}),e.on("batch",function(e){e.forEach(s)});var l=e.put,d=e.del,f=e.batch;e.put=function(e,t,n,r){var o=[{key:e,value:t,type:"put"}];return a(!1,o,n,r)},e.del=function(e,t,n){var r=[{key:e,type:"del"}];return a(!1,r,t,n)},e.batch=function(e,t,n){return a(!0,e,t,n)}}}},{"string-range":67}],67:[function(e,t,n){var r=n.range=function(e){return null==e?{}:"string"==typeof r?{min:r,max:r+"ÿ"}:e};n.prefix=function(e,t,r){e=n.range(e);var o={};return r=r||"ÿ",e instanceof RegExp||"function"==typeof e?(o.min=t,o.max=t+r,o.inner=function(n){var r=n.substring(t.length);return e.test?e.test(r):e(r)}):"object"==typeof e&&(o.min=t+(e.min||e.start||""),o.max=t+(e.max||e.end||r||"~"),o.reverse=!!e.reverse),o};var o=n.checker=function(e){return e||(e={}),"string"==typeof e?function(t){return 0==t.indexOf(e)}:e instanceof RegExp?function(t){return e.test(t)}:"object"==typeof e?function(t){var n=e.min||e.start,r=e.max||e.end;return t+="",(!n||t>=n)&&(!r||r>=t)&&(!e.inner||(e.inner.test?e.inner.test(t):e.inner(t)))}:"function"==typeof e?e:void 0};n.satisfies=function(e,t){return o(t)(e)}},{}],68:[function(e,t){t.exports=e(56)},{}],69:[function(e,t,n){arguments[4][57][0].apply(n,arguments)},{"./has-keys":68,"object-keys":70}],70:[function(e,t,n){arguments[4][59][0].apply(n,arguments)},{"./shim":73}],71:[function(e,t){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(e,t,o){if("[object Function]"!==r.call(t))throw new TypeError("iterator must be a function");var i=e.length;if(i===+i)for(var s=0;i>s;s++)t.call(o,e[s],s,e);else for(var a in e)n.call(e,a)&&t.call(o,e[a],a,e)}},{}],72:[function(e,t){var n=Object.prototype,r=n.hasOwnProperty,o=n.toString,i=function(e){return e!==e},s={"boolean":1,number:1,string:1,undefined:1},a=t.exports={};a.a=a.type=function(e,t){return typeof e===t},a.defined=function(e){return void 0!==e},a.empty=function(e){var t,n=o.call(e);if("[object Array]"===n||"[object Arguments]"===n)return 0===e.length;if("[object Object]"===n){for(t in e)if(r.call(e,t))return!1;return!0}return"[object String]"===n?""===e:!1},a.equal=function(e,t){var n,r=o.call(e);if(r!==o.call(t))return!1;if("[object Object]"===r){for(n in e)if(!a.equal(e[n],t[n]))return!1;return!0}if("[object Array]"===r){if(n=e.length,n!==t.length)return!1;for(;--n;)if(!a.equal(e[n],t[n]))return!1;return!0}return"[object Function]"===r?e.prototype===t.prototype:"[object Date]"===r?e.getTime()===t.getTime():e===t},a.hosted=function(e,t){var n=typeof t[e];return"object"===n?!!t[e]:!s[n]},a.instance=a["instanceof"]=function(e,t){return e instanceof t},a["null"]=function(e){return null===e},a.undefined=function(e){return void 0===e},a.arguments=function(e){var t="[object Arguments]"===o.call(e),n=!a.array(e)&&a.arraylike(e)&&a.object(e)&&a.fn(e.callee);return t||n},a.array=function(e){return"[object Array]"===o.call(e)},a.arguments.empty=function(e){return a.arguments(e)&&0===e.length},a.array.empty=function(e){return a.array(e)&&0===e.length},a.arraylike=function(e){return!!e&&!a.boolean(e)&&r.call(e,"length")&&isFinite(e.length)&&a.number(e.length)&&e.length>=0},a.boolean=function(e){return"[object Boolean]"===o.call(e)},a["false"]=function(e){return a.boolean(e)&&(e===!1||e.valueOf()===!1)},a["true"]=function(e){return a.boolean(e)&&(e===!0||e.valueOf()===!0)},a.date=function(e){return"[object Date]"===o.call(e)},a.element=function(e){return void 0!==e&&"undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&1===e.nodeType},a.error=function(e){return"[object Error]"===o.call(e)},a.fn=a["function"]=function(e){var t="undefined"!=typeof window&&e===window.alert;return t||"[object Function]"===o.call(e)},a.number=function(e){return"[object Number]"===o.call(e)},a.infinite=function(e){return 1/0===e||e===-1/0},a.decimal=function(e){return a.number(e)&&!i(e)&&!a.infinite(e)&&0!==e%1},a.divisibleBy=function(e,t){var n=a.infinite(e),r=a.infinite(t),o=a.number(e)&&!i(e)&&a.number(t)&&!i(t)&&0!==t;return n||r||o&&0===e%t},a.int=function(e){return a.number(e)&&!i(e)&&0===e%1},a.maximum=function(e,t){if(i(e))throw new TypeError("NaN is not a valid value");if(!a.arraylike(t))throw new TypeError("second argument must be array-like");for(var n=t.length;--n>=0;)if(t[n]>e)return!1;return!0},a.minimum=function(e,t){if(i(e))throw new TypeError("NaN is not a valid value");if(!a.arraylike(t))throw new TypeError("second argument must be array-like");for(var n=t.length;--n>=0;)if(e>t[n])return!1;return!0},a.nan=function(e){return!a.number(e)||e!==e},a.even=function(e){return a.infinite(e)||a.number(e)&&e===e&&0===e%2},a.odd=function(e){return a.infinite(e)||a.number(e)&&e===e&&0!==e%2},a.ge=function(e,t){if(i(e)||i(t))throw new TypeError("NaN is not a valid value");return!a.infinite(e)&&!a.infinite(t)&&e>=t},a.gt=function(e,t){if(i(e)||i(t))throw new TypeError("NaN is not a valid value");return!a.infinite(e)&&!a.infinite(t)&&e>t},a.le=function(e,t){if(i(e)||i(t))throw new TypeError("NaN is not a valid value");return!a.infinite(e)&&!a.infinite(t)&&t>=e},a.lt=function(e,t){if(i(e)||i(t))throw new TypeError("NaN is not a valid value");return!a.infinite(e)&&!a.infinite(t)&&t>e},a.within=function(e,t,n){if(i(e)||i(t)||i(n))throw new TypeError("NaN is not a valid value");if(!a.number(e)||!a.number(t)||!a.number(n))throw new TypeError("all arguments must be numbers");var r=a.infinite(e)||a.infinite(t)||a.infinite(n);return r||e>=t&&n>=e},a.object=function(e){return e&&"[object Object]"===o.call(e)},a.hash=function(e){return a.object(e)&&e.constructor===Object&&!e.nodeType&&!e.setInterval},a.regexp=function(e){return"[object RegExp]"===o.call(e)},a.string=function(e){return"[object String]"===o.call(e)}},{}],73:[function(e,t){(function(){"use strict";var n,r=Object.prototype.hasOwnProperty,o=e("is"),i=e("foreach"),s=!{toString:null}.propertyIsEnumerable("toString"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];n=function(e){if(!o.object(e)&&!o.array(e))throw new TypeError("Object.keys called on a non-object");var t,n=[];for(t in e)r.call(e,t)&&n.push(t);return s&&i(a,function(t){r.call(e,t)&&n.push(t)}),n},t.exports=n})()},{foreach:71,is:72}],74:[function(e,t){function n(e,t,r){if("string"==typeof r&&(console.error("db.sublevel(name, seperator<string>) is depreciated"),console.error("use db.sublevel(name, {sep: separator})) if you must"),r={sep:r}),!(this instanceof n))return new n(e,t,r);if(!e)throw Error("must provide db");if(!t)throw Error("must provide prefix");r=r||{},r.sep=r.sep||"ÿ",this._parent=e,this._options=r,this.options=r,this._prefix=t,this._root=o(this),e.sublevels[t]=this,this.sublevels={},this.methods={};var i=this;this.hooks={pre:function(){return i.pre.apply(i,arguments)},post:function(){return i.post.apply(i,arguments)}}}function r(e,t){["valueEncoding","encoding","keyEncoding","reverse","values","keys","limit","fillCache"].forEach(function(n){t.hasOwnProperty(n)&&(e[n]=t[n])})}function o(e){return e._parent?o(e._parent):e}var i=e("events").EventEmitter,s=e("util").inherits,a=e("string-range"),u=e("level-fix-range"),c=e("xtend"),l=e("./batch");s(n,i);var d=n.prototype;d._key=function(e){var t=this._options.sep;return t+this._prefix+t+e},d._getOptsAndCb=function(e,t){return"function"==typeof e&&(t=e,e={}),{opts:c(e,this._options),cb:t}},d.sublevel=function(e,t){return this.sublevels[e]?this.sublevels[e]:new n(this,e,t||this._options)},d.put=function(e,t,n,r){var o=this._getOptsAndCb(n,r);this._root.put(this.prefix(e),t,o.opts,o.cb)},d.get=function(e,t,n){var r=this._getOptsAndCb(t,n);this._root.get(this.prefix(e),r.opts,r.cb)},d.del=function(e,t,n){var r=this._getOptsAndCb(t,n);this._root.del(this.prefix(e),r.opts,r.cb)},d.batch=function(e,t,n){if(!Array.isArray(e))return new l(this);var r=this,o=this._getOptsAndCb(t,n);e.forEach(function(e){e.key="string"==typeof e.prefix?e.prefix+e.key:(e.prefix||r).prefix(e.key),e.prefix&&(e.prefix=null)}),this._root.batch(e,o.opts,o.cb)},d._getKeyEncoding=function(){return this.options.keyEncoding?this.options.keyEncoding:this._parent&&this._parent._getKeyEncoding?this._parent._getKeyEncoding():void 0},d._getValueEncoding=function(){return this.options.valueEncoding?this.options.valueEncoding:this._parent&&this._parent._getValueEncoding?this._parent._getValueEncoding():void 0},d.prefix=function(e){var t=this._options.sep;return this._parent.prefix()+t+this._prefix+t+(e||"")},d.keyStream=d.createKeyStream=function(e){return e=e||{},e.keys=!0,e.values=!1,this.createReadStream(e)},d.valueStream=d.createValueStream=function(e){return e=e||{},e.keys=!1,e.values=!0,e.keys=!1,this.createReadStream(e)},d.readStream=d.createReadStream=function(e){e=e||{};var t=o(this),n=this.prefix(),i=a.prefix(e,n);r(i,c(e,this._options));var s=t.createReadStream(i);if(i.values===!1){var u=s.read;if(u)s.read=function(e){var t=u.call(this,e);return t&&(t=t.substring(n.length)),t};else{var l=s.emit;s.emit=function(e,t){"data"===e?l.call(this,"data",t.substring(n.length)):l.call(this,e,t)}}return s}if(i.keys===!1)return s;var u=s.read;return u?s.read=function(e){var t=u.call(this,e);return t&&(t.key=t.key.substring(n.length)),t}:s.on("data",function(e){e.key=e.key.substring(n.length)}),s},d.writeStream=d.createWriteStream=function(){var e=o(this),t=this.prefix(),n=e.createWriteStream.apply(e,arguments),r=n.write,i=this._options.encoding,s=this._options.valueEncoding,a=this._options.keyEncoding,u=!i&&!s&&!a;return n.write=u?function(e){return e.key=t+e.key,r.call(n,e)}:function(e){return e.key=t+e.key,i&&e.encoding===void 0&&(e.encoding=i),s&&e.valueEncoding===void 0&&(e.valueEncoding=s),a&&e.keyEncoding===void 0&&(e.keyEncoding=a),r.call(n,e)},n},d.approximateSize=function(){var e=o(db);return e.approximateSize.apply(e,arguments)},d.pre=function(e,t){t||(t=e,e=null),e=a.prefix(e,this.prefix(),this._options.sep);var n=o(this._parent),r=this.prefix();return n.hooks.pre(u(e),function(e,n,o){t({key:e.key.substring(r.length),value:e.value,type:e.type},function(e,t){n(e,e.prefix?t:t||r)},o)})},d.post=function(e,t){t||(t=e,e=null);var n=o(this._parent),r=this.prefix();return e=a.prefix(e,r,this._options.sep),n.hooks.post(u(e),function(e){t({key:e.key.substring(r.length),value:e.value,type:e.type})})},t.exports=n},{"./batch":62,events:9,"level-fix-range":64,"string-range":67,util:25,xtend:69}],75:[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,s=r.dispatchError;n.prototype.put=function(e,t,n){n=i(this._levelup,n);var s=r.encodeKey(e,n),a=r.encodeValue(t,n);try{this.batch.put(s,a)}catch(u){throw new o(u)}return this.ops.push({type:"put",key:s,value:a}),this},n.prototype.del=function(e,t){t=i(this._levelup,t);var n=r.encodeKey(e,t);try{this.batch.del(n)}catch(s){throw new o(s)}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?s(t,new o(r),e):(t.emit("batch",n),e&&e(),void 0)})}catch(r){throw new o(r)}},t.exports=n},{"./errors":76,"./util":79}],76:[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:113}],77:[function(e,t){(function(n){function r(e,t){return"function"==typeof e?e:t}function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);var i;if(s.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&&(r=t,t={}),(!t||"function"!=typeof t.db)&&"string"!=typeof e){if(i=new g("Must provide a location for the database"),r)return n.nextTick(function(){r(i)});throw i}t=_(this,t),this.options=u(E,t),this._status="new",c(this,"location",e,"e"),this.open(r)}function i(e){return function(t,n){k()[e](t,n||function(){})}}var s=e("events").EventEmitter,a=e("util").inherits,u=e("xtend"),c=e("prr"),l=e("deferred-leveldown"),d=e("./errors").WriteError,f=e("./errors").ReadError,h=e("./errors").NotFoundError,p=e("./errors").OpenError,v=e("./errors").EncodingError,g=e("./errors").InitializationError,m=e("./read-stream"),y=e("./write-stream"),b=e("./util"),w=e("./batch"),_=b.getOptions,E=b.defaultOptions,k=b.getLevelDOWN,S=b.dispatchError;a(o,s),o.prototype.open=function(e){var t,r,o=this;return this.isOpen()?(e&&n.nextTick(function(){e(null,o)}),this):this._isOpening()?e&&this.once("open",function(){e(null,o)}):(this.emit("opening"),this._status="opening",this.db=new l(this.location),t=this.options.db||k(),r=t(this.location),r.open(this.options,function(t){return t?S(o,new p(t),e):(o.db.setDb(r),o.db=r,o._status="open",e&&e(null,o),o.emit("open"),o.emit("ready"),void 0)}),void 0)},o.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 n.nextTick(e);"closing"==this._status&&e?this.once("closed",e):this._isOpening()&&this.once("open",function(){t.close(e)})}},o.prototype.isOpen=function(){return"open"==this._status},o.prototype._isOpening=function(){return"opening"==this._status},o.prototype.isClosed=function(){return/^clos/.test(this._status)},o.prototype.get=function(e,t,n){var o,i=this;return n=r(t,n),"function"!=typeof n?S(this,new f("get() requires key and callback arguments")):this._isOpening()||this.isOpen()?(t=b.getOptions(this,t),o=b.encodeKey(e,t),t.asBuffer=b.isValueAsBuffer(t),this.db.get(o,t,function(r,o){if(r)return r=/notfound/i.test(r)?new h("Key not found in database ["+e+"]",r):new f(r),S(i,r,n);if(n){try{o=b.decodeValue(o,t)}catch(s){return n(new v(s))}n(null,o)}}),void 0):S(this,new f("Database is not open"),n)},o.prototype.put=function(e,t,n,o){var i,s,a=this;return o=r(n,o),null===e||void 0===e||null===t||void 0===t?S(this,new d("put() requires key and value arguments"),o):this._isOpening()||this.isOpen()?(n=_(this,n),i=b.encodeKey(e,n),s=b.encodeValue(t,n),this.db.put(i,s,n,function(n){return n?S(a,new d(n),o):(a.emit("put",e,t),o&&o(),void 0)}),void 0):S(this,new d("Database is not open"),o)},o.prototype.del=function(e,t,n){var o,i=this;return n=r(t,n),null===e||void 0===e?S(this,new d("del() requires a key argument"),n):this._isOpening()||this.isOpen()?(t=_(this,t),o=b.encodeKey(e,t),this.db.del(o,t,function(t){return t?S(i,new d(t),n):(i.emit("del",e),n&&n(),void 0)}),void 0):S(this,new d("Database is not open"),n)},o.prototype.batch=function(e,t,n){var o,i,s,a=this;return arguments.length?(n=r(t,n),Array.isArray(e)?this._isOpening()||this.isOpen()?(t=_(this,t),o=t.keyEncoding,i=t.valueEncoding,s=e.map(function(e){if(void 0===e.type||void 0===e.key)return{};var n,r=e.keyEncoding||o,s=e.valueEncoding||e.encoding||i;
return"utf8"!=r&&"binary"!=r||"utf8"!=s&&"binary"!=s?(n={type:e.type,key:b.encodeKey(e.key,t,e)},void 0!==e.value&&(n.value=b.encodeValue(e.value,t,e)),n):e}),this.db.batch(s,t,function(t){return t?S(a,new d(t),n):(a.emit("batch",e),n&&n(),void 0)}),void 0):S(this,new d("Database is not open"),n):S(this,new d("batch() requires an array argument"),n)):new w(this)},o.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 f("approximateSize() requires start, end and callback arguments"),n):(r=b.encodeKey(e,this.options),o=b.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 d("Database is not open"),n))},o.prototype.readStream=o.prototype.createReadStream=function(e){var t=this;return e=u(this.options,e),new m(e,this,function(e){return t.db.iterator(e)})},o.prototype.keyStream=o.prototype.createKeyStream=function(e){return this.createReadStream(u(e,{keys:!0,values:!1}))},o.prototype.valueStream=o.prototype.createValueStream=function(e){return this.createReadStream(u(e,{keys:!1,values:!0}))},o.prototype.writeStream=o.prototype.createWriteStream=function(e){return new y(u(e),this)},o.prototype.toString=function(){return"LevelUP"},t.exports=o,t.exports.copy=b.copy,t.exports.destroy=i("destroy"),t.exports.repair=i("repair")}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"./batch":75,"./errors":76,"./read-stream":78,"./util":79,"./write-stream":80,"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11,"deferred-leveldown":95,events:9,prr:114,util:25,xtend:125}],78:[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=a.encodeKey(this._options.start,this._options)),this._options.end!==void 0&&(this._options.end=a.encodeKey(this._options.end,this._options)),"number"!=typeof this._options.limit&&(this._options.limit=-1),this._options.keyAsBuffer=a.isKeyAsBuffer(this._options),this._options.valueAsBuffer=a.isValueAsBuffer(this._options),this._makeData=this._options.keys&&this._options.values?c:this._options.keys?l:this._options.values?d:f;var s=this;this._db.isOpen()?this._iterator=o(this._options):this._db.once("ready",function(){s._iterator=o(s._options)})}var r=e("readable-stream").Readable,o=e("util").inherits,i=e("xtend"),s=e("./errors").EncodingError,a=e("./util"),u={keys:!0,values:!0},c=function(e,t){return{key:a.decodeKey(e,this._options),value:a.decodeValue(t,this._options)}},l=function(e){return a.decodeKey(e,this._options)},d=function(e,t){return a.decodeValue(t,this._options)},f=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 s(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":76,"./util":79,"readable-stream":123,util:25,xtend:125}],79:[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),v(e&&e.options||{},n?_[t]||_[b.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 g(r)}if(!e("semver").satisfies(t,n))throw new g("Installed version of LevelDOWN ("+t+") does not match required version ("+n+")");try{return p=e("leveldown")}catch(o){throw new g(r)}}function i(e,t,n){return"function"==typeof n?n(t):e.emit("error",t)}function s(e,t){var n=t&&t.keyEncoding||e.keyEncoding||"utf8";return w[n]||n}function a(e,t){var n=t&&(t.valueEncoding||t.encoding)||e.valueEncoding||e.encoding||"utf8";return w[n]||n}function u(e,t,n){return s(t,n).encode(e)}function c(e,t,n){return a(t,n).encode(e)}function l(e,t){return s(t).decode(e)}function d(e,t){return a(t).decode(e)}function f(e,t){return a(e,t).buffer}function h(e,t){return s(e,t).buffer}var p,v=e("xtend"),g=e("./errors").LevelUPError,m=e("bops"),y=["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le"],b={createIfMissing:!0,errorIfExists:!1,keyEncoding:"utf8",valueEncoding:"utf8",compression:!0},w=function(){function e(e){return void 0===e||null===e||m.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"},y.forEach(function(n){t[n]||(t[n]={encode:function(t){return e(t)?t:m.from(t,n)},decode:function(e){return m.from(e,n)},buffer:!0,type:n})}),t}(),_=function(){var e={};return y.forEach(function(t){e[t]={valueEncoding:t}}),e}();t.exports={defaultOptions:b,copy:n,getOptions:r,getLevelDOWN:o,dispatchError:i,encodeKey:u,encodeValue:c,isValueAsBuffer:f,isKeyAsBuffer:h,decodeValue:d,decodeKey:l}},{"../package.json":130,"./errors":76,bops:81,leveldown:2,"leveldown/package":2,semver:2,xtend:125}],80:[function(e,t){(function(n,r){function o(e,t){if(!(this instanceof o))return new o(e,t);i.call(this),this._options=a(d,l(t,e)),this._db=t,this._buffer=[],this._status="init",this._end=!1,this.writable=!0,this.readable=!1;var n=this,r=function(){n.writable&&(n._status="ready",n.emit("ready"),n._process())};t.isOpen()?c(r):t.once("ready",r)}var i=e("stream").Stream,s=e("util").inherits,a=e("xtend"),u=e("concat-stream"),c=r.setImmediate||n.nextTick,l=e("./util").getOptions,d={type:"put"};s(o,i),o.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},o.prototype.end=function(e){var t=this;e&&this.write(e),c(function(){t._end=!0,t._process()})},o.prototype.destroy=function(){this.writable=!1,this.end()},o.prototype.destroySoon=function(){this.end()},o.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},o.prototype._processDelayed=function(){var e=this;c(function(){e._process()})},o.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)},o.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)}))},o.prototype.toString=function(){return"LevelUP.WriteStream"},t.exports=o}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./util":79,"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11,"concat-stream":94,stream:17,util:25,xtend:125}],81:[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":84,"./create.js":85,"./from.js":86,"./is.js":87,"./join.js":88,"./read.js":90,"./subarray.js":91,"./to.js":92,"./write.js":93}],82:[function(e,t){(function(){"use strict";function e(e){var t,n,o,i,s,a;if(e.length%4>0)throw"Invalid string. Length must be a multiple of 4";for(s=e.indexOf("="),s=s>0?e.length-s:0,a=[],o=s>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]),a.push((16711680&i)>>16),a.push((65280&i)>>8),a.push(255&i);return 2===s?(i=r.indexOf(e[t])<<2|r.indexOf(e[t+1])>>4,a.push(255&i)):1===s&&(i=r.indexOf(e[t])<<10|r.indexOf(e[t+1])<<4|r.indexOf(e[t+2])>>2,a.push(255&i>>8),a.push(255&i)),a}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,s=e.length%3,a="";for(n=0,i=e.length-s;i>n;n+=3)o=(e[n]<<16)+(e[n+1]<<8)+e[n+2],a+=t(o);switch(s){case 1:o=e[e.length-1],a+=r[o>>2],a+=r[63&o<<4],a+="==";break;case 2:o=(e[e.length-2]<<8)+e[e.length-1],a+=r[o>>10],a+=r[63&o>>4],a+=r[63&o<<2],a+="="}return a}var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports.toByteArray=e,t.exports.fromByteArray=n})()},{}],83:[function(e,t){function n(e,t,n){t=void 0===t?0:t,n=void 0===n?e.length:n;var u,l,d=0,f=128,h=0;for(s.length=i.length=0;e.length>d;)l=e[d],!h&&l&f?(u=r(l),h+=u,8>u&&(s[s.length]=l&c[6-u])):h?(s[s.length]=l&c[6],--h,!h&&s.length&&(i[i.length]=a(o(s,u)),s.length=0)):i[i.length]=a(l),++d;return s.length&&!h&&(i[i.length]=a(o(s,u)),s.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=[],s=[],a=String.fromCharCode,u=[64,32,16,8,4,2,1],c=[0,1,3,7,15,31,63,127]},{}],84:[function(e,t){function n(e,t,n,i,s){return n=3>arguments.length?0:n,i=4>arguments.length?0:i,s=5>arguments.length?e.length:s,s!==i&&0!==t.length&&0!==e.length?(s>e.length&&(s=e.length),s-i>t.length-n&&(s=t.length-n+i),e.buffer!==t.buffer?r(e,t,n,i,s):o(e,t,n,i,s)):void 0}function r(e,t,n,r,o){for(var i=o-r+n,s=n,a=r;i>s;++s,++a)t[s]=e[a]}function o(e,t,n,r,o){for(var s=o+r,a=new Uint8Array(i.call(e,r,s)),u=0;s>r;++r,++u)t[n++]=a[u]}t.exports=n;var i=[].slice},{}],85:[function(e,t){t.exports=function(e){return new Uint8Array(e)}},{}],86:[function(e,t){function n(e,t){return Array.isArray(e)?new Uint8Array(e):c[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=s(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,s=t,a=0;do++a;while(s>>>=1);for(n=0|Math.ceil((a-1)/5),r=[0,0,192,224,240,248,252][n],i=[0,0,3,4,5,6,7][n],o|=r,a=7-i+6*(n-1);a;)o|=+!!(t&1<<a)<<7-i,++i,0===i%8&&(e[e.length]=o,o=128,i=2),--a;i&&(o|=+!!(1&t)<<7-i,e[e.length]=o)}function s(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 a(e){return new Uint8Array(u.toByteArray(e))}t.exports=n;var u=e("base64-js"),c={hex:r,utf8:o,base64:a}},{"base64-js":82}],87:[function(e,t){t.exports=function(e){return e instanceof Uint8Array}},{}],88:[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],s=i.length,a=0,u=0,c=0;n>c;)u!==s?o[c++]=i[u++]:(u=0,++a,i=e[a],s=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},{}],89:[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},{}],90:[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=g.get(e);return n.getUint16(t+e.byteOffset,!0)}function i(e,t){var n=g.get(e);return n.getUint32(t+e.byteOffset,!0)}function s(e,t){var n=g.get(e);return n.getInt16(t+e.byteOffset,!0)}function a(e,t){var n=g.get(e);return n.getInt32(t+e.byteOffset,!0)}function u(e,t){var n=g.get(e);return n.getFloat32(t+e.byteOffset,!0)}function c(e,t){var n=g.get(e);return n.getFloat64(t+e.byteOffset,!0)}function l(e,t){var n=g.get(e);return n.getUint16(t+e.byteOffset,!1)}function d(e,t){var n=g.get(e);return n.getUint32(t+e.byteOffset,!1)}function f(e,t){var n=g.get(e);return n.getInt16(t+e.byteOffset,!1)}function h(e,t){var n=g.get(e);return n.getInt32(t+e.byteOffset,!1)}function p(e,t){var n=g.get(e);return n.getFloat32(t+e.byteOffset,!1)}function v(e,t){var n=g.get(e);return n.getFloat64(t+e.byteOffset,!1)}t.exports={readUInt8:n,readInt8:r,readUInt16LE:o,readUInt32LE:i,readInt16LE:s,readInt32LE:a,readFloatLE:u,readDoubleLE:c,readUInt16BE:l,readUInt32BE:d,readInt16BE:f,readInt32BE:h,readFloatBE:p,readDoubleBE:v};var g=e("./mapped.js")},{"./mapped.js":89}],91:[function(e,t){function n(e,t,n){return e.subarray(t||0,n||e.length)}t.exports=n},{}],92:[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 a(e)}function i(e){return s.fromByteArray(e)}t.exports=n;var s=e("base64-js"),a=e("to-utf8"),u={hex:r,utf8:o,base64:i}},{"base64-js":82,"to-utf8":83}],93:[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=g.get(e);return r.setUint16(n+e.byteOffset,t,!0)}function i(e,t,n){var r=g.get(e);return r.setUint32(n+e.byteOffset,t,!0)}function s(e,t,n){var r=g.get(e);return r.setInt16(n+e.byteOffset,t,!0)}function a(e,t,n){var r=g.get(e);return r.setInt32(n+e.byteOffset,t,!0)}function u(e,t,n){var r=g.get(e);return r.setFloat32(n+e.byteOffset,t,!0)}function c(e,t,n){var r=g.get(e);return r.setFloat64(n+e.byteOffset,t,!0)}function l(e,t,n){var r=g.get(e);return r.setUint16(n+e.byteOffset,t,!1)}function d(e,t,n){var r=g.get(e);return r.setUint32(n+e.byteOffset,t,!1)}function f(e,t,n){var r=g.get(e);return r.setInt16(n+e.byteOffset,t,!1)}function h(e,t,n){var r=g.get(e);return r.setInt32(n+e.byteOffset,t,!1)}function p(e,t,n){var r=g.get(e);return r.setFloat32(n+e.byteOffset,t,!1)}function v(e,t,n){var r=g.get(e);return r.setFloat64(n+e.byteOffset,t,!1)}t.exports={writeUInt8:n,writeInt8:r,writeUInt16LE:o,writeUInt32LE:i,writeInt16LE:s,writeInt32LE:a,writeFloatLE:u,writeDoubleLE:c,writeUInt16BE:l,writeUInt32BE:d,writeInt16BE:f,writeInt32BE:h,writeFloatBE:p,writeDoubleBE:v};var g=e("./mapped.js")},{"./mapped.js":89}],94:[function(e,t){(function(n){function r(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 o=e("stream"),i=e("util");i.inherits(r,o.Stream),r.prototype.write=function(e){this.body.push(e)},r.prototype.destroy=function(){},r.prototype.arrayConcat=function(e){return 0===e.length?[]:1===e.length?e[0]:e.reduce(function(e,t){return e.concat(t)})},r.prototype.isArray=function(e){return Array.isArray(e)},r.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):n!==void 0&&n.isBuffer(this.body[0])?n.concat(this.body):this.body:void 0},r.prototype.end=function(){this.cb&&this.cb(!1,this.getBody())},t.exports=function(e){return new r(e)},t.exports.ConcatStream=r}).call(this,e("buffer").Buffer)},{buffer:12,stream:17,util:25}],95:[function(e,t){(function(n){function r(e){s.call(this,"string"==typeof e?e:""),this._db=void 0,this._operations=[]}var o=e("util"),i=e("bops"),s=e("abstract-leveldown").AbstractLevelDOWN;o.inherits(r,s),r.prototype.setDb=function(e){this._db=e,this._operations.forEach(function(t){e[t.method].apply(e,t.args)})},r.prototype._open=function(e,t){return n.nextTick(t)},r.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){r.prototype["_"+e]=function(){this._operation(e,arguments)}}),r.prototype._isBuffer=function(e){return i.is(e)},r.prototype._iterator=function(){throw new TypeError("not implemented")},t.exports=r}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11,"abstract-leveldown":98,bops:99,util:25}],96:[function(e,t){t.exports=e(51)},{"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11}],97:[function(e,t){t.exports=e(52)},{"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11}],98:[function(e,t){(function(n,r){function o(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 i=e("./abstract-iterator"),s=e("./abstract-chained-batch");o.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):(n.nextTick(t),void 0)},o.prototype.close=function(e){if("function"!=typeof e)throw Error("close() requires a callback argument");return"function"==typeof this._close?this._close(e):(n.nextTick(e),void 0)},o.prototype.get=function(e,t,r){var o=this;if("function"==typeof t&&(r=t),"function"!=typeof r)throw Error("get() requires a callback argument");var i=o._checkKeyValue(e,"key",o._isBuffer);return i?r(i):(o._isBuffer(e)||(e+=""),"object"!=typeof t&&(t={}),"function"==typeof o._get?o._get(e,t,r):(n.nextTick(function(){r(Error("NotFound"))}),void 0))},o.prototype.put=function(e,t,r,o){if("function"==typeof r&&(o=r),"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)||n.browser||(t+=""),"object"!=typeof r&&(r={}),"function"==typeof this._put?this._put(e,t,r,o):(n.nextTick(o),void 0))},o.prototype.del=function(e,t,r){if("function"==typeof t&&(r=t),"function"!=typeof r)throw Error("del() requires a callback argument");var o=this._checkKeyValue(e,"key",this._isBuffer);return o?r(o):(this._isBuffer(e)||(e+=""),"object"!=typeof t&&(t={}),"function"==typeof this._del?this._del(e,t,r):(n.nextTick(r),void 0))},o.prototype.batch=function(e,t,r){if(!arguments.length)return this._chainedBatch();if("function"==typeof t&&(r=t),"function"!=typeof r)throw Error("batch(array) requires a callback argument");if(!Array.isArray(e))return r(Error("batch(array) requires an array argument"));"object"!=typeof t&&(t={});for(var o,i,s=0,a=e.length;a>s;s++)if(o=e[s],"object"==typeof o){if(i=this._checkKeyValue(o.type,"type",this._isBuffer))return r(i);if(i=this._checkKeyValue(o.key,"key",this._isBuffer))return r(i);if("put"==o.type&&(i=this._checkKeyValue(o.value,"value",this._isBuffer)))return r(i)}return"function"==typeof this._batch?this._batch(e,t,r):(n.nextTick(r),void 0)},o.prototype.approximateSize=function(e,t,r){if(null==e||null==t||"function"==typeof e||"function"==typeof t)throw Error("approximateSize() requires valid `start`, `end` and `callback` arguments");if("function"!=typeof r)throw Error("approximateSize() requires a callback argument");return this._isBuffer(e)||(e+=""),this._isBuffer(t)||(t+=""),"function"==typeof this._approximateSize?this._approximateSize(e,t,r):(n.nextTick(function(){r(null,0)}),void 0)},o.prototype.iterator=function(e){return"object"!=typeof e&&(e={}),"function"==typeof this._iterator?this._iterator(e):new i(this)},o.prototype._chainedBatch=function(){return new s(this)},o.prototype._isBuffer=function(e){return r.isBuffer(e)},o.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=o,t.exports.AbstractIterator=i,t.exports.AbstractChainedBatch=s}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),e("buffer").Buffer)},{"./abstract-chained-batch":96,"./abstract-iterator":97,"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11,buffer:12}],99:[function(e,t,n){arguments[4][81][0].apply(n,arguments)},{"./copy.js":102,"./create.js":103,"./from.js":104,"./is.js":105,"./join.js":106,"./read.js":108,"./subarray.js":109,"./to.js":110,"./write.js":111}],100:[function(e,t){t.exports=e(82)},{}],101:[function(e,t){t.exports=e(83)},{}],102:[function(e,t){t.exports=e(84)},{}],103:[function(e,t){t.exports=e(85)},{}],104:[function(e,t){function n(e,t){return Array.isArray(e)?new Uint8Array(e):a[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 s=0,a=t.length;a>s;++s)r[r.length]=parseInt(t[s],16)}else r[r.length]=n;return new Uint8Array(r)}function i(e){return new Uint8Array(s.toByteArray(e))}t.exports=n;var s=e("base64-js"),a={hex:r,utf8:o,base64:i}},{"base64-js":100}],105:[function(e,t){t.exports=e(87)},{}],106:[function(e,t){t.exports=e(88)},{}],107:[function(e,t){t.exports=e(89)},{}],108:[function(e,t){t.exports=e(90)},{"./mapped.js":107}],109:[function(e,t){t.exports=e(91)},{}],110:[function(e,t){t.exports=e(92)},{"base64-js":100,"to-utf8":101}],111:[function(e,t){t.exports=e(93)},{"./mapped.js":107}],112:[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}var 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:114}],113:[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":112}],114:[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 s;if(i=t(o,i),"object"==typeof r){for(s in r)Object.hasOwnProperty.call(r,s)&&(i.value=r[s],e(n,s,i));return n}return e(n,r,i)};return n})},{}],115:[function(e,t){(function(n){function r(e){return this instanceof r?(u.call(this,e),c.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",o),void 0):new r(e)}function o(){this.allowHalfOpen||this._writableState.ended||n.nextTick(this.end.bind(this))}function i(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n],n)}t.exports=r;var s=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},a=e("core-util-is");a.inherits=e("inherits");var u=e("./_stream_readable"),c=e("./_stream_writable");a.inherits(r,u),i(s(c.prototype),function(e){r.prototype[e]||(r.prototype[e]=c.prototype[e])})}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"./_stream_readable":117,"./_stream_writable":119,"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11,"core-util-is":120,inherits:48}],116:[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("core-util-is");o.inherits=e("inherits"),o.inherits(n,r),n.prototype._transform=function(e,t,n){n(null,e)}},{"./_stream_transform":118,"core-util-is":120,inherits:48}],117:[function(e,t){(function(n){function r(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&&(A||(A=e("string_decoder/").StringDecoder),this.decoder=new A(t.encoding),this.encoding=t.encoding)
}function o(e){return this instanceof o?(this._readableState=new r(e,this),this.readable=!0,j.call(this),void 0):new o(e)}function i(e,t,n,r,o){var i=c(t,n);if(i)e.emit("error",i);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 a=Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&o){var a=Error("stream.unshift() after end event");e.emit("error",a)}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&&d(e),h(e,t);else o||(t.reading=!1);return s(t)}function s(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function a(e){if(e>=L)e=L;else{e--;for(var t=1;32>t;t<<=1)e|=e>>t;e++}return e}function u(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 c(e,t){var n=null;return S.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?d(e):w(e)}function d(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,t.sync?n.nextTick(function(){f(e)}):f(e))}function f(e){e.emit("readable")}function h(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(function(){p(e,t)}))}function p(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 v(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,t),e.emit("data",n),r.awaitDrain>0)return;return 0===r.pipesCount?(r.flowing=!1,x.listenerCount(e,"data")>0&&y(e),void 0):(r.ranOut=!0,void 0)}function m(){this._readableState.ranOut&&(this._readableState.ranOut=!1,g(this))}function y(e,t){var r=e._readableState;if(r.flowing)throw Error("Cannot switch to old mode now.");var o=t||!1,i=!1;e.readable=!0,e.pipe=j.prototype.pipe,e.on=e.addListener=j.prototype.on,e.on("readable",function(){i=!0;for(var t;!o&&null!==(t=e.read());)e.emit("data",t);null===t&&(i=!1,e._readableState.needReadable=!0)}),e.pause=function(){o=!0,this.emit("pause")},e.resume=function(){o=!1,i?n.nextTick(function(){e.emit("readable")}):this.read(0),this.emit("resume")},e.emit("readable")}function b(e,t){var n,r=t.buffer,o=t.length,i=!!t.decoder,s=!!t.objectMode;if(0===r.length)return null;if(0===o)n=null;else if(s)n=r.shift();else if(!e||e>=o)n=i?r.join(""):S.concat(r,o),r.length=0;else if(r[0].length>e){var a=r[0];n=a.slice(0,e),r[0]=a.slice(e)}else if(e===r[0].length)n=r.shift();else{n=i?"":new S(e);for(var u=0,c=0,l=r.length;l>c&&e>u;c++){var a=r[0],d=Math.min(e-u,a.length);i?n+=a.slice(0,d):a.copy(n,u,0,d),a.length>d?r[0]=a.slice(d):r.shift(),u+=d}}return n}function w(e){var t=e._readableState;if(t.length>0)throw Error("endReadable called on non-empty stream");!t.endEmitted&&t.calledRead&&(t.ended=!0,n.nextTick(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function _(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n],n)}function E(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}t.exports=o;var k=e("isarray"),S=e("buffer").Buffer;o.ReadableState=r;var x=e("events").EventEmitter;x.listenerCount||(x.listenerCount=function(e,t){return e.listeners(t).length});var j=e("stream"),O=e("core-util-is");O.inherits=e("inherits");var A;O.inherits(o,j),o.prototype.push=function(e,t){var n=this._readableState;return"string"!=typeof e||n.objectMode||(t=t||n.defaultEncoding,t!==n.encoding&&(e=new S(e,t),t="")),i(this,n,e,t,!1)},o.prototype.unshift=function(e){var t=this._readableState;return i(this,t,e,"",!0)},o.prototype.setEncoding=function(t){A||(A=e("string_decoder/").StringDecoder),this._readableState.decoder=new A(t),this._readableState.encoding=t};var L=8388608;o.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 d(this),null;if(e=u(e,t),0===e&&t.ended)return 0===t.length&&w(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=u(n,t));var o;return o=e>0?b(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&&w(this),o},o.prototype._read=function(){this.emit("error",Error("not implemented"))},o.prototype.pipe=function(e,t){function r(e){e===l&&i()}function o(){e.end()}function i(){e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("drain",p),e.removeListener("error",s),e.removeListener("unpipe",r),l.removeListener("end",o),l.removeListener("end",i),(!e._writableState||e._writableState.needDrain)&&p()}function s(t){c(),e.removeListener("error",s),0===x.listenerCount(e,"error")&&e.emit("error",t)}function a(){e.removeListener("finish",u),c()}function u(){e.removeListener("close",a),c()}function c(){l.unpipe(e)}var l=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1;var f=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr,h=f?o:i;d.endEmitted?n.nextTick(h):l.once("end",h),e.on("unpipe",r);var p=v(l);return e.on("drain",p),e._events&&e._events.error?k(e._events.error)?e._events.error.unshift(s):e._events.error=[s,e._events.error]:e.on("error",s),e.once("close",a),e.once("finish",u),e.emit("pipe",l),d.flowing||(this.on("readable",m),d.flowing=!0,n.nextTick(function(){g(l)})),e},o.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",m),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",m),t.flowing=!1;for(var o=0;r>o;o++)n[o].emit("unpipe",this);return this}var o=E(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)},o.prototype.on=function(e,t){var n=j.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||y(this),"readable"===e&&this.readable){var r=this._readableState;r.readableListening||(r.readableListening=!0,r.emittedReadable=!1,r.needReadable=!0,r.reading?r.length&&d(this,r):this.read(0))}return n},o.prototype.addListener=o.prototype.on,o.prototype.resume=function(){y(this),this.read(0),this.emit("resume")},o.prototype.pause=function(){y(this,!0),this.emit("pause")},o.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,function(t){e.on(t,r.emit.bind(r,t))}),r._read=function(){n&&(n=!1,e.resume())},r},o._fromList=b}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11,buffer:12,"core-util-is":120,events:9,inherits:48,isarray:121,stream:17,"string_decoder/":122}],118:[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);s.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 s=e("./_stream_duplex"),a=e("core-util-is");a.inherits=e("inherits"),a.inherits(o,s),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.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;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0}},{"./_stream_duplex":115,"core-util-is":120,inherits:48}],119:[function(e,t){(function(n){function r(e,t,n){this.chunk=e,this.encoding=t,this.callback=n}function o(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){h(t,e)},this.writecb=null,this.writelen=0,this.buffer=[],this.errorEmitted=!1}function i(t){var n=e("./_stream_duplex");return this instanceof i||this instanceof n?(this._writableState=new o(t,this),this.writable=!0,E.call(this),void 0):new i(t)}function s(e,t,r){var o=Error("write after end");e.emit("error",o),n.nextTick(function(){r(o)})}function a(e,t,r,o){var i=!0;if(!w.isBuffer(r)&&"string"!=typeof r&&null!==r&&void 0!==r&&!t.objectMode){var s=new TypeError("Invalid non-string/buffer chunk");e.emit("error",s),n.nextTick(function(){o(s)}),i=!1}return i}function u(e,t,n){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=new w(t,n)),t}function c(e,t,n,o,i){n=u(t,n,o),w.isBuffer(n)&&(o="buffer");var s=t.objectMode?1:n.length;t.length+=s;var a=t.length<t.highWaterMark;return a||(t.needDrain=!0),t.writing?t.buffer.push(new r(n,o,i)):l(e,t,s,n,o,i),a}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 d(e,t,r,o,i){r?n.nextTick(function(){i(o)}):i(o),e._writableState.errorEmitted=!0,e.emit("error",o)}function f(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function h(e,t){var r=e._writableState,o=r.sync,i=r.writecb;if(f(r),t)d(e,r,o,t,i);else{var s=m(e,r);s||r.bufferProcessing||!r.buffer.length||g(e,r),o?n.nextTick(function(){p(e,r,s,i)}):p(e,r,s,i)}}function p(e,t,n,r){n||v(e,t),r(),n&&y(e,t)}function v(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,s=r.callback,a=t.objectMode?1:o.length;if(l(e,t,a,o,i,s),t.writing){n++;break}}t.bufferProcessing=!1,t.buffer.length>n?t.buffer=t.buffer.slice(n):t.buffer.length=0}function m(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function y(e,t){var n=m(e,t);return n&&(t.finished=!0,e.emit("finish")),n}function b(e,t,r){t.ending=!0,y(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0}t.exports=i;var w=e("buffer").Buffer;i.WritableState=o;var _=e("core-util-is");_.inherits=e("inherits");var E=e("stream");_.inherits(i,E),i.prototype.pipe=function(){this.emit("error",Error("Cannot pipe. Not readable."))},i.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?s(this,r,n):a(this,r,e,n)&&(o=c(this,r,e,t,n)),o},i.prototype._write=function(e,t,n){n(Error("not implemented"))},i.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||b(this,r,n)}}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"./_stream_duplex":115,"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11,buffer:12,"core-util-is":120,inherits:48,stream:17}],120:[function(e,t,n){(function(e){function t(e){return Array.isArray(e)}function r(e){return"boolean"==typeof e}function o(e){return null===e}function i(e){return null==e}function s(e){return"number"==typeof e}function a(e){return"string"==typeof e}function u(e){return"symbol"==typeof e}function c(e){return void 0===e}function l(e){return d(e)&&"[object RegExp]"===m(e)}function d(e){return"object"==typeof e&&null!==e}function f(e){return d(e)&&"[object Date]"===m(e)}function h(e){return d(e)&&("[object Error]"===m(e)||e instanceof Error)}function p(e){return"function"==typeof e}function v(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||e===void 0}function g(t){return e.isBuffer(t)}function m(e){return Object.prototype.toString.call(e)}n.isArray=t,n.isBoolean=r,n.isNull=o,n.isNullOrUndefined=i,n.isNumber=s,n.isString=a,n.isSymbol=u,n.isUndefined=c,n.isRegExp=l,n.isObject=d,n.isDate=f,n.isError=h,n.isFunction=p,n.isPrimitive=v,n.isBuffer=g}).call(this,e("buffer").Buffer)},{buffer:12}],121:[function(e,t){t.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},{}],122:[function(e,t,n){function r(e){if(e&&!u(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 s(e){var t=this.charReceived=e.length%3;return this.charLength=t?3:0,t}var a=e("buffer").Buffer,u=a.isEncoding||function(e){switch(e&&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}},c=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=s;break;default:return this.write=o,void 0}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};c.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),s=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-i,s),this.charReceived=i,s-=i),t+=e.toString(this.encoding,0,s);var s=t.length-1,o=t.charCodeAt(s);if(o>=55296&&56319>=o){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),this.charBuffer.write(t.charAt(t.length-1),this.encoding),t.substring(0,s)}return t},c.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},c.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:12}],123:[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":115,"./lib/_stream_passthrough.js":116,"./lib/_stream_readable.js":117,"./lib/_stream_transform.js":118,"./lib/_stream_writable.js":119}],124:[function(e,t){t.exports=e(56)},{}],125:[function(e,t,n){arguments[4][57][0].apply(n,arguments)},{"./has-keys":124,"object-keys":127}],126:[function(e,t){t.exports=e(58)},{}],127:[function(e,t,n){arguments[4][59][0].apply(n,arguments)},{"./shim":129}],128:[function(e,t){t.exports=e(60)},{}],129:[function(e,t){t.exports=e(61)},{"./foreach":126,"./isArguments":128}],130:[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.2"}
},{}],131:[function(e,t){"use strict";function n(){}t.exports=n},{}],132:[function(e,t){"use strict";var n=e("./INTERNAL"),r=e("./promise"),o=e("./reject"),i=e("./resolve");t.exports=function(e){function t(e,t){i(e).then(function(e){a[t]=e,++u===s&&l.resolve(a)},function(e){l.reject(e)})}if("[object Array]"!==Object.prototype.toString.call(e))return o(new TypeError("must be an array"));var s=e.length;if(!s)return i([]);for(var a=[],u=0,c=-1,l=new r(n);s>++c;)t(e[c],c);return l}},{"./INTERNAL":131,"./promise":136,"./reject":137,"./resolve":138}],133:[function(e,t){"use strict";function n(e){var t=e&&e.then;return e&&"object"==typeof e&&"function"==typeof t?function(){t.apply(e,arguments)}:void 0}t.exports=n},{}],134:[function(e,t,n){t.exports=n=e("./promise"),n.resolve=e("./resolve"),n.reject=e("./reject"),n.all=e("./all")},{"./all":132,"./promise":136,"./reject":137,"./resolve":138}],135:[function(e,t){"use strict";function n(){var e=0;return function(t){return function(){e++||t.apply(this,arguments)}}}t.exports=n},{}],136:[function(e,t){"use strict";function n(e){if(!(this instanceof n))return new n(e);if("function"!=typeof e)throw new TypeError("reslover must be a function");this.state=c,this.queue=[],e!==i&&r(this,e)}function r(e,t){var n=s(),r=n(function(t){return e.reject(t)}),o=a(function(){t(n(function(t){return e.resolve(t)}),r)});"error"===o.status&&r(o.value)}var o=e("./unwrap"),i=e("./INTERNAL"),s=e("./once"),a=e("./tryCatch"),u=e("./getThen"),c=["PENDING"],l=["FULFILLED"],d=["REJECTED"];t.exports=n,n.prototype.resolve=function(e){var t=a(u,e);if("error"===t.status)return this.reject(t.value);var n=t.value;if(n)r(this,n);else{this.state=l,this.outcome=e;for(var o=-1,i=this.queue.length;i>++o;)this.queue[o].callFulfilled(e)}return this},n.prototype.reject=function(e){this.state=d,this.outcome=e;for(var t=-1,n=this.queue.length;n>++t;)this.queue[t].callRejected(e);return this},n.prototype["catch"]=function(e){return this.then(null,e)},n.prototype.then=function(e,t){var r="function"==typeof e,s="function"==typeof t;if(!r&&this.state===l||!t&&this.state===d)return this;var a=new n(i),u={promise:a};return this.state!==d&&(u.callFulfilled=r?function(t){o(a,e,t)}:function(e){a.resolve(e)}),this.state!==l&&(u.callRejected=s?function(e){o(a,t,e)}:function(e){a.reject(e)}),this.state===l?u.callFulfilled(this.outcome):this.state===d?u.callRejected(this.outcome):this.queue.push(u),a}},{"./INTERNAL":131,"./getThen":133,"./once":135,"./tryCatch":139,"./unwrap":140}],137:[function(e,t){"use strict";function n(e){var t=new r(o);return t.reject(e)}var r=e("./promise"),o=e("./INTERNAL");t.exports=n},{"./INTERNAL":131,"./promise":136}],138:[function(e,t){"use strict";function n(e){if(e)return new r(o).resolve(e);var t=typeof e;switch(t){case"boolean":return i;case"undefined":return a;case"object":return s;case"number":return u;case"string":return c}}var r=e("./promise"),o=e("./INTERNAL");t.exports=n;var i=new r(o).resolve(!1),s=new r(o).resolve(null),a=new r(o).resolve(void 0),u=new r(o).resolve(0),c=new r(o).resolve("")},{"./INTERNAL":131,"./promise":136}],139:[function(e,t){"use strict";function n(e,t){var n={};try{n.value=e(t),n.status="success"}catch(r){n.status="error",n.value=r}return n}t.exports=n},{}],140:[function(e,t){"use strict";function n(e,t,n){r(function(){var r;try{r=t(n)}catch(o){return e.reject(o)}r===e?e.reject(new TypeError("Cannot resolve promise with itself")):e.resolve(r)})}var r=e("immediate");t.exports=n},{immediate:142}],141:[function(e,t,n){"use strict";n.test=function(){return!1}},{}],142:[function(e,t){"use strict";function n(){var e,t=0,n=i;for(i=[];e=n[t++];)e()}for(var r,o=[e("./nextTick"),e("./mutation"),e("./postMessage"),e("./messageChannel"),e("./stateChange"),e("./timeout")],i=[],s=-1,a=o.length;a>++s;)if(o[s].test()){r=o[s].install(n);break}t.exports=function(e){var t,o,s,a=e;if(arguments.length>1&&"function"==typeof e){for(s=Array(arguments.length-1),o=0;++o<arguments.length;)s[o-1]=arguments[o];a=function(){e.apply(void 0,s)}}return 1===(t=i.push(a))&&r(n),t},t.exports.clear=function(e){return i.length>=e&&(i[e-1]=function(){}),this}},{"./messageChannel":143,"./mutation":144,"./nextTick":141,"./postMessage":145,"./stateChange":146,"./timeout":147}],143:[function(e,t,n){(function(e){"use strict";n.test=function(){return e.MessageChannel!==void 0},n.install=function(t){var n=new e.MessageChannel;return n.port1.onmessage=t,function(){n.port2.postMessage(0)}}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],144:[function(e,t,n){(function(e){"use strict";var t=e.MutationObserver||e.WebKitMutationObserver;n.test=function(){return t},n.install=function(n){var r=new t(n),o=e.document.createElement("div");return r.observe(o,{attributes:!0}),e.addEventListener("unload",function(){r.disconnect(),r=null},!1),function(){o.setAttribute("drainQueue","drainQueue")}}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],145:[function(e,t,n){(function(e){"use strict";n.test=function(){if(!e.postMessage||e.importScripts)return!1;var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t},n.install=function(t){function n(n){n.source===e&&n.data===r&&t()}var r="com.calvinmetcalf.setImmediate"+Math.random();return e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),function(){e.postMessage(r,"*")}}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],146:[function(e,t,n){(function(e){"use strict";n.test=function(){return"document"in e&&"onreadystatechange"in e.document.createElement("script")},n.install=function(t){return function(){var n=e.document.createElement("script");return n.onreadystatechange=function(){t(),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},e.document.documentElement.appendChild(n),t}}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],147:[function(e,t,n){"use strict";n.test=function(){return!0},n.install=function(e){return function(){setTimeout(e,0)}}},{}],148:[function(require,module,exports){"use strict";module.exports=function(func,emit,sum,log,isArray,toJSON){return eval("'use strict'; ("+func+");")}},{}],149:[function(e,t,n){(function(t,r){"use strict";function o(e){for(var t={},n=0,r=e.length;r>n;n++){var o=m(e[n]),i=t[o];i===void 0?t[o]=n:"number"==typeof i?t[o]=[i,n]:i.push(n)}return t}function i(e,t){var n=p(e.id,t.id);return 0!==n?n:p(e.value,t.value)}function s(e,t,n){var r=n[e];r===void 0?n[e]=t:Array.isArray(r)?r.push(t):n[e]=[r,t]}function a(e){return e.reduce(function(e,t){return e+t},0)}function u(e,t,n,r){var o=t[e];o!==void 0&&(r&&(o=encodeURIComponent(JSON.stringify(o))),n.push(e+"="+o))}function c(e,t,n){var r=Array(t.length);e.forEach(function(e){var t=n[m(e.key)];"number"==typeof t?s(t,e,r):t.forEach(function(t){s(t,e,r)})});var o=[];return r.forEach(function(e){Array.isArray(e)?o=o.concat(e.sort(i)):o.push(e)}),o}function l(e,t,n){function r(t,r){var s={id:u.doc._id,key:t,value:r};if(!(n.startkey!==void 0&&0>p(t,n.startkey)||n.endkey!==void 0&&p(t,n.endkey)>0||void 0!==n.key&&0!==p(t,n.key)||void 0!==n.keys&&(l=l||o(n.keys),void 0===l[m(t)]))){if(f++,n.include_docs){if(r&&"object"==typeof r&&r._id)return e.get(r._id,function(e,t){t&&(s.doc=t),d.push(s),i()}),void 0;s.doc=u.doc}d.push(s)}}function i(){var e;if(h&&d.length===f){if(n.keys!==void 0&&d.length?d=c(d,n.keys,l):d.sort(function(e,t){var n=p(e.key,t.key);return 0!==n?n:p(e.id,t.id)}),n.descending&&d.reverse(),n.reduce===!1)return n.complete(null,{total_rows:d.length,offset:n.skip,rows:"limit"in n?d.slice(n.skip,n.limit+n.skip):n.skip>0?d.slice(n.skip):d});var r=[];if(d.forEach(function(e){var t=r[r.length-1];return t&&0===p(t.key[0][0],e.key)?(t.key.push([e.key,e.id]),t.value.push(e.value),void 0):(r.push({key:[[e.key,e.id]],value:[e.value]}),void 0)}),r.forEach(function(n){return n.value=t.reduce.call(null,n.key,n.value),n.value.sumsqr&&n.value.sumsqr instanceof Error?(e=n.value,void 0):(n.key=n.key[0][0],void 0)}),e)return n.complete(e),void 0;n.complete(null,{total_rows:r.length,offset:n.skip,rows:"limit"in n?r.slice(n.skip,n.limit+n.skip):n.skip>0?r.slice(n.skip):r})}}var s;n.skip||(n.skip=0),t.reduce||(n.reduce=!1);var u,l,d=[],f=0,h=!1;"function"==typeof t.map&&2===t.map.length?(s=t.map,t.map=function(e){return s(e,r)}):t.map=v(""+t.map,r,a,g,Array.isArray,JSON.parse),t.reduce&&(t.reduce=y[t.reduce]?y[t.reduce]:v(""+t.reduce,r,a,g,Array.isArray,JSON.parse)),e.changes({conflicts:!0,include_docs:!0,onChange:function(e){"deleted"in e||"_"===e.id[0]||(u={doc:e.doc},t.map.call(null,e.doc))},complete:function(){h=!0,i()}})}function d(e,t,n){var r,o=n.complete,i=[],s="GET";if(u("reduce",n,i),u("include_docs",n,i),u("limit",n,i),u("descending",n,i),u("group",n,i),u("group_level",n,i),u("skip",n,i),u("startkey",n,i,!0),u("endkey",n,i,!0),u("key",n,i,!0),n.keys!==void 0&&(s="POST","string"==typeof t?r=JSON.stringify({keys:n.keys}):t.keys=n.keys),i=i.join("&"),i=""===i?"":"?"+i,"string"==typeof t){var a=t.split("/");return e.request({method:s,url:"_design/"+a[0]+"/_view/"+a[1]+i,body:r},o),void 0}var c=JSON.parse(JSON.stringify(t,function(e,t){return"function"==typeof t?t+"":t}));e.request({method:"POST",url:"_temp_view"+i,body:c},o)}var f=e("pouchdb-collate"),h="function"==typeof r.Promise?r.Promise:e("lie"),p=f.collate,v=e("./evalfunc"),g="undefined"!=typeof console?Function.prototype.bind.call(console.log,console):function(){},m=function(e){return JSON.stringify(f.normalizeKey(e))},y={_sum:function(e,t){return a(t)},_count:function(e,t){return t.length},_stats:function(e,t){return{sum:a(t),min:Math.min.apply(null,t),max:Math.max.apply(null,t),count:t.length,sumsqr:function(){var e,n=0;for(var r in t){if("number"!=typeof t[r])return e=Error("builtin _stats function requires map values to be numbers"),e.name="invalid_value",e.status=500,e;n+=t[r]*t[r]}return n}()}}};n.query=function(e,n,r){var o=this;"function"==typeof n&&(r=n,n={}),n=n||{},r&&(n.complete=r);var i,s=n.complete;n.complete&&(i=function(e,n){t.nextTick(function(){s(e,n)})});var a=new h(function(t,r){if(n.complete=function(e,n){e?r(e):t(n)},"http"===o.type())return"function"==typeof e?d(o,{map:e},n):d(o,e,n);if("object"==typeof e)return l(o,e,n);if("function"==typeof e)return l(o,{map:e},n);var i=e.split("/");o.get("_design/"+i[0],function(e,t){return e?(n.complete(e),void 0):t.views[i[1]]?(l(o,{map:t.views[i[1]].map,reduce:t.views[i[1]].reduce},n),void 0):(n.complete({name:"not_found",message:"missing_named_view"}),void 0)})});return i&&a.then(function(e){i(null,e)},i),a}}).call(this,e("/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./evalfunc":148,"/home/admin/browserify-cdn/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":11,lie:150,"pouchdb-collate":158}],150:[function(e,t){"use strict";function n(e,t,n){u?Object.defineProperty(e,t,{value:n,configurable:!0,writable:!0}):e[t]=n}function r(e){return this instanceof r?(n(this,"successQueue",[]),n(this,"failureQueue",[]),n(this,"resolved",!1),"function"==typeof e&&this.resolvePassed(e),void 0):new r(e)}function o(e,t,n){n&&"function"==typeof n.then?n.then(e,t):e(n)}function i(e,t,n){function o(){var o=arguments[n];return"function"!=typeof o?e:new r(function(e,n){a(s,o,t,e,n)})}return o}function s(e,t,n,r){try{o(n,r,e(t))}catch(i){r(i)}}var a=e("immediate"),u=!1;(function(){try{Object.defineProperty({},"test",{value:!0}),u=!0}catch(e){}})(),n(r.prototype,"resolvePassed",function(e){try{e(this.fulfillUnwrap.bind(this),this.reject.bind(this))}catch(t){this.reject(t)}}),n(r.prototype,"reject",function(e){this.resolve(!1,e)}),n(r.prototype,"fulfill",function(e){this.resolve(!0,e)}),n(r.prototype,"fulfillUnwrap",function(e){o(this.fulfill.bind(this),this.reject.bind(this),e)}),r.prototype.then=function(e,t){return this.resolved?this.resolved(e,t):this.pending(e,t)},function(){try{r.prototype["catch"]=function(e){return this.then(null,e)}}catch(e){}}(),n(r.prototype,"pending",function(e,t){var n=this;return new r(function(r,o){"function"==typeof e?n.successQueue.push({resolve:r,reject:o,callback:e}):n.successQueue.push({next:r,callback:!1}),"function"==typeof t?n.failureQueue.push({resolve:r,reject:o,callback:t}):n.failureQueue.push({next:o,callback:!1})})}),n(r.prototype,"resolve",function(e,t){if(!this.resolved){this.resolved=i(this,t,e?0:1);for(var n=e?this.successQueue:this.failureQueue,r=n.length,o=-1;r>++o;)n[o].callback?a(s,n[o].callback,t,n[o].resolve,n[o].reject):n[o].next(t)}}),t.exports=r},{immediate:152}],151:[function(e,t){t.exports=e(141)},{}],152:[function(e,t){t.exports=e(142)},{"./messageChannel":153,"./mutation":154,"./nextTick":151,"./postMessage":155,"./stateChange":156,"./timeout":157}],153:[function(e,t){t.exports=e(143)},{}],154:[function(e,t){t.exports=e(144)},{}],155:[function(e,t){t.exports=e(145)},{}],156:[function(e,t){t.exports=e(146)},{}],157:[function(e,t){t.exports=e(147)},{}],158:[function(e,t,n){"use strict";function r(e,t){for(var r=Math.min(e.length,t.length),o=0;r>o;o++){var i=n.collate(e[o],t[o]);if(0!==i)return i}return e.length===t.length?0:e.length>t.length?1:-1}function o(e,t){return e===t?0:e>t?1:-1}function i(e,t){for(var r=Object.keys(e),o=Object.keys(t),i=Math.min(r.length,o.length),s=0;i>s;s++){var a=n.collate(r[s],o[s]);if(0!==a)return a;if(a=n.collate(e[r[s]],t[o[s]]),0!==a)return a}return r.length===o.length?0:r.length>o.length?1:-1}function s(e){var t=["boolean","number","string","object"];return-1!==t.indexOf(typeof e)?null===e?1:t.indexOf(typeof e)+2:Array.isArray(e)?4.5:void 0}n.collate=function(e,t){e=n.normalizeKey(e),t=n.normalizeKey(t);var a=s(e),u=s(t);return 0!==a-u?a-u:null===e?0:"number"==typeof e?e-t:"boolean"==typeof e?e===t?0:t>e?-1:1:"string"==typeof e?o(e,t):Array.isArray(e)?r(e,t):"object"==typeof e?i(e,t):void 0},n.normalizeKey=function(e){if(e===void 0)return null;if("number"==typeof e){if(1/0===e||e===-1/0||isNaN(e))return null}else if(e instanceof Date)return e.toJSON();return e}},{}],159:[function(e,t){t.exports={name:"pouchdb",version:"2.1.0",description:"PouchDB is a pocket-sized database.",release:"nightly",main:"./lib/index.js",homepage:"https://github.com/daleharvey/pouchdb",repository:"https://github.com/daleharvey/pouchdb",keywords:["db","couchdb","pouchdb"],tags:["db","couchdb","pouchdb"],dependencies:{bluebird:"~1.0.0",inherits:"~2.0.1","level-js":"~2.0.0","level-sublevel":"~5.2.0",leveldown:"~0.10.2",levelup:"~0.18.2",lie:"^2.6.0","pouchdb-mapreduce":"1.0.0",request:"~2.28.0"},devDependencies:{commander:"~2.1.0",watchify:"~0.4.1","uglify-js":"~2.4.6",jshint:"~2.3.0","http-proxy":"~0.10.3",corsproxy:"~0.2.13","http-server":"~0.5.5",browserify:"~3.24.13",wd:"~0.2.8",tin:"~0.4.0",mocha:"~1.17.1",chai:"~1.9.0",istanbul:"~0.2.4",ncp:"~0.5.0","sauce-connect-launcher":"0.2.2",less:"~1.7.0",bower:"~1.2.8"},scripts:{},browser:{"./deps/buffer":!1,request:!1,leveldown:"level-js",bluebird:"lie"},readme:"[PouchDB](http://pouchdb.com/) - The Javascript Database that Syncs\n==================================================\n\nPouchDB was written to help web developers build applications that work as well offline as well as they do online, applications save data locally so the user can use all the features of an app even while offline and synchronise the data between clients so they have up to date data wherever they go.\n\nPouchDB is a free open source project, written in Javascript by these [wonderful contributors](https://github.com/daleharvey/pouchdb/graphs/contributors) and inspired by <a href=\"http://couchdb.apache.org/\">Apache CouchDB</a>.\n\nUsing PouchDB\n-------------\n\nTo get started using PouchDB check out our [Documentation](http://pouchdb.com/learn.html) and the [API Documentation](http://pouchdb.com/api.html).\n\n\nContributors\n------------\nIf you want to get involved then check out the [contributing guide](https://github.com/daleharvey/pouchdb/blob/master/CONTRIBUTING.md)\n\nExample\n-------\n\n```javascript\nvar db = new PouchDB('dbname');\n\ndb.put({\n _id: 'dave@gmail.com',\n name: 'David',\n age: 66\n});\n\ndb.changes({\n onChange: function() {\n console.log('Ch-Ch-Changes');\n }\n});\n\ndb.replicate.to('http://example.com/mydb');\n```\n",readmeFilename:"package/README.md"}},{}]},{},[]);var test=require("tape"),PouchDB=require("pouchdb"),immediate=require("immediate");test("benchmarking",function(e){var t;e.test("setup",function(e){new PouchDB("test").then(function(n){n.destroy().then(function(){new PouchDB("test").then(function(n){t=n,console.time("inserts"),e.end()})})})}),e.test("meat",function(e){function n(o){o&&e.error(o),e.ok(r--),r&&immediate(function(){t.put({yo:"dawg"},""+r,n)})}e.plan(10);var r=10;t.put({yo:"dawg"},""+r,n)}),e.test("teardown",function(e){console.timeEnd("inserts"),t.destroy(function(){e.end()})})});
{
"name": "requirebin-sketch",
"version": "1.0.0",
"dependencies": {
"tape": "2.12.1",
"immediate": "2.6.3",
"pouchdb": "2.1.0"
}
}
<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