UNPKG

diffusion

Version:

Diffusion JavaScript client

10 lines 52.4 kB
!function(t){var r={};function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var i in t)e.d(n,i,function(r){return t[r]}.bind(null,i));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=3)}([function(t,r,e){"use strict";var n=this&&this.__values||function(t){var r="function"==typeof Symbol&&Symbol.iterator,e=r&&t[r],n=0;if(e)return e.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(r?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(r,"__esModule",{value:!0}),r.readOptional=r.writeOptional=r.writeBoolean=r.readBoolean=r.writeMap=r.readMap=r.readObject=r.writeObject=r.writeDictionary=r.readDictionary=r.readCollection=r.writeCollection=r.writeString=r.readString=r.writeBytes=r.readBytes=r.writeByte=r.writeInt32=r.readInt32=r.writeInt64=r.readInt64=r.readByte=void 0;var i=e(1),o=e(7),u=e(8),s=o.fromNumber(128),a=o.fromNumber(127),f=a.not();function h(t){var r=t.read();if(-1===r)throw new i.IOError("End of stream");return r}function l(t){for(var r=0,e=0;r<32;){var n=h(t);if(e|=(127&n)<<r,0==(128&n))return e;r+=7}throw new i.IOError("Malformed int32")}function c(t,r){for(;0!=(-128&r);)t.write(127&r|128),r>>>=7;t.write(r)}function p(t,r){t.write(r)}function g(t){var r=l(t);return t.readMany(r)}function d(t,r){c(t,r.length),t.writeMany(r)}function y(t){var r=g(t);return r?u.uint8toUtf8(r):""}function w(t,r){d(t,u.uint8FromUtf8(r))}function v(t,r,e,i){var o,u;c(t,Object.keys(r).length);try{for(var s=n(Object.getOwnPropertyNames(r)),a=s.next();!a.done;a=s.next()){var f=a.value;e(t,f),i(t,r[f])}}catch(t){o={error:t}}finally{try{a&&!a.done&&(u=s.return)&&u.call(s)}finally{if(o)throw o.error}}}function _(t,r,e){for(var n=l(t),i={},o=0;o<n;++o){i[r(t)]=e(t)}return i}r.readByte=h,r.readInt64=function(t){for(var r=o.fromNumber(0),e=0;e<64;){var n=h(t),u=o.fromNumber(n);if(r=r.or(u.and(a).shiftLeft(e)),u.and(s).equals(0))return r;e+=7}throw new i.IOError("Malformed int64")},r.writeInt64=function(t,r){for(var e=r instanceof o?r:o.fromNumber(r,!1);!e.and(f).equals(0);)t.write(e.and(a).or(s).toInt()),e=e.shiftRightUnsigned(7);t.write(e.toInt())},r.readInt32=l,r.writeInt32=c,r.writeByte=p,r.readBytes=g,r.writeBytes=d,r.readString=y,r.writeString=w,r.writeCollection=function(t,r,e){var i,o;c(t,r.length);try{for(var u=n(r),s=u.next();!s.done;s=u.next()){e(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}}},r.readCollection=function(t,r){for(var e=l(t),n=[],i=0;i<e;++i)n.push(r(t));return n},r.readDictionary=function(t,r){return _(t,y,r)},r.writeDictionary=function(t,r,e){v(t,r,w,e)},r.writeObject=v,r.readObject=_,r.readMap=function(t,r,e){for(var n=l(t),i=new Map,o=0;o<n;++o){var u=r(t);i.set(u,e(t))}return i},r.writeMap=function(t,r,e,n){c(t,r.size),r.forEach((function(r,i){e(t,i),n(t,r)}))},r.readBoolean=function(t){return 0!==t.readInt8()},r.writeBoolean=function(t,r){t.writeInt8(r?1:0)},r.writeOptional=function(t,r,e,n){void 0===n&&(n=function(t){return null!=t}),n(r)?(p(t,1),e(t,r)):p(t,0)},r.readOptional=function(t,r){return h(t)?r(t):void 0}},function(t,r,e){"use strict";var n,i=this&&this.__extends||(n=function(t,r){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])})(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function e(){this.constructor=t}n(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)});Object.defineProperty(r,"__esModule",{value:!0}),r.InternalError=r.IllegalStateError=r.RetryLimitError=r.SchemaParseError=r.SchemaViolationError=r.InvalidFilterError=r.OutOfBoundsError=r.IllegalArgumentError=r.SessionError=r.IOError=r.InvalidDataError=r.AssertionError=r.RuntimeError=r.NullValueError=void 0;var o=function(t){function r(r){return t.call(this,r)||this}return i(r,t),r.prototype.getType=function(){return r.type},r.type="null_value_error",r}(Error);r.NullValueError=o;var u=function(t){function r(r,e){var n=t.call(this,r)||this;return n.cause=e,n}return i(r,t),r.prototype.getType=function(){return r.type},r.type="runtime_error",r}(Error);r.RuntimeError=u;var s=function(t){function r(r){return t.call(this,r)||this}return i(r,t),r.prototype.getType=function(){return r.type},r.type="assertion_error",r}(Error);r.AssertionError=s;var a=function(t){function r(r){return t.call(this,r)||this}return i(r,t),r.prototype.getType=function(){return r.type},r.type="invalid_data_error",r}(Error);r.InvalidDataError=a;var f=function(t){function r(r){return t.call(this,r)||this}return i(r,t),r.prototype.getType=function(){return r.type},r.type="io_error",r}(Error);r.IOError=f;var h=function(t){function r(r,e){var n=t.call(this,r)||this;return n.cause=e,n}return i(r,t),r.prototype.getType=function(){return r.type},r.type="session_error",r}(Error);r.SessionError=h;var l=function(t){function r(r){return t.call(this,r)||this}return i(r,t),r.prototype.getType=function(){return r.type},r.type="illegal_argument_error",r}(Error);r.IllegalArgumentError=l;var c=function(t){function r(r){return t.call(this,r)||this}return i(r,t),r.prototype.getType=function(){return r.type},r.type="out_of_bounds_error",r}(Error);r.OutOfBoundsError=c;var p=function(t){function r(r,e){var n=t.call(this,r)||this;return n.errors=e,n}return i(r,t),r.prototype.getType=function(){return r.type},r.type="invalid_filter_error",r}(Error);r.InvalidFilterError=p;var g=function(t){function r(r){return t.call(this,r)||this}return i(r,t),r.prototype.getType=function(){return r.type},r.type="schema_violation_error",r}(Error);r.SchemaViolationError=g;var d=function(t){function r(r){return t.call(this,r)||this}return i(r,t),r.prototype.getType=function(){return r.type},r.type="schema_parse_error",r}(Error);r.SchemaParseError=d;var y=function(t){function r(r){return t.call(this,r)||this}return i(r,t),r.prototype.getType=function(){return r.type},r.type="retry_limit_error",r}(Error);r.RetryLimitError=y;var w=function(t){function r(r){return t.call(this,r)||this}return i(r,t),r.prototype.getType=function(){return r.type},r.type="illegal_state_error",r}(Error);r.IllegalStateError=w;var v=function(t){function r(r){return t.call(this,r)||this}return i(r,t),r.prototype.getType=function(){return r.type},r.type="internal_error",r}(Error);r.InternalError=v},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.AbstractSerialiser=void 0;var n=e(1),i=function(){function t(){}return t.prototype.read=function(t){throw new n.InternalError("AbstractSerialiser#read is not implemented")},t.prototype.write=function(t,r){throw new n.InternalError("AbstractSerialiser#write is not implemented")},t}();r.AbstractSerialiser=i},function(t,r,e){"use strict";Object.defineProperty(r,"__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=e(4);window._diffusion_features.session_trees.SessionTreesImpl=n.SessionTreesImpl},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.SessionTreesImpl=void 0;var n=e(5),i=e(19),o=e(21),u=e(22),s=i.create("SessionTrees"),a=function(){function t(t){this.internal=t;var r=t.getServiceLocator();this.PUT_BRANCH_MAPPING_TABLE=r.obtain(n.PUT_BRANCH_MAPPING_TABLE),this.GET_SESSION_TREE_BRANCHES_WITH_MAPPINGS=r.obtain(n.GET_SESSION_TREE_BRANCHES_WITH_MAPPINGS),this.GET_BRANCH_MAPPING_TABLE=r.obtain(n.GET_BRANCH_MAPPING_TABLE)}return t.prototype.putBranchMappingTable=function(t){var r=this;return new Promise((function(e,n){o.requireNonNull(t,"branchMappingTable"),r.internal.checkConnected(n)&&r.PUT_BRANCH_MAPPING_TABLE.send(t,(function(t,r){u.responseSuccess(t,r)?e():(n(t),s.debug("Put branch mapping table failed"))}))}))},t.prototype.getSessionTreeBranchesWithMappings=function(){var t=this;return new Promise((function(r,e){t.internal.checkConnected(e)&&t.GET_SESSION_TREE_BRANCHES_WITH_MAPPINGS.send(null,(function(t,n){u.responseSuccess(t,n)?r(n.paths):(e(t),s.debug("Get session tree branches with mappings failed"))}))}))},t.prototype.getBranchMappingTable=function(t){var r=this;return new Promise((function(e,n){o.requireNonNull(t,"sessionTreeBranch"),r.internal.checkConnected(n)&&r.GET_BRANCH_MAPPING_TABLE.send(t,(function(t,r){u.responseSuccess(t,r)?e(r):(n(t),s.debug("Get branch mapping table failed"))}))}))},t}();r.SessionTreesImpl=a},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.GET_BRANCH_MAPPING_TABLE=r.GET_SESSION_TREE_BRANCHES_WITH_MAPPINGS=r.PUT_BRANCH_MAPPING_TABLE=void 0;var n=e(6),i=e(14),o=e(15),u=e(17);r.PUT_BRANCH_MAPPING_TABLE={id:176,request:o.BranchMappingTableSerialiser,response:i.NullSerialiser},r.GET_SESSION_TREE_BRANCHES_WITH_MAPPINGS={id:177,request:i.NullSerialiser,response:u.SessionTreeBranchListSerialiser},r.GET_BRANCH_MAPPING_TABLE={id:178,request:n.StringSerialiser,response:o.BranchMappingTableSerialiser}},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.StringSerialiser=r.StringSerialiserClass=void 0;var n=e(0),i=function(){function t(){}return t.prototype.read=function(t){return n.readString(t)},t.prototype.write=function(t,r){n.writeString(t,r)},t}();r.StringSerialiserClass=i,r.StringSerialiser=new i},function(t,r){t.exports=n;var e=null;try{e=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,r,e){this.low=0|t,this.high=0|r,this.unsigned=!!e}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,r){var e,n,i;return r?(i=0<=(t>>>=0)&&t<256)&&(n=u[t])?n:(e=f(t,(0|t)<0?-1:0,!0),i&&(u[t]=e),e):(i=-128<=(t|=0)&&t<128)&&(n=o[t])?n:(e=f(t,t<0?-1:0,!1),i&&(o[t]=e),e)}function a(t,r){if(isNaN(t))return r?v:w;if(r){if(t<0)return v;if(t>=g)return A}else{if(t<=-d)return S;if(t+1>=d)return m}return t<0?a(-t,r).neg():f(t%p|0,t/p|0,r)}function f(t,r,e){return new n(t,r,e)}n.fromInt=s,n.fromNumber=a,n.fromBits=f;var h=Math.pow;function l(t,r,e){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return w;if("number"==typeof r?(e=r,r=!1):r=!!r,(e=e||10)<2||36<e)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return l(t.substring(1),r,e).neg();for(var i=a(h(e,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),e);if(s<8){var c=a(h(e,s));o=o.mul(c).add(a(f))}else o=(o=o.mul(i)).add(a(f))}return o.unsigned=r,o}function c(t,r){return"number"==typeof t?a(t,r):"string"==typeof t?l(t,r):f(t.low,t.high,"boolean"==typeof r?r:t.unsigned)}n.fromString=l,n.fromValue=c;var p=4294967296,g=p*p,d=g/2,y=s(1<<24),w=s(0);n.ZERO=w;var v=s(0,!0);n.UZERO=v;var _=s(1);n.ONE=_;var b=s(1,!0);n.UONE=b;var E=s(-1);n.NEG_ONE=E;var m=f(-1,2147483647,!1);n.MAX_VALUE=m;var A=f(-1,-1,!0);n.MAX_UNSIGNED_VALUE=A;var S=f(0,-2147483648,!1);n.MIN_VALUE=S;var T=n.prototype;T.toInt=function(){return this.unsigned?this.low>>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},T.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(S)){var r=a(t),e=this.div(r),n=e.mul(r).sub(this);return e.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}},T.getHighBits=function(){return this.high},T.getHighBitsUnsigned=function(){return this.high>>>0},T.getLowBits=function(){return this.low},T.getLowBitsUnsigned=function(){return this.low>>>0},T.getNumBitsAbs=function(){if(this.isNegative())return this.eq(S)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,r=31;r>0&&0==(t&1<<r);r--);return 0!=this.high?r+33:r+1},T.isZero=function(){return 0===this.high&&0===this.low},T.eqz=T.isZero,T.isNegative=function(){return!this.unsigned&&this.high<0},T.isPositive=function(){return this.unsigned||this.high>=0},T.isOdd=function(){return 1==(1&this.low)},T.isEven=function(){return 0==(1&this.low)},T.equals=function(t){return i(t)||(t=c(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},T.eq=T.equals,T.notEquals=function(t){return!this.eq(t)},T.neq=T.notEquals,T.ne=T.notEquals,T.lessThan=function(t){return this.comp(t)<0},T.lt=T.lessThan,T.lessThanOrEqual=function(t){return this.comp(t)<=0},T.lte=T.lessThanOrEqual,T.le=T.lessThanOrEqual,T.greaterThan=function(t){return this.comp(t)>0},T.gt=T.greaterThan,T.greaterThanOrEqual=function(t){return this.comp(t)>=0},T.gte=T.greaterThanOrEqual,T.ge=T.greaterThanOrEqual,T.compare=function(t){if(i(t)||(t=c(t)),this.eq(t))return 0;var r=this.isNegative(),e=t.isNegative();return r&&!e?-1:!r&&e?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},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(S)?S:this.not().add(_)},T.neg=T.negate,T.add=function(t){i(t)||(t=c(t));var r=this.high>>>16,e=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,l=0,p=0,g=0;return p+=(g+=o+(65535&t.low))>>>16,l+=(p+=n+a)>>>16,h+=(l+=e+s)>>>16,h+=r+u,f((p&=65535)<<16|(g&=65535),(h&=65535)<<16|(l&=65535),this.unsigned)},T.subtract=function(t){return i(t)||(t=c(t)),this.add(t.neg())},T.sub=T.subtract,T.multiply=function(t){if(this.isZero())return w;if(i(t)||(t=c(t)),e)return f(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return w;if(this.eq(S))return t.isOdd()?S:w;if(t.eq(S))return this.isOdd()?S: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(y)&&t.lt(y))return a(this.toNumber()*t.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,o=this.low>>>16,u=65535&this.low,s=t.high>>>16,h=65535&t.high,l=t.low>>>16,p=65535&t.low,g=0,d=0,v=0,_=0;return v+=(_+=u*p)>>>16,d+=(v+=o*p)>>>16,v&=65535,d+=(v+=u*l)>>>16,g+=(d+=n*p)>>>16,d&=65535,g+=(d+=o*l)>>>16,d&=65535,g+=(d+=u*h)>>>16,g+=r*p+n*l+o*h+u*s,f((v&=65535)<<16|(_&=65535),(g&=65535)<<16|(d&=65535),this.unsigned)},T.mul=T.multiply,T.divide=function(t){if(i(t)||(t=c(t)),t.isZero())throw Error("division by zero");var r,n,o;if(e)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?f((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.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 b;o=v}else{if(this.eq(S))return t.eq(_)||t.eq(E)?S:t.eq(S)?_:(r=this.shr(1).div(t).shl(1)).eq(w)?t.isNegative()?_:E:(n=this.sub(t.mul(r)),o=r.add(n.div(t)));if(t.eq(S))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);){r=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var u=Math.ceil(Math.log(r)/Math.LN2),s=u<=48?1:h(2,u-48),l=a(r),p=l.mul(t);p.isNegative()||p.gt(n);)p=(l=a(r-=s,this.unsigned)).mul(t);l.isZero()&&(l=_),o=o.add(l),n=n.sub(p)}return o},T.div=T.divide,T.modulo=function(t){return i(t)||(t=c(t)),e?f((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},T.mod=T.modulo,T.rem=T.modulo,T.not=function(){return f(~this.low,~this.high,this.unsigned)},T.and=function(t){return i(t)||(t=c(t)),f(this.low&t.low,this.high&t.high,this.unsigned)},T.or=function(t){return i(t)||(t=c(t)),f(this.low|t.low,this.high|t.high,this.unsigned)},T.xor=function(t){return i(t)||(t=c(t)),f(this.low^t.low,this.high^t.high,this.unsigned)},T.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)},T.shl=T.shiftLeft,T.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)},T.shr=T.shiftRight,T.shiftRightUnsigned=function(t){if(i(t)&&(t=t.toInt()),0===(t&=63))return this;var r=this.high;return t<32?f(this.low>>>t|r<<32-t,r>>>t,this.unsigned):f(32===t?r:r>>>t-32,0,this.unsigned)},T.shru=T.shiftRightUnsigned,T.shr_u=T.shiftRightUnsigned,T.toSigned=function(){return this.unsigned?f(this.low,this.high,!1):this},T.toUnsigned=function(){return this.unsigned?this:f(this.low,this.high,!0)},T.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},T.toBytesLE=function(){var t=this.high,r=this.low;return[255&r,r>>>8&255,r>>>16&255,r>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},T.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,r>>>24,r>>>16&255,r>>>8&255,255&r]},n.fromBytes=function(t,r,e){return e?n.fromBytesLE(t,r):n.fromBytesBE(t,r)},n.fromBytesLE=function(t,r){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,r)},n.fromBytesBE=function(t,r){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],r)}},function(t,r,e){"use strict";(function(t){var e=this&&this.__values||function(t){var r="function"==typeof Symbol&&Symbol.iterator,e=r&&t[r],n=0;if(e)return e.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(r?"Object is not iterable.":"Symbol.iterator is not defined.")},n=this&&this.__read||function(t,r){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var n,i,o=e.call(t),u=[];try{for(;(void 0===r||r-- >0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(e=o.return)&&e.call(o)}finally{if(i)throw i.error}}return u},i=this&&this.__spreadArray||function(t,r){for(var e=0,n=r.length,i=t.length;e<n;e++,i++)t[i]=r[e];return t};function o(t){for(var r=[],e=0;e<t.length;e+=128)r.push(t.subarray(e,Math.min(e+128,t.length)));return r.map((function(t){return String.fromCharCode.apply(String,i([],n(t)))})).join("")}Object.defineProperty(r,"__esModule",{value:!0}),r.isUint8Array=r.isEqualUint8Arrays=r.uint8toUtf8=r.uint8ToBase64=r.uint8ToAscii=r.uint8FromDoubleBE=r.uint8FromBase64=r.uint8FromUtf8=r.uint8FromBinary=r.writeInt32BE=r.writeInt8=r.readDoubleBE=r.readFloatBE=r.readInt32BE=r.readUInt32BE=r.readUInt16BE=r.readInt8=r.concatUint8Arrays=void 0,r.concatUint8Arrays=function(t){var r,n,i=t.reduce((function(t,r){return t+r.length}),0),o=new Uint8Array(i),u=0;try{for(var s=e(t),a=s.next();!a.done;a=s.next()){var f=a.value;o.set(f,u),u+=f.length}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return o},r.readInt8=function(t,r){return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(r)},r.readUInt16BE=function(t,r){return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint16(r,!1)},r.readUInt32BE=function(t,r){return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint32(r,!1)},r.readInt32BE=function(t,r){return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt32(r,!1)},r.readFloatBE=function(t,r){return new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(r,!1)},r.readDoubleBE=function(t,r){return new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(r,!1)},r.writeInt8=function(t,r,e){t[r]=e},r.writeInt32BE=function(t,r,e){new DataView(t.buffer,t.byteOffset,t.byteLength).setInt32(r,e,!1)},r.uint8FromBinary=function(t){for(var r=new Uint8Array(t.length),e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r},r.uint8FromUtf8=function(t){return(new TextEncoder).encode(t)},r.uint8FromBase64="undefined"==typeof window||void 0===window.atob?function(r){return new Uint8Array(t.from(r,"base64"))}:function(t){return new Uint8Array(window.atob(t).split("").map((function(t){return t.charCodeAt(0)})))},r.uint8FromDoubleBE=function(t){var r=new ArrayBuffer(8);return new DataView(r).setFloat64(0,t,!1),new Uint8Array(r)},r.uint8ToAscii=o,r.uint8ToBase64="undefined"==typeof window||void 0===window.btoa?function(r){return t.from(r).toString("base64")}:function(t){return window.btoa(o(t))},r.uint8toUtf8=function(t,r,e){return void 0===r&&(r=0),void 0===e&&(e=t.length),(new TextDecoder).decode(t.subarray(r,e))},r.isEqualUint8Arrays=function(t,r){if(t.length!==r.length)return!1;for(var e=0;e<t.length;++e)if(t[e]!==r[e])return!1;return!0},r.isUint8Array=function(t){return"function"==typeof Uint8Array&&t instanceof Uint8Array||"[object Uint8Array]"===Object.prototype.toString.call(t)}}).call(this,e(9).Buffer)},function(t,r,e){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <http://feross.org> * @license MIT */ var n=e(11),i=e(12),o=e(13);function u(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,r){if(u()<r)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=a.prototype:(null===t&&(t=new a(r)),t.length=r),t}function a(t,r,e){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return f(this,t,r,e)}function f(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);a.TYPED_ARRAY_SUPPORT?(t=r).__proto__=a.prototype:t=c(t,r);return t}(t,r,e,n):"string"==typeof r?function(t,r,e){"string"==typeof e&&""!==e||(e="utf8");if(!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|g(r,e),i=(t=s(t,n)).write(r,e);i!==n&&(t=t.slice(0,i));return t}(t,r,e):function(t,r){if(a.isBuffer(r)){var e=0|p(r.length);return 0===(t=s(t,e)).length||r.copy(t,0,0,e),t}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(n=r.length)!=n?s(t,0):c(t,r);if("Buffer"===r.type&&o(r.data))return c(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}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 l(t,r){if(h(r),t=s(t,r<0?0:0|p(r)),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function c(t,r){var e=r.length<0?0:0|p(r.length);t=s(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[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 g(t,r){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 e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return F(t).length;default:if(n)return q(t).length;r=(""+r).toLowerCase(),n=!0}}function d(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,r,e);case"utf8":case"utf-8":return B(this,r,e);case"ascii":return I(this,r,e);case"latin1":case"binary":return P(this,r,e);case"base64":return T(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function w(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=a.from(r,n)),a.isBuffer(r))return 0===r.length?-1:v(t,r,e,n,i);if("number"==typeof r)return r&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):v(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,r,e,n,i){var o,u=1,s=t.length,a=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,s/=2,a/=2,e/=2}function f(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var h=-1;for(o=e;o<s;o++)if(f(t,o)===f(r,-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(e+a>s&&(e=s-a),o=e;o>=0;o--){for(var l=!0,c=0;c<a;c++)if(f(t,o+c)!==f(r,c)){l=!1;break}if(l)return o}return-1}function _(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.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(r.substr(2*u,2),16);if(isNaN(s))return u;t[e+u]=s}return u}function b(t,r,e,n){return G(q(r,t.length-e),t,e,n)}function E(t,r,e,n){return G(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function m(t,r,e,n){return E(t,r,e,n)}function A(t,r,e,n){return G(F(r),t,e,n)}function S(t,r,e,n){return G(function(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)e=t.charCodeAt(u),n=e>>8,i=e%256,o.push(i),o.push(n);return o}(r,t.length-e),t,e,n)}function T(t,r,e){return 0===r&&e===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(r,e))}function B(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,s,a,f=t[i],h=null,l=f>239?4:f>223?3:f>191?2:1;if(i+l<=e)switch(l){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,l=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=l}return function(t){var r=t.length;if(r<=4096)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return e}(n)}r.Buffer=a,r.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},r.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}}(),r.kMaxLength=u(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,r,e){return f(null,t,r,e)},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,r,e){return function(t,r,e,n){return h(r),r<=0?s(t,r):void 0!==e?"string"==typeof n?s(t,r).fill(e,n):s(t,r).fill(e):s(t,r)}(null,t,r,e)},a.allocUnsafe=function(t){return l(null,t)},a.allocUnsafeSlow=function(t){return l(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,r){if(!a.isBuffer(t)||!a.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?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,r){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=a.allocUnsafe(r),i=0;for(e=0;e<t.length;++e){var u=t[e];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=g,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 r=0;r<t;r+=2)y(this,r,r+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 r=0;r<t;r+=4)y(this,r,r+3),y(this,r+1,r+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 r=0;r<t;r+=8)y(this,r,r+7),y(this,r+1,r+6),y(this,r+2,r+5),y(this,r+3,r+4);return this},a.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?B(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="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},a.prototype.compare=function(t,r,e,n,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),s=Math.min(o,u),f=this.slice(n,i),h=t.slice(r,e),l=0;l<s;++l)if(f[l]!==h[l]){o=f[l],u=h[l];break}return o<u?-1:u<o?1:0},a.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},a.prototype.indexOf=function(t,r,e){return w(this,t,r,e,!0)},a.prototype.lastIndexOf=function(t,r,e){return w(this,t,r,e,!1)},a.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return _(this,t,r,e);case"utf8":case"utf-8":return b(this,t,r,e);case"ascii":return E(this,t,r,e);case"latin1":case"binary":return m(this,t,r,e);case"base64":return A(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,r,e);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,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function P(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function R(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Y(t[o]);return i}function O(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function N(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function U(t,r,e,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function M(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function L(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function C(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function x(t,r,e,n,o){return o||C(t,0,e,4),i.write(t,r,e,n,23,4),e+4}function j(t,r,e,n,o){return o||C(t,0,e,8),i.write(t,r,e,n,52,8),e+8}a.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),a.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=a.prototype;else{var i=r-t;e=new a(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},a.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||N(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},a.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||N(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},a.prototype.readUInt8=function(t,r){return r||N(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,r){return r||N(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,r){return r||N(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,r){return r||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,r){return r||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||N(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},a.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||N(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},a.prototype.readInt8=function(t,r){return r||N(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,r){r||N(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},a.prototype.readInt16BE=function(t,r){r||N(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},a.prototype.readInt32LE=function(t,r){return r||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,r){return r||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,r){return r||N(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,r){return r||N(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,r){return r||N(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,r){return r||N(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||U(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},a.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||U(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},a.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},a.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):M(this,t,r,!0),r+2},a.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):M(this,t,r,!1),r+2},a.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):L(this,t,r,!0),r+4},a.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):L(this,t,r,!1),r+4},a.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);U(this,t,r,e,i-1,-i)}var o=0,u=1,s=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===s&&0!==this[r+o-1]&&(s=1),this[r+o]=(t/u>>0)-s&255;return r+e},a.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);U(this,t,r,e,i-1,-i)}var o=e-1,u=1,s=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===s&&0!==this[r+o+1]&&(s=1),this[r+o]=(t/u>>0)-s&255;return r+e},a.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},a.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):M(this,t,r,!0),r+2},a.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):M(this,t,r,!1),r+2},a.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):L(this,t,r,!0),r+4},a.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):L(this,t,r,!1),r+4},a.prototype.writeFloatLE=function(t,r,e){return x(this,t,r,!0,e)},a.prototype.writeFloatBE=function(t,r,e){return x(this,t,r,!1,e)},a.prototype.writeDoubleLE=function(t,r,e){return j(this,t,r,!0,e)},a.prototype.writeDoubleBE=function(t,r,e){return j(this,t,r,!1,e)},a.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=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-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},a.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=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(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=a.isBuffer(t)?t:q(new a(t,n).toString()),s=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%s]}return this};var D=/[^+\/0-9A-Za-z-_]/g;function Y(t){return t<16?"0"+t.toString(16):t.toString(16)}function q(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function F(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}}).call(this,e(10))},function(t,r){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,r,e){"use strict";r.byteLength=function(t){var r=f(t),e=r[0],n=r[1];return 3*(e+n)/4-n},r.toByteArray=function(t){var r,e,n=f(t),u=n[0],s=n[1],a=new o(function(t,r,e){return 3*(r+e)/4-e}(0,u,s)),h=0,l=s>0?u-4:u;for(e=0;e<l;e+=4)r=i[t.charCodeAt(e)]<<18|i[t.charCodeAt(e+1)]<<12|i[t.charCodeAt(e+2)]<<6|i[t.charCodeAt(e+3)],a[h++]=r>>16&255,a[h++]=r>>8&255,a[h++]=255&r;2===s&&(r=i[t.charCodeAt(e)]<<2|i[t.charCodeAt(e+1)]>>4,a[h++]=255&r);1===s&&(r=i[t.charCodeAt(e)]<<10|i[t.charCodeAt(e+1)]<<4|i[t.charCodeAt(e+2)]>>2,a[h++]=r>>8&255,a[h++]=255&r);return a},r.fromByteArray=function(t){for(var r,e=t.length,i=e%3,o=[],u=0,s=e-i;u<s;u+=16383)o.push(h(t,u,u+16383>s?s:u+16383));1===i?(r=t[e-1],o.push(n[r>>2]+n[r<<4&63]+"==")):2===i&&(r=(t[e-2]<<8)+t[e-1],o.push(n[r>>10]+n[r>>4&63]+n[r<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=u.length;s<a;++s)n[s]=u[s],i[u.charCodeAt(s)]=s;function f(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function h(t,r,e){for(var i,o,u=[],s=r;s<e;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),u.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return u.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,r){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ r.read=function(t,r,e,n,i){var o,u,s=8*i-n-1,a=(1<<s)-1,f=a>>1,h=-7,l=e?i-1:0,c=e?-1:1,p=t[r+l];for(l+=c,o=p&(1<<-h)-1,p>>=-h,h+=s;h>0;o=256*o+t[r+l],l+=c,h-=8);for(u=o&(1<<-h)-1,o>>=-h,h+=n;h>0;u=256*u+t[r+l],l+=c,h-=8);if(0===o)o=1-f;else{if(o===a)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),o-=f}return(p?-1:1)*u*Math.pow(2,o-n)},r.write=function(t,r,e,n,i,o){var u,s,a,f=8*o-i-1,h=(1<<f)-1,l=h>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,d=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,u=h):(u=Math.floor(Math.log(r)/Math.LN2),r*(a=Math.pow(2,-u))<1&&(u--,a*=2),(r+=u+l>=1?c/a:c*Math.pow(2,1-l))*a>=2&&(u++,a/=2),u+l>=h?(s=0,u=h):u+l>=1?(s=(r*a-1)*Math.pow(2,i),u+=l):(s=r*Math.pow(2,l-1)*Math.pow(2,i),u=0));i>=8;t[e+p]=255&s,p+=g,s/=256,i-=8);for(u=u<<i|s,f+=i;f>0;t[e+p]=255&u,p+=g,u/=256,f-=8);t[e+p-g]|=128*d}},function(t,r){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.NullSerialiser=void 0,r.NullSerialiser={read:function(){return null},write:function(){}}},function(t,r,e){"use strict";var n,i=this&&this.__extends||(n=function(t,r){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])})(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function e(){this.constructor=t}n(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)});Object.defineProperty(r,"__esModule",{value:!0}),r.BranchMappingTableSerialiser=r.BranchMappingTableSerialiserClass=void 0;var o=e(16),u=e(0);function s(t,r){u.writeString(t,r.sessionFilter),u.writeString(t,r.topicTreeBranch)}function a(t){return{sessionFilter:u.readString(t),topicTreeBranch:u.readString(t)}}var f=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return i(r,t),r.prototype.read=function(t){var r=u.readString(t),e=u.readCollection(t,a);return new o.BranchMappingTableImpl(r,e)},r.prototype.write=function(t,r){u.writeString(t,r.getSessionTreeBranch()),u.writeCollection(t,r.getBranchMappings(),s)},r}(e(2).AbstractSerialiser);r.BranchMappingTableSerialiserClass=f,r.BranchMappingTableSerialiser=new f},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.BranchMappingTableImpl=void 0;var n=function(){function t(t,r){this.sessionTreeBranch=t,this.branchMappings=r}return t.prototype.getSessionTreeBranch=function(){return this.sessionTreeBranch},t.prototype.getBranchMappings=function(){return this.branchMappings},t}();r.BranchMappingTableImpl=n},function(t,r,e){"use strict";var n,i=this&&this.__extends||(n=function(t,r){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])})(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function e(){this.constructor=t}n(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)});Object.defineProperty(r,"__esModule",{value:!0}),r.SessionTreeBranchListSerialiser=r.SessionTreeBranchListSerialiserClass=void 0;var o=e(0),u=e(2),s=e(18),a=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return i(r,t),r.prototype.read=function(t){var r=o.readCollection(t,o.readString);return new s.SessionTreeBranchList(r)},r}(u.AbstractSerialiser);r.SessionTreeBranchListSerialiserClass=a,r.SessionTreeBranchListSerialiser=new a},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.SessionTreeBranchList=void 0;var n=function(t){this.paths=t};r.SessionTreeBranchList=n},function(t,r,e){"use strict";var n=this&&this.__values||function(t){var r="function"==typeof Symbol&&Symbol.iterator,e=r&&t[r],n=0;if(e)return e.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(r?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(r,"__esModule",{value:!0}),r.setLevel=r.create=r.LoggingLevel=void 0;var i,o=e(20);function u(t,r){var e="|"+t.toUpperCase()+"|"+r+"|",n=function(){return new Date};return function(r,i){i?o[t](n()+e+r,i):o[t](n()+e+r)}}!function(t){t.trace="trace",t.debug="debug",t.info="info",t.warn="warn",t.error="error"}(i=r.LoggingLevel||(r.LoggingLevel={})),r.create=function(t){var r,e,o={};try{for(var s=n(Object.keys(i)),a=s.next();!a.done;a=s.next()){var f=a.value;o[f]=u(f,t)}}catch(t){r={error:t}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(r)throw r.error}}return o},r.setLevel=o.setLevel},function(t,r,e){var n,i;!function(o,u){"use strict";void 0===(i="function"==typeof(n=function(){var t=function(){},r="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent),e=["trace","debug","info","warn","error"];function n(t,r){var e=t[r];if("function"==typeof e.bind)return e.bind(t);try{return Function.prototype.bind.call(e,t)}catch(r){return function(){return Function.prototype.apply.apply(e,[t,arguments])}}}function i(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function o(e){return"debug"===e&&(e="log"),"undefined"!=typeof console&&("trace"===e&&r?i:void 0!==console[e]?n(console,e):void 0!==console.log?n(console,"