UNPKG

diffusion

Version:

Diffusion JavaScript client

8 lines 69.9 kB
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=12)}([function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.InternalError=e.IllegalStateError=e.RetryLimitError=e.SchemaParseError=e.SchemaViolationError=e.InvalidFilterError=e.OutOfBoundsError=e.IllegalArgumentError=e.SessionError=e.IOError=e.InvalidDataError=e.AssertionError=e.RuntimeError=e.NullValueError=void 0;var o=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="null_value_error",e}(Error);e.NullValueError=o;var u=function(t){function e(e,r){var n=t.call(this,e)||this;return n.cause=r,n}return i(e,t),e.prototype.getType=function(){return e.type},e.type="runtime_error",e}(Error);e.RuntimeError=u;var s=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="assertion_error",e}(Error);e.AssertionError=s;var a=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="invalid_data_error",e}(Error);e.InvalidDataError=a;var f=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="io_error",e}(Error);e.IOError=f;var h=function(t){function e(e,r){var n=t.call(this,e)||this;return n.cause=r,n}return i(e,t),e.prototype.getType=function(){return e.type},e.type="session_error",e}(Error);e.SessionError=h;var c=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="illegal_argument_error",e}(Error);e.IllegalArgumentError=c;var l=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="out_of_bounds_error",e}(Error);e.OutOfBoundsError=l;var p=function(t){function e(e,r){var n=t.call(this,e)||this;return n.errors=r,n}return i(e,t),e.prototype.getType=function(){return e.type},e.type="invalid_filter_error",e}(Error);e.InvalidFilterError=p;var y=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="schema_violation_error",e}(Error);e.SchemaViolationError=y;var d=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="schema_parse_error",e}(Error);e.SchemaParseError=d;var g=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="retry_limit_error",e}(Error);e.RetryLimitError=g;var w=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="illegal_state_error",e}(Error);e.IllegalStateError=w;var v=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="internal_error",e}(Error);e.InternalError=v},function(t,e,r){"use strict";var n=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.readOptional=e.writeOptional=e.writeBoolean=e.readBoolean=e.writeMap=e.readMap=e.readObject=e.writeObject=e.writeDictionary=e.readDictionary=e.readCollection=e.writeCollection=e.writeString=e.readString=e.writeBytes=e.readBytes=e.writeByte=e.writeInt32=e.readInt32=e.writeInt64=e.readInt64=e.readByte=void 0;var i=r(0),o=r(3),u=r(10),s=o.fromNumber(128),a=o.fromNumber(127),f=a.not();function h(t){var e=t.read();if(-1===e)throw new i.IOError("End of stream");return e}function c(t){for(var e=0,r=0;e<32;){var n=h(t);if(r|=(127&n)<<e,0==(128&n))return r;e+=7}throw new i.IOError("Malformed int32")}function l(t,e){for(;0!=(-128&e);)t.write(127&e|128),e>>>=7;t.write(e)}function p(t,e){t.write(e)}function y(t){var e=c(t);return t.readMany(e)}function d(t,e){l(t,e.length),t.writeMany(e)}function g(t){var e=y(t);return e?u.uint8toUtf8(e):""}function w(t,e){d(t,u.uint8FromUtf8(e))}function v(t,e,r,i){var o,u;l(t,Object.keys(e).length);try{for(var s=n(Object.getOwnPropertyNames(e)),a=s.next();!a.done;a=s.next()){var f=a.value;r(t,f),i(t,e[f])}}catch(t){o={error:t}}finally{try{a&&!a.done&&(u=s.return)&&u.call(s)}finally{if(o)throw o.error}}}function E(t,e,r){for(var n=c(t),i={},o=0;o<n;++o){i[e(t)]=r(t)}return i}e.readByte=h,e.readInt64=function(t){for(var e=o.fromNumber(0),r=0;r<64;){var n=h(t),u=o.fromNumber(n);if(e=e.or(u.and(a).shiftLeft(r)),u.and(s).equals(0))return e;r+=7}throw new i.IOError("Malformed int64")},e.writeInt64=function(t,e){for(var r=e instanceof o?e:o.fromNumber(e,!1);!r.and(f).equals(0);)t.write(r.and(a).or(s).toInt()),r=r.shiftRightUnsigned(7);t.write(r.toInt())},e.readInt32=c,e.writeInt32=l,e.writeByte=p,e.readBytes=y,e.writeBytes=d,e.readString=g,e.writeString=w,e.writeCollection=function(t,e,r){var i,o;l(t,e.length);try{for(var u=n(e),s=u.next();!s.done;s=u.next()){r(t,s.value)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}},e.readCollection=function(t,e){for(var r=c(t),n=[],i=0;i<r;++i)n.push(e(t));return n},e.readDictionary=function(t,e){return E(t,g,e)},e.writeDictionary=function(t,e,r){v(t,e,w,r)},e.writeObject=v,e.readObject=E,e.readMap=function(t,e,r){for(var n=c(t),i=new Map,o=0;o<n;++o){var u=e(t);i.set(u,r(t))}return i},e.writeMap=function(t,e,r,n){l(t,e.size),e.forEach((function(e,i){r(t,i),n(t,e)}))},e.readBoolean=function(t){return 0!==t.readInt8()},e.writeBoolean=function(t,e){t.writeInt8(e?1:0)},e.writeOptional=function(t,e,r,n){void 0===n&&(n=function(t){return null!=t}),n(e)?(p(t,1),r(t,e)):p(t,0)},e.readOptional=function(t,e){return h(t)?e(t):void 0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractSerialiser=void 0;var n=r(0),i=function(){function t(){}return t.prototype.read=function(t){throw new n.InternalError("AbstractSerialiser#read is not implemented")},t.prototype.write=function(t,e){throw new n.InternalError("AbstractSerialiser#write is not implemented")},t}();e.AbstractSerialiser=i},function(t,e){t.exports=n;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function n(t,e,r){this.low=0|t,this.high=0|e,this.unsigned=!!r}function i(t){return!0===(t&&t.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var o={},u={};function s(t,e){var r,n,i;return e?(i=0<=(t>>>=0)&&t<256)&&(n=u[t])?n:(r=f(t,(0|t)<0?-1:0,!0),i&&(u[t]=r),r):(i=-128<=(t|=0)&&t<128)&&(n=o[t])?n:(r=f(t,t<0?-1:0,!1),i&&(o[t]=r),r)}function a(t,e){if(isNaN(t))return e?v:w;if(e){if(t<0)return v;if(t>=y)return S}else{if(t<=-d)return b;if(t+1>=d)return T}return t<0?a(-t,e).neg():f(t%p|0,t/p|0,e)}function f(t,e,r){return new n(t,e,r)}n.fromInt=s,n.fromNumber=a,n.fromBits=f;var h=Math.pow;function c(t,e,r){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return w;if("number"==typeof e?(r=e,e=!1):e=!!e,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return c(t.substring(1),e,r).neg();for(var i=a(h(r,8)),o=w,u=0;u<t.length;u+=8){var s=Math.min(8,t.length-u),f=parseInt(t.substring(u,u+s),r);if(s<8){var l=a(h(r,s));o=o.mul(l).add(a(f))}else o=(o=o.mul(i)).add(a(f))}return o.unsigned=e,o}function l(t,e){return"number"==typeof t?a(t,e):"string"==typeof t?c(t,e):f(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}n.fromString=c,n.fromValue=l;var p=4294967296,y=p*p,d=y/2,g=s(1<<24),w=s(0);n.ZERO=w;var v=s(0,!0);n.UZERO=v;var E=s(1);n.ONE=E;var m=s(1,!0);n.UONE=m;var _=s(-1);n.NEG_ONE=_;var T=f(-1,2147483647,!1);n.MAX_VALUE=T;var S=f(-1,-1,!0);n.MAX_UNSIGNED_VALUE=S;var b=f(0,-2147483648,!1);n.MIN_VALUE=b;var R=n.prototype;R.toInt=function(){return this.unsigned?this.low>>>0:this.low},R.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},R.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(b)){var e=a(t),r=this.div(e),n=r.mul(e).sub(this);return r.toString(t)+n.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var i=a(h(t,6),this.unsigned),o=this,u="";;){var s=o.div(i),f=(o.sub(s.mul(i)).toInt()>>>0).toString(t);if((o=s).isZero())return f+u;for(;f.length<6;)f="0"+f;u=""+f+u}},R.getHighBits=function(){return this.high},R.getHighBitsUnsigned=function(){return this.high>>>0},R.getLowBits=function(){return this.low},R.getLowBitsUnsigned=function(){return this.low>>>0},R.getNumBitsAbs=function(){if(this.isNegative())return this.eq(b)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},R.isZero=function(){return 0===this.high&&0===this.low},R.eqz=R.isZero,R.isNegative=function(){return!this.unsigned&&this.high<0},R.isPositive=function(){return this.unsigned||this.high>=0},R.isOdd=function(){return 1==(1&this.low)},R.isEven=function(){return 0==(1&this.low)},R.equals=function(t){return i(t)||(t=l(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},R.eq=R.equals,R.notEquals=function(t){return!this.eq(t)},R.neq=R.notEquals,R.ne=R.notEquals,R.lessThan=function(t){return this.comp(t)<0},R.lt=R.lessThan,R.lessThanOrEqual=function(t){return this.comp(t)<=0},R.lte=R.lessThanOrEqual,R.le=R.lessThanOrEqual,R.greaterThan=function(t){return this.comp(t)>0},R.gt=R.greaterThan,R.greaterThanOrEqual=function(t){return this.comp(t)>=0},R.gte=R.greaterThanOrEqual,R.ge=R.greaterThanOrEqual,R.compare=function(t){if(i(t)||(t=l(t)),this.eq(t))return 0;var e=this.isNegative(),r=t.isNegative();return e&&!r?-1:!e&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},R.comp=R.compare,R.negate=function(){return!this.unsigned&&this.eq(b)?b:this.not().add(E)},R.neg=R.negate,R.add=function(t){i(t)||(t=l(t));var e=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,u=t.high>>>16,s=65535&t.high,a=t.low>>>16,h=0,c=0,p=0,y=0;return p+=(y+=o+(65535&t.low))>>>16,c+=(p+=n+a)>>>16,h+=(c+=r+s)>>>16,h+=e+u,f((p&=65535)<<16|(y&=65535),(h&=65535)<<16|(c&=65535),this.unsigned)},R.subtract=function(t){return i(t)||(t=l(t)),this.add(t.neg())},R.sub=R.subtract,R.multiply=function(t){if(this.isZero())return w;if(i(t)||(t=l(t)),r)return f(r.mul(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned);if(t.isZero())return w;if(this.eq(b))return t.isOdd()?b:w;if(t.eq(b))return this.isOdd()?b:w;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(g)&&t.lt(g))return a(this.toNumber()*t.toNumber(),this.unsigned);var e=this.high>>>16,n=65535&this.high,o=this.low>>>16,u=65535&this.low,s=t.high>>>16,h=65535&t.high,c=t.low>>>16,p=65535&t.low,y=0,d=0,v=0,E=0;return v+=(E+=u*p)>>>16,d+=(v+=o*p)>>>16,v&=65535,d+=(v+=u*c)>>>16,y+=(d+=n*p)>>>16,d&=65535,y+=(d+=o*c)>>>16,d&=65535,y+=(d+=u*h)>>>16,y+=e*p+n*c+o*h+u*s,f((v&=65535)<<16|(E&=65535),(y&=65535)<<16|(d&=65535),this.unsigned)},R.mul=R.multiply,R.divide=function(t){if(i(t)||(t=l(t)),t.isZero())throw Error("division by zero");var e,n,o;if(r)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?f((this.unsigned?r.div_u:r.div_s)(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?v:w;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return v;if(t.gt(this.shru(1)))return m;o=v}else{if(this.eq(b))return t.eq(E)||t.eq(_)?b:t.eq(b)?E:(e=this.shr(1).div(t).shl(1)).eq(w)?t.isNegative()?E:_:(n=this.sub(t.mul(e)),o=e.add(n.div(t)));if(t.eq(b))return this.unsigned?v:w;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=w}for(n=this;n.gte(t);){e=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var u=Math.ceil(Math.log(e)/Math.LN2),s=u<=48?1:h(2,u-48),c=a(e),p=c.mul(t);p.isNegative()||p.gt(n);)p=(c=a(e-=s,this.unsigned)).mul(t);c.isZero()&&(c=E),o=o.add(c),n=n.sub(p)}return o},R.div=R.divide,R.modulo=function(t){return i(t)||(t=l(t)),r?f((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},R.mod=R.modulo,R.rem=R.modulo,R.not=function(){return f(~this.low,~this.high,this.unsigned)},R.and=function(t){return i(t)||(t=l(t)),f(this.low&t.low,this.high&t.high,this.unsigned)},R.or=function(t){return i(t)||(t=l(t)),f(this.low|t.low,this.high|t.high,this.unsigned)},R.xor=function(t){return i(t)||(t=l(t)),f(this.low^t.low,this.high^t.high,this.unsigned)},R.shiftLeft=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?f(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):f(0,this.low<<t-32,this.unsigned)},R.shl=R.shiftLeft,R.shiftRight=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?f(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):f(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},R.shr=R.shiftRight,R.shiftRightUnsigned=function(t){if(i(t)&&(t=t.toInt()),0===(t&=63))return this;var e=this.high;return t<32?f(this.low>>>t|e<<32-t,e>>>t,this.unsigned):f(32===t?e:e>>>t-32,0,this.unsigned)},R.shru=R.shiftRightUnsigned,R.shr_u=R.shiftRightUnsigned,R.toSigned=function(){return this.unsigned?f(this.low,this.high,!1):this},R.toUnsigned=function(){return this.unsigned?this:f(this.low,this.high,!0)},R.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},R.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},R.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},n.fromBytes=function(t,e,r){return r?n.fromBytesLE(t,e):n.fromBytesBE(t,e)},n.fromBytesLE=function(t,e){return new n(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},n.fromBytesBE=function(t,e){return new n(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.enumerize=void 0,e.enumerize=function(t){Object.keys(t).forEach((function(e){var r=t[e].id;void 0!==r&&(t[r]=e)}))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.requireNonNull=void 0;var n=r(0);e.requireNonNull=function(t,e){if(null==t)throw new n.NullValueError(e+" is null");return t}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_RANGE=e.Range=void 0;var n=r(9),i=function(){function t(t,e){this.anchor=t,this.span=e}return t.prototype.equals=function(e){return!!(e&&e instanceof t)&&(this.anchor.equals(e.anchor)&&this.span.equals(e.span))},t.prototype.from=function(e){return new t(n.Point.at(e),this.span)},t.prototype.fromStart=function(){return new t(n.Point.atStart(),this.span)},t.prototype.fromLast=function(e){return new t(n.Point.offset(e),this.span)},t.prototype.fromLastMillis=function(e){return new t(n.Point.offsetMillis(e),this.span)},t.prototype.to=function(e){return new t(this.anchor,n.Point.at(e))},t.prototype.toStart=function(){return new t(this.anchor,n.Point.atStart())},t.prototype.untilLast=function(e){return new t(this.anchor,n.Point.offset(e))},t.prototype.untilLastMillis=function(e){return new t(this.anchor,n.Point.offsetMillis(e))},t.prototype.next=function(e){return new t(this.anchor,n.Point.next(e))},t.prototype.nextMillis=function(e){return new t(this.anchor,n.Point.nextMillis(e))},t.prototype.previous=function(e){return new t(this.anchor,n.Point.previous(e))},t.prototype.previousMillis=function(e){return new t(this.anchor,n.Point.previousMillis(e))},t}();e.Range=i,e.DEFAULT_RANGE=new i(n.Point.atStart(),n.Point.offset(0))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_RANGE_QUERY=e.RangeQueryParameters=e.QueryTypes=e.QueryType=e.StreamStructures=e.StreamStructure=void 0;var n=r(0),i=r(6),o=r(4),u=r(23),s=function(){function t(t,e){this.id=t,this.name=e}return t.prototype.toString=function(){return this.name},t}();e.StreamStructure=s,e.StreamStructures={VALUE_EVENT_STREAM:new s(1,"VALUE_EVENT_STREAM"),EDIT_EVENT_STREAM:new s(2,"EDIT_EVENT_STREAM")},o.enumerize(e.StreamStructures),Object.freeze(e.StreamStructures);var a=function(t,e){this.id=t,this.streamStructure=e};e.QueryType=a,e.QueryTypes={VALUES:new a(0,e.StreamStructures.VALUE_EVENT_STREAM),ALL_EDITS:new a(1,e.StreamStructures.EDIT_EVENT_STREAM),LATEST_EDITS:new a(2,e.StreamStructures.EDIT_EVENT_STREAM)},o.enumerize(e.QueryTypes),Object.freeze(e.QueryTypes);var f=function(){function t(t,e,r,n){this.queryType=t,this.viewRange=e,this.editRange=r,this.limit=n}return t.prototype.withViewRange=function(e){return new t(this.queryType,e,this.editRange,this.limit)},t.prototype.withEditRange=function(e){return new t(this.queryType,this.viewRange,e,this.limit)},t.prototype.withLimit=function(e){return new t(this.queryType,this.viewRange,this.editRange,function(t,e){if(t<0)throw new n.IllegalArgumentError(e+'" is negative: '+t);return t}(e,"limit"))},t.prototype.withQueryType=function(e){return new t(e,this.viewRange,this.editRange,this.limit)},t.prototype.equals=function(e){return!!(e&&e instanceof t)&&(this.queryType===e.queryType&&this.viewRange.equals(e.viewRange)&&this.editRange.equals(e.editRange)&&this.limit===e.limit)},t}();e.RangeQueryParameters=f,e.DEFAULT_RANGE_QUERY=Object.freeze(new f(e.QueryTypes.VALUES,i.DEFAULT_RANGE,i.DEFAULT_RANGE,u.MAX_SAFE_INTEGER))},function(t,e,r){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <http://feross.org> * @license MIT */ var n=r(19),i=r(20),o=r(21);function u(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(u()<e)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=a.prototype:(null===t&&(t=new a(e)),t.length=e),t}function a(t,e,r){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return f(this,t,e,r)}function f(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);a.TYPED_ARRAY_SUPPORT?(t=e).__proto__=a.prototype:t=l(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!a.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|y(e,r),i=(t=s(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(a.isBuffer(e)){var r=0|p(e.length);return 0===(t=s(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?s(t,0):l(t,e);if("Buffer"===e.type&&o(e.data))return l(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function h(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 c(t,e){if(h(e),t=s(t,e<0?0:0|p(e)),!a.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function l(t,e){var r=e.length<0?0:0|p(e.length);t=s(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function p(t){if(t>=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|t}function y(t,e){if(a.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 Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(t).length;default:if(n)return Q(t).length;e=(""+e).toLowerCase(),n=!0}}function d(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 P(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return O(this,e,r);case"base64":return R(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function w(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?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=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var o,u=1,s=t.length,a=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;u=2,s/=2,a/=2,r/=2}function f(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(i){var h=-1;for(o=r;o<s;o++)if(f(t,o)===f(e,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===a)return h*u}else-1!==h&&(o-=o-h),h=-1}else for(r+a>s&&(r=s-a),o=r;o>=0;o--){for(var c=!0,l=0;l<a;l++)if(f(t,o+l)!==f(e,l)){c=!1;break}if(c)return o}return-1}function E(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var s=parseInt(e.substr(2*u,2),16);if(isNaN(s))return u;t[r+u]=s}return u}function m(t,e,r,n){return F(Q(e,t.length-r),t,r,n)}function _(t,e,r,n){return F(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function T(t,e,r,n){return _(t,e,r,n)}function S(t,e,r,n){return F(V(e),t,r,n)}function b(t,e,r,n){return F(function(t,e){for(var r,n,i,o=[],u=0;u<t.length&&!((e-=2)<0);++u)r=t.charCodeAt(u),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function R(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,u,s,a,f=t[i],h=null,c=f>239?4:f>223?3:f>191?2:1;if(i+c<=r)switch(c){case 1:f<128&&(h=f);break;case 2:128==(192&(o=t[i+1]))&&(a=(31&f)<<6|63&o)>127&&(h=a);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(a=(15&f)<<12|(63&o)<<6|63&u)>2047&&(a<55296||a>57343)&&(h=a);break;case 4:o=t[i+1],u=t[i+2],s=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&s)&&(a=(15&f)<<18|(63&o)<<12|(63&u)<<6|63&s)>65535&&a<1114112&&(h=a)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=a,e.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},e.INSPECT_MAX_BYTES=50,a.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}}(),e.kMaxLength=u(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,r){return f(null,t,e,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,r){return function(t,e,r,n){return h(e),e<=0?s(t,e):void 0!==r?"string"==typeof n?s(t,e).fill(r,n):s(t,e).fill(r):s(t,e)}(null,t,e,r)},a.allocUnsafe=function(t){return c(null,t)},a.allocUnsafeSlow=function(t){return c(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.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},a.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}},a.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=a.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var u=t[r];if(!a.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(n,i),i+=u.length}return n},a.byteLength=y,a.prototype._isBuffer=!0,a.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)g(this,e,e+1);return this},a.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)g(this,e,e+3),g(this,e+1,e+2);return this},a.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)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},a.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):d.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},a.prototype.compare=function(t,e,r,n,i){if(!a.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(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(r>>>=0)-(e>>>=0),s=Math.min(o,u),f=this.slice(n,i),h=t.slice(e,r),c=0;c<s;++c)if(f[c]!==h[c]){o=f[c],u=h[c];break}return o<u?-1:u<o?1:0},a.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return w(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return w(this,t,e,r,!1)},a.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||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return T(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(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 O(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 P(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=j(t[o]);return i}function M(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 B(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function U(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 q(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 L(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 C(t,e,r,n,o){return o||L(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,o){return o||L(t,0,r,8),i.write(t,e,r,n,52,8),r+8}a.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),a.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=a.prototype;else{var i=e-t;r=new a(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},a.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||B(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},a.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||B(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return e||B(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||B(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||B(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||B(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||B(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){e||B(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){e||B(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return e||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||B(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||B(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||B(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||B(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||N(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},a.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||N(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):U(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):U(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):q(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):q(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);N(this,t,e,r,i-1,-i)}var o=0,u=1,s=0;for(this[e]=255&t;++o<r&&(u*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/u>>0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);N(this,t,e,r,i-1,-i)}var o=r-1,u=1,s=0;for(this[e+o]=255&t;--o>=0&&(u*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/u>>0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):U(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):U(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):q(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):q(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,r){return C(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return C(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},a.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),n>0&&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;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!a.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},a.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&&!a.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 u=a.isBuffer(t)?t:Q(new a(t,n).toString()),s=u.length;for(o=0;o<r-e;++o)this[o+e]=u[o%s]}return this};var x=/[^+\/0-9A-Za-z-_]/g;function j(t){return t<16?"0"+t.toString(16):t.toString(16)}function Q(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((r=t.charCodeAt(u))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&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 V(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(x,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(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(this,r(18))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Point=e.Types=e.Type=void 0;var n=r(0),i=r(4),o=r(5);function u(t,e){var r=o.requireNonNull(t,e);if(r<0)throw new n.IllegalArgumentError(e+" is negative: "+t);return r}var s=function(t,e,r,n){this.id=t,this.anchorOperator=e,this.spanOperator=r,this.unitsSuffix=n};e.Type=s,e.Types={ABSOLUTE_START:new s(0,"fromStart","toStart",""),ABSOLUTE_SEQUENCE:new s(1,"from","to",""),ABSOLUTE_TIME:new s(2,"from","to"," ms"),OFFSET_SEQUENCE:new s(3,"fromLast","untilLast",""),OFFSET_TIME:new s(4,"fromLast","untilLast"," ms"),NEXT_COUNT:new s(5,null,"next",""),NEXT_TIME:new s(6,null,"next"," ms"),PREVIOUS_COUNT:new s(7,null,"previous",""),PREVIOUS_TIME:new s(8,null,"previous"," ms")},i.enumerize(e.Types);var a=function(){function t(t,e){this.value=t,this.type=e}return t.at=function(r){return r instanceof Date?new t(r.getTime(),e.Types.ABSOLUTE_TIME):new t(u(r,"Sequence"),e.Types.ABSOLUTE_SEQUENCE)},t.atStart=function(){return f},t.offset=function(r){return new t(u(r,"Count"),e.Types.OFFSET_SEQUENCE)},t.offsetMillis=function(r){return new t(u(r,"Timespan"),e.Types.OFFSET_TIME)},t.next=function(r){return new t(u(r,"Count"),e.Types.NEXT_COUNT)},t.nextMillis=function(r){return new t(u(r,"Timespan"),e.Types.NEXT_TIME)},t.previous=function(r){return new t(u(r,"Count"),e.Types.PREVIOUS_COUNT)},t.previousMillis=function(r){return new t(u(r,"Timespan"),e.Types.PREVIOUS_TIME)},t.prototype.equals=function(e){return!!(e&&e instanceof t)&&(this.value===e.value&&this.type===e.type)},t}();e.Point=a;var f=new a(0,e.Types.ABSOLUTE_START)},function(t,e,r){"use strict";(function(t){var r=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},n=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u},i=this&&this.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};function o(t){for(var e=[],r=0;r<t.length;r+=128)e.push(t.subarray(r,Math.min(r+128,t.length)));return e.map((function(t){return String.fromCharCode.apply(String,i([],n(t)))})).join("")}Object.defineProperty(e,"__esModule",{value:!0}),e.isUint8Array=e.isEqualUint8Arrays=e.uint8toUtf8=e.uint8ToBase64=e.uint8ToAscii=e.uint8FromDoubleBE=e.uint8FromBase64=e.uint8FromUtf8=e.uint8FromBinary=e.writeInt32BE=e.writeInt8=e.readDoubleBE=e.readFloatBE=e.readInt32BE=e.readUInt32BE=e.readUInt16BE=e.readInt8=e.concatUint8Arrays=void 0,e.concatUint8Arrays=function(t){var e,n,i=t.reduce((function(t,e){return t+e.length}),0),o=new Uint8Array(i),u=0;try{for(var s=r(t),a=s.next();!a.done;a=s.next()){var f=a.value;o.set(f,u),u+=f.length}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return o},e.readInt8=function(t,e){return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(e)},e.readUInt16BE=function(t,e){return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint16(e,!1)},e.readUInt32BE=function(t,e){return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint32(e,!1)},e.readInt32BE=function(t,e){return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt32(e,!1)},e.readFloatBE=function(t,e){return new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(e,!1)},e.readDoubleBE=function(t,e){return new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(e,!1)},e.writeInt8=function(t,e,r){t[e]=r},e.writeInt32BE=function(t,e,r){new DataView(t.buffer,t.byteOffset,t.byteLength).setInt32(e,r,!1)},e.uint8FromBinary=function(t){for(var e=new Uint8Array(t.length),r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e},e.uint8FromUtf8=function(t){return(new TextEncoder).encode(t)},e.uint8FromBase64="undefined"==typeof window||void 0===window.atob?function(e){return new Uint8Array(t.from(e,"base64"))}:function(t){return new Uint8Array(window.atob(t).split("").map((function(t){return t.charCodeAt(0)})))},e.uint8FromDoubleBE=function(t){var e=new ArrayBuffer(8);return new DataView(e).setFloat64(0,t,!1),new Uint8Array(e)},e.uint8ToAscii=o,e.uint8ToBase64="undefined"==typeof window||void 0===window.btoa?function(e){return t.from(e).toString("base64")}:function(t){return window.btoa(o(t))},e.uint8toUtf8=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=t.length),(new TextDecoder).decode(t.subarray(e,r))},e.isEqualUint8Arrays=function(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0},e.isUint8Array=function(t){return"function"==typeof Uint8Array&&t instanceof Uint8Array||"[object Uint8Array]"===Object.prototype.toString.call(t)}}).call(this,r(8).Buffer)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EventMetadataImpl=void 0;var n=function(){function t(t,e,r){this.sequence=t,this.timestamp=e,this.author=r}return t.prototype.equals=function(e){return!!(e&&e instanceof t)&&(this.sequence===e.sequence&&this.timestamp===e.timestamp&&this.author===e.author)},t}();e.EventMetadataImpl=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),void 0===window._diffusion_features&&(window._diffusion_features={client_control:{},gateway_control:{},log_retrieval:{},messages:{},metrics:{},ping:{},remote_servers:{},replace_license:{},security:{},session_lock:{},session_trees:{},topic_control:{},topic_notifications:{},topic_update:{},topic_views:{},time_series:{}});var n=r(13);window._diffusion_features.time_series.TimeSeriesImpl=n.TimeSeriesImpl},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TimeSeriesImpl=void 0;var n=r(14),i=r(25),o=r(38),u=r(39),s=r(5),a=r(3),f=function(){function t(t){this.internal=t;var e=t.getServiceLocator();this.defaultRangeQuery=n.RangeQueryImpl.createDefault(e.obtain(i.rangeQueryFactory(t.getContext().DataTypes))),this.appendService=e.obtain(i.TIME_SERIES_APPEND),this.appendTimestampService=e.obtain(i.TIME_SERIES_TIMESTAMP_APPEND),this.editService=e.obtain(i.TIME_SERIES_EDIT)}return t.prototype.rangeQuery=function(){return this.defaultRangeQuery},t.prototype.edit=function(t,e,r,n){var i=this,o=this.internal.getContext().DataTypes;return new Promise((function(u,a){var f,h;try{f=n instanceof i.internal.getContext().AbstractDataType?n:n?o.getByClass(n):o.getByValue(r),s.requireNonNull(t,"Path"),s.requireNonNull(r,"Value"),s.requireNonNull(e,"Sequence"),h=(f=s.requireNonNull(f,"Data type")).writeValueToArray(r)}catch(t){return void a(t)}i.editService.send({path:t,sequence:e,dataType:f,value:h},(function(t,e){t?a(t):u(e)}))}))},t.prototype.append=function(t,e,r,n){var i=this,f=this.internal.getContext().DataTypes;return new Promise((function(h,c){var l,p;try{l=r instanceof i.internal.getContext().AbstractDataType?r:r?f.getByClass(r):f.getByValue(e),s.requireNonNull(t,"Path"),s.requireNonNull(e,"Value"),p=(l=s.requireNonNull(l,"Data type")).writeValueToArray(e)}catch(t){return void c(t)}var y=function(t,e){t?c(t):h(e)};void 0===n?i.appendService.send(new o.TimeSeriesAppendRequest(t,l,p),y):i.appendTimestampService.send(new u.TimeSeriesTimestampAppendRequest(t,l,p,"number"==typeof n?a.fromNumber(n):n),y)}))},t}();e.TimeSeriesImpl=f},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RangeQueryImpl=void 0;var n=r(15),i=r(0),o=r(5),u=r(17),s=r(6),a=r(7),f=r(24);function h(t,e){return t.withViewRange(e(t.viewRange))}function c(t,e){return t.withEditRange(e(t.editRange))}var l=function(){function t(t,e,r,n){this.context=t,this.valueType=e,this.parameters=r,this.mode=n}return t.createDefault=function(e){return new t(e,u.BytesImpl,a.DEFAULT_RANGE_QUERY,h)},t.prototype.withCurrentRange=function(e){return new t(this.context,this.valueType,this.mode(this.parameters,e),this.mode)},t.prototype.selectFrom=function(t){var e=this;return new Promise((function(r,i){if(t){var o={topicPath:t,parameters:e.parameters};e.context.send(o,(function(t,o){if(f.responseSuccess(t,o))try{r(o.createQueryResult(e.valueType,e.parameters.queryType.streamStructure))}catch(t){i(n.ErrorReason.INVALID_DATA)}else i(t)}))}else i(new Error("Topic path is null"))}))},t.prototype.forValues=function(){return new t(this.context,this.valueType,this.parameters.withQueryType(a.QueryTypes.VALUES).withViewRange(s.DEFAULT_RANGE),h)},t.prototype.forEdits=function(){return new t(this.context,this.valueType,this.parameters.withQueryType(a.QueryTypes.ALL_EDITS).withViewRange(s.DEFAULT_RANGE),h)},t.prototype.editRange=function(){if(this.parameters.queryType!==a.QueryTypes.VALUES)throw new i.IllegalStateError(".editRange() cannot be applied to this edit range query");return new t(this.context,this.valueType,this.parameters,c)},t.prototype.allEdits=function(){if(this.parameters.queryType===a.QueryTypes.VALUES)throw new i.IllegalStateError(".allEdits() cannot be applied to this value range query");return new t(this.context,this.valueType,this.parameters.withQueryType(a.QueryTypes.ALL_EDITS),c)},t.prototype.latestEdits=function(){if(this.parameters.queryType===a.QueryTypes.VALUES)throw new i.IllegalStateError(".latestEdits() cannot be applied to this value range query");return new t(this.context,this.valueType,this.parameters.withQueryType(a.QueryTypes.LATEST_EDITS),c)},t.prototype.limit=function(e){return new t(this.context,this.valueType,this.parameters.withLimit(e),this.mode)},t.prototype.as=function(e){if(o.requireNonNull(e,"Value type"),e&&e.valueClass)return new t(this.context,e.valueClass,this.parameters,this.mode);if(e instanceof Function)return new t(this.context,e,this.parameters,this.mode);throw new i.IllegalArgumentError("Invalid value type: "+e)},t.prototype.from=fun