UNPKG

p5.party

Version:

Pre-release! An easy to use library for simple multi-user sketches with p5.js.

1 lines 231 kB
"use strict";(()=>{var Ba=Object.create;var Nr=Object.defineProperty;var ka=Object.getOwnPropertyDescriptor;var xa=Object.getOwnPropertyNames,wn=Object.getOwnPropertySymbols,ja=Object.getPrototypeOf,Un=Object.prototype.hasOwnProperty,Va=Object.prototype.propertyIsEnumerable;var P=Math.pow,Pn=(i,t,e)=>t in i?Nr(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,ce=(i,t)=>{for(var e in t||(t={}))Un.call(t,e)&&Pn(i,e,t[e]);if(wn)for(var e of wn(t))Va.call(t,e)&&Pn(i,e,t[e]);return i};var Fa=(i,t)=>()=>(i&&(t=i(i=0)),t);var R=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var Ha=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of xa(t))!Un.call(i,n)&&n!==e&&Nr(i,n,{get:()=>t[n],enumerable:!(r=ka(t,n))||r.enumerable});return i};var Si=(i,t,e)=>(e=i!=null?Ba(ja(i)):{},Ha(t||!i||!i.__esModule?Nr(e,"default",{value:i,enumerable:!0}):e,i));var Tr=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var E=(i,t,e)=>(Tr(i,t,"read from private field"),e?e.call(i):t.get(i)),D=(i,t,e)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,e)},U=(i,t,e,r)=>(Tr(i,t,"write to private field"),r?r.call(i,e):t.set(i,e),e);var bt=(i,t,e)=>(Tr(i,t,"access private method"),e);var Q=(i,t,e)=>new Promise((r,n)=>{var o=c=>{try{a(e.next(c))}catch(l){n(l)}},s=c=>{try{a(e.throw(c))}catch(l){n(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,s);a((e=e.apply(i,t)).next())});var Bn=R(_i=>{"use strict";u();_i.byteLength=qa;_i.toByteArray=$a;_i.fromByteArray=Ka;var It=[],ht=[],Ga=typeof Uint8Array!="undefined"?Uint8Array:Array,br="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ue=0,Ln=br.length;ue<Ln;++ue)It[ue]=br[ue],ht[br.charCodeAt(ue)]=ue;var ue,Ln;ht[45]=62;ht[95]=63;function Mn(i){var t=i.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=i.indexOf("=");e===-1&&(e=t);var r=e===t?0:4-e%4;return[e,r]}function qa(i){var t=Mn(i),e=t[0],r=t[1];return(e+r)*3/4-r}function Wa(i,t,e){return(t+e)*3/4-e}function $a(i){var t,e=Mn(i),r=e[0],n=e[1],o=new Ga(Wa(i,r,n)),s=0,a=n>0?r-4:r,c;for(c=0;c<a;c+=4)t=ht[i.charCodeAt(c)]<<18|ht[i.charCodeAt(c+1)]<<12|ht[i.charCodeAt(c+2)]<<6|ht[i.charCodeAt(c+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=t&255;return n===2&&(t=ht[i.charCodeAt(c)]<<2|ht[i.charCodeAt(c+1)]>>4,o[s++]=t&255),n===1&&(t=ht[i.charCodeAt(c)]<<10|ht[i.charCodeAt(c+1)]<<4|ht[i.charCodeAt(c+2)]>>2,o[s++]=t>>8&255,o[s++]=t&255),o}function Ya(i){return It[i>>18&63]+It[i>>12&63]+It[i>>6&63]+It[i&63]}function Ja(i,t,e){for(var r,n=[],o=t;o<e;o+=3)r=(i[o]<<16&16711680)+(i[o+1]<<8&65280)+(i[o+2]&255),n.push(Ya(r));return n.join("")}function Ka(i){for(var t,e=i.length,r=e%3,n=[],o=16383,s=0,a=e-r;s<a;s+=o)n.push(Ja(i,s,s+o>a?a:s+o));return r===1?(t=i[e-1],n.push(It[t>>2]+It[t<<4&63]+"==")):r===2&&(t=(i[e-2]<<8)+i[e-1],n.push(It[t>>10]+It[t>>4&63]+It[t<<2&63]+"=")),n.join("")}});var kn=R(Ir=>{u();Ir.read=function(i,t,e,r,n){var o,s,a=n*8-r-1,c=(1<<a)-1,l=c>>1,h=-7,d=e?n-1:0,T=e?-1:1,N=i[t+d];for(d+=T,o=N&(1<<-h)-1,N>>=-h,h+=a;h>0;o=o*256+i[t+d],d+=T,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=r;h>0;s=s*256+i[t+d],d+=T,h-=8);if(o===0)o=1-l;else{if(o===c)return s?NaN:(N?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-l}return(N?-1:1)*s*Math.pow(2,o-r)};Ir.write=function(i,t,e,r,n,o){var s,a,c,l=o*8-n-1,h=(1<<l)-1,d=h>>1,T=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,N=r?0:o-1,B=r?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+d>=1?t+=T/c:t+=T*Math.pow(2,1-d),t*c>=2&&(s++,c/=2),s+d>=h?(a=0,s=h):s+d>=1?(a=(t*c-1)*Math.pow(2,n),s=s+d):(a=t*Math.pow(2,d-1)*Math.pow(2,n),s=0));n>=8;i[e+N]=a&255,N+=B,a/=256,n-=8);for(s=s<<n|a,l+=n;l>0;i[e+N]=s&255,N+=B,s/=256,l-=8);i[e+N-B]|=g*128}});var to=R(Ne=>{"use strict";u();var vr=Bn(),_e=kn(),xn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ne.Buffer=f;Ne.SlowBuffer=ec;Ne.INSPECT_MAX_BYTES=50;var Oi=2147483647;Ne.kMaxLength=Oi;f.TYPED_ARRAY_SUPPORT=Qa();!f.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Qa(){try{let i=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(i,t),i.foo()===42}catch(i){return!1}}Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}});Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}});function Lt(i){if(i>Oi)throw new RangeError('The value "'+i+'" is invalid for option "size"');let t=new Uint8Array(i);return Object.setPrototypeOf(t,f.prototype),t}function f(i,t,e){if(typeof i=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Ar(i)}return Hn(i,t,e)}f.poolSize=8192;function Hn(i,t,e){if(typeof i=="string")return Xa(i,t);if(ArrayBuffer.isView(i))return Za(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(vt(i,ArrayBuffer)||i&&vt(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(vt(i,SharedArrayBuffer)||i&&vt(i.buffer,SharedArrayBuffer)))return mr(i,t,e);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let r=i.valueOf&&i.valueOf();if(r!=null&&r!==i)return f.from(r,t,e);let n=tc(i);if(n)return n;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return f.from(i[Symbol.toPrimitive]("string"),t,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}f.from=function(i,t,e){return Hn(i,t,e)};Object.setPrototypeOf(f.prototype,Uint8Array.prototype);Object.setPrototypeOf(f,Uint8Array);function Gn(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function za(i,t,e){return Gn(i),i<=0?Lt(i):t!==void 0?typeof e=="string"?Lt(i).fill(t,e):Lt(i).fill(t):Lt(i)}f.alloc=function(i,t,e){return za(i,t,e)};function Ar(i){return Gn(i),Lt(i<0?0:Dr(i)|0)}f.allocUnsafe=function(i){return Ar(i)};f.allocUnsafeSlow=function(i){return Ar(i)};function Xa(i,t){if((typeof t!="string"||t==="")&&(t="utf8"),!f.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let e=qn(i,t)|0,r=Lt(e),n=r.write(i,t);return n!==e&&(r=r.slice(0,n)),r}function Cr(i){let t=i.length<0?0:Dr(i.length)|0,e=Lt(t);for(let r=0;r<t;r+=1)e[r]=i[r]&255;return e}function Za(i){if(vt(i,Uint8Array)){let t=new Uint8Array(i);return mr(t.buffer,t.byteOffset,t.byteLength)}return Cr(i)}function mr(i,t,e){if(t<0||i.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<t+(e||0))throw new RangeError('"length" is outside of buffer bounds');let r;return t===void 0&&e===void 0?r=new Uint8Array(i):e===void 0?r=new Uint8Array(i,t):r=new Uint8Array(i,t,e),Object.setPrototypeOf(r,f.prototype),r}function tc(i){if(f.isBuffer(i)){let t=Dr(i.length)|0,e=Lt(t);return e.length===0||i.copy(e,0,0,t),e}if(i.length!==void 0)return typeof i.length!="number"||Pr(i.length)?Lt(0):Cr(i);if(i.type==="Buffer"&&Array.isArray(i.data))return Cr(i.data)}function Dr(i){if(i>=Oi)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Oi.toString(16)+" bytes");return i|0}function ec(i){return+i!=i&&(i=0),f.alloc(+i)}f.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==f.prototype};f.compare=function(t,e){if(vt(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),vt(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let o=0,s=Math.min(r,n);o<s;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0};f.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}};f.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return f.alloc(0);let r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;let n=f.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){let s=t[r];if(vt(s,Uint8Array))o+s.length>n.length?(f.isBuffer(s)||(s=f.from(s)),s.copy(n,o)):Uint8Array.prototype.set.call(n,s,o);else if(f.isBuffer(s))s.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return n};function qn(i,t){if(f.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||vt(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);let e=i.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&e===0)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return gr(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Zn(i).length;default:if(n)return r?-1:gr(i).length;t=(""+t).toLowerCase(),n=!0}}f.byteLength=qn;function ic(i,t,e){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(i||(i="utf8");;)switch(i){case"hex":return fc(this,t,e);case"utf8":case"utf-8":return $n(this,t,e);case"ascii":return lc(this,t,e);case"latin1":case"binary":return hc(this,t,e);case"base64":return cc(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dc(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),r=!0}}f.prototype._isBuffer=!0;function le(i,t,e){let r=i[t];i[t]=i[e],i[e]=r}f.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)le(this,e,e+1);return this};f.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)le(this,e,e+3),le(this,e+1,e+2);return this};f.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)le(this,e,e+7),le(this,e+1,e+6),le(this,e+2,e+5),le(this,e+3,e+4);return this};f.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?$n(this,0,t):ic.apply(this,arguments)};f.prototype.toLocaleString=f.prototype.toString;f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:f.compare(this,t)===0};f.prototype.inspect=function(){let t="",e=Ne.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"};xn&&(f.prototype[xn]=f.prototype.inspect);f.prototype.compare=function(t,e,r,n,o){if(vt(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),r===void 0&&(r=t?t.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;let s=o-n,a=r-e,c=Math.min(s,a),l=this.slice(n,o),h=t.slice(e,r);for(let d=0;d<c;++d)if(l[d]!==h[d]){s=l[d],a=h[d];break}return s<a?-1:a<s?1:0};function Wn(i,t,e,r,n){if(i.length===0)return-1;if(typeof e=="string"?(r=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,Pr(e)&&(e=n?0:i.length-1),e<0&&(e=i.length+e),e>=i.length){if(n)return-1;e=i.length-1}else if(e<0)if(n)e=0;else return-1;if(typeof t=="string"&&(t=f.from(t,r)),f.isBuffer(t))return t.length===0?-1:jn(i,t,e,r,n);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(i,t,e):Uint8Array.prototype.lastIndexOf.call(i,t,e):jn(i,[t],e,r,n);throw new TypeError("val must be string, number or Buffer")}function jn(i,t,e,r,n){let o=1,s=i.length,a=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(i.length<2||t.length<2)return-1;o=2,s/=2,a/=2,e/=2}function c(h,d){return o===1?h[d]:h.readUInt16BE(d*o)}let l;if(n){let h=-1;for(l=e;l<s;l++)if(c(i,l)===c(t,h===-1?0:l-h)){if(h===-1&&(h=l),l-h+1===a)return h*o}else h!==-1&&(l-=l-h),h=-1}else for(e+a>s&&(e=s-a),l=e;l>=0;l--){let h=!0;for(let d=0;d<a;d++)if(c(i,l+d)!==c(t,d)){h=!1;break}if(h)return l}return-1}f.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1};f.prototype.indexOf=function(t,e,r){return Wn(this,t,e,r,!0)};f.prototype.lastIndexOf=function(t,e,r){return Wn(this,t,e,r,!1)};function rc(i,t,e,r){e=Number(e)||0;let n=i.length-e;r?(r=Number(r),r>n&&(r=n)):r=n;let o=t.length;r>o/2&&(r=o/2);let s;for(s=0;s<r;++s){let a=parseInt(t.substr(s*2,2),16);if(Pr(a))return s;i[e+s]=a}return s}function nc(i,t,e,r){return Ni(gr(t,i.length-e),i,e,r)}function oc(i,t,e,r){return Ni(Rc(t),i,e,r)}function sc(i,t,e,r){return Ni(Zn(t),i,e,r)}function ac(i,t,e,r){return Ni(Sc(t,i.length-e),i,e,r)}f.prototype.write=function(t,e,r,n){if(e===void 0)n="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")n=e,r=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-e;if((r===void 0||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return rc(this,t,e,r);case"utf8":case"utf-8":return nc(this,t,e,r);case"ascii":case"latin1":case"binary":return oc(this,t,e,r);case"base64":return sc(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ac(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}};f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function cc(i,t,e){return t===0&&e===i.length?vr.fromByteArray(i):vr.fromByteArray(i.slice(t,e))}function $n(i,t,e){e=Math.min(i.length,e);let r=[],n=t;for(;n<e;){let o=i[n],s=null,a=o>239?4:o>223?3:o>191?2:1;if(n+a<=e){let c,l,h,d;switch(a){case 1:o<128&&(s=o);break;case 2:c=i[n+1],(c&192)===128&&(d=(o&31)<<6|c&63,d>127&&(s=d));break;case 3:c=i[n+1],l=i[n+2],(c&192)===128&&(l&192)===128&&(d=(o&15)<<12|(c&63)<<6|l&63,d>2047&&(d<55296||d>57343)&&(s=d));break;case 4:c=i[n+1],l=i[n+2],h=i[n+3],(c&192)===128&&(l&192)===128&&(h&192)===128&&(d=(o&15)<<18|(c&63)<<12|(l&63)<<6|h&63,d>65535&&d<1114112&&(s=d))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|s&1023),r.push(s),n+=a}return uc(r)}var Vn=4096;function uc(i){let t=i.length;if(t<=Vn)return String.fromCharCode.apply(String,i);let e="",r=0;for(;r<t;)e+=String.fromCharCode.apply(String,i.slice(r,r+=Vn));return e}function lc(i,t,e){let r="";e=Math.min(i.length,e);for(let n=t;n<e;++n)r+=String.fromCharCode(i[n]&127);return r}function hc(i,t,e){let r="";e=Math.min(i.length,e);for(let n=t;n<e;++n)r+=String.fromCharCode(i[n]);return r}function fc(i,t,e){let r=i.length;(!t||t<0)&&(t=0),(!e||e<0||e>r)&&(e=r);let n="";for(let o=t;o<e;++o)n+=_c[i[o]];return n}function dc(i,t,e){let r=i.slice(t,e),n="";for(let o=0;o<r.length-1;o+=2)n+=String.fromCharCode(r[o]+r[o+1]*256);return n}f.prototype.slice=function(t,e){let r=this.length;t=~~t,e=e===void 0?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t);let n=this.subarray(t,e);return Object.setPrototypeOf(n,f.prototype),n};function q(i,t,e){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+t>e)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUintLE=f.prototype.readUIntLE=function(t,e,r){t=t>>>0,e=e>>>0,r||q(t,e,this.length);let n=this[t],o=1,s=0;for(;++s<e&&(o*=256);)n+=this[t+s]*o;return n};f.prototype.readUintBE=f.prototype.readUIntBE=function(t,e,r){t=t>>>0,e=e>>>0,r||q(t,e,this.length);let n=this[t+--e],o=1;for(;e>0&&(o*=256);)n+=this[t+--e]*o;return n};f.prototype.readUint8=f.prototype.readUInt8=function(t,e){return t=t>>>0,e||q(t,1,this.length),this[t]};f.prototype.readUint16LE=f.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||q(t,2,this.length),this[t]|this[t+1]<<8};f.prototype.readUint16BE=f.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||q(t,2,this.length),this[t]<<8|this[t+1]};f.prototype.readUint32LE=f.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||q(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};f.prototype.readUint32BE=f.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||q(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};f.prototype.readBigUInt64LE=jt(function(t){t=t>>>0,Oe(t,"offset");let e=this[t],r=this[t+7];(e===void 0||r===void 0)&&Je(t,this.length-8);let n=e+this[++t]*P(2,8)+this[++t]*P(2,16)+this[++t]*P(2,24),o=this[++t]+this[++t]*P(2,8)+this[++t]*P(2,16)+r*P(2,24);return BigInt(n)+(BigInt(o)<<BigInt(32))});f.prototype.readBigUInt64BE=jt(function(t){t=t>>>0,Oe(t,"offset");let e=this[t],r=this[t+7];(e===void 0||r===void 0)&&Je(t,this.length-8);let n=e*P(2,24)+this[++t]*P(2,16)+this[++t]*P(2,8)+this[++t],o=this[++t]*P(2,24)+this[++t]*P(2,16)+this[++t]*P(2,8)+r;return(BigInt(n)<<BigInt(32))+BigInt(o)});f.prototype.readIntLE=function(t,e,r){t=t>>>0,e=e>>>0,r||q(t,e,this.length);let n=this[t],o=1,s=0;for(;++s<e&&(o*=256);)n+=this[t+s]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n};f.prototype.readIntBE=function(t,e,r){t=t>>>0,e=e>>>0,r||q(t,e,this.length);let n=e,o=1,s=this[t+--n];for(;n>0&&(o*=256);)s+=this[t+--n]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*e)),s};f.prototype.readInt8=function(t,e){return t=t>>>0,e||q(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};f.prototype.readInt16LE=function(t,e){t=t>>>0,e||q(t,2,this.length);let r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function(t,e){t=t>>>0,e||q(t,2,this.length);let r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function(t,e){return t=t>>>0,e||q(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};f.prototype.readInt32BE=function(t,e){return t=t>>>0,e||q(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};f.prototype.readBigInt64LE=jt(function(t){t=t>>>0,Oe(t,"offset");let e=this[t],r=this[t+7];(e===void 0||r===void 0)&&Je(t,this.length-8);let n=this[t+4]+this[t+5]*P(2,8)+this[t+6]*P(2,16)+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+this[++t]*P(2,8)+this[++t]*P(2,16)+this[++t]*P(2,24))});f.prototype.readBigInt64BE=jt(function(t){t=t>>>0,Oe(t,"offset");let e=this[t],r=this[t+7];(e===void 0||r===void 0)&&Je(t,this.length-8);let n=(e<<24)+this[++t]*P(2,16)+this[++t]*P(2,8)+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*P(2,24)+this[++t]*P(2,16)+this[++t]*P(2,8)+r)});f.prototype.readFloatLE=function(t,e){return t=t>>>0,e||q(t,4,this.length),_e.read(this,t,!0,23,4)};f.prototype.readFloatBE=function(t,e){return t=t>>>0,e||q(t,4,this.length),_e.read(this,t,!1,23,4)};f.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||q(t,8,this.length),_e.read(this,t,!0,52,8)};f.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||q(t,8,this.length),_e.read(this,t,!1,52,8)};function at(i,t,e,r,n,o){if(!f.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw new RangeError('"value" argument is out of bounds');if(e+r>i.length)throw new RangeError("Index out of range")}f.prototype.writeUintLE=f.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e=e>>>0,r=r>>>0,!n){let a=Math.pow(2,8*r)-1;at(this,t,e,r,a,0)}let o=1,s=0;for(this[e]=t&255;++s<r&&(o*=256);)this[e+s]=t/o&255;return e+r};f.prototype.writeUintBE=f.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e=e>>>0,r=r>>>0,!n){let a=Math.pow(2,8*r)-1;at(this,t,e,r,a,0)}let o=r-1,s=1;for(this[e+o]=t&255;--o>=0&&(s*=256);)this[e+o]=t/s&255;return e+r};f.prototype.writeUint8=f.prototype.writeUInt8=function(t,e,r){return t=+t,e=e>>>0,r||at(this,t,e,1,255,0),this[e]=t&255,e+1};f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=e>>>0,r||at(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2};f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=e>>>0,r||at(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2};f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=e>>>0,r||at(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4};f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=e>>>0,r||at(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function Yn(i,t,e,r,n){Xn(t,r,n,i,e,7);let o=Number(t&BigInt(4294967295));i[e++]=o,o=o>>8,i[e++]=o,o=o>>8,i[e++]=o,o=o>>8,i[e++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return i[e++]=s,s=s>>8,i[e++]=s,s=s>>8,i[e++]=s,s=s>>8,i[e++]=s,e}function Jn(i,t,e,r,n){Xn(t,r,n,i,e,7);let o=Number(t&BigInt(4294967295));i[e+7]=o,o=o>>8,i[e+6]=o,o=o>>8,i[e+5]=o,o=o>>8,i[e+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return i[e+3]=s,s=s>>8,i[e+2]=s,s=s>>8,i[e+1]=s,s=s>>8,i[e]=s,e+8}f.prototype.writeBigUInt64LE=jt(function(t,e=0){return Yn(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});f.prototype.writeBigUInt64BE=jt(function(t,e=0){return Jn(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});f.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=e>>>0,!n){let c=Math.pow(2,8*r-1);at(this,t,e,r,c-1,-c)}let o=0,s=1,a=0;for(this[e]=t&255;++o<r&&(s*=256);)t<0&&a===0&&this[e+o-1]!==0&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r};f.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=e>>>0,!n){let c=Math.pow(2,8*r-1);at(this,t,e,r,c-1,-c)}let o=r-1,s=1,a=0;for(this[e+o]=t&255;--o>=0&&(s*=256);)t<0&&a===0&&this[e+o+1]!==0&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r};f.prototype.writeInt8=function(t,e,r){return t=+t,e=e>>>0,r||at(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1};f.prototype.writeInt16LE=function(t,e,r){return t=+t,e=e>>>0,r||at(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2};f.prototype.writeInt16BE=function(t,e,r){return t=+t,e=e>>>0,r||at(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2};f.prototype.writeInt32LE=function(t,e,r){return t=+t,e=e>>>0,r||at(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4};f.prototype.writeInt32BE=function(t,e,r){return t=+t,e=e>>>0,r||at(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};f.prototype.writeBigInt64LE=jt(function(t,e=0){return Yn(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});f.prototype.writeBigInt64BE=jt(function(t,e=0){return Jn(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Kn(i,t,e,r,n,o){if(e+r>i.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Qn(i,t,e,r,n){return t=+t,e=e>>>0,n||Kn(i,t,e,4,34028234663852886e22,-34028234663852886e22),_e.write(i,t,e,r,23,4),e+4}f.prototype.writeFloatLE=function(t,e,r){return Qn(this,t,e,!0,r)};f.prototype.writeFloatBE=function(t,e,r){return Qn(this,t,e,!1,r)};function zn(i,t,e,r,n){return t=+t,e=e>>>0,n||Kn(i,t,e,8,17976931348623157e292,-17976931348623157e292),_e.write(i,t,e,r,52,8),e+8}f.prototype.writeDoubleLE=function(t,e,r){return zn(this,t,e,!0,r)};f.prototype.writeDoubleBE=function(t,e,r){return zn(this,t,e,!1,r)};f.prototype.copy=function(t,e,r,n){if(!f.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);let o=n-r;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o};f.prototype.fill=function(t,e,r,n){if(typeof t=="string"){if(typeof e=="string"?(n=e,e=0,r=this.length):typeof r=="string"&&(n=r,r=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(t.length===1){let s=t.charCodeAt(0);(n==="utf8"&&s<128||n==="latin1")&&(t=s)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e=e>>>0,r=r===void 0?this.length:r>>>0,t||(t=0);let o;if(typeof t=="number")for(o=e;o<r;++o)this[o]=t;else{let s=f.isBuffer(t)?t:f.from(t,n),a=s.length;if(a===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var Se={};function wr(i,t,e){Se[i]=class extends e{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${i}]`,this.stack,delete this.name}get code(){return i}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${i}]: ${this.message}`}}}wr("ERR_BUFFER_OUT_OF_BOUNDS",function(i){return i?`${i} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);wr("ERR_INVALID_ARG_TYPE",function(i,t){return`The "${i}" argument must be of type number. Received type ${typeof t}`},TypeError);wr("ERR_OUT_OF_RANGE",function(i,t,e){let r=`The value of "${i}" is out of range.`,n=e;return Number.isInteger(e)&&Math.abs(e)>P(2,32)?n=Fn(String(e)):typeof e=="bigint"&&(n=String(e),(e>P(BigInt(2),BigInt(32))||e<-P(BigInt(2),BigInt(32)))&&(n=Fn(n)),n+="n"),r+=` It must be ${t}. Received ${n}`,r},RangeError);function Fn(i){let t="",e=i.length,r=i[0]==="-"?1:0;for(;e>=r+4;e-=3)t=`_${i.slice(e-3,e)}${t}`;return`${i.slice(0,e)}${t}`}function pc(i,t,e){Oe(t,"offset"),(i[t]===void 0||i[t+e]===void 0)&&Je(t,i.length-(e+1))}function Xn(i,t,e,r,n,o){if(i>e||i<t){let s=typeof t=="bigint"?"n":"",a;throw o>3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${e}${s}`,new Se.ERR_OUT_OF_RANGE("value",a,i)}pc(r,n,o)}function Oe(i,t){if(typeof i!="number")throw new Se.ERR_INVALID_ARG_TYPE(t,"number",i)}function Je(i,t,e){throw Math.floor(i)!==i?(Oe(i,e),new Se.ERR_OUT_OF_RANGE(e||"offset","an integer",i)):t<0?new Se.ERR_BUFFER_OUT_OF_BOUNDS:new Se.ERR_OUT_OF_RANGE(e||"offset",`>= ${e?1:0} and <= ${t}`,i)}var Ec=/[^+/0-9A-Za-z-_]/g;function yc(i){if(i=i.split("=")[0],i=i.trim().replace(Ec,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function gr(i,t){t=t||1/0;let e,r=i.length,n=null,o=[];for(let s=0;s<r;++s){if(e=i.charCodeAt(s),e>55295&&e<57344){if(!n){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}n=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),n=e;continue}e=(n-55296<<10|e-56320)+65536}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function Rc(i){let t=[];for(let e=0;e<i.length;++e)t.push(i.charCodeAt(e)&255);return t}function Sc(i,t){let e,r,n,o=[];for(let s=0;s<i.length&&!((t-=2)<0);++s)e=i.charCodeAt(s),r=e>>8,n=e%256,o.push(n),o.push(r);return o}function Zn(i){return vr.toByteArray(yc(i))}function Ni(i,t,e,r){let n;for(n=0;n<r&&!(n+e>=t.length||n>=i.length);++n)t[n+e]=i[n];return n}function vt(i,t){return i instanceof t||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===t.name}function Pr(i){return i!==i}var _c=function(){let i="0123456789abcdef",t=new Array(256);for(let e=0;e<16;++e){let r=e*16;for(let n=0;n<16;++n)t[r+n]=i[e]+i[n]}return t}();function jt(i){return typeof BigInt=="undefined"?Oc:i}function Oc(){throw new Error("BigInt not supported")}});var Buffer,u=Fa(()=>{"use strict";Buffer=to().Buffer});var ro=R(be=>{"use strict";u();Object.defineProperty(be,"__esModule",{value:!0});be.LOCAL_WINS=be.REMOTE_WINS=void 0;var Nc=function(i,t,e,r,n){n(null,e)};be.REMOTE_WINS=Nc;var Tc=function(i,t,e,r,n){n(null,i)};be.LOCAL_WINS=Tc});var no=R(Ti=>{"use strict";u();Object.defineProperty(Ti,"__esModule",{value:!0});Ti.DefaultOptions=void 0;var bc=ro();Ti.DefaultOptions={nativeTimerRegistry:!0,intervalTimerResolution:50,subscriptionInterval:100,heartbeatInterval:3e4,reconnectIntervalIncrement:4e3,maxReconnectInterval:18e4,maxReconnectAttempts:5,subscriptionTimeout:2e3,recordReadAckTimeout:15e3,recordReadTimeout:15e3,recordDeleteTimeout:15e3,offlineBufferTimeout:2e3,recordDiscardTimeout:5e3,offlineEnabled:!1,saveUpdatesOffline:!1,recordReadOnlyMode:!1,recordPrefixWriteWhitelist:[],path:"/deepstream",mergeStrategy:bc.REMOTE_WINS,recordDeepCopy:!0,dirtyStorageName:"__ds__dirty_records",nodeStoragePath:"./local-storage",indexdb:{autoVersion:!1,dbVersion:1,primaryKey:"id",storageDatabaseName:"deepstream",defaultObjectStoreName:"records",objectStoreNames:[],ignorePrefixes:[],flushTimeout:50},nodeStorageSize:5,lazyConnect:!1,debug:!1,initialRecordVersion:1}});var oo=R(bi=>{"use strict";u();Object.defineProperty(bi,"__esModule",{value:!0});var Ic;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.PARSER=1]="PARSER",i[i.CONNECTION=2]="CONNECTION",i[i.AUTH=3]="AUTH",i[i.EVENT=4]="EVENT",i[i.RECORD=5]="RECORD",i[i.RPC=6]="RPC",i[i.PRESENCE=7]="PRESENCE",i[i.MONITORING=8]="MONITORING",i[i.CLUSTER=9]="CLUSTER",i[i.LOCK=10]="LOCK",i[i.STATE_REGISTRY=11]="STATE_REGISTRY",i[i.ERROR=100]="ERROR"})(Ic=bi.TOPIC||(bi.TOPIC={}))});var so=R(Ii=>{"use strict";u();Object.defineProperty(Ii,"__esModule",{value:!0});var vc;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.ERROR=1]="ERROR",i[i.NOTIFY=2]="NOTIFY",i[i.READ=3]="READ",i[i.READ_RESPONSE=4]="READ_RESPONSE",i[i.HEAD=5]="HEAD",i[i.HEAD_RESPONSE=6]="HEAD_RESPONSE",i[i.HEAD_BULK=7]="HEAD_BULK",i[i.HEAD_RESPONSE_BULK=8]="HEAD_RESPONSE_BULK",i[i.DELETE=9]="DELETE",i[i.DELETE_SUCCESS=10]="DELETE_SUCCESS",i[i.DELETE_BULK=11]="DELETE_BULK",i[i.DELETE_BULK_SUCCESS=12]="DELETE_BULK_SUCCESS",i[i.DELETED=13]="DELETED",i[i.WRITE_ACKNOWLEDGEMENT=14]="WRITE_ACKNOWLEDGEMENT",i[i.CREATE=15]="CREATE",i[i.CREATEANDUPDATE=16]="CREATEANDUPDATE",i[i.CREATEANDPATCH=17]="CREATEANDPATCH",i[i.UPDATE=18]="UPDATE",i[i.PATCH=19]="PATCH",i[i.ERASE=20]="ERASE",i[i.SUBSCRIBEANDHEAD=21]="SUBSCRIBEANDHEAD",i[i.SUBSCRIBEANDREAD=22]="SUBSCRIBEANDREAD",i[i.SUBSCRIBECREATEANDREAD=23]="SUBSCRIBECREATEANDREAD",i[i.SUBSCRIBECREATEANDUPDATE=24]="SUBSCRIBECREATEANDUPDATE",i[i.SUBSCRIBE=25]="SUBSCRIBE",i[i.UNSUBSCRIBE=26]="UNSUBSCRIBE",i[i.LISTEN=27]="LISTEN",i[i.UNLISTEN=28]="UNLISTEN",i[i.LISTEN_ACCEPT=29]="LISTEN_ACCEPT",i[i.LISTEN_REJECT=30]="LISTEN_REJECT",i[i.SUBSCRIPTION_HAS_PROVIDER=31]="SUBSCRIPTION_HAS_PROVIDER",i[i.SUBSCRIPTION_HAS_NO_PROVIDER=32]="SUBSCRIPTION_HAS_NO_PROVIDER",i[i.SUBSCRIPTION_FOR_PATTERN_FOUND=33]="SUBSCRIPTION_FOR_PATTERN_FOUND",i[i.SUBSCRIPTION_FOR_PATTERN_REMOVED=34]="SUBSCRIPTION_FOR_PATTERN_REMOVED",i[i.CACHE_RETRIEVAL_TIMEOUT=100]="CACHE_RETRIEVAL_TIMEOUT",i[i.STORAGE_RETRIEVAL_TIMEOUT=101]="STORAGE_RETRIEVAL_TIMEOUT",i[i.VERSION_EXISTS=102]="VERSION_EXISTS",i[i.RECORD_LOAD_ERROR=103]="RECORD_LOAD_ERROR",i[i.RECORD_CREATE_ERROR=104]="RECORD_CREATE_ERROR",i[i.RECORD_UPDATE_ERROR=105]="RECORD_UPDATE_ERROR",i[i.RECORD_DELETE_ERROR=106]="RECORD_DELETE_ERROR",i[i.RECORD_NOT_FOUND=107]="RECORD_NOT_FOUND",i[i.INVALID_VERSION=108]="INVALID_VERSION",i[i.INVALID_PATCH_ON_HOTPATH=109]="INVALID_PATCH_ON_HOTPATH",i[i.INVALID_LISTEN_REGEX=110]="INVALID_LISTEN_REGEX",i[i.LISTEN_RESPONSE_TIMEOUT=111]="LISTEN_RESPONSE_TIMEOUT",i[i.LISTEN_UNSUCCESSFUL=112]="LISTEN_UNSUCCESSFUL",i[i.RECORD_NOTIFY_ERROR=113]="RECORD_NOTIFY_ERROR",i[i.MESSAGE_PERMISSION_ERROR=114]="MESSAGE_PERMISSION_ERROR",i[i.MESSAGE_DENIED=115]="MESSAGE_DENIED",i[i.INVALID_MESSAGE_DATA=116]="INVALID_MESSAGE_DATA",i[i.MULTIPLE_SUBSCRIPTIONS=117]="MULTIPLE_SUBSCRIPTIONS",i[i.NOT_SUBSCRIBED=118]="NOT_SUBSCRIBED"})(vc=Ii.RECORD_ACTION||(Ii.RECORD_ACTION={}))});var ao=R(vi=>{"use strict";u();Object.defineProperty(vi,"__esModule",{value:!0});var Cc;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.ERROR=1]="ERROR",i[i.REQUEST=2]="REQUEST",i[i.AUTH_SUCCESSFUL=3]="AUTH_SUCCESSFUL",i[i.AUTH_UNSUCCESSFUL=4]="AUTH_UNSUCCESSFUL",i[i.TOO_MANY_AUTH_ATTEMPTS=100]="TOO_MANY_AUTH_ATTEMPTS",i[i.INVALID_MESSAGE=101]="INVALID_MESSAGE",i[i.INVALID_MESSAGE_DATA=102]="INVALID_MESSAGE_DATA"})(Cc=vi.AUTH_ACTION||(vi.AUTH_ACTION={}))});var co=R(Ci=>{"use strict";u();Object.defineProperty(Ci,"__esModule",{value:!0});var mc;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.ERROR=1]="ERROR",i[i.EMIT=2]="EMIT",i[i.SUBSCRIBE=3]="SUBSCRIBE",i[i.UNSUBSCRIBE=4]="UNSUBSCRIBE",i[i.LISTEN=5]="LISTEN",i[i.UNLISTEN=6]="UNLISTEN",i[i.LISTEN_ACCEPT=7]="LISTEN_ACCEPT",i[i.LISTEN_REJECT=8]="LISTEN_REJECT",i[i.SUBSCRIPTION_HAS_PROVIDER=9]="SUBSCRIPTION_HAS_PROVIDER",i[i.SUBSCRIPTION_HAS_NO_PROVIDER=10]="SUBSCRIPTION_HAS_NO_PROVIDER",i[i.SUBSCRIPTION_FOR_PATTERN_FOUND=11]="SUBSCRIPTION_FOR_PATTERN_FOUND",i[i.SUBSCRIPTION_FOR_PATTERN_REMOVED=12]="SUBSCRIPTION_FOR_PATTERN_REMOVED",i[i.INVALID_LISTEN_REGEX=100]="INVALID_LISTEN_REGEX",i[i.LISTEN_RESPONSE_TIMEOUT=101]="LISTEN_RESPONSE_TIMEOUT",i[i.LISTEN_UNSUCCESSFUL=102]="LISTEN_UNSUCCESSFUL",i[i.MESSAGE_PERMISSION_ERROR=103]="MESSAGE_PERMISSION_ERROR",i[i.MESSAGE_DENIED=104]="MESSAGE_DENIED",i[i.INVALID_MESSAGE_DATA=105]="INVALID_MESSAGE_DATA",i[i.MULTIPLE_SUBSCRIPTIONS=106]="MULTIPLE_SUBSCRIPTIONS",i[i.NOT_SUBSCRIBED=107]="NOT_SUBSCRIBED"})(mc=Ci.EVENT_ACTION||(Ci.EVENT_ACTION={}))});var uo=R(mi=>{"use strict";u();Object.defineProperty(mi,"__esModule",{value:!0});var gc;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.ERROR=1]="ERROR",i[i.REQUEST=2]="REQUEST",i[i.ACCEPT=4]="ACCEPT",i[i.RESPONSE=5]="RESPONSE",i[i.REJECT=6]="REJECT",i[i.REQUEST_ERROR=7]="REQUEST_ERROR",i[i.PROVIDE=8]="PROVIDE",i[i.UNPROVIDE=9]="UNPROVIDE",i[i.NO_RPC_PROVIDER=100]="NO_RPC_PROVIDER",i[i.ACCEPT_TIMEOUT=101]="ACCEPT_TIMEOUT",i[i.MULTIPLE_ACCEPT=102]="MULTIPLE_ACCEPT",i[i.INVALID_RPC_CORRELATION_ID=103]="INVALID_RPC_CORRELATION_ID",i[i.RESPONSE_TIMEOUT=104]="RESPONSE_TIMEOUT",i[i.MULTIPLE_RESPONSE=105]="MULTIPLE_RESPONSE",i[i.MESSAGE_PERMISSION_ERROR=106]="MESSAGE_PERMISSION_ERROR",i[i.MESSAGE_DENIED=107]="MESSAGE_DENIED",i[i.INVALID_MESSAGE_DATA=108]="INVALID_MESSAGE_DATA",i[i.MULTIPLE_PROVIDERS=109]="MULTIPLE_PROVIDERS",i[i.NOT_PROVIDED=110]="NOT_PROVIDED"})(gc=mi.RPC_ACTION||(mi.RPC_ACTION={}))});var lo=R(gi=>{"use strict";u();Object.defineProperty(gi,"__esModule",{value:!0});var Ac;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.ERROR=1]="ERROR",i[i.QUERY_ALL=2]="QUERY_ALL",i[i.QUERY_ALL_RESPONSE=3]="QUERY_ALL_RESPONSE",i[i.QUERY=4]="QUERY",i[i.QUERY_RESPONSE=5]="QUERY_RESPONSE",i[i.PRESENCE_JOIN=6]="PRESENCE_JOIN",i[i.PRESENCE_JOIN_ALL=7]="PRESENCE_JOIN_ALL",i[i.PRESENCE_LEAVE=8]="PRESENCE_LEAVE",i[i.PRESENCE_LEAVE_ALL=9]="PRESENCE_LEAVE_ALL",i[i.SUBSCRIBE=10]="SUBSCRIBE",i[i.UNSUBSCRIBE=11]="UNSUBSCRIBE",i[i.SUBSCRIBE_ALL=12]="SUBSCRIBE_ALL",i[i.UNSUBSCRIBE_ALL=13]="UNSUBSCRIBE_ALL",i[i.INVALID_PRESENCE_USERS=100]="INVALID_PRESENCE_USERS",i[i.MESSAGE_PERMISSION_ERROR=101]="MESSAGE_PERMISSION_ERROR",i[i.MESSAGE_DENIED=102]="MESSAGE_DENIED",i[i.MULTIPLE_SUBSCRIPTIONS=103]="MULTIPLE_SUBSCRIPTIONS",i[i.NOT_SUBSCRIBED=104]="NOT_SUBSCRIBED"})(Ac=gi.PRESENCE_ACTION||(gi.PRESENCE_ACTION={}))});var ho=R(Ai=>{"use strict";u();Object.defineProperty(Ai,"__esModule",{value:!0});var Dc;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.ERROR=1]="ERROR",i[i.PING=2]="PING",i[i.PONG=3]="PONG",i[i.ACCEPT=4]="ACCEPT",i[i.CHALLENGE=5]="CHALLENGE",i[i.REJECT=6]="REJECT",i[i.REDIRECT=7]="REDIRECT",i[i.CLOSING=8]="CLOSING",i[i.CLOSED=9]="CLOSED",i[i.AUTHENTICATION_TIMEOUT=100]="AUTHENTICATION_TIMEOUT",i[i.INVALID_MESSAGE=101]="INVALID_MESSAGE"})(Dc=Ai.CONNECTION_ACTION||(Ai.CONNECTION_ACTION={}))});var fo=R(Di=>{"use strict";u();Object.defineProperty(Di,"__esModule",{value:!0});var wc;(function(i){i[i.REMOVE=1]="REMOVE",i[i.STATUS=2]="STATUS"})(wc=Di.CLUSTER_ACTION||(Di.CLUSTER_ACTION={}))});var po=R(wi=>{"use strict";u();Object.defineProperty(wi,"__esModule",{value:!0});var Pc;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.ERROR=1]="ERROR",i[i.REQUEST=2]="REQUEST",i[i.RESPONSE=3]="RESPONSE",i[i.RELEASE=4]="RELEASE"})(Pc=wi.LOCK_ACTION||(wi.LOCK_ACTION={}))});var Eo=R(Pi=>{"use strict";u();Object.defineProperty(Pi,"__esModule",{value:!0});var Uc;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.UNKNOWN_TOPIC=1]="UNKNOWN_TOPIC",i[i.UNKNOWN_ACTION=2]="UNKNOWN_ACTION",i[i.INVALID_MESSAGE=3]="INVALID_MESSAGE",i[i.MESSAGE_PARSE_ERROR=4]="MESSAGE_PARSE_ERROR",i[i.MAXIMUM_MESSAGE_SIZE_EXCEEDED=5]="MAXIMUM_MESSAGE_SIZE_EXCEEDED",i[i.ERROR=6]="ERROR",i[i.INVALID_META_PARAMS=7]="INVALID_META_PARAMS"})(Uc=Pi.PARSER_ACTION||(Pi.PARSER_ACTION={}))});var yo=R(Ui=>{"use strict";u();Object.defineProperty(Ui,"__esModule",{value:!0});var Lc;Lc=Ui.MONITORING_ACTION||(Ui.MONITORING_ACTION={})});var Ro=R(Ie=>{"use strict";u();Object.defineProperty(Ie,"__esModule",{value:!0});var Mc;(function(i){i[i.EVENT_SUBSCRIPTIONS=11]="EVENT_SUBSCRIPTIONS",i[i.RECORD_SUBSCRIPTIONS=12]="RECORD_SUBSCRIPTIONS",i[i.SUBSCRIPTIONS=9]="SUBSCRIPTIONS",i[i.ONLINE_USERS=10]="ONLINE_USERS",i[i.MONITORING_SUBSCRIPTIONS=24]="MONITORING_SUBSCRIPTIONS",i[i.RPC_SUBSCRIPTIONS=13]="RPC_SUBSCRIPTIONS",i[i.PRESENCE_SUBSCRIPTIONS=14]="PRESENCE_SUBSCRIPTIONS",i[i.RECORD_LISTEN_PATTERNS=15]="RECORD_LISTEN_PATTERNS",i[i.EVENT_LISTEN_PATTERNS=16]="EVENT_LISTEN_PATTERNS",i[i.RECORD_PUBLISHED_SUBSCRIPTIONS=17]="RECORD_PUBLISHED_SUBSCRIPTIONS",i[i.EVENT_PUBLISHED_SUBSCRIPTIONS=18]="EVENT_PUBLISHED_SUBSCRIPTIONS",i[i.RECORD_LISTENING=19]="RECORD_LISTENING",i[i.EVENT_LISTENING=20]="EVENT_LISTENING",i[i.STATE_REGISTRY=21]="STATE_REGISTRY"})(Mc=Ie.STATE_REGISTRY_TOPIC||(Ie.STATE_REGISTRY_TOPIC={}));var Bc;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.ERROR=1]="ERROR",i[i.ADD=2]="ADD",i[i.REMOVE=3]="REMOVE",i[i.REQUEST_FULL_STATE=4]="REQUEST_FULL_STATE",i[i.FULL_STATE=5]="FULL_STATE",i[i.CHECKSUM=6]="CHECKSUM"})(Bc=Ie.STATE_ACTION||(Ie.STATE_ACTION={}))});var ve=R(rt=>{"use strict";u();Object.defineProperty(rt,"__esModule",{value:!0});var kc=oo();rt.TOPIC=kc.TOPIC;var xc=so();rt.RECORD_ACTION=xc.RECORD_ACTION;var jc=ao();rt.AUTH_ACTION=jc.AUTH_ACTION;var Vc=co();rt.EVENT_ACTION=Vc.EVENT_ACTION;var Fc=uo();rt.RPC_ACTION=Fc.RPC_ACTION;var Hc=lo();rt.PRESENCE_ACTION=Hc.PRESENCE_ACTION;var Gc=ho();rt.CONNECTION_ACTION=Gc.CONNECTION_ACTION;var qc=fo();rt.CLUSTER_ACTION=qc.CLUSTER_ACTION;var Wc=po();rt.LOCK_ACTION=Wc.LOCK_ACTION;var $c=Eo();rt.PARSER_ACTION=$c.PARSER_ACTION;var Yc=yo();rt.MONITORING_ACTION=Yc.MONITORING_ACTION;var So=Ro();rt.STATE_ACTION=So.STATE_ACTION;rt.STATE_REGISTRY_TOPIC=So.STATE_REGISTRY_TOPIC});var Mr=R(Lr=>{"use strict";u();Object.defineProperty(Lr,"__esModule",{value:!0});var k=ve();Lr.ACTIONS={[k.TOPIC.PARSER]:k.PARSER_ACTION,[k.TOPIC.CONNECTION]:k.CONNECTION_ACTION,[k.TOPIC.AUTH]:k.AUTH_ACTION,[k.TOPIC.EVENT]:k.EVENT_ACTION,[k.TOPIC.RECORD]:k.RECORD_ACTION,[k.TOPIC.RPC]:k.RPC_ACTION,[k.TOPIC.PRESENCE]:k.PRESENCE_ACTION,[k.TOPIC.LOCK]:k.LOCK_ACTION,[k.TOPIC.STATE_REGISTRY]:k.STATE_ACTION,[k.TOPIC.CLUSTER]:k.CLUSTER_ACTION,[k.TOPIC.MONITORING]:k.MONITORING_ACTION}});var x=R(tt=>{"use strict";u();var Jc=tt&&tt.__createBinding||(Object.create?function(i,t,e,r){r===void 0&&(r=e),Object.defineProperty(i,r,{enumerable:!0,get:function(){return t[e]}})}:function(i,t,e,r){r===void 0&&(r=e),i[r]=t[e]}),_o=tt&&tt.__exportStar||function(i,t){for(var e in i)e!=="default"&&!Object.prototype.hasOwnProperty.call(t,e)&&Jc(t,i,e)},Ce,Qe,Li,Mi;Object.defineProperty(tt,"__esModule",{value:!0});tt.CONNECTION_STATE=tt.EVENT=tt.RESPONSE_TO_REQUEST=void 0;var W=ve();_o(ve(),tt);_o(Mr(),tt);tt.RESPONSE_TO_REQUEST=(Ce={},Ce[W.TOPIC.RECORD]=(Qe={},Qe[W.RECORD_ACTION.HEAD_RESPONSE]=W.RECORD_ACTION.HEAD,Qe[W.RECORD_ACTION.READ_RESPONSE]=W.RECORD_ACTION.READ,Qe[W.RECORD_ACTION.DELETE_SUCCESS]=W.RECORD_ACTION.DELETE,Qe),Ce[W.TOPIC.PRESENCE]=(Li={},Li[W.PRESENCE_ACTION.QUERY_RESPONSE]=W.PRESENCE_ACTION.QUERY,Li[W.PRESENCE_ACTION.QUERY_ALL_RESPONSE]=W.PRESENCE_ACTION.QUERY_ALL,Li),Ce[W.TOPIC.RPC]=(Mi={},Mi[W.RPC_ACTION.ACCEPT]=W.RPC_ACTION.REQUEST,Mi[W.RPC_ACTION.ERROR]=W.RPC_ACTION.REQUEST,Mi),Ce[W.TOPIC.EVENT]={},Ce);var Kc;(function(i){i.RECORD_READ_ONLY_MODE="RECORD_READ_ONLY_MODE",i.UNSOLICITED_MESSAGE="UNSOLICITED_MESSAGE",i.IS_CLOSED="IS_CLOSED",i.MAX_RECONNECTION_ATTEMPTS_REACHED="MAX_RECONNECTION_ATTEMPTS_REACHED",i.CONNECTION_ERROR="CONNECTION_ERROR",i.ACK_TIMEOUT="ACK_TIMEOUT",i.UNKNOWN_CORRELATION_ID="UNKNOWN_CORRELATION_ID",i.HEARTBEAT_TIMEOUT="HEARTBEAT_TIMEOUT",i.LISTENER_EXISTS="LISTENER_EXISTS",i.NOT_LISTENING="NOT_LISTENING",i.RECORD_ALREADY_DESTROYED="RECORD_ALREADY_DESTROYED",i.RECORD_DELETE_TIMEOUT="RECORD_DELETE_TIMEOUT",i.CLIENT_OFFLINE="client offline",i.INVALID_AUTHENTICATION_DETAILS="INVALID_AUTHENTICATION_DETAILS",i.CONNECTION_LOST="connectionLost",i.CONNECTION_REESTABLISHED="connectionReestablished",i.EXIT_LIMBO="exitLimbo",i.CONNECTION_STATE_CHANGED="connectionStateChanged",i.CLIENT_DATA_CHANGED="clientDataChanged",i.REAUTHENTICATION_FAILURE="reauthenticationFailure",i.AUTHENTICATION_TIMEOUT="AUTHENTICATION_TIMEOUT",i.RECORD_ERROR="error",i.RECORD_READY="ready",i.RECORD_DELETED="delete",i.RECORD_DISCARDED="discard",i.RECORD_VERSION_EXISTS="versionExists",i.RECORD_HAS_PROVIDER_CHANGED="hasProviderChanged",i.RECORD_STATE_CHANGED="onRecordStateChanged",i.ENTRY_ADDED_EVENT="entry-added",i.ENTRY_REMOVED_EVENT="entry-removed",i.ENTRY_MOVED_EVENT="entry-moved"})(Kc=tt.EVENT||(tt.EVENT={}));var Qc;(function(i){i.CLOSING="CLOSING",i.CLOSED="CLOSED",i.INITIALISING="INITIALISING",i.AWAITING_CONNECTION="AWAITING_CONNECTION",i.CHALLENGING="CHALLENGING",i.AWAITING_AUTHENTICATION="AWAITING_AUTHENTICATION",i.AUTHENTICATING="AUTHENTICATING",i.OPEN="OPEN",i.ERROR="ERROR",i.RECONNECTING="RECONNECTING",i.REDIRECTING="REDIRECTING",i.CHALLENGE_DENIED="CHALLENGE_DENIED",i.TOO_MANY_AUTH_ATTEMPTS="TOO_MANY_AUTH_ATTEMPTS",i.AUTHENTICATION_TIMEOUT="AUTHENTICATION_TIMEOUT",i.PAUSING="PAUSING",i.OFFLINE="OFFLINE"})(Qc=tt.CONNECTION_STATE||(tt.CONNECTION_STATE={}))});var No=R(ki=>{"use strict";u();Object.defineProperty(ki,"__esModule",{value:!0});ki.Logger=void 0;var ze=x(),Oo=Mr(),Bi=ve();function zc(i){return ze.EVENT[i]!==void 0}var Xc=function(){function i(t){this.emitter=t}return i.prototype.warn=function(t,e,r){var n="Warning: "+Bi.TOPIC[t.topic],o=t.action;o&&(n+=" ("+Oo.ACTIONS[t.topic][o]+")"),e&&(n+=": "+ze.EVENT[e]),r&&(n+=" \u2013 "+(typeof r=="string"?r:JSON.stringify(r))),console.warn(n)},i.prototype.error=function(t,e,r){if(zc(e))(e===ze.EVENT.IS_CLOSED||e===ze.EVENT.CONNECTION_ERROR)&&this.emitter.emit("error",r,ze.EVENT[e],Bi.TOPIC[Bi.TOPIC.CONNECTION]);else{var n=e||t.action;this.emitter.emit("error",r||t,Oo.ACTIONS[t.topic][n],Bi.TOPIC[t.topic])}},i}();ki.Logger=Xc});var mt=R(Ct=>{"use strict";u();var Zc=Ct&&Ct.__values||function(i){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&i[t],r=0;if(e)return e.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&r>=i.length&&(i=void 0),{value:i&&i[r++],done:!i}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},To=Ct&&Ct.__read||function(i,t){var e=typeof Symbol=="function"&&i[Symbol.iterator];if(!e)return i;var r=e.call(i),n,o=[],s;try{for(;(t===void 0||t-- >0)&&!(n=r.next()).done;)o.push(n.value)}catch(a){s={error:a}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(s)throw s.error}}return o},tu=Ct&&Ct.__spread||function(){for(var i=[],t=0;t<arguments.length;t++)i=i.concat(To(arguments[t]));return i};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.Emitter=void 0;var eu=function(){function i(){this.callbacks=null}return i.prototype.on=function(t,e,r){r===void 0&&(r=this),this.callbacks=this.callbacks||new Map;var n=this.callbacks.get(t);return n?n.push({fn:e,scope:r}):(n=[{fn:e,scope:r}],this.callbacks.set(t,n)),this},i.prototype.once=function(t,e,r){var n=this;r===void 0&&(r=this);var o=function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];n.off(t,o,n),e.apply(n,s)};return o.fn=e,this.on(t,o,r),this},i.prototype.off=function(t,e,r){if(t===void 0&&e===void 0&&r===void 0&&(this.callbacks=null),this.callbacks===null)return this;var n=this.callbacks.get(t);return n?e===void 0&&r===void 0?(this.callbacks.delete(t),this):(n=n.filter(function(o){var s=o.fn,a=o.scope;return!(t!==""&&e===void 0&&r===a||(s===e||s.fn===e)&&(r===void 0||r===a))}),n.length===0?this.callbacks.delete(t):this.callbacks.set(t,n),this):this},i.prototype.removeContext=function(t){var e,r;if(this.callbacks!==null)try{for(var n=Zc(this.callbacks),o=n.next();!o.done;o=n.next()){var s=To(o.value,2),a=s[0],c=s[1];this.callbacks.set(a,c.filter(function(l){var h=l.scope;return h===t}))}}catch(l){e={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},i.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(this.callbacks===null)return this;var n=this.callbacks.get(t);return!n||n.length===0?this:(n=n.slice(0),n.forEach(function(o){var s=o.fn,a=o.scope;return s.apply(a,e)}),this)},i.prototype.hasListeners=function(t){return this.callbacks===null?!1:this.callbacks.has(t)},i.prototype.eventNames=function(){return this.callbacks===null?[]:tu(this.callbacks.keys())},i}();Ct.Emitter=eu});var Io=R(ft=>{"use strict";u();var iu=ft&&ft.__extends||function(){var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},i(t,e)};return function(t,e){i(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),xi=ft&&ft.__assign||function(){return xi=Object.assign||function(i){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},xi.apply(this,arguments)},ru=ft&&ft.__values||function(i){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&i[t],r=0;if(e)return e.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&r>=i.length&&(i=void 0),{value:i&&i[r++],done:!i}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},nu=ft&&ft.__read||function(i,t){var e=typeof Symbol=="function"&&i[Symbol.iterator];if(!e)return i;var r=e.call(i),n,o=[],s;try{for(;(t===void 0||t-- >0)&&!(n=r.next()).done;)o.push(n.value)}catch(a){s={error:a}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(s)throw s.error}}return o};Object.defineProperty(ft,"__esModule",{value:!0});ft.TimeoutRegistry=void 0;var bo=x(),ou=mt(),su=function(i){iu(t,i);function t(e,r){var n=i.call(this)||this;return n.services=e,n.options=r,n.register=new Map,n}return t.prototype.add=function(e){if(e.duration===void 0&&(e.duration=this.options.subscriptionTimeout),e.event===void 0&&(e.event=bo.EVENT.ACK_TIMEOUT),!this.services.connection.isConnected)return null;this.remove(e.message);var r={timerId:-1,uniqueName:this.getUniqueName(e.message),timeout:e};return r.timerId=this.services.timerRegistry.add({context:this,callback:this.onTimeout,duration:e.duration,data:r}),this.register.set(r.uniqueName,r),r.uniqueName},t.prototype.remove=function(e){var r,n=bo.RESPONSE_TO_REQUEST[e.topic][e.action];n?r=xi(xi({},e),{action:n}):r=e;var o=this.getUniqueName(r);this.clear(o)},t.prototype.clear=function(e){var r=this.register.get(e);r&&(this.register.delete(e),this.services.timerRegistry.remove(r.timerId))},t.prototype.onTimeout=function(e){this.register.delete(e.uniqueName);var r=e.timeout;r.callback?r.callback(r.event,r.message):this.services.logger.warn(r.message,r.event)},t.prototype.getUniqueName=function(e){var r=e.originalAction||e.action,n=""+e.topic+r+"_";return e.correlationId?n+=e.correlationId:e.name&&(n+=e.name),n},t.prototype.onConnectionLost=function(){var e,r;try{for(var n=ru(this.register),o=n.next();!o.done;o=n.next()){var s=nu(o.value,2),a=s[0],c=s[1];this.services.timerRegistry.remove(c.timerId),this.register.delete(a)}}catch(l){e={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},t}(ou.Emitter);ft.TimeoutRegistry=su});var vo=R(Vt=>{"use strict";u();var au=Vt&&Vt.__values||function(i){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&i[t],r=0;if(e)return e.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&r>=i.length&&(i=void 0),{value:i&&i[r++],done:!i}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is no