@radixdlt/radix-dapp-toolkit
Version:
Radix dApp Toolkit repository
8 lines • 309 kB
JavaScript
(function(ot,ie){typeof exports=="object"&&typeof module<"u"?module.exports=ie():typeof define=="function"&&define.amd?define(ie):(ot=typeof globalThis<"u"?globalThis:ot||self,ot.RDT=ie())})(this,function(){"use strict";var w0=Object.defineProperty;var M0=(ot,ie,Dt)=>ie in ot?w0(ot,ie,{enumerable:!0,configurable:!0,writable:!0,value:Dt}):ot[ie]=Dt;var xl=(ot,ie,Dt)=>M0(ot,typeof ie!="symbol"?ie+"":ie,Dt);var bl;function ot(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ie={},Dt={};Dt.byteLength=vl,Dt.toByteArray=Nl,Dt.fromByteArray=Sl;for(var bt=[],it=[],wl=typeof Uint8Array<"u"?Uint8Array:Array,Io="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",An=0,Ml=Io.length;An<Ml;++An)bt[An]=Io[An],it[Io.charCodeAt(An)]=An;it[45]=62,it[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 vl(t){var e=Vi(t),n=e[0],r=e[1];return(n+r)*3/4-r}function Cl(t,e,n){return(e+n)*3/4-n}function Nl(t){var e,n=Vi(t),r=n[0],o=n[1],i=new wl(Cl(t,r,o)),s=0,a=o>0?r-4:r,l;for(l=0;l<a;l+=4)e=it[t.charCodeAt(l)]<<18|it[t.charCodeAt(l+1)]<<12|it[t.charCodeAt(l+2)]<<6|it[t.charCodeAt(l+3)],i[s++]=e>>16&255,i[s++]=e>>8&255,i[s++]=e&255;return o===2&&(e=it[t.charCodeAt(l)]<<2|it[t.charCodeAt(l+1)]>>4,i[s++]=e&255),o===1&&(e=it[t.charCodeAt(l)]<<10|it[t.charCodeAt(l+1)]<<4|it[t.charCodeAt(l+2)]>>2,i[s++]=e>>8&255,i[s++]=e&255),i}function Dl(t){return bt[t>>18&63]+bt[t>>12&63]+bt[t>>6&63]+bt[t&63]}function Tl(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(Dl(r));return o.join("")}function Sl(t){for(var e,n=t.length,r=n%3,o=[],i=16383,s=0,a=n-r;s<a;s+=i)o.push(Tl(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,h=-7,f=n?o-1:0,m=n?-1:1,b=t[e+f];for(f+=m,i=b&(1<<-h)-1,b>>=-h,h+=a;h>0;i=i*256+t[e+f],f+=m,h-=8);for(s=i&(1<<-h)-1,i>>=-h,h+=r;h>0;s=s*256+t[e+f],f+=m,h-=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,h=(1<<d)-1,f=h>>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=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+f>=1?e+=m/l:e+=m*Math.pow(2,1-f),e*l>=2&&(s++,l/=2),s+f>=h?(a=0,s=h):s+f>=1?(a=(e*l-1)*Math.pow(2,o),s=s+f):(a=e*Math.pow(2,f-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 p=new Uint8Array(1),c={foo:function(){return 42}};return Object.setPrototypeOf(c,Uint8Array.prototype),Object.setPrototypeOf(p,c),p.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(p){if(p>o)throw new RangeError('The value "'+p+'" is invalid for option "size"');const c=new Uint8Array(p);return Object.setPrototypeOf(c,a.prototype),c}function a(p,c,u){if(typeof p=="number"){if(typeof c=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(p)}return l(p,c,u)}a.poolSize=8192;function l(p,c,u){if(typeof p=="string")return m(p,c);if(ArrayBuffer.isView(p))return x(p);if(p==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p);if(rt(p,ArrayBuffer)||p&&rt(p.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(rt(p,SharedArrayBuffer)||p&&rt(p.buffer,SharedArrayBuffer)))return w(p,c,u);if(typeof p=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const g=p.valueOf&&p.valueOf();if(g!=null&&g!==p)return a.from(g,c,u);const y=M(p);if(y)return y;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof p[Symbol.toPrimitive]=="function")return a.from(p[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 p)}a.from=function(p,c,u){return l(p,c,u)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function d(p){if(typeof p!="number")throw new TypeError('"size" argument must be of type number');if(p<0)throw new RangeError('The value "'+p+'" is invalid for option "size"')}function h(p,c,u){return d(p),p<=0?s(p):c!==void 0?typeof u=="string"?s(p).fill(c,u):s(p).fill(c):s(p)}a.alloc=function(p,c,u){return h(p,c,u)};function f(p){return d(p),s(p<0?0:C(p)|0)}a.allocUnsafe=function(p){return f(p)},a.allocUnsafeSlow=function(p){return f(p)};function m(p,c){if((typeof c!="string"||c==="")&&(c="utf8"),!a.isEncoding(c))throw new TypeError("Unknown encoding: "+c);const u=N(p,c)|0;let g=s(u);const y=g.write(p,c);return y!==u&&(g=g.slice(0,y)),g}function b(p){const c=p.length<0?0:C(p.length)|0,u=s(c);for(let g=0;g<c;g+=1)u[g]=p[g]&255;return u}function x(p){if(rt(p,Uint8Array)){const c=new Uint8Array(p);return w(c.buffer,c.byteOffset,c.byteLength)}return b(p)}function w(p,c,u){if(c<0||p.byteLength<c)throw new RangeError('"offset" is outside of buffer bounds');if(p.byteLength<c+(u||0))throw new RangeError('"length" is outside of buffer bounds');let g;return c===void 0&&u===void 0?g=new Uint8Array(p):u===void 0?g=new Uint8Array(p,c):g=new Uint8Array(p,c,u),Object.setPrototypeOf(g,a.prototype),g}function M(p){if(a.isBuffer(p)){const c=C(p.length)|0,u=s(c);return u.length===0||p.copy(u,0,0,c),u}if(p.length!==void 0)return typeof p.length!="number"||Fn(p.length)?s(0):b(p);if(p.type==="Buffer"&&Array.isArray(p.data))return b(p.data)}function C(p){if(p>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return p|0}function j(p){return+p!=p&&(p=0),a.alloc(+p)}a.isBuffer=function(c){return c!=null&&c._isBuffer===!0&&c!==a.prototype},a.compare=function(c,u){if(rt(c,Uint8Array)&&(c=a.from(c,c.offset,c.byteLength)),rt(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 g=c.length,y=u.length;for(let A=0,v=Math.min(g,y);A<v;++A)if(c[A]!==u[A]){g=c[A],y=u[A];break}return g<y?-1:y<g?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 g;if(u===void 0)for(u=0,g=0;g<c.length;++g)u+=c[g].length;const y=a.allocUnsafe(u);let A=0;for(g=0;g<c.length;++g){let v=c[g];if(rt(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(p,c){if(a.isBuffer(p))return p.length;if(ArrayBuffer.isView(p)||rt(p,ArrayBuffer))return p.byteLength;if(typeof p!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof p);const u=p.length,g=arguments.length>2&&arguments[2]===!0;if(!g&&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(p).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u*2;case"hex":return u>>>1;case"base64":return mo(p).length;default:if(y)return g?-1:en(p).length;c=(""+c).toLowerCase(),y=!0}}a.byteLength=N;function S(p,c,u){let g=!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(p||(p="utf8");;)switch(p){case"hex":return k(this,c,u);case"utf8":case"utf-8":return tt(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(g)throw new TypeError("Unknown encoding: "+p);p=(p+"").toLowerCase(),g=!0}}a.prototype._isBuffer=!0;function I(p,c,u){const g=p[c];p[c]=p[u],p[u]=g}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?tt(this,0,c):S.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,g,y,A){if(rt(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),g===void 0&&(g=c?c.length:0),y===void 0&&(y=0),A===void 0&&(A=this.length),u<0||g>c.length||y<0||A>this.length)throw new RangeError("out of range index");if(y>=A&&u>=g)return 0;if(y>=A)return-1;if(u>=g)return 1;if(u>>>=0,g>>>=0,y>>>=0,A>>>=0,this===c)return 0;let v=A-y,ne=g-u;const Ce=Math.min(v,ne),Ie=this.slice(y,A),Ne=c.slice(u,g);for(let ge=0;ge<Ce;++ge)if(Ie[ge]!==Ne[ge]){v=Ie[ge],ne=Ne[ge];break}return v<ne?-1:ne<v?1:0};function D(p,c,u,g,y){if(p.length===0)return-1;if(typeof u=="string"?(g=u,u=0):u>2147483647?u=2147483647:u<-2147483648&&(u=-2147483648),u=+u,Fn(u)&&(u=y?0:p.length-1),u<0&&(u=p.length+u),u>=p.length){if(y)return-1;u=p.length-1}else if(u<0)if(y)u=0;else return-1;if(typeof c=="string"&&(c=a.from(c,g)),a.isBuffer(c))return c.length===0?-1:z(p,c,u,g,y);if(typeof c=="number")return c=c&255,typeof Uint8Array.prototype.indexOf=="function"?y?Uint8Array.prototype.indexOf.call(p,c,u):Uint8Array.prototype.lastIndexOf.call(p,c,u):z(p,[c],u,g,y);throw new TypeError("val must be string, number or Buffer")}function z(p,c,u,g,y){let A=1,v=p.length,ne=c.length;if(g!==void 0&&(g=String(g).toLowerCase(),g==="ucs2"||g==="ucs-2"||g==="utf16le"||g==="utf-16le")){if(p.length<2||c.length<2)return-1;A=2,v/=2,ne/=2,u/=2}function Ce(Ne,ge){return A===1?Ne[ge]:Ne.readUInt16BE(ge*A)}let Ie;if(y){let Ne=-1;for(Ie=u;Ie<v;Ie++)if(Ce(p,Ie)===Ce(c,Ne===-1?0:Ie-Ne)){if(Ne===-1&&(Ne=Ie),Ie-Ne+1===ne)return Ne*A}else Ne!==-1&&(Ie-=Ie-Ne),Ne=-1}else for(u+ne>v&&(u=v-ne),Ie=u;Ie>=0;Ie--){let Ne=!0;for(let ge=0;ge<ne;ge++)if(Ce(p,Ie+ge)!==Ce(c,ge)){Ne=!1;break}if(Ne)return Ie}return-1}a.prototype.includes=function(c,u,g){return this.indexOf(c,u,g)!==-1},a.prototype.indexOf=function(c,u,g){return D(this,c,u,g,!0)},a.prototype.lastIndexOf=function(c,u,g){return D(this,c,u,g,!1)};function L(p,c,u,g){u=Number(u)||0;const y=p.length-u;g?(g=Number(g),g>y&&(g=y)):g=y;const A=c.length;g>A/2&&(g=A/2);let v;for(v=0;v<g;++v){const ne=parseInt(c.substr(v*2,2),16);if(Fn(ne))return v;p[u+v]=ne}return v}function _(p,c,u,g){return $n(en(c,p.length-u),p,u,g)}function pe(p,c,u,g){return $n(go(c),p,u,g)}function H(p,c,u,g){return $n(mo(c),p,u,g)}function fe(p,c,u,g){return $n(qi(c,p.length-u),p,u,g)}a.prototype.write=function(c,u,g,y){if(u===void 0)y="utf8",g=this.length,u=0;else if(g===void 0&&typeof u=="string")y=u,g=this.length,u=0;else if(isFinite(u))u=u>>>0,isFinite(g)?(g=g>>>0,y===void 0&&(y="utf8")):(y=g,g=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const A=this.length-u;if((g===void 0||g>A)&&(g=A),c.length>0&&(g<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,g);case"utf8":case"utf-8":return _(this,c,u,g);case"ascii":case"latin1":case"binary":return pe(this,c,u,g);case"base64":return H(this,c,u,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fe(this,c,u,g);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(p,c,u){return c===0&&u===p.length?e.fromByteArray(p):e.fromByteArray(p.slice(c,u))}function tt(p,c,u){u=Math.min(p.length,u);const g=[];let y=c;for(;y<u;){const A=p[y];let v=null,ne=A>239?4:A>223?3:A>191?2:1;if(y+ne<=u){let Ce,Ie,Ne,ge;switch(ne){case 1:A<128&&(v=A);break;case 2:Ce=p[y+1],(Ce&192)===128&&(ge=(A&31)<<6|Ce&63,ge>127&&(v=ge));break;case 3:Ce=p[y+1],Ie=p[y+2],(Ce&192)===128&&(Ie&192)===128&&(ge=(A&15)<<12|(Ce&63)<<6|Ie&63,ge>2047&&(ge<55296||ge>57343)&&(v=ge));break;case 4:Ce=p[y+1],Ie=p[y+2],Ne=p[y+3],(Ce&192)===128&&(Ie&192)===128&&(Ne&192)===128&&(ge=(A&15)<<18|(Ce&63)<<12|(Ie&63)<<6|Ne&63,ge>65535&&ge<1114112&&(v=ge))}}v===null?(v=65533,ne=1):v>65535&&(v-=65536,g.push(v>>>10&1023|55296),v=56320|v&1023),g.push(v),y+=ne}return nt(g)}const Ye=4096;function nt(p){const c=p.length;if(c<=Ye)return String.fromCharCode.apply(String,p);let u="",g=0;for(;g<c;)u+=String.fromCharCode.apply(String,p.slice(g,g+=Ye));return u}function Nt(p,c,u){let g="";u=Math.min(p.length,u);for(let y=c;y<u;++y)g+=String.fromCharCode(p[y]&127);return g}function W(p,c,u){let g="";u=Math.min(p.length,u);for(let y=c;y<u;++y)g+=String.fromCharCode(p[y]);return g}function k(p,c,u){const g=p.length;(!c||c<0)&&(c=0),(!u||u<0||u>g)&&(u=g);let y="";for(let A=c;A<u;++A)y+=Ir[p[A]];return y}function G(p,c,u){const g=p.slice(c,u);let y="";for(let A=0;A<g.length-1;A+=2)y+=String.fromCharCode(g[A]+g[A+1]*256);return y}a.prototype.slice=function(c,u){const g=this.length;c=~~c,u=u===void 0?g:~~u,c<0?(c+=g,c<0&&(c=0)):c>g&&(c=g),u<0?(u+=g,u<0&&(u=0)):u>g&&(u=g),u<c&&(u=c);const y=this.subarray(c,u);return Object.setPrototypeOf(y,a.prototype),y};function U(p,c,u){if(p%1!==0||p<0)throw new RangeError("offset is not uint");if(p+c>u)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(c,u,g){c=c>>>0,u=u>>>0,g||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,g){c=c>>>0,u=u>>>0,g||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,oe(c,"offset");const u=this[c],g=this[c+7];(u===void 0||g===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+g*2**24;return BigInt(y)+(BigInt(A)<<BigInt(32))}),a.prototype.readBigUInt64BE=It(function(c){c=c>>>0,oe(c,"offset");const u=this[c],g=this[c+7];(u===void 0||g===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+g;return(BigInt(y)<<BigInt(32))+BigInt(A)}),a.prototype.readIntLE=function(c,u,g){c=c>>>0,u=u>>>0,g||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,g){c=c>>>0,u=u>>>0,g||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 g=this[c]|this[c+1]<<8;return g&32768?g|4294901760:g},a.prototype.readInt16BE=function(c,u){c=c>>>0,u||U(c,2,this.length);const g=this[c+1]|this[c]<<8;return g&32768?g|4294901760:g},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,oe(c,"offset");const u=this[c],g=this[c+7];(u===void 0||g===void 0)&&Oe(c,this.length-8);const y=this[c+4]+this[c+5]*2**8+this[c+6]*2**16+(g<<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,oe(c,"offset");const u=this[c],g=this[c+7];(u===void 0||g===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+g)}),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 $(p,c,u,g,y,A){if(!a.isBuffer(p))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+g>p.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(c,u,g,y){if(c=+c,u=u>>>0,g=g>>>0,!y){const ne=Math.pow(2,8*g)-1;$(this,c,u,g,ne,0)}let A=1,v=0;for(this[u]=c&255;++v<g&&(A*=256);)this[u+v]=c/A&255;return u+g},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(c,u,g,y){if(c=+c,u=u>>>0,g=g>>>0,!y){const ne=Math.pow(2,8*g)-1;$(this,c,u,g,ne,0)}let A=g-1,v=1;for(this[u+A]=c&255;--A>=0&&(v*=256);)this[u+A]=c/v&255;return u+g},a.prototype.writeUint8=a.prototype.writeUInt8=function(c,u,g){return c=+c,u=u>>>0,g||$(this,c,u,1,255,0),this[u]=c&255,u+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(c,u,g){return c=+c,u=u>>>0,g||$(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,g){return c=+c,u=u>>>0,g||$(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,g){return c=+c,u=u>>>0,g||$(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,g){return c=+c,u=u>>>0,g||$(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(p,c,u,g,y){ve(c,g,y,p,u,7);let A=Number(c&BigInt(4294967295));p[u++]=A,A=A>>8,p[u++]=A,A=A>>8,p[u++]=A,A=A>>8,p[u++]=A;let v=Number(c>>BigInt(32)&BigInt(4294967295));return p[u++]=v,v=v>>8,p[u++]=v,v=v>>8,p[u++]=v,v=v>>8,p[u++]=v,u}function re(p,c,u,g,y){ve(c,g,y,p,u,7);let A=Number(c&BigInt(4294967295));p[u+7]=A,A=A>>8,p[u+6]=A,A=A>>8,p[u+5]=A,A=A>>8,p[u+4]=A;let v=Number(c>>BigInt(32)&BigInt(4294967295));return p[u+3]=v,v=v>>8,p[u+2]=v,v=v>>8,p[u+1]=v,v=v>>8,p[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,g,y){if(c=+c,u=u>>>0,!y){const Ce=Math.pow(2,8*g-1);$(this,c,u,g,Ce-1,-Ce)}let A=0,v=1,ne=0;for(this[u]=c&255;++A<g&&(v*=256);)c<0&&ne===0&&this[u+A-1]!==0&&(ne=1),this[u+A]=(c/v>>0)-ne&255;return u+g},a.prototype.writeIntBE=function(c,u,g,y){if(c=+c,u=u>>>0,!y){const Ce=Math.pow(2,8*g-1);$(this,c,u,g,Ce-1,-Ce)}let A=g-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+g},a.prototype.writeInt8=function(c,u,g){return c=+c,u=u>>>0,g||$(this,c,u,1,127,-128),c<0&&(c=255+c+1),this[u]=c&255,u+1},a.prototype.writeInt16LE=function(c,u,g){return c=+c,u=u>>>0,g||$(this,c,u,2,32767,-32768),this[u]=c&255,this[u+1]=c>>>8,u+2},a.prototype.writeInt16BE=function(c,u,g){return c=+c,u=u>>>0,g||$(this,c,u,2,32767,-32768),this[u]=c>>>8,this[u+1]=c&255,u+2},a.prototype.writeInt32LE=function(c,u,g){return c=+c,u=u>>>0,g||$(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,g){return c=+c,u=u>>>0,g||$(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(p,c,u,g,y,A){if(u+g>p.length)throw new RangeError("Index out of range");if(u<0)throw new RangeError("Index out of range")}function te(p,c,u,g,y){return c=+c,u=u>>>0,y||ue(p,c,u,4),n.write(p,c,u,g,23,4),u+4}a.prototype.writeFloatLE=function(c,u,g){return te(this,c,u,!0,g)},a.prototype.writeFloatBE=function(c,u,g){return te(this,c,u,!1,g)};function ae(p,c,u,g,y){return c=+c,u=u>>>0,y||ue(p,c,u,8),n.write(p,c,u,g,52,8),u+8}a.prototype.writeDoubleLE=function(c,u,g){return ae(this,c,u,!0,g)},a.prototype.writeDoubleBE=function(c,u,g){return ae(this,c,u,!1,g)},a.prototype.copy=function(c,u,g,y){if(!a.isBuffer(c))throw new TypeError("argument should be a Buffer");if(g||(g=0),!y&&y!==0&&(y=this.length),u>=c.length&&(u=c.length),u||(u=0),y>0&&y<g&&(y=g),y===g||c.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(g<0||g>=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-g&&(y=c.length-u+g);const A=y-g;return this===c&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(u,g,y):Uint8Array.prototype.set.call(c,this.subarray(g,y),u),A},a.prototype.fill=function(c,u,g,y){if(typeof c=="string"){if(typeof u=="string"?(y=u,u=0,g=this.length):typeof g=="string"&&(y=g,g=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<g)throw new RangeError("Out of range index");if(g<=u)return this;u=u>>>0,g=g===void 0?this.length:g>>>0,c||(c=0);let A;if(typeof c=="number")for(A=u;A<g;++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<g-u;++A)this[A+u]=v[A%ne]}return this};const he={};function E(p,c,u){he[p]=class extends u{constructor(){super(),Object.defineProperty(this,"message",{value:c.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${p}]`,this.stack,delete this.name}get code(){return p}set code(y){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:y,writable:!0})}toString(){return`${this.name} [${p}]: ${this.message}`}}}E("ERR_BUFFER_OUT_OF_BOUNDS",function(p){return p?`${p} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),E("ERR_INVALID_ARG_TYPE",function(p,c){return`The "${p}" argument must be of type number. Received type ${typeof c}`},TypeError),E("ERR_OUT_OF_RANGE",function(p,c,u){let g=`The value of "${p}" is out of range.`,y=u;return Number.isInteger(u)&&Math.abs(u)>2**32?y=T(String(u)):typeof u=="bigint"&&(y=String(u),(u>BigInt(2)**BigInt(32)||u<-(BigInt(2)**BigInt(32)))&&(y=T(y)),y+="n"),g+=` It must be ${c}. Received ${y}`,g},RangeError);function T(p){let c="",u=p.length;const g=p[0]==="-"?1:0;for(;u>=g+4;u-=3)c=`_${p.slice(u-3,u)}${c}`;return`${p.slice(0,u)}${c}`}function Y(p,c,u){oe(c,"offset"),(p[c]===void 0||p[c+u]===void 0)&&Oe(c,p.length-(u+1))}function ve(p,c,u,g,y,A){if(p>u||p<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 he.ERR_OUT_OF_RANGE("value",ne,p)}Y(g,y,A)}function oe(p,c){if(typeof p!="number")throw new he.ERR_INVALID_ARG_TYPE(c,"number",p)}function Oe(p,c,u){throw Math.floor(p)!==p?(oe(p,u),new he.ERR_OUT_OF_RANGE("offset","an integer",p)):c<0?new he.ERR_BUFFER_OUT_OF_BOUNDS:new he.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${c}`,p)}const lt=/[^+/0-9A-Za-z-_]/g;function Hn(p){if(p=p.split("=")[0],p=p.trim().replace(lt,""),p.length<2)return"";for(;p.length%4!==0;)p=p+"=";return p}function en(p,c){c=c||1/0;let u;const g=p.length;let y=null;const A=[];for(let v=0;v<g;++v){if(u=p.charCodeAt(v),u>55295&&u<57344){if(!y){if(u>56319){(c-=3)>-1&&A.push(239,191,189);continue}else if(v+1===g){(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(p){const c=[];for(let u=0;u<p.length;++u)c.push(p.charCodeAt(u)&255);return c}function qi(p,c){let u,g,y;const A=[];for(let v=0;v<p.length&&!((c-=2)<0);++v)u=p.charCodeAt(v),g=u>>8,y=u%256,A.push(y),A.push(g);return A}function mo(p){return e.toByteArray(Hn(p))}function $n(p,c,u,g){let y;for(y=0;y<g&&!(y+u>=c.length||y>=p.length);++y)c[y+u]=p[y];return y}function rt(p,c){return p instanceof c||p!=null&&p.constructor!=null&&p.constructor.name!=null&&p.constructor.name===c.name}function Fn(p){return p!==p}const Ir=function(){const p="0123456789abcdef",c=new Array(256);for(let u=0;u<16;++u){const g=u*16;for(let y=0;y<16;++y)c[g+y]=p[u]+p[y]}return c}();function It(p){return typeof BigInt>"u"?yo:p}function yo(){throw new Error("BigInt not supported")}})(ie);const El=()=>{globalThis.Buffer||(globalThis.Buffer=ie.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 jl(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(h){try{d(r.next(h))}catch(f){s(f)}}function l(h){try{d(r.throw(h))}catch(f){s(f)}}function d(h){h.done?i(h.value):o(h.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(h){return l([d,h])}}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(h){d=[6,h],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 kl(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){f(i[0][3],x)}}function l(m){m.value instanceof vn?Promise.resolve(m.value.v).then(d,h):f(i[0][2],m)}function d(m){a("next",m)}function h(m){a("throw",m)}function f(m,b){m(b),i.shift(),i.length&&a(i[0][0],i[0][1])}}function zl(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 st=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 h=this.initialTeardown;if(de(h))try{h()}catch(w){i=w instanceof wo?w.errors:[w]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var m=wn(f),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=st.EMPTY;function Ji(t){return t instanceof st||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=Rl,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}(st),Ll=Function.prototype.bind;function vo(t,e){return Ll.call(t,e)}var Pl=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 Pl(s),i}return e}(Mo);function wr(t){ns(t)}function Bl(t){throw t}var Rl={closed:!0,next:xr,error:Bl,complete:xr},Co=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Mr(t){return t}function Ol(t){return t.length===0?Mr:t.length===1?t[0]:function(n){return t.reduce(function(r,o){return o(r)},n)}}var _e=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=Wl(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 Ol(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 Ul(t){return t&&de(t.next)&&de(t.error)&&de(t.complete)}function Wl(t){return t&&t instanceof Mo||Ul(t)&&Ji(t)}function Zl(t){return de(t==null?void 0:t.lift)}function Ve(t){return function(e){if(Zl(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 Qe(t,e,n,r,o){return new Gl(t,e,n,r,o)}var Gl=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(h){n.error(h)}}:t.prototype._next,l._error=i?function(d){try{i(d)}catch(h){n.error(h)}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),_l=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 _l},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 st(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 _e;return n.source=this,n},e.create=function(n,r){return new os(n,r)},e}(_e),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,h=1;h<i.length&&i[h]<=l;h+=2)d=h;d&&i.splice(0,d+1)}},e}(Ae),Hl=function(t){xt(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(st),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}(Hl),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}(),Fl=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 Fl($l),Yl=as,cs=new _e(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 ql(t,e){return typeof ls(t)=="number"?t.pop():e}var To=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function hs(t){return de(t==null?void 0:t.then)}function ps(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 Vl(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var ms=Vl();function ys(t){return de(t==null?void 0:t[ms])}function Is(t){return kl(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 qe(t){if(t instanceof _e)return t;if(t!=null){if(ps(t))return Ql(t);if(To(t))return Xl(t);if(hs(t))return Jl(t);if(fs(t))return xs(t);if(ys(t))return Kl(t);if(bs(t))return ed(t)}throw gs(t)}function Ql(t){return new _e(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 Xl(t){return new _e(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function Jl(t){return new _e(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,ns)})}function Kl(t){return new _e(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 _e(function(e){td(t,e).catch(function(n){return e.error(n)})})}function ed(t){return xs(Is(t))}function td(t,e){var n,r,o,i;return jl(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=zl(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),Ve(function(n,r){n.subscribe(Qe(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),Ve(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function nd(t,e){return qe(t).pipe(ws(e),As(e))}function rd(t,e){return qe(t).pipe(ws(e),As(e))}function od(t,e){return new _e(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function id(t,e){return new _e(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 _e(function(n){nn