-
Notifications
You must be signed in to change notification settings - Fork 1
/
monocle-client-min.js
1 lines (1 loc) · 37.1 KB
/
monocle-client-min.js
1
!function(r){var n={};function i(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,i),e.l=!0,e.exports}i.m=r,i.c=n,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1)}([function(t,e,r){"use strict";e.decode=e.parse=r(12),e.encode=e.stringify=r(13)},function(t,e,n){!function(t){"use strict";var e=n(2),r=new(n(16))(t.XMLHttpRequest,t.Promise);t.monocle=new e(r)}(window)},function(t,e,r){"use strict";var n=r(3),i=r(4),l=r(0),y=r(14);function o(t,e){this._http=t,this._base="/",this._cache=new n(new i("monocle",{capacity:100})),this._batched=[],this._batchTimeout=null,this._enableBatching=!0,this._queuedGets={},this._promise=e||Promise,this._host=""}o.prototype.setBase=function(t){return this._base=t,this},o.prototype.setHost=function(t){return this._host=t,this},o.prototype.getCache=function(){return this._cache},o.prototype.enableBatching=function(){this._enableBatching=!0},o.prototype.disableBatching=function(){this._enableBatching=!1},["get","post","put","patch","delete","options"].forEach(function(r){o.prototype[r]=function(t,e){return s.call(this,r,t,e)}});var g=function(){var n=this._batched;if(this._batched=[],1!==n.length&&this._enableBatching){var t=n.map(function(t){var e;return t.options&&t.options.body&&(e=t.options.body,delete t.options.body),{method:t.method,url:t.url,headers:t.headers,options:t.options,body:e,resolve:t.resolve,reject:t.reject}});this._http.request("POST",a(this._host,this._base,"/_batch"),{body:t}).then(function(t){t.forEach(function(t,e){200<=t.status&&t.status<300?n[e].resolve(t.body):304===t.status?n[e].resolve(n[e].cached):n[e].reject(t.body)})}).catch(function(r){n.forEach(function(t,e){n[e].reject(r)})})}else n.forEach(function(t){var e=a(this._host,this._base,t.url);this._http.request(t.method.toUpperCase(),e,t.options,t.headers).catch(function(t,e){return e&&304===e.$httpStatus?(t.cached.$httpStatus=304,t.cached):this._promise.reject(e)}.bind(this,t)).then(t.resolve).catch(t.reject)}.bind(this))},d=function(t,e){return[t,JSON.stringify(e)].join(":")},s=function(n,i,o){var s={},a=null;if((o=o||{})&&o.props){var t=/^[a-zA-Z0-9@.$_-]+$/,e={code:422,message:"Invalid props, expecting an array of strings"};if(!Array.isArray(o.props))return this._promise.reject(e);if(!o.props.length)return this._promise.reject({code:422,message:"Invalid props, expecting one or more"});for(var r=0,u=o.props.length;r<u;r++){if("string"!=typeof o.props[r])return this._promise.reject(e);if(!o.props[r].match(t))return this._promise.reject(e)}}switch(n){case"get":var h=function(t,e){var r=d(t,e);return this._queuedGets.hasOwnProperty(r)?this._queuedGets[r]:null}.call(this,i,o);if(h)return h;var f=this._cache.generateCacheKey(i,o&&o.query);if((a=this._cache.get(f))&&function(t,e){if(!e)return!0;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&!v(t,e[r]))return!1;return!0}(a,o.props)){if("collection"!==a.$type)return this._promise.resolve(a);var c=new y(a,o.props,o.query).id();c&&(s["if-none-match"]=c);break}break;case"post":case"put":case"delete":case"patch":this._cache.removeMatchingTag(i)}var p=new this._promise(function(t,e){var r=function(t){var e={};if(t&&t.query&&"object"==typeof t.query)for(var r in t.query)e[r]=t.query[r];t&&Array.isArray(t.props)&&(e.props=t.props.join(","));return l.stringify(e)}(o);r&&(i+="?"+r),this._batched.push({method:n,url:i,headers:s,options:o,resolve:t,reject:e,cached:a}),function(){null===this._batchTimeout&&(this._batchTimeout=setTimeout(function(){g.call(this),this._batchTimeout=null}.bind(this)))}.call(this)}.bind(this)).then(function(t,e,r){"get"===t&&this._cache.put(r,e&&e.query);return r}.bind(this,n,o)).finally(function(t,e){var r=d(t,e);delete this._queuedGets[r]}.bind(this,i,o));return"get"===n&&function(t,e,r){var n=d(t,e);this._queuedGets[n]=r}.call(this,i,o,p),p};function v(t,e){if(!e)return!0;var r=[],n={type:"object",property:""};r.push(n);for(var i=0,o=e.length;i<o;i++){var s=e[i];switch(s){case".":n={type:"object",property:""},r.push(n);break;case"@":n={type:"array",property:""},r.push(n);break;default:n.property+=s}}var a,u=t;for(i=0,o=r.length;i<o;i++){if(null===u)return!1;switch((a=r[i]).type){case"object":if(!u.hasOwnProperty(a.property))return!1;u=u[a.property];break;case"array":if(!u.length){u=null;break}if(!u[0].hasOwnProperty(a.property))return!1;u=u[0][a.property]}}return!0}function a(t,e,r){return t+(e+r).replace(/\/{2,}/g,"/")}t.exports=o},function(t,e,r){"use strict";function n(t){this._backend=t}n.prototype.get=function(t){return this._backend.get(t)},n.prototype.put=function(t,e){return this._backend.put(t,e)},n.prototype.remove=function(t){return this._backend.remove(t)},n.prototype.getAll=function(){return this._backend.getAll()},n.prototype.removeMatchingTag=function(t){return this._backend.removeMatchingTag(t)},n.prototype.generateCacheKey=function(t,e){return this._backend.generateCacheKey(t,e)},t.exports=n},function(t,e,r){"use strict";var o=r(5),n=r(11),i=r(0);function s(t,e){this._cache=new n(t,e)}function a(t){var e=o(this._cache.get(t));if(void 0!==e&&!function t(e){var r=Object.keys(e);for(var n=0;n<r.length;n++){var i=r[n];if("object"==typeof e[i]&&null!=e[i]){if(!(e[i].hasOwnProperty("key")&&e[i].hasOwnProperty("value")&&e[i].hasOwnProperty("expiration")))return t.call(this,e[i]);if(void 0===a.call(this,e[i].key))return!0}}return!1}.call(this,e))return function t(e){var r=Object.keys(e);for(var n=0;n<r.length;n++){var i=r[n];if("object"==typeof e[i]&&null!=e[i])if(e[i].hasOwnProperty("key")&&e[i].hasOwnProperty("value")&&e[i].hasOwnProperty("expiration")){var o=a.call(this,e[i].key);void 0!==o&&(e[i]=o)}else t.call(this,e[i])}}.call(this,e),e}s.prototype.generateCacheKey=function(t,r){return r?t+"?"+Object.keys(r).map(function(t){var e={};return e[t]=r[t],i.stringify(e)}).sort().join("&"):t},s.prototype.get=function(t){return a.call(this,t)},s.prototype.getAll=function(){return this._cache.getAll()},s.prototype.put=function(t,e){var r=u.call(this,t,e);return r?r.key:void 0};var u=function(t,e){if(t.hasOwnProperty("$id")&&t.hasOwnProperty("$expires")){var r=o(t);h.call(this,r);var n=this.generateCacheKey(r.$id,e),i=[t.$id];return this._cache.put(n,r,r.$expires,i)}},h=function(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var n=e[r];"object"==typeof t[n]&&null!=t[n]&&(t[n].hasOwnProperty("$id")&&t[n].hasOwnProperty("$expires")?t[n]=u.call(this,t[n]):"object"==typeof t[n]&&h.call(this,t[n]))}};s.prototype.printFromHead=function(){this._cache.printFromHead()},s.prototype.printFromTail=function(){this._cache.printFromTail()},s.prototype.remove=function(t){this._cache.remove(t)},s.prototype.removeAll=function(){this._cache.removeAll()},s.prototype.removeMatchingTag=function(t){this._cache.removeMatchingTag(t)},t.exports=s},function(e,t,r){(function(g){var t=function(){"use strict";function l(t,u,e,h){"object"==typeof u&&(e=u.depth,h=u.prototype,u.filter,u=u.circular);var f=[],c=[],p=void 0!==g;return void 0===u&&(u=!0),void 0===e&&(e=1/0),function t(e,r){if(null===e)return null;if(0==r)return e;var n,i;if("object"!=typeof e)return e;if(l.__isArray(e))n=[];else if(l.__isRegExp(e))n=new RegExp(e.source,y(e)),e.lastIndex&&(n.lastIndex=e.lastIndex);else if(l.__isDate(e))n=new Date(e.getTime());else{if(p&&g.isBuffer(e))return n=g.allocUnsafe?g.allocUnsafe(e.length):new g(e.length),e.copy(n),n;void 0===h?(i=Object.getPrototypeOf(e),n=Object.create(i)):(n=Object.create(h),i=h)}if(u){var o=f.indexOf(e);if(-1!=o)return c[o];f.push(e),c.push(n)}for(var s in e){var a;i&&(a=Object.getOwnPropertyDescriptor(i,s)),a&&null==a.set||(n[s]=t(e[s],r-1))}return n}(t,e)}function e(t){return Object.prototype.toString.call(t)}function y(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}return l.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},l.__objToStr=e,l.__isDate=function(t){return"object"==typeof t&&"[object Date]"===e(t)},l.__isArray=function(t){return"object"==typeof t&&"[object Array]"===e(t)},l.__isRegExp=function(t){return"object"==typeof t&&"[object RegExp]"===e(t)},l.__getRegExpFlags=y,l}();"object"==typeof e&&e.exports&&(e.exports=t)}).call(t,r(6).Buffer)},function(t,D,e){"use strict";(function(t){var n=e(8),o=e(9),s=e(10);function r(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(r()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"!=typeof t)return i(this,t,e,r);if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}function i(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=f(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|l(e,r),i=(t=a(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|p(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):f(t,e);if("Buffer"===e.type&&s(e.data))return f(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(u(e),t=a(t,e<0?0:0|p(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function f(t,e){var r=e.length<0?0:0|p(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function p(t){if(t>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function l(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return C(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(n)return C(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:d(t,e,r,n,i);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):d(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function d(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a/=s=2,u/=2,r/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var f=-1;for(o=r;o<a;o++)if(h(t,o)===h(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(a<r+u&&(r=a-u),o=r;0<=o;o--){for(var c=!0,p=0;p<u;p++)if(h(t,o+p)!==h(e,p)){c=!1;break}if(c)return o}return-1}function v(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?i<(n=Number(n))&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");o/2<n&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function _(t,e,r,n){return M(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function w(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function b(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,u,h=t[i],f=null,c=239<h?4:223<h?3:191<h?2:1;if(i+c<=r)switch(c){case 1:h<128&&(f=h);break;case 2:128==(192&(o=t[i+1]))&&127<(u=(31&h)<<6|63&o)&&(f=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&2047<(u=(15&h)<<12|(63&o)<<6|63&s)&&(u<55296||57343<u)&&(f=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&65535<(u=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)&&u<1114112&&(f=u)}null===f?(f=65533,c=1):65535<f&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return function(t){var e=t.length;if(e<=m)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=m));return r}(n)}D.Buffer=c,D.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},D.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),D.kMaxLength=r(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return i(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return n=null,o=e,s=r,u(i=t),i<=0?a(n,i):void 0!==o?"string"==typeof s?a(n,i).fill(o,s):a(n,i).fill(o):a(n,i);var n,i,o,s},c.allocUnsafe=function(t){return h(null,t)},c.allocUnsafeSlow=function(t){return h(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!s(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===e)for(r=e=0;r<t.length;++r)e+=t[r].length;var n=c.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!c.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},c.byteLength=l,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?b(this,0,t):function(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return w(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",e=D.INSPECT_MAX_BYTES;return 0<this.length&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,i){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&r<=e)return 0;if(i<=n)return-1;if(r<=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(n,i),h=t.slice(e,r),f=0;f<a;++f)if(u[f]!==h[f]){o=u[f],s=h[f];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||i<r)&&(r=i),0<t.length&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o,s,a,u,h,f,c,p,l,y=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return p=e,l=r,M(C(t,(c=this).length-p),c,p,l);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return _(this,t,e,r);case"base64":return u=this,h=e,f=r,M(Y(t),u,h,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s=e,a=r,M(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,(o=this).length-s),o,s,a);default:if(y)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),y=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var m=4096;function A(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function E(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function R(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||n<r)&&(r=n);for(var i="",o=e;o<r;++o)i+=k(t[o]);return i}function P(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(r<t+e)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<e||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function x(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function j(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function B(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function S(t,e,r,n,i){return i||B(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,i){return i||B(t,0,r,8),o.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):n<t&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):n<e&&(e=n),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=c.prototype;else{var i=e-t;r=new c(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},c.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},c.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],i=1;0<e&&(i*=256);)n+=this[t+--e]*i;return n},c.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return(i*=128)<=n&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,i=1,o=this[t+--n];0<n&&(i*=256);)o+=this[t+--n]*i;return(i*=128)<=o&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||O(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||O(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;0<=--i&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):x(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):x(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):j(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;0<=--o&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):x(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):x(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):j(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return S(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return S(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),0<n&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;0<=i;--i)t[i+e]=this[i+r];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=c.isBuffer(t)?t:C(new c(t,n).toString()),a=s.length;for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var I=/[^+\/0-9A-Za-z-_]/g;function k(t){return t<16?"0"+t.toString(16):t.toString(16)}function C(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if(55295<(r=t.charCodeAt(s))&&r<57344){if(!i){if(56319<r){-1<(e-=3)&&o.push(239,191,189);continue}if(s+1===n){-1<(e-=3)&&o.push(239,191,189);continue}i=r;continue}if(r<56320){-1<(e-=3)&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&-1<(e-=3)&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Y(t){return n.toByteArray(function(t){var e;if((t=(e=t,e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")).replace(I,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function M(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(D,e(7))},function(Bm,Cm){var Dm;Dm=function(){return this}();try{Dm=Dm||Function("return this")()||eval("this")}catch(t){"object"==typeof window&&(Dm=window)}Bm.exports=Dm},function(t,e,r){"use strict";e.byteLength=function(t){var e=l(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=l(t),i=n[0],o=n[1],s=new p((h=i,f=o,3*(h+f)/4-f)),a=0,u=0<o?i-4:i;var h,f;for(r=0;r<u;r+=4)e=c[t.charCodeAt(r)]<<18|c[t.charCodeAt(r+1)]<<12|c[t.charCodeAt(r+2)]<<6|c[t.charCodeAt(r+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;2===o&&(e=c[t.charCodeAt(r)]<<2|c[t.charCodeAt(r+1)]>>4,s[a++]=255&e);1===o&&(e=c[t.charCodeAt(r)]<<10|c[t.charCodeAt(r+1)]<<4|c[t.charCodeAt(r+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e);return s},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,i=[],o=0,s=r-n;o<s;o+=16383)i.push(u(t,o,s<o+16383?s:o+16383));1===n?(e=t[r-1],i.push(a[e>>2]+a[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],i.push(a[e>>10]+a[e>>4&63]+a[e<<2&63]+"="));return i.join("")};for(var a=[],c=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;i<o;++i)a[i]=n[i],c[n.charCodeAt(i)]=i;function l(t){var e=t.length;if(0<e%4)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,r){for(var n,i,o=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(a[(i=n)>>18&63]+a[i>>12&63]+a[i>>6&63]+a[63&i]);return o.join("")}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,h=u>>1,f=-7,c=r?i-1:0,p=r?-1:1,l=t[e+c];for(c+=p,o=l&(1<<-f)-1,l>>=-f,f+=a;0<f;o=256*o+t[e+c],c+=p,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;0<f;s=256*s+t[e+c],c+=p,f-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,n),o-=h}return(l?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,h=8*o-i-1,f=(1<<h)-1,c=f>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,y=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),2<=(e+=1<=s+c?p/u:p*Math.pow(2,1-c))*u&&(s++,u/=2),f<=s+c?(a=0,s=f):1<=s+c?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));8<=i;t[r+l]=255&a,l+=y,a/=256,i-=8);for(s=s<<i|a,h+=i;0<h;t[r+l]=255&s,l+=y,s/=256,h-=8);t[r+l-y]|=128*g}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";function n(t,e){this._cacheId=t,this._cache={},this._head=null,this._tail=null,this._options=e||{},this._options.hasOwnProperty("capacity")||(this._options.capacity=!1)}n.prototype.get=function(t){if(this._cache.hasOwnProperty(t)){var e=this._cache[t];if(e.expiration)if((new Date).getTime()>e.expiration.getTime())return void this.remove(t);return s.call(this,e),e.value}},n.prototype.getAll=function(){var t={};for(var e in this._cache){var r=this._cache[e];t[e]={value:r.value,expiration:r.expiration}}return t},n.prototype.put=function(t,e,r,n){Array.isArray(n)||(n="[object String]"==toString.call(n)?[n]:[]);var i={key:t,value:e,expiration:!1,tags:n};r=parseInt(r,10),isFinite(r)&&0<=r&&(i.expiration=new Date((new Date).getTime()+r)),s.call(this,i),this._cache[t]=i;var o=Object.keys(this._cache).length;return 0<this._options.capacity&&o>this._options.capacity&&(u.call(this),Object.keys(this._cache).length>this._options.capacity&&a.call(this)),i},n.prototype.printFromHead=function(){if(!this._head)return"";for(var t=[],e=this._head;e;)t.push(e.key),e=e.next;return t.join(" > ")},n.prototype.printFromTail=function(){if(!this._tail)return"";for(var t=[],e=this._tail;e;)t.push(e.key),e=e.previous;return t.join(" < ")};var s=function(t){if(t!==this._head){var e=t.next,r=t.previous;e&&(e.previous=r),r&&(r.next=e),this._head?(t.next=this._head,this._head.previous=t):t.next=null,t.previous=null,this._head=t,this._tail===t&&(this._tail=r),this._tail||(this._tail=t)}},a=function(){this._head!==this._tail&&this._tail&&this.remove(this._tail.key)},u=function(){var r=new Date;Object.keys(this._cache).forEach(function(t){var e=this._cache[t];e.expiration&&r.getTime()>e.expiration.getTime()&&this.remove(t)}.bind(this))};n.prototype.remove=function(t){if(this._cache.hasOwnProperty(t)){var e=this._cache[t],r=e.previous,n=e.next;r&&(r.next=n),n&&(n.previous=r),this._head===e&&(this._head=n),this._tail===e&&(this._tail=r),delete this._cache[t]}},n.prototype.removeAll=function(){this._cache={},this._head=null,this._tail=null},n.prototype.removeMatchingTag=function(e){Object.keys(this._cache).forEach(function(t){-1!==this._cache[t].tags.indexOf(e)&&this.remove(t)}.bind(this))},t.exports=n},function(t,e,r){"use strict";t.exports=function(t,e,r,n){e=e||"&",r=r||"=";var i={};if("string"!=typeof t||0===t.length)return i;var o=/\+/g;t=t.split(e);var s=1e3;n&&"number"==typeof n.maxKeys&&(s=n.maxKeys);var a,u,h=t.length;0<s&&s<h&&(h=s);for(var f=0;f<h;++f){var c,p,l,y,g=t[f].replace(o,"%20"),d=g.indexOf(r);p=0<=d?(c=g.substr(0,d),g.substr(d+1)):(c=g,""),l=decodeURIComponent(c),y=decodeURIComponent(p),a=i,u=l,Object.prototype.hasOwnProperty.call(a,u)?v(i[l])?i[l].push(y):i[l]=[i[l],y]:i[l]=y}return i};var v=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){"use strict";var o=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(r,n,i,t){return n=n||"&",i=i||"=",null===r&&(r=void 0),"object"==typeof r?a(u(r),function(t){var e=encodeURIComponent(o(t))+i;return s(r[t])?a(r[t],function(t){return e+encodeURIComponent(o(t))}).join(n):e+encodeURIComponent(o(r[t]))}).join(n):t?encodeURIComponent(o(t))+i+encodeURIComponent(o(r)):""};var s=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function a(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var u=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},function(t,e,r){var o=r(15),s=r(0),n=function(t,e,r){this.collection=t,this.props=e,this.query=r};n.prototype.id=function(){if("collection"!==this.collection.$type||!this.collection.$id||!this.collection.$expires)return!1;if(!Array.isArray(this.collection.items))return!1;var e=!1,t=this.collection.items.map(function(t){return t.$link?t.$link:t.$id?t.$id:void(e=!0)});if(e)return!1;var r=[].concat(this.props||[]).sort(),n=("string"==typeof this.query?this.query:s.stringify(this.query)).replace(/^\?/,"").split("&").filter(function(t){return!!t&&!t.match(/^props=/)}).sort(),i=JSON.stringify([t,r,n]);return'W/"'+o(i)+'"'},t.exports=n},function(t,e,r){var n,i,o;i=[],void 0===(o="function"==typeof(n=function(){var t=function t(e){function r(t,e){return t>>>e|t<<32-e}for(var n,i,o=Math.pow,s=o(2,32),a="length",u="",h=[],f=8*e[a],c=t.h=t.h||[],p=t.k=t.k||[],l=p[a],y={},g=2;l<64;g++)if(!y[g]){for(n=0;n<313;n+=g)y[n]=g;c[l]=o(g,.5)*s|0,p[l++]=o(g,1/3)*s|0}for(e+="";e[a]%64-56;)e+="\0";for(n=0;n<e[a];n++){if((i=e.charCodeAt(n))>>8)return;h[n>>2]|=i<<(3-n)%4*8}for(h[h[a]]=f/s|0,h[h[a]]=f,i=0;i<h[a];){var d=h.slice(i,i+=16),v=c;for(c=c.slice(0,8),n=0;n<64;n++){var _=d[n-15],w=d[n-2],b=c[0],m=c[4],A=c[7]+(r(m,6)^r(m,11)^r(m,25))+(m&c[5]^~m&c[6])+p[n]+(d[n]=n<16?d[n]:d[n-16]+(r(_,7)^r(_,18)^_>>>3)+d[n-7]+(r(w,17)^r(w,19)^w>>>10)|0);(c=[A+((r(b,2)^r(b,13)^r(b,22))+(b&c[1]^b&c[2]^c[1]&c[2]))|0].concat(c))[4]=c[4]+A|0}for(n=0;n<8;n++)c[n]=c[n]+v[n]|0}for(n=0;n<8;n++)for(i=3;i+1;i--){var E=c[n]>>8*i&255;u+=(E<16?0:"")+E.toString(16)}return u};return t.code='var sha256=function a(b){function c(a,b){return a>>>b|a<<32-b}for(var d,e,f=Math.pow,g=f(2,32),h="length",i="",j=[],k=8*b[h],l=a.h=a.h||[],m=a.k=a.k||[],n=m[h],o={},p=2;64>n;p++)if(!o[p]){for(d=0;313>d;d+=p)o[d]=p;l[n]=f(p,.5)*g|0,m[n++]=f(p,1/3)*g|0}for(b+="\\x80";b[h]%64-56;)b+="\\x00";for(d=0;d<b[h];d++){if(e=b.charCodeAt(d),e>>8)return;j[d>>2]|=e<<(3-d)%4*8}for(j[j[h]]=k/g|0,j[j[h]]=k,e=0;e<j[h];){var q=j.slice(e,e+=16),r=l;for(l=l.slice(0,8),d=0;64>d;d++){var s=q[d-15],t=q[d-2],u=l[0],v=l[4],w=l[7]+(c(v,6)^c(v,11)^c(v,25))+(v&l[5]^~v&l[6])+m[d]+(q[d]=16>d?q[d]:q[d-16]+(c(s,7)^c(s,18)^s>>>3)+q[d-7]+(c(t,17)^c(t,19)^t>>>10)|0),x=(c(u,2)^c(u,13)^c(u,22))+(u&l[1]^u&l[2]^l[1]&l[2]);l=[w+x|0].concat(l),l[4]=l[4]+w|0}for(d=0;8>d;d++)l[d]=l[d]+r[d]|0}for(d=0;8>d;d++)for(e=3;e+1;e--){var y=l[d]>>8*e&255;i+=(16>y?0:"")+y.toString(16)}return i};',t})?n.apply(e,i):n)||(t.exports=o)},function(t,e,r){"use strict";var n=function(t,e){this.XMLHttpRequest=t,this.Promise=e,this._timeout=3e4,this._headers={"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}};n.prototype.setTimeout=function(t){return this._timeout=t,this},n.prototype.setHeader=function(t,e){return this._headers[t]=e,this},n.prototype.setHeaders=function(t){for(var e in t)t.hasOwnProperty(e)&&this.setHeader(e,t[e]);return this},n.prototype.request=function(t,o,s,e){var a=t.toUpperCase();"GET"===a&&(o+=-1===o.indexOf("?")?"?":"&",o+="_"+(new Date).getTime());var r=h({},this._headers,e),n=[],u=[];for(var i in r)r.hasOwnProperty(i)&&("function"!=typeof r[i]?n.push(r[i]):n.push(r[i]()),u.push(i));return Promise.all(n).then(function(i){return new this.Promise(function(e,r){var n=new this.XMLHttpRequest;n.open(a,o,!0),u.forEach(function(t,e){n.setRequestHeader(t,i[e])}),n.timeout=this._timeout,n.onreadystatechange=function(){if(4==n.readyState){try{var t=JSON.parse(n.responseText)}catch(t){r(t)}e(t)}};var t=s&&s.body?JSON.stringify(s.body):void 0;t?n.send(t):n.send()}.bind(this))}.bind(this))};var h=function(){for(var t=arguments[0],e=1,r=arguments.length;e<r;e++){var n=arguments[e];for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])}return t};t.exports=n}]);