UNPKG

@liascript/exporter

Version:
1 lines โ€ข 954 kB
!function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function t(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var n=e.parcelRequire55a5;n.register("eB8Zt",(function(r,i){t(r.exports,"selfId",(function(){return xx}),(function(e){return xx=e})),t(r.exports,"joinRoom",(function(){return sC}),(function(e){return sC=e}));var a,o,u,s,l,c,f,d,h,v,p,g,y,m,b,w,k,_,E,S,A,I,x,C,T,P,R,L,D,M,N,O,U,F,B,q=n("f1evb"),z=n("1PH9R"),j=n("3u2tY"),K=n("hnmIs"),V=n("9yQwa"),H=n("9Klpk"),W=n("8qpTe"),G=n("gwSkA"),X=n("7ukXT"),Y=n("8TzS1"),Z=n("aFAb1"),Q=n("kw2NY"),J=n("fWXUu"),$=n("3bWnf"),ee=n("W5eu1"),te=n("eT7f3"),ne=n("9WzNc"),re=n("div3d"),ie=n("kb0qF"),ae=n("bgoEC"),oe=n("7j4mF"),ue=n("1Qswt"),se=n("5ENmm"),le=n("iPOEm"),ce=n("6Wo7Q"),fe=n("rJmE6"),de=n("hXL9f"),he=n("fSF4h"),ve=n("bWNdT"),pe=n("32Euv"),ge=(pe=n("32Euv"),n("84cK9"));function ye(){return new Uint8Array(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)}function me(){return new Uint8Array(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)}var be=268435456,we=34359738368,ke=4398046511104,_e=Math.pow(2,49),Ee=128,Se=127;function Ae(e){if(e<128)return 1;if(e<16384)return 2;if(e<2097152)return 3;if(e<be)return 4;if(e<we)return 5;if(e<ke)return 6;if(e<_e)return 7;if(null!=Number.MAX_SAFE_INTEGER&&e>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Ie(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;switch(Ae(e)){case 8:t[n++]=255&e|Ee,e/=128;case 7:t[n++]=255&e|Ee,e/=128;case 6:t[n++]=255&e|Ee,e/=128;case 5:t[n++]=255&e|Ee,e/=128;case 4:t[n++]=255&e|Ee,e>>>=7;case 3:t[n++]=255&e|Ee,e>>>=7;case 2:t[n++]=255&e|Ee,e>>>=7;case 1:t[n++]=255&e,e>>>=7;break;default:throw Error("unreachable")}return t}function xe(e,t){var n=e[t],r=0;if(r+=n&Se,n<Ee)return r;if(r+=((n=e[t+1])&Se)<<7,n<Ee)return r;if(r+=((n=e[t+2])&Se)<<14,n<Ee)return r;if(r+=((n=e[t+3])&Se)<<21,n<Ee)return r;if(r+=((n=e[t+4])&Se)*be,n<Ee)return r;if(r+=((n=e[t+5])&Se)*we,n<Ee)return r;if(r+=((n=e[t+6])&Se)*ke,n<Ee)return r;if(r+=((n=e[t+7])&Se)*_e,n<Ee)return r;throw new RangeError("Could not decode varint")}function Ce(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return null==t&&(t=me(Ae(e))),t instanceof Uint8Array?Ie(e,t,n):function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;switch(Ae(e)){case 8:t.set(n++,255&e|Ee),e/=128;case 7:t.set(n++,255&e|Ee),e/=128;case 6:t.set(n++,255&e|Ee),e/=128;case 5:t.set(n++,255&e|Ee),e/=128;case 4:t.set(n++,255&e|Ee),e>>>=7;case 3:t.set(n++,255&e|Ee),e>>>=7;case 2:t.set(n++,255&e|Ee),e>>>=7;case 1:t.set(n++,255&e),e>>>=7;break;default:throw Error("unreachable")}return t}(e,t,n)}function Te(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e instanceof Uint8Array?xe(e,t):function(e,t){var n=e.get(t),r=0;if(r+=n&Se,n<Ee)return r;if(r+=((n=e.get(t+1))&Se)<<7,n<Ee)return r;if(r+=((n=e.get(t+2))&Se)<<14,n<Ee)return r;if(r+=((n=e.get(t+3))&Se)<<21,n<Ee)return r;if(r+=((n=e.get(t+4))&Se)*be,n<Ee)return r;if(r+=((n=e.get(t+5))&Se)*we,n<Ee)return r;if(r+=((n=e.get(t+6))&Se)*ke,n<Ee)return r;if(r+=((n=e.get(t+7))&Se)*_e,n<Ee)return r;throw new RangeError("Could not decode varint")}(e,t)}var Pe=new Float32Array([-0]),Re=new Uint8Array(Pe.buffer);function Le(e,t,n){Pe[0]=e,t[n]=Re[0],t[n+1]=Re[1],t[n+2]=Re[2],t[n+3]=Re[3]}var De=new Float64Array([-0]),Me=new Uint8Array(De.buffer);function Ne(e,t,n){De[0]=e,t[n]=Me[0],t[n+1]=Me[1],t[n+2]=Me[2],t[n+3]=Me[3],t[n+4]=Me[4],t[n+5]=Me[5],t[n+6]=Me[6],t[n+7]=Me[7]}var Oe=BigInt(Number.MAX_SAFE_INTEGER),Ue=BigInt(Number.MIN_SAFE_INTEGER),Fe=function(){"use strict";function e(t,n){(0,H.default)(this,e),(0,te.default)(this,"lo",void 0),(0,te.default)(this,"hi",void 0),this.lo=0|t,this.hi=0|n}return(0,$.default)(e,[{key:"toNumber",value:function(){if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.hi>>>31>0){var e=1+~this.lo>>>0,t=~this.hi>>>0;return 0===e&&(t=t+1>>>0),-(e+4294967296*t)}return this.lo+4294967296*this.hi}},{key:"toBigInt",value:function(){if(arguments.length>0&&void 0!==arguments[0]&&arguments[0])return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31!=0){var e=1+~this.lo>>>0,t=~this.hi>>>0;return 0===e&&(t=t+1>>>0),-(BigInt(e)+(BigInt(t)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.toBigInt(e).toString()}},{key:"zzEncode",value:function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}},{key:"zzDecode",value:function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}},{key:"length",value:function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}}],[{key:"fromBigInt",value:function(t){if(0n===t)return Be;if(t<Oe&&t>Ue)return this.fromNumber(Number(t));var n=t<0n;n&&(t=-t);var r=t>>32n,i=t-(r<<32n);return n&&(r=0n|~r,i=0n|~i,++i>qe&&(i=0n,++r>qe&&(r=0n))),new e(Number(i),Number(r))}},{key:"fromNumber",value:function(t){if(0===t)return Be;var n=t<0;n&&(t=-t);var r=t>>>0,i=(t-r)/4294967296>>>0;return n&&(i=~i>>>0,r=~r>>>0,++r>4294967295&&(r=0,++i>4294967295&&(i=0))),new e(r,i)}},{key:"from",value:function(t){return"number"==typeof t?e.fromNumber(t):"bigint"==(void 0===t?"undefined":(0,fe.default)(t))?e.fromBigInt(t):"string"==typeof t?e.fromBigInt(BigInt(t)):null!=t.low||null!=t.high?new e(t.low>>>0,t.high>>>0):Be}}]),e}(),Be=new Fe(0,0);Be.toBigInt=function(){return 0n},Be.zzEncode=Be.zzDecode=function(){return this},Be.length=function(){return 1};var qe=4294967296n;function ze(e,t,n){for(var r,i,a=n,o=0;o<e.length;++o)(r=e.charCodeAt(o))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(i=e.charCodeAt(o+1)))?(r=65536+((1023&r)<<10)+(1023&i),++o,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-a}function je(e,t){return RangeError("index out of range: ".concat(e.pos," + ").concat(null!=t?t:1," > ").concat(e.len))}function Ke(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}var Ve=function(){"use strict";function e(t){(0,H.default)(this,e),(0,te.default)(this,"buf",void 0),(0,te.default)(this,"pos",void 0),(0,te.default)(this,"len",void 0),(0,te.default)(this,"_slice",Uint8Array.prototype.subarray),this.buf=t,this.pos=0,this.len=t.length}return(0,$.default)(e,[{key:"uint32",value:function(){var e=4294967295;if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,je(this,10);return e}},{key:"int32",value:function(){return 0|this.uint32()}},{key:"sint32",value:function(){var e=this.uint32();return e>>>1^-(1&e)}},{key:"bool",value:function(){return 0!==this.uint32()}},{key:"fixed32",value:function(){if(this.pos+4>this.len)throw je(this,4);return Ke(this.buf,this.pos+=4)}},{key:"sfixed32",value:function(){if(this.pos+4>this.len)throw je(this,4);return 0|Ke(this.buf,this.pos+=4)}},{key:"float",value:function(){if(this.pos+4>this.len)throw je(this,4);var e,t,n=(e=this.buf,t=this.pos,Re[0]=e[t],Re[1]=e[t+1],Re[2]=e[t+2],Re[3]=e[t+3],Pe[0]);return this.pos+=4,n}},{key:"double",value:function(){if(this.pos+8>this.len)throw je(this,4);var e,t,n=(e=this.buf,t=this.pos,Me[0]=e[t],Me[1]=e[t+1],Me[2]=e[t+2],Me[3]=e[t+3],Me[4]=e[t+4],Me[5]=e[t+5],Me[6]=e[t+6],Me[7]=e[t+7],De[0]);return this.pos+=8,n}},{key:"bytes",value:function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw je(this,e);return this.pos+=e,t===n?new Uint8Array(0):this.buf.subarray(t,n)}},{key:"string",value:function(){var e=this.bytes();return function(e,t,n){if(n-t<1)return"";for(var r,i,a=[],o=0;t<n;)(i=e[t++])<128?a[o++]=i:i>191&&i<224?a[o++]=(31&i)<<6|63&e[t++]:i>239&&i<365?(i=((7&i)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,a[o++]=55296+(i>>10),a[o++]=56320+(1023&i)):a[o++]=(15&i)<<12|(63&e[t++])<<6|63&e[t++],o>8191&&((null!=r?r:r=[]).push(String.fromCharCode.apply(String,a)),o=0);return null!=r?(o>0&&r.push(String.fromCharCode.apply(String,a.slice(0,o))),r.join("")):String.fromCharCode.apply(String,a.slice(0,o))}(e,0,e.length)}},{key:"skip",value:function(e){if("number"==typeof e){if(this.pos+e>this.len)throw je(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw je(this)}while(128&this.buf[this.pos++]);return this}},{key:"skipType",value:function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type ".concat(e," at offset ").concat(this.pos))}return this}},{key:"readLongVarint",value:function(){var e=new Fe(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw je(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw je(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}},{key:"readFixed64",value:function(){if(this.pos+8>this.len)throw je(this,8);var e=Ke(this.buf,this.pos+=4),t=Ke(this.buf,this.pos+=4);return new Fe(e,t)}},{key:"int64",value:function(){return this.readLongVarint().toBigInt()}},{key:"int64Number",value:function(){return this.readLongVarint().toNumber()}},{key:"int64String",value:function(){return this.readLongVarint().toString()}},{key:"uint64",value:function(){return this.readLongVarint().toBigInt(!0)}},{key:"uint64Number",value:function(){var e=xe(this.buf,this.pos);return this.pos+=Ae(e),e}},{key:"uint64String",value:function(){return this.readLongVarint().toString(!0)}},{key:"sint64",value:function(){return this.readLongVarint().zzDecode().toBigInt()}},{key:"sint64Number",value:function(){return this.readLongVarint().zzDecode().toNumber()}},{key:"sint64String",value:function(){return this.readLongVarint().zzDecode().toString()}},{key:"fixed64",value:function(){return this.readFixed64().toBigInt()}},{key:"fixed64Number",value:function(){return this.readFixed64().toNumber()}},{key:"fixed64String",value:function(){return this.readFixed64().toString()}},{key:"sfixed64",value:function(){return this.readFixed64().toBigInt()}},{key:"sfixed64Number",value:function(){return this.readFixed64().toNumber()}},{key:"sfixed64String",value:function(){return this.readFixed64().toString()}}]),e}();function He(e,t,n){var r=function(e){return new Ve(e instanceof Uint8Array?e:e.subarray())}(e);return t.decode(r,void 0,n)}function We(e){if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")}var Ge=function(e,t){var n=function(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var n=0,i=0;e[t]===l;)n++,t++;for(var a=(e.length-t)*c+1>>>0,o=new Uint8Array(a);e[t];){var u=r[e.charCodeAt(t)];if(255===u)return;for(var f=0,d=a-1;(0!==u||f<i)&&-1!==d;d--,f++)u+=s*o[d]>>>0,o[d]=u%256>>>0,u=u/256>>>0;if(0!==u)throw Error("Non-zero carry");i=f,t++}if(" "!==e[t]){for(var h=a-i;h!==a&&0===o[h];)h++;for(var v=new Uint8Array(n+(a-h)),p=n;h!==a;)v[p++]=o[h++];return v}}};if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var a=0;a<e.length;a++){var o=e.charAt(a),u=o.charCodeAt(0);if(255!==r[u])throw new TypeError(o+" is ambiguous");r[u]=a}var s=e.length,l=e.charAt(0),c=Math.log(s)/Math.log(256),f=Math.log(256)/Math.log(s);return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,a=t.length;i!==a&&0===t[i];)i++,n++;for(var o=(a-i)*f+1>>>0,u=new Uint8Array(o);i!==a;){for(var c=t[i],d=0,h=o-1;(0!==c||d<r)&&-1!==h;h--,d++)c+=256*u[h]>>>0,u[h]=c%s>>>0,c=c/s>>>0;if(0!==c)throw Error("Non-zero carry");r=d,i++}for(var v=o-r;v!==o&&0===u[v];)v++;for(var p=l.repeat(n);v<o;++v)p+=e.charAt(u[v]);return p},decodeUnsafe:n,decode:function(e){var r=n(e);if(r)return r;throw Error("Non-".concat(t," character"))}}},Xe=function(){"use strict";function e(t,n,r){(0,H.default)(this,e),(0,te.default)(this,"name",void 0),(0,te.default)(this,"prefix",void 0),(0,te.default)(this,"baseEncode",void 0),this.name=t,this.prefix=n,this.baseEncode=r}return(0,$.default)(e,[{key:"encode",value:function(e){if(e instanceof Uint8Array)return"".concat(this.prefix).concat(this.baseEncode(e));throw Error("Unknown type, must be binary type")}}]),e}(),Ye=function(){"use strict";function e(t,n,r){(0,H.default)(this,e),(0,te.default)(this,"name",void 0),(0,te.default)(this,"prefix",void 0),(0,te.default)(this,"baseDecode",void 0),(0,te.default)(this,"prefixCodePoint",void 0),this.name=t,this.prefix=n;var i=n.codePointAt(0);if(void 0===i)throw Error("Invalid prefix character");this.prefixCodePoint=i,this.baseDecode=r}return(0,$.default)(e,[{key:"decode",value:function(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error("Unable to decode multibase string ".concat(JSON.stringify(e),", ").concat(this.name," decoder only supports inputs prefixed with ").concat(this.prefix));return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}},{key:"or",value:function(e){return Qe(this,e)}}]),e}(),Ze=function(){"use strict";function e(t){(0,H.default)(this,e),(0,te.default)(this,"decoders",void 0),this.decoders=t}return(0,$.default)(e,[{key:"or",value:function(e){return Qe(this,e)}},{key:"decode",value:function(e){var t=e[0],n=this.decoders[t];if(null!=n)return n.decode(e);throw RangeError("Unable to decode multibase string ".concat(JSON.stringify(e),", only inputs prefixed with ").concat(Object.keys(this.decoders)," are supported"))}}]),e}();function Qe(e,t){var n,r;return new Ze((0,ae.default)({},null!==(n=e.decoders)&&void 0!==n?n:(0,te.default)({},e.prefix,e),null!==(r=t.decoders)&&void 0!==r?r:(0,te.default)({},t.prefix,t)))}var Je=function(){"use strict";function e(t,n,r,i){(0,H.default)(this,e),(0,te.default)(this,"name",void 0),(0,te.default)(this,"prefix",void 0),(0,te.default)(this,"baseEncode",void 0),(0,te.default)(this,"baseDecode",void 0),(0,te.default)(this,"encoder",void 0),(0,te.default)(this,"decoder",void 0),this.name=t,this.prefix=n,this.baseEncode=r,this.baseDecode=i,this.encoder=new Xe(t,n,r),this.decoder=new Ye(t,n,i)}return(0,$.default)(e,[{key:"encode",value:function(e){return this.encoder.encode(e)}},{key:"decode",value:function(e){return this.decoder.decode(e)}}]),e}();function $e(e){var t=e.name,n=e.prefix,r=e.encode,i=e.decode;return new Je(t,n,r,i)}function et(e){var t=e.name,n=e.prefix,r=e.alphabet,i=Ge(r,t),a=i.encode,o=i.decode;return $e({prefix:n,name:t,encode:a,decode:function(e){return We(o(e))}})}function tt(e){var t=e.name,n=e.prefix,r=e.bitsPerChar,i=e.alphabet,a=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=n;return t}(i);return $e({prefix:n,name:t,encode:function(e){return function(e,t,n){for(var r="="===t[t.length-1],i=(1<<n)-1,a="",o=0,u=0,s=0;s<e.length;++s)for(u=u<<8|e[s],o+=8;o>n;)a+=t[i&u>>(o-=n)];if(0!==o&&(a+=t[i&u<<n-o]),r)for(;a.length*n&7;)a+="=";return a}(e,i,r)},decode:function(e){return function(e,t,n,r){for(var i=e.length;"="===e[i-1];)--i;for(var a=new Uint8Array(i*n/8|0),o=0,u=0,s=0,l=0;l<i;++l){var c=t[e[l]];if(void 0===c)throw new SyntaxError("Non-".concat(r," character"));u=u<<n|c,(o+=n)>=8&&(o-=8,a[s++]=255&u>>o)}if(o>=n||255&u<<8-o)throw new SyntaxError("Unexpected end of data");return a}(e,a,r,t)}})}var nt=et({prefix:"9",name:"base10",alphabet:"0123456789"}),rt=Object.freeze({__proto__:null,base10:nt}),it=tt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),at=tt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),ot=Object.freeze({__proto__:null,base16:it,base16upper:at}),ut=tt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),st=Object.freeze({__proto__:null,base2:ut}),lt=Array.from("๐Ÿš€๐Ÿชโ˜„๐Ÿ›ฐ๐ŸŒŒ๐ŸŒ‘๐ŸŒ’๐ŸŒ“๐ŸŒ”๐ŸŒ•๐ŸŒ–๐ŸŒ—๐ŸŒ˜๐ŸŒ๐ŸŒ๐ŸŒŽ๐Ÿ‰โ˜€๐Ÿ’ป๐Ÿ–ฅ๐Ÿ’พ๐Ÿ’ฟ๐Ÿ˜‚โค๐Ÿ˜๐Ÿคฃ๐Ÿ˜Š๐Ÿ™๐Ÿ’•๐Ÿ˜ญ๐Ÿ˜˜๐Ÿ‘๐Ÿ˜…๐Ÿ‘๐Ÿ˜๐Ÿ”ฅ๐Ÿฅฐ๐Ÿ’”๐Ÿ’–๐Ÿ’™๐Ÿ˜ข๐Ÿค”๐Ÿ˜†๐Ÿ™„๐Ÿ’ช๐Ÿ˜‰โ˜บ๐Ÿ‘Œ๐Ÿค—๐Ÿ’œ๐Ÿ˜”๐Ÿ˜Ž๐Ÿ˜‡๐ŸŒน๐Ÿคฆ๐ŸŽ‰๐Ÿ’žโœŒโœจ๐Ÿคท๐Ÿ˜ฑ๐Ÿ˜Œ๐ŸŒธ๐Ÿ™Œ๐Ÿ˜‹๐Ÿ’—๐Ÿ’š๐Ÿ˜๐Ÿ’›๐Ÿ™‚๐Ÿ’“๐Ÿคฉ๐Ÿ˜„๐Ÿ˜€๐Ÿ–ค๐Ÿ˜ƒ๐Ÿ’ฏ๐Ÿ™ˆ๐Ÿ‘‡๐ŸŽถ๐Ÿ˜’๐Ÿคญโฃ๐Ÿ˜œ๐Ÿ’‹๐Ÿ‘€๐Ÿ˜ช๐Ÿ˜‘๐Ÿ’ฅ๐Ÿ™‹๐Ÿ˜ž๐Ÿ˜ฉ๐Ÿ˜ก๐Ÿคช๐Ÿ‘Š๐Ÿฅณ๐Ÿ˜ฅ๐Ÿคค๐Ÿ‘‰๐Ÿ’ƒ๐Ÿ˜ณโœ‹๐Ÿ˜š๐Ÿ˜๐Ÿ˜ด๐ŸŒŸ๐Ÿ˜ฌ๐Ÿ™ƒ๐Ÿ€๐ŸŒท๐Ÿ˜ป๐Ÿ˜“โญโœ…๐Ÿฅบ๐ŸŒˆ๐Ÿ˜ˆ๐Ÿค˜๐Ÿ’ฆโœ”๐Ÿ˜ฃ๐Ÿƒ๐Ÿ’โ˜น๐ŸŽŠ๐Ÿ’˜๐Ÿ˜ โ˜๐Ÿ˜•๐ŸŒบ๐ŸŽ‚๐ŸŒป๐Ÿ˜๐Ÿ–•๐Ÿ’๐Ÿ™Š๐Ÿ˜น๐Ÿ—ฃ๐Ÿ’ซ๐Ÿ’€๐Ÿ‘‘๐ŸŽต๐Ÿคž๐Ÿ˜›๐Ÿ”ด๐Ÿ˜ค๐ŸŒผ๐Ÿ˜ซโšฝ๐Ÿค™โ˜•๐Ÿ†๐Ÿคซ๐Ÿ‘ˆ๐Ÿ˜ฎ๐Ÿ™†๐Ÿป๐Ÿƒ๐Ÿถ๐Ÿ’๐Ÿ˜ฒ๐ŸŒฟ๐Ÿงก๐ŸŽโšก๐ŸŒž๐ŸŽˆโŒโœŠ๐Ÿ‘‹๐Ÿ˜ฐ๐Ÿคจ๐Ÿ˜ถ๐Ÿค๐Ÿšถ๐Ÿ’ฐ๐Ÿ“๐Ÿ’ข๐ŸคŸ๐Ÿ™๐Ÿšจ๐Ÿ’จ๐Ÿคฌโœˆ๐ŸŽ€๐Ÿบ๐Ÿค“๐Ÿ˜™๐Ÿ’Ÿ๐ŸŒฑ๐Ÿ˜–๐Ÿ‘ถ๐Ÿฅดโ–ถโžกโ“๐Ÿ’Ž๐Ÿ’ธโฌ‡๐Ÿ˜จ๐ŸŒš๐Ÿฆ‹๐Ÿ˜ท๐Ÿ•บโš ๐Ÿ™…๐Ÿ˜Ÿ๐Ÿ˜ต๐Ÿ‘Ž๐Ÿคฒ๐Ÿค ๐Ÿคง๐Ÿ“Œ๐Ÿ”ต๐Ÿ’…๐Ÿง๐Ÿพ๐Ÿ’๐Ÿ˜—๐Ÿค‘๐ŸŒŠ๐Ÿคฏ๐Ÿทโ˜Ž๐Ÿ’ง๐Ÿ˜ฏ๐Ÿ’†๐Ÿ‘†๐ŸŽค๐Ÿ™‡๐Ÿ‘โ„๐ŸŒด๐Ÿ’ฃ๐Ÿธ๐Ÿ’Œ๐Ÿ“๐Ÿฅ€๐Ÿคข๐Ÿ‘…๐Ÿ’ก๐Ÿ’ฉ๐Ÿ‘๐Ÿ“ธ๐Ÿ‘ป๐Ÿค๐Ÿคฎ๐ŸŽผ๐Ÿฅต๐Ÿšฉ๐ŸŽ๐ŸŠ๐Ÿ‘ผ๐Ÿ’๐Ÿ“ฃ๐Ÿฅ‚"),ct=lt.reduce((function(e,t,n){return e[n]=t,e}),[]),ft=lt.reduce((function(e,t,n){var r=t.codePointAt(0);if(null==r)throw Error("Invalid character: "+t);return e[r]=n,e}),[]),dt=$e({prefix:"๐Ÿš€",name:"base256emoji",encode:function(e){return e.reduce((function(e,t){return e+ct[t]}),"")},decode:function(e){var t=[],n=!0,r=!1,i=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=a.value,s=u.codePointAt(0);if(null==s)throw Error("Invalid character: "+u);var l=ft[s];if(null==l)throw Error("Non-base256emoji character: "+u);t.push(l)}}catch(e){r=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(r)throw i}}return new Uint8Array(t)}}),ht=Object.freeze({__proto__:null,base256emoji:dt}),vt=tt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),pt=tt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),gt=tt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),yt=tt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),mt=tt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),bt=tt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),wt=tt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),kt=tt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),_t=tt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Et=Object.freeze({__proto__:null,base32:vt,base32hex:mt,base32hexpad:wt,base32hexpadupper:kt,base32hexupper:bt,base32pad:gt,base32padupper:yt,base32upper:pt,base32z:_t}),St=et({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),At=et({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),It=Object.freeze({__proto__:null,base36:St,base36upper:At}),xt=et({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Ct=et({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Tt=Object.freeze({__proto__:null,base58btc:xt,base58flickr:Ct}),Pt=tt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Rt=tt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Lt=tt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Dt=tt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Mt=Object.freeze({__proto__:null,base64:Pt,base64pad:Rt,base64url:Lt,base64urlpad:Dt}),Nt=tt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Ot=Object.freeze({__proto__:null,base8:Nt}),Ut=$e({prefix:"\0",name:"identity",encode:function(e){var t;return t=e,(new TextDecoder).decode(t)},decode:function(e){return function(e){return(new TextEncoder).encode(e)}(e)}}),Ft=Object.freeze({__proto__:null,identity:Ut});new TextEncoder,new TextDecoder;var Bt=128,qt=-128,zt=2147483648,jt=128,Kt=127,Vt=Math.pow(2,63),Ht={encode:function e(t,n,r){n=n||[];for(var i=r=r||0;t>=zt;)n[r++]=255&t|Bt,t/=128;for(;t&qt;)n[r++]=255&t|Bt,t>>>=7;return n[r]=0|t,e.bytes=r-i+1,n},decode:function e(t,n){var r,i=0,a=0,o=n=n||0,u=t.length;do{if(o>=u)throw e.bytes=0,new RangeError("Could not decode varint");r=t[o++],i+=a<28?(r&Kt)<<a:(r&Kt)*Math.pow(2,a),a+=7}while(r>=jt);return e.bytes=o-n,i},encodingLength:function(e){return e<128?1:e<16384?2:e<2097152?3:e<268435456?4:e<34359738368?5:e<4398046511104?6:e<562949953421312?7:e<72057594037927940?8:e<Vt?9:10}};function Wt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return[Ht.decode(e,t),Ht.decode.bytes]}function Gt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Ht.encode(e,t,n),t}function Xt(e){return Ht.encodingLength(e)}function Yt(e,t){var n=t.byteLength,r=Xt(e),i=r+Xt(n),a=new Uint8Array(i+n);return Gt(e,a,0),Gt(n,a,r),a.set(t,i),new $t(e,n,t,a)}function Zt(e){var t=We(e),n=(0,se.default)(Wt(t),2),r=n[0],i=n[1],a=(0,se.default)(Wt(t.subarray(i)),2),o=a[0],u=a[1],s=t.subarray(i+u);if(s.byteLength!==o)throw Error("Incorrect length");return new $t(r,o,s,t)}var Qt,Jt,$t=function e(t,n,r,i){"use strict";(0,H.default)(this,e),(0,te.default)(this,"code",void 0),(0,te.default)(this,"size",void 0),(0,te.default)(this,"digest",void 0),(0,te.default)(this,"bytes",void 0),this.code=t,this.size=n,this.digest=r,this.bytes=i},en=We,tn={code:0,name:"identity",encode:en,digest:function(e){return Yt(0,en(e))}},nn=function(){"use strict";function e(t,n,r){(0,H.default)(this,e),(0,te.default)(this,"name",void 0),(0,te.default)(this,"code",void 0),(0,te.default)(this,"encode",void 0),this.name=t,this.code=n,this.encode=r}return(0,$.default)(e,[{key:"digest",value:function(e){var t=this;if(e instanceof Uint8Array){var n=this.encode(e);return n instanceof Uint8Array?Yt(this.code,n):n.then((function(e){return Yt(t.code,e)}))}throw Error("Unknown type, must be binary type")}}]),e}(),rn=(Qt={name:"sha2-256",code:18,encode:(Jt=(0,K.default)((function(e){var t;return(0,pe.__generator)(this,(function(n){switch(n.label){case 0:return t=Uint8Array.bind,[4,crypto.subtle.digest("SHA-256",e)];case 1:return[2,new(t.apply(Uint8Array,[void 0,n.sent()]))]}}))})),function(e){return Jt.apply(this,arguments)})},new nn(Qt.name,Qt.code,Qt.encode));function an(e,t){var n=e.bytes;return 0===e.version?function(e,t,n){var r=n.prefix;if(r!==xt.prefix)throw Error("Cannot string encode V0 in ".concat(n.name," encoding"));var i=t.get(r);if(null==i){var a=n.encode(e).slice(1);return t.set(r,a),a}return i}(n,un(e),null!=t?t:xt.encoder):function(e,t,n){var r=n.prefix,i=t.get(r);if(null==i){var a=n.encode(e);return t.set(r,a),a}return i}(n,un(e),null!=t?t:vt.encoder)}var on=new WeakMap;function un(e){var t=on.get(e);if(null==t){var n=new Map;return on.set(e,n),n}return t}var sn=Symbol.toStringTag,ln=Symbol.for("nodejs.util.inspect.custom"),cn=function(){"use strict";function e(t,n,r,i){(0,H.default)(this,e),(0,te.default)(this,"code",void 0),(0,te.default)(this,"version",void 0),(0,te.default)(this,"multihash",void 0),(0,te.default)(this,"bytes",void 0),(0,te.default)(this,"/",void 0),(0,te.default)(this,sn,"CID"),this.code=n,this.version=t,this.multihash=r,this.bytes=i,this["/"]=i}return(0,$.default)(e,[{key:"asCID",get:function(){return this}},{key:"byteOffset",get:function(){return this.bytes.byteOffset}},{key:"byteLength",get:function(){return this.bytes.byteLength}},{key:"toV0",value:function(){switch(this.version){case 0:return this;case 1:var t=this.code,n=this.multihash;if(t!==fn)throw Error("Cannot convert a non dag-pb CID to CIDv0");if(n.code!==dn)throw Error("Cannot convert non sha2-256 multihash CID to CIDv0");return e.createV0(n);default:throw Error("Can not convert CID version ".concat(this.version," to version 0. This is a bug please report"))}}},{key:"toV1",value:function(){switch(this.version){case 0:var t=this.multihash,n=Yt(t.code,t.digest);return e.createV1(this.code,n);case 1:return this;default:throw Error("Can not convert CID version ".concat(this.version," to version 1. This is a bug please report"))}}},{key:"equals",value:function(t){return e.equals(this,t)}},{key:"toString",value:function(e){return an(this,e)}},{key:"toJSON",value:function(){return{"/":an(this)}}},{key:"link",value:function(){return this}},{key:ln,value:function(){return"CID(".concat(this.toString(),")")}}],[{key:"equals",value:function(e,t){var n=t;return null!=n&&e.code===n.code&&e.version===n.version&&function(e,t){if(e===t)return!0;var n=t;return e.code===n.code&&e.size===n.size&&n.bytes instanceof Uint8Array&&function(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(var n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}(e.bytes,n.bytes)}(e.multihash,n.multihash)}},{key:"asCID",value:function(t){if(null==t)return null;var n=t;if(n instanceof e)return n;if(null!=n["/"]&&n["/"]===n.bytes||n.asCID===n){var r=n.version,i=n.code,a=n.multihash,o=n.bytes;return new e(r,i,a,null!=o?o:hn(r,i,a.bytes))}if(!0===n[vn]){var u=n.version,s=n.multihash,l=n.code,c=Zt(s);return e.create(u,l,c)}return null}},{key:"create",value:function(t,n,r){if("number"!=typeof n)throw Error("String codecs are no longer supported");if(!(r.bytes instanceof Uint8Array))throw Error("Invalid digest");switch(t){case 0:if(n!==fn)throw Error("Version 0 CID must use dag-pb (code: ".concat(fn,") block encoding"));return new e(t,n,r,r.bytes);case 1:return new e(t,n,r,hn(t,n,r.bytes));default:throw Error("Invalid version")}}},{key:"createV0",value:function(t){return e.create(0,fn,t)}},{key:"createV1",value:function(t,n){return e.create(1,t,n)}},{key:"decode",value:function(t){var n=(0,se.default)(e.decodeFirst(t),2),r=n[0];if(0!==n[1].length)throw Error("Incorrect length");return r}},{key:"decodeFirst",value:function(t){var n=e.inspectBytes(t),r=n.size-n.multihashSize,i=We(t.subarray(r,r+n.multihashSize));if(i.byteLength!==n.multihashSize)throw Error("Incorrect length");var a=i.subarray(n.multihashSize-n.digestSize),o=new $t(n.multihashCode,n.digestSize,a,i);return[0===n.version?e.createV0(o):e.createV1(n.codec,o),t.subarray(n.size)]}},{key:"inspectBytes",value:function(e){var t=0,n=function(){var n=(0,se.default)(Wt(e.subarray(t)),2),r=n[0],i=n[1];return t+=i,r},r=n(),i=fn;if(18===r?(r=0,t=0):i=n(),0!==r&&1!==r)throw new RangeError("Invalid CID version "+r);var a=t,o=n(),u=n(),s=t+u;return{version:r,codec:i,multihashCode:o,digestSize:u,multihashSize:s-a,size:s}}},{key:"parse",value:function(t,n){var r=(0,se.default)(function(e,t){switch(e[0]){case"Q":var n=null!=t?t:xt;return[xt.prefix,n.decode("".concat(xt.prefix).concat(e))];case xt.prefix:var r=null!=t?t:xt;return[xt.prefix,r.decode(e)];case vt.prefix:var i=null!=t?t:vt;return[vt.prefix,i.decode(e)];case St.prefix:var a=null!=t?t:St;return[St.prefix,a.decode(e)];default:if(null==t)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}(t,n),2),i=r[0],a=r[1],o=e.decode(a);if(0===o.version&&"Q"!==t[0])throw Error("Version 0 CID string must not include multibase prefix");return un(o).set(i,t),o}}]),e}(),fn=112,dn=18;function hn(e,t,n){var r=Xt(e),i=r+Xt(t),a=new Uint8Array(i+n.byteLength);return Gt(e,a,0),Gt(t,a,r),a.set(n,i),a}var vn=Symbol.for("@ipld/js-cid/CID"),pn=(0,ae.default)({},Ft,st,Ot,rt,ot,Et,It,Tt,Mt,ht);function gn(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}var yn=gn("utf8","u",(function(e){return"u"+new TextDecoder("utf8").decode(e)}),(function(e){return(new TextEncoder).encode(e.substring(1))})),mn=gn("ascii","a",(function(e){for(var t="a",n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}),(function(e){for(var t=me((e=e.substring(1)).length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t})),bn=(0,ae.default)({utf8:yn,"utf-8":yn,hex:pn.base16,latin1:mn,ascii:mn,binary:mn},pn);function wn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8",n=bn[t];if(null==n)throw Error('Unsupported encoding "'.concat(t,'"'));return n.decoder.decode("".concat(n.prefix).concat(e))}var kn=function e(t,n,r){"use strict";(0,H.default)(this,e),(0,te.default)(this,"fn",void 0),(0,te.default)(this,"len",void 0),(0,te.default)(this,"next",void 0),(0,te.default)(this,"val",void 0),this.fn=t,this.len=n,this.next=void 0,this.val=r};function _n(){}var En,Sn,An,In=function e(t){"use strict";(0,H.default)(this,e),(0,te.default)(this,"head",void 0),(0,te.default)(this,"tail",void 0),(0,te.default)(this,"len",void 0),(0,te.default)(this,"next",void 0),this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states},xn=(An=Sn=8192,function(e){if(e<1||e>4096)return me(e);An+e>Sn&&(En=me(Sn),An=0);var t=En.subarray(An,An+=e);return 7&An&&(An=1+(7|An)),t}),Cn=function(){"use strict";function e(){(0,H.default)(this,e),(0,te.default)(this,"len",void 0),(0,te.default)(this,"head",void 0),(0,te.default)(this,"tail",void 0),(0,te.default)(this,"states",void 0),this.len=0,this.head=new kn(_n,0,0),this.tail=this.head,this.states=null}return(0,$.default)(e,[{key:"_push",value:function(e,t,n){return this.tail=this.tail.next=new kn(e,t,n),this.len+=t,this}},{key:"uint32",value:function(e){return this.len+=(this.tail=this.tail.next=new dr((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}},{key:"int32",value:function(e){return e<0?this._push(hr,10,Fe.fromNumber(e)):this.uint32(e)}},{key:"sint32",value:function(e){return this.uint32((e<<1^e>>31)>>>0)}},{key:"uint64",value:function(e){var t=Fe.fromBigInt(e);return this._push(hr,t.length(),t)}},{key:"uint64Number",value:function(e){return this._push(Ie,Ae(e),e)}},{key:"uint64String",value:function(e){return this.uint64(BigInt(e))}},{key:"int64",value:function(e){return this.uint64(e)}},{key:"int64Number",value:function(e){return this.uint64Number(e)}},{key:"int64String",value:function(e){return this.uint64String(e)}},{key:"sint64",value:function(e){var t=Fe.fromBigInt(e).zzEncode();return this._push(hr,t.length(),t)}},{key:"sint64Number",value:function(e){var t=Fe.fromNumber(e).zzEncode();return this._push(hr,t.length(),t)}},{key:"sint64String",value:function(e){return this.sint64(BigInt(e))}},{key:"bool",value:function(e){return this._push(Tn,1,e?1:0)}},{key:"fixed32",value:function(e){return this._push(vr,4,e>>>0)}},{key:"sfixed32",value:function(e){return this.fixed32(e)}},{key:"fixed64",value:function(e){var t=Fe.fromBigInt(e);return this._push(vr,4,t.lo)._push(vr,4,t.hi)}},{key:"fixed64Number",value:function(e){var t=Fe.fromNumber(e);return this._push(vr,4,t.lo)._push(vr,4,t.hi)}},{key:"fixed64String",value:function(e){return this.fixed64(BigInt(e))}},{key:"sfixed64",value:function(e){return this.fixed64(e)}},{key:"sfixed64Number",value:function(e){return this.fixed64Number(e)}},{key:"sfixed64String",value:function(e){return this.fixed64String(e)}},{key:"float",value:function(e){return this._push(Le,4,e)}},{key:"double",value:function(e){return this._push(Ne,8,e)}},{key:"bytes",value:function(e){var t=e.length>>>0;return 0===t?this._push(Tn,1,0):this.uint32(t)._push(pr,t,e)}},{key:"string",value:function(e){var t=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t}(e);return 0!==t?this.uint32(t)._push(ze,t,e):this._push(Tn,1,0)}},{key:"fork",value:function(){return this.states=new In(this),this.head=this.tail=new kn(_n,0,0),this.len=0,this}},{key:"reset",value:function(){return null!=this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new kn(_n,0,0),this.len=0),this}},{key:"ldelim",value:function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),0!==n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this}},{key:"finish",value:function(){for(var e,t=this.head.next,n=(e=this.len,null!=globalThis.Buffer?me(e):xn(e)),r=0;null!=t;)t.fn(t.val,n,r),r+=t.len,t=t.next;return n}}]),e}();function Tn(e,t,n){t[n]=255&e}function Pn(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e}var Rn,Ln,Dn,Mn,Nn,On,Un,Fn,Bn,qn,zn,jn,Kn,Vn,Hn,Wn,Gn,Xn,Yn,Zn,Qn,Jn,$n,er,tr,nr,rr,ir,ar,or,ur,sr,lr,cr,fr,dr=function(e){"use strict";(0,ie.default)(n,e);var t=(0,ve.default)(n);function n(e,r){var i;return(0,H.default)(this,n),i=t.call(this,Pn,e,r),(0,te.default)((0,q.default)(i),"next",void 0),i.next=void 0,(0,ue.default)(i)}return n}(kn);function hr(e,t,n){for(;0!==e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function vr(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function pr(e,t,n){t.set(e,n)}function gr(e,t,n){t.set(e,n)}function yr(e,t,n){e.length<40?ze(e,t,n):null!=t.utf8Write?t.utf8Write(e,n):t.set(wn(e),n)}function mr(e,t){var n=new Cn;return t.encode(e,n,{lengthDelimited:!1}),n.finish()}function br(e,t,n,r){return{name:e,type:t,encode:n,decode:r}}function wr(e){var t=function(t){if(null==e[t.toString()])throw Error("Invalid enum value");return e[t]};return br("enum",Rn.VARINT,(function(e,n){var r=t(e);n.int32(r)}),(function(e){return t(e.int32())}))}function kr(e,t){return br("message",Rn.LENGTH_DELIMITED,e,t)}null!=globalThis.Buffer&&(Cn.prototype.bytes=function(e){var t=e.length>>>0;return this.uint32(t),t>0&&this._push(gr,t,e),this},Cn.prototype.string=function(e){var t=globalThis.Buffer.byteLength(e);return this.uint32(t),t>0&&this._push(yr,t,e),this}),(fr=Rn||(Rn={}))[fr.VARINT=0]="VARINT",fr[fr.BIT64=1]="BIT64",fr[fr.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",fr[fr.START_GROUP=3]="START_GROUP",fr[fr.END_GROUP=4]="END_GROUP",fr[fr.BIT32=5]="BIT32";var _r=function(e){"use strict";(0,ie.default)(n,e);var t=(0,ve.default)(n);function n(){var e;return(0,H.default)(this,n),e=t.apply(this,arguments),(0,te.default)((0,q.default)(e),"code","ERR_MAX_LENGTH"),(0,te.default)((0,q.default)(e),"name","MaxLengthError"),e}return n}((0,he.default)(Error)),Er=function(e){"use strict";(0,ie.default)(n,e);var t=(0,ve.default)(n);function n(){var e;return(0,H.default)(this,n),e=t.apply(this,arguments),(0,te.default)((0,q.default)(e),"code","ERR_MAX_SIZE"),(0,te.default)((0,q.default)(e),"name","MaxSizeError"),e}return n}((0,he.default)(Error));function Sr(e){return!!e}(function(e){var t;e.codec=function(){return null==t&&(t=kr((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==n.lengthDelimited&&t.fork(),null!=e.proof&&e.proof.byteLength>0&&(t.uint32(10),t.bytes(e.proof)),null!=e.merkleRoot&&e.merkleRoot.byteLength>0&&(t.uint32(18),t.bytes(e.merkleRoot)),null!=e.epoch&&e.epoch.byteLength>0&&(t.uint32(26),t.bytes(e.epoch)),null!=e.shareX&&e.shareX.byteLength>0&&(t.uint32(34),t.bytes(e.shareX)),null!=e.shareY&&e.shareY.byteLength>0&&(t.uint32(42),t.bytes(e.shareY)),null!=e.nullifier&&e.nullifier.byteLength>0&&(t.uint32(50),t.bytes(e.nullifier)),null!=e.rlnIdentifier&&e.rlnIdentifier.byteLength>0&&(t.uint32(58),t.bytes(e.rlnIdentifier)),!1!==n.lengthDelimited&&t.ldelim()}),(function(e,t){for(var n={proof:ye(0),merkleRoot:ye(0),epoch:ye(0),shareX:ye(0),shareY:ye(0),nullifier:ye(0),rlnIdentifier:ye(0)},r=null==t?e.len:e.pos+t;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.proof=e.bytes();break;case 2:n.merkleRoot=e.bytes();break;case 3:n.epoch=e.bytes();break;case 4:n.shareX=e.bytes();break;case 5:n.shareY=e.bytes();break;case 6:n.nullifier=e.bytes();break;case 7:n.rlnIdentifier=e.bytes();break;default:e.skipType(7&i)}}return n}))),t},e.encode=function(t){return mr(t,e.codec())},e.decode=function(t,n){return He(t,e.codec(),n)}})(Ln||(Ln={})),function(e){var t;e.codec=function(){return null==t&&(t=kr((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==n.lengthDelimited&&t.fork(),null!=e.payload&&e.payload.byteLength>0&&(t.uint32(10),t.bytes(e.payload)),null!=e.contentTopic&&""!==e.contentTopic&&(t.uint32(18),t.string(e.contentTopic)),null!=e.version&&(t.uint32(24),t.uint32(e.version)),null!=e.timestamp&&(t.uint32(80),t.sint64(e.timestamp)),null!=e.meta&&(t.uint32(90),t.bytes(e.meta)),null!=e.rateLimitProof&&(t.uint32(170),Ln.codec().encode(e.rateLimitProof,t)),null!=e.ephemeral&&(t.uint32(248),t.bool(e.ephemeral)),!1!==n.lengthDelimited&&t.ldelim()}),(function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={payload:ye(0),contentTopic:""},i=null==t?e.len:e.pos+t;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:r.payload=e.bytes();break;case 2:r.contentTopic=e.string();break;case 3:r.version=e.uint32();break;case 10:r.timestamp=e.sint64();break;case 11:r.meta=e.bytes();break;case 21:var o;r.rateLimitProof=Ln.codec().decode(e,e.uint32(),{limits:null===(o=n.limits)||void 0===o?void 0:o.rateLimitProof});break;case 31:r.ephemeral=e.bool();break;default:e.skipType(7&a)}}return r}))),t},e.encode=function(t){return mr(t,e.codec())},e.decode=function(t,n){return He(t,e.codec(),n)}}(Dn||(Dn={})),function(e){var t;(function(e){var t;e.codec=function(){return null==t&&(t=kr((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==n.lengthDelimited&&t.fork(),null!=e.contentTopic&&""!==e.contentTopic&&(t.uint32(10),t.string(e.contentTopic)),!1!==n.lengthDelimited&&t.ldelim()}),(function(e,t){for(var n={contentTopic:""},r=null==t?e.len:e.pos+t;e.pos<r;){var i=e.uint32();i>>>3==1?n.contentTopic=e.string():e.skipType(7&i)}return n}))),t},e.encode=function(t){return mr(t,e.codec())},e.decode=function(t,n){return He(t,e.codec(),n)}})(e.ContentFilter||(e.ContentFilter={})),e.codec=function(){return null==t&&(t=kr((function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=!0,a=!1,o=void 0;if(!1!==r.lengthDelimited&&n.fork(),null!=t.subscribe&&!1!==t.subscribe&&(n.uint32(8),n.bool(t.subscribe)),null!=t.topic&&""!==t.topic&&(n.uint32(18),n.string(t.topic)),null!=t.contentFilters)try{for(var u,s=t.contentFilters[Symbol.iterator]();!(i=(u=s.next()).done);i=!0){var l=u.value;n.uint32(26),e.ContentFilter.codec().encode(l,n)}}catch(e){a=!0,o=e}finally{try{i||null==s.return||s.return()}finally{if(a)throw o}}!1!==r.lengthDelimited&&n.ldelim()}),(function(t,n){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={subscribe:!1,topic:"",contentFilters:[]},a=null==n?t.len:t.pos+n;t.pos<a;){var o=t.uint32();switch(o>>>3){case 1:i.subscribe=t.bool();break;case 2:i.topic=t.string();break;case 3:var u,s;if(null!=(null===(u=r.limits)||void 0===u?void 0:u.contentFilters)&&i.contentFilters.length===r.limits.contentFilters)throw new _r('Decode error - map field "contentFilters" had too many elements');i.contentFilters.push(e.ContentFilter.codec().decode(t,t.uint32(),{limits:null===(s=r.limits)||void 0===s?void 0:s.contentFilters$}));break;default:t.skipType(7&o)}}return i}))),t},e.encode=function(t){return mr(t,e.codec())},e.decode=function(t,n){return He(t,e.codec(),n)}}(Mn||(Mn={})),function(e){var t;e.codec=function(){return null==t&&(t=kr((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=!0,i=!1,a=void 0;if(!1!==n.lengthDelimited&&t.fork(),null!=e.messages)try{for(var o,u=e.messages[Symbol.iterator]();!(r=(o=u.next()).done);r=!0){var s=o.value;t.uint32(10),Fn.codec().encode(s,t)}}catch(e){i=!0,a=e}finally{try{r||null==u.return||u.return()}finally{if(i)throw a}}!1!==n.lengthDelimited&&t.ldelim()}),(function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={messages:[]},i=null==t?e.len:e.pos+t;e.pos<i;){var a=e.uint32();if(a>>>3==1){var o,u;if(null!=(null===(o=n.limits)||void 0===o?void 0:o.messages)&&r.messages.length===n.limits.messages)throw new _r('Decode error - map field "messages" had too many elements');r.messages.push(Fn.codec().decode(e,e.uint32(),{limits:null===(u=n.limits)||void 0===u?void 0:u.messages$}))}else e.skipType(7&a)}return r}))),t},e.encode=function(t){return mr(t,e.codec())},e.decode=function(t,n){return He(t,e.codec(),n)}}(Nn||(Nn={})),function(e){var t;e.codec=function(){return null==t&&(t=kr((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==n.lengthDelimited&&t.fork(),null!=e.requestId&&""!==e.requestId&&(t.uint32(10),t.string(e.requestId)),null!=e.request&&(t.uint32(18),Mn.codec().encode(e.request,t)),null!=e.push&&(t.uint32(26),Nn.codec().encode(e.push,t)),!1!==n.lengthDelimited&&t.ldelim()}),(function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={requestId:""},i=null==t?e.len:e.pos+t;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:r.requestId=e.string();break;case 2:var o;r.request=Mn.codec().decode(e,e.uint32(),{limits:null===(o=n.limits)||void 0===o?void 0:o.request});break;case 3:var u;r.push=Nn.codec().decode(e,e.uint32(),{limits:null===(u=n.limits)||void 0===u?void 0:u.push});break;default:e.skipType(7&a)}}return r}))),t},e.encode=function(t){return mr(t,e.codec())},e.decode=function(t,n){return He(t,e.codec(),n)}}(On||(On={})),function(e){var t;e.codec=function(){return null==t&&(t=kr((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==n.lengthDelimited&&t.fork(),null!=e.proof&&e.proof.byteLength>0&&(t.uint32(10),t.bytes(e.proof)),null!=e.merkleRoot&&e.merkleRoot.byteLength>0&&(t.uint32(18),t.bytes(e.merkleRoot)),null!=e.epoch&&e.epoch.byteLength>0&&(t.uint32(26),t.bytes(e.epoch)),null!=e.shareX&&e.shareX.byteLength>0&&(t.uint32(34),t.bytes(e.shareX)),null!=e.shareY&&e.shareY.byteLength>0&&(t.uint32(42),t.bytes(e.shareY)),null!=e.nullifier&&e.nullifier.byteLength>0&&(t.uint32(50),t.bytes(e.nullifier)),null!=e.rlnIdentifier&&e.rlnIdentifier.byteLength>0&&(t.uint32(58),t.bytes(e.rlnIdentifier)),!1!==n.lengthDelimited&&t.ldelim()}),(function(e,t){for(var n={proof:ye(0),merkleRoot:ye(0),epoch:ye(0),shareX:ye(0),shareY:ye(0),nullifier:ye(0),rlnIdentifier:ye(0)},r=null==t?e.len:e.pos+t;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.proof=e.bytes();break;case 2:n.merkleRoot=e.bytes();break;case 3:n.epoch=e.bytes();break;case 4:n.shareX=e.bytes();break;case 5:n.shareY=e.bytes();break;case 6:n.nullifier=e.bytes();break;case 7:n.rlnIdentifier=e.bytes();break;default:e.skipType(7&i)}}return n}))),t},e.encode=function(t){return mr(t,e.codec())},e.decode=function(t,n){return He(t,e.codec(),n)}}(Un||(Un={})),function(e){var t;e.codec=function(){return null==t&&(t=kr((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==n.lengthDelimited&&t.fork(),null!=e.payload&&e.payload.byteLength>0&&(t.uint32(10),t.bytes(e.payload)),null!=e.contentTopic&&""!==e.contentTopic&&(t.uint32(18),t.string(e.contentTopic)),null!=e.version&&(t.uint32(24),t.uint32(e.version)),null!=e.timestamp&&(t.uint32(80),t.sint64(e.timestamp)),null!=e.meta&&(t.uint32(90),t.bytes(e.meta)),null!=e.rateLimitProof&&(t.uint32(170),Un.codec().encode(e.rateLimitProof,t)),null!=e.ephemeral&&(t.uint32(248),t.bool(e.ephemeral)),!1!==n.lengthDelimited&&t.ldelim()}),(function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={payload:ye(0),contentTopic:""},i=null==t?e.len:e.pos+t;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:r.payload=e.bytes();break;case 2:r.contentTopic=e.string();break;case 3:r.version=e.uint32();break;case 10:r.timestamp=e.sint64();break;case 11:r.meta=e.bytes();break;case 21:var o;r.rateLimitProof=Un.codec().decode(e,e.uint32(),{limits:null===(o=n.limits)||void 0===o?void 0:o.rateLimitProof});break;case 31:r.ephemeral=e.bool();break;default:e.skipType(7&a)}}return r}))),t},e.encode=function(t){return mr(t,e.codec())},e.decode=function(t,n){return He(t,e.codec(),n)}}(Fn||(Fn={})),function(e){var t;e.codec=function(){return null==t&&(t=kr((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==n.lengthDelimited&&t.fork(),null!=e.contentTopic&&""!==e.contentTopic&&(t.uint32(18),t.string(e.contentTopic)),!1!==n.lengthDelimited&&t.ldelim()}),(function(e,t){for(var n={contentTopic:""},r=null==t?e.len:e.pos+t;e.pos<r;){var i=e.uint32();i>>>3==2?n.contentTopic=e.string():e.skipType(7&i)}return n}))),t},e.encode=function(t){return mr(t,e.codec())},e.decode=function(t,n){return He(t,e.codec(),n)}}(Bn||(Bn={})),function(e){var t,n,r;(function(e){e.SUBSCRIBER_PING="SUBSCRIBER_PING",e.SUBSCRIBE="SUBSCRIBE",e.UNSUBSCRIBE="UNSUBSCRIBE",e.UNSUBSCRIBE_ALL="UNSUBSCRIBE_ALL"})(e.FilterSubscribeType||(e.FilterSubscribeType={})),function(e){e[e.SUBSCRIBER_PING=0]="SUBSCRIBER_PING",e[e.SUBSCRIBE=1]="SUBSCRIBE",e[e.UNSUBSCRIBE=2]="UNSUBSCRIBE",e[e.UNSUBSCRIBE_ALL=3]="UNSUBSCRIBE_ALL"}(n||(n={})),function(e){e.codec=function(){return wr(n)}}(t=e.FilterSubscribeType||(e.FilterSubscribeType={})),e.codec=function(){return null==r&&(r=kr((function(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=!0,o=!1,u=void 0;if(!1!==i.lengthDelimited&&r.fork(),null!=t.requestId&&""!==t.requestId&&(r.uint32(10),r.string(t.requestId)),null!=t.filterSubscribeType&&0!==n[t.filterSubscribeType]&&(r.uint32(16),e.FilterSubscribeType.codec().encode(t.filterSubscribeType,r)),null!=t.pubsubTopic&&(r.uint32(82),r.string(t.pubsubTopic)),null!=t.contentTopics)try{for(var s,l=t.contentTopics[Symbol.iterator]();!(a=(s=l.next()).done);a=!0){var c=s.value;r.uint32(90),r.string(c)}}catch(e){o=!0,u=e}finally{try{a||null==l.return||l.return()}finally{if(o)throw u}}!1!==i.lengthDelimited&&r.ldelim()}),(function(n,r){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={requestId:"",filterSubscribeType:t.SUBSCRIBER_PING,contentTopics:[]},o=null==r?n.len:n.pos+r;n.pos<o;){var u=n.uint32();switch(u>>>3){case 1:a.requestId=n.string();break;case 2:a.filterSubscribeType=e.FilterSubscribeType.codec().decode(n);break;case 10:a.pubsubTopic=n.string();break;case 11:var s;if(null!=(null===(s=i.limits)||void 0===s?void 0:s.contentTopics)&&a.contentTopics.length===i.limits.contentTopics)throw new _r('Decode error - map field "contentTopics" had too many elements');a.contentTopics.push(n.string());break;default:n.skipType(7&u)}}return a}))),r},e.encode=function(t){return mr(t,e.codec())},e.decode=function(t,n){return He(t,e.codec(),n)}}(qn||(qn={})),function(e){var t;e.codec=function(){return null==t&&(t=kr((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==n.lengthDelimited&&t.fork(),null!=e.requestId&&""!==e.requestId&&(t.uint32(10),t.string(e.requestId)),null!=e.statusCode&&0!==e.statusCode&&(t.uint32(80),t.uint32(e.statusCode)),null!=e.statusDesc&&(t.uint32(90),t.string(e.statusDesc)),!1!==n.lengthDelimited&&t.ldelim()}),(function(e,t){for(var n={requestId:"",statusCode:0},r=null==t?e.len:e.pos+t;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.requestId=e.string();break;case 10:n.statusCode=e.uint32();break;case 11:n.statusDesc=e.string();break;default:e.skipType(7&i)}}return n}))),t},e.encode=function(t){return mr(t,e.codec())},e.decode=function(t,n){return He(t,e.codec(),n)}}(zn||(zn={})),function(e){var t;e.codec=function(){return null==t&&(t=kr((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==n.lengthDelimited&&t.fork(),null!=e.wakuMessage&&(t.uint32(10),Vn.codec().encode(e.wakuMessage,t)),null!=e.pubsubTopic&&(t.uint32(18),t.string(e.pubsubTopic)),!1!==n.lengthDelimited&&t.ldelim()}),(function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={},i=null==t?e.len:e.pos+t;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:var o;r.wakuMessage=Vn.codec().decode(e,e.uint32(),{limits:null===(o=n.limits)||void 0===o?void 0:o.wakuMessage});break;case 2:r.pubsubTopic=e.string();break;default:e.skipType(7&a)}}return r}))),t},e.encode=function(t){return mr(t,e.codec())},e.decode=function(t,n){return He(t,e.codec(),n)}}(jn||(jn={})),function(e){var t;e.codec=function(){return null==t&&(t=kr((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==n.lengthDelimited&&t.fork(),null!=e.proof&&e.proof.byteLength>0&&(t.uint32(10),t.bytes(e.proof)),null!=e.merkleRoot&&e.merkleRoot.byteLength>0&&(t.uint32(18),t.bytes(e.merkleRoot)),null!=e.epoch&&e.epoch.byteLength>0&&(t.uint32(26),t.bytes(e.epoch)),null!=e.shareX&&e.shareX.byteLength>0&&(t.uint32(34),t.bytes(e.shareX)),null!=e.shareY&&e.shareY.byteLength>0&&(t.uint32(42),t.bytes(e.shareY)),null!=e.nullifier&&e.nullifier.byteLength>0&&(t.uint32(50),t.bytes(e.nullifier)),null!=e.rlnIdentifier&&e.rlnIdentifier.byteLength>0&&(t.uint32(58),t.bytes(e.rlnIdentifier)),!1!==n.lengthDelimited&&t.ldelim()}),(function(e,t){for(var n={proof:ye(0),merkleRoot:ye(0),epoch:ye(0),shareX:ye(0),shareY:ye(0),nullifier:ye(0),rlnIdentifier:ye(0)},r=null==t?e.len:e.pos+t;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.proof=e.bytes();break;case 2:n.merkleRoot=e.bytes();break;case 3:n.epoch=e.bytes();break;case 4:n.shareX=e.bytes();break;case 5:n.shareY=e.bytes();break