@libp2p/tcp 7.0.1 → 7.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1,7 +1,7 @@
1
1
  (function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PTcp = factory()}(typeof self !== 'undefined' ? self : this, function () {
2
- "use strict";var Libp2PTcp=(()=>{var Ni=Object.create;var Ce=Object.defineProperty;var Li=Object.getOwnPropertyDescriptor;var Ui=Object.getOwnPropertyNames;var $i=Object.getPrototypeOf,ji=Object.prototype.hasOwnProperty;var yt=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var N=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),nt=(r,t)=>{for(var e in t)Ce(r,e,{get:t[e],enumerable:!0})},wn=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ui(t))!ji.call(r,i)&&i!==e&&Ce(r,i,{get:()=>t[i],enumerable:!(n=Li(t,i))||n.enumerable});return r};var V=(r,t,e)=>(e=r!=null?Ni($i(r)):{},wn(t||!r||!r.__esModule?Ce(e,"default",{value:r,enumerable:!0}):e,r)),Vi=r=>wn(Ce({},"__esModule",{value:!0}),r);var Vn=N((Df,jn)=>{jn.exports=Rr;var $n=128,tc=127,ec=~tc,rc=Math.pow(2,31);function Rr(r,t,e){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw Rr.bytes=0,new RangeError("Could not encode varint");t=t||[],e=e||0;for(var n=e;r>=rc;)t[e++]=r&255|$n,r/=128;for(;r&ec;)t[e++]=r&255|$n,r>>>=7;return t[e]=r|0,Rr.bytes=e-n+1,t}});var Gn=N((Pf,qn)=>{qn.exports=Mr;var nc=128,zn=127;function Mr(r,n){var e=0,n=n||0,i=0,u=n,f,d=r.length;do{if(u>=d||i>49)throw Mr.bytes=0,new RangeError("Could not decode varint");f=r[u++],e+=i<28?(f&zn)<<i:(f&zn)*Math.pow(2,i),i+=7}while(f>=nc);return Mr.bytes=u-n,e}});var Wn=N((kf,Hn)=>{var sc=Math.pow(2,7),oc=Math.pow(2,14),ic=Math.pow(2,21),ac=Math.pow(2,28),cc=Math.pow(2,35),uc=Math.pow(2,42),fc=Math.pow(2,49),lc=Math.pow(2,56),pc=Math.pow(2,63);Hn.exports=function(r){return r<sc?1:r<oc?2:r<ic?3:r<ac?4:r<cc?5:r<uc?6:r<fc?7:r<lc?8:r<pc?9:10}});var De=N((_f,Zn)=>{Zn.exports={encode:Vn(),decode:Gn(),encodingLength:Wn()}});var ys=N((op,ws)=>{var te=1e3,ee=te*60,re=ee*60,Ut=re*24,zc=Ut*7,qc=Ut*365.25;ws.exports=function(r,t){t=t||{};var e=typeof r;if(e==="string"&&r.length>0)return Gc(r);if(e==="number"&&isFinite(r))return t.long?Wc(r):Hc(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function Gc(r){if(r=String(r),!(r.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(t){var e=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return e*qc;case"weeks":case"week":case"w":return e*zc;case"days":case"day":case"d":return e*Ut;case"hours":case"hour":case"hrs":case"hr":case"h":return e*re;case"minutes":case"minute":case"mins":case"min":case"m":return e*ee;case"seconds":case"second":case"secs":case"sec":case"s":return e*te;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return e;default:return}}}}function Hc(r){var t=Math.abs(r);return t>=Ut?Math.round(r/Ut)+"d":t>=re?Math.round(r/re)+"h":t>=ee?Math.round(r/ee)+"m":t>=te?Math.round(r/te)+"s":r+"ms"}function Wc(r){var t=Math.abs(r);return t>=Ut?Le(r,t,Ut,"day"):t>=re?Le(r,t,re,"hour"):t>=ee?Le(r,t,ee,"minute"):t>=te?Le(r,t,te,"second"):r+" ms"}function Le(r,t,e,n){var i=t>=e*1.5;return Math.round(r/e)+" "+n+(i?"s":"")}});var Vr=N((ip,vs)=>{function Zc(r){e.debug=e,e.default=e,e.coerce=g,e.disable=u,e.enable=i,e.enabled=f,e.humanize=ys(),e.destroy=A,Object.keys(r).forEach(l=>{e[l]=r[l]}),e.names=[],e.skips=[],e.formatters={};function t(l){let w=0;for(let x=0;x<l.length;x++)w=(w<<5)-w+l.charCodeAt(x),w|=0;return e.colors[Math.abs(w)%e.colors.length]}e.selectColor=t;function e(l){let w,x=null,S,m;function E(...B){if(!E.enabled)return;let C=E,I=Number(new Date),O=I-(w||I);C.diff=O,C.prev=w,C.curr=I,w=I,B[0]=e.coerce(B[0]),typeof B[0]!="string"&&B.unshift("%O");let F=0;B[0]=B[0].replace(/%([a-zA-Z%])/g,(J,Z)=>{if(J==="%%")return"%";F++;let Y=e.formatters[Z];if(typeof Y=="function"){let ut=B[F];J=Y.call(C,ut),B.splice(F,1),F--}return J}),e.formatArgs.call(C,B),(C.log||e.log).apply(C,B)}return E.namespace=l,E.useColors=e.useColors(),E.color=e.selectColor(l),E.extend=n,E.destroy=e.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>x!==null?x:(S!==e.namespaces&&(S=e.namespaces,m=e.enabled(l)),m),set:B=>{x=B}}),typeof e.init=="function"&&e.init(E),E}function n(l,w){let x=e(this.namespace+(typeof w>"u"?":":w)+l);return x.log=this.log,x}function i(l){e.save(l),e.namespaces=l,e.names=[],e.skips=[];let w,x=(typeof l=="string"?l:"").split(/[\s,]+/),S=x.length;for(w=0;w<S;w++)x[w]&&(l=x[w].replace(/\*/g,".*?"),l[0]==="-"?e.skips.push(new RegExp("^"+l.slice(1)+"$")):e.names.push(new RegExp("^"+l+"$")))}function u(){let l=[...e.names.map(d),...e.skips.map(d).map(w=>"-"+w)].join(",");return e.enable(""),l}function f(l){if(l[l.length-1]==="*")return!0;let w,x;for(w=0,x=e.skips.length;w<x;w++)if(e.skips[w].test(l))return!1;for(w=0,x=e.names.length;w<x;w++)if(e.names[w].test(l))return!0;return!1}function d(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function g(l){return l instanceof Error?l.stack||l.message:l}function A(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return e.enable(e.load()),e}vs.exports=Zc});var xs=N((st,Ue)=>{st.formatArgs=Jc;st.save=Yc;st.load=Qc;st.useColors=Xc;st.storage=Kc();st.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();st.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Xc(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Jc(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+Ue.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;r.splice(1,0,t,"color: inherit");let e=0,n=0;r[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(e++,i==="%c"&&(n=e))}),r.splice(n,0,t)}st.log=console.debug||console.log||(()=>{});function Yc(r){try{r?st.storage.setItem("debug",r):st.storage.removeItem("debug")}catch{}}function Qc(){let r;try{r=st.storage.getItem("debug")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function Kc(){try{return localStorage}catch{}}Ue.exports=Vr()(st);var{formatters:tu}=Ue.exports;tu.j=function(r){try{return JSON.stringify(r)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Ts=N((ap,Ss)=>{"use strict";Ss.exports=(r,t)=>{t=t||process.argv;let e=r.startsWith("-")?"":r.length===1?"-":"--",n=t.indexOf(e+r),i=t.indexOf("--");return n!==-1&&(i===-1?!0:n<i)}});var Cs=N((cp,Es)=>{"use strict";var eu=yt("os"),dt=Ts(),q=process.env,ne;dt("no-color")||dt("no-colors")||dt("color=false")?ne=!1:(dt("color")||dt("colors")||dt("color=true")||dt("color=always"))&&(ne=!0);"FORCE_COLOR"in q&&(ne=q.FORCE_COLOR.length===0||parseInt(q.FORCE_COLOR,10)!==0);function ru(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function nu(r){if(ne===!1)return 0;if(dt("color=16m")||dt("color=full")||dt("color=truecolor"))return 3;if(dt("color=256"))return 2;if(r&&!r.isTTY&&ne!==!0)return 0;let t=ne?1:0;if(process.platform==="win32"){let e=eu.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in q)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in q)||q.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in q)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(q.TEAMCITY_VERSION)?1:0;if(q.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in q){let e=parseInt((q.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(q.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(q.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(q.TERM)||"COLORTERM"in q?1:(q.TERM==="dumb",t)}function zr(r){let t=nu(r);return ru(t)}Es.exports={supportsColor:zr,stdout:zr(process.stdout),stderr:zr(process.stderr)}});var Is=N((j,je)=>{var su=yt("tty"),$e=yt("util");j.init=lu;j.log=cu;j.formatArgs=iu;j.save=uu;j.load=fu;j.useColors=ou;j.destroy=$e.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");j.colors=[6,2,3,4,5,1];try{let r=Cs();r&&(r.stderr||r).level>=2&&(j.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}j.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,t)=>{let e=t.substring(6).toLowerCase().replace(/_([a-z])/g,(i,u)=>u.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),r[e]=n,r},{});function ou(){return"colors"in j.inspectOpts?!!j.inspectOpts.colors:su.isatty(process.stderr.fd)}function iu(r){let{namespace:t,useColors:e}=this;if(e){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),u=` ${i};1m${t} \x1B[0m`;r[0]=u+r[0].split(`
2
+ "use strict";var Libp2PTcp=(()=>{var ki=Object.create;var ie=Object.defineProperty;var Pi=Object.getOwnPropertyDescriptor;var Oi=Object.getOwnPropertyNames;var _i=Object.getPrototypeOf,Fi=Object.prototype.hasOwnProperty;var Ni=(r,t,e)=>t in r?ie(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var yt=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var L=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),nt=(r,t)=>{for(var e in t)ie(r,e,{get:t[e],enumerable:!0})},dn=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Oi(t))!Fi.call(r,i)&&i!==e&&ie(r,i,{get:()=>t[i],enumerable:!(n=Pi(t,i))||n.enumerable});return r};var j=(r,t,e)=>(e=r!=null?ki(_i(r)):{},dn(t||!r||!r.__esModule?ie(e,"default",{value:r,enumerable:!0}):e,r)),Li=r=>dn(ie({},"__esModule",{value:!0}),r);var Ye=(r,t,e)=>(Ni(r,typeof t!="symbol"?t+"":t,e),e);var Nn=L((Ef,Fn)=>{Fn.exports=xr;var _n=128,Ha=127,Za=~Ha,Wa=Math.pow(2,31);function xr(r,t,e){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw xr.bytes=0,new RangeError("Could not encode varint");t=t||[],e=e||0;for(var n=e;r>=Wa;)t[e++]=r&255|_n,r/=128;for(;r&Za;)t[e++]=r&255|_n,r>>>=7;return t[e]=r|0,xr.bytes=e-n+1,t}});var $n=L((Af,Un)=>{Un.exports=Sr;var Xa=128,Ln=127;function Sr(r,n){var e=0,n=n||0,i=0,u=n,f,d=r.length;do{if(u>=d||i>49)throw Sr.bytes=0,new RangeError("Could not decode varint");f=r[u++],e+=i<28?(f&Ln)<<i:(f&Ln)*Math.pow(2,i),i+=7}while(f>=Xa);return Sr.bytes=u-n,e}});var jn=L((If,Vn)=>{var Ja=Math.pow(2,7),Ya=Math.pow(2,14),Qa=Math.pow(2,21),Ka=Math.pow(2,28),tc=Math.pow(2,35),ec=Math.pow(2,42),rc=Math.pow(2,49),nc=Math.pow(2,56),sc=Math.pow(2,63);Vn.exports=function(r){return r<Ja?1:r<Ya?2:r<Qa?3:r<Ka?4:r<tc?5:r<ec?6:r<rc?7:r<nc?8:r<sc?9:10}});var xe=L((Bf,zn)=>{zn.exports={encode:Nn(),decode:$n(),encodingLength:jn()}});var ds=L((rp,hs)=>{var Xt=1e3,Jt=Xt*60,Yt=Jt*60,Lt=Yt*24,Uc=Lt*7,$c=Lt*365.25;hs.exports=function(r,t){t=t||{};var e=typeof r;if(e==="string"&&r.length>0)return Vc(r);if(e==="number"&&isFinite(r))return t.long?zc(r):jc(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function Vc(r){if(r=String(r),!(r.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(t){var e=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return e*$c;case"weeks":case"week":case"w":return e*Uc;case"days":case"day":case"d":return e*Lt;case"hours":case"hour":case"hrs":case"hr":case"h":return e*Yt;case"minutes":case"minute":case"mins":case"min":case"m":return e*Jt;case"seconds":case"second":case"secs":case"sec":case"s":return e*Xt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return e;default:return}}}}function jc(r){var t=Math.abs(r);return t>=Lt?Math.round(r/Lt)+"d":t>=Yt?Math.round(r/Yt)+"h":t>=Jt?Math.round(r/Jt)+"m":t>=Xt?Math.round(r/Xt)+"s":r+"ms"}function zc(r){var t=Math.abs(r);return t>=Lt?De(r,t,Lt,"day"):t>=Yt?De(r,t,Yt,"hour"):t>=Jt?De(r,t,Jt,"minute"):t>=Xt?De(r,t,Xt,"second"):r+" ms"}function De(r,t,e,n){var i=t>=e*1.5;return Math.round(r/e)+" "+n+(i?"s":"")}});var Lr=L((np,ms)=>{function qc(r){e.debug=e,e.default=e,e.coerce=g,e.disable=u,e.enable=i,e.enabled=f,e.humanize=ds(),e.destroy=A,Object.keys(r).forEach(l=>{e[l]=r[l]}),e.names=[],e.skips=[],e.formatters={};function t(l){let y=0;for(let x=0;x<l.length;x++)y=(y<<5)-y+l.charCodeAt(x),y|=0;return e.colors[Math.abs(y)%e.colors.length]}e.selectColor=t;function e(l){let y,x=null,S,m;function C(...B){if(!C.enabled)return;let E=C,I=Number(new Date),_=I-(y||I);E.diff=_,E.prev=y,E.curr=I,y=I,B[0]=e.coerce(B[0]),typeof B[0]!="string"&&B.unshift("%O");let N=0;B[0]=B[0].replace(/%([a-zA-Z%])/g,(J,W)=>{if(J==="%%")return"%";N++;let Y=e.formatters[W];if(typeof Y=="function"){let ut=B[N];J=Y.call(E,ut),B.splice(N,1),N--}return J}),e.formatArgs.call(E,B),(E.log||e.log).apply(E,B)}return C.namespace=l,C.useColors=e.useColors(),C.color=e.selectColor(l),C.extend=n,C.destroy=e.destroy,Object.defineProperty(C,"enabled",{enumerable:!0,configurable:!1,get:()=>x!==null?x:(S!==e.namespaces&&(S=e.namespaces,m=e.enabled(l)),m),set:B=>{x=B}}),typeof e.init=="function"&&e.init(C),C}function n(l,y){let x=e(this.namespace+(typeof y>"u"?":":y)+l);return x.log=this.log,x}function i(l){e.save(l),e.namespaces=l,e.names=[],e.skips=[];let y,x=(typeof l=="string"?l:"").split(/[\s,]+/),S=x.length;for(y=0;y<S;y++)x[y]&&(l=x[y].replace(/\*/g,".*?"),l[0]==="-"?e.skips.push(new RegExp("^"+l.slice(1)+"$")):e.names.push(new RegExp("^"+l+"$")))}function u(){let l=[...e.names.map(d),...e.skips.map(d).map(y=>"-"+y)].join(",");return e.enable(""),l}function f(l){if(l[l.length-1]==="*")return!0;let y,x;for(y=0,x=e.skips.length;y<x;y++)if(e.skips[y].test(l))return!1;for(y=0,x=e.names.length;y<x;y++)if(e.names[y].test(l))return!0;return!1}function d(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function g(l){return l instanceof Error?l.stack||l.message:l}function A(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return e.enable(e.load()),e}ms.exports=qc});var gs=L((st,ke)=>{st.formatArgs=Hc;st.save=Zc;st.load=Wc;st.useColors=Gc;st.storage=Xc();st.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();st.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Gc(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Hc(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+ke.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;r.splice(1,0,t,"color: inherit");let e=0,n=0;r[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(e++,i==="%c"&&(n=e))}),r.splice(n,0,t)}st.log=console.debug||console.log||(()=>{});function Zc(r){try{r?st.storage.setItem("debug",r):st.storage.removeItem("debug")}catch{}}function Wc(){let r;try{r=st.storage.getItem("debug")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function Xc(){try{return localStorage}catch{}}ke.exports=Lr()(st);var{formatters:Jc}=ke.exports;Jc.j=function(r){try{return JSON.stringify(r)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var ws=L((sp,bs)=>{"use strict";bs.exports=(r,t)=>{t=t||process.argv;let e=r.startsWith("-")?"":r.length===1?"-":"--",n=t.indexOf(e+r),i=t.indexOf("--");return n!==-1&&(i===-1?!0:n<i)}});var vs=L((op,ys)=>{"use strict";var Yc=yt("os"),dt=ws(),q=process.env,Qt;dt("no-color")||dt("no-colors")||dt("color=false")?Qt=!1:(dt("color")||dt("colors")||dt("color=true")||dt("color=always"))&&(Qt=!0);"FORCE_COLOR"in q&&(Qt=q.FORCE_COLOR.length===0||parseInt(q.FORCE_COLOR,10)!==0);function Qc(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function Kc(r){if(Qt===!1)return 0;if(dt("color=16m")||dt("color=full")||dt("color=truecolor"))return 3;if(dt("color=256"))return 2;if(r&&!r.isTTY&&Qt!==!0)return 0;let t=Qt?1:0;if(process.platform==="win32"){let e=Yc.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in q)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in q)||q.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in q)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(q.TEAMCITY_VERSION)?1:0;if(q.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in q){let e=parseInt((q.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(q.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(q.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(q.TERM)||"COLORTERM"in q?1:(q.TERM==="dumb",t)}function Ur(r){let t=Kc(r);return Qc(t)}ys.exports={supportsColor:Ur,stdout:Ur(process.stdout),stderr:Ur(process.stderr)}});var Ss=L((V,Oe)=>{var tu=yt("tty"),Pe=yt("util");V.init=au;V.log=su;V.formatArgs=ru;V.save=ou;V.load=iu;V.useColors=eu;V.destroy=Pe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");V.colors=[6,2,3,4,5,1];try{let r=vs();r&&(r.stderr||r).level>=2&&(V.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}V.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,t)=>{let e=t.substring(6).toLowerCase().replace(/_([a-z])/g,(i,u)=>u.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),r[e]=n,r},{});function eu(){return"colors"in V.inspectOpts?!!V.inspectOpts.colors:tu.isatty(process.stderr.fd)}function ru(r){let{namespace:t,useColors:e}=this;if(e){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),u=` ${i};1m${t} \x1B[0m`;r[0]=u+r[0].split(`
3
3
  `).join(`
4
- `+u),r.push(i+"m+"+je.exports.humanize(this.diff)+"\x1B[0m")}else r[0]=au()+t+" "+r[0]}function au(){return j.inspectOpts.hideDate?"":new Date().toISOString()+" "}function cu(...r){return process.stderr.write($e.format(...r)+`
5
- `)}function uu(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function fu(){return process.env.DEBUG}function lu(r){r.inspectOpts={};let t=Object.keys(j.inspectOpts);for(let e=0;e<t.length;e++)r.inspectOpts[t[e]]=j.inspectOpts[t[e]]}je.exports=Vr()(j);var{formatters:As}=je.exports;As.o=function(r){return this.inspectOpts.colors=this.useColors,$e.inspect(r,this.inspectOpts).split(`
6
- `).map(t=>t.trim()).join(" ")};As.O=function(r){return this.inspectOpts.colors=this.useColors,$e.inspect(r,this.inspectOpts)}});var Bs=N((up,qr)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?qr.exports=xs():qr.exports=Is()});var Ve=N((dp,Rs)=>{Rs.exports=r=>{if(r[Symbol.asyncIterator])return r;if(r.getReader)return async function*(){let t=r.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)return;yield n}}finally{t.releaseLock()}}();throw new Error("unknown stream")}});var Ds=N((mp,Ms)=>{Ms.exports=function(t){if(t){if(typeof t[Symbol.iterator]=="function")return t[Symbol.iterator]();if(typeof t[Symbol.asyncIterator]=="function")return t[Symbol.asyncIterator]();if(typeof t.next=="function")return t}throw new Error("argument is not an iterator or iterable")}});var Gr=N((gp,Ps)=>{var hu=Ds();Ps.exports=r=>async t=>{t=hu(t);let e=C=>{typeof C.return=="function"&&C.return()},n=null,i=null,u=C=>{n=C,i&&i(C),e(t)},f=null,d=!1,g=()=>{d=!0,f&&f()},A=null,l=!1,w=()=>{l=!0,A&&A()},x=null,S=()=>{x&&x()},m=()=>new Promise((C,I)=>{f=x=C,i=I,r.once("drain",S)}),E=()=>(e(t),new Promise((C,I)=>{if(d||l||n)return C();A=f=C,i=I})),B=()=>{r.removeListener("error",u),r.removeListener("close",g),r.removeListener("finish",w),r.removeListener("drain",S)};r.once("error",u),r.once("close",g),r.once("finish",w);try{for await(let C of t){if(!r.writable||r.destroyed||n)break;r.write(C)===!1&&await m()}}catch(C){n||r.destroy(),n=C}try{if(r.writable&&r.end(),await E(),n)throw n}finally{B()}}});var Hr=N((bp,ks)=>{var du=Gr(),mu=Ve();ks.exports=r=>({sink:du(r),source:mu(r)})});var Os=N((wp,_s)=>{var gu=Hr();_s.exports=r=>async function*(t){let e=gu(r),n;if(e.sink(t).catch(i=>{n=i}),yield*e.source,n)throw n}});var Fs=N((yp,se)=>{se.exports=Ve();se.exports.source=Ve();se.exports.sink=Gr();se.exports.transform=Os();se.exports.duplex=Hr()});var Zr=N((Ge,Us)=>{(function(){var r,t=0xdeadbeefcafe,e=(t&16777215)==15715070;function n(s,o,a){s!=null&&(typeof s=="number"?this.fromNumber(s,o,a):o==null&&typeof s!="string"?this.fromString(s,256):this.fromString(s,o))}function i(){return new n(null)}function u(s,o,a,c,p,h){for(;--h>=0;){var b=o*this[s++]+a[c]+p;p=Math.floor(b/67108864),a[c++]=b&67108863}return p}function f(s,o,a,c,p,h){for(var b=o&32767,y=o>>15;--h>=0;){var M=this[s]&32767,$=this[s++]>>15,it=y*M+$*b;M=b*M+((it&32767)<<15)+a[c]+(p&1073741823),p=(M>>>30)+(it>>>15)+y*$+(p>>>30),a[c++]=M&1073741823}return p}function d(s,o,a,c,p,h){for(var b=o&16383,y=o>>14;--h>=0;){var M=this[s]&16383,$=this[s++]>>14,it=y*M+$*b;M=b*M+((it&16383)<<14)+a[c]+p,p=(M>>28)+(it>>14)+y*$,a[c++]=M&268435455}return p}var g=typeof navigator<"u";g&&e&&navigator.appName=="Microsoft Internet Explorer"?(n.prototype.am=f,r=30):g&&e&&navigator.appName!="Netscape"?(n.prototype.am=u,r=26):(n.prototype.am=d,r=28),n.prototype.DB=r,n.prototype.DM=(1<<r)-1,n.prototype.DV=1<<r;var A=52;n.prototype.FV=Math.pow(2,A),n.prototype.F1=A-r,n.prototype.F2=2*r-A;var l="0123456789abcdefghijklmnopqrstuvwxyz",w=new Array,x,S;for(x="0".charCodeAt(0),S=0;S<=9;++S)w[x++]=S;for(x="a".charCodeAt(0),S=10;S<36;++S)w[x++]=S;for(x="A".charCodeAt(0),S=10;S<36;++S)w[x++]=S;function m(s){return l.charAt(s)}function E(s,o){var a=w[s.charCodeAt(o)];return a??-1}function B(s){for(var o=this.t-1;o>=0;--o)s[o]=this[o];s.t=this.t,s.s=this.s}function C(s){this.t=1,this.s=s<0?-1:0,s>0?this[0]=s:s<-1?this[0]=s+this.DV:this.t=0}function I(s){var o=i();return o.fromInt(s),o}function O(s,o){var a;if(o==16)a=4;else if(o==8)a=3;else if(o==256)a=8;else if(o==2)a=1;else if(o==32)a=5;else if(o==4)a=2;else{this.fromRadix(s,o);return}this.t=0,this.s=0;for(var c=s.length,p=!1,h=0;--c>=0;){var b=a==8?s[c]&255:E(s,c);if(b<0){s.charAt(c)=="-"&&(p=!0);continue}p=!1,h==0?this[this.t++]=b:h+a>this.DB?(this[this.t-1]|=(b&(1<<this.DB-h)-1)<<h,this[this.t++]=b>>this.DB-h):this[this.t-1]|=b<<h,h+=a,h>=this.DB&&(h-=this.DB)}a==8&&s[0]&128&&(this.s=-1,h>0&&(this[this.t-1]|=(1<<this.DB-h)-1<<h)),this.clamp(),p&&n.ZERO.subTo(this,this)}function F(){for(var s=this.s&this.DM;this.t>0&&this[this.t-1]==s;)--this.t}function tt(s){if(this.s<0)return"-"+this.negate().toString(s);var o;if(s==16)o=4;else if(s==8)o=3;else if(s==2)o=1;else if(s==32)o=5;else if(s==4)o=2;else return this.toRadix(s);var a=(1<<o)-1,c,p=!1,h="",b=this.t,y=this.DB-b*this.DB%o;if(b-- >0)for(y<this.DB&&(c=this[b]>>y)>0&&(p=!0,h=m(c));b>=0;)y<o?(c=(this[b]&(1<<y)-1)<<o-y,c|=this[--b]>>(y+=this.DB-o)):(c=this[b]>>(y-=o)&a,y<=0&&(y+=this.DB,--b)),c>0&&(p=!0),p&&(h+=m(c));return p?h:"0"}function J(){var s=i();return n.ZERO.subTo(this,s),s}function Z(){return this.s<0?this.negate():this}function Y(s){var o=this.s-s.s;if(o!=0)return o;var a=this.t;if(o=a-s.t,o!=0)return this.s<0?-o:o;for(;--a>=0;)if((o=this[a]-s[a])!=0)return o;return 0}function ut(s){var o=1,a;return(a=s>>>16)!=0&&(s=a,o+=16),(a=s>>8)!=0&&(s=a,o+=8),(a=s>>4)!=0&&(s=a,o+=4),(a=s>>2)!=0&&(s=a,o+=2),(a=s>>1)!=0&&(s=a,o+=1),o}function ro(){return this.t<=0?0:this.DB*(this.t-1)+ut(this[this.t-1]^this.s&this.DM)}function no(s,o){var a;for(a=this.t-1;a>=0;--a)o[a+s]=this[a];for(a=s-1;a>=0;--a)o[a]=0;o.t=this.t+s,o.s=this.s}function so(s,o){for(var a=s;a<this.t;++a)o[a-s]=this[a];o.t=Math.max(this.t-s,0),o.s=this.s}function oo(s,o){var a=s%this.DB,c=this.DB-a,p=(1<<c)-1,h=Math.floor(s/this.DB),b=this.s<<a&this.DM,y;for(y=this.t-1;y>=0;--y)o[y+h+1]=this[y]>>c|b,b=(this[y]&p)<<a;for(y=h-1;y>=0;--y)o[y]=0;o[h]=b,o.t=this.t+h+1,o.s=this.s,o.clamp()}function io(s,o){o.s=this.s;var a=Math.floor(s/this.DB);if(a>=this.t){o.t=0;return}var c=s%this.DB,p=this.DB-c,h=(1<<c)-1;o[0]=this[a]>>c;for(var b=a+1;b<this.t;++b)o[b-a-1]|=(this[b]&h)<<p,o[b-a]=this[b]>>c;c>0&&(o[this.t-a-1]|=(this.s&h)<<p),o.t=this.t-a,o.clamp()}function ao(s,o){for(var a=0,c=0,p=Math.min(s.t,this.t);a<p;)c+=this[a]-s[a],o[a++]=c&this.DM,c>>=this.DB;if(s.t<this.t){for(c-=s.s;a<this.t;)c+=this[a],o[a++]=c&this.DM,c>>=this.DB;c+=this.s}else{for(c+=this.s;a<s.t;)c-=s[a],o[a++]=c&this.DM,c>>=this.DB;c-=s.s}o.s=c<0?-1:0,c<-1?o[a++]=this.DV+c:c>0&&(o[a++]=c),o.t=a,o.clamp()}function co(s,o){var a=this.abs(),c=s.abs(),p=a.t;for(o.t=p+c.t;--p>=0;)o[p]=0;for(p=0;p<c.t;++p)o[p+a.t]=a.am(0,c[p],o,p,0,a.t);o.s=0,o.clamp(),this.s!=s.s&&n.ZERO.subTo(o,o)}function uo(s){for(var o=this.abs(),a=s.t=2*o.t;--a>=0;)s[a]=0;for(a=0;a<o.t-1;++a){var c=o.am(a,o[a],s,2*a,0,1);(s[a+o.t]+=o.am(a+1,2*o[a],s,2*a+1,c,o.t-a-1))>=o.DV&&(s[a+o.t]-=o.DV,s[a+o.t+1]=1)}s.t>0&&(s[s.t-1]+=o.am(a,o[a],s,2*a,0,1)),s.s=0,s.clamp()}function fo(s,o,a){var c=s.abs();if(!(c.t<=0)){var p=this.abs();if(p.t<c.t){o?.fromInt(0),a!=null&&this.copyTo(a);return}a==null&&(a=i());var h=i(),b=this.s,y=s.s,M=this.DB-ut(c[c.t-1]);M>0?(c.lShiftTo(M,h),p.lShiftTo(M,a)):(c.copyTo(h),p.copyTo(a));var $=h.t,it=h[$-1];if(it!=0){var rt=it*(1<<this.F1)+($>1?h[$-2]>>this.F2:0),wt=this.FV/rt,Te=(1<<this.F1)/rt,lt=1<<this.F2,pt=a.t,Ee=pt-$,It=o??i();for(h.dlShiftTo(Ee,It),a.compareTo(It)>=0&&(a[a.t++]=1,a.subTo(It,a)),n.ONE.dlShiftTo($,It),It.subTo(h,h);h.t<$;)h[h.t++]=0;for(;--Ee>=0;){var nr=a[--pt]==it?this.DM:Math.floor(a[pt]*wt+(a[pt-1]+lt)*Te);if((a[pt]+=h.am(0,nr,a,Ee,0,$))<nr)for(h.dlShiftTo(Ee,It),a.subTo(It,a);a[pt]<--nr;)a.subTo(It,a)}o!=null&&(a.drShiftTo($,o),b!=y&&n.ZERO.subTo(o,o)),a.t=$,a.clamp(),M>0&&a.rShiftTo(M,a),b<0&&n.ZERO.subTo(a,a)}}}function lo(s){var o=i();return this.abs().divRemTo(s,null,o),this.s<0&&o.compareTo(n.ZERO)>0&&s.subTo(o,o),o}function _t(s){this.m=s}function po(s){return s.s<0||s.compareTo(this.m)>=0?s.mod(this.m):s}function ho(s){return s}function mo(s){s.divRemTo(this.m,null,s)}function go(s,o,a){s.multiplyTo(o,a),this.reduce(a)}function bo(s,o){s.squareTo(o),this.reduce(o)}_t.prototype.convert=po,_t.prototype.revert=ho,_t.prototype.reduce=mo,_t.prototype.mulTo=go,_t.prototype.sqrTo=bo;function wo(){if(this.t<1)return 0;var s=this[0];if(!(s&1))return 0;var o=s&3;return o=o*(2-(s&15)*o)&15,o=o*(2-(s&255)*o)&255,o=o*(2-((s&65535)*o&65535))&65535,o=o*(2-s*o%this.DV)%this.DV,o>0?this.DV-o:-o}function Ot(s){this.m=s,this.mp=s.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<s.DB-15)-1,this.mt2=2*s.t}function yo(s){var o=i();return s.abs().dlShiftTo(this.m.t,o),o.divRemTo(this.m,null,o),s.s<0&&o.compareTo(n.ZERO)>0&&this.m.subTo(o,o),o}function vo(s){var o=i();return s.copyTo(o),this.reduce(o),o}function xo(s){for(;s.t<=this.mt2;)s[s.t++]=0;for(var o=0;o<this.m.t;++o){var a=s[o]&32767,c=a*this.mpl+((a*this.mph+(s[o]>>15)*this.mpl&this.um)<<15)&s.DM;for(a=o+this.m.t,s[a]+=this.m.am(0,c,s,o,0,this.m.t);s[a]>=s.DV;)s[a]-=s.DV,s[++a]++}s.clamp(),s.drShiftTo(this.m.t,s),s.compareTo(this.m)>=0&&s.subTo(this.m,s)}function So(s,o){s.squareTo(o),this.reduce(o)}function To(s,o,a){s.multiplyTo(o,a),this.reduce(a)}Ot.prototype.convert=yo,Ot.prototype.revert=vo,Ot.prototype.reduce=xo,Ot.prototype.mulTo=To,Ot.prototype.sqrTo=So;function Eo(){return(this.t>0?this[0]&1:this.s)==0}function Co(s,o){if(s>4294967295||s<1)return n.ONE;var a=i(),c=i(),p=o.convert(this),h=ut(s)-1;for(p.copyTo(a);--h>=0;)if(o.sqrTo(a,c),(s&1<<h)>0)o.mulTo(c,p,a);else{var b=a;a=c,c=b}return o.revert(a)}function Ao(s,o){var a;return s<256||o.isEven()?a=new _t(o):a=new Ot(o),this.exp(s,a)}n.prototype.copyTo=B,n.prototype.fromInt=C,n.prototype.fromString=O,n.prototype.clamp=F,n.prototype.dlShiftTo=no,n.prototype.drShiftTo=so,n.prototype.lShiftTo=oo,n.prototype.rShiftTo=io,n.prototype.subTo=ao,n.prototype.multiplyTo=co,n.prototype.squareTo=uo,n.prototype.divRemTo=fo,n.prototype.invDigit=wo,n.prototype.isEven=Eo,n.prototype.exp=Co,n.prototype.toString=tt,n.prototype.negate=J,n.prototype.abs=Z,n.prototype.compareTo=Y,n.prototype.bitLength=ro,n.prototype.mod=lo,n.prototype.modPowInt=Ao,n.ZERO=I(0),n.ONE=I(1);function Io(){var s=i();return this.copyTo(s),s}function Bo(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function Ro(){return this.t==0?this.s:this[0]<<24>>24}function Mo(){return this.t==0?this.s:this[0]<<16>>16}function Do(s){return Math.floor(Math.LN2*this.DB/Math.log(s))}function Po(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function ko(s){if(s==null&&(s=10),this.signum()==0||s<2||s>36)return"0";var o=this.chunkSize(s),a=Math.pow(s,o),c=I(a),p=i(),h=i(),b="";for(this.divRemTo(c,p,h);p.signum()>0;)b=(a+h.intValue()).toString(s).substr(1)+b,p.divRemTo(c,p,h);return h.intValue().toString(s)+b}function _o(s,o){this.fromInt(0),o==null&&(o=10);for(var a=this.chunkSize(o),c=Math.pow(o,a),p=!1,h=0,b=0,y=0;y<s.length;++y){var M=E(s,y);if(M<0){s.charAt(y)=="-"&&this.signum()==0&&(p=!0);continue}b=o*b+M,++h>=a&&(this.dMultiply(c),this.dAddOffset(b,0),h=0,b=0)}h>0&&(this.dMultiply(Math.pow(o,h)),this.dAddOffset(b,0)),p&&n.ZERO.subTo(this,this)}function Oo(s,o,a){if(typeof o=="number")if(s<2)this.fromInt(1);else for(this.fromNumber(s,a),this.testBit(s-1)||this.bitwiseTo(n.ONE.shiftLeft(s-1),Ke,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(o);)this.dAddOffset(2,0),this.bitLength()>s&&this.subTo(n.ONE.shiftLeft(s-1),this);else{var c=new Array,p=s&7;c.length=(s>>3)+1,o.nextBytes(c),p>0?c[0]&=(1<<p)-1:c[0]=0,this.fromString(c,256)}}function Fo(){var s=this.t,o=new Array;o[0]=this.s;var a=this.DB-s*this.DB%8,c,p=0;if(s-- >0)for(a<this.DB&&(c=this[s]>>a)!=(this.s&this.DM)>>a&&(o[p++]=c|this.s<<this.DB-a);s>=0;)a<8?(c=(this[s]&(1<<a)-1)<<8-a,c|=this[--s]>>(a+=this.DB-8)):(c=this[s]>>(a-=8)&255,a<=0&&(a+=this.DB,--s)),c&128&&(c|=-256),p==0&&(this.s&128)!=(c&128)&&++p,(p>0||c!=this.s)&&(o[p++]=c);return o}function No(s){return this.compareTo(s)==0}function Lo(s){return this.compareTo(s)<0?this:s}function Uo(s){return this.compareTo(s)>0?this:s}function $o(s,o,a){var c,p,h=Math.min(s.t,this.t);for(c=0;c<h;++c)a[c]=o(this[c],s[c]);if(s.t<this.t){for(p=s.s&this.DM,c=h;c<this.t;++c)a[c]=o(this[c],p);a.t=this.t}else{for(p=this.s&this.DM,c=h;c<s.t;++c)a[c]=o(p,s[c]);a.t=s.t}a.s=o(this.s,s.s),a.clamp()}function jo(s,o){return s&o}function Vo(s){var o=i();return this.bitwiseTo(s,jo,o),o}function Ke(s,o){return s|o}function zo(s){var o=i();return this.bitwiseTo(s,Ke,o),o}function pn(s,o){return s^o}function qo(s){var o=i();return this.bitwiseTo(s,pn,o),o}function hn(s,o){return s&~o}function Go(s){var o=i();return this.bitwiseTo(s,hn,o),o}function Ho(){for(var s=i(),o=0;o<this.t;++o)s[o]=this.DM&~this[o];return s.t=this.t,s.s=~this.s,s}function Wo(s){var o=i();return s<0?this.rShiftTo(-s,o):this.lShiftTo(s,o),o}function Zo(s){var o=i();return s<0?this.lShiftTo(-s,o):this.rShiftTo(s,o),o}function Xo(s){if(s==0)return-1;var o=0;return s&65535||(s>>=16,o+=16),s&255||(s>>=8,o+=8),s&15||(s>>=4,o+=4),s&3||(s>>=2,o+=2),s&1||++o,o}function Jo(){for(var s=0;s<this.t;++s)if(this[s]!=0)return s*this.DB+Xo(this[s]);return this.s<0?this.t*this.DB:-1}function Yo(s){for(var o=0;s!=0;)s&=s-1,++o;return o}function Qo(){for(var s=0,o=this.s&this.DM,a=0;a<this.t;++a)s+=Yo(this[a]^o);return s}function Ko(s){var o=Math.floor(s/this.DB);return o>=this.t?this.s!=0:(this[o]&1<<s%this.DB)!=0}function ti(s,o){var a=n.ONE.shiftLeft(s);return this.bitwiseTo(a,o,a),a}function ei(s){return this.changeBit(s,Ke)}function ri(s){return this.changeBit(s,hn)}function ni(s){return this.changeBit(s,pn)}function si(s,o){for(var a=0,c=0,p=Math.min(s.t,this.t);a<p;)c+=this[a]+s[a],o[a++]=c&this.DM,c>>=this.DB;if(s.t<this.t){for(c+=s.s;a<this.t;)c+=this[a],o[a++]=c&this.DM,c>>=this.DB;c+=this.s}else{for(c+=this.s;a<s.t;)c+=s[a],o[a++]=c&this.DM,c>>=this.DB;c+=s.s}o.s=c<0?-1:0,c>0?o[a++]=c:c<-1&&(o[a++]=this.DV+c),o.t=a,o.clamp()}function oi(s){var o=i();return this.addTo(s,o),o}function ii(s){var o=i();return this.subTo(s,o),o}function ai(s){var o=i();return this.multiplyTo(s,o),o}function ci(){var s=i();return this.squareTo(s),s}function ui(s){var o=i();return this.divRemTo(s,o,null),o}function fi(s){var o=i();return this.divRemTo(s,null,o),o}function li(s){var o=i(),a=i();return this.divRemTo(s,o,a),new Array(o,a)}function pi(s){this[this.t]=this.am(0,s-1,this,0,0,this.t),++this.t,this.clamp()}function hi(s,o){if(s!=0){for(;this.t<=o;)this[this.t++]=0;for(this[o]+=s;this[o]>=this.DV;)this[o]-=this.DV,++o>=this.t&&(this[this.t++]=0),++this[o]}}function fe(){}function dn(s){return s}function di(s,o,a){s.multiplyTo(o,a)}function mi(s,o){s.squareTo(o)}fe.prototype.convert=dn,fe.prototype.revert=dn,fe.prototype.mulTo=di,fe.prototype.sqrTo=mi;function gi(s){return this.exp(s,new fe)}function bi(s,o,a){var c=Math.min(this.t+s.t,o);for(a.s=0,a.t=c;c>0;)a[--c]=0;var p;for(p=a.t-this.t;c<p;++c)a[c+this.t]=this.am(0,s[c],a,c,0,this.t);for(p=Math.min(s.t,o);c<p;++c)this.am(0,s[c],a,c,0,o-c);a.clamp()}function wi(s,o,a){--o;var c=a.t=this.t+s.t-o;for(a.s=0;--c>=0;)a[c]=0;for(c=Math.max(o-this.t,0);c<s.t;++c)a[this.t+c-o]=this.am(o-c,s[c],a,0,0,this.t+c-o);a.clamp(),a.drShiftTo(1,a)}function Ft(s){this.r2=i(),this.q3=i(),n.ONE.dlShiftTo(2*s.t,this.r2),this.mu=this.r2.divide(s),this.m=s}function yi(s){if(s.s<0||s.t>2*this.m.t)return s.mod(this.m);if(s.compareTo(this.m)<0)return s;var o=i();return s.copyTo(o),this.reduce(o),o}function vi(s){return s}function xi(s){for(s.drShiftTo(this.m.t-1,this.r2),s.t>this.m.t+1&&(s.t=this.m.t+1,s.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);s.compareTo(this.r2)<0;)s.dAddOffset(1,this.m.t+1);for(s.subTo(this.r2,s);s.compareTo(this.m)>=0;)s.subTo(this.m,s)}function Si(s,o){s.squareTo(o),this.reduce(o)}function Ti(s,o,a){s.multiplyTo(o,a),this.reduce(a)}Ft.prototype.convert=yi,Ft.prototype.revert=vi,Ft.prototype.reduce=xi,Ft.prototype.mulTo=Ti,Ft.prototype.sqrTo=Si;function Ei(s,o){var a=s.bitLength(),c,p=I(1),h;if(a<=0)return p;a<18?c=1:a<48?c=3:a<144?c=4:a<768?c=5:c=6,a<8?h=new _t(o):o.isEven()?h=new Ft(o):h=new Ot(o);var b=new Array,y=3,M=c-1,$=(1<<c)-1;if(b[1]=h.convert(this),c>1){var it=i();for(h.sqrTo(b[1],it);y<=$;)b[y]=i(),h.mulTo(it,b[y-2],b[y]),y+=2}var rt=s.t-1,wt,Te=!0,lt=i(),pt;for(a=ut(s[rt])-1;rt>=0;){for(a>=M?wt=s[rt]>>a-M&$:(wt=(s[rt]&(1<<a+1)-1)<<M-a,rt>0&&(wt|=s[rt-1]>>this.DB+a-M)),y=c;!(wt&1);)wt>>=1,--y;if((a-=y)<0&&(a+=this.DB,--rt),Te)b[wt].copyTo(p),Te=!1;else{for(;y>1;)h.sqrTo(p,lt),h.sqrTo(lt,p),y-=2;y>0?h.sqrTo(p,lt):(pt=p,p=lt,lt=pt),h.mulTo(lt,b[wt],p)}for(;rt>=0&&!(s[rt]&1<<a);)h.sqrTo(p,lt),pt=p,p=lt,lt=pt,--a<0&&(a=this.DB-1,--rt)}return h.revert(p)}function Ci(s){var o=this.s<0?this.negate():this.clone(),a=s.s<0?s.negate():s.clone();if(o.compareTo(a)<0){var c=o;o=a,a=c}var p=o.getLowestSetBit(),h=a.getLowestSetBit();if(h<0)return o;for(p<h&&(h=p),h>0&&(o.rShiftTo(h,o),a.rShiftTo(h,a));o.signum()>0;)(p=o.getLowestSetBit())>0&&o.rShiftTo(p,o),(p=a.getLowestSetBit())>0&&a.rShiftTo(p,a),o.compareTo(a)>=0?(o.subTo(a,o),o.rShiftTo(1,o)):(a.subTo(o,a),a.rShiftTo(1,a));return h>0&&a.lShiftTo(h,a),a}function Ai(s){if(s<=0)return 0;var o=this.DV%s,a=this.s<0?s-1:0;if(this.t>0)if(o==0)a=this[0]%s;else for(var c=this.t-1;c>=0;--c)a=(o*a+this[c])%s;return a}function Ii(s){var o=s.isEven();if(this.isEven()&&o||s.signum()==0)return n.ZERO;for(var a=s.clone(),c=this.clone(),p=I(1),h=I(0),b=I(0),y=I(1);a.signum()!=0;){for(;a.isEven();)a.rShiftTo(1,a),o?((!p.isEven()||!h.isEven())&&(p.addTo(this,p),h.subTo(s,h)),p.rShiftTo(1,p)):h.isEven()||h.subTo(s,h),h.rShiftTo(1,h);for(;c.isEven();)c.rShiftTo(1,c),o?((!b.isEven()||!y.isEven())&&(b.addTo(this,b),y.subTo(s,y)),b.rShiftTo(1,b)):y.isEven()||y.subTo(s,y),y.rShiftTo(1,y);a.compareTo(c)>=0?(a.subTo(c,a),o&&p.subTo(b,p),h.subTo(y,h)):(c.subTo(a,c),o&&b.subTo(p,b),y.subTo(h,y))}if(c.compareTo(n.ONE)!=0)return n.ZERO;if(y.compareTo(s)>=0)return y.subtract(s);if(y.signum()<0)y.addTo(s,y);else return y;return y.signum()<0?y.add(s):y}var X=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Bi=(1<<26)/X[X.length-1];function Ri(s){var o,a=this.abs();if(a.t==1&&a[0]<=X[X.length-1]){for(o=0;o<X.length;++o)if(a[0]==X[o])return!0;return!1}if(a.isEven())return!1;for(o=1;o<X.length;){for(var c=X[o],p=o+1;p<X.length&&c<Bi;)c*=X[p++];for(c=a.modInt(c);o<p;)if(c%X[o++]==0)return!1}return a.millerRabin(s)}function Mi(s){var o=this.subtract(n.ONE),a=o.getLowestSetBit();if(a<=0)return!1;var c=o.shiftRight(a);s=s+1>>1,s>X.length&&(s=X.length);for(var p=i(),h=0;h<s;++h){p.fromInt(X[Math.floor(Math.random()*X.length)]);var b=p.modPow(c,this);if(b.compareTo(n.ONE)!=0&&b.compareTo(o)!=0){for(var y=1;y++<a&&b.compareTo(o)!=0;)if(b=b.modPowInt(2,this),b.compareTo(n.ONE)==0)return!1;if(b.compareTo(o)!=0)return!1}}return!0}n.prototype.chunkSize=Do,n.prototype.toRadix=ko,n.prototype.fromRadix=_o,n.prototype.fromNumber=Oo,n.prototype.bitwiseTo=$o,n.prototype.changeBit=ti,n.prototype.addTo=si,n.prototype.dMultiply=pi,n.prototype.dAddOffset=hi,n.prototype.multiplyLowerTo=bi,n.prototype.multiplyUpperTo=wi,n.prototype.modInt=Ai,n.prototype.millerRabin=Mi,n.prototype.clone=Io,n.prototype.intValue=Bo,n.prototype.byteValue=Ro,n.prototype.shortValue=Mo,n.prototype.signum=Po,n.prototype.toByteArray=Fo,n.prototype.equals=No,n.prototype.min=Lo,n.prototype.max=Uo,n.prototype.and=Vo,n.prototype.or=zo,n.prototype.xor=qo,n.prototype.andNot=Go,n.prototype.not=Ho,n.prototype.shiftLeft=Wo,n.prototype.shiftRight=Zo,n.prototype.getLowestSetBit=Jo,n.prototype.bitCount=Qo,n.prototype.testBit=Ko,n.prototype.setBit=ei,n.prototype.clearBit=ri,n.prototype.flipBit=ni,n.prototype.add=oi,n.prototype.subtract=ii,n.prototype.multiply=ai,n.prototype.divide=ui,n.prototype.remainder=fi,n.prototype.divideAndRemainder=li,n.prototype.modPow=Ei,n.prototype.modInverse=Ii,n.prototype.pow=gi,n.prototype.gcd=Ci,n.prototype.isProbablePrime=Ri,n.prototype.square=ci,n.prototype.Barrett=Ft;var Se,et,U;function Di(s){et[U++]^=s&255,et[U++]^=s>>8&255,et[U++]^=s>>16&255,et[U++]^=s>>24&255,U>=rr&&(U-=rr)}function mn(){Di(new Date().getTime())}if(et==null){et=new Array,U=0;var ft;if(typeof window<"u"&&window.crypto){if(window.crypto.getRandomValues){var gn=new Uint8Array(32);for(window.crypto.getRandomValues(gn),ft=0;ft<32;++ft)et[U++]=gn[ft]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var bn=window.crypto.random(32);for(ft=0;ft<bn.length;++ft)et[U++]=bn.charCodeAt(ft)&255}}for(;U<rr;)ft=Math.floor(65536*Math.random()),et[U++]=ft>>>8,et[U++]=ft&255;U=0,mn()}function Pi(){if(Se==null){for(mn(),Se=Fi(),Se.init(et),U=0;U<et.length;++U)et[U]=0;U=0}return Se.next()}function ki(s){var o;for(o=0;o<s.length;++o)s[o]=Pi()}function tr(){}tr.prototype.nextBytes=ki;function er(){this.i=0,this.j=0,this.S=new Array}function _i(s){var o,a,c;for(o=0;o<256;++o)this.S[o]=o;for(a=0,o=0;o<256;++o)a=a+this.S[o]+s[o%s.length]&255,c=this.S[o],this.S[o]=this.S[a],this.S[a]=c;this.i=0,this.j=0}function Oi(){var s;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,s=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=s,this.S[s+this.S[this.i]&255]}er.prototype.init=_i,er.prototype.next=Oi;function Fi(){return new er}var rr=256;typeof Ge<"u"?Ge=Us.exports={default:n,BigInteger:n,SecureRandom:tr}:this.jsbn={BigInteger:n,SecureRandom:tr}}).call(Ge)});var xe=N(He=>{(function(){"use strict";var r={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function t(f){return n(u(f),arguments)}function e(f,d){return t.apply(null,[f].concat(d||[]))}function n(f,d){var g=1,A=f.length,l,w="",x,S,m,E,B,C,I,O;for(x=0;x<A;x++)if(typeof f[x]=="string")w+=f[x];else if(typeof f[x]=="object"){if(m=f[x],m.keys)for(l=d[g],S=0;S<m.keys.length;S++){if(l==null)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',m.keys[S],m.keys[S-1]));l=l[m.keys[S]]}else m.param_no?l=d[m.param_no]:l=d[g++];if(r.not_type.test(m.type)&&r.not_primitive.test(m.type)&&l instanceof Function&&(l=l()),r.numeric_arg.test(m.type)&&typeof l!="number"&&isNaN(l))throw new TypeError(t("[sprintf] expecting number but found %T",l));switch(r.number.test(m.type)&&(I=l>=0),m.type){case"b":l=parseInt(l,10).toString(2);break;case"c":l=String.fromCharCode(parseInt(l,10));break;case"d":case"i":l=parseInt(l,10);break;case"j":l=JSON.stringify(l,null,m.width?parseInt(m.width):0);break;case"e":l=m.precision?parseFloat(l).toExponential(m.precision):parseFloat(l).toExponential();break;case"f":l=m.precision?parseFloat(l).toFixed(m.precision):parseFloat(l);break;case"g":l=m.precision?String(Number(l.toPrecision(m.precision))):parseFloat(l);break;case"o":l=(parseInt(l,10)>>>0).toString(8);break;case"s":l=String(l),l=m.precision?l.substring(0,m.precision):l;break;case"t":l=String(!!l),l=m.precision?l.substring(0,m.precision):l;break;case"T":l=Object.prototype.toString.call(l).slice(8,-1).toLowerCase(),l=m.precision?l.substring(0,m.precision):l;break;case"u":l=parseInt(l,10)>>>0;break;case"v":l=l.valueOf(),l=m.precision?l.substring(0,m.precision):l;break;case"x":l=(parseInt(l,10)>>>0).toString(16);break;case"X":l=(parseInt(l,10)>>>0).toString(16).toUpperCase();break}r.json.test(m.type)?w+=l:(r.number.test(m.type)&&(!I||m.sign)?(O=I?"+":"-",l=l.toString().replace(r.sign,"")):O="",B=m.pad_char?m.pad_char==="0"?"0":m.pad_char.charAt(1):" ",C=m.width-(O+l).length,E=m.width&&C>0?B.repeat(C):"",w+=m.align?O+l+E:B==="0"?O+E+l:E+O+l)}return w}var i=Object.create(null);function u(f){if(i[f])return i[f];for(var d=f,g,A=[],l=0;d;){if((g=r.text.exec(d))!==null)A.push(g[0]);else if((g=r.modulo.exec(d))!==null)A.push("%");else if((g=r.placeholder.exec(d))!==null){if(g[2]){l|=1;var w=[],x=g[2],S=[];if((S=r.key.exec(x))!==null)for(w.push(S[1]);(x=x.substring(S[0].length))!=="";)if((S=r.key_access.exec(x))!==null)w.push(S[1]);else if((S=r.index_access.exec(x))!==null)w.push(S[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");g[2]=w}else l|=2;if(l===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");A.push({placeholder:g[0],param_no:g[1],keys:g[2],sign:g[3],pad_char:g[4],align:g[5],width:g[6],precision:g[7],type:g[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");d=d.substring(g[0].length)}return i[f]=A}typeof He<"u"&&(He.sprintf=t,He.vsprintf=e),typeof window<"u"&&(window.sprintf=t,window.vsprintf=e,typeof define=="function"&&define.amd&&define(function(){return{sprintf:t,vsprintf:e}}))})()});var ku={};nt(ku,{tcp:()=>Pu});var eo=V(yt("net"),1);var Bt=yt("node:net");function Ae(r){return!!(0,Bt.isIP)(r)}var cr={};nt(cr,{identity:()=>Zi});function zi(r,t){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var i=0;i<r.length;i++){var u=r.charAt(i),f=u.charCodeAt(0);if(e[f]!==255)throw new TypeError(u+" is ambiguous");e[f]=i}var d=r.length,g=r.charAt(0),A=Math.log(d)/Math.log(256),l=Math.log(256)/Math.log(d);function w(m){if(m instanceof Uint8Array||(ArrayBuffer.isView(m)?m=new Uint8Array(m.buffer,m.byteOffset,m.byteLength):Array.isArray(m)&&(m=Uint8Array.from(m))),!(m instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(m.length===0)return"";for(var E=0,B=0,C=0,I=m.length;C!==I&&m[C]===0;)C++,E++;for(var O=(I-C)*l+1>>>0,F=new Uint8Array(O);C!==I;){for(var tt=m[C],J=0,Z=O-1;(tt!==0||J<B)&&Z!==-1;Z--,J++)tt+=256*F[Z]>>>0,F[Z]=tt%d>>>0,tt=tt/d>>>0;if(tt!==0)throw new Error("Non-zero carry");B=J,C++}for(var Y=O-B;Y!==O&&F[Y]===0;)Y++;for(var ut=g.repeat(E);Y<O;++Y)ut+=r.charAt(F[Y]);return ut}function x(m){if(typeof m!="string")throw new TypeError("Expected String");if(m.length===0)return new Uint8Array;var E=0;if(m[E]!==" "){for(var B=0,C=0;m[E]===g;)B++,E++;for(var I=(m.length-E)*A+1>>>0,O=new Uint8Array(I);m[E];){var F=e[m.charCodeAt(E)];if(F===255)return;for(var tt=0,J=I-1;(F!==0||tt<C)&&J!==-1;J--,tt++)F+=d*O[J]>>>0,O[J]=F%256>>>0,F=F/256>>>0;if(F!==0)throw new Error("Non-zero carry");C=tt,E++}if(m[E]!==" "){for(var Z=I-C;Z!==I&&O[Z]===0;)Z++;for(var Y=new Uint8Array(B+(I-Z)),ut=B;Z!==I;)Y[ut++]=O[Z++];return Y}}}function S(m){var E=x(m);if(E)return E;throw new Error(`Non-${t} character`)}return{encode:w,decodeUnsafe:x,decode:S}}var qi=zi,Gi=qi,yn=Gi;var Nu=new Uint8Array(0);var vn=(r,t)=>{if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0},at=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var xn=r=>new TextEncoder().encode(r),Sn=r=>new TextDecoder().decode(r);var sr=class{constructor(t,e,n){this.name=t,this.prefix=e,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},or=class{constructor(t,e,n){if(this.name=t,this.prefix=e,e.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return En(this,t)}},ir=class{constructor(t){this.decoders=t}or(t){return En(this,t)}decode(t){let e=t[0],n=this.decoders[e];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},En=(r,t)=>new ir({...r.decoders||{[r.prefix]:r},...t.decoders||{[t.prefix]:t}}),ar=class{constructor(t,e,n,i){this.name=t,this.prefix=e,this.baseEncode=n,this.baseDecode=i,this.encoder=new sr(t,e,n),this.decoder=new or(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},qt=({name:r,prefix:t,encode:e,decode:n})=>new ar(r,t,e,n),Rt=({prefix:r,name:t,alphabet:e})=>{let{encode:n,decode:i}=yn(e,t);return qt({prefix:r,name:t,encode:n,decode:u=>at(i(u))})},Hi=(r,t,e,n)=>{let i={};for(let l=0;l<t.length;++l)i[t[l]]=l;let u=r.length;for(;r[u-1]==="=";)--u;let f=new Uint8Array(u*e/8|0),d=0,g=0,A=0;for(let l=0;l<u;++l){let w=i[r[l]];if(w===void 0)throw new SyntaxError(`Non-${n} character`);g=g<<e|w,d+=e,d>=8&&(d-=8,f[A++]=255&g>>d)}if(d>=e||255&g<<8-d)throw new SyntaxError("Unexpected end of data");return f},Wi=(r,t,e)=>{let n=t[t.length-1]==="=",i=(1<<e)-1,u="",f=0,d=0;for(let g=0;g<r.length;++g)for(d=d<<8|r[g],f+=8;f>e;)f-=e,u+=t[i&d>>f];if(f&&(u+=t[i&d<<e-f]),n)for(;u.length*e&7;)u+="=";return u},k=({name:r,prefix:t,bitsPerChar:e,alphabet:n})=>qt({prefix:t,name:r,encode(i){return Wi(i,n,e)},decode(i){return Hi(i,n,e,r)}});var Zi=qt({prefix:"\0",name:"identity",encode:r=>Sn(r),decode:r=>xn(r)});var ur={};nt(ur,{base2:()=>Xi});var Xi=k({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var fr={};nt(fr,{base8:()=>Ji});var Ji=k({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var lr={};nt(lr,{base10:()=>Yi});var Yi=Rt({prefix:"9",name:"base10",alphabet:"0123456789"});var pr={};nt(pr,{base16:()=>Qi,base16upper:()=>Ki});var Qi=k({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ki=k({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var hr={};nt(hr,{base32:()=>ht,base32hex:()=>na,base32hexpad:()=>oa,base32hexpadupper:()=>ia,base32hexupper:()=>sa,base32pad:()=>ea,base32padupper:()=>ra,base32upper:()=>ta,base32z:()=>aa});var ht=k({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ta=k({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),ea=k({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),ra=k({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),na=k({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),sa=k({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),oa=k({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ia=k({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),aa=k({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var dr={};nt(dr,{base36:()=>ca,base36upper:()=>ua});var ca=Rt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),ua=Rt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var mr={};nt(mr,{base58btc:()=>z,base58flickr:()=>fa});var z=Rt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),fa=Rt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var br={};nt(br,{base64:()=>gr,base64pad:()=>la,base64url:()=>pa,base64urlpad:()=>ha});var gr=k({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),la=k({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),pa=k({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ha=k({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var wr={};nt(wr,{base256emoji:()=>wa});var Cn=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),da=Cn.reduce((r,t,e)=>(r[e]=t,r),[]),ma=Cn.reduce((r,t,e)=>(r[t.codePointAt(0)]=e,r),[]);function ga(r){return r.reduce((t,e)=>(t+=da[e],t),"")}function ba(r){let t=[];for(let e of r){let n=ma[e.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${e}`);t.push(n)}return new Uint8Array(t)}var wa=qt({prefix:"\u{1F680}",name:"base256emoji",encode:ga,decode:ba});var Tr={};nt(Tr,{sha256:()=>Na,sha512:()=>La});var Sr=V(yt("crypto"),1);var ya=Bn,An=128,va=127,xa=~va,Sa=Math.pow(2,31);function Bn(r,t,e){t=t||[],e=e||0;for(var n=e;r>=Sa;)t[e++]=r&255|An,r/=128;for(;r&xa;)t[e++]=r&255|An,r>>>=7;return t[e]=r|0,Bn.bytes=e-n+1,t}var Ta=yr,Ea=128,In=127;function yr(r,n){var e=0,n=n||0,i=0,u=n,f,d=r.length;do{if(u>=d)throw yr.bytes=0,new RangeError("Could not decode varint");f=r[u++],e+=i<28?(f&In)<<i:(f&In)*Math.pow(2,i),i+=7}while(f>=Ea);return yr.bytes=u-n,e}var Ca=Math.pow(2,7),Aa=Math.pow(2,14),Ia=Math.pow(2,21),Ba=Math.pow(2,28),Ra=Math.pow(2,35),Ma=Math.pow(2,42),Da=Math.pow(2,49),Pa=Math.pow(2,56),ka=Math.pow(2,63),_a=function(r){return r<Ca?1:r<Aa?2:r<Ia?3:r<Ba?4:r<Ra?5:r<Ma?6:r<Da?7:r<Pa?8:r<ka?9:10},Oa={encode:ya,decode:Ta,encodingLength:_a},Fa=Oa,le=Fa;var pe=(r,t=0)=>[le.decode(r,t),le.decode.bytes],Gt=(r,t,e=0)=>(le.encode(r,t,e),t),Ht=r=>le.encodingLength(r);var Nt=(r,t)=>{let e=t.byteLength,n=Ht(r),i=n+Ht(e),u=new Uint8Array(i+e);return Gt(r,u,0),Gt(e,u,n),u.set(t,i),new Wt(r,e,t,u)},Be=r=>{let t=at(r),[e,n]=pe(t),[i,u]=pe(t.subarray(n)),f=t.subarray(n+u);if(f.byteLength!==i)throw new Error("Incorrect length");return new Wt(e,i,f,t)},Rn=(r,t)=>{if(r===t)return!0;{let e=t;return r.code===e.code&&r.size===e.size&&e.bytes instanceof Uint8Array&&vn(r.bytes,e.bytes)}},Wt=class{constructor(t,e,n,i){this.code=t,this.size=e,this.digest=n,this.bytes=i}};var xr=({name:r,code:t,encode:e})=>new vr(r,t,e),vr=class{constructor(t,e,n){this.name=t,this.code=e,this.encode=n}digest(t){if(t instanceof Uint8Array){let e=this.encode(t);return e instanceof Uint8Array?Nt(this.code,e):e.then(n=>Nt(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Na=xr({name:"sha2-256",code:18,encode:r=>at(Sr.default.createHash("sha256").update(r).digest())}),La=xr({name:"sha2-512",code:19,encode:r=>at(Sr.default.createHash("sha512").update(r).digest())});var Er={};nt(Er,{identity:()=>ja});var Dn=0,Ua="identity",Pn=at,$a=r=>Nt(Dn,Pn(r)),ja={code:Dn,name:Ua,encode:Pn,digest:$a};var of=new TextEncoder,af=new TextDecoder;var kn=(r,t)=>{let{bytes:e,version:n}=r;switch(n){case 0:return Ga(e,Cr(r),t||z.encoder);default:return Ha(e,Cr(r),t||ht.encoder)}};var _n=new WeakMap,Cr=r=>{let t=_n.get(r);if(t==null){let e=new Map;return _n.set(r,e),e}return t},D=class{constructor(t,e,n,i){this.code=e,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:e}=this;if(t!==he)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==Wa)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return D.createV0(e)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:e}=this.multihash,n=Nt(t,e);return D.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return D.equals(this,t)}static equals(t,e){let n=e;return n&&t.code===n.code&&t.version===n.version&&Rn(t.multihash,n.multihash)}toString(t){return kn(this,t)}toJSON(){return{"/":kn(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let e=t;if(e instanceof D)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){let{version:n,code:i,multihash:u,bytes:f}=e;return new D(n,i,u,f||On(n,i,u.bytes))}else if(e[Za]===!0){let{version:n,multihash:i,code:u}=e,f=Be(i);return D.create(n,u,f)}else return null}static create(t,e,n){if(typeof e!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(e!==he)throw new Error(`Version 0 CID must use dag-pb (code: ${he}) block encoding`);return new D(t,e,n,n.bytes)}case 1:{let i=On(t,e,n.bytes);return new D(t,e,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return D.create(0,he,t)}static createV1(t,e){return D.create(1,t,e)}static decode(t){let[e,n]=D.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return e}static decodeFirst(t){let e=D.inspectBytes(t),n=e.size-e.multihashSize,i=at(t.subarray(n,n+e.multihashSize));if(i.byteLength!==e.multihashSize)throw new Error("Incorrect length");let u=i.subarray(e.multihashSize-e.digestSize),f=new Wt(e.multihashCode,e.digestSize,u,i);return[e.version===0?D.createV0(f):D.createV1(e.codec,f),t.subarray(e.size)]}static inspectBytes(t){let e=0,n=()=>{let[w,x]=pe(t.subarray(e));return e+=x,w},i=n(),u=he;if(i===18?(i=0,e=0):u=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let f=e,d=n(),g=n(),A=e+g,l=A-f;return{version:i,codec:u,multihashCode:d,digestSize:g,multihashSize:l,size:A}}static parse(t,e){let[n,i]=qa(t,e),u=D.decode(i);if(u.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Cr(u).set(n,t),u}},qa=(r,t)=>{switch(r[0]){case"Q":{let e=t||z;return[z.prefix,e.decode(`${z.prefix}${r}`)]}case z.prefix:{let e=t||z;return[z.prefix,e.decode(r)]}case ht.prefix:{let e=t||ht;return[ht.prefix,e.decode(r)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],t.decode(r)]}}},Ga=(r,t,e)=>{let{prefix:n}=e;if(n!==z.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let i=t.get(n);if(i==null){let u=e.encode(r).slice(1);return t.set(n,u),u}else return i},Ha=(r,t,e)=>{let{prefix:n}=e,i=t.get(n);if(i==null){let u=e.encode(r);return t.set(n,u),u}else return i},he=112,Wa=18,On=(r,t,e)=>{let n=Ht(r),i=n+Ht(t),u=new Uint8Array(i+e.byteLength);return Gt(r,u,0),Gt(t,u,n),u.set(e,i),u},Za=Symbol.for("@ipld/js-cid/CID");var de={...cr,...ur,...fr,...lr,...pr,...hr,...dr,...mr,...br,...wr},bf={...Tr,...Er};function Xt(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function Re(r=0){return globalThis.Buffer?.allocUnsafe!=null?Xt(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function Nn(r,t,e,n){return{name:r,prefix:t,encoder:{name:r,prefix:t,encode:e},decoder:{decode:n}}}var Fn=Nn("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Ar=Nn("ascii","a",r=>{let t="a";for(let e=0;e<r.length;e++)t+=String.fromCharCode(r[e]);return t},r=>{r=r.substring(1);let t=Re(r.length);for(let e=0;e<r.length;e++)t[e]=r.charCodeAt(e);return t}),Xa={utf8:Fn,"utf-8":Fn,hex:de.base16,latin1:Ar,ascii:Ar,binary:Ar,...de},Me=Xa;function Q(r,t="utf8"){let e=Me[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):e.encoder.encode(r).substring(1)}var Ln=Bt.isIPv4,Ja=Bt.isIPv6,Ir=function(r){let t=0;if(r=r.toString().trim(),Ln(r)){let e=new Uint8Array(t+4);return r.split(/\./g).forEach(n=>{e[t++]=parseInt(n,10)&255}),e}if(Ja(r)){let e=r.split(":",8),n;for(n=0;n<e.length;n++){let u=Ln(e[n]),f;u&&(f=Ir(e[n]),e[n]=Q(f.slice(0,2),"base16")),f!=null&&++n<8&&e.splice(n,0,Q(f.slice(2,4),"base16"))}if(e[0]==="")for(;e.length<8;)e.unshift("0");else if(e[e.length-1]==="")for(;e.length<8;)e.push("0");else if(e.length<8){for(n=0;n<e.length&&e[n]!=="";n++);let u=[n,1];for(n=9-e.length;n>0;n--)u.push("0");e.splice.apply(e,u)}let i=new Uint8Array(t+16);for(n=0;n<e.length;n++){let u=parseInt(e[n],16);i[t++]=u>>8&255,i[t++]=u&255}return i}throw new Error("invalid ip address")},Un=function(r,t=0,e){t=~~t,e=e??r.length-t;let n=new DataView(r.buffer);if(e===4){let i=[];for(let u=0;u<e;u++)i.push(r[t+u]);return i.join(".")}if(e===16){let i=[];for(let u=0;u<e;u+=2)i.push(n.getUint16(t+u).toString(16));return i.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var me={},Br={},Qa=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,-1,"ip6zone"],[43,8,"ipcidr"],[53,-1,"dns",!0],[54,-1,"dns4",!0],[55,-1,"dns6",!0],[56,-1,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc-direct"],[281,0,"webrtc"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,-1,"unix",!1,!0],[421,-1,"ipfs"],[421,-1,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,-1,"garlic64"],[448,0,"tls"],[449,-1,"sni"],[460,0,"quic"],[461,0,"quic-v1"],[465,0,"webtransport"],[466,-1,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,-1,"memory"]];Qa.forEach(r=>{let t=Ka(...r);Br[t.code]=t,me[t.name]=t});function Ka(r,t,e,n,i){return{code:r,size:t,name:e,resolvable:!!n,path:!!i}}function R(r){if(typeof r=="number"){if(Br[r]!=null)return Br[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(me[r]!=null)return me[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var gt=V(De(),1);function Dr(r,t="utf8"){let e=Me[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Xt(globalThis.Buffer.from(r,"utf-8")):e.decoder.decode(`${e.prefix}${r}`)}function vt(r,t){t==null&&(t=r.reduce((i,u)=>i+u.length,0));let e=Re(t),n=0;for(let i of r)e.set(i,n),n+=i.length;return Xt(e)}var Pe=class{index=0;input="";new(t){return this.index=0,this.input=t,this}readAtomically(t){let e=this.index,n=t();return n===void 0&&(this.index=e),n}parseWith(t){let e=t();if(this.index===this.input.length)return e}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(t){return this.readAtomically(()=>{let e=this.readChar();if(e===t)return e})}readSeparator(t,e,n){return this.readAtomically(()=>{if(!(e>0&&this.readGivenChar(t)===void 0))return n()})}readNumber(t,e,n,i){return this.readAtomically(()=>{let u=0,f=0,d=this.peekChar();if(d===void 0)return;let g=d==="0",A=2**(8*i)-1;for(;;){let l=this.readAtomically(()=>{let w=this.readChar();if(w===void 0)return;let x=Number.parseInt(w,t);if(!Number.isNaN(x))return x});if(l===void 0)break;if(u*=t,u+=l,u>A||(f+=1,e!==void 0&&f>e))return}if(f!==0)return!n&&g&&f>1?void 0:u})}readIPv4Addr(){return this.readAtomically(()=>{let t=new Uint8Array(4);for(let e=0;e<t.length;e++){let n=this.readSeparator(".",e,()=>this.readNumber(10,3,!1,1));if(n===void 0)return;t[e]=n}return t})}readIPv6Addr(){let t=e=>{for(let n=0;n<e.length/2;n++){let i=n*2;if(n<e.length-3){let f=this.readSeparator(":",n,()=>this.readIPv4Addr());if(f!==void 0)return e[i]=f[0],e[i+1]=f[1],e[i+2]=f[2],e[i+3]=f[3],[i+4,!0]}let u=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(u===void 0)return[i,!1];e[i]=u>>8,e[i+1]=u&255}return[e.length,!1]};return this.readAtomically(()=>{let e=new Uint8Array(16),[n,i]=t(e);if(n===16)return e;if(i||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let u=new Uint8Array(14),f=16-(n+2),[d]=t(u.subarray(0,f));return e.set(u.subarray(0,d),16-d),e})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var zf=new Pe;var Yf=parseInt("0xFFFF",16),Qf=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);var Dl=R("ip4"),Pl=R("ip6"),kl=R("ipcidr");function es(r,t){switch(R(r).code){case 4:case 41:return yc(t);case 42:return Kn(t);case 6:case 273:case 33:case 132:return ns(t).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Kn(t);case 421:return Tc(t);case 444:return ts(t);case 445:return ts(t);case 466:return Sc(t);default:return Q(t,"base16")}}function rs(r,t){switch(R(r).code){case 4:return Yn(t);case 41:return Yn(t);case 42:return Qn(t);case 6:case 273:case 33:case 132:return kr(parseInt(t,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Qn(t);case 421:return vc(t);case 444:return Ec(t);case 445:return Cc(t);case 466:return xc(t);default:return Dr(t,"base16")}}var Pr=Object.values(de).map(r=>r.decoder),wc=function(){let r=Pr[0].or(Pr[1]);return Pr.slice(2).forEach(t=>r=r.or(t)),r}();function Yn(r){if(!Ae(r))throw new Error("invalid ip address");return Ir(r)}function yc(r){let t=Un(r,0,r.length);if(t==null)throw new Error("ipBuff is required");if(!Ae(t))throw new Error("invalid ip address");return t}function kr(r){let t=new ArrayBuffer(2);return new DataView(t).setUint16(0,r),new Uint8Array(t)}function ns(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function Qn(r){let t=Dr(r),e=Uint8Array.from(gt.default.encode(t.length));return vt([e,t],e.length+t.length)}function Kn(r){let t=gt.default.decode(r);if(r=r.slice(gt.default.decode.bytes),r.length!==t)throw new Error("inconsistent lengths");return Q(r)}function vc(r){let t;r[0]==="Q"||r[0]==="1"?t=Be(z.decode(`z${r}`)).bytes:t=D.parse(r).multihash.bytes;let e=Uint8Array.from(gt.default.encode(t.length));return vt([e,t],e.length+t.length)}function xc(r){let t=wc.decode(r),e=Uint8Array.from(gt.default.encode(t.length));return vt([e,t],e.length+t.length)}function Sc(r){let t=gt.default.decode(r),e=r.slice(gt.default.decode.bytes);if(e.length!==t)throw new Error("inconsistent lengths");return"u"+Q(e,"base64url")}function Tc(r){let t=gt.default.decode(r),e=r.slice(gt.default.decode.bytes);if(e.length!==t)throw new Error("inconsistent lengths");return Q(e,"base58btc")}function Ec(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==16)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion address.`);let e=ht.decode("b"+t[0]),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=kr(n);return vt([e,i],e.length+i.length)}function Cc(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==56)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion3 address.`);let e=ht.decode(`b${t[0]}`),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=kr(n);return vt([e,i],e.length+i.length)}function ts(r){let t=r.slice(0,r.length-2),e=r.slice(r.length-2),n=Q(t,"base32"),i=ns(e);return`${n}:${i}`}var Jt=V(De(),1);function Ac(r){let t=[],e=r.split("/").slice(1);if(e.length===1&&e[0]==="")return[];for(let n=0;n<e.length;n++){let i=e[n],u=R(i);if(u.size===0){t.push([i]);continue}if(n++,n>=e.length)throw os("invalid address: "+r);if(u.path===!0){t.push([i,Lr(e.slice(n).join("/"))]);break}t.push([i,e[n]])}return t}function Ic(r){let t=[];return r.map(e=>{let n=Oe(e);return t.push(n.name),e.length>1&&e[1]!=null&&t.push(e[1]),null}),Lr(t.join("/"))}function Bc(r){return r.map(t=>{Array.isArray(t)||(t=[t]);let e=Oe(t);return t.length>1?[e.code,rs(e.code,t[1])]:[e.code]})}function _r(r){return r.map(t=>{let e=Oe(t);return t[1]!=null?[e.code,es(e.code,t[1])]:[e.code]})}function Or(r){return _e(vt(r.map(t=>{let e=Oe(t),n=Uint8Array.from(Jt.default.encode(e.code));return t.length>1&&t[1]!=null&&(n=vt([n,t[1]])),n})))}function Fr(r,t){return r.size>0?r.size/8:r.size===0?0:Jt.default.decode(t)+(Jt.default.decode.bytes??0)}function ke(r){let t=[],e=0;for(;e<r.length;){let n=Jt.default.decode(r,e),i=Jt.default.decode.bytes??0,u=R(n),f=Fr(u,r.slice(e+i));if(f===0){t.push([n]),e+=i;continue}let d=r.slice(e+i,e+i+f);if(e+=f+i,e>r.length)throw os("Invalid address Uint8Array: "+Q(r,"base16"));t.push([n,d])}return t}function Nr(r){let t=ke(r),e=_r(t);return Ic(e)}function Rc(r){r=Lr(r);let t=Ac(r),e=Bc(t);return Or(e)}function ss(r){return Rc(r)}function _e(r){let t=Mc(r);if(t!=null)throw t;return Uint8Array.from(r)}function Mc(r){try{ke(r)}catch(t){return t}}function Lr(r){return"/"+r.trim().split("/").filter(t=>t).join("/")}function os(r){return new Error("Error parsing address: "+r)}function Oe(r){return R(r[0])}var Ur=V(De(),1);var xt=class extends Error{constructor(t="The operation was aborted"){super(t),this.code=xt.code,this.type=xt.type}static get code(){return"ABORT_ERR"}static get type(){return"aborted"}},K=class extends Error{constructor(t,e,n){super(t),this.code=e,this.name=n?.name??"CodeError",this.props=n??{}}};function is(r,t){if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0}var St=function(r,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(r):n?n.value:t.get(r)},Yt=function(r,t,e,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?r!==t||!i:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,e):i?i.value=e:t.set(r,e),e},ge,be,we,Mt,as,Pc=Symbol.for("nodejs.util.inspect.custom"),kc=[R("dns").code,R("dns4").code,R("dns6").code,R("dnsaddr").code],_c=new Map,cs=Symbol.for("@multiformats/js-multiaddr/multiaddr");function Oc(r){return!!r?.[cs]}var Tt=class{constructor(t){if(ge.set(this,void 0),be.set(this,void 0),we.set(this,void 0),Mt.set(this,void 0),this[as]=!0,t==null&&(t=""),t instanceof Uint8Array)this.bytes=_e(t);else if(typeof t=="string"){if(t.length>0&&t.charAt(0)!=="/")throw new Error(`multiaddr "${t}" must start with a "/"`);this.bytes=ss(t)}else if(Oc(t))this.bytes=_e(t.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr")}toString(){return St(this,ge,"f")==null&&Yt(this,ge,Nr(this.bytes),"f"),St(this,ge,"f")}toJSON(){return this.toString()}toOptions(){let t,e,n,i,u="",f=R("tcp"),d=R("udp"),g=R("ip4"),A=R("ip6"),l=R("dns6"),w=R("ip6zone");for(let[S,m]of this.stringTuples())S===w.code&&(u=`%${m??""}`),kc.includes(S)&&(e=f.name,i=443,n=`${m??""}${u}`,t=S===l.code?6:4),(S===f.code||S===d.code)&&(e=R(S).name,i=parseInt(m??"")),(S===g.code||S===A.code)&&(e=R(S).name,n=`${m??""}${u}`,t=S===A.code?6:4);if(t==null||e==null||n==null||i==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:t,host:n,transport:e,port:i}}protos(){return this.protoCodes().map(t=>Object.assign({},R(t)))}protoCodes(){let t=[],e=this.bytes,n=0;for(;n<e.length;){let i=Ur.default.decode(e,n),u=Ur.default.decode.bytes??0,f=R(i),d=Fr(f,e.slice(n+u));n+=d+u,t.push(i)}return t}protoNames(){return this.protos().map(t=>t.name)}tuples(){return St(this,be,"f")==null&&Yt(this,be,ke(this.bytes),"f"),St(this,be,"f")}stringTuples(){return St(this,we,"f")==null&&Yt(this,we,_r(this.tuples()),"f"),St(this,we,"f")}encapsulate(t){return t=new Tt(t),new Tt(this.toString()+t.toString())}decapsulate(t){let e=t.toString(),n=this.toString(),i=n.lastIndexOf(e);if(i<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${t.toString()}`);return new Tt(n.slice(0,i))}decapsulateCode(t){let e=this.tuples();for(let n=e.length-1;n>=0;n--)if(e[n][0]===t)return new Tt(Or(e.slice(0,n)));return this}getPeerId(){try{let e=this.stringTuples().filter(n=>n[0]===me.ipfs.code).pop();if(e?.[1]!=null){let n=e[1];return n[0]==="Q"||n[0]==="1"?Q(z.decode(`z${n}`),"base58btc"):Q(D.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){if(St(this,Mt,"f")===void 0)try{Yt(this,Mt,this.stringTuples().filter(t=>R(t[0]).path===!0)[0][1],"f"),St(this,Mt,"f")==null&&Yt(this,Mt,null,"f")}catch{Yt(this,Mt,null,"f")}return St(this,Mt,"f")}equals(t){return is(this.bytes,t.bytes)}async resolve(t){let e=this.protos().find(u=>u.resolvable);if(e==null)return[this];let n=_c.get(e.name);if(n==null)throw new K(`no available resolver for ${e.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,t)).map(u=>new Tt(u))}nodeAddress(){let t=this.toOptions();if(t.transport!=="tcp"&&t.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${t.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:t.family,address:t.host,port:t.port}}isThinWaistAddress(t){let e=(t??this).protos();return!(e.length!==2||e[0].code!==4&&e[0].code!==41||e[1].code!==6&&e[1].code!==273)}[(ge=new WeakMap,be=new WeakMap,we=new WeakMap,Mt=new WeakMap,as=cs,Pc)](){return`Multiaddr(${Nr(this.bytes)})`}};function bt(r){return new Tt(r)}var Fc=v("dns4"),Nc=v("dns6"),Lc=v("dnsaddr"),Lt=L(v("dns"),Lc,Fc,Nc),Fe=L(v("ip4"),v("ip6")),Pt=L(T(Fe,v("tcp")),T(Lt,v("tcp"))),Ne=T(Fe,v("udp")),Uc=T(Ne,v("utp")),$c=T(Ne,v("quic")),jc=T(Ne,v("quic-v1")),ye=L(T(Pt,v("ws")),T(Lt,v("ws"))),ve=L(T(Pt,v("wss")),T(Lt,v("wss")),T(Pt,v("tls"),v("ws")),T(Lt,v("tls"),v("ws"))),$r=L(T(Pt,v("http")),T(Fe,v("http")),T(Lt,v("http"))),jr=L(T(Pt,v("https")),T(Fe,v("https")),T(Lt,v("https"))),us=T(Ne,v("webrtc-direct"),v("certhash")),ps=L(T(us,v("p2p")),us),fs=T(jc,v("webtransport"),v("certhash"),v("certhash")),hs=L(T(fs,v("p2p")),fs),ds=L(T(ye,v("p2p-webrtc-star"),v("p2p")),T(ve,v("p2p-webrtc-star"),v("p2p")),T(ye,v("p2p-webrtc-star")),T(ve,v("p2p-webrtc-star"))),ep=L(T(ye,v("p2p-websocket-star"),v("p2p")),T(ve,v("p2p-websocket-star"),v("p2p")),T(ye,v("p2p-websocket-star")),T(ve,v("p2p-websocket-star"))),ms=L(T($r,v("p2p-webrtc-direct"),v("p2p")),T(jr,v("p2p-webrtc-direct"),v("p2p")),T($r,v("p2p-webrtc-direct")),T(jr,v("p2p-webrtc-direct"))),Kt=L(ye,ve,$r,jr,ds,ms,Pt,Uc,$c,Lt,ps,hs),rp=L(T(Kt,v("p2p-stardust"),v("p2p")),T(Kt,v("p2p-stardust"))),Dt=L(T(Kt,v("p2p")),ds,ms,ps,hs,v("p2p")),ls=L(T(Dt,v("p2p-circuit"),Dt),T(Dt,v("p2p-circuit")),T(v("p2p-circuit"),Dt),T(Kt,v("p2p-circuit")),T(v("p2p-circuit"),Kt),v("p2p-circuit")),gs=()=>L(T(ls,gs),ls),Qt=gs(),np=L(T(Qt,Dt,Qt),T(Dt,Qt),T(Qt,Dt),Qt,Dt);var sp=L(T(Qt,v("webrtc")),T(Kt,v("webrtc")),v("webrtc"));function bs(r){function t(e){let n;try{n=bt(e)}catch{return!1}let i=r(n.protoNames());return i===null?!1:i===!0||i===!1?i:i.length===0}return t}function T(...r){function t(e){if(e.length<r.length)return null;let n=e;return r.some(i=>(n=typeof i=="function"?i().partialMatch(e):i.partialMatch(e),Array.isArray(n)&&(e=n),n===null)),n}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:bs(t),partialMatch:t}}function L(...r){function t(n){let i=null;return r.some(u=>{let f=typeof u=="function"?u().partialMatch(n):u.partialMatch(n);return f!=null?(i=f,!0):!1}),i}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:bs(t),partialMatch:t}}function v(r){let t=r;function e(i){let u;try{u=bt(i)}catch{return!1}let f=u.protoNames();return f.length===1&&f[0]===t}function n(i){return i.length===0?null:i[0]===t?i.slice(1):null}return{toString:function(){return t},matches:e,partialMatch:n}}var ct=V(Bs(),1);ct.default.formatters.b=r=>r==null?"undefined":z.baseEncode(r);ct.default.formatters.t=r=>r==null?"undefined":ht.baseEncode(r);ct.default.formatters.m=r=>r==null?"undefined":gr.baseEncode(r);ct.default.formatters.p=r=>r==null?"undefined":r.toString();ct.default.formatters.c=r=>r==null?"undefined":r.toString();ct.default.formatters.k=r=>r==null?"undefined":r.toString();function pu(r){let t=()=>{};return t.enabled=!1,t.color="",t.diff=0,t.log=()=>{},t.namespace=r,t.destroy=()=>!0,t.extend=()=>t,t}function kt(r){let t=pu(`${r}:trace`);return ct.default.enabled(`${r}:trace`)&&ct.default.names.map(e=>e.toString()).find(e=>e.includes(":trace"))!=null&&(t=(0,ct.default)(`${r}:trace`)),Object.assign((0,ct.default)(r),{error:(0,ct.default)(`${r}:error`),trace:t})}var Ys=V(Fs(),1);function ze(r){return this.subnetMask<r.subnetMask?!1:this.mask(r.subnetMask)===r.mask()}function qe(r){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===r&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}var oe=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g,Wr=/\/\d{1,2}$/;var G=class extends Error{constructor(t,e){super(t),this.name="AddressError",e!==null&&(this.parseMessage=e)}};var ie=V(Zr(),1),$t=V(xe(),1),P=class{constructor(t){this.groups=4,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=qe(32),this.isInSubnet=ze,this.address=t;let e=Wr.exec(t);if(e){if(this.parsedSubnet=e[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>32)throw new G("Invalid subnet mask.");t=t.replace(Wr,"")}this.addressMinusSuffix=t,this.parsedAddress=this.parse(t)}static isValid(t){try{return new P(t),!0}catch{return!1}}parse(t){let e=t.split(".");if(!t.match(oe))throw new G("Invalid IPv4 address.");return e}correctForm(){return this.parsedAddress.map(t=>parseInt(t,10)).join(".")}static fromHex(t){let e=t.replace(/:/g,"").padStart(8,"0"),n=[],i;for(i=0;i<8;i+=2){let u=e.slice(i,i+2);n.push(parseInt(u,16))}return new P(n.join("."))}static fromInteger(t){return P.fromHex(t.toString(16))}static fromArpa(t){let n=t.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new P(n)}toHex(){return this.parsedAddress.map(t=>(0,$t.sprintf)("%02x",parseInt(t,10))).join(":")}toArray(){return this.parsedAddress.map(t=>parseInt(t,10))}toGroup6(){let t=[],e;for(e=0;e<4;e+=2){let n=(0,$t.sprintf)("%02x%02x",parseInt(this.parsedAddress[e],10),parseInt(this.parsedAddress[e+1],10));t.push((0,$t.sprintf)("%x",parseInt(n,16)))}return t.join(":")}bigInteger(){return new ie.BigInteger(this.parsedAddress.map(t=>(0,$t.sprintf)("%02x",parseInt(t,10))).join(""),16)}_startAddress(){return new ie.BigInteger(this.mask()+"0".repeat(32-this.subnetMask),2)}startAddress(){return P.fromBigInteger(this._startAddress())}startAddressExclusive(){let t=new ie.BigInteger("1");return P.fromBigInteger(this._startAddress().add(t))}_endAddress(){return new ie.BigInteger(this.mask()+"1".repeat(32-this.subnetMask),2)}endAddress(){return P.fromBigInteger(this._endAddress())}endAddressExclusive(){let t=new ie.BigInteger("1");return P.fromBigInteger(this._endAddress().subtract(t))}static fromBigInteger(t){return P.fromInteger(parseInt(t.toString(),10))}mask(t){return t===void 0&&(t=this.subnetMask),this.getBitsBase2(0,t)}getBitsBase2(t,e){return this.binaryZeroPad().slice(t,e)}reverseForm(t){t||(t={});let e=this.correctForm().split(".").reverse().join(".");return t.omitSuffix?e:(0,$t.sprintf)("%s.in-addr.arpa.",e)}isMulticast(){return this.isInSubnet(new P("224.0.0.0/4"))}binaryZeroPad(){return this.bigInteger().toString(2).padStart(32,"0")}groupForV6(){let t=this.parsedAddress;return this.address.replace(oe,(0,$t.sprintf)('<span class="hover-group group-v4 group-6">%s</span>.<span class="hover-group group-v4 group-7">%s</span>',t.slice(0,2).join("."),t.slice(2,4).join(".")))}};var js={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"},Xr={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"},Jr=/([^0-9a-f:/%])/gi,Yr=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi,Qr=/\/\d{1,3}(?=%|$)/,Kr=/%.*$/,Vs=new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/),zs=new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/);var Gs=V(xe(),1);function bu(r){return r.replace(/^(0+)/,'<span class="zero">$1</span>')}function We(r,t=0){return r.split(":").map((n,i)=>/group-v4/.test(n)?n:(0,Gs.sprintf)('<span class="hover-group group-%d">%s</span>',i+t,bu(n)))}var Vt=V(xe(),1);function en(r){return(0,Vt.sprintf)("(%s)",r.join("|"))}function tn(r){return r.length<4?(0,Vt.sprintf)("0{0,%d}%s",4-r.length,r):r}var rn="[^A-Fa-f0-9:]";function Ze(r){let t=[];r.forEach((n,i)=>{parseInt(n,16)===0&&t.push(i)});let e=t.map(n=>r.map((i,u)=>{if(u===n){let f=u===0||u===8-1?":":"";return en([tn(i),f])}return tn(i)}).join(":"));return e.push(r.map(tn).join(":")),en(e)}function nn(r,t,e){let n=t?"":":",i=e?"":":",u=[];!t&&!e&&u.push("::"),t&&e&&u.push(""),(e&&!t||!e&&t)&&u.push(":"),u.push((0,Vt.sprintf)("%s(:0{1,4}){1,%d}",n,r-1)),u.push((0,Vt.sprintf)("(0{1,4}:){1,%d}%s",r-1,i)),u.push((0,Vt.sprintf)("(0{1,4}:){%d}0{1,4}",r-1));for(let f=1;f<r-1;f++)for(let d=1;d<r-f;d++)u.push((0,Vt.sprintf)("(0{1,4}:){%d}:(0{1,4}:){%d}0{1,4}",d,r-d-f-1));return en(u)}var H=V(Zr(),1),W=V(xe(),1);function Xe(r){if(!r)throw new Error("Assertion failed.")}function wu(r){let t=/(\d+)(\d{3})/;for(;t.test(r);)r=r.replace(t,"$1,$2");return r}function yu(r){return r=r.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),r=r.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),r}function vu(r,t){let e=[],n=[],i;for(i=0;i<r.length;i++)i<t[0]?e.push(r[i]):i>t[1]&&n.push(r[i]);return e.concat(["compact"]).concat(n)}function Ws(r){return(0,W.sprintf)("%04x",parseInt(r,16))}function Zs(r){return r&255}var _=class{constructor(t,e){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=ze,this.isCorrect=qe(128),e===void 0?this.groups=8:this.groups=e,this.address=t;let n=Qr.exec(t);if(n){if(this.parsedSubnet=n[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>128)throw new G("Invalid subnet mask.");t=t.replace(Qr,"")}else if(/\//.test(t))throw new G("Invalid subnet mask.");let i=Kr.exec(t);i&&(this.zone=i[0],t=t.replace(Kr,"")),this.addressMinusSuffix=t,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(t){try{return new _(t),!0}catch{return!1}}static fromBigInteger(t){let e=t.toString(16).padStart(32,"0"),n=[],i;for(i=0;i<8;i++)n.push(e.slice(i*4,(i+1)*4));return new _(n.join(":"))}static fromURL(t){let e,n=null,i;if(t.indexOf("[")!==-1&&t.indexOf("]:")!==-1){if(i=zs.exec(t),i===null)return{error:"failed to parse address with port",address:null,port:null};e=i[1],n=i[2]}else if(t.indexOf("/")!==-1){if(t=t.replace(/^[a-z0-9]+:\/\//,""),i=Vs.exec(t),i===null)return{error:"failed to parse address from URL",address:null,port:null};e=i[1]}else e=t;return n?(n=parseInt(n,10),(n<0||n>65536)&&(n=null)):n=null,{address:new _(e),port:n}}static fromAddress4(t){let e=new P(t),n=128-(32-e.subnetMask);return new _(`::ffff:${e.correctForm()}/${n}`)}static fromArpa(t){let e=t.replace(/(\.ip6\.arpa)?\.$/,""),n=7;if(e.length!==63)throw new G("Invalid 'ip6.arpa' form.");let i=e.split(".").reverse();for(let u=n;u>0;u--){let f=u*4;i.splice(f,0,":")}return e=i.join(""),new _(e)}microsoftTranscription(){return(0,W.sprintf)("%s.ipv6-literal.net",this.correctForm().replace(/:/g,"-"))}mask(t=this.subnetMask){return this.getBitsBase2(0,t)}possibleSubnets(t=128){let e=128-this.subnetMask,n=Math.abs(t-128),i=e-n;return i<0?"0":wu(new H.BigInteger("2",10).pow(i).toString(10))}_startAddress(){return new H.BigInteger(this.mask()+"0".repeat(128-this.subnetMask),2)}startAddress(){return _.fromBigInteger(this._startAddress())}startAddressExclusive(){let t=new H.BigInteger("1");return _.fromBigInteger(this._startAddress().add(t))}_endAddress(){return new H.BigInteger(this.mask()+"1".repeat(128-this.subnetMask),2)}endAddress(){return _.fromBigInteger(this._endAddress())}endAddressExclusive(){let t=new H.BigInteger("1");return _.fromBigInteger(this._endAddress().subtract(t))}getScope(){let t=js[this.getBits(12,16).intValue()];return this.getType()==="Global unicast"&&t!=="Link local"&&(t="Global"),t||"Unknown"}getType(){for(let t of Object.keys(Xr))if(this.isInSubnet(new _(t)))return Xr[t];return"Global unicast"}getBits(t,e){return new H.BigInteger(this.getBitsBase2(t,e),2)}getBitsBase2(t,e){return this.binaryZeroPad().slice(t,e)}getBitsBase16(t,e){let n=e-t;if(n%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(t,e).toString(16).padStart(n/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,128)}reverseForm(t){t||(t={});let e=Math.floor(this.subnetMask/4),n=this.canonicalForm().replace(/:/g,"").split("").slice(0,e).reverse().join(".");return e>0?t.omitSuffix?n:(0,W.sprintf)("%s.ip6.arpa.",n):t.omitSuffix?"":"ip6.arpa."}correctForm(){let t,e=[],n=0,i=[];for(t=0;t<this.parsedAddress.length;t++){let d=parseInt(this.parsedAddress[t],16);d===0&&n++,d!==0&&n>0&&(n>1&&i.push([t-n,t-1]),n=0)}n>1&&i.push([this.parsedAddress.length-n,this.parsedAddress.length-1]);let u=i.map(d=>d[1]-d[0]+1);if(i.length>0){let d=u.indexOf(Math.max(...u));e=vu(this.parsedAddress,i[d])}else e=this.parsedAddress;for(t=0;t<e.length;t++)e[t]!=="compact"&&(e[t]=parseInt(e[t],16).toString(16));let f=e.join(":");return f=f.replace(/^compact$/,"::"),f=f.replace(/^compact|compact$/,":"),f=f.replace(/compact/,""),f}binaryZeroPad(){return this.bigInteger().toString(2).padStart(128,"0")}parse4in6(t){let e=t.split(":"),i=e.slice(-1)[0].match(oe);if(i){this.parsedAddress4=i[0],this.address4=new P(this.parsedAddress4);for(let u=0;u<this.address4.groups;u++)if(/^0[0-9]+/.test(this.address4.parsedAddress[u]))throw new G("IPv4 addresses can't have leading zeroes.",t.replace(oe,this.address4.parsedAddress.map(yu).join(".")));this.v4=!0,e[e.length-1]=this.address4.toGroup6(),t=e.join(":")}return t}parse(t){t=this.parse4in6(t);let e=t.match(Jr);if(e)throw new G((0,W.sprintf)("Bad character%s detected in address: %s",e.length>1?"s":"",e.join("")),t.replace(Jr,'<span class="parse-error">$1</span>'));let n=t.match(Yr);if(n)throw new G((0,W.sprintf)("Address failed regex: %s",n.join("")),t.replace(Yr,'<span class="parse-error">$1</span>'));let i=[],u=t.split("::");if(u.length===2){let f=u[0].split(":"),d=u[1].split(":");f.length===1&&f[0]===""&&(f=[]),d.length===1&&d[0]===""&&(d=[]);let g=this.groups-(f.length+d.length);if(!g)throw new G("Error parsing groups");this.elidedGroups=g,this.elisionBegin=f.length,this.elisionEnd=f.length+this.elidedGroups,i=i.concat(f);for(let A=0;A<g;A++)i.push("0");i=i.concat(d)}else if(u.length===1)i=t.split(":"),this.elidedGroups=0;else throw new G("Too many :: groups found");if(i=i.map(f=>(0,W.sprintf)("%x",parseInt(f,16))),i.length!==this.groups)throw new G("Incorrect number of groups found");return i}canonicalForm(){return this.parsedAddress.map(Ws).join(":")}decimal(){return this.parsedAddress.map(t=>(0,W.sprintf)("%05d",parseInt(t,16))).join(":")}bigInteger(){return new H.BigInteger(this.parsedAddress.map(Ws).join(""),16)}to4(){let t=this.binaryZeroPad().split("");return P.fromHex(new H.BigInteger(t.slice(96,128).join(""),2).toString(16))}to4in6(){let t=this.to4(),n=new _(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),i="";return/:$/.test(n)||(i=":"),n+i+t.address}inspectTeredo(){let t=this.getBitsBase16(0,32),e=this.getBits(80,96).xor(new H.BigInteger("ffff",16)).toString(),n=P.fromHex(this.getBitsBase16(32,64)),i=P.fromHex(this.getBits(96,128).xor(new H.BigInteger("ffffffff",16)).toString(16)),u=this.getBits(64,80),f=this.getBitsBase2(64,80),d=u.testBit(15),g=u.testBit(14),A=u.testBit(8),l=u.testBit(9),w=new H.BigInteger(f.slice(2,6)+f.slice(8,16),2).toString(10);return{prefix:(0,W.sprintf)("%s:%s",t.slice(0,4),t.slice(4,8)),server4:n.address,client4:i.address,flags:f,coneNat:d,microsoft:{reserved:g,universalLocal:l,groupIndividual:A,nonce:w},udpPort:e}}inspect6to4(){let t=this.getBitsBase16(0,16),e=P.fromHex(this.getBitsBase16(16,48));return{prefix:(0,W.sprintf)("%s",t.slice(0,4)),gateway:e.address}}to6to4(){if(!this.is4())return null;let t=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new _(t)}toByteArray(){let t=this.bigInteger().toByteArray();return t.length===17&&t[0]===0?t.slice(1):t}toUnsignedByteArray(){return this.toByteArray().map(Zs)}static fromByteArray(t){return this.fromUnsignedByteArray(t.map(Zs))}static fromUnsignedByteArray(t){let e=new H.BigInteger("256",10),n=new H.BigInteger("0",10),i=new H.BigInteger("1",10);for(let u=t.length-1;u>=0;u--)n=n.add(i.multiply(new H.BigInteger(t[u].toString(10),10))),i=i.multiply(e);return _.fromBigInteger(n)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){return this.getType()==="Multicast"}is4(){return this.v4}isTeredo(){return this.isInSubnet(new _("2001::/32"))}is6to4(){return this.isInSubnet(new _("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(t){return t===void 0?t="":t=(0,W.sprintf)(":%s",t),(0,W.sprintf)("http://[%s]%s/",this.correctForm(),t)}link(t){t||(t={}),t.className===void 0&&(t.className=""),t.prefix===void 0&&(t.prefix="/#address="),t.v4===void 0&&(t.v4=!1);let e=this.correctForm;return t.v4&&(e=this.to4in6),t.className?(0,W.sprintf)('<a href="%1$s%2$s" class="%3$s">%2$s</a>',t.prefix,e.call(this),t.className):(0,W.sprintf)('<a href="%1$s%2$s">%2$s</a>',t.prefix,e.call(this))}group(){if(this.elidedGroups===0)return We(this.address).join(":");Xe(typeof this.elidedGroups=="number"),Xe(typeof this.elisionBegin=="number");let t=[],[e,n]=this.address.split("::");e.length?t.push(...We(e)):t.push("");let i=["hover-group"];for(let u=this.elisionBegin;u<this.elisionBegin+this.elidedGroups;u++)i.push((0,W.sprintf)("group-%d",u));return t.push((0,W.sprintf)('<span class="%s"></span>',i.join(" "))),n.length?t.push(...We(n,this.elisionEnd)):t.push(""),this.is4()&&(Xe(this.address4 instanceof P),t.pop(),t.push(this.address4.groupForV6())),t.join(":")}regularExpressionString(t=!1){let e=[],n=new _(this.correctForm());if(n.elidedGroups===0)e.push(Ze(n.parsedAddress));else if(n.elidedGroups===8)e.push(nn(8));else{let i=n.address.split("::");i[0].length&&e.push(Ze(i[0].split(":"))),Xe(typeof n.elidedGroups=="number"),e.push(nn(n.elidedGroups,i[0].length!==0,i[1].length!==0)),i[1].length&&e.push(Ze(i[1].split(":"))),e=[e.join(":")]}return t||(e=["(?=^|",rn,"|[^\\w\\:])(",...e,")(?=[^\\w\\:]|",rn,"|$)"]),e.join("")}regularExpression(t=!1){return new RegExp(this.regularExpressionString(t),"i")}};var xu=kt("libp2p:ip-port-to-multiaddr"),sn={ERR_INVALID_IP_PARAMETER:"ERR_INVALID_IP_PARAMETER",ERR_INVALID_PORT_PARAMETER:"ERR_INVALID_PORT_PARAMETER",ERR_INVALID_IP:"ERR_INVALID_IP"};function Xs(r,t){if(typeof r!="string")throw new K(`invalid ip provided: ${r}`,sn.ERR_INVALID_IP_PARAMETER);if(typeof t=="string"&&(t=parseInt(t)),isNaN(t))throw new K(`invalid port provided: ${t}`,sn.ERR_INVALID_PORT_PARAMETER);try{return new P(r),bt(`/ip4/${r}/tcp/${t}`)}catch{}try{let e=new _(r);return e.is4()?bt(`/ip4/${e.to4().correctForm()}/tcp/${t}`):bt(`/ip6/${r}/tcp/${t}`)}catch{let n=`invalid ip:port for creating a multiaddr: ${r}:${t}`;throw xu.error(n),new K(n,sn.ERR_INVALID_IP)}}var on=V(yt("os"),1),Js=V(yt("path"),1),Su={ip4:"IPv4",ip6:"IPv6"};function ce(r,t={}){let e=r.getPath();return e!=null?on.default.platform()==="win32"?{path:Js.default.join("\\\\.\\pipe\\",e)}:{path:e}:{...r.toOptions(),...t}}function an(r,t,e){let n=i=>bt(`/${r}/${i}/tcp/${e}`);return(Tu(t)?Cu(Su[r]):[t]).map(n)}function Tu(r){return["0.0.0.0","::"].includes(r)}var Eu=on.default.networkInterfaces();function Cu(r){let t=[];for(let[,e]of Object.entries(Eu))if(e!=null)for(let n of e)n.family===r&&t.push(n.address);return t}var mt=kt("libp2p:tcp:socket"),Je=(r,t)=>{let e=t.metrics,n=t.metricPrefix??"",i=t.socketInactivityTimeout??3e5,u=t.socketCloseTimeout??2e3;t.listeningAddr?.getPath()!=null&&(t.remoteAddr=t.listeningAddr),t.remoteAddr?.getPath()!=null&&(t.localAddr=t.remoteAddr);let f;if(t.remoteAddr!=null)f=t.remoteAddr;else{if(r.remoteAddress==null||r.remotePort==null)throw new K("Could not determine remote address or port","ERR_NO_REMOTE_ADDRESS");f=Xs(r.remoteAddress,r.remotePort)}let d=ce(f),g=d.path??`${d.host??""}:${d.port??""}`,{sink:A,source:l}=Ys.default.duplex(r);r.setTimeout(i,()=>{mt("%s socket read timeout",g),e?.increment({[`${n}timeout`]:!0});let x;r.readable&&(x=new K("Socket read timeout","ERR_SOCKET_READ_TIMEOUT")),r.destroy(x)}),r.once("close",()=>{mt("%s socket close",g),e?.increment({[`${n}close`]:!0}),w.timeline.close==null&&(w.timeline.close=Date.now())}),r.once("end",()=>{mt("%s socket end",g),e?.increment({[`${n}end`]:!0})});let w={async sink(x){try{await A(x)}catch(S){S.type!=="aborted"&&mt(S)}r.end()},source:l,remoteAddr:f,timeline:{open:Date.now()},async close(){if(r.destroyed){mt("%s socket was already destroyed when trying to close",g);return}mt("%s closing socket",g),await new Promise((x,S)=>{let m=Date.now(),E;r.once("close",()=>{mt("%s socket closed",g),E!==void 0&&clearTimeout(E),x()}),r.once("error",B=>{mt("%s socket error",g,B),w.timeline.close==null&&(w.timeline.close=Date.now()),r.destroyed&&E!==void 0&&clearTimeout(E),S(B)}),r.setTimeout(u),r.end(),r.writableLength>0?(E=setTimeout(()=>{r.destroyed?(mt("%s is already destroyed",g),x()):(mt("%s socket close timeout after %dms, destroying it manually",g,Date.now()-m),r.destroy(new K("Socket close timeout","ERR_SOCKET_CLOSE_TIMEOUT")))},u).unref(),r.once("drain",()=>{mt("%s socket drained",g),r.destroy()})):r.destroy()})}};return w};var Qs=V(yt("net"),1);var zt=function(r,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(r):n?n.value:t.get(r)},Ct,Ye=class extends EventTarget{constructor(){super(...arguments),Ct.set(this,new Map)}listenerCount(t){let e=zt(this,Ct,"f").get(t);return e==null?0:e.length}addEventListener(t,e,n){super.addEventListener(t,e,n);let i=zt(this,Ct,"f").get(t);i==null&&(i=[],zt(this,Ct,"f").set(t,i)),i.push({callback:e,once:(n!==!0&&n!==!1&&n?.once)??!1})}removeEventListener(t,e,n){super.removeEventListener(t.toString(),e??null,n);let i=zt(this,Ct,"f").get(t);i!=null&&(i=i.filter(({callback:u})=>u!==e),zt(this,Ct,"f").set(t,i))}dispatchEvent(t){let e=super.dispatchEvent(t),n=zt(this,Ct,"f").get(t.type);return n==null||(n=n.filter(({once:i})=>!i),zt(this,Ct,"f").set(t.type,n)),e}safeDispatchEvent(t,e){return this.dispatchEvent(new ue(t,e))}};Ct=new WeakMap;var cn=class extends Event{constructor(t,e){super(t,e),this.detail=e?.detail}},ue=globalThis.CustomEvent??cn;var ot=kt("libp2p:tcp:listener");async function un(r){try{await r.close()}catch(t){ot.error("an error occurred closing the connection",t)}}var Bu=1,Ru=0,Qe=class extends Ye{constructor(t){if(super(),this.context=t,this.connections=new Set,this.status={started:!1},t.keepAlive=t.keepAlive??!0,this.addr="unknown",this.server=Qs.default.createServer(t,this.onSocket.bind(this)),t.maxConnections!==void 0&&(this.server.maxConnections=t.maxConnections),t.closeServerOnMaxConnections!=null&&t.closeServerOnMaxConnections.closeAbove<t.closeServerOnMaxConnections.listenBelow)throw Error("closeAbove must be >= listenBelow");this.server.on("listening",()=>{if(t.metrics!=null){let e=this.server.address();e==null?this.addr="unknown":typeof e=="string"?this.addr=e:this.addr=`${e.address}:${e.port}`,t.metrics?.registerMetricGroup("libp2p_tcp_inbound_connections_total",{label:"address",help:"Current active connections in TCP listener",calculate:()=>({[this.addr]:this.connections.size})}),this.metrics={status:t.metrics.registerMetricGroup("libp2p_tcp_listener_status_info",{label:"address",help:"Current status of the TCP listener socket"}),errors:t.metrics.registerMetricGroup("libp2p_tcp_listener_errors_total",{label:"address",help:"Total count of TCP listener errors by type"}),events:t.metrics.registerMetricGroup("libp2p_tcp_listener_events_total",{label:"address",help:"Total count of TCP listener events by type"})},this.metrics?.status.update({[this.addr]:Bu})}this.dispatchEvent(new ue("listening"))}).on("error",e=>{this.metrics?.errors.increment({[`${this.addr} listen_error`]:!0}),this.dispatchEvent(new ue("error",{detail:e}))}).on("close",()=>{this.metrics?.status.update({[this.addr]:Ru}),this.dispatchEvent(new ue("close"))})}onSocket(t){t.on("error",n=>{ot("socket error",n),this.metrics?.events.increment({[`${this.addr} error`]:!0})});let e;try{e=Je(t,{listeningAddr:this.status.started?this.status.listeningAddr:void 0,socketInactivityTimeout:this.context.socketInactivityTimeout,socketCloseTimeout:this.context.socketCloseTimeout,metrics:this.metrics?.events,metricPrefix:`${this.addr} `})}catch(n){ot.error("inbound connection failed",n),this.metrics?.errors.increment({[`${this.addr} inbound_to_connection`]:!0});return}ot("new inbound connection %s",e.remoteAddr);try{this.context.upgrader.upgradeInbound(e).then(n=>{ot("inbound connection upgraded %s",e.remoteAddr),this.connections.add(e),t.once("close",()=>{this.connections.delete(e),this.context.closeServerOnMaxConnections!=null&&this.connections.size<this.context.closeServerOnMaxConnections.listenBelow&&this.netListen().catch(i=>{ot.error("error attempting to listen server once connection count under limit",i),this.context.closeServerOnMaxConnections?.onListenError?.(i)})}),this.context.handler!=null&&this.context.handler(n),this.context.closeServerOnMaxConnections!=null&&this.connections.size>=this.context.closeServerOnMaxConnections.closeAbove&&this.netClose(),this.dispatchEvent(new ue("connection",{detail:n}))}).catch(async n=>{ot.error("inbound connection failed",n),this.metrics?.errors.increment({[`${this.addr} inbound_upgrade`]:!0}),await un(e)}).catch(n=>{ot.error("closing inbound connection failed",n)})}catch(n){ot.error("inbound connection failed",n),un(e).catch(i=>{ot.error("closing inbound connection failed",i),this.metrics?.errors.increment({[`${this.addr} inbound_closing_failed`]:!0})})}}getAddrs(){if(!this.status.started)return[];let t=[],e=this.server.address(),{listeningAddr:n,peerId:i}=this.status;if(e==null)return[];if(typeof e=="string")t=[n];else try{n.toString().startsWith("/ip4")?t=t.concat(an("ip4",e.address,e.port)):e.family==="IPv6"&&(t=t.concat(an("ip6",e.address,e.port)))}catch(u){ot.error("could not turn %s:%s into multiaddr",e.address,e.port,u)}return t.map(u=>i!=null?u.encapsulate(`/p2p/${i}`):u)}async listen(t){if(this.status.started)throw Error("server is already listening");let e=t.getPeerId(),n=e==null?t.decapsulateCode(421):t,{backlog:i}=this.context;this.status={started:!0,listeningAddr:n,peerId:e,netConfig:ce(n,{backlog:i})},await this.netListen()}async close(){await Promise.all(Array.from(this.connections.values()).map(async t=>{await un(t)})),this.netClose()}async netListen(){if(!this.status.started||this.server.listening)return;let t=this.status.netConfig;await new Promise((e,n)=>{this.server.once("error",n),this.server.listen(t,e)}),ot("Listening on %s",this.server.address())}netClose(){!this.status.started||!this.server.listening||(ot("Closing server on %s",this.server.address()),this.server.close())}};var to=Symbol.for("@libp2p/transport");var Ks;(function(r){r[r.FATAL_ALL=0]="FATAL_ALL",r[r.NO_FATAL=1]="NO_FATAL"})(Ks||(Ks={}));var At=kt("libp2p:tcp"),ln=class{constructor(t,e={}){this.opts=e,this.components=t,t.metrics!=null&&(this.metrics={dialerEvents:t.metrics.registerCounterGroup("libp2p_tcp_dialer_events_total",{label:"event",help:"Total count of TCP dialer events by type"})})}get[to](){return!0}get[Symbol.toStringTag](){return"@libp2p/tcp"}async dial(t,e){e.keepAlive=e.keepAlive??!0;let n=await this._connect(t,e);n.on("error",d=>{At("socket error",d)});let i=Je(n,{remoteAddr:t,socketInactivityTimeout:this.opts.outboundSocketInactivityTimeout,socketCloseTimeout:this.opts.socketCloseTimeout,metrics:this.metrics?.dialerEvents}),u=()=>{i.close().catch(d=>{At.error("Error closing maConn after abort",d)})};e.signal?.addEventListener("abort",u,{once:!0}),At("new outbound connection %s",i.remoteAddr);let f=await e.upgrader.upgradeOutbound(i);if(At("outbound connection %s upgraded",i.remoteAddr),e.signal?.removeEventListener("abort",u),e.signal?.aborted===!0)throw f.close().catch(d=>{At.error("Error closing conn after abort",d)}),new xt;return f}async _connect(t,e){if(e.signal?.aborted===!0)throw new xt;return await new Promise((n,i)=>{let u=Date.now(),f=ce(t),d=f.path??`${f.host??""}:${f.port}`;At("dialing %j",f);let g=eo.default.connect(f),A=m=>{m.message=`connection error ${d}: ${m.message}`,this.metrics?.dialerEvents.increment({error:!0}),S(m)},l=()=>{At("connection timeout %s",d),this.metrics?.dialerEvents.increment({timeout:!0});let m=new K(`connection timeout after ${Date.now()-u}ms`,"ERR_CONNECT_TIMEOUT");g.emit("error",m)},w=()=>{At("connection opened %j",f),this.metrics?.dialerEvents.increment({connect:!0}),S()},x=()=>{At("connection aborted %j",f),this.metrics?.dialerEvents.increment({abort:!0}),g.destroy(),S(new xt)},S=m=>{if(g.removeListener("error",A),g.removeListener("timeout",l),g.removeListener("connect",w),e.signal!=null&&e.signal.removeEventListener("abort",x),m!=null){i(m);return}n(g)};g.on("error",A),g.on("timeout",l),g.on("connect",w),e.signal!=null&&e.signal.addEventListener("abort",x)})}createListener(t){return new Qe({...t,maxConnections:this.opts.maxConnections,backlog:this.opts.backlog,closeServerOnMaxConnections:this.opts.closeServerOnMaxConnections,socketInactivityTimeout:this.opts.inboundSocketInactivityTimeout,socketCloseTimeout:this.opts.socketCloseTimeout,metrics:this.components.metrics})}filter(t){return t=Array.isArray(t)?t:[t],t.filter(e=>e.protoCodes().includes(290)?!1:e.protoCodes().includes(400)?!0:Pt.matches(e.decapsulateCode(421)))}};function Pu(r={}){return(t={})=>new ln(t,r)}return Vi(ku);})();
4
+ `+u),r.push(i+"m+"+Oe.exports.humanize(this.diff)+"\x1B[0m")}else r[0]=nu()+t+" "+r[0]}function nu(){return V.inspectOpts.hideDate?"":new Date().toISOString()+" "}function su(...r){return process.stderr.write(Pe.format(...r)+`
5
+ `)}function ou(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function iu(){return process.env.DEBUG}function au(r){r.inspectOpts={};let t=Object.keys(V.inspectOpts);for(let e=0;e<t.length;e++)r.inspectOpts[t[e]]=V.inspectOpts[t[e]]}Oe.exports=Lr()(V);var{formatters:xs}=Oe.exports;xs.o=function(r){return this.inspectOpts.colors=this.useColors,Pe.inspect(r,this.inspectOpts).split(`
6
+ `).map(t=>t.trim()).join(" ")};xs.O=function(r){return this.inspectOpts.colors=this.useColors,Pe.inspect(r,this.inspectOpts)}});var Ts=L((ip,$r)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?$r.exports=gs():$r.exports=Ss()});var _e=L((lp,Cs)=>{Cs.exports=r=>{if(r[Symbol.asyncIterator])return r;if(r.getReader)return async function*(){let t=r.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)return;yield n}}finally{t.releaseLock()}}();throw new Error("unknown stream")}});var As=L((pp,Es)=>{Es.exports=function(t){if(t){if(typeof t[Symbol.iterator]=="function")return t[Symbol.iterator]();if(typeof t[Symbol.asyncIterator]=="function")return t[Symbol.asyncIterator]();if(typeof t.next=="function")return t}throw new Error("argument is not an iterator or iterable")}});var Vr=L((hp,Is)=>{var uu=As();Is.exports=r=>async t=>{t=uu(t);let e=E=>{typeof E.return=="function"&&E.return()},n=null,i=null,u=E=>{n=E,i&&i(E),e(t)},f=null,d=!1,g=()=>{d=!0,f&&f()},A=null,l=!1,y=()=>{l=!0,A&&A()},x=null,S=()=>{x&&x()},m=()=>new Promise((E,I)=>{f=x=E,i=I,r.once("drain",S)}),C=()=>(e(t),new Promise((E,I)=>{if(d||l||n)return E();A=f=E,i=I})),B=()=>{r.removeListener("error",u),r.removeListener("close",g),r.removeListener("finish",y),r.removeListener("drain",S)};r.once("error",u),r.once("close",g),r.once("finish",y);try{for await(let E of t){if(!r.writable||r.destroyed||n)break;r.write(E)===!1&&await m()}}catch(E){n||r.destroy(),n=E}try{if(r.writable&&r.end(),await C(),n)throw n}finally{B()}}});var jr=L((dp,Bs)=>{var fu=Vr(),lu=_e();Bs.exports=r=>({sink:fu(r),source:lu(r)})});var Ms=L((mp,Rs)=>{var pu=jr();Rs.exports=r=>async function*(t){let e=pu(r),n;if(e.sink(t).catch(i=>{n=i}),yield*e.source,n)throw n}});var Ds=L((gp,Kt)=>{Kt.exports=_e();Kt.exports.source=_e();Kt.exports.sink=Vr();Kt.exports.transform=Ms();Kt.exports.duplex=jr()});var qr=L((Le,Os)=>{(function(){var r,t=0xdeadbeefcafe,e=(t&16777215)==15715070;function n(s,o,a){s!=null&&(typeof s=="number"?this.fromNumber(s,o,a):o==null&&typeof s!="string"?this.fromString(s,256):this.fromString(s,o))}function i(){return new n(null)}function u(s,o,a,c,p,h){for(;--h>=0;){var b=o*this[s++]+a[c]+p;p=Math.floor(b/67108864),a[c++]=b&67108863}return p}function f(s,o,a,c,p,h){for(var b=o&32767,v=o>>15;--h>=0;){var M=this[s]&32767,$=this[s++]>>15,at=v*M+$*b;M=b*M+((at&32767)<<15)+a[c]+(p&1073741823),p=(M>>>30)+(at>>>15)+v*$+(p>>>30),a[c++]=M&1073741823}return p}function d(s,o,a,c,p,h){for(var b=o&16383,v=o>>14;--h>=0;){var M=this[s]&16383,$=this[s++]>>14,at=v*M+$*b;M=b*M+((at&16383)<<14)+a[c]+p,p=(M>>28)+(at>>14)+v*$,a[c++]=M&268435455}return p}var g=typeof navigator<"u";g&&e&&navigator.appName=="Microsoft Internet Explorer"?(n.prototype.am=f,r=30):g&&e&&navigator.appName!="Netscape"?(n.prototype.am=u,r=26):(n.prototype.am=d,r=28),n.prototype.DB=r,n.prototype.DM=(1<<r)-1,n.prototype.DV=1<<r;var A=52;n.prototype.FV=Math.pow(2,A),n.prototype.F1=A-r,n.prototype.F2=2*r-A;var l="0123456789abcdefghijklmnopqrstuvwxyz",y=new Array,x,S;for(x="0".charCodeAt(0),S=0;S<=9;++S)y[x++]=S;for(x="a".charCodeAt(0),S=10;S<36;++S)y[x++]=S;for(x="A".charCodeAt(0),S=10;S<36;++S)y[x++]=S;function m(s){return l.charAt(s)}function C(s,o){var a=y[s.charCodeAt(o)];return a??-1}function B(s){for(var o=this.t-1;o>=0;--o)s[o]=this[o];s.t=this.t,s.s=this.s}function E(s){this.t=1,this.s=s<0?-1:0,s>0?this[0]=s:s<-1?this[0]=s+this.DV:this.t=0}function I(s){var o=i();return o.fromInt(s),o}function _(s,o){var a;if(o==16)a=4;else if(o==8)a=3;else if(o==256)a=8;else if(o==2)a=1;else if(o==32)a=5;else if(o==4)a=2;else{this.fromRadix(s,o);return}this.t=0,this.s=0;for(var c=s.length,p=!1,h=0;--c>=0;){var b=a==8?s[c]&255:C(s,c);if(b<0){s.charAt(c)=="-"&&(p=!0);continue}p=!1,h==0?this[this.t++]=b:h+a>this.DB?(this[this.t-1]|=(b&(1<<this.DB-h)-1)<<h,this[this.t++]=b>>this.DB-h):this[this.t-1]|=b<<h,h+=a,h>=this.DB&&(h-=this.DB)}a==8&&s[0]&128&&(this.s=-1,h>0&&(this[this.t-1]|=(1<<this.DB-h)-1<<h)),this.clamp(),p&&n.ZERO.subTo(this,this)}function N(){for(var s=this.s&this.DM;this.t>0&&this[this.t-1]==s;)--this.t}function tt(s){if(this.s<0)return"-"+this.negate().toString(s);var o;if(s==16)o=4;else if(s==8)o=3;else if(s==2)o=1;else if(s==32)o=5;else if(s==4)o=2;else return this.toRadix(s);var a=(1<<o)-1,c,p=!1,h="",b=this.t,v=this.DB-b*this.DB%o;if(b-- >0)for(v<this.DB&&(c=this[b]>>v)>0&&(p=!0,h=m(c));b>=0;)v<o?(c=(this[b]&(1<<v)-1)<<o-v,c|=this[--b]>>(v+=this.DB-o)):(c=this[b]>>(v-=o)&a,v<=0&&(v+=this.DB,--b)),c>0&&(p=!0),p&&(h+=m(c));return p?h:"0"}function J(){var s=i();return n.ZERO.subTo(this,s),s}function W(){return this.s<0?this.negate():this}function Y(s){var o=this.s-s.s;if(o!=0)return o;var a=this.t;if(o=a-s.t,o!=0)return this.s<0?-o:o;for(;--a>=0;)if((o=this[a]-s[a])!=0)return o;return 0}function ut(s){var o=1,a;return(a=s>>>16)!=0&&(s=a,o+=16),(a=s>>8)!=0&&(s=a,o+=8),(a=s>>4)!=0&&(s=a,o+=4),(a=s>>2)!=0&&(s=a,o+=2),(a=s>>1)!=0&&(s=a,o+=1),o}function Ys(){return this.t<=0?0:this.DB*(this.t-1)+ut(this[this.t-1]^this.s&this.DM)}function Qs(s,o){var a;for(a=this.t-1;a>=0;--a)o[a+s]=this[a];for(a=s-1;a>=0;--a)o[a]=0;o.t=this.t+s,o.s=this.s}function Ks(s,o){for(var a=s;a<this.t;++a)o[a-s]=this[a];o.t=Math.max(this.t-s,0),o.s=this.s}function to(s,o){var a=s%this.DB,c=this.DB-a,p=(1<<c)-1,h=Math.floor(s/this.DB),b=this.s<<a&this.DM,v;for(v=this.t-1;v>=0;--v)o[v+h+1]=this[v]>>c|b,b=(this[v]&p)<<a;for(v=h-1;v>=0;--v)o[v]=0;o[h]=b,o.t=this.t+h+1,o.s=this.s,o.clamp()}function eo(s,o){o.s=this.s;var a=Math.floor(s/this.DB);if(a>=this.t){o.t=0;return}var c=s%this.DB,p=this.DB-c,h=(1<<c)-1;o[0]=this[a]>>c;for(var b=a+1;b<this.t;++b)o[b-a-1]|=(this[b]&h)<<p,o[b-a]=this[b]>>c;c>0&&(o[this.t-a-1]|=(this.s&h)<<p),o.t=this.t-a,o.clamp()}function ro(s,o){for(var a=0,c=0,p=Math.min(s.t,this.t);a<p;)c+=this[a]-s[a],o[a++]=c&this.DM,c>>=this.DB;if(s.t<this.t){for(c-=s.s;a<this.t;)c+=this[a],o[a++]=c&this.DM,c>>=this.DB;c+=this.s}else{for(c+=this.s;a<s.t;)c-=s[a],o[a++]=c&this.DM,c>>=this.DB;c-=s.s}o.s=c<0?-1:0,c<-1?o[a++]=this.DV+c:c>0&&(o[a++]=c),o.t=a,o.clamp()}function no(s,o){var a=this.abs(),c=s.abs(),p=a.t;for(o.t=p+c.t;--p>=0;)o[p]=0;for(p=0;p<c.t;++p)o[p+a.t]=a.am(0,c[p],o,p,0,a.t);o.s=0,o.clamp(),this.s!=s.s&&n.ZERO.subTo(o,o)}function so(s){for(var o=this.abs(),a=s.t=2*o.t;--a>=0;)s[a]=0;for(a=0;a<o.t-1;++a){var c=o.am(a,o[a],s,2*a,0,1);(s[a+o.t]+=o.am(a+1,2*o[a],s,2*a+1,c,o.t-a-1))>=o.DV&&(s[a+o.t]-=o.DV,s[a+o.t+1]=1)}s.t>0&&(s[s.t-1]+=o.am(a,o[a],s,2*a,0,1)),s.s=0,s.clamp()}function oo(s,o,a){var c=s.abs();if(!(c.t<=0)){var p=this.abs();if(p.t<c.t){o?.fromInt(0),a!=null&&this.copyTo(a);return}a==null&&(a=i());var h=i(),b=this.s,v=s.s,M=this.DB-ut(c[c.t-1]);M>0?(c.lShiftTo(M,h),p.lShiftTo(M,a)):(c.copyTo(h),p.copyTo(a));var $=h.t,at=h[$-1];if(at!=0){var rt=at*(1<<this.F1)+($>1?h[$-2]>>this.F2:0),wt=this.FV/rt,de=(1<<this.F1)/rt,lt=1<<this.F2,pt=a.t,me=pt-$,Ct=o??i();for(h.dlShiftTo(me,Ct),a.compareTo(Ct)>=0&&(a[a.t++]=1,a.subTo(Ct,a)),n.ONE.dlShiftTo($,Ct),Ct.subTo(h,h);h.t<$;)h[h.t++]=0;for(;--me>=0;){var Je=a[--pt]==at?this.DM:Math.floor(a[pt]*wt+(a[pt-1]+lt)*de);if((a[pt]+=h.am(0,Je,a,me,0,$))<Je)for(h.dlShiftTo(me,Ct),a.subTo(Ct,a);a[pt]<--Je;)a.subTo(Ct,a)}o!=null&&(a.drShiftTo($,o),b!=v&&n.ZERO.subTo(o,o)),a.t=$,a.clamp(),M>0&&a.rShiftTo(M,a),b<0&&n.ZERO.subTo(a,a)}}}function io(s){var o=i();return this.abs().divRemTo(s,null,o),this.s<0&&o.compareTo(n.ZERO)>0&&s.subTo(o,o),o}function Dt(s){this.m=s}function ao(s){return s.s<0||s.compareTo(this.m)>=0?s.mod(this.m):s}function co(s){return s}function uo(s){s.divRemTo(this.m,null,s)}function fo(s,o,a){s.multiplyTo(o,a),this.reduce(a)}function lo(s,o){s.squareTo(o),this.reduce(o)}Dt.prototype.convert=ao,Dt.prototype.revert=co,Dt.prototype.reduce=uo,Dt.prototype.mulTo=fo,Dt.prototype.sqrTo=lo;function po(){if(this.t<1)return 0;var s=this[0];if(!(s&1))return 0;var o=s&3;return o=o*(2-(s&15)*o)&15,o=o*(2-(s&255)*o)&255,o=o*(2-((s&65535)*o&65535))&65535,o=o*(2-s*o%this.DV)%this.DV,o>0?this.DV-o:-o}function kt(s){this.m=s,this.mp=s.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<s.DB-15)-1,this.mt2=2*s.t}function ho(s){var o=i();return s.abs().dlShiftTo(this.m.t,o),o.divRemTo(this.m,null,o),s.s<0&&o.compareTo(n.ZERO)>0&&this.m.subTo(o,o),o}function mo(s){var o=i();return s.copyTo(o),this.reduce(o),o}function go(s){for(;s.t<=this.mt2;)s[s.t++]=0;for(var o=0;o<this.m.t;++o){var a=s[o]&32767,c=a*this.mpl+((a*this.mph+(s[o]>>15)*this.mpl&this.um)<<15)&s.DM;for(a=o+this.m.t,s[a]+=this.m.am(0,c,s,o,0,this.m.t);s[a]>=s.DV;)s[a]-=s.DV,s[++a]++}s.clamp(),s.drShiftTo(this.m.t,s),s.compareTo(this.m)>=0&&s.subTo(this.m,s)}function bo(s,o){s.squareTo(o),this.reduce(o)}function wo(s,o,a){s.multiplyTo(o,a),this.reduce(a)}kt.prototype.convert=ho,kt.prototype.revert=mo,kt.prototype.reduce=go,kt.prototype.mulTo=wo,kt.prototype.sqrTo=bo;function yo(){return(this.t>0?this[0]&1:this.s)==0}function vo(s,o){if(s>4294967295||s<1)return n.ONE;var a=i(),c=i(),p=o.convert(this),h=ut(s)-1;for(p.copyTo(a);--h>=0;)if(o.sqrTo(a,c),(s&1<<h)>0)o.mulTo(c,p,a);else{var b=a;a=c,c=b}return o.revert(a)}function xo(s,o){var a;return s<256||o.isEven()?a=new Dt(o):a=new kt(o),this.exp(s,a)}n.prototype.copyTo=B,n.prototype.fromInt=E,n.prototype.fromString=_,n.prototype.clamp=N,n.prototype.dlShiftTo=Qs,n.prototype.drShiftTo=Ks,n.prototype.lShiftTo=to,n.prototype.rShiftTo=eo,n.prototype.subTo=ro,n.prototype.multiplyTo=no,n.prototype.squareTo=so,n.prototype.divRemTo=oo,n.prototype.invDigit=po,n.prototype.isEven=yo,n.prototype.exp=vo,n.prototype.toString=tt,n.prototype.negate=J,n.prototype.abs=W,n.prototype.compareTo=Y,n.prototype.bitLength=Ys,n.prototype.mod=io,n.prototype.modPowInt=xo,n.ZERO=I(0),n.ONE=I(1);function So(){var s=i();return this.copyTo(s),s}function To(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function Co(){return this.t==0?this.s:this[0]<<24>>24}function Eo(){return this.t==0?this.s:this[0]<<16>>16}function Ao(s){return Math.floor(Math.LN2*this.DB/Math.log(s))}function Io(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Bo(s){if(s==null&&(s=10),this.signum()==0||s<2||s>36)return"0";var o=this.chunkSize(s),a=Math.pow(s,o),c=I(a),p=i(),h=i(),b="";for(this.divRemTo(c,p,h);p.signum()>0;)b=(a+h.intValue()).toString(s).substr(1)+b,p.divRemTo(c,p,h);return h.intValue().toString(s)+b}function Ro(s,o){this.fromInt(0),o==null&&(o=10);for(var a=this.chunkSize(o),c=Math.pow(o,a),p=!1,h=0,b=0,v=0;v<s.length;++v){var M=C(s,v);if(M<0){s.charAt(v)=="-"&&this.signum()==0&&(p=!0);continue}b=o*b+M,++h>=a&&(this.dMultiply(c),this.dAddOffset(b,0),h=0,b=0)}h>0&&(this.dMultiply(Math.pow(o,h)),this.dAddOffset(b,0)),p&&n.ZERO.subTo(this,this)}function Mo(s,o,a){if(typeof o=="number")if(s<2)this.fromInt(1);else for(this.fromNumber(s,a),this.testBit(s-1)||this.bitwiseTo(n.ONE.shiftLeft(s-1),He,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(o);)this.dAddOffset(2,0),this.bitLength()>s&&this.subTo(n.ONE.shiftLeft(s-1),this);else{var c=new Array,p=s&7;c.length=(s>>3)+1,o.nextBytes(c),p>0?c[0]&=(1<<p)-1:c[0]=0,this.fromString(c,256)}}function Do(){var s=this.t,o=new Array;o[0]=this.s;var a=this.DB-s*this.DB%8,c,p=0;if(s-- >0)for(a<this.DB&&(c=this[s]>>a)!=(this.s&this.DM)>>a&&(o[p++]=c|this.s<<this.DB-a);s>=0;)a<8?(c=(this[s]&(1<<a)-1)<<8-a,c|=this[--s]>>(a+=this.DB-8)):(c=this[s]>>(a-=8)&255,a<=0&&(a+=this.DB,--s)),c&128&&(c|=-256),p==0&&(this.s&128)!=(c&128)&&++p,(p>0||c!=this.s)&&(o[p++]=c);return o}function ko(s){return this.compareTo(s)==0}function Po(s){return this.compareTo(s)<0?this:s}function Oo(s){return this.compareTo(s)>0?this:s}function _o(s,o,a){var c,p,h=Math.min(s.t,this.t);for(c=0;c<h;++c)a[c]=o(this[c],s[c]);if(s.t<this.t){for(p=s.s&this.DM,c=h;c<this.t;++c)a[c]=o(this[c],p);a.t=this.t}else{for(p=this.s&this.DM,c=h;c<s.t;++c)a[c]=o(p,s[c]);a.t=s.t}a.s=o(this.s,s.s),a.clamp()}function Fo(s,o){return s&o}function No(s){var o=i();return this.bitwiseTo(s,Fo,o),o}function He(s,o){return s|o}function Lo(s){var o=i();return this.bitwiseTo(s,He,o),o}function cn(s,o){return s^o}function Uo(s){var o=i();return this.bitwiseTo(s,cn,o),o}function un(s,o){return s&~o}function $o(s){var o=i();return this.bitwiseTo(s,un,o),o}function Vo(){for(var s=i(),o=0;o<this.t;++o)s[o]=this.DM&~this[o];return s.t=this.t,s.s=~this.s,s}function jo(s){var o=i();return s<0?this.rShiftTo(-s,o):this.lShiftTo(s,o),o}function zo(s){var o=i();return s<0?this.lShiftTo(-s,o):this.rShiftTo(s,o),o}function qo(s){if(s==0)return-1;var o=0;return s&65535||(s>>=16,o+=16),s&255||(s>>=8,o+=8),s&15||(s>>=4,o+=4),s&3||(s>>=2,o+=2),s&1||++o,o}function Go(){for(var s=0;s<this.t;++s)if(this[s]!=0)return s*this.DB+qo(this[s]);return this.s<0?this.t*this.DB:-1}function Ho(s){for(var o=0;s!=0;)s&=s-1,++o;return o}function Zo(){for(var s=0,o=this.s&this.DM,a=0;a<this.t;++a)s+=Ho(this[a]^o);return s}function Wo(s){var o=Math.floor(s/this.DB);return o>=this.t?this.s!=0:(this[o]&1<<s%this.DB)!=0}function Xo(s,o){var a=n.ONE.shiftLeft(s);return this.bitwiseTo(a,o,a),a}function Jo(s){return this.changeBit(s,He)}function Yo(s){return this.changeBit(s,un)}function Qo(s){return this.changeBit(s,cn)}function Ko(s,o){for(var a=0,c=0,p=Math.min(s.t,this.t);a<p;)c+=this[a]+s[a],o[a++]=c&this.DM,c>>=this.DB;if(s.t<this.t){for(c+=s.s;a<this.t;)c+=this[a],o[a++]=c&this.DM,c>>=this.DB;c+=this.s}else{for(c+=this.s;a<s.t;)c+=s[a],o[a++]=c&this.DM,c>>=this.DB;c+=s.s}o.s=c<0?-1:0,c>0?o[a++]=c:c<-1&&(o[a++]=this.DV+c),o.t=a,o.clamp()}function ti(s){var o=i();return this.addTo(s,o),o}function ei(s){var o=i();return this.subTo(s,o),o}function ri(s){var o=i();return this.multiplyTo(s,o),o}function ni(){var s=i();return this.squareTo(s),s}function si(s){var o=i();return this.divRemTo(s,o,null),o}function oi(s){var o=i();return this.divRemTo(s,null,o),o}function ii(s){var o=i(),a=i();return this.divRemTo(s,o,a),new Array(o,a)}function ai(s){this[this.t]=this.am(0,s-1,this,0,0,this.t),++this.t,this.clamp()}function ci(s,o){if(s!=0){for(;this.t<=o;)this[this.t++]=0;for(this[o]+=s;this[o]>=this.DV;)this[o]-=this.DV,++o>=this.t&&(this[this.t++]=0),++this[o]}}function oe(){}function fn(s){return s}function ui(s,o,a){s.multiplyTo(o,a)}function fi(s,o){s.squareTo(o)}oe.prototype.convert=fn,oe.prototype.revert=fn,oe.prototype.mulTo=ui,oe.prototype.sqrTo=fi;function li(s){return this.exp(s,new oe)}function pi(s,o,a){var c=Math.min(this.t+s.t,o);for(a.s=0,a.t=c;c>0;)a[--c]=0;var p;for(p=a.t-this.t;c<p;++c)a[c+this.t]=this.am(0,s[c],a,c,0,this.t);for(p=Math.min(s.t,o);c<p;++c)this.am(0,s[c],a,c,0,o-c);a.clamp()}function hi(s,o,a){--o;var c=a.t=this.t+s.t-o;for(a.s=0;--c>=0;)a[c]=0;for(c=Math.max(o-this.t,0);c<s.t;++c)a[this.t+c-o]=this.am(o-c,s[c],a,0,0,this.t+c-o);a.clamp(),a.drShiftTo(1,a)}function Pt(s){this.r2=i(),this.q3=i(),n.ONE.dlShiftTo(2*s.t,this.r2),this.mu=this.r2.divide(s),this.m=s}function di(s){if(s.s<0||s.t>2*this.m.t)return s.mod(this.m);if(s.compareTo(this.m)<0)return s;var o=i();return s.copyTo(o),this.reduce(o),o}function mi(s){return s}function gi(s){for(s.drShiftTo(this.m.t-1,this.r2),s.t>this.m.t+1&&(s.t=this.m.t+1,s.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);s.compareTo(this.r2)<0;)s.dAddOffset(1,this.m.t+1);for(s.subTo(this.r2,s);s.compareTo(this.m)>=0;)s.subTo(this.m,s)}function bi(s,o){s.squareTo(o),this.reduce(o)}function wi(s,o,a){s.multiplyTo(o,a),this.reduce(a)}Pt.prototype.convert=di,Pt.prototype.revert=mi,Pt.prototype.reduce=gi,Pt.prototype.mulTo=wi,Pt.prototype.sqrTo=bi;function yi(s,o){var a=s.bitLength(),c,p=I(1),h;if(a<=0)return p;a<18?c=1:a<48?c=3:a<144?c=4:a<768?c=5:c=6,a<8?h=new Dt(o):o.isEven()?h=new Pt(o):h=new kt(o);var b=new Array,v=3,M=c-1,$=(1<<c)-1;if(b[1]=h.convert(this),c>1){var at=i();for(h.sqrTo(b[1],at);v<=$;)b[v]=i(),h.mulTo(at,b[v-2],b[v]),v+=2}var rt=s.t-1,wt,de=!0,lt=i(),pt;for(a=ut(s[rt])-1;rt>=0;){for(a>=M?wt=s[rt]>>a-M&$:(wt=(s[rt]&(1<<a+1)-1)<<M-a,rt>0&&(wt|=s[rt-1]>>this.DB+a-M)),v=c;!(wt&1);)wt>>=1,--v;if((a-=v)<0&&(a+=this.DB,--rt),de)b[wt].copyTo(p),de=!1;else{for(;v>1;)h.sqrTo(p,lt),h.sqrTo(lt,p),v-=2;v>0?h.sqrTo(p,lt):(pt=p,p=lt,lt=pt),h.mulTo(lt,b[wt],p)}for(;rt>=0&&!(s[rt]&1<<a);)h.sqrTo(p,lt),pt=p,p=lt,lt=pt,--a<0&&(a=this.DB-1,--rt)}return h.revert(p)}function vi(s){var o=this.s<0?this.negate():this.clone(),a=s.s<0?s.negate():s.clone();if(o.compareTo(a)<0){var c=o;o=a,a=c}var p=o.getLowestSetBit(),h=a.getLowestSetBit();if(h<0)return o;for(p<h&&(h=p),h>0&&(o.rShiftTo(h,o),a.rShiftTo(h,a));o.signum()>0;)(p=o.getLowestSetBit())>0&&o.rShiftTo(p,o),(p=a.getLowestSetBit())>0&&a.rShiftTo(p,a),o.compareTo(a)>=0?(o.subTo(a,o),o.rShiftTo(1,o)):(a.subTo(o,a),a.rShiftTo(1,a));return h>0&&a.lShiftTo(h,a),a}function xi(s){if(s<=0)return 0;var o=this.DV%s,a=this.s<0?s-1:0;if(this.t>0)if(o==0)a=this[0]%s;else for(var c=this.t-1;c>=0;--c)a=(o*a+this[c])%s;return a}function Si(s){var o=s.isEven();if(this.isEven()&&o||s.signum()==0)return n.ZERO;for(var a=s.clone(),c=this.clone(),p=I(1),h=I(0),b=I(0),v=I(1);a.signum()!=0;){for(;a.isEven();)a.rShiftTo(1,a),o?((!p.isEven()||!h.isEven())&&(p.addTo(this,p),h.subTo(s,h)),p.rShiftTo(1,p)):h.isEven()||h.subTo(s,h),h.rShiftTo(1,h);for(;c.isEven();)c.rShiftTo(1,c),o?((!b.isEven()||!v.isEven())&&(b.addTo(this,b),v.subTo(s,v)),b.rShiftTo(1,b)):v.isEven()||v.subTo(s,v),v.rShiftTo(1,v);a.compareTo(c)>=0?(a.subTo(c,a),o&&p.subTo(b,p),h.subTo(v,h)):(c.subTo(a,c),o&&b.subTo(p,b),v.subTo(h,v))}if(c.compareTo(n.ONE)!=0)return n.ZERO;if(v.compareTo(s)>=0)return v.subtract(s);if(v.signum()<0)v.addTo(s,v);else return v;return v.signum()<0?v.add(s):v}var X=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Ti=(1<<26)/X[X.length-1];function Ci(s){var o,a=this.abs();if(a.t==1&&a[0]<=X[X.length-1]){for(o=0;o<X.length;++o)if(a[0]==X[o])return!0;return!1}if(a.isEven())return!1;for(o=1;o<X.length;){for(var c=X[o],p=o+1;p<X.length&&c<Ti;)c*=X[p++];for(c=a.modInt(c);o<p;)if(c%X[o++]==0)return!1}return a.millerRabin(s)}function Ei(s){var o=this.subtract(n.ONE),a=o.getLowestSetBit();if(a<=0)return!1;var c=o.shiftRight(a);s=s+1>>1,s>X.length&&(s=X.length);for(var p=i(),h=0;h<s;++h){p.fromInt(X[Math.floor(Math.random()*X.length)]);var b=p.modPow(c,this);if(b.compareTo(n.ONE)!=0&&b.compareTo(o)!=0){for(var v=1;v++<a&&b.compareTo(o)!=0;)if(b=b.modPowInt(2,this),b.compareTo(n.ONE)==0)return!1;if(b.compareTo(o)!=0)return!1}}return!0}n.prototype.chunkSize=Ao,n.prototype.toRadix=Bo,n.prototype.fromRadix=Ro,n.prototype.fromNumber=Mo,n.prototype.bitwiseTo=_o,n.prototype.changeBit=Xo,n.prototype.addTo=Ko,n.prototype.dMultiply=ai,n.prototype.dAddOffset=ci,n.prototype.multiplyLowerTo=pi,n.prototype.multiplyUpperTo=hi,n.prototype.modInt=xi,n.prototype.millerRabin=Ei,n.prototype.clone=So,n.prototype.intValue=To,n.prototype.byteValue=Co,n.prototype.shortValue=Eo,n.prototype.signum=Io,n.prototype.toByteArray=Do,n.prototype.equals=ko,n.prototype.min=Po,n.prototype.max=Oo,n.prototype.and=No,n.prototype.or=Lo,n.prototype.xor=Uo,n.prototype.andNot=$o,n.prototype.not=Vo,n.prototype.shiftLeft=jo,n.prototype.shiftRight=zo,n.prototype.getLowestSetBit=Go,n.prototype.bitCount=Zo,n.prototype.testBit=Wo,n.prototype.setBit=Jo,n.prototype.clearBit=Yo,n.prototype.flipBit=Qo,n.prototype.add=ti,n.prototype.subtract=ei,n.prototype.multiply=ri,n.prototype.divide=si,n.prototype.remainder=oi,n.prototype.divideAndRemainder=ii,n.prototype.modPow=yi,n.prototype.modInverse=Si,n.prototype.pow=li,n.prototype.gcd=vi,n.prototype.isProbablePrime=Ci,n.prototype.square=ni,n.prototype.Barrett=Pt;var he,et,U;function Ai(s){et[U++]^=s&255,et[U++]^=s>>8&255,et[U++]^=s>>16&255,et[U++]^=s>>24&255,U>=Xe&&(U-=Xe)}function ln(){Ai(new Date().getTime())}if(et==null){et=new Array,U=0;var ft;if(typeof window<"u"&&window.crypto){if(window.crypto.getRandomValues){var pn=new Uint8Array(32);for(window.crypto.getRandomValues(pn),ft=0;ft<32;++ft)et[U++]=pn[ft]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var hn=window.crypto.random(32);for(ft=0;ft<hn.length;++ft)et[U++]=hn.charCodeAt(ft)&255}}for(;U<Xe;)ft=Math.floor(65536*Math.random()),et[U++]=ft>>>8,et[U++]=ft&255;U=0,ln()}function Ii(){if(he==null){for(ln(),he=Di(),he.init(et),U=0;U<et.length;++U)et[U]=0;U=0}return he.next()}function Bi(s){var o;for(o=0;o<s.length;++o)s[o]=Ii()}function Ze(){}Ze.prototype.nextBytes=Bi;function We(){this.i=0,this.j=0,this.S=new Array}function Ri(s){var o,a,c;for(o=0;o<256;++o)this.S[o]=o;for(a=0,o=0;o<256;++o)a=a+this.S[o]+s[o%s.length]&255,c=this.S[o],this.S[o]=this.S[a],this.S[a]=c;this.i=0,this.j=0}function Mi(){var s;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,s=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=s,this.S[s+this.S[this.i]&255]}We.prototype.init=Ri,We.prototype.next=Mi;function Di(){return new We}var Xe=256;typeof Le<"u"?Le=Os.exports={default:n,BigInteger:n,SecureRandom:Ze}:this.jsbn={BigInteger:n,SecureRandom:Ze}}).call(Le)});var pe=L(Ue=>{(function(){"use strict";var r={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function t(f){return n(u(f),arguments)}function e(f,d){return t.apply(null,[f].concat(d||[]))}function n(f,d){var g=1,A=f.length,l,y="",x,S,m,C,B,E,I,_;for(x=0;x<A;x++)if(typeof f[x]=="string")y+=f[x];else if(typeof f[x]=="object"){if(m=f[x],m.keys)for(l=d[g],S=0;S<m.keys.length;S++){if(l==null)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',m.keys[S],m.keys[S-1]));l=l[m.keys[S]]}else m.param_no?l=d[m.param_no]:l=d[g++];if(r.not_type.test(m.type)&&r.not_primitive.test(m.type)&&l instanceof Function&&(l=l()),r.numeric_arg.test(m.type)&&typeof l!="number"&&isNaN(l))throw new TypeError(t("[sprintf] expecting number but found %T",l));switch(r.number.test(m.type)&&(I=l>=0),m.type){case"b":l=parseInt(l,10).toString(2);break;case"c":l=String.fromCharCode(parseInt(l,10));break;case"d":case"i":l=parseInt(l,10);break;case"j":l=JSON.stringify(l,null,m.width?parseInt(m.width):0);break;case"e":l=m.precision?parseFloat(l).toExponential(m.precision):parseFloat(l).toExponential();break;case"f":l=m.precision?parseFloat(l).toFixed(m.precision):parseFloat(l);break;case"g":l=m.precision?String(Number(l.toPrecision(m.precision))):parseFloat(l);break;case"o":l=(parseInt(l,10)>>>0).toString(8);break;case"s":l=String(l),l=m.precision?l.substring(0,m.precision):l;break;case"t":l=String(!!l),l=m.precision?l.substring(0,m.precision):l;break;case"T":l=Object.prototype.toString.call(l).slice(8,-1).toLowerCase(),l=m.precision?l.substring(0,m.precision):l;break;case"u":l=parseInt(l,10)>>>0;break;case"v":l=l.valueOf(),l=m.precision?l.substring(0,m.precision):l;break;case"x":l=(parseInt(l,10)>>>0).toString(16);break;case"X":l=(parseInt(l,10)>>>0).toString(16).toUpperCase();break}r.json.test(m.type)?y+=l:(r.number.test(m.type)&&(!I||m.sign)?(_=I?"+":"-",l=l.toString().replace(r.sign,"")):_="",B=m.pad_char?m.pad_char==="0"?"0":m.pad_char.charAt(1):" ",E=m.width-(_+l).length,C=m.width&&E>0?B.repeat(E):"",y+=m.align?_+l+C:B==="0"?_+C+l:C+_+l)}return y}var i=Object.create(null);function u(f){if(i[f])return i[f];for(var d=f,g,A=[],l=0;d;){if((g=r.text.exec(d))!==null)A.push(g[0]);else if((g=r.modulo.exec(d))!==null)A.push("%");else if((g=r.placeholder.exec(d))!==null){if(g[2]){l|=1;var y=[],x=g[2],S=[];if((S=r.key.exec(x))!==null)for(y.push(S[1]);(x=x.substring(S[0].length))!=="";)if((S=r.key_access.exec(x))!==null)y.push(S[1]);else if((S=r.index_access.exec(x))!==null)y.push(S[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");g[2]=y}else l|=2;if(l===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");A.push({placeholder:g[0],param_no:g[1],keys:g[2],sign:g[3],pad_char:g[4],align:g[5],width:g[6],precision:g[7],type:g[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");d=d.substring(g[0].length)}return i[f]=A}typeof Ue<"u"&&(Ue.sprintf=t,Ue.vsprintf=e),typeof window<"u"&&(window.sprintf=t,window.vsprintf=e,typeof define=="function"&&define.amd&&define(function(){return{sprintf:t,vsprintf:e}}))})()});var Ru={};nt(Ru,{tcp:()=>Bu});var Js=j(yt("net"),1);var ge=class extends Error{code;type;constructor(t="The operation was aborted"){super(t),this.code=ge.code,this.type=ge.type}},Et=ge;Ye(Et,"code","ABORT_ERR"),Ye(Et,"type","aborted");var Q=class extends Error{code;props;constructor(t,e,n){super(t),this.code=e,this.name=n?.name??"CodeError",this.props=n??{}}};var rr={};nt(rr,{base58btc:()=>z,base58flickr:()=>qi});function Ui(r,t){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var i=0;i<r.length;i++){var u=r.charAt(i),f=u.charCodeAt(0);if(e[f]!==255)throw new TypeError(u+" is ambiguous");e[f]=i}var d=r.length,g=r.charAt(0),A=Math.log(d)/Math.log(256),l=Math.log(256)/Math.log(d);function y(m){if(m instanceof Uint8Array||(ArrayBuffer.isView(m)?m=new Uint8Array(m.buffer,m.byteOffset,m.byteLength):Array.isArray(m)&&(m=Uint8Array.from(m))),!(m instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(m.length===0)return"";for(var C=0,B=0,E=0,I=m.length;E!==I&&m[E]===0;)E++,C++;for(var _=(I-E)*l+1>>>0,N=new Uint8Array(_);E!==I;){for(var tt=m[E],J=0,W=_-1;(tt!==0||J<B)&&W!==-1;W--,J++)tt+=256*N[W]>>>0,N[W]=tt%d>>>0,tt=tt/d>>>0;if(tt!==0)throw new Error("Non-zero carry");B=J,E++}for(var Y=_-B;Y!==_&&N[Y]===0;)Y++;for(var ut=g.repeat(C);Y<_;++Y)ut+=r.charAt(N[Y]);return ut}function x(m){if(typeof m!="string")throw new TypeError("Expected String");if(m.length===0)return new Uint8Array;var C=0;if(m[C]!==" "){for(var B=0,E=0;m[C]===g;)B++,C++;for(var I=(m.length-C)*A+1>>>0,_=new Uint8Array(I);m[C];){var N=e[m.charCodeAt(C)];if(N===255)return;for(var tt=0,J=I-1;(N!==0||tt<E)&&J!==-1;J--,tt++)N+=d*_[J]>>>0,_[J]=N%256>>>0,N=N/256>>>0;if(N!==0)throw new Error("Non-zero carry");E=tt,C++}if(m[C]!==" "){for(var W=I-E;W!==I&&_[W]===0;)W++;for(var Y=new Uint8Array(B+(I-W)),ut=B;W!==I;)Y[ut++]=_[W++];return Y}}}function S(m){var C=x(m);if(C)return C;throw new Error(`Non-${t} character`)}return{encode:y,decodeUnsafe:x,decode:S}}var $i=Ui,Vi=$i,mn=Vi;var Ou=new Uint8Array(0);var gn=(r,t)=>{if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0},ct=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var bn=r=>new TextEncoder().encode(r),wn=r=>new TextDecoder().decode(r);var Qe=class{constructor(t,e,n){this.name=t,this.prefix=e,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},Ke=class{constructor(t,e,n){if(this.name=t,this.prefix=e,e.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return vn(this,t)}},tr=class{constructor(t){this.decoders=t}or(t){return vn(this,t)}decode(t){let e=t[0],n=this.decoders[e];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},vn=(r,t)=>new tr({...r.decoders||{[r.prefix]:r},...t.decoders||{[t.prefix]:t}}),er=class{constructor(t,e,n,i){this.name=t,this.prefix=e,this.baseEncode=n,this.baseDecode=i,this.encoder=new Qe(t,e,n),this.decoder=new Ke(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},jt=({name:r,prefix:t,encode:e,decode:n})=>new er(r,t,e,n),At=({prefix:r,name:t,alphabet:e})=>{let{encode:n,decode:i}=mn(e,t);return jt({prefix:r,name:t,encode:n,decode:u=>ct(i(u))})},ji=(r,t,e,n)=>{let i={};for(let l=0;l<t.length;++l)i[t[l]]=l;let u=r.length;for(;r[u-1]==="=";)--u;let f=new Uint8Array(u*e/8|0),d=0,g=0,A=0;for(let l=0;l<u;++l){let y=i[r[l]];if(y===void 0)throw new SyntaxError(`Non-${n} character`);g=g<<e|y,d+=e,d>=8&&(d-=8,f[A++]=255&g>>d)}if(d>=e||255&g<<8-d)throw new SyntaxError("Unexpected end of data");return f},zi=(r,t,e)=>{let n=t[t.length-1]==="=",i=(1<<e)-1,u="",f=0,d=0;for(let g=0;g<r.length;++g)for(d=d<<8|r[g],f+=8;f>e;)f-=e,u+=t[i&d>>f];if(f&&(u+=t[i&d<<e-f]),n)for(;u.length*e&7;)u+="=";return u},P=({name:r,prefix:t,bitsPerChar:e,alphabet:n})=>jt({prefix:t,name:r,encode(i){return zi(i,n,e)},decode(i){return ji(i,n,e,r)}});var z=At({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),qi=At({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Gi=Tn,xn=128,Hi=127,Zi=~Hi,Wi=Math.pow(2,31);function Tn(r,t,e){t=t||[],e=e||0;for(var n=e;r>=Wi;)t[e++]=r&255|xn,r/=128;for(;r&Zi;)t[e++]=r&255|xn,r>>>=7;return t[e]=r|0,Tn.bytes=e-n+1,t}var Xi=nr,Ji=128,Sn=127;function nr(r,n){var e=0,n=n||0,i=0,u=n,f,d=r.length;do{if(u>=d)throw nr.bytes=0,new RangeError("Could not decode varint");f=r[u++],e+=i<28?(f&Sn)<<i:(f&Sn)*Math.pow(2,i),i+=7}while(f>=Ji);return nr.bytes=u-n,e}var Yi=Math.pow(2,7),Qi=Math.pow(2,14),Ki=Math.pow(2,21),ta=Math.pow(2,28),ea=Math.pow(2,35),ra=Math.pow(2,42),na=Math.pow(2,49),sa=Math.pow(2,56),oa=Math.pow(2,63),ia=function(r){return r<Yi?1:r<Qi?2:r<Ki?3:r<ta?4:r<ea?5:r<ra?6:r<na?7:r<sa?8:r<oa?9:10},aa={encode:Gi,decode:Xi,encodingLength:ia},ca=aa,ae=ca;var ce=(r,t=0)=>[ae.decode(r,t),ae.decode.bytes],zt=(r,t,e=0)=>(ae.encode(r,t,e),t),qt=r=>ae.encodingLength(r);var Ot=(r,t)=>{let e=t.byteLength,n=qt(r),i=n+qt(e),u=new Uint8Array(i+e);return zt(r,u,0),zt(e,u,n),u.set(t,i),new Gt(r,e,t,u)},we=r=>{let t=ct(r),[e,n]=ce(t),[i,u]=ce(t.subarray(n)),f=t.subarray(n+u);if(f.byteLength!==i)throw new Error("Incorrect length");return new Gt(e,i,f,t)},Cn=(r,t)=>{if(r===t)return!0;{let e=t;return r.code===e.code&&r.size===e.size&&e.bytes instanceof Uint8Array&&gn(r.bytes,e.bytes)}},Gt=class{constructor(t,e,n,i){this.code=t,this.size=e,this.digest=n,this.bytes=i}};var sr={};nt(sr,{base32:()=>ht,base32hex:()=>pa,base32hexpad:()=>da,base32hexpadupper:()=>ma,base32hexupper:()=>ha,base32pad:()=>fa,base32padupper:()=>la,base32upper:()=>ua,base32z:()=>ga});var ht=P({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ua=P({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),fa=P({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),la=P({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),pa=P({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),ha=P({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),da=P({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ma=P({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ga=P({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var En=(r,t)=>{let{bytes:e,version:n}=r;switch(n){case 0:return wa(e,or(r),t||z.encoder);default:return ya(e,or(r),t||ht.encoder)}};var An=new WeakMap,or=r=>{let t=An.get(r);if(t==null){let e=new Map;return An.set(r,e),e}return t},D=class{constructor(t,e,n,i){this.code=e,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:e}=this;if(t!==ue)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==va)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return D.createV0(e)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:e}=this.multihash,n=Ot(t,e);return D.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return D.equals(this,t)}static equals(t,e){let n=e;return n&&t.code===n.code&&t.version===n.version&&Cn(t.multihash,n.multihash)}toString(t){return En(this,t)}toJSON(){return{"/":En(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let e=t;if(e instanceof D)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){let{version:n,code:i,multihash:u,bytes:f}=e;return new D(n,i,u,f||In(n,i,u.bytes))}else if(e[xa]===!0){let{version:n,multihash:i,code:u}=e,f=we(i);return D.create(n,u,f)}else return null}static create(t,e,n){if(typeof e!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(e!==ue)throw new Error(`Version 0 CID must use dag-pb (code: ${ue}) block encoding`);return new D(t,e,n,n.bytes)}case 1:{let i=In(t,e,n.bytes);return new D(t,e,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return D.create(0,ue,t)}static createV1(t,e){return D.create(1,t,e)}static decode(t){let[e,n]=D.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return e}static decodeFirst(t){let e=D.inspectBytes(t),n=e.size-e.multihashSize,i=ct(t.subarray(n,n+e.multihashSize));if(i.byteLength!==e.multihashSize)throw new Error("Incorrect length");let u=i.subarray(e.multihashSize-e.digestSize),f=new Gt(e.multihashCode,e.digestSize,u,i);return[e.version===0?D.createV0(f):D.createV1(e.codec,f),t.subarray(e.size)]}static inspectBytes(t){let e=0,n=()=>{let[y,x]=ce(t.subarray(e));return e+=x,y},i=n(),u=ue;if(i===18?(i=0,e=0):u=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let f=e,d=n(),g=n(),A=e+g,l=A-f;return{version:i,codec:u,multihashCode:d,digestSize:g,multihashSize:l,size:A}}static parse(t,e){let[n,i]=ba(t,e),u=D.decode(i);if(u.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return or(u).set(n,t),u}},ba=(r,t)=>{switch(r[0]){case"Q":{let e=t||z;return[z.prefix,e.decode(`${z.prefix}${r}`)]}case z.prefix:{let e=t||z;return[z.prefix,e.decode(r)]}case ht.prefix:{let e=t||ht;return[ht.prefix,e.decode(r)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],t.decode(r)]}}},wa=(r,t,e)=>{let{prefix:n}=e;if(n!==z.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let i=t.get(n);if(i==null){let u=e.encode(r).slice(1);return t.set(n,u),u}else return i},ya=(r,t,e)=>{let{prefix:n}=e,i=t.get(n);if(i==null){let u=e.encode(r);return t.set(n,u),u}else return i},ue=112,va=18,In=(r,t,e)=>{let n=qt(r),i=n+qt(t),u=new Uint8Array(i+e.byteLength);return zt(r,u,0),zt(t,u,n),u.set(e,i),u},xa=Symbol.for("@ipld/js-cid/CID");function Bn(r,t){if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0}var ir={};nt(ir,{identity:()=>Sa});var Sa=jt({prefix:"\0",name:"identity",encode:r=>wn(r),decode:r=>bn(r)});var ar={};nt(ar,{base2:()=>Ta});var Ta=P({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var cr={};nt(cr,{base8:()=>Ca});var Ca=P({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var ur={};nt(ur,{base10:()=>Ea});var Ea=At({prefix:"9",name:"base10",alphabet:"0123456789"});var fr={};nt(fr,{base16:()=>Aa,base16upper:()=>Ia});var Aa=P({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ia=P({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var lr={};nt(lr,{base36:()=>Ba,base36upper:()=>Ra});var Ba=At({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Ra=At({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var hr={};nt(hr,{base64:()=>pr,base64pad:()=>Ma,base64url:()=>Da,base64urlpad:()=>ka});var pr=P({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Ma=P({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Da=P({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ka=P({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var dr={};nt(dr,{base256emoji:()=>Na});var Rn=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Pa=Rn.reduce((r,t,e)=>(r[e]=t,r),[]),Oa=Rn.reduce((r,t,e)=>(r[t.codePointAt(0)]=e,r),[]);function _a(r){return r.reduce((t,e)=>(t+=Pa[e],t),"")}function Fa(r){let t=[];for(let e of r){let n=Oa[e.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${e}`);t.push(n)}return new Uint8Array(t)}var Na=jt({prefix:"\u{1F680}",name:"base256emoji",encode:_a,decode:Fa});var wr={};nt(wr,{sha256:()=>La,sha512:()=>Ua});var br=j(yt("crypto"),1);var gr=({name:r,code:t,encode:e})=>new mr(r,t,e),mr=class{constructor(t,e,n){this.name=t,this.code=e,this.encode=n}digest(t){if(t instanceof Uint8Array){let e=this.encode(t);return e instanceof Uint8Array?Ot(this.code,e):e.then(n=>Ot(this.code,n))}else throw Error("Unknown type, must be binary type")}};var La=gr({name:"sha2-256",code:18,encode:r=>ct(br.default.createHash("sha256").update(r).digest())}),Ua=gr({name:"sha2-512",code:19,encode:r=>ct(br.default.createHash("sha512").update(r).digest())});var yr={};nt(yr,{identity:()=>ja});var Dn=0,$a="identity",kn=ct,Va=r=>Ot(Dn,kn(r)),ja={code:Dn,name:$a,encode:kn,digest:Va};var uf=new TextEncoder,ff=new TextDecoder;var fe={...ir,...ar,...cr,...ur,...fr,...sr,...lr,...rr,...hr,...dr},mf={...wr,...yr};function Zt(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function ye(r=0){return globalThis.Buffer?.allocUnsafe!=null?Zt(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function On(r,t,e,n){return{name:r,prefix:t,encoder:{name:r,prefix:t,encode:e},decoder:{decode:n}}}var Pn=On("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),vr=On("ascii","a",r=>{let t="a";for(let e=0;e<r.length;e++)t+=String.fromCharCode(r[e]);return t},r=>{r=r.substring(1);let t=ye(r.length);for(let e=0;e<r.length;e++)t[e]=r.charCodeAt(e);return t}),Ga={utf8:Pn,"utf-8":Pn,hex:fe.base16,latin1:vr,ascii:vr,binary:vr,...fe},ve=Ga;function K(r,t="utf8"){let e=ve[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):e.encoder.encode(r).substring(1)}var Pr=j(xe(),1);function vt(r,t){t==null&&(t=r.reduce((i,u)=>i+u.length,0));let e=ye(t),n=0;for(let i of r)e.set(i,n),n+=i.length;return Zt(e)}var Wt=j(xe(),1);var Se=class{index=0;input="";new(t){return this.index=0,this.input=t,this}readAtomically(t){let e=this.index,n=t();return n===void 0&&(this.index=e),n}parseWith(t){let e=t();if(this.index===this.input.length)return e}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(t){return this.readAtomically(()=>{let e=this.readChar();if(e===t)return e})}readSeparator(t,e,n){return this.readAtomically(()=>{if(!(e>0&&this.readGivenChar(t)===void 0))return n()})}readNumber(t,e,n,i){return this.readAtomically(()=>{let u=0,f=0,d=this.peekChar();if(d===void 0)return;let g=d==="0",A=2**(8*i)-1;for(;;){let l=this.readAtomically(()=>{let y=this.readChar();if(y===void 0)return;let x=Number.parseInt(y,t);if(!Number.isNaN(x))return x});if(l===void 0)break;if(u*=t,u+=l,u>A||(f+=1,e!==void 0&&f>e))return}if(f!==0)return!n&&g&&f>1?void 0:u})}readIPv4Addr(){return this.readAtomically(()=>{let t=new Uint8Array(4);for(let e=0;e<t.length;e++){let n=this.readSeparator(".",e,()=>this.readNumber(10,3,!1,1));if(n===void 0)return;t[e]=n}return t})}readIPv6Addr(){let t=e=>{for(let n=0;n<e.length/2;n++){let i=n*2;if(n<e.length-3){let f=this.readSeparator(":",n,()=>this.readIPv4Addr());if(f!==void 0)return e[i]=f[0],e[i+1]=f[1],e[i+2]=f[2],e[i+3]=f[3],[i+4,!0]}let u=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(u===void 0)return[i,!1];e[i]=u>>8,e[i+1]=u&255}return[e.length,!1]};return this.readAtomically(()=>{let e=new Uint8Array(16),[n,i]=t(e);if(n===16)return e;if(i||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let u=new Uint8Array(14),f=16-(n+2),[d]=t(u.subarray(0,f));return e.set(u.subarray(0,d),16-d),e})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var Of=new Se;var jf=parseInt("0xFFFF",16),zf=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);function Tr(r,t="utf8"){let e=ve[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Zt(globalThis.Buffer.from(r,"utf-8")):e.decoder.decode(`${e.prefix}${r}`)}var gt=j(xe(),1);var It=yt("node:net");function Te(r){return!!(0,It.isIP)(r)}var Hn=It.isIPv4,fc=It.isIPv6,Cr=function(r){let t=0;if(r=r.toString().trim(),Hn(r)){let e=new Uint8Array(t+4);return r.split(/\./g).forEach(n=>{e[t++]=parseInt(n,10)&255}),e}if(fc(r)){let e=r.split(":",8),n;for(n=0;n<e.length;n++){let u=Hn(e[n]),f;u&&(f=Cr(e[n]),e[n]=K(f.slice(0,2),"base16")),f!=null&&++n<8&&e.splice(n,0,K(f.slice(2,4),"base16"))}if(e[0]==="")for(;e.length<8;)e.unshift("0");else if(e[e.length-1]==="")for(;e.length<8;)e.push("0");else if(e.length<8){for(n=0;n<e.length&&e[n]!=="";n++);let u=[n,1];for(n=9-e.length;n>0;n--)u.push("0");e.splice.apply(e,u)}let i=new Uint8Array(t+16);for(n=0;n<e.length;n++){let u=parseInt(e[n],16);i[t++]=u>>8&255,i[t++]=u&255}return i}throw new Error("invalid ip address")},Zn=function(r,t=0,e){t=~~t,e=e??r.length-t;let n=new DataView(r.buffer);if(e===4){let i=[];for(let u=0;u<e;u++)i.push(r[t+u]);return i.join(".")}if(e===16){let i=[];for(let u=0;u<e;u+=2)i.push(n.getUint16(t+u).toString(16));return i.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var le={},Er={},pc=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,-1,"ip6zone"],[43,8,"ipcidr"],[53,-1,"dns",!0],[54,-1,"dns4",!0],[55,-1,"dns6",!0],[56,-1,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc-direct"],[281,0,"webrtc"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,-1,"unix",!1,!0],[421,-1,"ipfs"],[421,-1,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,-1,"garlic64"],[448,0,"tls"],[449,-1,"sni"],[460,0,"quic"],[461,0,"quic-v1"],[465,0,"webtransport"],[466,-1,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,-1,"memory"]];pc.forEach(r=>{let t=hc(...r);Er[t.code]=t,le[t.name]=t});function hc(r,t,e,n,i){return{code:r,size:t,name:e,resolvable:!!n,path:!!i}}function R(r){if(typeof r=="number"){if(Er[r]!=null)return Er[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(le[r]!=null)return le[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var Ml=R("ip4"),Dl=R("ip6"),kl=R("ipcidr");function Qn(r,t){switch(R(r).code){case 4:case 41:return mc(t);case 42:return Jn(t);case 6:case 273:case 33:case 132:return ts(t).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Jn(t);case 421:return yc(t);case 444:return Yn(t);case 445:return Yn(t);case 466:return wc(t);default:return K(t,"base16")}}function Kn(r,t){switch(R(r).code){case 4:return Wn(t);case 41:return Wn(t);case 42:return Xn(t);case 6:case 273:case 33:case 132:return Ir(parseInt(t,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Xn(t);case 421:return gc(t);case 444:return vc(t);case 445:return xc(t);case 466:return bc(t);default:return Tr(t,"base16")}}var Ar=Object.values(fe).map(r=>r.decoder),dc=function(){let r=Ar[0].or(Ar[1]);return Ar.slice(2).forEach(t=>r=r.or(t)),r}();function Wn(r){if(!Te(r))throw new Error("invalid ip address");return Cr(r)}function mc(r){let t=Zn(r,0,r.length);if(t==null)throw new Error("ipBuff is required");if(!Te(t))throw new Error("invalid ip address");return t}function Ir(r){let t=new ArrayBuffer(2);return new DataView(t).setUint16(0,r),new Uint8Array(t)}function ts(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function Xn(r){let t=Tr(r),e=Uint8Array.from(gt.default.encode(t.length));return vt([e,t],e.length+t.length)}function Jn(r){let t=gt.default.decode(r);if(r=r.slice(gt.default.decode.bytes),r.length!==t)throw new Error("inconsistent lengths");return K(r)}function gc(r){let t;r[0]==="Q"||r[0]==="1"?t=we(z.decode(`z${r}`)).bytes:t=D.parse(r).multihash.bytes;let e=Uint8Array.from(gt.default.encode(t.length));return vt([e,t],e.length+t.length)}function bc(r){let t=dc.decode(r),e=Uint8Array.from(gt.default.encode(t.length));return vt([e,t],e.length+t.length)}function wc(r){let t=gt.default.decode(r),e=r.slice(gt.default.decode.bytes);if(e.length!==t)throw new Error("inconsistent lengths");return"u"+K(e,"base64url")}function yc(r){let t=gt.default.decode(r),e=r.slice(gt.default.decode.bytes);if(e.length!==t)throw new Error("inconsistent lengths");return K(e,"base58btc")}function vc(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==16)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion address.`);let e=ht.decode("b"+t[0]),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=Ir(n);return vt([e,i],e.length+i.length)}function xc(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==56)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion3 address.`);let e=ht.decode(`b${t[0]}`),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=Ir(n);return vt([e,i],e.length+i.length)}function Yn(r){let t=r.slice(0,r.length-2),e=r.slice(r.length-2),n=K(t,"base32"),i=ts(e);return`${n}:${i}`}function Sc(r){let t=[],e=r.split("/").slice(1);if(e.length===1&&e[0]==="")return[];for(let n=0;n<e.length;n++){let i=e[n],u=R(i);if(u.size===0){t.push([i]);continue}if(n++,n>=e.length)throw rs("invalid address: "+r);if(u.path===!0){t.push([i,kr(e.slice(n).join("/"))]);break}t.push([i,e[n]])}return t}function Tc(r){let t=[];return r.map(e=>{let n=Ae(e);return t.push(n.name),e.length>1&&e[1]!=null&&t.push(e[1]),null}),kr(t.join("/"))}function Cc(r){return r.map(t=>{Array.isArray(t)||(t=[t]);let e=Ae(t);return t.length>1?[e.code,Kn(e.code,t[1])]:[e.code]})}function Br(r){return r.map(t=>{let e=Ae(t);return t[1]!=null?[e.code,Qn(e.code,t[1])]:[e.code]})}function Rr(r){return Ee(vt(r.map(t=>{let e=Ae(t),n=Uint8Array.from(Wt.default.encode(e.code));return t.length>1&&t[1]!=null&&(n=vt([n,t[1]])),n})))}function Mr(r,t){return r.size>0?r.size/8:r.size===0?0:Wt.default.decode(t)+(Wt.default.decode.bytes??0)}function Ce(r){let t=[],e=0;for(;e<r.length;){let n=Wt.default.decode(r,e),i=Wt.default.decode.bytes??0,u=R(n),f=Mr(u,r.slice(e+i));if(f===0){t.push([n]),e+=i;continue}let d=r.slice(e+i,e+i+f);if(e+=f+i,e>r.length)throw rs("Invalid address Uint8Array: "+K(r,"base16"));t.push([n,d])}return t}function Dr(r){let t=Ce(r),e=Br(t);return Tc(e)}function Ec(r){r=kr(r);let t=Sc(r),e=Cc(t);return Rr(e)}function es(r){return Ec(r)}function Ee(r){let t=Ac(r);if(t!=null)throw t;return Uint8Array.from(r)}function Ac(r){try{Ce(r)}catch(t){return t}}function kr(r){return"/"+r.trim().split("/").filter(t=>t).join("/")}function rs(r){return new Error("Error parsing address: "+r)}function Ae(r){return R(r[0])}var Bc=Symbol.for("nodejs.util.inspect.custom"),Rc=[R("dns").code,R("dns4").code,R("dns6").code,R("dnsaddr").code],Mc=new Map,ns=Symbol.for("@multiformats/js-multiaddr/multiaddr");function Dc(r){return!!r?.[ns]}var xt=class{bytes;#t;#r;#n;#e;[ns]=!0;constructor(t){if(t==null&&(t=""),t instanceof Uint8Array)this.bytes=Ee(t);else if(typeof t=="string"){if(t.length>0&&t.charAt(0)!=="/")throw new Error(`multiaddr "${t}" must start with a "/"`);this.bytes=es(t)}else if(Dc(t))this.bytes=Ee(t.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr")}toString(){return this.#t==null&&(this.#t=Dr(this.bytes)),this.#t}toJSON(){return this.toString()}toOptions(){let t,e,n,i,u="",f=R("tcp"),d=R("udp"),g=R("ip4"),A=R("ip6"),l=R("dns6"),y=R("ip6zone");for(let[S,m]of this.stringTuples())S===y.code&&(u=`%${m??""}`),Rc.includes(S)&&(e=f.name,i=443,n=`${m??""}${u}`,t=S===l.code?6:4),(S===f.code||S===d.code)&&(e=R(S).name,i=parseInt(m??"")),(S===g.code||S===A.code)&&(e=R(S).name,n=`${m??""}${u}`,t=S===A.code?6:4);if(t==null||e==null||n==null||i==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:t,host:n,transport:e,port:i}}protos(){return this.protoCodes().map(t=>Object.assign({},R(t)))}protoCodes(){let t=[],e=this.bytes,n=0;for(;n<e.length;){let i=Pr.default.decode(e,n),u=Pr.default.decode.bytes??0,f=R(i),d=Mr(f,e.slice(n+u));n+=d+u,t.push(i)}return t}protoNames(){return this.protos().map(t=>t.name)}tuples(){return this.#r==null&&(this.#r=Ce(this.bytes)),this.#r}stringTuples(){return this.#n==null&&(this.#n=Br(this.tuples())),this.#n}encapsulate(t){return t=new xt(t),new xt(this.toString()+t.toString())}decapsulate(t){let e=t.toString(),n=this.toString(),i=n.lastIndexOf(e);if(i<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${t.toString()}`);return new xt(n.slice(0,i))}decapsulateCode(t){let e=this.tuples();for(let n=e.length-1;n>=0;n--)if(e[n][0]===t)return new xt(Rr(e.slice(0,n)));return this}getPeerId(){try{let e=this.stringTuples().filter(n=>n[0]===le.ipfs.code).pop();if(e?.[1]!=null){let n=e[1];return n[0]==="Q"||n[0]==="1"?K(z.decode(`z${n}`),"base58btc"):K(D.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){if(this.#e===void 0)try{this.#e=this.stringTuples().filter(t=>R(t[0]).path===!0)[0][1],this.#e==null&&(this.#e=null)}catch{this.#e=null}return this.#e}equals(t){return Bn(this.bytes,t.bytes)}async resolve(t){let e=this.protos().find(u=>u.resolvable);if(e==null)return[this];let n=Mc.get(e.name);if(n==null)throw new Q(`no available resolver for ${e.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,t)).map(u=>new xt(u))}nodeAddress(){let t=this.toOptions();if(t.transport!=="tcp"&&t.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${t.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:t.family,address:t.host,port:t.port}}isThinWaistAddress(t){let e=(t??this).protos();return!(e.length!==2||e[0].code!==4&&e[0].code!==41||e[1].code!==6&&e[1].code!==273)}[Bc](){return`Multiaddr(${Dr(this.bytes)})`}};function bt(r){return new xt(r)}var kc=w("dns4"),Pc=w("dns6"),Oc=w("dnsaddr"),Ft=F(w("dns"),Oc,kc,Pc),Re=F(w("ip4"),w("ip6")),Rt=F(T(Re,w("tcp")),T(Ft,w("tcp"))),Me=T(Re,w("udp")),_c=T(Me,w("utp")),Fc=T(Me,w("quic")),Nc=T(Me,w("quic-v1")),Or=F(T(Rt,w("ws")),T(Ft,w("ws"))),Ie=F(T(Or,w("p2p")),Or),_r=F(T(Rt,w("wss")),T(Ft,w("wss")),T(Rt,w("tls"),w("ws")),T(Ft,w("tls"),w("ws"))),Be=F(T(_r,w("p2p")),_r),Fr=F(T(Rt,w("http")),T(Re,w("http")),T(Ft,w("http"))),Nr=F(T(Rt,w("https")),T(Re,w("https")),T(Ft,w("https"))),ss=T(Me,w("webrtc-direct"),w("certhash")),as=F(T(ss,w("p2p")),ss),os=T(Nc,w("webtransport"),w("certhash"),w("certhash")),cs=F(T(os,w("p2p")),os),us=F(T(Ie,w("p2p-webrtc-star"),w("p2p")),T(Be,w("p2p-webrtc-star"),w("p2p")),T(Ie,w("p2p-webrtc-star")),T(Be,w("p2p-webrtc-star"))),Ql=F(T(Ie,w("p2p-websocket-star"),w("p2p")),T(Be,w("p2p-websocket-star"),w("p2p")),T(Ie,w("p2p-websocket-star")),T(Be,w("p2p-websocket-star"))),fs=F(T(Fr,w("p2p-webrtc-direct"),w("p2p")),T(Nr,w("p2p-webrtc-direct"),w("p2p")),T(Fr,w("p2p-webrtc-direct")),T(Nr,w("p2p-webrtc-direct"))),Nt=F(Or,_r,Fr,Nr,us,fs,Rt,_c,Fc,Ft,as,cs),Kl=F(T(Nt,w("p2p-stardust"),w("p2p")),T(Nt,w("p2p-stardust"))),Bt=F(T(Nt,w("p2p")),us,fs,as,cs,w("p2p")),is=F(T(Bt,w("p2p-circuit"),Bt),T(Bt,w("p2p-circuit")),T(w("p2p-circuit"),Bt),T(Nt,w("p2p-circuit")),T(w("p2p-circuit"),Nt),w("p2p-circuit")),ls=()=>F(T(is,ls),is),_t=ls(),tp=F(T(_t,Bt,_t),T(Bt,_t),T(_t,Bt),_t,Bt);var ep=F(T(_t,w("webrtc"),w("p2p")),T(_t,w("webrtc")),T(Nt,w("webrtc"),w("p2p")),T(Nt,w("webrtc")),w("webrtc"));function ps(r){function t(e){let n;try{n=bt(e)}catch{return!1}let i=r(n.protoNames());return i===null?!1:i===!0||i===!1?i:i.length===0}return t}function T(...r){function t(e){if(e.length<r.length)return null;let n=e;return r.some(i=>(n=typeof i=="function"?i().partialMatch(e):i.partialMatch(e),Array.isArray(n)&&(e=n),n===null)),n}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:ps(t),partialMatch:t}}function F(...r){function t(n){let i=null;return r.some(u=>{let f=typeof u=="function"?u().partialMatch(n):u.partialMatch(n);return f!=null?(i=f,!0):!1}),i}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:ps(t),partialMatch:t}}function w(r){let t=r;function e(i){let u;try{u=bt(i)}catch{return!1}let f=u.protoNames();return f.length===1&&f[0]===t}function n(i){return i.length===0?null:i[0]===t?i.slice(1):null}return{toString:function(){return t},matches:e,partialMatch:n}}var ot=j(Ts(),1);ot.default.formatters.b=r=>r==null?"undefined":z.baseEncode(r);ot.default.formatters.t=r=>r==null?"undefined":ht.baseEncode(r);ot.default.formatters.m=r=>r==null?"undefined":pr.baseEncode(r);ot.default.formatters.p=r=>r==null?"undefined":r.toString();ot.default.formatters.c=r=>r==null?"undefined":r.toString();ot.default.formatters.k=r=>r==null?"undefined":r.toString();ot.default.formatters.a=r=>r==null?"undefined":r.toString();function cu(r){let t=()=>{};return t.enabled=!1,t.color="",t.diff=0,t.log=()=>{},t.namespace=r,t.destroy=()=>!0,t.extend=()=>t,t}function Mt(r){let t=cu(`${r}:trace`);return ot.default.enabled(`${r}:trace`)&&ot.default.names.map(e=>e.toString()).find(e=>e.includes(":trace"))!=null&&(t=(0,ot.default)(`${r}:trace`)),Object.assign((0,ot.default)(r),{error:(0,ot.default)(`${r}:error`),trace:t})}var Hs=j(Ds(),1);function Fe(r){return this.subnetMask<r.subnetMask?!1:this.mask(r.subnetMask)===r.mask()}function Ne(r){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===r&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}var te=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g,zr=/\/\d{1,2}$/;var G=class extends Error{constructor(t,e){super(t),this.name="AddressError",e!==null&&(this.parseMessage=e)}};var ee=j(qr(),1),Ut=j(pe(),1),k=class{constructor(t){this.groups=4,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=Ne(32),this.isInSubnet=Fe,this.address=t;let e=zr.exec(t);if(e){if(this.parsedSubnet=e[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>32)throw new G("Invalid subnet mask.");t=t.replace(zr,"")}this.addressMinusSuffix=t,this.parsedAddress=this.parse(t)}static isValid(t){try{return new k(t),!0}catch{return!1}}parse(t){let e=t.split(".");if(!t.match(te))throw new G("Invalid IPv4 address.");return e}correctForm(){return this.parsedAddress.map(t=>parseInt(t,10)).join(".")}static fromHex(t){let e=t.replace(/:/g,"").padStart(8,"0"),n=[],i;for(i=0;i<8;i+=2){let u=e.slice(i,i+2);n.push(parseInt(u,16))}return new k(n.join("."))}static fromInteger(t){return k.fromHex(t.toString(16))}static fromArpa(t){let n=t.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new k(n)}toHex(){return this.parsedAddress.map(t=>(0,Ut.sprintf)("%02x",parseInt(t,10))).join(":")}toArray(){return this.parsedAddress.map(t=>parseInt(t,10))}toGroup6(){let t=[],e;for(e=0;e<4;e+=2){let n=(0,Ut.sprintf)("%02x%02x",parseInt(this.parsedAddress[e],10),parseInt(this.parsedAddress[e+1],10));t.push((0,Ut.sprintf)("%x",parseInt(n,16)))}return t.join(":")}bigInteger(){return new ee.BigInteger(this.parsedAddress.map(t=>(0,Ut.sprintf)("%02x",parseInt(t,10))).join(""),16)}_startAddress(){return new ee.BigInteger(this.mask()+"0".repeat(32-this.subnetMask),2)}startAddress(){return k.fromBigInteger(this._startAddress())}startAddressExclusive(){let t=new ee.BigInteger("1");return k.fromBigInteger(this._startAddress().add(t))}_endAddress(){return new ee.BigInteger(this.mask()+"1".repeat(32-this.subnetMask),2)}endAddress(){return k.fromBigInteger(this._endAddress())}endAddressExclusive(){let t=new ee.BigInteger("1");return k.fromBigInteger(this._endAddress().subtract(t))}static fromBigInteger(t){return k.fromInteger(parseInt(t.toString(),10))}mask(t){return t===void 0&&(t=this.subnetMask),this.getBitsBase2(0,t)}getBitsBase2(t,e){return this.binaryZeroPad().slice(t,e)}reverseForm(t){t||(t={});let e=this.correctForm().split(".").reverse().join(".");return t.omitSuffix?e:(0,Ut.sprintf)("%s.in-addr.arpa.",e)}isMulticast(){return this.isInSubnet(new k("224.0.0.0/4"))}binaryZeroPad(){return this.bigInteger().toString(2).padStart(32,"0")}groupForV6(){let t=this.parsedAddress;return this.address.replace(te,(0,Ut.sprintf)('<span class="hover-group group-v4 group-6">%s</span>.<span class="hover-group group-v4 group-7">%s</span>',t.slice(0,2).join("."),t.slice(2,4).join(".")))}};var Fs={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"},Gr={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"},Hr=/([^0-9a-f:/%])/gi,Zr=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi,Wr=/\/\d{1,3}(?=%|$)/,Xr=/%.*$/,Ns=new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/),Ls=new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/);var $s=j(pe(),1);function hu(r){return r.replace(/^(0+)/,'<span class="zero">$1</span>')}function $e(r,t=0){return r.split(":").map((n,i)=>/group-v4/.test(n)?n:(0,$s.sprintf)('<span class="hover-group group-%d">%s</span>',i+t,hu(n)))}var Vt=j(pe(),1);function Yr(r){return(0,Vt.sprintf)("(%s)",r.join("|"))}function Jr(r){return r.length<4?(0,Vt.sprintf)("0{0,%d}%s",4-r.length,r):r}var Qr="[^A-Fa-f0-9:]";function Ve(r){let t=[];r.forEach((n,i)=>{parseInt(n,16)===0&&t.push(i)});let e=t.map(n=>r.map((i,u)=>{if(u===n){let f=u===0||u===8-1?":":"";return Yr([Jr(i),f])}return Jr(i)}).join(":"));return e.push(r.map(Jr).join(":")),Yr(e)}function Kr(r,t,e){let n=t?"":":",i=e?"":":",u=[];!t&&!e&&u.push("::"),t&&e&&u.push(""),(e&&!t||!e&&t)&&u.push(":"),u.push((0,Vt.sprintf)("%s(:0{1,4}){1,%d}",n,r-1)),u.push((0,Vt.sprintf)("(0{1,4}:){1,%d}%s",r-1,i)),u.push((0,Vt.sprintf)("(0{1,4}:){%d}0{1,4}",r-1));for(let f=1;f<r-1;f++)for(let d=1;d<r-f;d++)u.push((0,Vt.sprintf)("(0{1,4}:){%d}:(0{1,4}:){%d}0{1,4}",d,r-d-f-1));return Yr(u)}var H=j(qr(),1),Z=j(pe(),1);function je(r){if(!r)throw new Error("Assertion failed.")}function du(r){let t=/(\d+)(\d{3})/;for(;t.test(r);)r=r.replace(t,"$1,$2");return r}function mu(r){return r=r.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),r=r.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),r}function gu(r,t){let e=[],n=[],i;for(i=0;i<r.length;i++)i<t[0]?e.push(r[i]):i>t[1]&&n.push(r[i]);return e.concat(["compact"]).concat(n)}function js(r){return(0,Z.sprintf)("%04x",parseInt(r,16))}function zs(r){return r&255}var O=class{constructor(t,e){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=Fe,this.isCorrect=Ne(128),e===void 0?this.groups=8:this.groups=e,this.address=t;let n=Wr.exec(t);if(n){if(this.parsedSubnet=n[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>128)throw new G("Invalid subnet mask.");t=t.replace(Wr,"")}else if(/\//.test(t))throw new G("Invalid subnet mask.");let i=Xr.exec(t);i&&(this.zone=i[0],t=t.replace(Xr,"")),this.addressMinusSuffix=t,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(t){try{return new O(t),!0}catch{return!1}}static fromBigInteger(t){let e=t.toString(16).padStart(32,"0"),n=[],i;for(i=0;i<8;i++)n.push(e.slice(i*4,(i+1)*4));return new O(n.join(":"))}static fromURL(t){let e,n=null,i;if(t.indexOf("[")!==-1&&t.indexOf("]:")!==-1){if(i=Ls.exec(t),i===null)return{error:"failed to parse address with port",address:null,port:null};e=i[1],n=i[2]}else if(t.indexOf("/")!==-1){if(t=t.replace(/^[a-z0-9]+:\/\//,""),i=Ns.exec(t),i===null)return{error:"failed to parse address from URL",address:null,port:null};e=i[1]}else e=t;return n?(n=parseInt(n,10),(n<0||n>65536)&&(n=null)):n=null,{address:new O(e),port:n}}static fromAddress4(t){let e=new k(t),n=128-(32-e.subnetMask);return new O(`::ffff:${e.correctForm()}/${n}`)}static fromArpa(t){let e=t.replace(/(\.ip6\.arpa)?\.$/,""),n=7;if(e.length!==63)throw new G("Invalid 'ip6.arpa' form.");let i=e.split(".").reverse();for(let u=n;u>0;u--){let f=u*4;i.splice(f,0,":")}return e=i.join(""),new O(e)}microsoftTranscription(){return(0,Z.sprintf)("%s.ipv6-literal.net",this.correctForm().replace(/:/g,"-"))}mask(t=this.subnetMask){return this.getBitsBase2(0,t)}possibleSubnets(t=128){let e=128-this.subnetMask,n=Math.abs(t-128),i=e-n;return i<0?"0":du(new H.BigInteger("2",10).pow(i).toString(10))}_startAddress(){return new H.BigInteger(this.mask()+"0".repeat(128-this.subnetMask),2)}startAddress(){return O.fromBigInteger(this._startAddress())}startAddressExclusive(){let t=new H.BigInteger("1");return O.fromBigInteger(this._startAddress().add(t))}_endAddress(){return new H.BigInteger(this.mask()+"1".repeat(128-this.subnetMask),2)}endAddress(){return O.fromBigInteger(this._endAddress())}endAddressExclusive(){let t=new H.BigInteger("1");return O.fromBigInteger(this._endAddress().subtract(t))}getScope(){let t=Fs[this.getBits(12,16).intValue()];return this.getType()==="Global unicast"&&t!=="Link local"&&(t="Global"),t||"Unknown"}getType(){for(let t of Object.keys(Gr))if(this.isInSubnet(new O(t)))return Gr[t];return"Global unicast"}getBits(t,e){return new H.BigInteger(this.getBitsBase2(t,e),2)}getBitsBase2(t,e){return this.binaryZeroPad().slice(t,e)}getBitsBase16(t,e){let n=e-t;if(n%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(t,e).toString(16).padStart(n/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,128)}reverseForm(t){t||(t={});let e=Math.floor(this.subnetMask/4),n=this.canonicalForm().replace(/:/g,"").split("").slice(0,e).reverse().join(".");return e>0?t.omitSuffix?n:(0,Z.sprintf)("%s.ip6.arpa.",n):t.omitSuffix?"":"ip6.arpa."}correctForm(){let t,e=[],n=0,i=[];for(t=0;t<this.parsedAddress.length;t++){let d=parseInt(this.parsedAddress[t],16);d===0&&n++,d!==0&&n>0&&(n>1&&i.push([t-n,t-1]),n=0)}n>1&&i.push([this.parsedAddress.length-n,this.parsedAddress.length-1]);let u=i.map(d=>d[1]-d[0]+1);if(i.length>0){let d=u.indexOf(Math.max(...u));e=gu(this.parsedAddress,i[d])}else e=this.parsedAddress;for(t=0;t<e.length;t++)e[t]!=="compact"&&(e[t]=parseInt(e[t],16).toString(16));let f=e.join(":");return f=f.replace(/^compact$/,"::"),f=f.replace(/^compact|compact$/,":"),f=f.replace(/compact/,""),f}binaryZeroPad(){return this.bigInteger().toString(2).padStart(128,"0")}parse4in6(t){let e=t.split(":"),i=e.slice(-1)[0].match(te);if(i){this.parsedAddress4=i[0],this.address4=new k(this.parsedAddress4);for(let u=0;u<this.address4.groups;u++)if(/^0[0-9]+/.test(this.address4.parsedAddress[u]))throw new G("IPv4 addresses can't have leading zeroes.",t.replace(te,this.address4.parsedAddress.map(mu).join(".")));this.v4=!0,e[e.length-1]=this.address4.toGroup6(),t=e.join(":")}return t}parse(t){t=this.parse4in6(t);let e=t.match(Hr);if(e)throw new G((0,Z.sprintf)("Bad character%s detected in address: %s",e.length>1?"s":"",e.join("")),t.replace(Hr,'<span class="parse-error">$1</span>'));let n=t.match(Zr);if(n)throw new G((0,Z.sprintf)("Address failed regex: %s",n.join("")),t.replace(Zr,'<span class="parse-error">$1</span>'));let i=[],u=t.split("::");if(u.length===2){let f=u[0].split(":"),d=u[1].split(":");f.length===1&&f[0]===""&&(f=[]),d.length===1&&d[0]===""&&(d=[]);let g=this.groups-(f.length+d.length);if(!g)throw new G("Error parsing groups");this.elidedGroups=g,this.elisionBegin=f.length,this.elisionEnd=f.length+this.elidedGroups,i=i.concat(f);for(let A=0;A<g;A++)i.push("0");i=i.concat(d)}else if(u.length===1)i=t.split(":"),this.elidedGroups=0;else throw new G("Too many :: groups found");if(i=i.map(f=>(0,Z.sprintf)("%x",parseInt(f,16))),i.length!==this.groups)throw new G("Incorrect number of groups found");return i}canonicalForm(){return this.parsedAddress.map(js).join(":")}decimal(){return this.parsedAddress.map(t=>(0,Z.sprintf)("%05d",parseInt(t,16))).join(":")}bigInteger(){return new H.BigInteger(this.parsedAddress.map(js).join(""),16)}to4(){let t=this.binaryZeroPad().split("");return k.fromHex(new H.BigInteger(t.slice(96,128).join(""),2).toString(16))}to4in6(){let t=this.to4(),n=new O(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),i="";return/:$/.test(n)||(i=":"),n+i+t.address}inspectTeredo(){let t=this.getBitsBase16(0,32),e=this.getBits(80,96).xor(new H.BigInteger("ffff",16)).toString(),n=k.fromHex(this.getBitsBase16(32,64)),i=k.fromHex(this.getBits(96,128).xor(new H.BigInteger("ffffffff",16)).toString(16)),u=this.getBits(64,80),f=this.getBitsBase2(64,80),d=u.testBit(15),g=u.testBit(14),A=u.testBit(8),l=u.testBit(9),y=new H.BigInteger(f.slice(2,6)+f.slice(8,16),2).toString(10);return{prefix:(0,Z.sprintf)("%s:%s",t.slice(0,4),t.slice(4,8)),server4:n.address,client4:i.address,flags:f,coneNat:d,microsoft:{reserved:g,universalLocal:l,groupIndividual:A,nonce:y},udpPort:e}}inspect6to4(){let t=this.getBitsBase16(0,16),e=k.fromHex(this.getBitsBase16(16,48));return{prefix:(0,Z.sprintf)("%s",t.slice(0,4)),gateway:e.address}}to6to4(){if(!this.is4())return null;let t=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new O(t)}toByteArray(){let t=this.bigInteger().toByteArray();return t.length===17&&t[0]===0?t.slice(1):t}toUnsignedByteArray(){return this.toByteArray().map(zs)}static fromByteArray(t){return this.fromUnsignedByteArray(t.map(zs))}static fromUnsignedByteArray(t){let e=new H.BigInteger("256",10),n=new H.BigInteger("0",10),i=new H.BigInteger("1",10);for(let u=t.length-1;u>=0;u--)n=n.add(i.multiply(new H.BigInteger(t[u].toString(10),10))),i=i.multiply(e);return O.fromBigInteger(n)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){return this.getType()==="Multicast"}is4(){return this.v4}isTeredo(){return this.isInSubnet(new O("2001::/32"))}is6to4(){return this.isInSubnet(new O("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(t){return t===void 0?t="":t=(0,Z.sprintf)(":%s",t),(0,Z.sprintf)("http://[%s]%s/",this.correctForm(),t)}link(t){t||(t={}),t.className===void 0&&(t.className=""),t.prefix===void 0&&(t.prefix="/#address="),t.v4===void 0&&(t.v4=!1);let e=this.correctForm;return t.v4&&(e=this.to4in6),t.className?(0,Z.sprintf)('<a href="%1$s%2$s" class="%3$s">%2$s</a>',t.prefix,e.call(this),t.className):(0,Z.sprintf)('<a href="%1$s%2$s">%2$s</a>',t.prefix,e.call(this))}group(){if(this.elidedGroups===0)return $e(this.address).join(":");je(typeof this.elidedGroups=="number"),je(typeof this.elisionBegin=="number");let t=[],[e,n]=this.address.split("::");e.length?t.push(...$e(e)):t.push("");let i=["hover-group"];for(let u=this.elisionBegin;u<this.elisionBegin+this.elidedGroups;u++)i.push((0,Z.sprintf)("group-%d",u));return t.push((0,Z.sprintf)('<span class="%s"></span>',i.join(" "))),n.length?t.push(...$e(n,this.elisionEnd)):t.push(""),this.is4()&&(je(this.address4 instanceof k),t.pop(),t.push(this.address4.groupForV6())),t.join(":")}regularExpressionString(t=!1){let e=[],n=new O(this.correctForm());if(n.elidedGroups===0)e.push(Ve(n.parsedAddress));else if(n.elidedGroups===8)e.push(Kr(8));else{let i=n.address.split("::");i[0].length&&e.push(Ve(i[0].split(":"))),je(typeof n.elidedGroups=="number"),e.push(Kr(n.elidedGroups,i[0].length!==0,i[1].length!==0)),i[1].length&&e.push(Ve(i[1].split(":"))),e=[e.join(":")]}return t||(e=["(?=^|",Qr,"|[^\\w\\:])(",...e,")(?=[^\\w\\:]|",Qr,"|$)"]),e.join("")}regularExpression(t=!1){return new RegExp(this.regularExpressionString(t),"i")}};var bu=Mt("libp2p:ip-port-to-multiaddr"),tn={ERR_INVALID_IP_PARAMETER:"ERR_INVALID_IP_PARAMETER",ERR_INVALID_PORT_PARAMETER:"ERR_INVALID_PORT_PARAMETER",ERR_INVALID_IP:"ERR_INVALID_IP"};function qs(r,t){if(typeof r!="string")throw new Q(`invalid ip provided: ${r}`,tn.ERR_INVALID_IP_PARAMETER);if(typeof t=="string"&&(t=parseInt(t)),isNaN(t))throw new Q(`invalid port provided: ${t}`,tn.ERR_INVALID_PORT_PARAMETER);try{return new k(r),bt(`/ip4/${r}/tcp/${t}`)}catch{}try{let e=new O(r);return e.is4()?bt(`/ip4/${e.to4().correctForm()}/tcp/${t}`):bt(`/ip6/${r}/tcp/${t}`)}catch{let n=`invalid ip:port for creating a multiaddr: ${r}:${t}`;throw bu.error(n),new Q(n,tn.ERR_INVALID_IP)}}var en=j(yt("os"),1),Gs=j(yt("path"),1),wu={ip4:"IPv4",ip6:"IPv6"};function ne(r,t={}){let e=r.getPath();return e!=null?en.default.platform()==="win32"?{path:Gs.default.join("\\\\.\\pipe\\",e)}:{path:e}:{...r.toOptions(),...t}}function rn(r,t,e){let n=i=>bt(`/${r}/${i}/tcp/${e}`);return(yu(t)?xu(wu[r]):[t]).map(n)}function yu(r){return["0.0.0.0","::"].includes(r)}var vu=en.default.networkInterfaces();function xu(r){let t=[];for(let[,e]of Object.entries(vu))if(e!=null)for(let n of e)n.family===r&&t.push(n.address);return t}var mt=Mt("libp2p:tcp:socket"),ze=(r,t)=>{let e=t.metrics,n=t.metricPrefix??"",i=t.socketInactivityTimeout??3e5,u=t.socketCloseTimeout??2e3;t.listeningAddr?.getPath()!=null&&(t.remoteAddr=t.listeningAddr),t.remoteAddr?.getPath()!=null&&(t.localAddr=t.remoteAddr);let f;if(t.remoteAddr!=null)f=t.remoteAddr;else{if(r.remoteAddress==null||r.remotePort==null)throw new Q("Could not determine remote address or port","ERR_NO_REMOTE_ADDRESS");f=qs(r.remoteAddress,r.remotePort)}let d=ne(f),g=d.path??`${d.host??""}:${d.port??""}`,{sink:A,source:l}=Hs.default.duplex(r);r.setTimeout(i,()=>{mt("%s socket read timeout",g),e?.increment({[`${n}timeout`]:!0});let x;r.readable&&(x=new Q("Socket read timeout","ERR_SOCKET_READ_TIMEOUT")),r.destroy(x)}),r.once("close",()=>{mt("%s socket close",g),e?.increment({[`${n}close`]:!0}),y.timeline.close==null&&(y.timeline.close=Date.now())}),r.once("end",()=>{mt("%s socket end",g),e?.increment({[`${n}end`]:!0})});let y={async sink(x){try{await A(x)}catch(S){S.type!=="aborted"&&mt(S)}r.end()},source:l,remoteAddr:f,timeline:{open:Date.now()},async close(){if(r.destroyed){mt("%s socket was already destroyed when trying to close",g);return}mt("%s closing socket",g),await new Promise((x,S)=>{let m=Date.now(),C;r.once("close",()=>{mt("%s socket closed",g),C!==void 0&&clearTimeout(C),x()}),r.once("error",B=>{mt("%s socket error",g,B),y.timeline.close==null&&(y.timeline.close=Date.now()),r.destroyed&&C!==void 0&&clearTimeout(C),S(B)}),r.setTimeout(u),r.end(),r.writableLength>0?(C=setTimeout(()=>{r.destroyed?(mt("%s is already destroyed",g),x()):(mt("%s socket close timeout after %dms, destroying it manually",g,Date.now()-m),r.destroy(new Q("Socket close timeout","ERR_SOCKET_CLOSE_TIMEOUT")))},u).unref(),r.once("drain",()=>{mt("%s socket drained",g),r.destroy()})):r.destroy()})}};return y};var Zs=j(yt("net"),1);var qe=class extends EventTarget{#t=new Map;listenerCount(t){let e=this.#t.get(t);return e==null?0:e.length}addEventListener(t,e,n){super.addEventListener(t,e,n);let i=this.#t.get(t);i==null&&(i=[],this.#t.set(t,i)),i.push({callback:e,once:(n!==!0&&n!==!1&&n?.once)??!1})}removeEventListener(t,e,n){super.removeEventListener(t.toString(),e??null,n);let i=this.#t.get(t);i!=null&&(i=i.filter(({callback:u})=>u!==e),this.#t.set(t,i))}dispatchEvent(t){let e=super.dispatchEvent(t),n=this.#t.get(t.type);return n==null||(n=n.filter(({once:i})=>!i),this.#t.set(t.type,n)),e}safeDispatchEvent(t,e){return this.dispatchEvent(new se(t,e))}},nn=class extends Event{detail;constructor(t,e){super(t,e),this.detail=e?.detail}},se=globalThis.CustomEvent??nn;var it=Mt("libp2p:tcp:listener");async function sn(r){try{await r.close()}catch(t){it.error("an error occurred closing the connection",t)}}var Cu=1,Eu=0,Ge=class extends qe{constructor(t){if(super(),this.context=t,this.connections=new Set,this.status={started:!1},t.keepAlive=t.keepAlive??!0,this.addr="unknown",this.server=Zs.default.createServer(t,this.onSocket.bind(this)),t.maxConnections!==void 0&&(this.server.maxConnections=t.maxConnections),t.closeServerOnMaxConnections!=null&&t.closeServerOnMaxConnections.closeAbove<t.closeServerOnMaxConnections.listenBelow)throw Error("closeAbove must be >= listenBelow");this.server.on("listening",()=>{if(t.metrics!=null){let e=this.server.address();e==null?this.addr="unknown":typeof e=="string"?this.addr=e:this.addr=`${e.address}:${e.port}`,t.metrics?.registerMetricGroup("libp2p_tcp_inbound_connections_total",{label:"address",help:"Current active connections in TCP listener",calculate:()=>({[this.addr]:this.connections.size})}),this.metrics={status:t.metrics.registerMetricGroup("libp2p_tcp_listener_status_info",{label:"address",help:"Current status of the TCP listener socket"}),errors:t.metrics.registerMetricGroup("libp2p_tcp_listener_errors_total",{label:"address",help:"Total count of TCP listener errors by type"}),events:t.metrics.registerMetricGroup("libp2p_tcp_listener_events_total",{label:"address",help:"Total count of TCP listener events by type"})},this.metrics?.status.update({[this.addr]:Cu})}this.dispatchEvent(new se("listening"))}).on("error",e=>{this.metrics?.errors.increment({[`${this.addr} listen_error`]:!0}),this.dispatchEvent(new se("error",{detail:e}))}).on("close",()=>{this.metrics?.status.update({[this.addr]:Eu}),this.dispatchEvent(new se("close"))})}onSocket(t){t.on("error",n=>{it("socket error",n),this.metrics?.events.increment({[`${this.addr} error`]:!0})});let e;try{e=ze(t,{listeningAddr:this.status.started?this.status.listeningAddr:void 0,socketInactivityTimeout:this.context.socketInactivityTimeout,socketCloseTimeout:this.context.socketCloseTimeout,metrics:this.metrics?.events,metricPrefix:`${this.addr} `})}catch(n){it.error("inbound connection failed",n),this.metrics?.errors.increment({[`${this.addr} inbound_to_connection`]:!0});return}it("new inbound connection %s",e.remoteAddr);try{this.context.upgrader.upgradeInbound(e).then(n=>{it("inbound connection upgraded %s",e.remoteAddr),this.connections.add(e),t.once("close",()=>{this.connections.delete(e),this.context.closeServerOnMaxConnections!=null&&this.connections.size<this.context.closeServerOnMaxConnections.listenBelow&&this.netListen().catch(i=>{it.error("error attempting to listen server once connection count under limit",i),this.context.closeServerOnMaxConnections?.onListenError?.(i)})}),this.context.handler!=null&&this.context.handler(n),this.context.closeServerOnMaxConnections!=null&&this.connections.size>=this.context.closeServerOnMaxConnections.closeAbove&&this.netClose(),this.dispatchEvent(new se("connection",{detail:n}))}).catch(async n=>{it.error("inbound connection failed",n),this.metrics?.errors.increment({[`${this.addr} inbound_upgrade`]:!0}),await sn(e)}).catch(n=>{it.error("closing inbound connection failed",n)})}catch(n){it.error("inbound connection failed",n),sn(e).catch(i=>{it.error("closing inbound connection failed",i),this.metrics?.errors.increment({[`${this.addr} inbound_closing_failed`]:!0})})}}getAddrs(){if(!this.status.started)return[];let t=[],e=this.server.address(),{listeningAddr:n,peerId:i}=this.status;if(e==null)return[];if(typeof e=="string")t=[n];else try{n.toString().startsWith("/ip4")?t=t.concat(rn("ip4",e.address,e.port)):e.family==="IPv6"&&(t=t.concat(rn("ip6",e.address,e.port)))}catch(u){it.error("could not turn %s:%s into multiaddr",e.address,e.port,u)}return t.map(u=>i!=null?u.encapsulate(`/p2p/${i}`):u)}async listen(t){if(this.status.started)throw Error("server is already listening");let e=t.getPeerId(),n=e==null?t.decapsulateCode(421):t,{backlog:i}=this.context;this.status={started:!0,listeningAddr:n,peerId:e,netConfig:ne(n,{backlog:i})},await this.netListen()}async close(){await Promise.all(Array.from(this.connections.values()).map(async t=>{await sn(t)})),this.netClose()}async netListen(){if(!this.status.started||this.server.listening)return;let t=this.status.netConfig;await new Promise((e,n)=>{this.server.once("error",n),this.server.listen(t,e)}),it("Listening on %s",this.server.address())}netClose(){!this.status.started||!this.server.listening||(it("Closing server on %s",this.server.address()),this.server.close())}};var Xs=Symbol.for("@libp2p/transport");var Ws;(function(r){r[r.FATAL_ALL=0]="FATAL_ALL",r[r.NO_FATAL=1]="NO_FATAL"})(Ws||(Ws={}));var Tt=Mt("libp2p:tcp"),an=class{constructor(t,e={}){this.opts=e,this.components=t,t.metrics!=null&&(this.metrics={dialerEvents:t.metrics.registerCounterGroup("libp2p_tcp_dialer_events_total",{label:"event",help:"Total count of TCP dialer events by type"})})}get[Xs](){return!0}get[Symbol.toStringTag](){return"@libp2p/tcp"}async dial(t,e){e.keepAlive=e.keepAlive??!0;let n=await this._connect(t,e);n.on("error",d=>{Tt("socket error",d)});let i=ze(n,{remoteAddr:t,socketInactivityTimeout:this.opts.outboundSocketInactivityTimeout,socketCloseTimeout:this.opts.socketCloseTimeout,metrics:this.metrics?.dialerEvents}),u=()=>{i.close().catch(d=>{Tt.error("Error closing maConn after abort",d)})};e.signal?.addEventListener("abort",u,{once:!0}),Tt("new outbound connection %s",i.remoteAddr);let f=await e.upgrader.upgradeOutbound(i);if(Tt("outbound connection %s upgraded",i.remoteAddr),e.signal?.removeEventListener("abort",u),e.signal?.aborted===!0)throw f.close().catch(d=>{Tt.error("Error closing conn after abort",d)}),new Et;return f}async _connect(t,e){if(e.signal?.aborted===!0)throw new Et;return await new Promise((n,i)=>{let u=Date.now(),f=ne(t),d=f.path??`${f.host??""}:${f.port}`;Tt("dialing %j",f);let g=Js.default.connect(f),A=m=>{m.message=`connection error ${d}: ${m.message}`,this.metrics?.dialerEvents.increment({error:!0}),S(m)},l=()=>{Tt("connection timeout %s",d),this.metrics?.dialerEvents.increment({timeout:!0});let m=new Q(`connection timeout after ${Date.now()-u}ms`,"ERR_CONNECT_TIMEOUT");g.emit("error",m)},y=()=>{Tt("connection opened %j",f),this.metrics?.dialerEvents.increment({connect:!0}),S()},x=()=>{Tt("connection aborted %j",f),this.metrics?.dialerEvents.increment({abort:!0}),g.destroy(),S(new Et)},S=m=>{if(g.removeListener("error",A),g.removeListener("timeout",l),g.removeListener("connect",y),e.signal!=null&&e.signal.removeEventListener("abort",x),m!=null){i(m);return}n(g)};g.on("error",A),g.on("timeout",l),g.on("connect",y),e.signal!=null&&e.signal.addEventListener("abort",x)})}createListener(t){return new Ge({...t,maxConnections:this.opts.maxConnections,backlog:this.opts.backlog,closeServerOnMaxConnections:this.opts.closeServerOnMaxConnections,socketInactivityTimeout:this.opts.inboundSocketInactivityTimeout,socketCloseTimeout:this.opts.socketCloseTimeout,metrics:this.components.metrics})}filter(t){return t=Array.isArray(t)?t:[t],t.filter(e=>e.protoCodes().includes(290)?!1:e.protoCodes().includes(400)?!0:Rt.matches(e.decapsulateCode(421)))}};function Bu(r={}){return(t={})=>new an(t,r)}return Li(Ru);})();
7
7
  return Libp2PTcp}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/tcp",
3
- "version": "7.0.1",
3
+ "version": "7.0.2",
4
4
  "description": "A TCP transport for libp2p",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p-tcp#readme",
@@ -152,7 +152,7 @@
152
152
  "stream-to-it": "^0.2.2"
153
153
  },
154
154
  "devDependencies": {
155
- "@libp2p/interface-mocks": "^11.0.0",
155
+ "@libp2p/interface-mocks": "^12.0.1",
156
156
  "@libp2p/interface-transport-compliance-tests": "^4.0.0",
157
157
  "aegir": "^38.1.0",
158
158
  "it-all": "^3.0.1",