@radixdlt/radix-dapp-toolkit
Version:
Radix dApp Toolkit repository
8 lines • 308 kB
JavaScript
(function(rt,oe){typeof exports=="object"&&typeof module<"u"?module.exports=oe():typeof define=="function"&&define.amd?define(oe):(rt=typeof globalThis<"u"?globalThis:rt||self,rt.RDT=oe())})(this,function(){"use strict";var A0=Object.defineProperty;var w0=(rt,oe,Dt)=>oe in rt?A0(rt,oe,{enumerable:!0,configurable:!0,writable:!0,value:Dt}):rt[oe]=Dt;var bl=(rt,oe,Dt)=>w0(rt,typeof oe!="symbol"?oe+"":oe,Dt);var Il;function rt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var oe={},Dt={};Dt.byteLength=Ml,Dt.toByteArray=Cl,Dt.fromByteArray=Tl;for(var bt=[],ot=[],Al=typeof Uint8Array<"u"?Uint8Array:Array,Io="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",An=0,wl=Io.length;An<wl;++An)bt[An]=Io[An],ot[Io.charCodeAt(An)]=An;ot[45]=62,ot[95]=63;function Vi(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var r=n===e?0:4-n%4;return[n,r]}function Ml(t){var e=Vi(t),n=e[0],r=e[1];return(n+r)*3/4-r}function vl(t,e,n){return(e+n)*3/4-n}function Cl(t){var e,n=Vi(t),r=n[0],o=n[1],i=new Al(vl(t,r,o)),s=0,a=o>0?r-4:r,l;for(l=0;l<a;l+=4)e=ot[t.charCodeAt(l)]<<18|ot[t.charCodeAt(l+1)]<<12|ot[t.charCodeAt(l+2)]<<6|ot[t.charCodeAt(l+3)],i[s++]=e>>16&255,i[s++]=e>>8&255,i[s++]=e&255;return o===2&&(e=ot[t.charCodeAt(l)]<<2|ot[t.charCodeAt(l+1)]>>4,i[s++]=e&255),o===1&&(e=ot[t.charCodeAt(l)]<<10|ot[t.charCodeAt(l+1)]<<4|ot[t.charCodeAt(l+2)]>>2,i[s++]=e>>8&255,i[s++]=e&255),i}function Nl(t){return bt[t>>18&63]+bt[t>>12&63]+bt[t>>6&63]+bt[t&63]}function Dl(t,e,n){for(var r,o=[],i=e;i<n;i+=3)r=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(t[i+2]&255),o.push(Nl(r));return o.join("")}function Tl(t){for(var e,n=t.length,r=n%3,o=[],i=16383,s=0,a=n-r;s<a;s+=i)o.push(Dl(t,s,s+i>a?a:s+i));return r===1?(e=t[n-1],o.push(bt[e>>2]+bt[e<<4&63]+"==")):r===2&&(e=(t[n-2]<<8)+t[n-1],o.push(bt[e>>10]+bt[e>>4&63]+bt[e<<2&63]+"=")),o.join("")}var bo={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */bo.read=function(t,e,n,r,o){var i,s,a=o*8-r-1,l=(1<<a)-1,d=l>>1,p=-7,g=n?o-1:0,m=n?-1:1,b=t[e+g];for(g+=m,i=b&(1<<-p)-1,b>>=-p,p+=a;p>0;i=i*256+t[e+g],g+=m,p-=8);for(s=i&(1<<-p)-1,i>>=-p,p+=r;p>0;s=s*256+t[e+g],g+=m,p-=8);if(i===0)i=1-d;else{if(i===l)return s?NaN:(b?-1:1)*(1/0);s=s+Math.pow(2,r),i=i-d}return(b?-1:1)*s*Math.pow(2,i-r)},bo.write=function(t,e,n,r,o,i){var s,a,l,d=i*8-o-1,p=(1<<d)-1,g=p>>1,m=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=r?0:i-1,x=r?1:-1,w=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=p):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+g>=1?e+=m/l:e+=m*Math.pow(2,1-g),e*l>=2&&(s++,l/=2),s+g>=p?(a=0,s=p):s+g>=1?(a=(e*l-1)*Math.pow(2,o),s=s+g):(a=e*Math.pow(2,g-1)*Math.pow(2,o),s=0));o>=8;t[n+b]=a&255,b+=x,a/=256,o-=8);for(s=s<<o|a,d+=o;d>0;t[n+b]=s&255,b+=x,s/=256,d-=8);t[n+b-x]|=w*128};/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/(function(t){const e=Dt,n=bo,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=j,t.INSPECT_MAX_BYTES=50;const o=2147483647;t.kMaxLength=o,a.TYPED_ARRAY_SUPPORT=i(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&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 i(){try{const h=new Uint8Array(1),c={foo:function(){return 42}};return Object.setPrototypeOf(c,Uint8Array.prototype),Object.setPrototypeOf(h,c),h.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function s(h){if(h>o)throw new RangeError('The value "'+h+'" is invalid for option "size"');const c=new Uint8Array(h);return Object.setPrototypeOf(c,a.prototype),c}function a(h,c,u){if(typeof h=="number"){if(typeof c=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(h)}return l(h,c,u)}a.poolSize=8192;function l(h,c,u){if(typeof h=="string")return m(h,c);if(ArrayBuffer.isView(h))return x(h);if(h==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof h);if(nt(h,ArrayBuffer)||h&&nt(h.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(nt(h,SharedArrayBuffer)||h&&nt(h.buffer,SharedArrayBuffer)))return w(h,c,u);if(typeof h=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const f=h.valueOf&&h.valueOf();if(f!=null&&f!==h)return a.from(f,c,u);const y=M(h);if(y)return y;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof h[Symbol.toPrimitive]=="function")return a.from(h[Symbol.toPrimitive]("string"),c,u);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof h)}a.from=function(h,c,u){return l(h,c,u)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function d(h){if(typeof h!="number")throw new TypeError('"size" argument must be of type number');if(h<0)throw new RangeError('The value "'+h+'" is invalid for option "size"')}function p(h,c,u){return d(h),h<=0?s(h):c!==void 0?typeof u=="string"?s(h).fill(c,u):s(h).fill(c):s(h)}a.alloc=function(h,c,u){return p(h,c,u)};function g(h){return d(h),s(h<0?0:C(h)|0)}a.allocUnsafe=function(h){return g(h)},a.allocUnsafeSlow=function(h){return g(h)};function m(h,c){if((typeof c!="string"||c==="")&&(c="utf8"),!a.isEncoding(c))throw new TypeError("Unknown encoding: "+c);const u=N(h,c)|0;let f=s(u);const y=f.write(h,c);return y!==u&&(f=f.slice(0,y)),f}function b(h){const c=h.length<0?0:C(h.length)|0,u=s(c);for(let f=0;f<c;f+=1)u[f]=h[f]&255;return u}function x(h){if(nt(h,Uint8Array)){const c=new Uint8Array(h);return w(c.buffer,c.byteOffset,c.byteLength)}return b(h)}function w(h,c,u){if(c<0||h.byteLength<c)throw new RangeError('"offset" is outside of buffer bounds');if(h.byteLength<c+(u||0))throw new RangeError('"length" is outside of buffer bounds');let f;return c===void 0&&u===void 0?f=new Uint8Array(h):u===void 0?f=new Uint8Array(h,c):f=new Uint8Array(h,c,u),Object.setPrototypeOf(f,a.prototype),f}function M(h){if(a.isBuffer(h)){const c=C(h.length)|0,u=s(c);return u.length===0||h.copy(u,0,0,c),u}if(h.length!==void 0)return typeof h.length!="number"||Fn(h.length)?s(0):b(h);if(h.type==="Buffer"&&Array.isArray(h.data))return b(h.data)}function C(h){if(h>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return h|0}function j(h){return+h!=h&&(h=0),a.alloc(+h)}a.isBuffer=function(c){return c!=null&&c._isBuffer===!0&&c!==a.prototype},a.compare=function(c,u){if(nt(c,Uint8Array)&&(c=a.from(c,c.offset,c.byteLength)),nt(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),!a.isBuffer(c)||!a.isBuffer(u))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(c===u)return 0;let f=c.length,y=u.length;for(let A=0,v=Math.min(f,y);A<v;++A)if(c[A]!==u[A]){f=c[A],y=u[A];break}return f<y?-1:y<f?1:0},a.isEncoding=function(c){switch(String(c).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(c,u){if(!Array.isArray(c))throw new TypeError('"list" argument must be an Array of Buffers');if(c.length===0)return a.alloc(0);let f;if(u===void 0)for(u=0,f=0;f<c.length;++f)u+=c[f].length;const y=a.allocUnsafe(u);let A=0;for(f=0;f<c.length;++f){let v=c[f];if(nt(v,Uint8Array))A+v.length>y.length?(a.isBuffer(v)||(v=a.from(v)),v.copy(y,A)):Uint8Array.prototype.set.call(y,v,A);else if(a.isBuffer(v))v.copy(y,A);else throw new TypeError('"list" argument must be an Array of Buffers');A+=v.length}return y};function N(h,c){if(a.isBuffer(h))return h.length;if(ArrayBuffer.isView(h)||nt(h,ArrayBuffer))return h.byteLength;if(typeof h!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof h);const u=h.length,f=arguments.length>2&&arguments[2]===!0;if(!f&&u===0)return 0;let y=!1;for(;;)switch(c){case"ascii":case"latin1":case"binary":return u;case"utf8":case"utf-8":return en(h).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u*2;case"hex":return u>>>1;case"base64":return mo(h).length;default:if(y)return f?-1:en(h).length;c=(""+c).toLowerCase(),y=!0}}a.byteLength=N;function T(h,c,u){let f=!1;if((c===void 0||c<0)&&(c=0),c>this.length||((u===void 0||u>this.length)&&(u=this.length),u<=0)||(u>>>=0,c>>>=0,u<=c))return"";for(h||(h="utf8");;)switch(h){case"hex":return k(this,c,u);case"utf8":case"utf-8":return et(this,c,u);case"ascii":return Nt(this,c,u);case"latin1":case"binary":return W(this,c,u);case"base64":return me(this,c,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,c,u);default:if(f)throw new TypeError("Unknown encoding: "+h);h=(h+"").toLowerCase(),f=!0}}a.prototype._isBuffer=!0;function I(h,c,u){const f=h[c];h[c]=h[u],h[u]=f}a.prototype.swap16=function(){const c=this.length;if(c%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let u=0;u<c;u+=2)I(this,u,u+1);return this},a.prototype.swap32=function(){const c=this.length;if(c%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let u=0;u<c;u+=4)I(this,u,u+3),I(this,u+1,u+2);return this},a.prototype.swap64=function(){const c=this.length;if(c%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let u=0;u<c;u+=8)I(this,u,u+7),I(this,u+1,u+6),I(this,u+2,u+5),I(this,u+3,u+4);return this},a.prototype.toString=function(){const c=this.length;return c===0?"":arguments.length===0?et(this,0,c):T.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(c){if(!a.isBuffer(c))throw new TypeError("Argument must be a Buffer");return this===c?!0:a.compare(this,c)===0},a.prototype.inspect=function(){let c="";const u=t.INSPECT_MAX_BYTES;return c=this.toString("hex",0,u).replace(/(.{2})/g,"$1 ").trim(),this.length>u&&(c+=" ... "),"<Buffer "+c+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(c,u,f,y,A){if(nt(c,Uint8Array)&&(c=a.from(c,c.offset,c.byteLength)),!a.isBuffer(c))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof c);if(u===void 0&&(u=0),f===void 0&&(f=c?c.length:0),y===void 0&&(y=0),A===void 0&&(A=this.length),u<0||f>c.length||y<0||A>this.length)throw new RangeError("out of range index");if(y>=A&&u>=f)return 0;if(y>=A)return-1;if(u>=f)return 1;if(u>>>=0,f>>>=0,y>>>=0,A>>>=0,this===c)return 0;let v=A-y,ne=f-u;const ve=Math.min(v,ne),Ie=this.slice(y,A),Ce=c.slice(u,f);for(let ge=0;ge<ve;++ge)if(Ie[ge]!==Ce[ge]){v=Ie[ge],ne=Ce[ge];break}return v<ne?-1:ne<v?1:0};function D(h,c,u,f,y){if(h.length===0)return-1;if(typeof u=="string"?(f=u,u=0):u>2147483647?u=2147483647:u<-2147483648&&(u=-2147483648),u=+u,Fn(u)&&(u=y?0:h.length-1),u<0&&(u=h.length+u),u>=h.length){if(y)return-1;u=h.length-1}else if(u<0)if(y)u=0;else return-1;if(typeof c=="string"&&(c=a.from(c,f)),a.isBuffer(c))return c.length===0?-1:z(h,c,u,f,y);if(typeof c=="number")return c=c&255,typeof Uint8Array.prototype.indexOf=="function"?y?Uint8Array.prototype.indexOf.call(h,c,u):Uint8Array.prototype.lastIndexOf.call(h,c,u):z(h,[c],u,f,y);throw new TypeError("val must be string, number or Buffer")}function z(h,c,u,f,y){let A=1,v=h.length,ne=c.length;if(f!==void 0&&(f=String(f).toLowerCase(),f==="ucs2"||f==="ucs-2"||f==="utf16le"||f==="utf-16le")){if(h.length<2||c.length<2)return-1;A=2,v/=2,ne/=2,u/=2}function ve(Ce,ge){return A===1?Ce[ge]:Ce.readUInt16BE(ge*A)}let Ie;if(y){let Ce=-1;for(Ie=u;Ie<v;Ie++)if(ve(h,Ie)===ve(c,Ce===-1?0:Ie-Ce)){if(Ce===-1&&(Ce=Ie),Ie-Ce+1===ne)return Ce*A}else Ce!==-1&&(Ie-=Ie-Ce),Ce=-1}else for(u+ne>v&&(u=v-ne),Ie=u;Ie>=0;Ie--){let Ce=!0;for(let ge=0;ge<ne;ge++)if(ve(h,Ie+ge)!==ve(c,ge)){Ce=!1;break}if(Ce)return Ie}return-1}a.prototype.includes=function(c,u,f){return this.indexOf(c,u,f)!==-1},a.prototype.indexOf=function(c,u,f){return D(this,c,u,f,!0)},a.prototype.lastIndexOf=function(c,u,f){return D(this,c,u,f,!1)};function L(h,c,u,f){u=Number(u)||0;const y=h.length-u;f?(f=Number(f),f>y&&(f=y)):f=y;const A=c.length;f>A/2&&(f=A/2);let v;for(v=0;v<f;++v){const ne=parseInt(c.substr(v*2,2),16);if(Fn(ne))return v;h[u+v]=ne}return v}function _(h,c,u,f){return Hn(en(c,h.length-u),h,u,f)}function he(h,c,u,f){return Hn(go(c),h,u,f)}function $(h,c,u,f){return Hn(mo(c),h,u,f)}function fe(h,c,u,f){return Hn(qi(c,h.length-u),h,u,f)}a.prototype.write=function(c,u,f,y){if(u===void 0)y="utf8",f=this.length,u=0;else if(f===void 0&&typeof u=="string")y=u,f=this.length,u=0;else if(isFinite(u))u=u>>>0,isFinite(f)?(f=f>>>0,y===void 0&&(y="utf8")):(y=f,f=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const A=this.length-u;if((f===void 0||f>A)&&(f=A),c.length>0&&(f<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");y||(y="utf8");let v=!1;for(;;)switch(y){case"hex":return L(this,c,u,f);case"utf8":case"utf-8":return _(this,c,u,f);case"ascii":case"latin1":case"binary":return he(this,c,u,f);case"base64":return $(this,c,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fe(this,c,u,f);default:if(v)throw new TypeError("Unknown encoding: "+y);y=(""+y).toLowerCase(),v=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function me(h,c,u){return c===0&&u===h.length?e.fromByteArray(h):e.fromByteArray(h.slice(c,u))}function et(h,c,u){u=Math.min(h.length,u);const f=[];let y=c;for(;y<u;){const A=h[y];let v=null,ne=A>239?4:A>223?3:A>191?2:1;if(y+ne<=u){let ve,Ie,Ce,ge;switch(ne){case 1:A<128&&(v=A);break;case 2:ve=h[y+1],(ve&192)===128&&(ge=(A&31)<<6|ve&63,ge>127&&(v=ge));break;case 3:ve=h[y+1],Ie=h[y+2],(ve&192)===128&&(Ie&192)===128&&(ge=(A&15)<<12|(ve&63)<<6|Ie&63,ge>2047&&(ge<55296||ge>57343)&&(v=ge));break;case 4:ve=h[y+1],Ie=h[y+2],Ce=h[y+3],(ve&192)===128&&(Ie&192)===128&&(Ce&192)===128&&(ge=(A&15)<<18|(ve&63)<<12|(Ie&63)<<6|Ce&63,ge>65535&&ge<1114112&&(v=ge))}}v===null?(v=65533,ne=1):v>65535&&(v-=65536,f.push(v>>>10&1023|55296),v=56320|v&1023),f.push(v),y+=ne}return tt(f)}const Fe=4096;function tt(h){const c=h.length;if(c<=Fe)return String.fromCharCode.apply(String,h);let u="",f=0;for(;f<c;)u+=String.fromCharCode.apply(String,h.slice(f,f+=Fe));return u}function Nt(h,c,u){let f="";u=Math.min(h.length,u);for(let y=c;y<u;++y)f+=String.fromCharCode(h[y]&127);return f}function W(h,c,u){let f="";u=Math.min(h.length,u);for(let y=c;y<u;++y)f+=String.fromCharCode(h[y]);return f}function k(h,c,u){const f=h.length;(!c||c<0)&&(c=0),(!u||u<0||u>f)&&(u=f);let y="";for(let A=c;A<u;++A)y+=Ir[h[A]];return y}function G(h,c,u){const f=h.slice(c,u);let y="";for(let A=0;A<f.length-1;A+=2)y+=String.fromCharCode(f[A]+f[A+1]*256);return y}a.prototype.slice=function(c,u){const f=this.length;c=~~c,u=u===void 0?f:~~u,c<0?(c+=f,c<0&&(c=0)):c>f&&(c=f),u<0?(u+=f,u<0&&(u=0)):u>f&&(u=f),u<c&&(u=c);const y=this.subarray(c,u);return Object.setPrototypeOf(y,a.prototype),y};function U(h,c,u){if(h%1!==0||h<0)throw new RangeError("offset is not uint");if(h+c>u)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(c,u,f){c=c>>>0,u=u>>>0,f||U(c,u,this.length);let y=this[c],A=1,v=0;for(;++v<u&&(A*=256);)y+=this[c+v]*A;return y},a.prototype.readUintBE=a.prototype.readUIntBE=function(c,u,f){c=c>>>0,u=u>>>0,f||U(c,u,this.length);let y=this[c+--u],A=1;for(;u>0&&(A*=256);)y+=this[c+--u]*A;return y},a.prototype.readUint8=a.prototype.readUInt8=function(c,u){return c=c>>>0,u||U(c,1,this.length),this[c]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(c,u){return c=c>>>0,u||U(c,2,this.length),this[c]|this[c+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(c,u){return c=c>>>0,u||U(c,2,this.length),this[c]<<8|this[c+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(c,u){return c=c>>>0,u||U(c,4,this.length),(this[c]|this[c+1]<<8|this[c+2]<<16)+this[c+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(c,u){return c=c>>>0,u||U(c,4,this.length),this[c]*16777216+(this[c+1]<<16|this[c+2]<<8|this[c+3])},a.prototype.readBigUInt64LE=It(function(c){c=c>>>0,ae(c,"offset");const u=this[c],f=this[c+7];(u===void 0||f===void 0)&&Oe(c,this.length-8);const y=u+this[++c]*2**8+this[++c]*2**16+this[++c]*2**24,A=this[++c]+this[++c]*2**8+this[++c]*2**16+f*2**24;return BigInt(y)+(BigInt(A)<<BigInt(32))}),a.prototype.readBigUInt64BE=It(function(c){c=c>>>0,ae(c,"offset");const u=this[c],f=this[c+7];(u===void 0||f===void 0)&&Oe(c,this.length-8);const y=u*2**24+this[++c]*2**16+this[++c]*2**8+this[++c],A=this[++c]*2**24+this[++c]*2**16+this[++c]*2**8+f;return(BigInt(y)<<BigInt(32))+BigInt(A)}),a.prototype.readIntLE=function(c,u,f){c=c>>>0,u=u>>>0,f||U(c,u,this.length);let y=this[c],A=1,v=0;for(;++v<u&&(A*=256);)y+=this[c+v]*A;return A*=128,y>=A&&(y-=Math.pow(2,8*u)),y},a.prototype.readIntBE=function(c,u,f){c=c>>>0,u=u>>>0,f||U(c,u,this.length);let y=u,A=1,v=this[c+--y];for(;y>0&&(A*=256);)v+=this[c+--y]*A;return A*=128,v>=A&&(v-=Math.pow(2,8*u)),v},a.prototype.readInt8=function(c,u){return c=c>>>0,u||U(c,1,this.length),this[c]&128?(255-this[c]+1)*-1:this[c]},a.prototype.readInt16LE=function(c,u){c=c>>>0,u||U(c,2,this.length);const f=this[c]|this[c+1]<<8;return f&32768?f|4294901760:f},a.prototype.readInt16BE=function(c,u){c=c>>>0,u||U(c,2,this.length);const f=this[c+1]|this[c]<<8;return f&32768?f|4294901760:f},a.prototype.readInt32LE=function(c,u){return c=c>>>0,u||U(c,4,this.length),this[c]|this[c+1]<<8|this[c+2]<<16|this[c+3]<<24},a.prototype.readInt32BE=function(c,u){return c=c>>>0,u||U(c,4,this.length),this[c]<<24|this[c+1]<<16|this[c+2]<<8|this[c+3]},a.prototype.readBigInt64LE=It(function(c){c=c>>>0,ae(c,"offset");const u=this[c],f=this[c+7];(u===void 0||f===void 0)&&Oe(c,this.length-8);const y=this[c+4]+this[c+5]*2**8+this[c+6]*2**16+(f<<24);return(BigInt(y)<<BigInt(32))+BigInt(u+this[++c]*2**8+this[++c]*2**16+this[++c]*2**24)}),a.prototype.readBigInt64BE=It(function(c){c=c>>>0,ae(c,"offset");const u=this[c],f=this[c+7];(u===void 0||f===void 0)&&Oe(c,this.length-8);const y=(u<<24)+this[++c]*2**16+this[++c]*2**8+this[++c];return(BigInt(y)<<BigInt(32))+BigInt(this[++c]*2**24+this[++c]*2**16+this[++c]*2**8+f)}),a.prototype.readFloatLE=function(c,u){return c=c>>>0,u||U(c,4,this.length),n.read(this,c,!0,23,4)},a.prototype.readFloatBE=function(c,u){return c=c>>>0,u||U(c,4,this.length),n.read(this,c,!1,23,4)},a.prototype.readDoubleLE=function(c,u){return c=c>>>0,u||U(c,8,this.length),n.read(this,c,!0,52,8)},a.prototype.readDoubleBE=function(c,u){return c=c>>>0,u||U(c,8,this.length),n.read(this,c,!1,52,8)};function H(h,c,u,f,y,A){if(!a.isBuffer(h))throw new TypeError('"buffer" argument must be a Buffer instance');if(c>y||c<A)throw new RangeError('"value" argument is out of bounds');if(u+f>h.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(c,u,f,y){if(c=+c,u=u>>>0,f=f>>>0,!y){const ne=Math.pow(2,8*f)-1;H(this,c,u,f,ne,0)}let A=1,v=0;for(this[u]=c&255;++v<f&&(A*=256);)this[u+v]=c/A&255;return u+f},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(c,u,f,y){if(c=+c,u=u>>>0,f=f>>>0,!y){const ne=Math.pow(2,8*f)-1;H(this,c,u,f,ne,0)}let A=f-1,v=1;for(this[u+A]=c&255;--A>=0&&(v*=256);)this[u+A]=c/v&255;return u+f},a.prototype.writeUint8=a.prototype.writeUInt8=function(c,u,f){return c=+c,u=u>>>0,f||H(this,c,u,1,255,0),this[u]=c&255,u+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(c,u,f){return c=+c,u=u>>>0,f||H(this,c,u,2,65535,0),this[u]=c&255,this[u+1]=c>>>8,u+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(c,u,f){return c=+c,u=u>>>0,f||H(this,c,u,2,65535,0),this[u]=c>>>8,this[u+1]=c&255,u+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(c,u,f){return c=+c,u=u>>>0,f||H(this,c,u,4,4294967295,0),this[u+3]=c>>>24,this[u+2]=c>>>16,this[u+1]=c>>>8,this[u]=c&255,u+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(c,u,f){return c=+c,u=u>>>0,f||H(this,c,u,4,4294967295,0),this[u]=c>>>24,this[u+1]=c>>>16,this[u+2]=c>>>8,this[u+3]=c&255,u+4};function ee(h,c,u,f,y){Se(c,f,y,h,u,7);let A=Number(c&BigInt(4294967295));h[u++]=A,A=A>>8,h[u++]=A,A=A>>8,h[u++]=A,A=A>>8,h[u++]=A;let v=Number(c>>BigInt(32)&BigInt(4294967295));return h[u++]=v,v=v>>8,h[u++]=v,v=v>>8,h[u++]=v,v=v>>8,h[u++]=v,u}function re(h,c,u,f,y){Se(c,f,y,h,u,7);let A=Number(c&BigInt(4294967295));h[u+7]=A,A=A>>8,h[u+6]=A,A=A>>8,h[u+5]=A,A=A>>8,h[u+4]=A;let v=Number(c>>BigInt(32)&BigInt(4294967295));return h[u+3]=v,v=v>>8,h[u+2]=v,v=v>>8,h[u+1]=v,v=v>>8,h[u]=v,u+8}a.prototype.writeBigUInt64LE=It(function(c,u=0){return ee(this,c,u,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=It(function(c,u=0){return re(this,c,u,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(c,u,f,y){if(c=+c,u=u>>>0,!y){const ve=Math.pow(2,8*f-1);H(this,c,u,f,ve-1,-ve)}let A=0,v=1,ne=0;for(this[u]=c&255;++A<f&&(v*=256);)c<0&&ne===0&&this[u+A-1]!==0&&(ne=1),this[u+A]=(c/v>>0)-ne&255;return u+f},a.prototype.writeIntBE=function(c,u,f,y){if(c=+c,u=u>>>0,!y){const ve=Math.pow(2,8*f-1);H(this,c,u,f,ve-1,-ve)}let A=f-1,v=1,ne=0;for(this[u+A]=c&255;--A>=0&&(v*=256);)c<0&&ne===0&&this[u+A+1]!==0&&(ne=1),this[u+A]=(c/v>>0)-ne&255;return u+f},a.prototype.writeInt8=function(c,u,f){return c=+c,u=u>>>0,f||H(this,c,u,1,127,-128),c<0&&(c=255+c+1),this[u]=c&255,u+1},a.prototype.writeInt16LE=function(c,u,f){return c=+c,u=u>>>0,f||H(this,c,u,2,32767,-32768),this[u]=c&255,this[u+1]=c>>>8,u+2},a.prototype.writeInt16BE=function(c,u,f){return c=+c,u=u>>>0,f||H(this,c,u,2,32767,-32768),this[u]=c>>>8,this[u+1]=c&255,u+2},a.prototype.writeInt32LE=function(c,u,f){return c=+c,u=u>>>0,f||H(this,c,u,4,2147483647,-2147483648),this[u]=c&255,this[u+1]=c>>>8,this[u+2]=c>>>16,this[u+3]=c>>>24,u+4},a.prototype.writeInt32BE=function(c,u,f){return c=+c,u=u>>>0,f||H(this,c,u,4,2147483647,-2147483648),c<0&&(c=4294967295+c+1),this[u]=c>>>24,this[u+1]=c>>>16,this[u+2]=c>>>8,this[u+3]=c&255,u+4},a.prototype.writeBigInt64LE=It(function(c,u=0){return ee(this,c,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=It(function(c,u=0){return re(this,c,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ue(h,c,u,f,y,A){if(u+f>h.length)throw new RangeError("Index out of range");if(u<0)throw new RangeError("Index out of range")}function te(h,c,u,f,y){return c=+c,u=u>>>0,y||ue(h,c,u,4),n.write(h,c,u,f,23,4),u+4}a.prototype.writeFloatLE=function(c,u,f){return te(this,c,u,!0,f)},a.prototype.writeFloatBE=function(c,u,f){return te(this,c,u,!1,f)};function se(h,c,u,f,y){return c=+c,u=u>>>0,y||ue(h,c,u,8),n.write(h,c,u,f,52,8),u+8}a.prototype.writeDoubleLE=function(c,u,f){return se(this,c,u,!0,f)},a.prototype.writeDoubleBE=function(c,u,f){return se(this,c,u,!1,f)},a.prototype.copy=function(c,u,f,y){if(!a.isBuffer(c))throw new TypeError("argument should be a Buffer");if(f||(f=0),!y&&y!==0&&(y=this.length),u>=c.length&&(u=c.length),u||(u=0),y>0&&y<f&&(y=f),y===f||c.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(f<0||f>=this.length)throw new RangeError("Index out of range");if(y<0)throw new RangeError("sourceEnd out of bounds");y>this.length&&(y=this.length),c.length-u<y-f&&(y=c.length-u+f);const A=y-f;return this===c&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(u,f,y):Uint8Array.prototype.set.call(c,this.subarray(f,y),u),A},a.prototype.fill=function(c,u,f,y){if(typeof c=="string"){if(typeof u=="string"?(y=u,u=0,f=this.length):typeof f=="string"&&(y=f,f=this.length),y!==void 0&&typeof y!="string")throw new TypeError("encoding must be a string");if(typeof y=="string"&&!a.isEncoding(y))throw new TypeError("Unknown encoding: "+y);if(c.length===1){const v=c.charCodeAt(0);(y==="utf8"&&v<128||y==="latin1")&&(c=v)}}else typeof c=="number"?c=c&255:typeof c=="boolean"&&(c=Number(c));if(u<0||this.length<u||this.length<f)throw new RangeError("Out of range index");if(f<=u)return this;u=u>>>0,f=f===void 0?this.length:f>>>0,c||(c=0);let A;if(typeof c=="number")for(A=u;A<f;++A)this[A]=c;else{const v=a.isBuffer(c)?c:a.from(c,y),ne=v.length;if(ne===0)throw new TypeError('The value "'+c+'" is invalid for argument "value"');for(A=0;A<f-u;++A)this[A+u]=v[A%ne]}return this};const pe={};function E(h,c,u){pe[h]=class extends u{constructor(){super(),Object.defineProperty(this,"message",{value:c.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${h}]`,this.stack,delete this.name}get code(){return h}set code(y){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:y,writable:!0})}toString(){return`${this.name} [${h}]: ${this.message}`}}}E("ERR_BUFFER_OUT_OF_BOUNDS",function(h){return h?`${h} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),E("ERR_INVALID_ARG_TYPE",function(h,c){return`The "${h}" argument must be of type number. Received type ${typeof c}`},TypeError),E("ERR_OUT_OF_RANGE",function(h,c,u){let f=`The value of "${h}" is out of range.`,y=u;return Number.isInteger(u)&&Math.abs(u)>2**32?y=S(String(u)):typeof u=="bigint"&&(y=String(u),(u>BigInt(2)**BigInt(32)||u<-(BigInt(2)**BigInt(32)))&&(y=S(y)),y+="n"),f+=` It must be ${c}. Received ${y}`,f},RangeError);function S(h){let c="",u=h.length;const f=h[0]==="-"?1:0;for(;u>=f+4;u-=3)c=`_${h.slice(u-3,u)}${c}`;return`${h.slice(0,u)}${c}`}function Y(h,c,u){ae(c,"offset"),(h[c]===void 0||h[c+u]===void 0)&&Oe(c,h.length-(u+1))}function Se(h,c,u,f,y,A){if(h>u||h<c){const v=typeof c=="bigint"?"n":"";let ne;throw c===0||c===BigInt(0)?ne=`>= 0${v} and < 2${v} ** ${(A+1)*8}${v}`:ne=`>= -(2${v} ** ${(A+1)*8-1}${v}) and < 2 ** ${(A+1)*8-1}${v}`,new pe.ERR_OUT_OF_RANGE("value",ne,h)}Y(f,y,A)}function ae(h,c){if(typeof h!="number")throw new pe.ERR_INVALID_ARG_TYPE(c,"number",h)}function Oe(h,c,u){throw Math.floor(h)!==h?(ae(h,u),new pe.ERR_OUT_OF_RANGE("offset","an integer",h)):c<0?new pe.ERR_BUFFER_OUT_OF_BOUNDS:new pe.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${c}`,h)}const ut=/[^+/0-9A-Za-z-_]/g;function $n(h){if(h=h.split("=")[0],h=h.trim().replace(ut,""),h.length<2)return"";for(;h.length%4!==0;)h=h+"=";return h}function en(h,c){c=c||1/0;let u;const f=h.length;let y=null;const A=[];for(let v=0;v<f;++v){if(u=h.charCodeAt(v),u>55295&&u<57344){if(!y){if(u>56319){(c-=3)>-1&&A.push(239,191,189);continue}else if(v+1===f){(c-=3)>-1&&A.push(239,191,189);continue}y=u;continue}if(u<56320){(c-=3)>-1&&A.push(239,191,189),y=u;continue}u=(y-55296<<10|u-56320)+65536}else y&&(c-=3)>-1&&A.push(239,191,189);if(y=null,u<128){if((c-=1)<0)break;A.push(u)}else if(u<2048){if((c-=2)<0)break;A.push(u>>6|192,u&63|128)}else if(u<65536){if((c-=3)<0)break;A.push(u>>12|224,u>>6&63|128,u&63|128)}else if(u<1114112){if((c-=4)<0)break;A.push(u>>18|240,u>>12&63|128,u>>6&63|128,u&63|128)}else throw new Error("Invalid code point")}return A}function go(h){const c=[];for(let u=0;u<h.length;++u)c.push(h.charCodeAt(u)&255);return c}function qi(h,c){let u,f,y;const A=[];for(let v=0;v<h.length&&!((c-=2)<0);++v)u=h.charCodeAt(v),f=u>>8,y=u%256,A.push(y),A.push(f);return A}function mo(h){return e.toByteArray($n(h))}function Hn(h,c,u,f){let y;for(y=0;y<f&&!(y+u>=c.length||y>=h.length);++y)c[y+u]=h[y];return y}function nt(h,c){return h instanceof c||h!=null&&h.constructor!=null&&h.constructor.name!=null&&h.constructor.name===c.name}function Fn(h){return h!==h}const Ir=function(){const h="0123456789abcdef",c=new Array(256);for(let u=0;u<16;++u){const f=u*16;for(let y=0;y<16;++y)c[f+y]=h[u]+h[y]}return c}();function It(h){return typeof BigInt>"u"?yo:h}function yo(){throw new Error("BigInt not supported")}})(oe);const Sl=()=>{globalThis.Buffer||(globalThis.Buffer=oe.Buffer)};var xo=function(t,e){return xo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])},xo(t,e)};function xt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");xo(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function El(t,e,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(p){try{d(r.next(p))}catch(g){s(g)}}function l(p){try{d(r.throw(p))}catch(g){s(g)}}function d(p){p.done?i(p.value):o(p.value).then(a,l)}d((r=r.apply(t,e||[])).next())})}function Qi(t,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(d){return function(p){return l([d,p])}}function l(d){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,d[0]&&(n=0)),n;)try{if(r=1,o&&(i=d[0]&2?o.return:d[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,d[1])).done)return i;switch(o=0,i&&(d=[d[0]&2,i.value]),d[0]){case 0:case 1:i=d;break;case 4:return n.label++,{value:d[1],done:!1};case 5:n.label++,o=d[1],d=[0];continue;case 7:d=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!i||d[1]>i[0]&&d[1]<i[3])){n.label=d[1];break}if(d[0]===6&&n.label<i[1]){n.label=i[1],i=d;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(d);break}i[2]&&n.ops.pop(),n.trys.pop();continue}d=e.call(t,n)}catch(p){d=[6,p],o=0}finally{r=i=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function wn(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function tn(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),o,i=[],s;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i}function Mn(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}function vn(t){return this instanceof vn?(this.v=t,this):new vn(t)}function jl(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),o,i=[];return o={},s("next"),s("throw"),s("return"),o[Symbol.asyncIterator]=function(){return this},o;function s(m){r[m]&&(o[m]=function(b){return new Promise(function(x,w){i.push([m,b,x,w])>1||a(m,b)})})}function a(m,b){try{l(r[m](b))}catch(x){g(i[0][3],x)}}function l(m){m.value instanceof vn?Promise.resolve(m.value.v).then(d,p):g(i[0][2],m)}function d(m){a("next",m)}function p(m){a("throw",m)}function g(m,b){m(b),i.shift(),i.length&&a(i[0][0],i[0][1])}}function kl(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof wn=="function"?wn(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(i){n[i]=t[i]&&function(s){return new Promise(function(a,l){s=t[i](s),o(a,l,s.done,s.value)})}}function o(i,s,a,l){Promise.resolve(l).then(function(d){i({value:d,done:a})},s)}}typeof SuppressedError=="function"&&SuppressedError;function de(t){return typeof t=="function"}function Ao(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var wo=Ao(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
`+n.map(function(r,o){return o+1+") "+r.toString()}).join(`
`):"",this.name="UnsubscriptionError",this.errors=n}});function br(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var it=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,o,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=wn(s),l=a.next();!l.done;l=a.next()){var d=l.value;d.remove(this)}}catch(w){e={error:w}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}else s.remove(this);var p=this.initialTeardown;if(de(p))try{p()}catch(w){i=w instanceof wo?w.errors:[w]}var g=this._finalizers;if(g){this._finalizers=null;try{for(var m=wn(g),b=m.next();!b.done;b=m.next()){var x=b.value;try{Ki(x)}catch(w){i=i??[],w instanceof wo?i=Mn(Mn([],tn(i)),tn(w.errors)):i.push(w)}}}catch(w){r={error:w}}finally{try{b&&!b.done&&(o=m.return)&&o.call(m)}finally{if(r)throw r.error}}}if(i)throw new wo(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Ki(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&br(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&br(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),Xi=it.EMPTY;function Ji(t){return t instanceof it||t&&"closed"in t&&de(t.remove)&&de(t.add)&&de(t.unsubscribe)}function Ki(t){de(t)?t():t.unsubscribe()}var es={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ts={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,Mn([t,e],tn(n)))},clearTimeout:function(t){var e=ts.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function ns(t){ts.setTimeout(function(){throw t})}function xr(){}function Ar(t){t()}var Mo=function(t){xt(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,Ji(n)&&n.add(r)):r.destination=Bl,r}return e.create=function(n,r,o){return new Cn(n,r,o)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(it),zl=Function.prototype.bind;function vo(t,e){return zl.call(t,e)}var Ll=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){wr(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){wr(r)}else wr(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){wr(n)}},t}(),Cn=function(t){xt(e,t);function e(n,r,o){var i=t.call(this)||this,s;if(de(n)||!n)s={next:n??void 0,error:r??void 0,complete:o??void 0};else{var a;i&&es.useDeprecatedNextContext?(a=Object.create(n),a.unsubscribe=function(){return i.unsubscribe()},s={next:n.next&&vo(n.next,a),error:n.error&&vo(n.error,a),complete:n.complete&&vo(n.complete,a)}):s=n}return i.destination=new Ll(s),i}return e}(Mo);function wr(t){ns(t)}function Pl(t){throw t}var Bl={closed:!0,next:xr,error:Pl,complete:xr},Co=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Mr(t){return t}function Rl(t){return t.length===0?Mr:t.length===1?t[0]:function(n){return t.reduce(function(r,o){return o(r)},n)}}var Ge=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var o=this,i=Ul(e)?e:new Cn(e,n,r);return Ar(function(){var s=o,a=s.operator,l=s.source;i.add(a?a.call(i,l):l?o._subscribe(i):o._trySubscribe(i))}),i},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=rs(n),new n(function(o,i){var s=new Cn({next:function(a){try{e(a)}catch(l){i(l),s.unsubscribe()}},error:i,complete:o});r.subscribe(s)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[Co]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Rl(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=rs(e),new e(function(r,o){var i;n.subscribe(function(s){return i=s},function(s){return o(s)},function(){return r(i)})})},t.create=function(e){return new t(e)},t}();function rs(t){var e;return(e=t??es.Promise)!==null&&e!==void 0?e:Promise}function Ol(t){return t&&de(t.next)&&de(t.error)&&de(t.complete)}function Ul(t){return t&&t instanceof Mo||Ol(t)&&Ji(t)}function Wl(t){return de(t==null?void 0:t.lift)}function qe(t){return function(e){if(Wl(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function Ve(t,e,n,r,o){return new Zl(t,e,n,r,o)}var Zl=function(t){xt(e,t);function e(n,r,o,i,s,a){var l=t.call(this,n)||this;return l.onFinalize=s,l.shouldUnsubscribe=a,l._next=r?function(d){try{r(d)}catch(p){n.error(p)}}:t.prototype._next,l._error=i?function(d){try{i(d)}catch(p){n.error(p)}finally{this.unsubscribe()}}:t.prototype._error,l._complete=o?function(){try{o()}catch(d){n.error(d)}finally{this.unsubscribe()}}:t.prototype._complete,l}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(Mo),Gl=Ao(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Ae=function(t){xt(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new os(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new Gl},e.prototype.next=function(n){var r=this;Ar(function(){var o,i;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var s=wn(r.currentObservers),a=s.next();!a.done;a=s.next()){var l=a.value;l.next(n)}}catch(d){o={error:d}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}})},e.prototype.error=function(n){var r=this;Ar(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var o=r.observers;o.length;)o.shift().error(n)}})},e.prototype.complete=function(){var n=this;Ar(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,o=this,i=o.hasError,s=o.isStopped,a=o.observers;return i||s?Xi:(this.currentObservers=null,a.push(n),new it(function(){r.currentObservers=null,br(a,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,o=r.hasError,i=r.thrownError,s=r.isStopped;o?n.error(i):s&&n.complete()},e.prototype.asObservable=function(){var n=new Ge;return n.source=this,n},e.create=function(n,r){return new os(n,r)},e}(Ge),os=function(t){xt(e,t);function e(n,r){var o=t.call(this)||this;return o.destination=n,o.source=r,o}return e.prototype.next=function(n){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.next)===null||o===void 0||o.call(r,n)},e.prototype.error=function(n){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.error)===null||o===void 0||o.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,o;return(o=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&o!==void 0?o:Xi},e}(Ae),Pe=function(t){xt(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){var n=this,r=n.hasError,o=n.thrownError,i=n._value;if(r)throw o;return this._throwIfClosed(),i},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e}(Ae),No={now:function(){return(No.delegate||Date).now()},delegate:void 0},is=function(t){xt(e,t);function e(n,r,o){n===void 0&&(n=1/0),r===void 0&&(r=1/0),o===void 0&&(o=No);var i=t.call(this)||this;return i._bufferSize=n,i._windowTime=r,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,n),i._windowTime=Math.max(1,r),i}return e.prototype.next=function(n){var r=this,o=r.isStopped,i=r._buffer,s=r._infiniteTimeWindow,a=r._timestampProvider,l=r._windowTime;o||(i.push(n),!s&&i.push(a.now()+l)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),o=this,i=o._infiniteTimeWindow,s=o._buffer,a=s.slice(),l=0;l<a.length&&!n.closed;l+=i?1:2)n.next(a[l]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,o=n._timestampProvider,i=n._buffer,s=n._infiniteTimeWindow,a=(s?1:2)*r;if(r<1/0&&a<i.length&&i.splice(0,i.length-a),!s){for(var l=o.now(),d=0,p=1;p<i.length&&i[p]<=l;p+=2)d=p;d&&i.splice(0,d+1)}},e}(Ae),_l=function(t){xt(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(it),Do={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,Mn([t,e],tn(n)))},clearInterval:function(t){var e=Do.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},$l=function(t){xt(e,t);function e(n,r){var o=t.call(this,n,r)||this;return o.scheduler=n,o.work=r,o.pending=!1,o}return e.prototype.schedule=function(n,r){var o;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,r)),this.pending=!0,this.delay=r,this.id=(o=this.id)!==null&&o!==void 0?o:this.requestAsyncId(s,this.id,r),this},e.prototype.requestAsyncId=function(n,r,o){return o===void 0&&(o=0),Do.setInterval(n.flush.bind(n,this),o)},e.prototype.recycleAsyncId=function(n,r,o){if(o===void 0&&(o=0),o!=null&&this.delay===o&&this.pending===!1)return r;r!=null&&Do.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var o=this._execute(n,r);if(o)return o;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var o=!1,i;try{this.work(n)}catch(s){o=!0,i=s||new Error("Scheduled action threw falsy error")}if(o)return this.unsubscribe(),i},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,o=n.scheduler,i=o.actions;this.work=this.state=this.scheduler=null,this.pending=!1,br(i,this),r!=null&&(this.id=this.recycleAsyncId(o,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(_l),ss=function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(r,n)},t.now=No.now,t}(),Hl=function(t){xt(e,t);function e(n,r){r===void 0&&(r=ss.now);var o=t.call(this,n,r)||this;return o.actions=[],o._active=!1,o}return e.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var o;this._active=!0;do if(o=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,o){for(;n=r.shift();)n.unsubscribe();throw o}},e}(ss),as=new Hl($l),Fl=as,cs=new Ge(function(t){return t.complete()});function us(t){return t&&de(t.schedule)}function ls(t){return t[t.length-1]}function ds(t){return us(ls(t))?t.pop():void 0}function Yl(t,e){return typeof ls(t)=="number"?t.pop():e}var To=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function ps(t){return de(t==null?void 0:t.then)}function hs(t){return de(t[Co])}function fs(t){return Symbol.asyncIterator&&de(t==null?void 0:t[Symbol.asyncIterator])}function gs(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function ql(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var ms=ql();function ys(t){return de(t==null?void 0:t[ms])}function Is(t){return jl(this,arguments,function(){var n,r,o,i;return Qi(this,function(s){switch(s.label){case 0:n=t.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,vn(n.read())];case 3:return r=s.sent(),o=r.value,i=r.done,i?[4,vn(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,vn(o)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function bs(t){return de(t==null?void 0:t.getReader)}function Ye(t){if(t instanceof Ge)return t;if(t!=null){if(hs(t))return Vl(t);if(To(t))return Ql(t);if(ps(t))return Xl(t);if(fs(t))return xs(t);if(ys(t))return Jl(t);if(bs(t))return Kl(t)}throw gs(t)}function Vl(t){return new Ge(function(e){var n=t[Co]();if(de(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Ql(t){return new Ge(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function Xl(t){return new Ge(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,ns)})}function Jl(t){return new Ge(function(e){var n,r;try{for(var o=wn(t),i=o.next();!i.done;i=o.next()){var s=i.value;if(e.next(s),e.closed)return}}catch(a){n={error:a}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}e.complete()})}function xs(t){return new Ge(function(e){ed(t,e).catch(function(n){return e.error(n)})})}function Kl(t){return xs(Is(t))}function ed(t,e){var n,r,o,i;return El(this,void 0,void 0,function(){var s,a;return Qi(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=kl(t),l.label=1;case 1:return[4,n.next()];case 2:if(r=l.sent(),!!r.done)return[3,4];if(s=r.value,e.next(s),e.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=l.sent(),o={error:a},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(i=n.return)?[4,i.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function nn(t,e,n,r,o){r===void 0&&(r=0),o===void 0&&(o=!1);var i=e.schedule(function(){n(),o?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(i),!o)return i}function As(t,e){return e===void 0&&(e=0),qe(function(n,r){n.subscribe(Ve(r,function(o){return nn(r,t,function(){return r.next(o)},e)},function(){return nn(r,t,function(){return r.complete()},e)},function(o){return nn(r,t,function(){return r.error(o)},e)}))})}function ws(t,e){return e===void 0&&(e=0),qe(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function td(t,e){return Ye(t).pipe(ws(e),As(e))}function nd(t,e){return Ye(t).pipe(ws(e),As(e))}function rd(t,e){return new Ge(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function od(t,e){return new Ge(function(n){var r;return nn(n,e,function(){r=t[ms](),nn(n,e,function(){var o,i,s;try{o=r.next(),i=o.value,s=o.done}catch(a){n.error(a);return}s?n.complete():n.next(i)},0,!0)}),function(){return de(r==null?void 0:r.return)&&r.return()}})}function Ms(t,e){if(!t)throw new Error("Iterable cannot be null");return new Ge(function(n){nn