diff --git a/dogfooding/index.html b/dogfooding/index.html index a68b669..8f3f20d 100644 --- a/dogfooding/index.html +++ b/dogfooding/index.html @@ -1 +1 @@ -
>>2),u[h++]=255&(n<<6|r<<1|i>>>4),u[h++]=255&(i<<4|s>>>1),u[h++]=255&(s<<7|o<<2|c>>>3),u[h++]=255&(c<<5|l);var g=d-p;return 2===g?(e=a[t.charAt(f++)],n=a[t.charAt(f++)],u[h++]=255&(e<<3|n>>>2)):4===g?(e=a[t.charAt(f++)],n=a[t.charAt(f++)],r=a[t.charAt(f++)],i=a[t.charAt(f++)],u[h++]=255&(e<<3|n>>>2),u[h++]=255&(n<<6|r<<1|i>>>4)):5===g?(e=a[t.charAt(f++)],n=a[t.charAt(f++)],r=a[t.charAt(f++)],i=a[t.charAt(f++)],s=a[t.charAt(f++)],u[h++]=255&(e<<3|n>>>2),u[h++]=255&(n<<6|r<<1|i>>>4),u[h++]=255&(i<<4|s>>>1)):7===g&&(e=a[t.charAt(f++)],n=a[t.charAt(f++)],r=a[t.charAt(f++)],i=a[t.charAt(f++)],s=a[t.charAt(f++)],o=a[t.charAt(f++)],c=a[t.charAt(f++)],u[h++]=255&(e<<3|n>>>2),u[h++]=255&(n<<6|r<<1|i>>>4),u[h++]=255&(i<<4|s>>>1),u[h++]=255&(s<<7|o<<2|c>>>3)),u},h=function(t,e){if(!e)return function(t){for(var e,n,r="",i=t.length,s=0,o=0;s191&&e<=223?(n=31&e,o=1):e<=239?(n=15&e,o=2):e<=247?(n=7&e,o=3):l(s,r);for(var a=0;a >6,c[l++]=128|63&a):a<55296||a>=57344?(c[l++]=224|a>>12,c[l++]=128|a>>6&63,c[l++]=128|63&a):(a=65536+((1023&a)<<10|1023&t.charCodeAt(++d)),c[l++]=240|a>>18,c[l++]=128|a>>12&63,c[l++]=128|a>>6&63,c[l++]=128|63&a);f=l-5,d===p&&++d,d>p&&l<6&&(u=!0),e=c[0],l>4?(n=c[1],r=c[2],i=c[3],s=c[4],h+=o[e>>>3]+o[31&(e<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|r>>>4)]+o[31&(r<<1|i>>>7)]+o[i>>>2&31]+o[31&(i<<3|s>>>5)]+o[31&s]):1===l?h+=o[e>>>3]+o[e<<2&31]+"======":2===l?(n=c[1],h+=o[e>>>3]+o[31&(e<<2|n>>>6)]+o[n>>>1&31]+o[n<<4&31]+"===="):3===l?(n=c[1],r=c[2],h+=o[e>>>3]+o[31&(e<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|r>>>4)]+o[r<<1&31]+"==="):(n=c[1],r=c[2],i=c[3],h+=o[e>>>3]+o[31&(e<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|r>>>4)]+o[31&(r<<1|i>>>7)]+o[i>>>2&31]+o[i<<3&31]+"=")}while(!u);return h}(t)},decode:h};h.asBytes=u,i?t.exports=d:(e.base32=d,s&&(void 0===(r=function(){return d}.call(d,n,d,t))||(t.exports=r)))}()},6237:(t,e,n)=>{"use strict";t.exports=c;var r,i=n(3610),s=i.LongBits,o=i.utf8;function a(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function c(t){this.buf=t,this.pos=0,this.len=t.length}var l,u="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new c(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new c(t);throw Error("illegal buffer")},h=function(){return i.Buffer?function(t){return(c.create=function(t){return i.Buffer.isBuffer(t)?new r(t):u(t)})(t)}:u};function d(){var t=new s(0,0),e=0;if(!(this.len-this.pos>4)){for(;e<3;++e){if(this.pos>=this.len)throw a(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*e)>>>0,t}for(;e<4;++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(e=0,this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw a(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function f(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw a(this,8);return new s(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}c.create=h(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=(l=4294967295,function(){if(l=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return l;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return l}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return f(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|f(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var t=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var t=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},c.prototype.bytes=function(){var t=this.uint32(),e=this.pos,n=this.pos+t;if(n>this.len)throw a(this,t);if(this.pos+=t,Array.isArray(this.buf))return this.buf.slice(e,n);if(e===n){var r=i.Buffer;return r?r.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,e,n)},c.prototype.string=function(){var t=this.bytes();return o.read(t,0,t.length)},c.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw a(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},c._configure=function(t){r=t,c.create=h(),r._configure();var e=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return d.call(this)[e](!1)},uint64:function(){return d.call(this)[e](!0)},sint64:function(){return d.call(this).zzDecode()[e](!1)},fixed64:function(){return p.call(this)[e](!0)},sfixed64:function(){return p.call(this)[e](!1)}})}},6434:(t,e,n)=>{"use strict";var r=e,i=n(2551);r[".google.protobuf.Any"]={fromObject:function(t){if(t&&t["@type"]){var e=t["@type"].substring(t["@type"].lastIndexOf("/")+1),n=this.lookup(e);if(n){var r="."===t["@type"].charAt(0)?t["@type"].slice(1):t["@type"];return-1===r.indexOf("/")&&(r="/"+r),this.create({type_url:r,value:n.encode(n.fromObject(t)).finish()})}}return this.fromObject(t)},toObject:function(t,e){var n="",r="";if(e&&e.json&&t.type_url&&t.value){r=t.type_url.substring(t.type_url.lastIndexOf("/")+1),n=t.type_url.substring(0,t.type_url.lastIndexOf("/")+1);var s=this.lookup(r);s&&(t=s.decode(t.value))}if(!(t instanceof this.ctor)&&t instanceof i){var o=t.$type.toObject(t,e);return""===n&&(n="type.googleapis.com/"),r=n+("."===t.$type.fullName[0]?t.$type.fullName.slice(1):t.$type.fullName),o["@type"]=r,o}return this.toObject(t,e)}}},6585:t=>{var e=1e3,n=60*e,r=60*n,i=24*r,s=7*i;function o(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}t.exports=function(t,a){a=a||{};var c,l,u=typeof t;if("string"===u&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(o){var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*s;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*r;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(t);if("number"===u&&isFinite(t))return a.long?(c=t,(l=Math.abs(c))>=i?o(c,l,i,"day"):l>=r?o(c,l,r,"hour"):l>=n?o(c,l,n,"minute"):l>=e?o(c,l,e,"second"):c+" ms"):function(t){var s=Math.abs(t);return s>=i?Math.round(t/i)+"d":s>=r?Math.round(t/r)+"h":s>=n?Math.round(t/n)+"m":s>=e?Math.round(t/e)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},7168:(t,e,n)=>{var r;!function(i,s,o,a){"use strict";var c,l=["","webkit","Moz","MS","ms","o"],u=s.createElement("div"),h=Math.round,d=Math.abs,f=Date.now;function p(t,e,n){return setTimeout(x(t,n),e)}function g(t,e,n){return!!Array.isArray(t)&&(m(t,n[e],n),!0)}function m(t,e,n){var r;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==a)for(r=0;r>>3){case 1:i.subscribe=e.bool();break;case 2:i.topic=e.string();break;case 3:if(null!=r.limits?.contentFilters&&i.contentFilters.length===r.limits.contentFilters)throw new An('Decode error - map field "contentFilters" had too many elements');i.contentFilters.push(t.ContentFilter.codec().decode(e,e.uint32(),{limits:r.limits?.contentFilters$}));break;default:e.skipType(7&n)}}return i})),n),t.encode=e=>ze(e,t.codec()),t.decode=(e,n)=>H(e,t.codec(),n)}(He||(He={})),function(t){let e;t.codec=()=>(null==e&&(e=kn((t,e,n={})=>{if(!1!==n.lengthDelimited&&e.fork(),null!=t.messages)for(const n of t.messages)e.uint32(10),Xe.codec().encode(n,e);!1!==n.lengthDelimited&&e.ldelim()},(t,e,n={})=>{const r={messages:[]},i=null==e?t.len:t.pos+e;for(;t.pos>>3==1){if(null!=n.limits?.messages&&r.messages.length===n.limits.messages)throw new An('Decode error - map field "messages" had too many elements');r.messages.push(Xe.codec().decode(t,t.uint32(),{limits:n.limits?.messages$}))}else t.skipType(7&e)}return r})),e),t.encode=e=>ze(e,t.codec()),t.decode=(e,n)=>H(e,t.codec(),n)}(Ke||(Ke={})),function(t){let e;t.codec=()=>(null==e&&(e=kn((t,e,n={})=>{!1!==n.lengthDelimited&&e.fork(),null!=t.requestId&&""!==t.requestId&&(e.uint32(10),e.string(t.requestId)),null!=t.request&&(e.uint32(18),He.codec().encode(t.request,e)),null!=t.push&&(e.uint32(26),Ke.codec().encode(t.push,e)),!1!==n.lengthDelimited&&e.ldelim()},(t,e,n={})=>{const r={requestId:""},i=null==e?t.len:t.pos+e;for(;t.pos>>3){case 1:r.requestId=t.string();break;case 2:r.request=He.codec().decode(t,t.uint32(),{limits:n.limits?.request});break;case 3:r.push=Ke.codec().decode(t,t.uint32(),{limits:n.limits?.push});break;default:t.skipType(7&e)}}return r})),e),t.encode=e=>ze(e,t.codec()),t.decode=(e,n)=>H(e,t.codec(),n)}(We||(We={})),function(t){let e;t.codec=()=>(null==e&&(e=kn((t,e,n={})=>{!1!==n.lengthDelimited&&e.fork(),null!=t.proof&&t.proof.byteLength>0&&(e.uint32(10),e.bytes(t.proof)),null!=t.merkleRoot&&t.merkleRoot.byteLength>0&&(e.uint32(18),e.bytes(t.merkleRoot)),null!=t.epoch&&t.epoch.byteLength>0&&(e.uint32(26),e.bytes(t.epoch)),null!=t.shareX&&t.shareX.byteLength>0&&(e.uint32(34),e.bytes(t.shareX)),null!=t.shareY&&t.shareY.byteLength>0&&(e.uint32(42),e.bytes(t.shareY)),null!=t.nullifier&&t.nullifier.byteLength>0&&(e.uint32(50),e.bytes(t.nullifier)),null!=t.rlnIdentifier&&t.rlnIdentifier.byteLength>0&&(e.uint32(58),e.bytes(t.rlnIdentifier)),!1!==n.lengthDelimited&&e.ldelim()},(t,e,n={})=>{const r={proof:p(0),merkleRoot:p(0),epoch:p(0),shareX:p(0),shareY:p(0),nullifier:p(0),rlnIdentifier:p(0)},i=null==e?t.len:t.pos+e;for(;t.pos>>3){case 1:r.proof=t.bytes();break;case 2:r.merkleRoot=t.bytes();break;case 3:r.epoch=t.bytes();break;case 4:r.shareX=t.bytes();break;case 5:r.shareY=t.bytes();break;case 6:r.nullifier=t.bytes();break;case 7:r.rlnIdentifier=t.bytes();break;default:t.skipType(7&e)}}return r})),e),t.encode=e=>ze(e,t.codec()),t.decode=(e,n)=>H(e,t.codec(),n)}(Ge||(Ge={})),function(t){let e;t.codec=()=>(null==e&&(e=kn((t,e,n={})=>{!1!==n.lengthDelimited&&e.fork(),null!=t.payload&&t.payload.byteLength>0&&(e.uint32(10),e.bytes(t.payload)),null!=t.contentTopic&&""!==t.contentTopic&&(e.uint32(18),e.string(t.contentTopic)),null!=t.version&&(e.uint32(24),e.uint32(t.version)),null!=t.timestamp&&(e.uint32(80),e.sint64(t.timestamp)),null!=t.meta&&(e.uint32(90),e.bytes(t.meta)),null!=t.rateLimitProof&&(e.uint32(170),Ge.codec().encode(t.rateLimitProof,e)),null!=t.ephemeral&&(e.uint32(248),e.bool(t.ephemeral)),!1!==n.lengthDelimited&&e.ldelim()},(t,e,n={})=>{const r={payload:p(0),contentTopic:""},i=null==e?t.len:t.pos+e;for(;t.pos>>3){case 1:r.payload=t.bytes();break;case 2:r.contentTopic=t.string();break;case 3:r.version=t.uint32();break;case 10:r.timestamp=t.sint64();break;case 11:r.meta=t.bytes();break;case 21:r.rateLimitProof=Ge.codec().decode(t,t.uint32(),{limits:n.limits?.rateLimitProof});break;case 31:r.ephemeral=t.bool();break;default:t.skipType(7&e)}}return r})),e),t.encode=e=>ze(e,t.codec()),t.decode=(e,n)=>H(e,t.codec(),n)}(Xe||(Xe={})),function(t){let e;t.codec=()=>(null==e&&(e=kn((t,e,n={})=>{!1!==n.lengthDelimited&&e.fork(),null!=t.contentTopic&&""!==t.contentTopic&&(e.uint32(18),e.string(t.contentTopic)),!1!==n.lengthDelimited&&e.ldelim()},(t,e,n={})=>{const r={contentTopic:""},i=null==e?t.len:t.pos+e;for(;t.pos>>3==2?r.contentTopic=t.string():t.skipType(7&e)}return r})),e),t.encode=e=>ze(e,t.codec()),t.decode=(e,n)=>H(e,t.codec(),n)}(Ye||(Ye={})),function(t){let e,n,r;!function(t){t.SUBSCRIBER_PING="SUBSCRIBER_PING",t.SUBSCRIBE="SUBSCRIBE",t.UNSUBSCRIBE="UNSUBSCRIBE",t.UNSUBSCRIBE_ALL="UNSUBSCRIBE_ALL"}(e=t.FilterSubscribeType||(t.FilterSubscribeType={})),function(t){t[t.SUBSCRIBER_PING=0]="SUBSCRIBER_PING",t[t.SUBSCRIBE=1]="SUBSCRIBE",t[t.UNSUBSCRIBE=2]="UNSUBSCRIBE",t[t.UNSUBSCRIBE_ALL=3]="UNSUBSCRIBE_ALL"}(n||(n={})),function(t){t.codec=()=>Sn(n)}(e=t.FilterSubscribeType||(t.FilterSubscribeType={})),t.codec=()=>(null==r&&(r=kn((e,r,i={})=>{if(!1!==i.lengthDelimited&&r.fork(),null!=e.requestId&&""!==e.requestId&&(r.uint32(10),r.string(e.requestId)),null!=e.filterSubscribeType&&0!==n[e.filterSubscribeType]&&(r.uint32(16),t.FilterSubscribeType.codec().encode(e.filterSubscribeType,r)),null!=e.pubsubTopic&&(r.uint32(82),r.string(e.pubsubTopic)),null!=e.contentTopics)for(const t of e.contentTopics)r.uint32(90),r.string(t);!1!==i.lengthDelimited&&r.ldelim()},(n,r,i={})=>{const s={requestId:"",filterSubscribeType:e.SUBSCRIBER_PING,contentTopics:[]},o=null==r?n.len:n.pos+r;for(;n.pos>BigInt(t)&l);u[s]=u[s].add(n[e])}let e=o;for(let t=u.length-1,n=o;t>0;t--)n=n.add(u[t]),e=e.add(n);if(h=h.add(e),0!==t)for(let t=0;t1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const o=Zo(n?To(t):Co(t),e-jo)+jo;return n?Mo(o,i):Po(o,i)}(ko(t,i.seed,"seed"),n.ORDER)}function a(e,r=!0){return t.BASE.multiply(zc(n,e)).toBytes(r)}function c(e){if("bigint"==typeof e)return!1;if(e instanceof t)return!0;const{secretKey:r,publicKey:s,publicKeyUncompressed:o}=i;if(n.allowedLengths||r===s)return;const a=Do("key",e).length;return a===s||a===o}const l={isValidSecretKey:s,isValidPublicKey:function(e,n){const{publicKey:r,publicKeyUncompressed:s}=i;try{const i=e.length;return!(!0===n&&i!==r||!1===n&&i!==s||!t.fromBytes(e))}catch(t){return!1}},randomSecretKey:o,isValidPrivateKey:s,randomPrivateKey:o,normPrivateKeyToScalar:t=>zc(n,t),precompute:(e=8,n=t.BASE)=>n.precompute(e,!1)};return Object.freeze({getPublicKey:a,getSharedSecret:function(e,r,i=!0){if(!0===c(e))throw new Error("first arg must be private key");if(!1===c(r))throw new Error("second arg must be public key");const s=zc(n,e);return t.fromHex(r).multiply(s).toBytes(i)},keygen:function(t){const e=o(t);return{secretKey:e,publicKey:a(e)}},Point:t,utils:l,lengths:i})}(t,n),p={prehash:!1,lowS:"boolean"==typeof n.lowS&&n.lowS,format:void 0,extraEntropy:!1},g="compact";function m(t){return t>a>>Fc}function y(t,e){if(!o.isValidNot0(e))throw new Error(`invalid signature ${t}: out of range 1..Point.Fn.ORDER`);return e}class b{constructor(t,e,n){this.r=y("r",t),this.s=y("s",e),null!=n&&(this.recovery=n),Object.freeze(this)}static fromBytes(t,e=g){let n;if(function(t,e){Dc(e);const n=f.signature;ko(t,"compact"===e?n:"recovered"===e?n+1:void 0,`${e} signature`)}(t,e),"der"===e){const{r:e,s:n}=Lc.toSig(ko(t));return new b(e,n)}"recovered"===e&&(n=t[0],e="compact",t=t.subarray(1));const r=o.BYTES,i=t.subarray(0,r),s=t.subarray(r,2*r);return new b(o.fromBytes(i),o.fromBytes(s),n)}static fromHex(t,e){return this.fromBytes(jn(t),e)}addRecoveryBit(t){return new b(this.r,this.s,t)}recoverPublicKey(e){const n=s.ORDER,{r,s:i,recovery:c}=this;if(null==c||![0,1,2,3].includes(c))throw new Error("recovery id invalid");if(a*Bc{t.update(e);const n=e.length%16;n&&t.update(Oh.subarray(n))},Nh=new Uint8Array(32);function Fh(t,e,n,r,i){const s=t(e,n,Nh),o=Ph.create(s);i&&Lh(o,i),Lh(o,r);const a=function(t,e,n){oh(n);const r=new Uint8Array(16),i=(s=r,new DataView(s.buffer,s.byteOffset,s.byteLength));var s;return mh(i,0,BigInt(e),n),mh(i,8,BigInt(t),n),r}(r.length,i?i.length:0,!0);o.update(a);const c=o.digest();return hh(s,a),c}const Bh=t=>(e,n,r)=>({encrypt(i,s){const o=i.length;(s=gh(o+16,s,!1)).set(i);const a=s.subarray(0,-16);t(e,n,a,a,1);const c=Fh(t,e,n,a,r);return s.set(c,o),hh(c),s},decrypt(i,s){s=gh(i.length-16,s,!1);const o=i.subarray(0,-16),a=i.subarray(-16),c=Fh(t,e,n,o,r);if(!function(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r({publicKey:Ja.getPublicKey(t),privateKey:t}),generateX25519SharedKey:(t,e)=>Ja.getSharedSecret(t.subarray(),e.subarray()),chaCha20Poly1305Encrypt:(t,e,n,r)=>Uh(r,e,n).encrypt(t.subarray()),chaCha20Poly1305Decrypt:(t,e,n,r,i)=>Uh(r,e,n).decrypt(t.subarray(),i)},qh=t=>{const e=g(2);return e[0]=t>>8,e[1]=t,e};qh.bytes=2;const Vh=t=>{if(t.length<2)throw RangeError("Could not decode int16BE");if(t instanceof Uint8Array){let e=0;return e+=t[0]<<8,e+=t[1],e}return t.getUint16(0)};function Hh(t,e){e.enabled&&ih&&(t?(e(`LOCAL_STATIC_PUBLIC_KEY ${Cr(t.publicKey,"hex")}`),e(`LOCAL_STATIC_PRIVATE_KEY ${Cr(t.privateKey,"hex")}`)):e("Missing local static keys."))}function Kh(t,e){e.enabled&&ih&&(t?(e(`LOCAL_PUBLIC_EPHEMERAL_KEY ${Cr(t.publicKey,"hex")}`),e(`LOCAL_PRIVATE_EPHEMERAL_KEY ${Cr(t.privateKey,"hex")}`)):e("Missing local ephemeral keys."))}function Wh(t,e){e.enabled&&ih&&e(t?`REMOTE_EPHEMERAL_PUBLIC_KEY ${Cr(t.subarray(),"hex")}`:"Missing remote ephemeral keys.")}function Gh(t,e,n){n.enabled&&ih&&(n(`CIPHER_STATE_1 ${t.n.getUint64()} ${t.k&&Cr(t.k,"hex")}`),n(`CIPHER_STATE_2 ${e.n.getUint64()} ${e.k&&Cr(e.k,"hex")}`))}Vh.bytes=2;class Xh extends Error{code;constructor(t="Invalid crypto exchange"){super(t),this.code=Xh.code}static code="ERR_INVALID_CRYPTO_EXCHANGE"}class Yh{n;bytes;view;constructor(t=0){this.n=t,this.bytes=p(12),this.view=new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength),this.view.setUint32(4,t,!0)}increment(){this.n++,this.view.setUint32(4,this.n,!0)}getBytes(){return this.bytes}getUint64(){return this.n}assertValue(){if(this.n>4294967295)throw new Error("Cipherstate has reached maximum n, a new handshake must be performed")}}const Zh=p(0);class Jh{k;n;crypto;constructor(t,e=void 0,n=0){this.crypto=t,this.k=e,this.n=new Yh(n)}hasKey(){return Boolean(this.k)}encryptWithAd(t,e){if(!this.hasKey())return e;this.n.assertValue();const n=this.crypto.encrypt(e,this.n.getBytes(),t,this.k);return this.n.increment(),n}decryptWithAd(t,e,n){if(!this.hasKey())return e;this.n.assertValue();const r=this.crypto.decrypt(e,this.n.getBytes(),t,this.k,n);return this.n.increment(),r}}class Qh{cs;ck;h;crypto;constructor(t,e){this.crypto=t;const n=Ie(e,"utf-8");this.h=function(t,e){if(e.length<=32){const t=p(32);return t.set(e),t}return t.hash(e)}(t,n),this.ck=this.h,this.cs=new Jh(t)}mixKey(t){const[e,n]=this.crypto.hkdf(this.ck,t);this.ck=e,this.cs=new Jh(this.crypto,n)}mixHash(t){this.h=this.crypto.hash(new ui(this.h,t))}encryptAndHash(t){const e=this.cs.encryptWithAd(this.h,t);return this.mixHash(e),e}decryptAndHash(t){const e=this.cs.decryptWithAd(this.h,t);return this.mixHash(t),e}split(){const[t,e]=this.crypto.hkdf(this.ck,Zh);return[new Jh(this.crypto,t),new Jh(this.crypto,e)]}}class td{ss;s;e;rs;re;initiator;crypto;constructor(t){const{crypto:e,protocolName:n,prologue:r,initiator:i,s,e:o,rs:a,re:c}=t;this.crypto=e,this.ss=new Qh(e,n),this.ss.mixHash(r),this.initiator=i,this.s=s,this.e=o,this.rs=a,this.re=c}writeE(){if(this.e)throw new Error("ephemeral keypair is already set");const t=this.crypto.generateKeypair();return this.ss.mixHash(t.publicKey),this.e=t,t.publicKey}writeS(){if(!this.s)throw new Error("static keypair is not set");return this.ss.encryptAndHash(this.s.publicKey)}writeEE(){if(!this.e)throw new Error("ephemeral keypair is not set");if(!this.re)throw new Error("remote ephemeral public key is not set");this.ss.mixKey(this.crypto.dh(this.e,this.re))}writeES(){if(this.initiator){if(!this.e)throw new Error("ephemeral keypair is not set");if(!this.rs)throw new Error("remote static public key is not set");this.ss.mixKey(this.crypto.dh(this.e,this.rs))}else{if(!this.s)throw new Error("static keypair is not set");if(!this.re)throw new Error("remote ephemeral public key is not set");this.ss.mixKey(this.crypto.dh(this.s,this.re))}}writeSE(){if(this.initiator){if(!this.s)throw new Error("static keypair is not set");if(!this.re)throw new Error("remote ephemeral public key is not set");this.ss.mixKey(this.crypto.dh(this.s,this.re))}else{if(!this.e)throw new Error("ephemeral keypair is not set");if(!this.rs)throw new Error("remote static public key is not set");this.ss.mixKey(this.crypto.dh(this.e,this.rs))}}readE(t,e=0){if(this.re)throw new Error("remote ephemeral public key is already set");if(t.byteLength>>3){case 1:i.peerId=e.bytes();break;case 2:i.seq=e.uint64();break;case 3:if(null!=r.limits?.addresses&&i.addresses.length===r.limits.addresses)throw new An('Decode error - map field "addresses" had too many elements');i.addresses.push(t.AddressInfo.codec().decode(e,e.uint32(),{limits:r.limits?.addresses$}));break;default:e.skipType(7&n)}}return i})),n),t.encode=e=>ze(e,t.codec()),t.decode=(e,n)=>H(e,t.codec(),n)}(Vd||(Vd={}));class Kd{static createFromProtobuf=t=>{const e=Vd.decode(t),n=dl(ie(e.peerId)),r=(e.addresses??[]).map(t=>Ql(t.multiaddr)),i=e.seq;return new Kd({peerId:n,multiaddrs:r,seqNumber:i})};static DOMAIN="libp2p-peer-record";static CODEC=qd;peerId;multiaddrs;seqNumber;domain=Kd.DOMAIN;codec=Kd.CODEC;marshaled;constructor(t){const{peerId:e,multiaddrs:n,seqNumber:r}=t;this.peerId=e,this.multiaddrs=n??[],this.seqNumber=r??BigInt(Date.now())}marshal(){return null==this.marshaled&&(this.marshaled=Vd.encode({peerId:this.peerId.toMultihash().bytes,seq:BigInt(this.seqNumber),addresses:this.multiaddrs.map(t=>({multiaddr:t.bytes}))})),this.marshaled}equals(t){return t instanceof Kd&&!!this.peerId.equals(t.peerId)&&this.seqNumber===t.seqNumber&&!!function(t,e){const n=(t,e)=>t.toString().localeCompare(e.toString());return t.length===e.length&&(e.sort(n),t.sort(n).every((t,n)=>e[n].equals(t)))}(this.multiaddrs,t.multiaddrs)}}!function(t){let e;t.codec=()=>(null==e&&(e=kn((t,e,n={})=>{!1!==n.lengthDelimited&&e.fork(),null!=t.publicKey&&t.publicKey.byteLength>0&&(e.uint32(10),e.bytes(t.publicKey)),null!=t.payloadType&&t.payloadType.byteLength>0&&(e.uint32(18),e.bytes(t.payloadType)),null!=t.payload&&t.payload.byteLength>0&&(e.uint32(26),e.bytes(t.payload)),null!=t.signature&&t.signature.byteLength>0&&(e.uint32(42),e.bytes(t.signature)),!1!==n.lengthDelimited&&e.ldelim()},(t,e,n={})=>{const r={publicKey:p(0),payloadType:p(0),payload:p(0),signature:p(0)},i=null==e?t.len:t.pos+e;for(;t.pos>>3){case 1:r.publicKey=t.bytes();break;case 2:r.payloadType=t.bytes();break;case 3:r.payload=t.bytes();break;case 5:r.signature=t.bytes();break;default:t.skipType(7&e)}}return r})),e),t.encode=e=>ze(e,t.codec()),t.decode=(e,n)=>H(e,t.codec(),n)}(Hd||(Hd={}));class Wd extends Error{constructor(t="Invalid signature"){super(t),this.name="InvalidSignatureError"}}class Gd{static createFromProtobuf=t=>{const e=Hd.decode(t),n=nl(e.publicKey);return new Gd({publicKey:n,payloadType:e.payloadType,payload:e.payload,signature:e.signature})};static seal=async(t,e,n)=>{if(null==e)throw new Error("Missing private key");const r=t.domain,i=t.codec,s=t.marshal(),o=Xd(r,i,s),a=await e.sign(o.subarray(),n);return new Gd({publicKey:e.publicKey,payloadType:i,payload:s,signature:a})};static openAndCertify=async(t,e,n)=>{const r=Gd.createFromProtobuf(t);if(!await r.validate(e,n))throw new Wd("Envelope signature is not valid for the given domain");return r};publicKey;payloadType;payload;signature;marshaled;constructor(t){const{publicKey:e,payloadType:n,payload:r,signature:i}=t;this.publicKey=e,this.payloadType=n,this.payload=r,this.signature=i}marshal(){return null==this.marshaled&&(this.marshaled=Hd.encode({publicKey:rl(this.publicKey),payloadType:this.payloadType,payload:this.payload.subarray(),signature:this.signature})),this.marshaled}equals(t){return null!=t&&oi(this.marshal(),t.marshal())}async validate(t,e){const n=Xd(t,this.payloadType,this.payload);return this.publicKey.verify(n.subarray(),this.signature,e)}}const Xd=(t,e,n)=>{const r=Ie(t),i=C(r.byteLength),s=C(e.length),o=C(n.length);return new ui(i,r,s,e,o,n)};var Yd=__webpack_require__(5507);const Zd=["0.0.0.0/8","10.0.0.0/8","100.64.0.0/10","127.0.0.0/8","169.254.0.0/16","172.16.0.0/12","192.0.0.0/24","192.0.0.0/29","192.0.0.8/32","192.0.0.9/32","192.0.0.10/32","192.0.0.170/32","192.0.0.171/32","192.0.2.0/24","192.31.196.0/24","192.52.193.0/24","192.88.99.0/24","192.168.0.0/16","192.175.48.0/24","198.18.0.0/15","198.51.100.0/24","203.0.113.0/24","240.0.0.0/4","255.255.255.255/32"].map(t=>new Yd.Netmask(t));function Jd(t){for(const e of Zd)if(e.contains(t))return!0;return!1}function Qd(t){return El(t)?Jd(t):/^::ffff:([0-9a-fA-F]{1,4}):([0-9a-fA-F]{1,4})$/.test(t)?function(t){const e=t.split(":");if(e.length<2)return!1;const n=e[e.length-1].padStart(4,"0"),r=e[e.length-2].padStart(4,"0");return Jd(`${parseInt(r.substring(0,2),16)}.${parseInt(r.substring(2),16)}.${parseInt(n.substring(0,2),16)}.${parseInt(n.substring(2),16)}`)}(t):/^::ffff:([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(t)?function(t){const e=t.split(":");return Jd(e[e.length-1])}(t):_l(t)?function(t){return/^::$/.test(t)||/^::1$/.test(t)||/^64:ff9b::([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(t)||/^100::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2001::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2001:2[0-9a-fA-F]:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2001:db8:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2002:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^f[c-d]([0-9a-fA-F]{2,2}):/i.test(t)||/^fe[8-9a-bA-B][0-9a-fA-F]:/i.test(t)||/^ff([0-9a-fA-F]{2,2}):/i.test(t)}(t):void 0}function tf(t){try{for(const{code:e}of t.getComponents())if(e!==kl)return 4===e||e===Sl}catch{}return!1}function ef(t){try{if(!tf(t))return!1;const[[,e]]=t.stringTuples();return null!=e&&(Qd(e)??!1)}catch{}return!0}const nf=t=>({match:e=>!(e.length<1)&&!!t(e[0])&&e.slice(1),pattern:"fn"}),rf=t=>({match:e=>nf(e=>e===t).match(e),pattern:t}),sf=()=>({match:t=>nf(t=>"string"==typeof t).match(t),pattern:"{string}"}),of=()=>({match:t=>nf(t=>!isNaN(parseInt(t))).match(t),pattern:"{number}"}),af=()=>({match:t=>{if(t.length<2)return!1;if("p2p"!==t[0]&&"ipfs"!==t[0])return!1;if(!t[1].startsWith("Q")&&!t[1].startsWith("1"))return!1;try{xt.decode(`z${t[1]}`)}catch(t){return!1}return t.slice(2)},pattern:"/p2p/{peerid}"}),cf=()=>({match:t=>{if(t.length<2)return!1;if("certhash"!==t[0])return!1;try{kt.decode(t[1])}catch{return!1}return t.slice(2)},pattern:"/certhash/{certhash}"}),lf=t=>({match:e=>{const n=t.match(e);return!1===n?e:n},pattern:`optional(${t.pattern})`}),uf=(...t)=>({match:e=>{let n;for(const r of t){const t=r.match(e);!1!==t&&(null==n||t.length>>3){case 1:if(null!=r.limits?.addresses&&i.addresses.length===r.limits.addresses)throw new An('Decode error - map field "addresses" had too many elements');i.addresses.push(Rm.codec().decode(e,e.uint32(),{limits:r.limits?.addresses$}));break;case 2:if(null!=r.limits?.protocols&&i.protocols.length===r.limits.protocols)throw new An('Decode error - map field "protocols" had too many elements');i.protocols.push(e.string());break;case 4:i.publicKey=e.bytes();break;case 5:i.peerRecordEnvelope=e.bytes();break;case 6:{if(null!=r.limits?.metadata&&i.metadata.size===r.limits.metadata)throw new In('Decode error - map field "metadata" had too many elements');const n=t.Peer$metadataEntry.codec().decode(e,e.uint32());i.metadata.set(n.key,n.value);break}case 7:{if(null!=r.limits?.tags&&i.tags.size===r.limits.tags)throw new In('Decode error - map field "tags" had too many elements');const n=t.Peer$tagsEntry.codec().decode(e,e.uint32(),{limits:{value:r.limits?.tags$value}});i.tags.set(n.key,n.value);break}case 8:i.updated=e.uint64Number();break;default:e.skipType(7&n)}}return i})),r),t.encode=e=>ze(e,t.codec()),t.decode=(e,n)=>H(e,t.codec(),n)}(Dm||(Dm={})),function(t){let e;t.codec=()=>(null==e&&(e=kn((t,e,n={})=>{!1!==n.lengthDelimited&&e.fork(),null!=t.multiaddr&&t.multiaddr.byteLength>0&&(e.uint32(10),e.bytes(t.multiaddr)),null!=t.isCertified&&(e.uint32(16),e.bool(t.isCertified)),null!=t.observed&&(e.uint32(24),e.uint64Number(t.observed)),!1!==n.lengthDelimited&&e.ldelim()},(t,e,n={})=>{const r={multiaddr:p(0)},i=null==e?t.len:t.pos+e;for(;t.pos>>3){case 1:r.multiaddr=t.bytes();break;case 2:r.isCertified=t.bool();break;case 3:r.observed=t.uint64Number();break;default:t.skipType(7&e)}}return r})),e),t.encode=e=>ze(e,t.codec()),t.decode=(e,n)=>H(e,t.codec(),n)}(Rm||(Rm={})),function(t){let e;t.codec=()=>(null==e&&(e=kn((t,e,n={})=>{!1!==n.lengthDelimited&&e.fork(),null!=t.value&&0!==t.value&&(e.uint32(8),e.uint32(t.value)),null!=t.expiry&&(e.uint32(16),e.uint64(t.expiry)),!1!==n.lengthDelimited&&e.ldelim()},(t,e,n={})=>{const r={value:0},i=null==e?t.len:t.pos+e;for(;t.pos>>3){case 1:r.value=t.uint32();break;case 2:r.expiry=t.uint64();break;default:t.skipType(7&e)}}return r})),e),t.encode=e=>ze(e,t.codec()),t.decode=(e,n)=>H(e,t.codec(),n)}(Om||(Om={}));const $m="/",zm=(new TextEncoder).encode($m),jm=zm[0];class qm{_buf;constructor(t,e){if("string"==typeof t)this._buf=Ie(t);else{if(!(t instanceof Uint8Array))throw new Error("Invalid key, should be String of Uint8Array");this._buf=t}if(null==e&&(e=!0),e&&this.clean(),0===this._buf.byteLength||this._buf[0]!==jm)throw new Error("Invalid key")}toString(t="utf8"){return Cr(this._buf,t)}uint8Array(){return this._buf}get[Symbol.toStringTag](){return`Key(${this.toString()})`}static withNamespaces(t){return new qm(t.join($m))}static random(){return new qm(Math.random().toString().substring(2))}static asKey(t){return t instanceof Uint8Array||"string"==typeof t?new qm(t):"function"==typeof t.uint8Array?new qm(t.uint8Array()):null}clean(){if(null!=this._buf&&0!==this._buf.byteLength||(this._buf=zm),this._buf[0]!==jm){const t=new Uint8Array(this._buf.byteLength+1);t.fill(jm,0,1),t.set(this._buf,1),this._buf=t}for(;this._buf.byteLength>1&&this._buf[this._buf.byteLength-1]===jm;)this._buf=this._buf.subarray(0,-1)}less(t){const e=this.list(),n=t.list();for(let t=0;t