!function(t){if("function"==typeofbootstrap)bootstrap("nedb",t);elseif("object"==typeofexports)module.exports=t();elseif("function"==typeofdefine&&define.amd)define(t);elseif("undefined"!=typeofses){if(!ses.ok())return;ses.makeNedb=t}else"undefined"!=typeofwindow?window.Nedb=t():global.Nedb=t()}(function(){vart;returnfunction(t,e,n){functionr(n,o){if(!e[n]){if(!t[n]){varu="function"==typeofrequire&&require;if(!o&&u)returnu(n,!0);if(i)returni(n,!0);thrownewError("Cannot find module '"+n+"'")}vara=e[n]={exports:{}};t[n][0].call(a.exports,function(e){vari=t[n][1][e];returnr(i?i:e)},a,a.exports)}returne[n].exports}for(vari="function"==typeofrequire&&require,o=0;o<n.length;o++)r(n[o]);returnr}({1:[function(t,e,n){functionr(t,e){if(t.indexOf)returnt.indexOf(e);for(varn=0;n<t.length;n++)if(e===t[n])returnn;return-1}vari=t("__browserify_process");i.EventEmitter||(i.EventEmitter=function(){});varo=n.EventEmitter=i.EventEmitter,u="function"==typeofArray.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},a=10;o.prototype.setMaxListeners=function(t){this._events||(this._events={}),this._events.maxListeners=t},o.prototype.emit=function(t){if("error"===t&&(!this._events||!this._events.error||u(this._events.error)&&!this._events.error.length))throwarguments[1]instanceofError?arguments[1]:newError("Uncaught, unspecified 'error' event.");if(!this._events)return!1;vare=this._events[t];if(!e)return!1;if("function"==typeofe){switch(arguments.length){case1:e.call(this);break;case2:e.call(this,arguments[1]);break;case3:e.call(this,arguments[1],arguments[2]);break;default:varn=Array.prototype.slice.call(arguments,1);e.apply(this,n)}return!0}if(u(e)){for(varn=Array.prototype.slice.call(arguments,1),r=e.slice(),i=0,o=r.length;o>i;i++)r[i].apply(this,n);return!0}return!1},o.prototype.addListener=function(t,e){if("function"!=typeofe)thrownewError("addListener only takes instances of Function");if(this._events||(this._events={}),this.emit("newListener",t,e),this._events[t])if(u(this._events[t])){if(!this._events[t].warned){varn;n=void0!==this._events.maxListeners?this._events.maxListeners:a,n&&n>0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),console.trace())}this._events[t].push(e)}elsethis._events[t]=[this._events[t],e];elsethis._events[t]=e;returnthis},o.prototype.on=o.prototype.addListener,o.prototype.once=function(t,e){varn=this;returnn.on(t,functionr(){n.removeListener(t,r),e.apply(this,arguments)}),this},o.prototype.removeListener=function(t,e){if("function"!=typeofe)thrownewError("removeListener only takes instances of Function");if(!this._events||!this._events[t])returnthis;varn=this._events[t];if(u(n)){vari=r(n,e);if(0>i)returnthis;n.splice(i,1),0==n.length&&deletethis._events[t]}elsethis._events[t]===e&&deletethis._events[t];returnthis},o.prototype.removeAllListeners=function(t){return0===arguments.length?(this._events={},this):(t&&this._events&&this._events[t]&&(this._events[t]=null),this)},o.prototype.listeners=function(t){returnthis._events||(this._events={}),this._events[t]||(this._events[t]=[]),u(this._events[t])||(this._events[t]=[this._events[t]]),this._events[t]},o.listenerCount=function(t,e){varn;returnn=t._events&&t._events[e]?"function"==typeoft._events[e]?1:t._events[e].length:0}},{__browserify_process:3}],2:[function(t,e,n){functionr(t){returnArray.isArray(t)||"object"==typeoft&&"[object Array]"===Object.prototype.toString.call(t)}functioni(t){"object"==typeoft&&"[object RegExp]"===Object.prototype.toString.call(t)}functiono(t){return"object"==typeoft&&"[object Date]"===Object.prototype.toString.call(t)}t("events"),n.isArray=r,n.isDate=function(t){return"[object Date]"===Object.prototype.toString.call(t)},n.isRegExp=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},n.print=function(){},n.puts=function(){},n.debu
})},u.doUntil=function(t,e,n){t(function(r){returnr?n(r):(e()?n():u.doUntil(t,e,n),void0)})},u.queue=function(t,n){functionr(t,e,r,i){e.constructor!==Array&&(e=[e]),a(e,function(e){varo={data:e,callback:"function"==typeofi?i:null};r?t.tasks.unshift(o):t.tasks.push(o),t.saturated&&t.tasks.length===n&&t.saturated(),u.setImmediate(t.process)})}void0===n&&(n=1);vari=0,o={tasks:[],concurrency:n,saturated:null,empty:null,drain:null,push:function(t,e){r(o,t,!1,e)},unshift:function(t,e){r(o,t,!0,e)},process:function(){if(i<o.concurrency&&o.tasks.length){varn=o.tasks.shift();o.empty&&0===o.tasks.length&&o.empty(),i+=1;varr=function(){i-=1,n.callback&&n.callback.apply(n,arguments),o.drain&&0===o.tasks.length+i&&o.drain(),o.process()},u=e(r);t(n.data,u)}},length:function(){returno.tasks.length},running:function(){returni}};returno},u.cargo=function(t,e){varn=!1,r=[],i={tasks:r,payload:e,saturated:null,empty:null,drain:null,push:function(t,n){t.constructor!==Array&&(t=[t]),a(t,function(t){r.push({data:t,callback:"function"==typeofn?n:null}),i.saturated&&r.length===e&&i.saturated()}),u.setImmediate(i.process)},process:functiono(){if(!n){if(0===r.length)returni.drain&&i.drain(),void0;varu="number"==typeofe?r.splice(0,e):r.splice(0),c=s(u,function(t){returnt.data});i.empty&&i.empty(),n=!0,t(c,function(){n=!1;vart=arguments;a(u,function(e){e.callback&&e.callback.apply(null,t)}),o()})}},length:function(){returnr.length},running:function(){returnn}};returni};varx=function(t){returnfunction(e){varn=Array.prototype.slice.call(arguments,1);e.apply(null,n.concat([function(e){varn=Array.prototype.slice.call(arguments,1);"undefined"!=typeofconsole&&(e?console.error&&console.error(e):console[t]&&a(n,function(e){console[t](e)}))}]))}};u.log=x("log"),u.dir=x("dir"),u.memoize=function(t,e){varn={},r={};e=e||function(t){returnt};vari=function(){vari=Array.prototype.slice.call(arguments),o=i.pop(),u=e.apply(null,i);uinn?o.apply(null,n[u]):uinr?r[u].push(o):(r[u]=[o],t.apply(null,i.concat([function(){n[u]=arguments;vart=r[u];deleter[u];for(vare=0,i=t.length;i>e;e++)t[e].apply(null,arguments)}])))};returni.memo=n,i.unmemoized=t,i},u.unmemoize=function(t){returnfunction(){return(t.unmemoized||t).apply(null,arguments)}},u.times=function(t,e,n){for(varr=[],i=0;t>i;i++)r.push(i);returnu.map(r,e,n)},u.timesSeries=function(t,e,n){for(varr=[],i=0;t>i;i++)r.push(i);returnu.mapSeries(r,e,n)},u.compose=function(){vart=Array.prototype.reverse.call(arguments);returnfunction(){vare=this,n=Array.prototype.slice.call(arguments),r=n.pop();u.reduce(t,n,function(t,n,r){n.apply(e,t.concat([function(){vart=arguments[0],e=Array.prototype.slice.call(arguments,1);r(t,e)}]))},function(t,n){r.apply(e,[t].concat(n))})}};var_=function(t,e){varn=function(){varn=this,r=Array.prototype.slice.call(arguments),i=r.pop();returnt(e,function(t,e){t.apply(n,r.concat([e]))},i)};if(arguments.length>2){varr=Array.prototype.slice.call(arguments,2);returnn.apply(this,r)}returnn};u.applyEach=h(_),u.applyEachSeries=y(_),u.forever=function(t,e){functionn(r){if(r){if(e)returne(r);throwr}t(n)}n()},"undefined"!=typeoft&&t.amd?t([],function(){returnu}):"undefined"!=typeofn&&n.exports?n.exports=u:i.async=u}()},{__browserify_process:3}],11:[function(t,e){e.exports.BinarySearchTree=t("./lib/bst"),e.exports.AVLTree=t("./lib/avltree")},{"./lib/avltree":12,"./lib/bst":13}],12:[function(t,e){functionn(t){this.tree=newr(t)}functionr(t){t=t||{},this.left=null,this.right=null,this.parent=void0!==t.parent?t.parent:null,t.hasOwnProperty("key")&&(this.key=t.key),this.data=t.hasOwnProperty("value")?[t.value]:[],this.unique=t.unique||!1,this.compareKeys=t.compareKeys||o.defaultCompareKeysFunction,this.checkValueEquality=t.checkValueEquality||o.defaultCheckValueEquality}vari=t("./bst"),o=t("./customUtils"),u=t("util");t("underscore"),u.inherits(r,i),n._AVLTree=r,r.prototype.checkHeightCorrect=function(){vart,e;if(this.hasOwnProperty("key")){if(this.left&&void0===this.left.height)throw"Undefined height for node "+this.left.key;if(this.right&&void