diffusion
Version:
Diffusion JavaScript client
8 lines • 97 kB
JavaScript
!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=22)}([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 s=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=s;var u=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=u;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 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="io_error",e}(Error);e.IOError=c;var f=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=f;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="illegal_argument_error",e}(Error);e.IllegalArgumentError=l;var p=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=p;var h=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=h;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_violation_error",e}(Error);e.SchemaViolationError=d;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_parse_error",e}(Error);e.SchemaParseError=y;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 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="illegal_state_error",e}(Error);e.IllegalStateError=v;var E=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=E},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,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(12),s=r(13),u=o.fromNumber(128),a=o.fromNumber(127),c=a.not();function f(t){var e=t.read();if(-1===e)throw new i.IOError("End of stream");return e}function l(t){for(var e=0,r=0;e<32;){var n=f(t);if(r|=(127&n)<<e,0==(128&n))return r;e+=7}throw new i.IOError("Malformed int32")}function p(t,e){for(;0!=(-128&e);)t.write(127&e|128),e>>>=7;t.write(e)}function h(t,e){t.write(e)}function d(t){var e=l(t);return t.readMany(e)}function y(t,e){p(t,e.length),t.writeMany(e)}function g(t){var e=d(t);return e?s.uint8toUtf8(e):""}function v(t,e){y(t,s.uint8FromUtf8(e))}function E(t,e,r,i){var o,s;p(t,Object.keys(e).length);try{for(var u=n(Object.getOwnPropertyNames(e)),a=u.next();!a.done;a=u.next()){var c=a.value;r(t,c),i(t,e[c])}}catch(t){o={error:t}}finally{try{a&&!a.done&&(s=u.return)&&s.call(u)}finally{if(o)throw o.error}}}function _(t,e,r){for(var n=l(t),i={},o=0;o<n;++o){i[e(t)]=r(t)}return i}e.readByte=f,e.readInt64=function(t){for(var e=o.fromNumber(0),r=0;r<64;){var n=f(t),s=o.fromNumber(n);if(e=e.or(s.and(a).shiftLeft(r)),s.and(u).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(c).equals(0);)t.write(r.and(a).or(u).toInt()),r=r.shiftRightUnsigned(7);t.write(r.toInt())},e.readInt32=l,e.writeInt32=p,e.writeByte=h,e.readBytes=d,e.writeBytes=y,e.readString=g,e.writeString=v,e.writeCollection=function(t,e,r){var i,o;p(t,e.length);try{for(var s=n(e),u=s.next();!u.done;u=s.next()){r(t,u.value)}}catch(t){i={error:t}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}},e.readCollection=function(t,e){for(var r=l(t),n=[],i=0;i<r;++i)n.push(e(t));return n},e.readDictionary=function(t,e){return _(t,g,e)},e.writeDictionary=function(t,e,r){E(t,e,v,r)},e.writeObject=E,e.readObject=_,e.readMap=function(t,e,r){for(var n=l(t),i=new Map,o=0;o<n;++o){var s=e(t);i.set(s,r(t))}return i},e.writeMap=function(t,e,r,n){p(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)?(h(t,1),r(t,e)):h(t,0)},e.readOptional=function(t,e){return f(t)?e(t):void 0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CIDSerialiser=e.CIDSerialiserClass=void 0;var n=r(34),i=r(2),o=function(){function t(){}return t.prototype.read=function(t){return new n.ConversationId(i.readInt64(t))},t.prototype.write=function(t,e){i.writeInt64(t,e.val)},t}();e.CIDSerialiserClass=o,e.CIDSerialiser=new o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DescendantQualifier=e.DQ=e.canonicalise=e.split=e.PATH_SEPARATOR=void 0,e.PATH_SEPARATOR="/",e.split=function(t){return t.split(e.PATH_SEPARATOR)},e.canonicalise=function(t){if(!t)return"";var r=t.length,n=r>0&&t.charAt(0)===e.PATH_SEPARATOR?1:0,i=r>1&&t.charAt(r-1)===e.PATH_SEPARATOR?1:0;return t.substring(n,r-i)};var n=function(t){this.includesDescendants=t};e.DQ=n,e.DescendantQualifier=Object.freeze({MATCH:new n(!1),DESCENDANTS_OF_MATCH:new n(!0),MATCH_AND_DESCENDANTS:new n(!0)})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractTopicSelector=void 0;var n=r(4),i=function(){function t(t,e,r){this.type=t,this.prefix=e,this.expression=r}return t.prototype.selects=function(t){var e=n.canonicalise(t);return 0===e.indexOf(this.prefix)&&this.doSelects(e)},t.prototype.toString=function(){return this.expression},t}();e.AbstractTopicSelector=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.write=e.read=void 0;var n=r(0),i=r(2);e.read=function(t,e){var r=i.readByte(t);if(void 0===e[r])throw new n.IllegalArgumentError("Unable to decode enum value "+r);return e[e[r]]},e.write=function(t,e){"number"==typeof e?i.writeByte(t,e):i.writeByte(t,e.id)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TopicTypeEnum=e.TopicType=void 0;var n=r(16),i=function(t,e,r){this.id=t,this.stateful=e,this.functional=r};e.TopicType=i,e.TopicTypeEnum={BINARY:new i(14,!0,!1),JSON:new i(15,!0,!1),STRING:new i(17,!0,!1),INT64:new i(18,!0,!1),DOUBLE:new i(19,!0,!1),TIME_SERIES:new i(16,!0,!1),RECORD_V2:new i(20,!0,!1),UNKNOWN_TOPIC_TYPE:new i(21,!1,!1)},n.enumerize(e.TopicTypeEnum)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TopicNotificationType=void 0,function(t){t[t.ADDED=0]="ADDED",t[t.SELECTED=1]="SELECTED",t[t.REMOVED=2]="REMOVED",t[t.DESELECTED=3]="DESELECTED"}(e.TopicNotificationType||(e.TopicNotificationType={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Type=e.Prefix=void 0,function(t){t.PATH=">",t.SPLIT_PATH_PATTERN="?",t.FULL_PATH_PATTERN="*",t.SELECTOR_SET="#"}(e.Prefix||(e.Prefix={})),function(t){t.PATH=">",t.SPLIT_PATH_PATTERN="?",t.FULL_PATH_PATTERN="*",t.SELECTOR_SET="#"}(e.Type||(e.Type={}))},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.MessageReceiverControlRegistrationParamsSerialiser=e.MessageReceiverControlRegistrationParamsSerialiserClass=void 0;var o=r(11),s=r(2),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.write=function(t,e){s.writeInt32(t,e.definition.id),o.ControlGroupSerialiser.write(t,e.group),s.writeString(t,e.path),s.writeCollection(t,e.keys,s.writeString)},e}(r(1).AbstractSerialiser);e.MessageReceiverControlRegistrationParamsSerialiserClass=u,e.MessageReceiverControlRegistrationParamsSerialiser=new u},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.ControlGroupSerialiser=e.ControlGroupSerialiserClass=void 0;var o=r(27),s=r(2),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.read=function(t){var e=s.readString(t);return new o.ControlGroup(e)},e.prototype.write=function(t,e){s.writeString(t,e.name)},e}(r(1).AbstractSerialiser);e.ControlGroupSerialiserClass=u,e.ControlGroupSerialiser=new u},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={},s={};function u(t,e){var r,n,i;return e?(i=0<=(t>>>=0)&&t<256)&&(n=s[t])?n:(r=c(t,(0|t)<0?-1:0,!0),i&&(s[t]=r),r):(i=-128<=(t|=0)&&t<128)&&(n=o[t])?n:(r=c(t,t<0?-1:0,!1),i&&(o[t]=r),r)}function a(t,e){if(isNaN(t))return e?E:v;if(e){if(t<0)return E;if(t>=d)return b}else{if(t<=-y)return O;if(t+1>=y)return S}return t<0?a(-t,e).neg():c(t%h|0,t/h|0,e)}function c(t,e,r){return new n(t,e,r)}n.fromInt=u,n.fromNumber=a,n.fromBits=c;var f=Math.pow;function l(t,e,r){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return v;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 l(t.substring(1),e,r).neg();for(var i=a(f(r,8)),o=v,s=0;s<t.length;s+=8){var u=Math.min(8,t.length-s),c=parseInt(t.substring(s,s+u),r);if(u<8){var p=a(f(r,u));o=o.mul(p).add(a(c))}else o=(o=o.mul(i)).add(a(c))}return o.unsigned=e,o}function p(t,e){return"number"==typeof t?a(t,e):"string"==typeof t?l(t,e):c(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}n.fromString=l,n.fromValue=p;var h=4294967296,d=h*h,y=d/2,g=u(1<<24),v=u(0);n.ZERO=v;var E=u(0,!0);n.UZERO=E;var _=u(1);n.ONE=_;var T=u(1,!0);n.UONE=T;var w=u(-1);n.NEG_ONE=w;var S=c(-1,2147483647,!1);n.MAX_VALUE=S;var b=c(-1,-1,!0);n.MAX_UNSIGNED_VALUE=b;var O=c(0,-2147483648,!1);n.MIN_VALUE=O;var I=n.prototype;I.toInt=function(){return this.unsigned?this.low>>>0:this.low},I.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},I.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(O)){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(f(t,6),this.unsigned),o=this,s="";;){var u=o.div(i),c=(o.sub(u.mul(i)).toInt()>>>0).toString(t);if((o=u).isZero())return c+s;for(;c.length<6;)c="0"+c;s=""+c+s}},I.getHighBits=function(){return this.high},I.getHighBitsUnsigned=function(){return this.high>>>0},I.getLowBits=function(){return this.low},I.getLowBitsUnsigned=function(){return this.low>>>0},I.getNumBitsAbs=function(){if(this.isNegative())return this.eq(O)?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},I.isZero=function(){return 0===this.high&&0===this.low},I.eqz=I.isZero,I.isNegative=function(){return!this.unsigned&&this.high<0},I.isPositive=function(){return this.unsigned||this.high>=0},I.isOdd=function(){return 1==(1&this.low)},I.isEven=function(){return 0==(1&this.low)},I.equals=function(t){return i(t)||(t=p(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},I.eq=I.equals,I.notEquals=function(t){return!this.eq(t)},I.neq=I.notEquals,I.ne=I.notEquals,I.lessThan=function(t){return this.comp(t)<0},I.lt=I.lessThan,I.lessThanOrEqual=function(t){return this.comp(t)<=0},I.lte=I.lessThanOrEqual,I.le=I.lessThanOrEqual,I.greaterThan=function(t){return this.comp(t)>0},I.gt=I.greaterThan,I.greaterThanOrEqual=function(t){return this.comp(t)>=0},I.gte=I.greaterThanOrEqual,I.ge=I.greaterThanOrEqual,I.compare=function(t){if(i(t)||(t=p(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},I.comp=I.compare,I.negate=function(){return!this.unsigned&&this.eq(O)?O:this.not().add(_)},I.neg=I.negate,I.add=function(t){i(t)||(t=p(t));var e=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,s=t.high>>>16,u=65535&t.high,a=t.low>>>16,f=0,l=0,h=0,d=0;return h+=(d+=o+(65535&t.low))>>>16,l+=(h+=n+a)>>>16,f+=(l+=r+u)>>>16,f+=e+s,c((h&=65535)<<16|(d&=65535),(f&=65535)<<16|(l&=65535),this.unsigned)},I.subtract=function(t){return i(t)||(t=p(t)),this.add(t.neg())},I.sub=I.subtract,I.multiply=function(t){if(this.isZero())return v;if(i(t)||(t=p(t)),r)return c(r.mul(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned);if(t.isZero())return v;if(this.eq(O))return t.isOdd()?O:v;if(t.eq(O))return this.isOdd()?O:v;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,s=65535&this.low,u=t.high>>>16,f=65535&t.high,l=t.low>>>16,h=65535&t.low,d=0,y=0,E=0,_=0;return E+=(_+=s*h)>>>16,y+=(E+=o*h)>>>16,E&=65535,y+=(E+=s*l)>>>16,d+=(y+=n*h)>>>16,y&=65535,d+=(y+=o*l)>>>16,y&=65535,d+=(y+=s*f)>>>16,d+=e*h+n*l+o*f+s*u,c((E&=65535)<<16|(_&=65535),(d&=65535)<<16|(y&=65535),this.unsigned)},I.mul=I.multiply,I.divide=function(t){if(i(t)||(t=p(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?c((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?E:v;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return E;if(t.gt(this.shru(1)))return T;o=E}else{if(this.eq(O))return t.eq(_)||t.eq(w)?O:t.eq(O)?_:(e=this.shr(1).div(t).shl(1)).eq(v)?t.isNegative()?_:w:(n=this.sub(t.mul(e)),o=e.add(n.div(t)));if(t.eq(O))return this.unsigned?E:v;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=v}for(n=this;n.gte(t);){e=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(e)/Math.LN2),u=s<=48?1:f(2,s-48),l=a(e),h=l.mul(t);h.isNegative()||h.gt(n);)h=(l=a(e-=u,this.unsigned)).mul(t);l.isZero()&&(l=_),o=o.add(l),n=n.sub(h)}return o},I.div=I.divide,I.modulo=function(t){return i(t)||(t=p(t)),r?c((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))},I.mod=I.modulo,I.rem=I.modulo,I.not=function(){return c(~this.low,~this.high,this.unsigned)},I.and=function(t){return i(t)||(t=p(t)),c(this.low&t.low,this.high&t.high,this.unsigned)},I.or=function(t){return i(t)||(t=p(t)),c(this.low|t.low,this.high|t.high,this.unsigned)},I.xor=function(t){return i(t)||(t=p(t)),c(this.low^t.low,this.high^t.high,this.unsigned)},I.shiftLeft=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?c(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):c(0,this.low<<t-32,this.unsigned)},I.shl=I.shiftLeft,I.shiftRight=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?c(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):c(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function(t){if(i(t)&&(t=t.toInt()),0===(t&=63))return this;var e=this.high;return t<32?c(this.low>>>t|e<<32-t,e>>>t,this.unsigned):c(32===t?e:e>>>t-32,0,this.unsigned)},I.shru=I.shiftRightUnsigned,I.shr_u=I.shiftRightUnsigned,I.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},I.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},I.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},I.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]},I.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";(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),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.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 s},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),s=0;try{for(var u=r(t),a=u.next();!a.done;a=u.next()){var c=a.value;o.set(c,s),s+=c.length}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=u.return)&&n.call(u)}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(28).Buffer)},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.TopicControlRegistrationParamsSerialiser=e.TopicControlRegistrationParamsSerialiserClass=void 0;var o=r(11),s=r(2),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.write=function(t,e){s.writeInt32(t,e.definition.id),o.ControlGroupSerialiser.write(t,e.group),s.writeString(t,e.path)},e}(r(1).AbstractSerialiser);e.TopicControlRegistrationParamsSerialiserClass=u,e.TopicControlRegistrationParamsSerialiser=new u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NullSerialiser=void 0,e.NullSerialiser={read:function(){return null},write:function(){}}},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";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=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.TopicSpecification=void 0;var o=r(0),s=["PUBLISH_VALUES_ONLY","SCHEMA","VALIDATE_VALUES","TIDY_ON_UNSUBSCRIBE","TIME_SERIES_EVENT_VALUE_TYPE","TIME_SERIES_RETAINED_RANGE","TIME_SERIES_SUBSCRIPTION_RANGE","DONT_RETAIN_VALUE","PERSISTENT","REMOVAL","OWNER","COMPRESSION","CONFLATION","PRIORITY"],u=function(){function t(t,e){void 0===e&&(e={}),this.type=t,this.properties=e}return t.prototype.withProperty=function(e,r){var i;if("string"!=typeof e||s.indexOf(e.toUpperCase())<0)throw new o.IllegalArgumentError("Invalid key: "+e);if("string"!=typeof r)throw new o.IllegalArgumentError("Invalid value, must be string: "+r);var u=n(n({},this.properties),((i={})[e]=r,i));return new t(this.type,u)},t.prototype.withProperties=function(e){var r,u;try{for(var a=i(Object.getOwnPropertyNames(e)),c=a.next();!c.done;c=a.next()){var f=c.value;if("string"!=typeof f||s.indexOf(f.toUpperCase())<0)throw new o.IllegalArgumentError("Invalid key: "+f);var l=e[f];if("string"!=typeof l)throw new o.IllegalArgumentError("Invalid value, must be string: "+l)}}catch(t){r={error:t}}finally{try{c&&!c.done&&(u=a.return)&&u.call(a)}finally{if(r)throw r.error}}var p=n(n({},this.properties),e);return new t(this.type,p)},t.PUBLISH_VALUES_ONLY="PUBLISH_VALUES_ONLY",t.VALIDATE_VALUES="VALIDATE_VALUES",t.TIDY_ON_UNSUBSCRIBE="TIDY_ON_UNSUBSCRIBE",t.TIME_SERIES_EVENT_VALUE_TYPE="TIME_SERIES_EVENT_VALUE_TYPE",t.TIME_SERIES_RETAINED_RANGE="TIME_SERIES_RETAINED_RANGE",t.TIME_SERIES_SUBSCRIPTION_RANGE="TIME_SERIES_SUBSCRIPTION_RANGE",t.SCHEMA="SCHEMA",t.DONT_RETAIN_VALUE="DONT_RETAIN_VALUE",t.PERSISTENT="PERSISTENT",t.REMOVAL="REMOVAL",t.CONFLATION="CONFLATION",t.OWNER="OWNER",t.COMPRESSION="COMPRESSION",t.PRIORITY="PRIORITY",t}();e.TopicSpecification=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.write=e.read=void 0;var n,i,o,s=r(2),u=r(6),a=r(13),c=r(17),f=r(7);e.read=function(t){if(i){var e=t.buffer.subarray(t.pos,t.pos+o);if(a.isEqualUint8Arrays(e,i))return t.readMany(o),n}var r=t.pos,l=u.read(t,f.TopicTypeEnum),p=s.readDictionary(t,s.readString),h=new c.TopicSpecification(l,p);return o=t.pos-r,i=Uint8Array.from(t.buffer.subarray(r,t.pos)),n=Object.freeze(h),h},e.write=function(t,e){u.write(t,e.type),s.writeDictionary(t,e.properties,s.writeString)}},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.setLevel=e.create=e.LoggingLevel=void 0;var i,o=r(43);function s(t,e){var r="|"+t.toUpperCase()+"|"+e+"|",n=function(){return new Date};return function(e,i){i?o[t](n()+r+e,i):o[t](n()+r+e)}}!function(t){t.trace="trace",t.debug="debug",t.info="info",t.warn="warn",t.error="error"}(i=e.LoggingLevel||(e.LoggingLevel={})),e.create=function(t){var e,r,o={};try{for(var u=n(Object.keys(i)),a=u.next();!a.done;a=u.next()){var c=a.value;o[c]=s(c,t)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}return o},e.setLevel=o.setLevel},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.TopicSelectorSerialiser=e.TopicSelectorSerialiserClass=void 0;var o=r(2),s=r(1),u=r(49),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.read=function(t){return u.parseSelector(o.readString(t))},e.prototype.write=function(t,e){o.writeString(t,e.expression)},e}(s.AbstractSerialiser);e.TopicSelectorSerialiserClass=a,e.TopicSelectorSerialiser=new a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.regex=void 0;var n=r(0);e.regex=function(t,e){if(void 0===e&&(e=""),""===t)throw new n.IllegalArgumentError("Empty regular expression ["+e+"]");try{var r=new RegExp(t);return function(t){var e=r.exec(t);return e&&e[0]===t}}catch(t){throw new n.IllegalArgumentError("Bad regular expression ["+t.message+", "+e+"]")}}},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(23);window._diffusion_features.topic_notifications.TopicNotificationsImpl=n.TopicNotificationsImpl},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.TopicNotificationsImpl=void 0;var o=r(0),s=r(24),u=r(25),a=r(44),c=r(19),f=r(8),l=r(62),p=c.create("Session.Notifications"),h=function(){function t(t){this.TopicNotificationType=f.TopicNotificationType,this.internal=t;var e=t.getServiceLocator();this.conversationSet=t.getConversationSet(),this.TOPIC_NOTIFICATION_SELECTION=e.obtain(a.TOPIC_NOTIFICATION_SELECTION),this.TOPIC_NOTIFICATION_DESELECTION=e.obtain(a.TOPIC_NOTIFICATION_DESELECTION),this.TOPIC_NOTIFICATION_DEREGISTRATION=e.obtain(a.TOPIC_NOTIFICATION_DEREGISTRATION);var r=t.getServiceRegistry(),n=s.create((function(t,e,r){r.respond(),t.getConversationSet().respond(e.cid,e)}));r.add(a.TOPIC_NOTIFICATION_EVENTS,n),r.add(a.TOPIC_DESCENDANT_EVENTS,n)}return t.prototype.addListener=function(t){var e=this,r=this.internal.getContext().parseSelector;return new Promise((function(s,a){return n(e,void 0,void 0,(function(){var e,n,c=this;return i(this,(function(i){switch(i.label){case 0:return t?this.internal.checkConnected(a)?(p.debug("Adding Topic Notification Listener"),e={active:function(e,n){p.debug("Topic Notification Listener active"),s({select:function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return new Promise((function(i,s){if(l.requireNonNull(t,"topicSelector"),t)try{var u=e.length>0?r([t].concat(e)):r(t);c.TOPIC_NOTIFICATION_SELECTION.send({cid:n,selector:u},(function(t){t?(c.conversationSet.discard(n,t),s(t)):i()}))}catch(t){s(t)}else s(new o.IllegalArgumentError("No topic selector provided"))}))},deselect:function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return new Promise((function(i,s){if(l.requireNonNull(t,"topicSelector"),t)try{var u=e.length>0?r([t].concat(e)):r(t);c.TOPIC_NOTIFICATION_DESELECTION.send({cid:n,selector:u},(function(t){t?(c.conversationSet.discard(n,t),s(t)):i()}))}catch(t){s(t)}else s(new o.IllegalArgumentError("No topic selector provided"))}))},close:function(){c.TOPIC_NOTIFICATION_DEREGISTRATION.send({cid:n},(function(e,r){e?(c.conversationSet.discard(n,e),p.debug("Error with topic notification deregistration: ",e)):(t.onClose(),c.conversationSet.respondIfPresent(n,r))}))}})},respond:function(e){return e.isDescendantEvent?t.onDescendantNotification(e.path,e.type):t.onTopicNotification(e.path,e.specification,e.type),!1},close:function(e){p.debug("Topic Notification Listener closed"),e?t.onError(e):t.onClose()}},[4,this.conversationSet.newConversation(u.responseHandler(this.internal,e,(function(t,e){c.TOPIC_NOTIFICATION_DEREGISTRATION.send({cid:t},e)})))]):[3,2]:(a(new Error("Topic Notification Listener is null or undefined")),[2]);case 1:n=i.sent(),u.registrationCallback(this.conversationSet,n,(function(){}),(function(){}))(void 0),i.label=2;case 2:return[2]}}))}))}))},t}();e.TopicNotificationsImpl=h},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.create=void 0,e.create=function(t){return{onRequest:function(e,r,n){try{t(e,r,n)}catch(t){n.fail(e.getContext().ErrorReason.CALLBACK_EXCEPTION,t.message)}}}}},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)}),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((n=n.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},u=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),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.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 s},a=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};Object.defineProperty(e,"__esModule",{value:!0}),e.registerTopicHandler=e.registerRequestHandler=e.registerHandler=e.registrationCallback=e.responseHandler=e.ResponseHandlerState=void 0;var c,f=r(26),l=r(19).create("Registration");!function(t){t[t.REGISTERING=0]="REGISTERING",t[t.ACTIVE=1]="ACTIVE",t[t.CLOSED=2]="CLOSED"}(c=e.ResponseHandlerState||(e.ResponseHandlerState={}));var p=function(t){function e(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=t.apply(this,a([],u(r)))||this;return i.cause=e,i}return i(e,t),e}(Error);function h(t,e,r){var n,i=c.REGISTERING;return{onDiscard:function(r,n){try{n instanceof t.getContext().CloseReason?e.close():e.close(n)}catch(n){l.error("REGISTERED_HANDLER_EXCEPTION",n)}i=c.CLOSED},onOpen:function(e){n=function(){return new Promise((function(n,o){i!==c.CLOSED?r(e,(function(r){r?(t.getConversationSet().discard(e,r),o(r)):(t.getConversationSet().respondIfPresent(e,c.CLOSED),n())})):o(new Error("Handler already closed"))}))}},onResponse:function(r,o){if(o===c.CLOSED){try{e.close()}catch(t){l.error("REGISTERED_HANDLER_EXCEPTION",t)}return i=o,!0}try{return o===c.ACTIVE?(e.active(n,r),i=o,!1):e.respond(o)}catch(e){l.error("REGISTERED_HANDLER_EXCEPTION",e),t.getConversationSet().discard(r,new p(e,"An error was thrown by the handler")),n().catch((function(t){l.debug("Failed to deregister with the server",t)}))}return!0}}}function d(t,e,r,n){return function(i){i?(t.discard(e,i),n(i)):(t.respondIfPresent(e,c.ACTIVE),r())}}function y(t,e,r,n,i){return o(this,void 0,void 0,(function(){var o,u,a,c,f;return s(this,(function(s){switch(s.label){case 0:return o=t.getConversationSet(),u=t.getServiceLocator(),a=u.obtain(n),c=u.obtain(i),[4,o.newConversation(h(t,r,(function(t,r){c.send(e,r)})))];case 1:return f=s.sent(),[2,new Promise((function(t,r){a.send({params:e,cid:f},d(o,f,t,r))}))]}}))}))}e.responseHandler=h,e.registrationCallback=d,e.registerHandler=y,e.registerRequestHandler=function(t,e,r){return y(t,e,r,f.MESSAGING_RECEIVER_CONTROL_REGISTRATION,f.MESSAGING_RECEIVER_CONTROL_DEREGISTRATION)},e.registerTopicHandler=function(t,e,r){return y(t,e,r,f.TOPIC_CONTROL_REGISTRATION,f.TOPIC_CONTROL_DEREGISTRATION)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MESSAGING_RECEIVER_CONTROL_DEREGISTRATION=e.MESSAGING_RECEIVER_CONTROL_REGISTRATION=e.NOTIFY_SUBSCRIPTION=e.MESSAGE_RECEIVER_CONTROL_DEREGISTRATION=e.MESSAGE_RECEIVER_CONTROL_REGISTRATION=e.UNSUBSCRIPTION_NOTIFICATION=e.TOPIC_CONTROL_DEREGISTRATION=e.TOPIC_CONTROL_REGISTRATION=void 0;var n=r(10),i=r(33),o=r(14),s=r(35),u=r(15),a=r(36),c=r(41);e.TOPIC_CONTROL_REGISTRATION={id:20,request:s.TopicControlRegistrationRequestSerialiser,response:u.NullSerialiser},e.TOPIC_CONTROL_DEREGISTRATION={id:21,request:o.TopicControlRegistrationParamsSerialiser,response:u.NullSerialiser},e.UNSUBSCRIPTION_NOTIFICATION={id:42,request:a.UnsubscriptionNotificationSerialiser,response:u.NullSerialiser},e.MESSAGE_RECEIVER_CONTROL_REGISTRATION={id:63,request:i.MessageReceiverControlRegistrationRequestSerialiser,response:u.NullSerialiser},e.MESSAGE_RECEIVER_CONTROL_DEREGISTRATION={id:64,request:n.MessageReceiverControlRegistrationParamsSerialiser,response:u.NullSerialiser},e.NOTIFY_SUBSCRIPTION={id:87,request:c.TopicSpecificationInfoSerialiser,response:u.NullSerialiser},e.MESSAGING_RECEIVER_CONTROL_REGISTRATION={id:97,request:i.MessageReceiverControlRegistrationRequestSerialiser,response:u.NullSerialiser},e.MESSAGING_RECEIVER_CONTROL_DEREGISTRATION={id:98,request:n.MessageReceiverControlRegistrationParamsSerialiser,response:u.NullSerialiser}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT=e.ControlGroup=void 0;var n=function(t){this.name=t};e.ControlGroup=n,e.DEFAULT=Object.freeze(new n("default"))},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(30),i=r(31),o=r(32);function s(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(s()<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 l(this,t)}return c(this,t,e,r)}function c(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=p(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|d(e,r),i=(t=u(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|h(e.length);return 0===(t=u(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?u(t,0):p(t,e);if("Buffer"===e.type&&o(e.data))return p(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(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,e){if(f(e),t=u(t,e<0?0:0|h(e)),!a.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|h(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function h(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(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 G(t).length;default:if(n)return q(t).length;e=(""+e).toLowerCase(),n=!0}}function y(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 m(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return N(this,e,r);case"base64":return I(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(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 v(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:E(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):E(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function E(t,e,r,n,i){var o,s=1,u=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;s=2,u/=2,a/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var f=-1;for(o=r;o<u;o++)if(c(t,o)===c(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===a)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(r+a>u&&(r=u-a),o=r;o>=0;o--){for(var l=!0,p=0;p<a;p++)if(c(t,o+p)!==c(e,p)){l=!1;break}if(l)return o}return-1}function _(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 s=0;s<n;++s){var u=parseInt(e.substr(2*s,2),16);if(isNaN(u))return s;t[r+s]=u}return s}function T(t,e,r,n){return H(q(e,t.length-r),t,r,n)}function w(t,e,r,n){return H(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function S(t,e,r,n){return w(t,e,r,n)}function b(t,e,r,n){return H(G(e),t,r,n)}function O(t,e,r,n){return H(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function I(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,s,u,a,c=t[i],f=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=t[i+1]))&&(a=(31&c)<<6|63&o)>127&&(f=a);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(a=(15&c)<<12|(63&o)<<6|63&s)>2047&&(a<55296||a>57343)&&(f=a);break;case 4:o=t[i+1],s=t[i+2],u=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&u)&&(a=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&u)>65535&&a<1114112&&(f=a)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}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=s(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,r){return c(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 f(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},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,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buf