text: !function e(t,r,n){function o(i,a){if(!r[i]){if(!t[i]){var u="function"==typeof require&&require;if(!a&&u)return u(i,!0);if(s)return s(i,!0);throw new Error("Cannot find module '"+i+"'")}var c=r[i]={exports:{}};t[i][0].call(c.exports,function(e){var r=t[i][1][e];return o(r?r:e)},c,c.exports,e,t,r,n)}return r[i].exports}for(var s="function"==typeof require&&require,i=0;i<n.length;i++)o(n[i]);return o}({1:[function(e,t,r){"use strict";function n(e){var t=[],r=0;try{e.split("\n").forEach(function(e){e&&(e=JSON.parse(e),e.docs&&(t=t.concat(e.docs)),e.seq&&(r=e.seq))})}catch(n){return{err:n}}return{docs:t,lastSeq:r}}function o(e,t,r,o){function s(e){p||o(e),p=!0}var a=n(t);if(a.err)return o(a.err);var f=a.docs,l=a.lastSeq,p=!1;e.bulkDocs({docs:f,new_edits:!1}).then(function(){return r.proxy?e.info():s()}).then(function(t){var n=new e.constructor(r.proxy,i.extend(!0,{},e.__opts,r)),o=new e.constructor(t.db_name,i.extend(!0,{},e.__opts,r)),s={};return r.filter&&(s.filter=r.filter),r.query_params&&(s.query_params=r.query_params),c(n,o,s).then(function(e){var t={cancelled:!1},r=new u(n,o,e,t);return r.writeCheckpoint(l)})}).then(function(){s()},s)}function s(e,t,r,n){var s={url:t,json:!1};r.ajax&&(s=i.extend(!0,s,r.ajax)),a(s,function(t,s){return t?n(t):void o(e,s,r,n)})}var i=e("./utils"),a=e("pouchdb/extras/ajax"),u=e("pouchdb/extras/checkpointer"),c=e("pouchdb/extras/generateReplicationId");r.load=i.toPromise(function(e,t,r){var n=this;return"function"==typeof t&&(r=t,t={}),/^\s*\{/.test(e)?o(n,e,t,r):s(n,e,t,r)}),"undefined"!=typeof window&&window.PouchDB&&window.PouchDB.plugin(r)},{"./utils":2,"pouchdb/extras/ajax":17,"pouchdb/extras/checkpointer":18,"pouchdb/extras/generateReplicationId":19}],2:[function(e,t,r){var n=e("__browserify_process"),o="undefined"!=typeof self?self:"undefined"!=typeof window?window:{},s=e("pouchdb/extras/promise");r.uuid=e("./uuid"),r.extend=e("pouchdb-extend"),r.once=function(e){var t=!1;return r.getArguments(function(r){if(t)throw console.trace(),new Error("once called  more than once");t=!0,e.apply(this,r)})},r.getArguments=e("argsarray"),r.toPromise=function(e){return r.getArguments(function(t){var o,i=this,a="function"==typeof t[t.length-1]?t.pop():!1;a&&(o=function(e,t){n.nextTick(function(){a(e,t)})});var u=new s(function(n,o){try{var s=r.once(function(e,t){e?o(e):n(t)});t.push(s),e.apply(i,t)}catch(a){o(a)}});return o&&u.then(function(e){o(null,e)},o),u.cancel=function(){return this},u})},r.inherits=e("inherits"),r.Promise=s,r.explain404=function(e){n.browser&&"console"in o&&"info"in console&&console.info("The above 404 is totally normal. "+e+"\n♥ the PouchDB team")}},{"./uuid":3,__browserify_process:55,argsarray:4,inherits:11,"pouchdb-extend":16,"pouchdb/extras/promise":20}],3:[function(e,t,r){"use strict";function n(e){return 0|Math.random()*e}function o(e,t){t=t||s.length;var r="",o=-1;if(e){for(;++o<e;)r+=s[n(t)];return r}for(;++o<36;)switch(o){case 8:case 13:case 18:case 23:r+="-";break;case 19:r+=s[3&n(16)|8];break;default:r+=s[n(16)]}return r}var s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");t.exports=o},{}],4:[function(e,t,r){"use strict";function n(e){return function(){var t=arguments.length;if(t){for(var r=[],n=-1;++n<t;)r[n]=arguments[n];return e.call(this,r)}return e.call(this,[])}}t.exports=n},{}],5:[function(e,t,r){function n(e){return"[object Array]"===c.call(e)}function o(e,t){var r;if(null===e)r={__proto__:null};else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var n=function(){};n.prototype=e,r=new n,r.__proto__=e}return"undefined"!=typeof t&&Object.defineProperties&&Object.defineProperties(r,t),r}function s(e){return"object"!=typeof e&&"function"!=typeof e||null===e}function i(e){if(s(e))throw new TypeError("Object.keys called on a non-object");var t=[];for(var r in e)f.call(e,r)&&t.push(r);return t}function a(e){if(s(e))throw new TypeError("Object.getOwnPropertyNames called on a non-object");var t=i(e);return r.isArray(e)&&-1===r.indexOf(e,"length")&&t.push("length"),t}function u(e,t){return{value:e[t]}}var c=Object.prototype.toString,f=Object.prototype.hasOwnProperty;r.isArray="function"==typeof Array.isArray?Array.isArray:n,r.indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;r<e.length;r++)if(t===e[r])return r;return-1},r.filter=function(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r},r.forEach=function(e,t,r){if(e.forEach)return e.forEach(t,r);for(var n=0;n<e.length;n++)t.call(r,e[n],n,e)},r.map=function(e,t){if(e.map)return e.map(t);for(var r=new Array(e.length),n=0;n<e.length;n++)r[n]=t(e[n],n,e);return r},r.reduce=function(e,t,r){if(e.reduce)return e.reduce(t,r);var n,o=!1;2<arguments.length&&(n=r,o=!0);for(var s=0,i=e.length;i>s;++s)e.hasOwnProperty(s)&&(o?n=t(n,e[s],s,e):(n=e[s],o=!0));return n},"b"!=="ab".substr(-1)?r.substr=function(e,t,r){return 0>t&&(t=e.length+t),e.substr(t,r)}:r.substr=function(e,t,r){return e.substr(t,r)},r.trim=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},r.bind=function(){var e=Array.prototype.slice.call(arguments),t=e.shift();if(t.bind)return t.bind.apply(t,e);var r=e.shift();return function(){t.apply(r,e.concat([Array.prototype.slice.call(arguments)]))}},r.create="function"==typeof Object.create?Object.create:o;var l="function"==typeof Object.keys?Object.keys:i,p="function"==typeof Object.getOwnPropertyNames?Object.getOwnPropertyNames:a;if((new Error).hasOwnProperty("description")){var d=function(e,t){return"[object Error]"===c.call(e)&&(t=r.filter(t,function(e){return"description"!==e&&"number"!==e&&"message"!==e})),t};r.keys=function(e){return d(e,l(e))},r.getOwnPropertyNames=function(e){return d(e,p(e))}}else r.keys=l,r.getOwnPropertyNames=p;if("function"==typeof Object.getOwnPropertyDescriptor)try{Object.getOwnPropertyDescriptor({a:1},"a"),r.getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor}catch(h){r.getOwnPropertyDescriptor=function(e,t){try{return Object.getOwnPropertyDescriptor(e,t)}catch(r){return u(e,t)}}}else r.getOwnPropertyDescriptor=u},{}],6:[function(e,t,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}var o=e("util");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.isNumber(e)||0>e)throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,r,n,s,i,a;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o.isObject(this._events.error)&&!this._events.error.length))throw t=arguments[1],t instanceof Error?t:TypeError('Uncaught, unspecified "error" event.');if(r=this._events[e],o.isUndefined(r))return!1;if(o.isFunction(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(n=arguments.length,s=new Array(n-1),i=1;n>i;i++)s[i-1]=arguments[i];r.apply(this,s)}else if(o.isObject(r)){for(n=arguments.length,s=new Array(n-1),i=1;n>i;i++)s[i-1]=arguments[i];for(a=r.slice(),n=a.length,i=0;n>i;i++)a[i].apply(this,s)}return!0},n.prototype.addListener=function(e,t){var r;if(!o.isFunction(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,o.isFunction(t.listener)?t.listener:t),this._events[e]?o.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o.isObject(this._events[e])&&!this._events[e].warned){var r;r=o.isUndefined(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,r&&r>0&&this._events[e].length>r&&(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 r(){this.removeListener(e,r),t.apply(this,arguments)}if(!o.isFunction(t))throw TypeError("listener must be a function");return r.listener=t,this.on(e,r),this},n.prototype.removeListener=function(e,t){var r,n,s,i;if(!o.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],s=r.length,n=-1,r===t||o.isFunction(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o.isObject(r)){for(i=s;i-->0;)if(r[i]===t||r[i].listener&&r[i].listener===t){n=i;break}if(0>n)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,r;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(r=this._events[e],o.isFunction(r))this.removeListener(e,r);else for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?o.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.listenerCount=function(e,t){var r;return r=e._events&&e._events[t]?o.isFunction(e._events[t])?1:e._events[t].length:0}},{util:7}],7:[function(e,t,r){function n(e,t){var n={seen:[],stylize:s};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),h(t)?n.showHidden=t:t&&r._extend(n,t),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=o),a(n,e,n.depth)}function o(e,t){var r=n.styles[t];return r?"["+n.colors[r][0]+"m"+e+"["+n.colors[r][1]+"m":e}function s(e,t){return e}function i(e){var t={};return D.forEach(e,function(e,r){t[e]=!0}),t}function a(e,t,n){if(e.customInspect&&t&&A(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var o=t.inspect(n);return m(o)||(o=a(e,o,n)),o}var s=u(e,t);if(s)return s;var h=D.keys(t),y=i(h);if(e.showHidden&&(h=D.getOwnPropertyNames(t)),0===h.length){if(A(t)){var v=t.name?": "+t.name:"";return e.stylize("[Function"+v+"]","special")}if(w(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(j(t))return e.stylize(Date.prototype.toString.call(t),"date");if(O(t))return c(t)}var g="",b=!1,_=["{","}"];if(d(t)&&(b=!0,_=["[","]"]),A(t)){var x=t.name?": "+t.name:"";g=" [Function"+x+"]"}if(w(t)&&(g=" "+RegExp.prototype.toString.call(t)),j(t)&&(g=" "+Date.prototype.toUTCString.call(t)),O(t)&&(g=" "+c(t)),0===h.length&&(!b||0==t.length))return _[0]+g+_[1];if(0>n)return w(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var S;return S=b?f(e,t,n,y,h):h.map(function(r){return l(e,t,n,y,r,b)}),e.seen.pop(),p(S,g,_)}function u(e,t){if(_(t))return e.stylize("undefined","undefined");if(m(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):h(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,r,n,o){for(var s=[],i=0,a=t.length;a>i;++i)B(t,String(i))?s.push(l(e,t,r,n,String(i),!0)):s.push("");return D.forEach(o,function(o){o.match(/^\d+$/)||s.push(l(e,t,r,n,o,!0))}),s}function l(e,t,r,n,o,s){var i,u,c;if(c=D.getOwnPropertyDescriptor(t,o)||{value:t[o]},c.get?u=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(u=e.stylize("[Setter]","special")),B(n,o)||(i="["+o+"]"),u||(D.indexOf(e.seen,c.value)<0?(u=y(r)?a(e,c.value,null):a(e,c.value,r-1),u.indexOf("\n")>-1&&(u=s?u.split("\n").map(function(e){return"  "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return"   "+e}).join("\n"))):u=e.stylize("[Circular]","special")),_(i)){if(s&&o.match(/^\d+$/))return u;i=JSON.stringify(""+o),i.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.substr(1,i.length-2),i=e.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=e.stylize(i,"string"))}return i+": "+u}function p(e,t,r){var n=0,o=D.reduce(e,function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n  ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function d(e){return D.isArray(e)}function h(e){return"boolean"==typeof e}function y(e){return null===e}function v(e){return null==e}function g(e){return"number"==typeof e}function m(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function _(e){return void 0===e}function w(e){return x(e)&&"[object RegExp]"===C(e)}function x(e){return"object"==typeof e&&e}function j(e){return x(e)&&"[object Date]"===C(e)}function O(e){return x(e)&&"[object Error]"===C(e)}function A(e){return"function"==typeof e}function S(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function E(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.binarySlice}function C(e){return Object.prototype.toString.call(e)}function k(e){return 10>e?"0"+e.toString(10):e.toString(10)}function I(){var e=new Date,t=[k(e.getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":");return[e.getDate(),R[e.getMonth()],t].join(" ")}function B(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var D=e("_shims"),T=/%[sdj%]/g;r.format=function(e){if(!m(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(n(arguments[r]));return t.join(" ")}for(var r=1,o=arguments,s=o.length,i=String(e).replace(T,function(e){if("%%"===e)return"%";if(r>=s)return e;switch(e){case"%s":return String(o[r++]);case"%d":return Number(o[r++]);case"%j":try{return JSON.stringify(o[r++])}catch(t){return"[Circular]"}default:return e}}),a=o[r];s>r;a=o[++r])i+=y(a)||!x(a)?" "+a:" "+n(a);return i},r.inspect=n,n.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]},n.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=d,r.isBoolean=h,r.isNull=y,r.isNullOrUndefined=v,r.isNumber=g,r.isString=m,r.isSymbol=b,r.isUndefined=_,r.isRegExp=w,r.isObject=x,r.isDate=j,r.isError=O,r.isFunction=A,r.isPrimitive=S,r.isBuffer=E;var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];r.log=function(){console.log("%s - %s",I(),r.format.apply(r,arguments))},r.inherits=function(e,t){e.super_=t,e.prototype=D.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},r._extend=function(e,t){if(!t||!x(t))return e;for(var r=D.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}},{_shims:5}],8:[function(e,t,r){function n(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function o(){var e=arguments,t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff),!t)return e;var n="color: "+this.color;e=[e[0],n,"color: inherit"].concat(Array.prototype.slice.call(e,1));var o=0,s=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(o++,"%c"===e&&(s=o))}),e.splice(s,0,n),e}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function i(e){try{null==e?r.storage.removeItem("debug"):r.storage.debug=e}catch(t){}}function a(){var e;try{e=r.storage.debug}catch(t){}return e}function u(){try{return window.localStorage}catch(e){}}r=t.exports=e("./debug"),r.log=s,r.formatArgs=o,r.save=i,r.load=a,r.useColors=n,r.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:u(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(e){return JSON.stringify(e)},r.enable(a())},{"./debug":9}],9:[function(e,t,r){function n(){return r.colors[f++%r.colors.length]}function o(e){function t(){}function o(){var e=o,t=+new Date,s=t-(c||t);e.diff=s,e.prev=c,e.curr=t,c=t,null==e.useColors&&(e.useColors=r.useColors()),null==e.color&&e.useColors&&(e.color=n());var i=Array.prototype.slice.call(arguments);i[0]=r.coerce(i[0]),"string"!=typeof i[0]&&(i=["%o"].concat(i));var a=0;i[0]=i[0].replace(/%([a-z%])/g,function(t,n){if("%%"===t)return t;a++;var o=r.formatters[n];if("function"==typeof o){var s=i[a];t=o.call(e,s),i.splice(a,1),a--}return t}),"function"==typeof r.formatArgs&&(i=r.formatArgs.apply(e,i));var u=o.log||r.log||console.log.bind(console);u.apply(e,i)}t.enabled=!1,o.enabled=!0;var s=r.enabled(e)?o:t;return s.namespace=e,s}function s(e){r.save(e);for(var t=(e||"").split(/[\s,]+/),n=t.length,o=0;n>o;o++)t[o]&&(e=t[o].replace(/\*/g,".*?"),"-"===e[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")))}function i(){r.enable("")}function a(e){var t,n;for(t=0,n=r.skips.length;n>t;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;n>t;t++)if(r.names[t].test(e))return!0;return!1}function u(e){return e instanceof Error?e.stack||e.message:e}r=t.exports=o,r.coerce=u,r.disable=i,r.enable=s,r.enabled=a,r.humanize=e("ms"),r.names=[],r.skips=[],r.formatters={};var c,f=0},{ms:12}],10:[function(e,t,r){function n(){p=!0;for(var e,t,r=d.length;r;){for(t=d,d=[],e=-1;++e<r;)t[e]();r=d.length}p=!1}function o(e){1!==d.push(e)||p||s()}var s,i="undefined"!=typeof self?self:"undefined"!=typeof window?window:{},a=i.MutationObserver||i.WebKitMutationObserver;if(a){var u=0,c=new a(n),f=i.document.createTextNode("");c.observe(f,{characterData:!0}),s=function(){f.data=u=++u%2}}else if(i.setImmediate||"undefined"==typeof i.MessageChannel)s="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var e=i.document.createElement("script");e.onreadystatechange=function(){n(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},i.document.documentElement.appendChild(e)}:function(){setTimeout(n,0)};else{var l=new i.MessageChannel;l.port1.onmessage=n,s=function(){l.port2.postMessage(0)}}var p,d=[];t.exports=o},{}],11:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],12:[function(e,t,r){function n(e){if(e=""+e,!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*l;case"days":case"day":case"d":return r*f;case"hours":case"hour":case"hrs":case"hr":case"h":return r*c;case"minutes":case"minute":case"mins":case"min":case"m":return r*u;case"seconds":case"second":case"secs":case"sec":case"s":return r*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}}}function o(e){return e>=f?Math.round(e/f)+"d":e>=c?Math.round(e/c)+"h":e>=u?Math.round(e/u)+"m":e>=a?Math.round(e/a)+"s":e+"ms"}function s(e){return i(e,f,"day")||i(e,c,"hour")||i(e,u,"minute")||i(e,a,"second")||e+" ms"}function i(e,t,r){return t>e?void 0:1.5*t>e?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}var a=1e3,u=60*a,c=60*u,f=24*c,l=365.25*f;t.exports=function(e,t){return t=t||{},"string"==typeof e?n(e):t["long"]?s(e):o(e)}},{}],13:[function(e,t,r){"use strict";function n(e){if(null!==e)switch(typeof e){case"boolean":return e?1:0;case"number":return f(e);case"string":return e.replace(/\u0002/g,"").replace(/\u0001/g,"").replace(/\u0000/g,"");case"object":var t=Array.isArray(e),n=t?e:Object.keys(e),o=-1,s=n.length,i="";if(t)for(;++o<s;)i+=r.toIndexableString(n[o]);else for(;++o<s;){var a=n[o];i+=r.toIndexableString(a)+r.toIndexableString(e[a])}return i}return""}function o(e,t){var r,n=t,o="1"===e[t];if(o)r=0,t++;else{var s="0"===e[t];t++;var i="",a=e.substring(t,t+p),u=parseInt(a,10)+l;for(s&&(u=-u),t+=p;;){var c=e[t];if("\x00"===c)break;i+=c,t++}i=i.split("."),r=1===i.length?parseInt(i,10):parseFloat(i[0]+"."+i[1]),s&&(r-=10),0!==u&&(r=parseFloat(r+"e"+u))}return{num:r,length:t-n}}function s(e,t){var r=e.pop();if(t.length){var n=t[t.length-1];r===n.element&&(t.pop(),n=t[t.length-1]);var o=n.element,s=n.index;if(Array.isArray(o))o.push(r);else if(s===e.length-2){var i=e.pop();o[i]=r}else e.push(r)}}function i(e,t){for(var n=Math.min(e.length,t.length),o=0;n>o;o++){var s=r.collate(e[o],t[o]);if(0!==s)return s}return e.length===t.length?0:e.length>t.length?1:-1}function a(e,t){return e===t?0:e>t?1:-1}function u(e,t){for(var n=Object.keys(e),o=Object.keys(t),s=Math.min(n.length,o.length),i=0;s>i;i++){var a=r.collate(n[i],o[i]);if(0!==a)return a;if(a=r.collate(e[n[i]],t[o[i]]),0!==a)return a}return n.length===o.length?0:n.length>o.length?1:-1}function c(e){var t=["boolean","number","string","object"],r=t.indexOf(typeof e);return~r?null===e?1:Array.isArray(e)?5:3>r?r+2:r+3:Array.isArray(e)?5:void 0}function f(e){if(0===e)return"1";var t=e.toExponential().split(/e\+?/),r=parseInt(t[1],10),n=0>e,o=n?"0":"2",s=(n?-r:r)-l,i=h.padLeft(s.toString(),"0",p);o+=d+i;var a=Math.abs(parseFloat(t[0]));n&&(a=10-a);var u=a.toFixed(20);return u=u.replace(/\.?0+$/,""),o+=d+u}var l=-324,p=3,d="",h=e("./utils");r.collate=function(e,t){if(e===t)return 0;e=r.normalizeKey(e),t=r.normalizeKey(t);var n=c(e),o=c(t);if(n-o!==0)return n-o;if(null===e)return 0;switch(typeof e){case"number":return e-t;case"boolean":return e===t?0:t>e?-1:1;case"string":return a(e,t)}return Array.isArray(e)?i(e,t):u(e,t)},r.normalizeKey=function(e){switch(typeof e){case"undefined":return null;case"number":return e===1/0||e===-(1/0)||isNaN(e)?null:e;case"object":var t=e;if(Array.isArray(e)){var n=e.length;e=new Array(n);for(var o=0;n>o;o++)e[o]=r.normalizeKey(t[o])}else{if(e instanceof Date)return e.toJSON();if(null!==e){e={};for(var s in t)if(t.hasOwnProperty(s)){var i=t[s];"undefined"!=typeof i&&(e[s]=r.normalizeKey(i))}}}}return e},r.toIndexableString=function(e){var t="\x00";return e=r.normalizeKey(e),c(e)+d+n(e)+t},r.parseIndexableString=function(e){for(var t=[],r=[],n=0;;){var i=e[n++];if("\x00"!==i)switch(i){case"1":t.push(null);break;case"2":t.push("1"===e[n]),n++;break;case"3":var a=o(e,n);t.push(a.num),n+=a.length;break;case"4":for(var u="";;){var c=e[n];if("\x00"===c)break;u+=c,n++}u=u.replace(/\u0001\u0001/g,"\x00").replace(/\u0001\u0002/g,"").replace(/\u0002\u0002/g,""),t.push(u);break;case"5":var f={element:[],index:t.length};t.push(f.element),r.push(f);break;case"6":var l={element:{},index:t.length};t.push(l.element),r.push(l);break;default:throw new Error("bad collationIndex or unexpectedly reached end of input: "+i)}else{if(1===t.length)return t.pop();s(t,r)}}}},{"./utils":14}],14:[function(e,t,r){"use strict";function n(e,t,r){for(var n="",o=r-e.length;n.length<o;)n+=t;return n}r.padLeft=function(e,t,r){var o=n(e,t,r);return o+e},r.padRight=function(e,t,r){var o=n(e,t,r);return e+o},r.stringLexCompare=function(e,t){var r,n=e.length,o=t.length;for(r=0;n>r;r++){if(r===o)return 1;var s=e.charAt(r),i=t.charAt(r);if(s!==i)return i>s?-1:1}return o>n?-1:0},r.intToDecimalForm=function(e){var t=0>e,r="";do{var n=t?-Math.ceil(e%10):Math.floor(e%10);r=n+r,e=t?Math.ceil(e/10):Math.floor(e/10)}while(e);return t&&"0"!==r&&(r="-"+r),r}},{}],15:[function(e,t,r){"use strict";function n(){this.store={}}function o(e){if(this.store=new n,e&&Array.isArray(e))for(var t=0,r=e.length;r>t;t++)this.add(e[t])}r.Map=n,r.Set=o,n.prototype.mangle=function(e){if("string"!=typeof e)throw new TypeError("key must be a string but Got "+e);return"$"+e},n.prototype.unmangle=function(e){return e.substring(1)},n.prototype.get=function(e){var t=this.mangle(e);return t in this.store?this.store[t]:void 0},n.prototype.set=function(e,t){var r=this.mangle(e);return this.store[r]=t,!0},n.prototype.has=function(e){var t=this.mangle(e);return t in this.store},n.prototype["delete"]=function(e){var t=this.mangle(e);return t in this.store?(delete this.store[t],!0):!1},n.prototype.forEach=function(e){for(var t=Object.keys(this.store),r=0,n=t.length;n>r;r++){var o=t[r],s=this.store[o];o=this.unmangle(o),e(s,o)}},o.prototype.add=function(e){return this.store.set(e,!0)},o.prototype.has=function(e){return this.store.has(e)},o.prototype["delete"]=function(e){return this.store["delete"](e)}},{}],16:[function(e,t,r){"use strict";function n(e){return null===e?String(e):"object"==typeof e||"function"==typeof e?c[d.call(e)]||"object":typeof e}function o(e){return null!==e&&e===e.window}function s(e){if(!e||"object"!==n(e)||e.nodeType||o(e))return!1;try{if(e.constructor&&!h.call(e,"constructor")&&!h.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}var r;for(r in e);return void 0===r||h.call(e,r)}function i(e){return"function"===n(e)}function a(){for(var e=[],t=-1,r=arguments.length,n=new Array(r);++t<r;)n[t]=arguments[t];var o={};e.push({args:n,result:{container:o,key:"key"}});for(var s;s=e.pop();)u(e,s.args,s.result);return o.key}function u(e,t,r){var n,o,a,u,c,f,l,p=t[0]||{},d=1,h=t.length,v=!1,g=/\d+/;for("boolean"==typeof p&&(v=p,p=t[1]||{},d=2),"object"==typeof p||i(p)||(p={}),h===d&&(p=this,--d);h>d;d++)if(null!=(n=t[d])){l=y(n);for(o in n)if(!(o in Object.prototype)){if(l&&!g.test(o))continue;if(a=p[o],u=n[o],p===u)continue;v&&u&&(s(u)||(c=y(u)))?(c?(c=!1,f=a&&y(a)?a:[]):f=a&&s(a)?a:{},e.push({args:[v,f,u],result:{container:p,key:o}})):void 0!==u&&(y(n)&&i(u)||(p[o]=u))}}r.container[r.key]=p}for(var c={},f=["Boolean","Number","String","Function","Array","Date","RegExp","Object","Error"],l=0;l<f.length;l++){var p=f[l];c["[object "+p+"]"]=p.toLowerCase()}var d=c.toString,h=c.hasOwnProperty,y=Array.isArray||function(e){return"array"===n(e)};t.exports=a},{}],17:[function(e,t,r){"use strict";t.exports=e("../lib/deps/ajax/ajaxCore")},{"../lib/deps/ajax/ajaxCore":22}],18:[function(e,t,r){"use strict";t.exports=e("../lib/replicate/checkpointer")},{"../lib/replicate/checkpointer":51}],19:[function(e,t,r){"use strict";t.exports=e("../lib/replicate/generateReplicationId")},{"../lib/replicate/generateReplicationId":52}],20:[function(e,t,r){"use strict";t.exports=e("../lib/deps/promise")},{"../lib/deps/promise":48}],21:[function(e,t,r){"use strict";function n(e){a()?chrome.storage.onChanged.addListener(function(t){null!=t.db_name&&e.emit(t.dbName.newValue)}):u()&&("undefined"!=typeof addEventListener?addEventListener("storage",function(t){e.emit(t.key)}):window.attachEvent("storage",function(t){e.emit(t.key)}))}function o(){s.call(this),this._listeners={},n(this)}var s=e("events").EventEmitter,i=e("inherits"),a=e("./deps/env/isChromeApp"),u=e("./deps/env/hasLocalStorage"),c=e("./deps/pick");i(o,s),o.prototype.addListener=function(e,t,r,n){function o(){if(s._listeners[t]){if(i)return void(i="waiting");i=!0;var e=c(n,["style","include_docs","attachments","conflicts","filter","doc_ids","view","since","query_params","binary"]);r.changes(e).on("change",function(e){e.seq>n.since&&!n.cancelled&&(n.since=e.seq,n.onChange(e))}).on("complete",function(){"waiting"===i&&setTimeout(function(){o()},0),i=!1}).on("error",function(){i=!1})}}if(!this._listeners[t]){var s=this,i=!1;this._listeners[t]=o,this.on(e,o)}},o.prototype.removeListener=function(e,t){t in this._listeners&&s.prototype.removeListener.call(this,e,this._listeners[t])},o.prototype.notifyLocalWindows=function(e){a()?chrome.storage.local.set({dbName:e}):u()&&(localStorage[e]="a"===localStorage[e]?"b":"a")},o.prototype.notify=function(e){this.emit(e),this.notifyLocalWindows(e)},t.exports=o},{"./deps/env/hasLocalStorage":39,"./deps/env/isChromeApp":40,"./deps/pick":47,events:6,inherits:11}],22:[function(e,t,r){"use strict";function n(e,t){function r(t,r,n){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 n(o)}}else t=JSON.stringify(t);Array.isArray(t)&&(t=t.map(function(e){return e.error||e.missing?s.generateErrorFromResponse(e):e})),e.binary&&a(t,r),n(null,t,r)}function n(e,t){var r,n;if(e.code&&e.status){var o=new Error(e.message||e.code);return o.status=e.status,t(o)}try{r=JSON.parse(e.responseText),n=s.generateErrorFromResponse(r)}catch(i){n=s.generateErrorFromResponse(e)}t(n)}e=i.clone(e);var f={method:"GET",headers:{},json:!0,processData:!0,timeout:1e4,cache:!1};return e=i.extend(f,e),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(o,i,a){if(o){if(i){var f="undefined"!=typeof document&&document.location.origin,l=f&&0===e.url.indexOf(f);l&&0===i.statusCode&&c(),o.status=i.statusCode}else o.status=400;return n(o,t)}var p,d=i.headers&&i.headers["content-type"],h=a||u();if(!e.binary&&(e.json||!e.processData)&&"object"!=typeof h&&(/json/.test(d)||/^[\s]*\{/.test(h)&&/\}[\s]*$/.test(h)))try{h=JSON.parse(h.toString())}catch(y){}i.statusCode>=200&&i.statusCode<300?r(h,i,t):(p=s.generateErrorFromResponse(h),p.status=i.statusCode,t(p))})}var o=e("request"),s=e("./../errors"),i=e("../../utils"),a=e("./applyTypeToBuffer"),u=e("./defaultBody"),c=e("./explainCors");t.exports=n},{"../../utils":53,"./../errors":41,"./applyTypeToBuffer":23,"./defaultBody":24,"./explainCors":26,request:28}],23:[function(e,t,r){"use strict";t.exports=function(){}},{}],24:[function(e,t,r){"use strict";t.exports=function(){return""}},{}],25:[function(e,t,r){var n="undefined"!=typeof self?self:"undefined"!=typeof window?window:{};t.exports=function(e){"console"in n&&"info"in console&&console.info("The above 404 is totally normal. "+e)}},{}],26:[function(e,t,r){var n="undefined"!=typeof self?self:"undefined"!=typeof window?window:{};t.exports=function(){"console"in n&&"warn"in console&&console.warn("PouchDB: the remote database may not have CORS enabled.If not please enable CORS: http://pouchdb.com/errors.html#no_access_control_allow_origin_header")}},{}],27:[function(e,t,r){"use strict";var n=e("./ajaxCore");t.exports=function(e,t){if(("POST"===e.method||"GET"===e.method)&&!e.cache){var r=-1!==e.url.indexOf("?");e.url+=(r?"&":"?")+"_nonce="+Date.now()}return n(e,t)}},{"./ajaxCore":22}],28:[function(e,t,r){"use strict";function n(){for(var e={},t=new u.Promise(function(t,r){e.resolve=t,e.reject=r}),r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.promise=t,u.Promise.resolve().then(function(){return fetch.apply(null,r)}).then(function(t){e.resolve(t)})["catch"](function(t){e.reject(t)}),e}function o(e,t){var r,o,s,i=new Headers,a={method:e.method,credentials:"include",headers:i};return e.json&&(i.set("Accept","application/json"),i.set("Content-Type",e.headers["Content-Type"]||"application/json")),e.body&&e.body instanceof Blob?c(e.body,function(e){a.body=e}):e.body&&e.processData&&"string"!=typeof e.body?a.body=JSON.stringify(e.body):"body"in e?a.body=e.body:a.body=null,Object.keys(e.headers).forEach(function(t){e.headers.hasOwnProperty(t)&&i.set(t,e.headers[t])}),r=n(e.url,a),e.timeout>0&&(o=setTimeout(function(){r.reject(new Error("Load timeout for resource: "+e.url))},e.timeout)),r.promise.then(function(t){return s={statusCode:t.status},e.timeout>0&&clearTimeout(o),
  s.statusCode>=200&&s.statusCode<300?e.binary?t.blob():t.text():t.json()}).then(function(e){s.statusCode>=200&&s.statusCode<300?t(null,s,e):t(e,s)})["catch"](function(e){t(e,s)}),{abort:r.reject}}function s(e,t){var r,n,o,s=function(){r.abort()};r=e.xhr?new e.xhr:new XMLHttpRequest,r.open(e.method,e.url),r.withCredentials=!0,"GET"===e.method?delete e.headers["Content-Type"]: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&&(r.responseType="arraybuffer"),"body"in e||(e.body=null);for(var i in e.headers)e.headers.hasOwnProperty(i)&&r.setRequestHeader(i,e.headers[i]);return e.timeout>0&&(n=setTimeout(s,e.timeout),r.onprogress=function(){clearTimeout(n),n=setTimeout(s,e.timeout)},"undefined"==typeof o&&(o=-1!==Object.keys(r).indexOf("upload")&&"undefined"!=typeof r.upload),o&&(r.upload.onprogress=r.onprogress)),r.onreadystatechange=function(){if(4===r.readyState){var n={statusCode:r.status};if(r.status>=200&&r.status<300){var o;o=e.binary?a([r.response||""],{type:r.getResponseHeader("Content-Type")}):r.responseText,t(null,n,o)}else{var s={};try{s=JSON.parse(r.response)}catch(i){}t(s,n)}}},e.body&&e.body instanceof Blob?c(e.body,function(e){r.send(e)}):r.send(e.body),{abort:s}}function i(){try{return new XMLHttpRequest,!0}catch(e){return!1}}var a=e("./../binary/blob.js"),u=e("../../utils"),c=e("./../binary/readAsArrayBuffer"),f=i();t.exports=function(e,t){return f||e.xhr?s(e,t):o(e,t)}},{"../../utils":53,"./../binary/blob.js":32,"./../binary/readAsArrayBuffer":36}],29:[function(e,t,r){"use strict";var n=e("./buffer");"function"==typeof atob?r.atob=function(e){return atob(e)}:r.atob=function(e){var t=new n(e,"base64");if(t.toString("base64")!==e)throw"Cannot base64 encode full string";return t.toString("binary")},"function"==typeof btoa?r.btoa=function(e){return btoa(e)}:r.btoa=function(e){return new n(e,"binary").toString("base64")}},{"./buffer":33}],30:[function(e,t,r){"use strict";t.exports=function(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),o=0;t>o;o++)n[o]=e.charCodeAt(o);return r}},{}],31:[function(e,t,r){"use strict";var n=e("./blob"),o=e("./binaryStringToArrayBuffer");t.exports=function(e,t){return n([o(e)],{type:t})}},{"./binaryStringToArrayBuffer":30,"./blob":32}],32:[function(e,t,r){"use strict";function n(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(r){if("TypeError"!==r.name)throw r;for(var n="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder,o=new n,s=0;s<e.length;s+=1)o.append(e[s]);return o.getBlob(t.type)}}t.exports=n},{}],33:[function(e,t,r){t.exports={}},{}],34:[function(e,t,r){"use strict";function n(e){if("function"==typeof e.slice)return e.slice(0);var t=new ArrayBuffer(e.byteLength),r=new Uint8Array(t),n=new Uint8Array(e);return r.set(n),t}t.exports=function(e){if(e instanceof ArrayBuffer)return n(e);var t=e.size,r=e.type;return"function"==typeof e.slice?e.slice(0,t,r):e.webkitSlice(0,t,r)}},{}],35:[function(e,t,r){"use strict";t.exports=function(e){return e instanceof ArrayBuffer||"undefined"!=typeof Blob&&e instanceof Blob}},{}],36:[function(e,t,r){"use strict";t.exports=function(e,t){var r=new FileReader;r.onloadend=function(e){var r=e.target.result||new ArrayBuffer(0);t(r)},r.readAsArrayBuffer(e)}},{}],37:[function(e,t,r){"use strict";var n=e("./binary/isBinaryObject"),o=e("./binary/cloneBinaryObject");t.exports=function s(e){var t,r,i;if(!e||"object"!=typeof e)return e;if(Array.isArray(e)){for(t=[],r=0,i=e.length;i>r;r++)t[r]=s(e[r]);return t}if(e instanceof Date)return e.toISOString();if(n(e))return o(e);t={};for(r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var a=s(e[r]);"undefined"!=typeof a&&(t[r]=a)}return t}},{"./binary/cloneBinaryObject":34,"./binary/isBinaryObject":35}],38:[function(e,t,r){"use strict";function n(e){return e.reduce(function(e,t){return e[t]=!0,e},{})}function o(e){if(!/^\d+\-./.test(e))return i.error(i.INVALID_REV);var t=e.indexOf("-"),r=e.substring(0,t),n=e.substring(t+1);return{prefix:parseInt(r,10),id:n}}function s(e,t){for(var r=e.start-e.ids.length+1,n=e.ids,o=[n[0],t,[]],s=1,i=n.length;i>s;s++)o=[n[s],{status:"missing"},[o]];return[{pos:r,ids:o}]}var i=e("./../errors"),a=e("./../uuid"),u=n(["_id","_rev","_attachments","_deleted","_revisions","_revs_info","_conflicts","_deleted_conflicts","_local_seq","_rev_tree","_replication_id","_replication_state","_replication_state_time","_replication_state_reason","_replication_stats","_removed"]),c=n(["_attachments","_replication_id","_replication_state","_replication_state_time","_replication_state_reason","_replication_stats"]);r.invalidIdError=function(e){var t;if(e?"string"!=typeof e?t=i.error(i.INVALID_ID):/^_/.test(e)&&!/^_(design|local)/.test(e)&&(t=i.error(i.RESERVED_ID)):t=i.error(i.MISSING_ID),t)throw t},r.parseDoc=function(e,t){var n,f,l,p={status:"available"};if(e._deleted&&(p.deleted=!0),t)if(e._id||(e._id=a()),f=a(32,16).toLowerCase(),e._rev){if(l=o(e._rev),l.error)return l;e._rev_tree=[{pos:l.prefix,ids:[l.id,{status:"missing"},[[f,p,[]]]]}],n=l.prefix+1}else e._rev_tree=[{pos:1,ids:[f,p,[]]}],n=1;else if(e._revisions&&(e._rev_tree=s(e._revisions,p),n=e._revisions.start,f=e._revisions.ids[0]),!e._rev_tree){if(l=o(e._rev),l.error)return l;n=l.prefix,f=l.id,e._rev_tree=[{pos:n,ids:[f,p,[]]}]}r.invalidIdError(e._id),e._rev=n+"-"+f;var d={metadata:{},data:{}};for(var h in e)if(Object.prototype.hasOwnProperty.call(e,h)){var y="_"===h[0];if(y&&!u[h]){var v=i.error(i.DOC_VALIDATION,h);throw v.message=i.DOC_VALIDATION.message+": "+h,v}y&&!c[h]?d.metadata[h.slice(1)]=e[h]:d.data[h]=e[h]}return d}},{"./../errors":41,"./../uuid":50}],39:[function(e,t,r){"use strict";var n,o=e("./isChromeApp");if(o())n=!1;else try{localStorage.setItem("_pouch_check_localstorage",1),n=!!localStorage.getItem("_pouch_check_localstorage")}catch(s){n=!1}t.exports=function(){return n}},{"./isChromeApp":40}],40:[function(e,t,r){"use strict";t.exports=function(){return"undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage&&"undefined"!=typeof chrome.storage.local}},{}],41:[function(e,t,r){"use strict";function n(e){Error.call(this,e.reason),this.status=e.status,this.name=e.error,this.message=e.reason,this.error=!0}var o=e("inherits");o(n,Error),n.prototype.toString=function(){return JSON.stringify({status:this.status,name:this.name,message:this.message,reason:this.reason})},r.UNAUTHORIZED=new n({status:401,error:"unauthorized",reason:"Name or password is incorrect."}),r.MISSING_BULK_DOCS=new n({status:400,error:"bad_request",reason:"Missing JSON list of 'docs'"}),r.MISSING_DOC=new n({status:404,error:"not_found",reason:"missing"}),r.REV_CONFLICT=new n({status:409,error:"conflict",reason:"Document update conflict"}),r.INVALID_ID=new n({status:400,error:"invalid_id",reason:"_id field must contain a string"}),r.MISSING_ID=new n({status:412,error:"missing_id",reason:"_id is required for puts"}),r.RESERVED_ID=new n({status:400,error:"bad_request",reason:"Only reserved document ids may start with underscore."}),r.NOT_OPEN=new n({status:412,error:"precondition_failed",reason:"Database not open"}),r.UNKNOWN_ERROR=new n({status:500,error:"unknown_error",reason:"Database encountered an unknown error"}),r.BAD_ARG=new n({status:500,error:"badarg",reason:"Some query argument is invalid"}),r.INVALID_REQUEST=new n({status:400,error:"invalid_request",reason:"Request was invalid"}),r.QUERY_PARSE_ERROR=new n({status:400,error:"query_parse_error",reason:"Some query parameter is invalid"}),r.DOC_VALIDATION=new n({status:500,error:"doc_validation",reason:"Bad special document member"}),r.BAD_REQUEST=new n({status:400,error:"bad_request",reason:"Something wrong with the request"}),r.NOT_AN_OBJECT=new n({status:400,error:"bad_request",reason:"Document must be a JSON object"}),r.DB_MISSING=new n({status:404,error:"not_found",reason:"Database not found"}),r.IDB_ERROR=new n({status:500,error:"indexed_db_went_bad",reason:"unknown"}),r.WSQ_ERROR=new n({status:500,error:"web_sql_went_bad",reason:"unknown"}),r.LDB_ERROR=new n({status:500,error:"levelDB_went_went_bad",reason:"unknown"}),r.FORBIDDEN=new n({status:403,error:"forbidden",reason:"Forbidden by design doc validate_doc_update function"}),r.INVALID_REV=new n({status:400,error:"bad_request",reason:"Invalid rev format"}),r.FILE_EXISTS=new n({status:412,error:"file_exists",reason:"The database could not be created, the file already exists."}),r.MISSING_STUB=new n({status:412,error:"missing_stub"}),r.error=function(e,t,r){function o(t){for(var n in e)"function"!=typeof e[n]&&(this[n]=e[n]);void 0!==r&&(this.name=r),void 0!==t&&(this.reason=t)}return o.prototype=n.prototype,new o(t)},r.getErrorTypeByProp=function(e,t,n){var o=r,s=Object.keys(o).filter(function(r){var n=o[r];return"function"!=typeof n&&n[e]===t}),i=n&&s.filter(function(e){var t=o[e];return t.message===n})[0]||s[0];return i?o[i]:null},r.generateErrorFromResponse=function(e){var t,n,o,s,i,a=r;return n=e.error===!0&&"string"==typeof e.name?e.name:e.error,i=e.reason,o=a.getErrorTypeByProp("name",n,i),e.missing||"missing"===i||"deleted"===i||"not_found"===n?o=a.MISSING_DOC:"doc_validation"===n?(o=a.DOC_VALIDATION,s=i):"bad_request"===n&&o.message!==i&&(o=a.BAD_REQUEST),o||(o=a.getErrorTypeByProp("status",e.status,i)||a.UNKNOWN_ERROR),t=a.error(o,i,n),s&&(t.message=s),e.id&&(t.id=e.id),e.status&&(t.status=e.status),e.missing&&(t.missing=e.missing),t}},{inherits:11}],42:[function(e,t,r){"use strict";function n(e,t){for(var r in t)if(t.hasOwnProperty(r)){var n=o(t[r]);"undefined"!=typeof n&&(e[r]=n)}}var o=e("./clone");t.exports=function(e,t,r){return n(e,t),r&&n(e,r),e}},{"./clone":37}],43:[function(e,t,r){function n(e){return String.fromCharCode(255&e)+String.fromCharCode(e>>>8&255)+String.fromCharCode(e>>>16&255)+String.fromCharCode(e>>>24&255)}function o(e){for(var t="",r=0,o=e.length;o>r;r++)t+=n(e[r]);return c.btoa(t)}function s(e,t,r,n){(r>0||n<t.byteLength)&&(t=new Uint8Array(t,r,Math.min(n,t.byteLength)-r)),e.append(t)}function i(e,t,r,n){(r>0||n<t.length)&&(t=t.substring(r,n)),e.appendBinary(t)}var a="undefined"!=typeof self?self:"undefined"!=typeof window?window:{},u=e("./toPromise"),c=e("./binary/base64"),f=e("spark-md5"),l=a.setImmediate||a.setTimeout,p=32768;t.exports=u(function(e,t){function r(){var n=d*u,s=n+u;if(d++,c>d)y(h,e,n,s),l(r);else{y(h,e,n,s);var i=h.end(!0),a=o(i);t(null,a),h.destroy()}}var n="string"==typeof e,a=n?e.length:e.byteLength,u=Math.min(p,a),c=Math.ceil(a/u),d=0,h=n?new f:new f.ArrayBuffer,y=n?i:s;r()})},{"./binary/base64":29,"./toPromise":49,"spark-md5":56}],44:[function(e,t,r){"use strict";t.exports=function(e,t){for(var r,n=e.slice();r=n.pop();)for(var o=r.pos,s=r.ids,i=s[2],a=t(0===i.length,o,s[0],r.ctx,s[1]),u=0,c=i.length;c>u;u++)n.push({pos:o+1,ids:i[u],ctx:a})}},{}],45:[function(e,t,r){"use strict";function n(e){var t=!1;return o(function(r){if(t)throw new Error("once called more than once");t=!0,e.apply(this,r)})}var o=e("argsarray");t.exports=n},{argsarray:4}],46:[function(e,t,r){"use strict";function n(e){for(var t=a.exec(e),r={},n=14;n--;){var u=o[n],c=t[n]||"",f=-1!==["user","password"].indexOf(u);r[u]=f?decodeURIComponent(c):c}return r[s]={},r[o[12]].replace(i,function(e,t,n){t&&(r[s][t]=n)}),r}var o=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],s="queryKey",i=/(?:^|&)([^&=]*)=?([^&]*)/g,a=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;t.exports=n},{}],47:[function(e,t,r){"use strict";t.exports=function(e,t){for(var r={},n=0,o=t.length;o>n;n++){var s=t[n];s in e&&(r[s]=e[s])}return r}},{}],48:[function(e,t,r){"use strict";t.exports="function"==typeof Promise?Promise:e("lie")},{lie:54}],49:[function(e,t,r){function n(e){return i(function(t){t=a(t);var r,n=this,i="function"==typeof t[t.length-1]?t.pop():!1;i&&(r=function(e,t){o.nextTick(function(){i(e,t)})});var c=new s(function(r,o){var s;try{var i=u(function(e,t){e?o(e):r(t)});t.push(i),s=e.apply(n,t),s&&"function"==typeof s.then&&r(s)}catch(a){o(a)}});return r&&c.then(function(e){r(null,e)},r),c})}var o=e("__browserify_process"),s=e("./promise"),i=e("argsarray"),a=e("./clone"),u=e("./once");t.exports=n},{"./clone":37,"./once":45,"./promise":48,__browserify_process:55,argsarray:4}],50:[function(e,t,r){"use strict";function n(e){return 0|Math.random()*e}function o(e,t){t=t||s.length;var r="",o=-1;if(e){for(;++o<e;)r+=s[n(t)];return r}for(;++o<36;)switch(o){case 8:case 13:case 18:case 23:r+="-";break;case 19:r+=s[3&n(16)|8];break;default:r+=s[n(16)]}return r}var s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");t.exports=o},{}],51:[function(e,t,r){"use strict";function n(e,t,r,o,s){return e.get(t)["catch"](function(r){if(404===r.status)return"http"===e.type()&&c("PouchDB is just checking if a remote checkpoint exists."),{session_id:o,_id:t,history:[],replicator:d,version:p};throw r}).then(function(i){return s.cancelled?void 0:(i.history=(i.history||[]).filter(function(e){return e.session_id!==o}),i.history.unshift({last_seq:r,session_id:o}),i.history=i.history.slice(0,h),i.version=p,i.replicator=d,i.session_id=o,i.last_seq=r,e.put(i)["catch"](function(i){if(409===i.status)return n(e,t,r,o,s);throw i}))})}function o(e,t,r,n){this.src=e,this.target=t,this.id=r,this.returnValue=n}function s(e,t){if(e.session_id===t.session_id)return{last_seq:e.last_seq,history:e.history||[]};var r=e.history||[],n=t.history||[];return i(r,n)}function i(e,t){var r=e[0],n=e.slice(1),o=t[0],s=t.slice(1);if(!r||0===t.length)return{last_seq:y,history:[]};var u=r.session_id;if(a(u,t))return{last_seq:r.last_seq,history:e};var c=o.session_id;return a(c,n)?{last_seq:o.last_seq,history:s}:i(n,s)}function a(e,t){var r=t[0],n=t.slice(1);return e&&0!==t.length?e===r.session_id?!0:a(e,n):!1}var u=e("./../deps/promise"),c=e("./../deps/ajax/explain404"),f=e("pouchdb-collate"),l=f.collate,p=1,d="pouchdb",h=5,y=0;o.prototype.writeCheckpoint=function(e,t){var r=this;return this.updateTarget(e,t).then(function(){return r.updateSource(e,t)})},o.prototype.updateTarget=function(e,t){return n(this.target,this.id,e,t,this.returnValue)},o.prototype.updateSource=function(e,t){var r=this;return this.readOnlySource?u.resolve(!0):n(this.src,this.id,e,t,this.returnValue)["catch"](function(e){var t="number"==typeof e.status&&4===Math.floor(e.status/100);if(t)return r.readOnlySource=!0,!0;throw e})};var v={undefined:function(e,t){return 0===l(e.last_seq,t.last_seq)?t.last_seq:0},1:function(e,t){return s(t,e).last_seq}};o.prototype.getCheckpoint=function(){var e=this;return e.target.get(e.id).then(function(t){return e.src.get(e.id).then(function(e){if(t.version!==e.version)return y;var r;return r=t.version?t.version.toString():"undefined",r in v?v[r](t,e):y},function(r){if(404===r.status&&t.last_seq)return e.src.put({_id:e.id,last_seq:y}).then(function(){return y},function(r){return 401===r.status?(e.readOnlySource=!0,t.last_seq):y});throw r})})["catch"](function(e){if(404!==e.status)throw e;return y})},t.exports=o},{"./../deps/ajax/explain404":25,"./../deps/promise":48,"pouchdb-collate":13}],52:[function(e,t,r){"use strict";function n(e){return Object.keys(e).sort(a).reduce(function(t,r){return t[r]=e[r],t},{})}function o(e,t,r){var o=r.doc_ids?r.doc_ids.sort(a):"",u=r.filter?r.filter.toString():"",c="",f="";return r.filter&&r.query_params&&(c=JSON.stringify(n(r.query_params))),r.filter&&"_view"===r.filter&&(f=r.view.toString()),s.all([e.id(),t.id()]).then(function(e){var t=e[0]+e[1]+u+f+c+o;return i(t)}).then(function(e){return e=e.replace(/\//g,".").replace(/\+/g,"_"),"_local/"+e})}var s=e("./../deps/promise"),i=e("../deps/md5"),a=e("pouchdb-collate").collate;t.exports=o},{"../deps/md5":43,"./../deps/promise":48,"pouchdb-collate":13}],53:[function(e,t,r){function n(e,t,r){try{return!e(t,r)}catch(n){var o="Filter function threw: "+n.toString();return c.error(c.BAD_REQUEST,o)}}var o=e("./deps/merge/traverseRevTree");r.ajax=e("./deps/ajax/prequest"),r.uuid=e("./deps/uuid"),r.getArguments=e("argsarray");var s=e("pouchdb-collections");r.Map=s.Map,r.Set=s.Set;var i=e("./deps/docs/parseDoc"),a=e("./deps/promise");r.Promise=a;var u=e("./deps/binary/base64"),c=e("./deps/errors");r.atob=u.atob,r.btoa=u.btoa;var f=e("./deps/binary/binaryStringToBlobOrBuffer");r.binaryStringToBlobOrBuffer=f,r.clone=e("./deps/clone"),r.extend=e("./deps/extend"),r.pick=e("./deps/pick"),r.inherits=e("inherits"),r.filterChange=function(e){var t={},r=e.filter&&"function"==typeof e.filter;return t.query=e.query_params,function(o){o.doc||(o.doc={});var s=r&&n(e.filter,o.doc,t);if("object"==typeof s)return s;if(s)return!1;if(e.include_docs){if(!e.attachments)for(var i in o.doc._attachments)o.doc._attachments.hasOwnProperty(i)&&(o.doc._attachments[i].stub=!0)}else delete o.doc;return!0}},r.parseDoc=i.parseDoc,r.invalidIdError=i.invalidIdError,r.isCordova=function(){return"undefined"!=typeof cordova||"undefined"!=typeof PhoneGap||"undefined"!=typeof phonegap},r.Changes=e("./changesHandler"),r.once=e("./deps/once"),r.toPromise=e("./deps/toPromise"),r.adapterFun=function(t,n){function o(e,t,r){if(s.enabled){for(var n=[e._db_name,t],o=0;o<r.length-1;o++)n.push(r[o]);s.apply(null,n);var i=r[r.length-1];r[r.length-1]=function(r,n){var o=[e._db_name,t];o=o.concat(r?["error",r]:["success",n]),s.apply(null,o),i(r,n)}}}var s=e("debug")("pouchdb:api");return r.toPromise(r.getArguments(function(e){if(this._closed)return a.reject(new Error("database is closed"));var r=this;return o(r,t,e),this.taskqueue.isReady?n.apply(this,e):new a(function(n,o){r.taskqueue.addTask(function(s){s?o(s):n(r[t].apply(r,e))})})}))},r.explain404=e("./deps/ajax/explain404"),r.parseUri=e("./deps/parseUri"),r.compare=function(e,t){return t>e?-1:e>t?1:0},r.compactTree=function(e){var t=[];return o(e.rev_tree,function(e,r,n,o,s){"available"!==s.status||e||(t.push(r+"-"+n),s.status="missing")}),t};var l=e("vuvuzela");r.safeJsonParse=function(e){try{return JSON.parse(e)}catch(t){return l.parse(e)}},r.safeJsonStringify=function(e){try{return JSON.stringify(e)}catch(t){return l.stringify(e)}}},{"./changesHandler":21,"./deps/ajax/explain404":25,"./deps/ajax/prequest":27,"./deps/binary/base64":29,"./deps/binary/binaryStringToBlobOrBuffer":31,"./deps/clone":37,"./deps/docs/parseDoc":38,"./deps/errors":41,"./deps/extend":42,"./deps/merge/traverseRevTree":44,"./deps/once":45,"./deps/parseUri":46,"./deps/pick":47,"./deps/promise":48,"./deps/toPromise":49,"./deps/uuid":50,argsarray:4,debug:8,inherits:11,"pouchdb-collections":15,vuvuzela:57}],54:[function(e,t,r){"use strict";function n(){}function o(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=m,this.queue=[],this.outcome=void 0,e!==n&&u(this,e)}function s(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function i(e,t,r){h(function(){var n;try{n=t(r)}catch(o){return y.reject(e,o)}n===e?y.reject(e,new TypeError("Cannot resolve promise with itself")):y.resolve(e,n)})}function a(e){var t=e&&e.then;return e&&"object"==typeof e&&"function"==typeof t?function(){t.apply(e,arguments)}:void 0}function u(e,t){function r(t){s||(s=!0,y.reject(e,t))}function n(t){s||(s=!0,y.resolve(e,t))}function o(){t(n,r)}var s=!1,i=c(o);"error"===i.status&&r(i.value)}function c(e,t){var r={};try{r.value=e(t),r.status="success"}catch(n){r.status="error",r.value=n}return r}function f(e){return e instanceof this?e:y.resolve(new this(n),e)}function l(e){var t=new this(n);return y.reject(t,e)}function p(e){function t(e,t){function n(e){i[t]=e,++a!==o||s||(s=!0,y.resolve(c,i))}r.resolve(e).then(n,function(e){s||(s=!0,y.reject(c,e))})}var r=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var o=e.length,s=!1;if(!o)return this.resolve([]);for(var i=new Array(o),a=0,u=-1,c=new this(n);++u<o;)t(e[u],u);return c}function d(e){function t(e){r.resolve(e).then(function(e){s||(s=!0,y.resolve(a,e))},function(e){s||(s=!0,y.reject(a,e))})}var r=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var o=e.length,s=!1;if(!o)return this.resolve([]);for(var i=-1,a=new this(n);++i<o;)t(e[i]);return a}var h=e("immediate"),y={},v=["REJECTED"],g=["FULFILLED"],m=["PENDING"];t.exports=r=o,o.prototype["catch"]=function(e){return this.then(null,e)},o.prototype.then=function(e,t){if("function"!=typeof e&&this.state===g||"function"!=typeof t&&this.state===v)return this;var r=new this.constructor(n);if(this.state!==m){var o=this.state===g?e:t;i(r,o,this.outcome)}else this.queue.push(new s(r,e,t));return r},s.prototype.callFulfilled=function(e){y.resolve(this.promise,e)},s.prototype.otherCallFulfilled=function(e){i(this.promise,this.onFulfilled,e)},s.prototype.callRejected=function(e){y.reject(this.promise,e)},s.prototype.otherCallRejected=function(e){i(this.promise,this.onRejected,e)},y.resolve=function(e,t){var r=c(a,t);if("error"===r.status)return y.reject(e,r.value);var n=r.value;if(n)u(e,n);else{e.state=g,e.outcome=t;for(var o=-1,s=e.queue.length;++o<s;)e.queue[o].callFulfilled(t)}return e},y.reject=function(e,t){e.state=v,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},r.resolve=f,r.reject=l,r.all=p,r.race=d},{immediate:10}],55:[function(e,t,r){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 r=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),r.length>0)){var n=r.shift();n()}},!0),function(e){r.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(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")}},{}],56:[function(e,t,r){!function(e){if("object"==typeof r)t.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var n;try{n=window}catch(o){n=self}n.SparkMD5=e()}}(function(e){"use strict";var t=function(e,t){return e+t&4294967295},r=function(e,r,n,o,s,i){return r=t(t(r,e),t(o,i)),t(r<<s|r>>>32-s,n)},n=function(e,t,n,o,s,i,a){return r(t&n|~t&o,e,t,s,i,a)},o=function(e,t,n,o,s,i,a){return r(t&o|n&~o,e,t,s,i,a)},s=function(e,t,n,o,s,i,a){return r(t^n^o,e,t,s,i,a)},i=function(e,t,n,o,s,i,a){return r(n^(t|~o),e,t,s,i,a)},a=function(e,r){var a=e[0],u=e[1],c=e[2],f=e[3];a=n(a,u,c,f,r[0],7,-680876936),f=n(f,a,u,c,r[1],12,-389564586),c=n(c,f,a,u,r[2],17,606105819),u=n(u,c,f,a,r[3],22,-1044525330),a=n(a,u,c,f,r[4],7,-176418897),f=n(f,a,u,c,r[5],12,1200080426),c=n(c,f,a,u,r[6],17,-1473231341),u=n(u,c,f,a,r[7],22,-45705983),a=n(a,u,c,f,r[8],7,1770035416),f=n(f,a,u,c,r[9],12,-1958414417),c=n(c,f,a,u,r[10],17,-42063),u=n(u,c,f,a,r[11],22,-1990404162),a=n(a,u,c,f,r[12],7,1804603682),f=n(f,a,u,c,r[13],12,-40341101),c=n(c,f,a,u,r[14],17,-1502002290),u=n(u,c,f,a,r[15],22,1236535329),a=o(a,u,c,f,r[1],5,-165796510),f=o(f,a,u,c,r[6],9,-1069501632),c=o(c,f,a,u,r[11],14,643717713),u=o(u,c,f,a,r[0],20,-373897302),a=o(a,u,c,f,r[5],5,-701558691),f=o(f,a,u,c,r[10],9,38016083),c=o(c,f,a,u,r[15],14,-660478335),u=o(u,c,f,a,r[4],20,-405537848),a=o(a,u,c,f,r[9],5,568446438),f=o(f,a,u,c,r[14],9,-1019803690),c=o(c,f,a,u,r[3],14,-187363961),u=o(u,c,f,a,r[8],20,1163531501),a=o(a,u,c,f,r[13],5,-1444681467),f=o(f,a,u,c,r[2],9,-51403784),c=o(c,f,a,u,r[7],14,1735328473),u=o(u,c,f,a,r[12],20,-1926607734),a=s(a,u,c,f,r[5],4,-378558),f=s(f,a,u,c,r[8],11,-2022574463),c=s(c,f,a,u,r[11],16,1839030562),u=s(u,c,f,a,r[14],23,-35309556),a=s(a,u,c,f,r[1],4,-1530992060),f=s(f,a,u,c,r[4],11,1272893353),c=s(c,f,a,u,r[7],16,-155497632),u=s(u,c,f,a,r[10],23,-1094730640),a=s(a,u,c,f,r[13],4,681279174),f=s(f,a,u,c,r[0],11,-358537222),c=s(c,f,a,u,r[3],16,-722521979),u=s(u,c,f,a,r[6],23,76029189),a=s(a,u,c,f,r[9],4,-640364487),f=s(f,a,u,c,r[12],11,-421815835),c=s(c,f,a,u,r[15],16,530742520),u=s(u,c,f,a,r[2],23,-995338651),a=i(a,u,c,f,r[0],6,-198630844),f=i(f,a,u,c,r[7],10,1126891415),c=i(c,f,a,u,r[14],15,-1416354905),u=i(u,c,f,a,r[5],21,-57434055),a=i(a,u,c,f,r[12],6,1700485571),f=i(f,a,u,c,r[3],10,-1894986606),c=i(c,f,a,u,r[10],15,-1051523),u=i(u,c,f,a,r[1],21,-2054922799),a=i(a,u,c,f,r[8],6,1873313359),f=i(f,a,u,c,r[15],10,-30611744),c=i(c,f,a,u,r[6],15,-1560198380),u=i(u,c,f,a,r[13],21,1309151649),a=i(a,u,c,f,r[4],6,-145523070),f=i(f,a,u,c,r[11],10,-1120210379),c=i(c,f,a,u,r[2],15,718787259),u=i(u,c,f,a,r[9],21,-343485551),e[0]=t(a,e[0]),e[1]=t(u,e[1]),e[2]=t(c,e[2]),e[3]=t(f,e[3])},u=function(e){var t,r=[];for(t=0;64>t;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r},c=function(e){var t,r=[];for(t=0;64>t;t+=4)r[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return r},f=function(e){var t,r,n,o,s,i,c=e.length,f=[1732584193,-271733879,-1732584194,271733878];for(t=64;c>=t;t+=64)a(f,u(e.substring(t-64,t)));for(e=e.substring(t-64),r=e.length,n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;r>t;t+=1)n[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(n[t>>2]|=128<<(t%4<<3),t>55)for(a(f,n),t=0;16>t;t+=1)n[t]=0;return o=8*c,o=o.toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(o[2],16),i=parseInt(o[1],16)||0,n[14]=s,n[15]=i,a(f,n),f},l=function(e){var t,r,n,o,s,i,u=e.length,f=[1732584193,-271733879,-1732584194,271733878];for(t=64;u>=t;t+=64)a(f,c(e.subarray(t-64,t)));for(e=u>t-64?e.subarray(t-64):new Uint8Array(0),r=e.length,n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;r>t;t+=1)n[t>>2]|=e[t]<<(t%4<<3);if(n[t>>2]|=128<<(t%4<<3),t>55)for(a(f,n),t=0;16>t;t+=1)n[t]=0;return o=8*u,o=o.toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(o[2],16),i=parseInt(o[1],16)||0,n[14]=s,n[15]=i,a(f,n),f},p=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],d=function(e){var t,r="";for(t=0;4>t;t+=1)r+=p[e>>8*t+4&15]+p[e>>8*t&15];return r},h=function(e){var t;for(t=0;t<e.length;t+=1)e[t]=d(e[t]);return e.join("")},y=function(e){return h(f(e))},v=function(){this.reset()};return"5d41402abc4b2a76b9719d911017c592"!==y("hello")&&(t=function(e,t){var r=(65535&e)+(65535&t),n=(e>>16)+(t>>16)+(r>>16);return n<<16|65535&r}),v.prototype.append=function(e){return/[\u0080-\uFFFF]/.test(e)&&(e=unescape(encodeURIComponent(e))),this.appendBinary(e),this},v.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,r=this._buff.length;for(t=64;r>=t;t+=64)a(this._state,u(this._buff.substring(t-64,t)));return this._buff=this._buff.substr(t-64),this},v.prototype.end=function(e){var t,r,n=this._buff,o=n.length,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;o>t;t+=1)s[t>>2]|=n.charCodeAt(t)<<(t%4<<3);return this._finish(s,o),r=e?this._state:h(this._state),this.reset(),r},v.prototype._finish=function(e,t){var r,n,o,s=t;if(e[s>>2]|=128<<(s%4<<3),s>55)for(a(this._state,e),s=0;16>s;s+=1)e[s]=0;r=8*this._length,r=r.toString(16).match(/(.*?)(.{0,8})$/),n=parseInt(r[2],16),o=parseInt(r[1],16)||0,e[14]=n,e[15]=o,a(this._state,e)},v.prototype.reset=function(){return this._buff="",this._length=0,this._state=[1732584193,-271733879,-1732584194,271733878],this},v.prototype.destroy=function(){delete this._state,delete this._buff,delete this._length},v.hash=function(e,t){/[\u0080-\uFFFF]/.test(e)&&(e=unescape(encodeURIComponent(e)));var r=f(e);return t?r:h(r)},v.hashBinary=function(e,t){var r=f(e);return t?r:h(r)},v.ArrayBuffer=function(){this.reset()},v.ArrayBuffer.prototype.append=function(e){var t,r=this._concatArrayBuffer(this._buff,e),n=r.length;for(this._length+=e.byteLength,t=64;n>=t;t+=64)a(this._state,c(r.subarray(t-64,t)));return this._buff=n>t-64?r.subarray(t-64):new Uint8Array(0),this},v.ArrayBuffer.prototype.end=function(e){var t,r,n=this._buff,o=n.length,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;o>t;t+=1)s[t>>2]|=n[t]<<(t%4<<3);return this._finish(s,o),r=e?this._state:h(this._state),this.reset(),r},v.ArrayBuffer.prototype._finish=v.prototype._finish,v.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._state=[1732584193,-271733879,-1732584194,271733878],this},v.ArrayBuffer.prototype.destroy=v.prototype.destroy,v.ArrayBuffer.prototype._concatArrayBuffer=function(e,t){var r=e.length,n=new Uint8Array(r+t.byteLength);return n.set(e),n.set(new Uint8Array(t),r),n},v.ArrayBuffer.hash=function(e,t){var r=l(new Uint8Array(e));return t?r:h(r)},v})},{}],57:[function(e,t,r){"use strict";function n(e,t,r){var n=r[r.length-1];e===n.element&&(r.pop(),n=r[r.length-1]);var o=n.element,s=n.index;if(Array.isArray(o))o.push(e);else if(s===t.length-2){var i=t.pop();o[i]=e}else t.push(e)}r.stringify=function(e){var t=[];t.push({obj:e});for(var r,n,o,s,i,a,u,c,f,l,p,d="";r=t.pop();)if(n=r.obj,o=r.prefix||"",s=r.val||"",d+=o,s)d+=s;else if("object"!=typeof n)d+="undefined"==typeof n?null:JSON.stringify(n);else if(null===n)d+="null";else if(Array.isArray(n)){for(t.push({val:"]"}),i=n.length-1;i>=0;i--)a=0===i?"":",",t.push({obj:n[i],prefix:a});t.push({val:"["})}else{u=[];for(c in n)n.hasOwnProperty(c)&&u.push(c);for(t.push({val:"}"}),i=u.length-1;i>=0;i--)f=u[i],l=n[f],p=i>0?",":"",p+=JSON.stringify(f)+":",t.push({obj:l,prefix:p});t.push({val:"{"})}return d},r.parse=function(e){for(var t,r,o,s,i,a,u,c,f,l=[],p=[],d=0;;)if(t=e[d++],"}"!==t&&"]"!==t&&"undefined"!=typeof t)switch(t){case" ":case"	":case"\n":case":":case",":break;case"n":d+=3,n(null,l,p);break;case"t":d+=3,n(!0,l,p);break;case"f":d+=4,n(!1,l,p);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"-":for(r="",d--;;){if(o=e[d++],!/[\d\.\-e\+]/.test(o)){d--;break}r+=o}n(parseFloat(r),l,p);break;case'"':for(s="",i=void 0,a=0;;){if(u=e[d++],'"'===u&&("\\"!==i||a%2!==1))break;s+=u,i=u,"\\"===i?a++:a=0}n(JSON.parse('"'+s+'"'),l,p);break;case"[":c={element:[],index:l.length},l.push(c.element),p.push(c);break;case"{":f={element:{},index:l.length},l.push(f.element),p.push(f);break;default:throw new Error("unexpectedly reached end of input: "+t)}else{if(1===l.length)return l.pop();n(l.pop(),l,p)}}},{}]},{},[1]);
  