🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@multiformats/dns

Package Overview
Dependencies
Maintainers
10
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@multiformats/dns - npm Package Compare versions

Comparing version
1.0.13
to
1.0.14
+1
-1
dist/index.min.js
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.MultiformatsDns = factory()}(typeof self !== 'undefined' ? self : this, function () {
"use strict";var MultiformatsDns=(()=>{var mt=Object.create;var G=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var gt=Object.getOwnPropertyNames;var xt=Object.getPrototypeOf,wt=Object.prototype.hasOwnProperty;var ze=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),x=(r,e)=>{for(var t in e)G(r,t,{get:e[t],enumerable:!0})},$e=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of gt(e))!wt.call(r,i)&&i!==t&&G(r,i,{get:()=>e[i],enumerable:!(n=bt(e,i))||n.enumerable});return r};var Oe=(r,e,t)=>(t=r!=null?mt(xt(r)):{},$e(e||!r||!r.__esModule?G(t,"default",{value:r,enumerable:!0}):t,r)),yt=r=>$e(G({},"__esModule",{value:!0}),r);var ke=ze((qr,ne)=>{"use strict";var vt=Object.prototype.hasOwnProperty,m="~";function q(){}Object.create&&(q.prototype=Object.create(null),new q().__proto__||(m=!1));function Et(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function _e(r,e,t,n,i){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new Et(t,n||r,i),o=m?m+e:e;return r._events[o]?r._events[o].fn?r._events[o]=[r._events[o],s]:r._events[o].push(s):(r._events[o]=s,r._eventsCount++),r}function j(r,e){--r._eventsCount===0?r._events=new q:delete r._events[e]}function p(){this._events=new q,this._eventsCount=0}p.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)vt.call(t,n)&&e.push(m?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};p.prototype.listeners=function(e){var t=m?m+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=new Array(s);i<s;i++)o[i]=n[i].fn;return o};p.prototype.listenerCount=function(e){var t=m?m+e:e,n=this._events[t];return n?n.fn?1:n.length:0};p.prototype.emit=function(e,t,n,i,s,o){var c=m?m+e:e;if(!this._events[c])return!1;var a=this._events[c],h=arguments.length,d,u;if(a.fn){switch(a.once&&this.removeListener(e,a.fn,void 0,!0),h){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,t),!0;case 3:return a.fn.call(a.context,t,n),!0;case 4:return a.fn.call(a.context,t,n,i),!0;case 5:return a.fn.call(a.context,t,n,i,s),!0;case 6:return a.fn.call(a.context,t,n,i,s,o),!0}for(u=1,d=new Array(h-1);u<h;u++)d[u-1]=arguments[u];a.fn.apply(a.context,d)}else{var g=a.length,T;for(u=0;u<g;u++)switch(a[u].once&&this.removeListener(e,a[u].fn,void 0,!0),h){case 1:a[u].fn.call(a[u].context);break;case 2:a[u].fn.call(a[u].context,t);break;case 3:a[u].fn.call(a[u].context,t,n);break;case 4:a[u].fn.call(a[u].context,t,n,i);break;default:if(!d)for(T=1,d=new Array(h-1);T<h;T++)d[T-1]=arguments[T];a[u].fn.apply(a[u].context,d)}}return!0};p.prototype.on=function(e,t,n){return _e(this,e,t,n,!1)};p.prototype.once=function(e,t,n){return _e(this,e,t,n,!0)};p.prototype.removeListener=function(e,t,n,i){var s=m?m+e:e;if(!this._events[s])return this;if(!t)return j(this,s),this;var o=this._events[s];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&j(this,s);else{for(var c=0,a=[],h=o.length;c<h;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&a.push(o[c]);a.length?this._events[s]=a.length===1?a[0]:a:j(this,s)}return this};p.prototype.removeAllListeners=function(e){var t;return e?(t=m?m+e:e,this._events[t]&&j(this,t)):(this._events=new q,this._eventsCount=0),this};p.prototype.off=p.prototype.removeListener;p.prototype.addListener=p.prototype.on;p.prefixed=m;p.EventEmitter=p;typeof ne<"u"&&(ne.exports=p)});var lt=ze((ni,ft)=>{ft.exports=function(r){if(!r)throw Error("hashlru must have a max value, of type number, greater than 0");var e=0,t=Object.create(null),n=Object.create(null);function i(s,o){t[s]=o,e++,e>=r&&(e=0,n=t,t=Object.create(null))}return{has:function(s){return t[s]!==void 0||n[s]!==void 0},remove:function(s){t[s]!==void 0&&(t[s]=void 0),n[s]!==void 0&&(n[s]=void 0)},get:function(s){var o=t[s];if(o!==void 0)return o;if((o=n[s])!==void 0)return i(s,o),o},set:function(s,o){t[s]!==void 0?t[s]=o:i(s,o)},clear:function(){t=Object.create(null),n=Object.create(null)}}}});var _r={};x(_r,{MAX_RECURSIVE_DEPTH:()=>$r,RecordType:()=>y,dns:()=>Or});var P=class extends Event{type;detail;constructor(e,t){super(e),this.type=e,this.detail=t}};var Z=class extends AggregateError{static name="DNSQueryFailedError";name="DNSQueryFailedError"};var ie=Oe(ke(),1);var se=class r extends Error{name="TimeoutError";constructor(e,t){super(e,t),Error.captureStackTrace?.(this,r)}},Re=r=>r.reason??new DOMException("This operation was aborted.","AbortError");function oe(r,e){let{milliseconds:t,fallback:n,message:i,customTimers:s={setTimeout,clearTimeout},signal:o}=e,c,a,d=new Promise((u,g)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(o?.aborted){g(Re(o));return}if(o&&(a=()=>{g(Re(o))},o.addEventListener("abort",a,{once:!0})),r.then(u,g),t===Number.POSITIVE_INFINITY)return;let T=new se;c=s.setTimeout.call(void 0,()=>{if(n){try{u(n())}catch(f){g(f)}return}typeof r.cancel=="function"&&r.cancel(),i===!1?u():i instanceof Error?g(i):(T.message=i??`Promise timed out after ${t} milliseconds`,g(T))},t)}).finally(()=>{d.clear(),a&&o&&o.removeEventListener("abort",a)});return d.clear=()=>{s.clearTimeout.call(void 0,c),c=void 0},d}function ae(r,e,t){let n=0,i=r.length;for(;i>0;){let s=Math.trunc(i/2),o=n+s;t(r[o],e)<=0?(n=++o,i-=s+1):i=s}return n}var F=class{#r=[];enqueue(e,t){let{priority:n=0,id:i}=t??{},s={priority:n,id:i,run:e};if(this.size===0||this.#r[this.size-1].priority>=n){this.#r.push(s);return}let o=ae(this.#r,s,(c,a)=>a.priority-c.priority);this.#r.splice(o,0,s)}setPriority(e,t){let n=this.#r.findIndex(s=>s.id===e);if(n===-1)throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);let[i]=this.#r.splice(n,1);this.enqueue(i.run,{priority:t,id:e})}dequeue(){return this.#r.shift()?.run}filter(e){return this.#r.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#r.length}};var B=class extends ie.default{#r;#o;#a=0;#d;#m=!1;#x=!1;#c;#S=0;#w=0;#h;#u;#s;#i=[];#n=0;#e;#I;#t=0;#b;#f;#U=1n;#g=new Map;timeout;constructor(e){if(super(),e={carryoverIntervalCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:F,strict:!1,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);if(e.strict&&e.interval===0)throw new TypeError("The `strict` option requires a non-zero `interval`");if(e.strict&&e.intervalCap===Number.POSITIVE_INFINITY)throw new TypeError("The `strict` option requires a finite `intervalCap`");if(this.#r=e.carryoverIntervalCount??e.carryoverConcurrencyCount??!1,this.#o=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#d=e.intervalCap,this.#c=e.interval,this.#s=e.strict,this.#e=new e.queueClass,this.#I=e.queueClass,this.concurrency=e.concurrency,e.timeout!==void 0&&!(Number.isFinite(e.timeout)&&e.timeout>0))throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${e.timeout}\` (${typeof e.timeout})`);this.timeout=e.timeout,this.#f=e.autoStart===!1,this.#q()}#y(e){for(;this.#n<this.#i.length;){let n=this.#i[this.#n];if(n!==void 0&&e-n>=this.#c)this.#n++;else break}(this.#n>100&&this.#n>this.#i.length/2||this.#n===this.#i.length)&&(this.#i=this.#i.slice(this.#n),this.#n=0)}#z(e){this.#s?this.#i.push(e):this.#a++}#$(){this.#s?this.#i.length>this.#n&&this.#i.pop():this.#a>0&&this.#a--}#v(){return this.#i.length-this.#n}get#O(){return this.#o?!0:this.#s?this.#v()<this.#d:this.#a<this.#d}get#_(){return this.#t<this.#b}#k(){this.#t--,this.#t===0&&this.emit("pendingZero"),this.#C(),this.emit("next")}#R(){this.#u=void 0,this.#N(),this.#L()}#M(e){if(this.#s){if(this.#y(e),this.#v()>=this.#d){let n=this.#i[this.#n],i=this.#c-(e-n);return this.#E(i),!0}return!1}if(this.#h===void 0){let t=this.#S-e;if(t<0){if(this.#w>0){let n=e-this.#w;if(n<this.#c)return this.#E(this.#c-n),!0}this.#a=this.#r?this.#t:0}else return this.#E(t),!0}return!1}#E(e){this.#u===void 0&&(this.#u=setTimeout(()=>{this.#R()},e))}#T(){this.#h&&(clearInterval(this.#h),this.#h=void 0)}#D(){this.#u&&(clearTimeout(this.#u),this.#u=void 0)}#C(){if(this.#e.size===0){if(this.#T(),this.emit("empty"),this.#t===0){if(this.#D(),this.#s&&this.#n>0){let t=Date.now();this.#y(t)}this.emit("idle")}return!1}let e=!1;if(!this.#f){let t=Date.now(),n=!this.#M(t);if(this.#O&&this.#_){let i=this.#e.dequeue();this.#o||(this.#z(t),this.#p()),this.emit("active"),i(),n&&this.#L(),e=!0}}return e}#L(){this.#o||this.#h!==void 0||this.#s||(this.#h=setInterval(()=>{this.#N()},this.#c),this.#S=Date.now()+this.#c)}#N(){this.#s||(this.#a===0&&this.#t===0&&this.#h&&this.#T(),this.#a=this.#r?this.#t:0),this.#A(),this.#p()}#A(){for(;this.#C(););}get concurrency(){return this.#b}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#b=e,this.#A()}setPriority(e,t){if(typeof t!="number"||!Number.isFinite(t))throw new TypeError(`Expected \`priority\` to be a finite number, got \`${t}\` (${typeof t})`);this.#e.setPriority(e,t)}async add(e,t={}){return t={timeout:this.timeout,...t,id:t.id??(this.#U++).toString()},new Promise((n,i)=>{let s=Symbol(`task-${t.id}`);this.#e.enqueue(async()=>{this.#t++,this.#g.set(s,{id:t.id,priority:t.priority??0,startTime:Date.now(),timeout:t.timeout});let o;try{try{t.signal?.throwIfAborted()}catch(h){throw this.#F(),this.#g.delete(s),h}this.#w=Date.now();let c=e({signal:t.signal});if(t.timeout&&(c=oe(Promise.resolve(c),{milliseconds:t.timeout,message:`Task timed out after ${t.timeout}ms (queue has ${this.#t} running, ${this.#e.size} waiting)`})),t.signal){let{signal:h}=t;c=Promise.race([c,new Promise((d,u)=>{o=()=>{u(h.reason)},h.addEventListener("abort",o,{once:!0})})])}let a=await c;n(a),this.emit("completed",a)}catch(c){i(c),this.emit("error",c)}finally{o&&t.signal?.removeEventListener("abort",o),this.#g.delete(s),queueMicrotask(()=>{this.#k()})}},t),this.emit("add"),this.#C()})}async addAll(e,t){return Promise.all(e.map(async n=>this.add(n,t)))}start(){return this.#f?(this.#f=!1,this.#A(),this):this}pause(){this.#f=!0}clear(){this.#e=new this.#I,this.#T(),this.#P(),this.emit("empty"),this.#t===0&&(this.#D(),this.emit("idle")),this.emit("next")}async onEmpty(){this.#e.size!==0&&await this.#l("empty")}async onSizeLessThan(e){this.#e.size<e||await this.#l("next",()=>this.#e.size<e)}async onIdle(){this.#t===0&&this.#e.size===0||await this.#l("idle")}async onPendingZero(){this.#t!==0&&await this.#l("pendingZero")}async onRateLimit(){this.isRateLimited||await this.#l("rateLimit")}async onRateLimitCleared(){this.isRateLimited&&await this.#l("rateLimitCleared")}onError(){return new Promise((e,t)=>{let n=i=>{this.off("error",n),t(i)};this.on("error",n)})}async#l(e,t){return new Promise(n=>{let i=()=>{t&&!t()||(this.off(e,i),n())};this.on(e,i)})}get size(){return this.#e.size}sizeBy(e){return this.#e.filter(e).length}get pending(){return this.#t}get isPaused(){return this.#f}#q(){this.#o||(this.on("add",()=>{this.#e.size>0&&this.#p()}),this.on("next",()=>{this.#p()}))}#p(){this.#o||this.#x||(this.#x=!0,queueMicrotask(()=>{this.#x=!1,this.#P()}))}#F(){this.#o||(this.#$(),this.#p())}#P(){let e=this.#m;if(this.#o||this.#e.size===0){e&&(this.#m=!1,this.emit("rateLimitCleared"));return}let t;if(this.#s){let i=Date.now();this.#y(i),t=this.#v()}else t=this.#a;let n=t>=this.#d;n!==e&&(this.#m=n,this.emit(n?"rateLimit":"rateLimitCleared"))}get isRateLimited(){return this.#m}get isSaturated(){return this.#t===this.#b&&this.#e.size>0||this.isRateLimited&&this.#e.size>0}get runningTasks(){return[...this.#g.values()].map(e=>({...e}))}};function K(r){let e=[y.A];return r==null?e:Array.isArray(r)?r.length===0?e:r:[r]}var le={};x(le,{base10:()=>Lt});var Kr=new Uint8Array(0);function Me(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}function L(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")}function qe(r){return new TextEncoder().encode(r)}function Fe(r){return new TextDecoder().decode(r)}function Tt(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var s=r.charAt(i),o=s.charCodeAt(0);if(t[o]!==255)throw new TypeError(s+" is ambiguous");t[o]=i}var c=r.length,a=r.charAt(0),h=Math.log(c)/Math.log(256),d=Math.log(256)/Math.log(c);function u(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";for(var b=0,z=0,v=0,C=f.length;v!==C&&f[v]===0;)v++,b++;for(var A=(C-v)*d+1>>>0,w=new Uint8Array(A);v!==C;){for(var S=f[v],N=0,E=A-1;(S!==0||N<z)&&E!==-1;E--,N++)S+=256*w[E]>>>0,w[E]=S%c>>>0,S=S/c>>>0;if(S!==0)throw new Error("Non-zero carry");z=N,v++}for(var D=A-z;D!==A&&w[D]===0;)D++;for(var Y=a.repeat(b);D<A;++D)Y+=r.charAt(w[D]);return Y}function g(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;var b=0;if(f[b]!==" "){for(var z=0,v=0;f[b]===a;)z++,b++;for(var C=(f.length-b)*h+1>>>0,A=new Uint8Array(C);f[b];){var w=t[f.charCodeAt(b)];if(w===255)return;for(var S=0,N=C-1;(w!==0||S<v)&&N!==-1;N--,S++)w+=c*A[N]>>>0,A[N]=w%256>>>0,w=w/256>>>0;if(w!==0)throw new Error("Non-zero carry");v=S,b++}if(f[b]!==" "){for(var E=C-v;E!==C&&A[E]===0;)E++;for(var D=new Uint8Array(z+(C-E)),Y=z;E!==C;)D[Y++]=A[E++];return D}}}function T(f){var b=g(f);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:u,decodeUnsafe:g,decode:T}}var Ct=Tt,At=Ct,Ve=At;var ce=class{name;prefix;baseEncode;constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},he=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){this.name=e,this.prefix=t;let i=t.codePointAt(0);if(i===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=i,this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Je(this,e)}},ue=class{decoders;constructor(e){this.decoders=e}or(e){return Je(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Je(r,e){return new ue({...r.decoders??{[r.prefix]:r},...e.decoders??{[e.prefix]:e}})}var fe=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new ce(e,t,n),this.decoder=new he(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function $({name:r,prefix:e,encode:t,decode:n}){return new fe(r,e,t,n)}function U({name:r,prefix:e,alphabet:t}){let{encode:n,decode:i}=Ve(t,r);return $({prefix:e,name:r,encode:n,decode:s=>L(i(s))})}function St(r,e,t,n){let i=r.length;for(;r[i-1]==="=";)--i;let s=new Uint8Array(i*t/8|0),o=0,c=0,a=0;for(let h=0;h<i;++h){let d=e[r[h]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<t|d,o+=t,o>=8&&(o-=8,s[a++]=255&c>>o)}if(o>=t||(255&c<<8-o)!==0)throw new SyntaxError("Unexpected end of data");return s}function It(r,e,t){let n=e[e.length-1]==="=",i=(1<<t)-1,s="",o=0,c=0;for(let a=0;a<r.length;++a)for(c=c<<8|r[a],o+=8;o>t;)o-=t,s+=e[i&c>>o];if(o!==0&&(s+=e[i&c<<t-o]),n)for(;(s.length*t&7)!==0;)s+="=";return s}function Dt(r){let e={};for(let t=0;t<r.length;++t)e[r[t]]=t;return e}function l({name:r,prefix:e,bitsPerChar:t,alphabet:n}){let i=Dt(n);return $({prefix:e,name:r,encode(s){return It(s,n,t)},decode(s){return St(s,i,t,r)}})}var Lt=U({prefix:"9",name:"base10",alphabet:"0123456789"});var de={};x(de,{base16:()=>Nt,base16upper:()=>Pt});var Nt=l({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Pt=l({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var pe={};x(pe,{base2:()=>Ut});var Ut=l({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var me={};x(me,{base256emoji:()=>kt});var Qe=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}"),zt=Qe.reduce((r,e,t)=>(r[t]=e,r),[]),$t=Qe.reduce((r,e,t)=>{let n=e.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${e}`);return r[n]=t,r},[]);function Ot(r){return r.reduce((e,t)=>(e+=zt[t],e),"")}function _t(r){let e=[];for(let t of r){let n=t.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${t}`);let i=$t[n];if(i==null)throw new Error(`Non-base256emoji character: ${t}`);e.push(i)}return new Uint8Array(e)}var kt=$({prefix:"\u{1F680}",name:"base256emoji",encode:Ot,decode:_t});var be={};x(be,{base32:()=>O,base32hex:()=>Ft,base32hexpad:()=>Vt,base32hexpadupper:()=>Jt,base32hexupper:()=>Bt,base32pad:()=>Mt,base32padupper:()=>qt,base32upper:()=>Rt,base32z:()=>Qt});var O=l({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Rt=l({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Mt=l({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),qt=l({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ft=l({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Bt=l({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Vt=l({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Jt=l({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Qt=l({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ge={};x(ge,{base36:()=>V,base36upper:()=>Ht});var V=U({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Ht=U({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var xe={};x(xe,{base58btc:()=>I,base58flickr:()=>Xt});var I=U({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Xt=U({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var we={};x(we,{base64:()=>Yt,base64pad:()=>Gt,base64url:()=>Zt,base64urlpad:()=>jt});var Yt=l({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Gt=l({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Zt=l({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),jt=l({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var ye={};x(ye,{base8:()=>Kt});var Kt=l({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var ve={};x(ve,{identity:()=>Wt});var Wt=$({prefix:"\0",name:"identity",encode:r=>Fe(r),decode:r=>qe(r)});var mn=new TextEncoder,bn=new TextDecoder;var Te={};x(Te,{identity:()=>Er});var rr=Ye,He=128,nr=127,ir=~nr,sr=Math.pow(2,31);function Ye(r,e,t){e=e||[],t=t||0;for(var n=t;r>=sr;)e[t++]=r&255|He,r/=128;for(;r&ir;)e[t++]=r&255|He,r>>>=7;return e[t]=r|0,Ye.bytes=t-n+1,e}var or=Ee,ar=128,Xe=127;function Ee(r,n){var t=0,n=n||0,i=0,s=n,o,c=r.length;do{if(s>=c)throw Ee.bytes=0,new RangeError("Could not decode varint");o=r[s++],t+=i<28?(o&Xe)<<i:(o&Xe)*Math.pow(2,i),i+=7}while(o>=ar);return Ee.bytes=s-n,t}var cr=Math.pow(2,7),hr=Math.pow(2,14),ur=Math.pow(2,21),fr=Math.pow(2,28),lr=Math.pow(2,35),dr=Math.pow(2,42),pr=Math.pow(2,49),mr=Math.pow(2,56),br=Math.pow(2,63),gr=function(r){return r<cr?1:r<hr?2:r<ur?3:r<fr?4:r<lr?5:r<dr?6:r<pr?7:r<mr?8:r<br?9:10},xr={encode:rr,decode:or,encodingLength:gr},wr=xr,J=wr;function Q(r,e=0){return[J.decode(r,e),J.decode.bytes]}function _(r,e,t=0){return J.encode(r,e,t),e}function k(r){return J.encodingLength(r)}function M(r,e){let t=e.byteLength,n=k(r),i=n+k(t),s=new Uint8Array(i+t);return _(r,s,0),_(t,s,n),s.set(e,i),new R(r,t,e,s)}function Ge(r){let e=L(r),[t,n]=Q(e),[i,s]=Q(e.subarray(n)),o=e.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new R(t,i,o,e)}function Ze(r,e){if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&Me(r.bytes,t.bytes)}}var R=class{code;size;digest;bytes;constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};var je=0,yr="identity",Ke=L;function vr(r,e){if(e?.truncate!=null&&e.truncate!==r.byteLength){if(e.truncate<0||e.truncate>r.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${r.byteLength}`);r=r.subarray(0,e.truncate)}return M(je,Ke(r))}var Er={code:je,name:yr,encode:Ke,digest:vr};var Se={};x(Se,{sha256:()=>Cr,sha512:()=>Ar});var Tr=20;function Ae({name:r,code:e,encode:t,minDigestLength:n,maxDigestLength:i}){return new Ce(r,e,t,n,i)}var Ce=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,n,i,s){this.name=e,this.code=t,this.encode=n,this.minDigestLength=i??Tr,this.maxDigestLength=s}digest(e,t){if(t?.truncate!=null){if(t.truncate<this.minDigestLength)throw new Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&t.truncate>this.maxDigestLength)throw new Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(e instanceof Uint8Array){let n=this.encode(e);return n instanceof Uint8Array?We(n,this.code,t?.truncate):n.then(i=>We(i,this.code,t?.truncate))}else throw Error("Unknown type, must be binary type")}};function We(r,e,t){if(t!=null&&t!==r.byteLength){if(t>r.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${r.byteLength}`);r=r.subarray(0,t)}return M(e,r)}function tt(r){return async e=>new Uint8Array(await crypto.subtle.digest(r,e))}var Cr=Ae({name:"sha2-256",code:18,encode:tt("SHA-256")}),Ar=Ae({name:"sha2-512",code:19,encode:tt("SHA-512")});function rt(r,e){let{bytes:t,version:n}=r;switch(n){case 0:return Ir(t,Ie(r),e??I.encoder);default:return Dr(t,Ie(r),e??O.encoder)}}var nt=new WeakMap;function Ie(r){let e=nt.get(r);if(e==null){let t=new Map;return nt.set(r,t),t}return e}var ee=class r{code;version;multihash;bytes;"/";constructor(e,t,n,i){this.code=t,this.version=e,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:e,multihash:t}=this;if(e!==X)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==Lr)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}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:e,digest:t}=this.multihash,n=M(e,t);return r.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(e){return r.equals(this,e)}static equals(e,t){let n=t;return n!=null&&e.code===n.code&&e.version===n.version&&Ze(e.multihash,n.multihash)}toString(e){return rt(this,e)}toJSON(){return{"/":rt(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof r)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:i,multihash:s,bytes:o}=t;return new r(n,i,s,o??it(n,i,s.bytes))}else if(t[Nr]===!0){let{version:n,multihash:i,code:s}=t,o=Ge(i);return r.create(n,s,o)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==X)throw new Error(`Version 0 CID must use dag-pb (code: ${X}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let i=it(e,t,n.bytes);return new r(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,X,e)}static createV1(e,t){return r.create(1,e,t)}static decode(e){let[t,n]=r.decodeFirst(e);if(n.length!==0)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=r.inspectBytes(e),n=t.size-t.multihashSize,i=L(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=i.subarray(t.multihashSize-t.digestSize),o=new R(t.multihashCode,t.digestSize,s,i);return[t.version===0?r.createV0(o):r.createV1(t.codec,o),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[u,g]=Q(e.subarray(t));return t+=g,u},i=n(),s=X;if(i===18?(i=0,t=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=t,c=n(),a=n(),h=t+a,d=h-o;return{version:i,codec:s,multihashCode:c,digestSize:a,multihashSize:d,size:h}}static parse(e,t){let[n,i]=Sr(e,t),s=r.decode(i);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Ie(s).set(n,e),s}};function Sr(r,e){switch(r[0]){case"Q":{let t=e??I;return[I.prefix,t.decode(`${I.prefix}${r}`)]}case I.prefix:{let t=e??I;return[I.prefix,t.decode(r)]}case O.prefix:{let t=e??O;return[O.prefix,t.decode(r)]}case V.prefix:{let t=e??V;return[V.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}}function Ir(r,e,t){let{prefix:n}=t;if(n!==I.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let s=t.encode(r).slice(1);return e.set(n,s),s}else return i}function Dr(r,e,t){let{prefix:n}=t,i=e.get(n);if(i==null){let s=t.encode(r);return e.set(n,s),s}else return i}var X=112,Lr=18;function it(r,e,t){let n=k(r),i=n+k(e),s=new Uint8Array(i+t.byteLength);return _(r,s,0),_(e,s,n),s.set(t,i),s}var Nr=Symbol.for("@ipld/js-cid/CID");var De={...ve,...pe,...ye,...le,...de,...be,...ge,...xe,...we,...me},Rn={...Se,...Te};function st(r=0){return new Uint8Array(r)}function at(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var ot=at("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Le=at("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=st(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),Pr={utf8:ot,"utf-8":ot,hex:De.base16,latin1:Le,ascii:Le,binary:Le,...De},ct=Pr;function ht(r,e="utf8"){let t=ct[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(r).substring(1)}var Ne=60;function te(r){return{Status:r.Status??0,TC:r.TC??r.flag_tc??!1,RD:r.RD??r.flag_rd??!1,RA:r.RA??r.flag_ra??!1,AD:r.AD??r.flag_ad??!1,CD:r.CD??r.flag_cd??!1,Question:(r.Question??r.questions??[]).map(e=>({name:e.name,type:y[e.type]})),Answer:(r.Answer??r.answers??[]).map(e=>({name:e.name,type:y[e.type],TTL:e.TTL??e.ttl??Ne,data:e.data instanceof Uint8Array?ht(e.data):e.data}))}}var Ur=4;function Pe(r,e={}){let t=new B({concurrency:e.queryConcurrency??Ur});return async(n,i={})=>{let s=i?.logger?.forComponent("dns:dns-json-over-https"),o=new URLSearchParams;o.set("name",n),K(i.types).forEach(a=>{o.append("type",y[a])}),i.onProgress?.(new P("dns:query",n)),s?.("GET %s",`${r}?${o}`);let c=await t.add(async()=>{let a=await fetch(`${r}?${o}`,{headers:{accept:"application/dns-json"},signal:i?.signal});if(s?.("GET %s %d",a.url,a.status),a.status!==200)throw new Error(`Unexpected HTTP status: ${a.status} - ${a.statusText}`);let h=te(await a.json());return i.onProgress?.(new P("dns:response",h)),h},{signal:i.signal});if(c==null)throw new Error("No DNS response received");return c}}function ut(){return[Pe("https://cloudflare-dns.com/dns-query"),Pe("https://dns.google/resolve")]}var dt=Oe(lt(),1);var Ue=class{lru;constructor(e){this.lru=(0,dt.default)(e)}get(e,t){let n=!0,i=[];for(let s of t){let o=this.getAnswers(e,s);if(o.length===0){n=!1;break}i.push(...o)}if(n)return te({answers:i})}getAnswers(e,t){let n=`${e.toLowerCase()}-${t}`,i=this.lru.get(n);if(i!=null){let s=i.filter(o=>o.expires>Date.now()).map(({expires:o,value:c})=>({...c,TTL:Math.round((o-Date.now())/1e3),type:y[c.type]}));return s.length===0&&this.lru.remove(n),s}return[]}add(e,t){let n=`${e.toLowerCase()}-${t.type}`,i=this.lru.get(n)??[];i.push({expires:Date.now()+(t.TTL??Ne)*1e3,value:t}),this.lru.set(n,i)}remove(e,t){let n=`${e.toLowerCase()}-${t}`;this.lru.remove(n)}clear(){this.lru.clear()}};function pt(r){return new Ue(r)}var zr=1e3,re=class{resolvers;cache;logger;constructor(e){this.resolvers={},this.cache=pt(e.cacheSize??zr),this.logger=e.logger,Object.entries(e.resolvers??{}).forEach(([t,n])=>{Array.isArray(n)||(n=[n]),t.endsWith(".")||(t=`${t}.`),this.resolvers[t]=n}),this.resolvers["."]==null&&(this.resolvers["."]=ut())}async query(e,t={}){let n=K(t.types),i=t.cached!==!1?this.cache.get(e,n):void 0;if(i!=null)return t.onProgress?.(new P("dns:cache",i)),i;let s=`${e.split(".").pop()}.`,o=(this.resolvers[s]??this.resolvers["."]).sort(()=>Math.random()>.5?-1:1),c=[];for(let a of o){if(t.signal?.aborted===!0)break;try{let h=await a(e,{...t,logger:this.logger,types:n});for(let d of h.Answer)this.cache.add(e,d);return h}catch(h){c.push(h),t.onProgress?.(new P("dns:error",h))}}throw new Z(c,`DNS lookup of ${e} ${n} failed`)}};var y;(function(r){r[r.A=1]="A",r[r.CNAME=5]="CNAME",r[r.TXT=16]="TXT",r[r.AAAA=28]="AAAA"})(y||(y={}));var $r=32;function Or(r={}){return new re(r)}return yt(_r);})();
"use strict";var MultiformatsDns=(()=>{var yt=Object.create;var W=Object.defineProperty;var xt=Object.getOwnPropertyDescriptor;var wt=Object.getOwnPropertyNames;var Et=Object.getPrototypeOf,At=Object.prototype.hasOwnProperty;var _e=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},v=(r,e)=>{for(var t in e)W(r,t,{get:e[t],enumerable:!0})},ke=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of wt(e))!At.call(r,i)&&i!==t&&W(r,i,{get:()=>e[i],enumerable:!(n=xt(e,i))||n.enumerable});return r};var qe=(r,e,t)=>(t=r!=null?yt(Et(r)):{},ke(e||!r||!r.__esModule?W(t,"default",{value:r,enumerable:!0}):t,r)),Ct=r=>ke(W({},"__esModule",{value:!0}),r);var Re=_e((Jr,se)=>{"use strict";var Tt=Object.prototype.hasOwnProperty,g="~";function V(){}Object.create&&(V.prototype=Object.create(null),new V().__proto__||(g=!1));function It(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function Me(r,e,t,n,i){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new It(t,n||r,i),o=g?g+e:e;return r._events[o]?r._events[o].fn?r._events[o]=[r._events[o],s]:r._events[o].push(s):(r._events[o]=s,r._eventsCount++),r}function j(r,e){--r._eventsCount===0?r._events=new V:delete r._events[e]}function m(){this._events=new V,this._eventsCount=0}m.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)Tt.call(t,n)&&e.push(g?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};m.prototype.listeners=function(e){var t=g?g+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=new Array(s);i<s;i++)o[i]=n[i].fn;return o};m.prototype.listenerCount=function(e){var t=g?g+e:e,n=this._events[t];return n?n.fn?1:n.length:0};m.prototype.emit=function(e,t,n,i,s,o){var c=g?g+e:e;if(!this._events[c])return!1;var a=this._events[c],h=arguments.length,u,f;if(a.fn){switch(a.once&&this.removeListener(e,a.fn,void 0,!0),h){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,t),!0;case 3:return a.fn.call(a.context,t,n),!0;case 4:return a.fn.call(a.context,t,n,i),!0;case 5:return a.fn.call(a.context,t,n,i,s),!0;case 6:return a.fn.call(a.context,t,n,i,s,o),!0}for(f=1,u=new Array(h-1);f<h;f++)u[f-1]=arguments[f];a.fn.apply(a.context,u)}else{var p=a.length,w;for(f=0;f<p;f++)switch(a[f].once&&this.removeListener(e,a[f].fn,void 0,!0),h){case 1:a[f].fn.call(a[f].context);break;case 2:a[f].fn.call(a[f].context,t);break;case 3:a[f].fn.call(a[f].context,t,n);break;case 4:a[f].fn.call(a[f].context,t,n,i);break;default:if(!u)for(w=1,u=new Array(h-1);w<h;w++)u[w-1]=arguments[w];a[f].fn.apply(a[f].context,u)}}return!0};m.prototype.on=function(e,t,n){return Me(this,e,t,n,!1)};m.prototype.once=function(e,t,n){return Me(this,e,t,n,!0)};m.prototype.removeListener=function(e,t,n,i){var s=g?g+e:e;if(!this._events[s])return this;if(!t)return j(this,s),this;var o=this._events[s];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&j(this,s);else{for(var c=0,a=[],h=o.length;c<h;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&a.push(o[c]);a.length?this._events[s]=a.length===1?a[0]:a:j(this,s)}return this};m.prototype.removeAllListeners=function(e){var t;return e?(t=g?g+e:e,this._events[t]&&j(this,t)):(this._events=new V,this._eventsCount=0),this};m.prototype.off=m.prototype.removeListener;m.prototype.addListener=m.prototype.on;m.prefixed=g;m.EventEmitter=m;typeof se<"u"&&(se.exports=m)});var mt=_e((hi,pt)=>{pt.exports=function(r){if(!r)throw Error("hashlru must have a max value, of type number, greater than 0");var e=0,t=Object.create(null),n=Object.create(null);function i(s,o){t[s]=o,e++,e>=r&&(e=0,n=t,t=Object.create(null))}return{has:function(s){return t[s]!==void 0||n[s]!==void 0},remove:function(s){t[s]!==void 0&&(t[s]=void 0),n[s]!==void 0&&(n[s]=void 0)},get:function(s){var o=t[s];if(o!==void 0)return o;if((o=n[s])!==void 0)return i(s,o),o},set:function(s,o){t[s]!==void 0?t[s]=o:i(s,o)},clear:function(){t=Object.create(null),n=Object.create(null)}}}});var Fr={};v(Fr,{MAX_RECURSIVE_DEPTH:()=>Rr,RecordType:()=>x,dns:()=>Br});var U=class extends Event{type;detail;constructor(e,t){super(e),this.type=e,this.detail=t}};var K=class extends AggregateError{static name="DNSQueryFailedError";name="DNSQueryFailedError"};var oe=qe(Re(),1);var ae=class r extends Error{name="TimeoutError";constructor(e,t){super(e,t),Error.captureStackTrace?.(this,r)}},Be=r=>r.reason??new DOMException("This operation was aborted.","AbortError");function ce(r,e){let{milliseconds:t,fallback:n,message:i,customTimers:s={setTimeout,clearTimeout},signal:o}=e,c,a,u=new Promise((f,p)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(o?.aborted){p(Be(o));return}if(o&&(a=()=>{p(Be(o))},o.addEventListener("abort",a,{once:!0})),r.then(f,p),t===Number.POSITIVE_INFINITY)return;let w=new ae;c=s.setTimeout.call(void 0,()=>{if(n){try{f(n())}catch(F){p(F)}return}typeof r.cancel=="function"&&r.cancel(),i===!1?f():i instanceof Error?p(i):(w.message=i??`Promise timed out after ${t} milliseconds`,p(w))},t)}).finally(()=>{u.clear(),a&&o&&o.removeEventListener("abort",a)});return u.clear=()=>{s.clearTimeout.call(void 0,c),c=void 0},u}function he(r,e,t){let n=0,i=r.length;for(;i>0;){let s=Math.trunc(i/2),o=n+s;t(r[o],e)<=0?(n=++o,i-=s+1):i=s}return n}var St=100,O=class{#t=[];#e=0;enqueue(e,t){let{priority:n=0,id:i}=t??{},{size:s}=this,o={priority:n,id:i,run:e};if(s===0){this.#t.length=0,this.#e=0,this.#t.push(o);return}if(this.#t.at(-1).priority>=n){this.#t.push(o);return}this.#s();let c=he(this.#t,o,(a,h)=>h.priority-a.priority);this.#t.splice(c,0,o)}setPriority(e,t){let n=this.#t.findIndex((s,o)=>o>=this.#e&&s.id===e);if(n===-1)throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);let[i]=this.#t.splice(n,1);this.enqueue(i.run,{priority:t,id:e})}remove(e){let t=this.#t.findIndex((n,i)=>i<this.#e?!1:typeof e=="string"?n.id===e:n.run===e);t!==-1&&this.#t.splice(t,1)}dequeue(){if(this.#e===this.#t.length)return;let e=this.#t[this.#e];return this.#e++,this.#e===this.#t.length?(this.#t.length=0,this.#e=0):this.#e>St&&this.#e>this.#t.length/2&&this.#s(),e?.run}filter(e){let t=[];for(let n=this.#e;n<this.#t.length;n++){let i=this.#t[n];i.priority===e.priority&&t.push(i.run)}return t}get size(){return this.#t.length-this.#e}#s(){this.#e!==0&&(this.#t.splice(0,this.#e),this.#e=0)}};var Q=class extends oe.default{#t;#e;#s=0;#d;#m=!1;#y=!1;#c;#S=0;#x=0;#h;#u;#a;#o=[];#i=0;#r;#L;#n=0;#g;#f;#z=1n;#b=new Map;#w=new Set;timeout;constructor(e){if(super(),e={carryoverIntervalCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:O,strict:!1,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);if(e.strict&&e.interval===0)throw new TypeError("The `strict` option requires a non-zero `interval`");if(e.strict&&e.intervalCap===Number.POSITIVE_INFINITY)throw new TypeError("The `strict` option requires a finite `intervalCap`");if(this.#t=e.carryoverIntervalCount??e.carryoverConcurrencyCount??!1,this.#e=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#d=e.intervalCap,this.#c=e.interval,this.#a=e.strict,this.#r=new e.queueClass,this.#L=e.queueClass,this.concurrency=e.concurrency,e.timeout!==void 0&&!(Number.isFinite(e.timeout)&&e.timeout>0))throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${e.timeout}\` (${typeof e.timeout})`);this.timeout=e.timeout,this.#f=e.autoStart===!1,this.#B()}#E(e){for(;this.#i<this.#o.length;){let n=this.#o[this.#i];if(n!==void 0&&e-n>=this.#c)this.#i++;else break}(this.#i>100&&this.#i>this.#o.length/2||this.#i===this.#o.length)&&(this.#o=this.#o.slice(this.#i),this.#i=0)}#$(e){this.#a?this.#o.push(e):this.#s++}#O(){this.#a?this.#o.length>this.#i&&this.#o.pop():this.#s>0&&this.#s--}#A(){return this.#o.length-this.#i}get#_(){return this.#e?!0:this.#a?this.#A()<this.#d:this.#s<this.#d}get#k(){return this.#n<this.#g}#q(){this.#n--,this.#n===0&&this.emit("pendingZero"),this.#v(),this.emit("next")}#M(){this.#u=void 0,this.#U(),this.#N()}#R(e){if(this.#a){if(this.#E(e),this.#A()>=this.#d){let n=this.#o[this.#i],i=this.#c-(e-n);return this.#C(i),!0}return!1}if(this.#h===void 0){let t=this.#S-e;if(t<0){if(this.#x>0){let n=e-this.#x;if(n<this.#c)return this.#C(this.#c-n),!0}this.#s=this.#t?this.#n:0}else return this.#C(t),!0}return!1}#C(e){this.#u===void 0&&(this.#u=setTimeout(()=>{this.#M()},e))}#T(){this.#h&&(clearInterval(this.#h),this.#h=void 0)}#D(){this.#u&&(clearTimeout(this.#u),this.#u=void 0)}#v(){if(this.#r.size===0){if(this.#T(),this.emit("empty"),this.#n===0){if(this.#D(),this.#a&&this.#i>0){let t=Date.now();this.#E(t)}this.emit("idle")}return!1}let e=!1;if(!this.#f){let t=Date.now(),n=!this.#R(t);if(this.#_&&this.#k){let i=this.#r.dequeue();this.#e||(this.#$(t),this.#p()),this.emit("active"),i(),n&&this.#N(),e=!0}}return e}#N(){this.#e||this.#h!==void 0||this.#a||(this.#h=setInterval(()=>{this.#U()},this.#c),this.#S=Date.now()+this.#c)}#U(){this.#a||(this.#s===0&&this.#n===0&&this.#h&&this.#T(),this.#s=this.#t?this.#n:0),this.#I(),this.#p()}#I(){for(;this.#v(););}get concurrency(){return this.#g}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#g=e,this.#I()}setPriority(e,t){if(typeof t!="number"||!Number.isFinite(t))throw new TypeError(`Expected \`priority\` to be a finite number, got \`${t}\` (${typeof t})`);this.#r.setPriority(e,t)}async add(e,t={}){return t={timeout:this.timeout,...t,id:t.id??(this.#z++).toString()},new Promise((n,i)=>{let s=Symbol(`task-${t.id}`),o=()=>{},c=async()=>{o(),this.#n++,this.#b.set(s,{id:t.id,priority:t.priority??0,startTime:Date.now(),timeout:t.timeout});let h;try{try{t.signal?.throwIfAborted()}catch(p){throw this.#F(),this.#b.delete(s),p}this.#x=Date.now();let u=e({signal:t.signal});if(t.timeout&&(u=ce(Promise.resolve(u),{milliseconds:t.timeout,message:`Task timed out after ${t.timeout}ms (queue has ${this.#n} running, ${this.#r.size} waiting)`})),t.signal){let{signal:p}=t;u=Promise.race([u,new Promise((w,F)=>{h=()=>{F(p.reason)},p.addEventListener("abort",h,{once:!0})})])}let f=await u;n(f),this.emit("completed",f)}catch(u){i(u),this.emit("error",u)}finally{h&&t.signal?.removeEventListener("abort",h),this.#b.delete(s),queueMicrotask(()=>{this.#q()})}};this.#r.enqueue(c,t);let a=()=>{if(this.#r instanceof O){this.#r.remove(c);return}this.#r.remove?.(t.id)};if(t.signal){let{signal:h}=t,u=()=>{o(),a(),i(h.reason),this.#v(),this.emit("next")};if(o=()=>{h.removeEventListener("abort",u),this.#w.delete(o)},h.aborted){u();return}h.addEventListener("abort",u,{once:!0}),this.#w.add(o)}this.emit("add"),this.#v()})}async addAll(e,t){return Promise.all(e.map(async n=>this.add(n,t)))}start(){return this.#f?(this.#f=!1,this.#I(),this):this}pause(){this.#f=!0}clear(){for(let e of this.#w)e();this.#r=new this.#L,this.#T(),this.#P(),this.emit("empty"),this.#n===0&&(this.#D(),this.emit("idle")),this.emit("next")}async onEmpty(){this.#r.size!==0&&await this.#l("empty")}async onSizeLessThan(e){this.#r.size<e||await this.#l("next",()=>this.#r.size<e)}async onIdle(){this.#n===0&&this.#r.size===0||await this.#l("idle")}async onPendingZero(){this.#n!==0&&await this.#l("pendingZero")}async onRateLimit(){this.isRateLimited||await this.#l("rateLimit")}async onRateLimitCleared(){this.isRateLimited&&await this.#l("rateLimitCleared")}onError(){return new Promise((e,t)=>{let n=i=>{this.off("error",n),t(i)};this.on("error",n)})}async#l(e,t){return new Promise(n=>{let i=()=>{t&&!t()||(this.off(e,i),n())};this.on(e,i)})}get size(){return this.#r.size}sizeBy(e){return this.#r.filter(e).length}get pending(){return this.#n}get isPaused(){return this.#f}#B(){this.#e||(this.on("add",()=>{this.#r.size>0&&this.#p()}),this.on("next",()=>{this.#p()}))}#p(){this.#e||this.#y||(this.#y=!0,queueMicrotask(()=>{this.#y=!1,this.#P()}))}#F(){this.#e||(this.#O(),this.#p())}#P(){let e=this.#m;if(this.#e||this.#r.size===0){e&&(this.#m=!1,this.emit("rateLimitCleared"));return}let t;if(this.#a){let i=Date.now();this.#E(i),t=this.#A()}else t=this.#s;let n=t>=this.#d;n!==e&&(this.#m=n,this.emit(n?"rateLimit":"rateLimitCleared"))}get isRateLimited(){return this.#m}get isSaturated(){return this.#n===this.#g&&this.#r.size>0||this.isRateLimited&&this.#r.size>0}get runningTasks(){return[...this.#b.values()].map(e=>({...e,timeoutRemaining:e.timeout?Math.max(0,e.startTime+e.timeout-Date.now()):void 0}))}};function ee(r){let e=[x.A];return r==null?e:Array.isArray(r)?r.length===0?e:r:[r]}var pe={};v(pe,{base10:()=>Ot});var sn=new Uint8Array(0);function Fe(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}function D(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")}function Ve(r){return new TextEncoder().encode(r)}function Qe(r){return new TextDecoder().decode(r)}function Lt(r){return r?.buffer instanceof ArrayBuffer}function $(r){return Lt(r)?r:r.slice()}function Dt(r,e,t){if(r.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),i=0;i<n.length;i++)n[i]=255;for(var s=0;s<r.length;s++){var o=r.charAt(s),c=o.charCodeAt(0);if(n[c]!==255)throw new TypeError(o+" is ambiguous");if(n[c]=s,t){var a=o.toLowerCase().charCodeAt(0),h=o.toUpperCase().charCodeAt(0);a!==c&&(n[a]=s),h!==c&&(n[h]=s)}}var u=r.length,f=r.charAt(0),p=Math.log(u)/Math.log(256),w=Math.log(256)/Math.log(u);function F(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var b=0,z=0,E=0,C=l.length;E!==C&&l[E]===0;)E++,b++;for(var T=(C-E)*w+1>>>0,y=new Uint8Array(T);E!==C;){for(var I=l[E],N=0,A=T-1;(I!==0||N<z)&&A!==-1;A--,N++)I+=256*y[A]>>>0,y[A]=I%u>>>0,I=I/u>>>0;if(I!==0)throw new Error("Non-zero carry");z=N,E++}for(var L=T-z;L!==T&&y[L]===0;)L++;for(var Z=f.repeat(b);L<T;++L)Z+=r.charAt(y[L]);return Z}function Oe(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;var b=0;if(l[b]!==" "){for(var z=0,E=0;l[b]===f;)z++,b++;for(var C=(l.length-b)*p+1>>>0,T=new Uint8Array(C);l[b];){var y=n[l.charCodeAt(b)];if(y===255)return;for(var I=0,N=C-1;(y!==0||I<E)&&N!==-1;N--,I++)y+=u*T[N]>>>0,T[N]=y%256>>>0,y=y/256>>>0;if(y!==0)throw new Error("Non-zero carry");E=I,b++}if(l[b]!==" "){for(var A=C-E;A!==C&&T[A]===0;)A++;for(var L=new Uint8Array(z+(C-A)),Z=z;A!==C;)L[Z++]=T[A++];return L}}}function vt(l){var b=Oe(l);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:F,decodeUnsafe:Oe,decode:vt}}var Nt=Dt,Ut=Nt,Je=Ut;var ue=class{name;prefix;baseEncode;constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},fe=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){this.name=e,this.prefix=t;let i=t.codePointAt(0);if(i===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=i,this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Xe(this,e)}},le=class{decoders;constructor(e){this.decoders=e}or(e){return Xe(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Xe(r,e){return new le({...r.decoders??{[r.prefix]:r},...e.decoders??{[e.prefix]:e}})}var de=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new ue(e,t,n),this.decoder=new fe(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function _({name:r,prefix:e,encode:t,decode:n}){return new de(r,e,t,n)}function P({name:r,prefix:e,alphabet:t,caseInsensitive:n=!1}){let{encode:i,decode:s}=Je(t,r,n);return _({prefix:e,name:r,encode:i,decode:o=>D(s(o))})}function Pt(r,e,t,n){let i=r.length;for(;r[i-1]==="=";)--i;let s=new Uint8Array(i*t/8|0),o=0,c=0,a=0;for(let h=0;h<i;++h){let u=e[r[h]];if(u===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<t|u,o+=t,o>=8&&(o-=8,s[a++]=255&c>>o)}if(o>=t||(255&c<<8-o)!==0)throw new SyntaxError("Unexpected end of data");return s}function zt(r,e,t){let n=e[e.length-1]==="=",i=(1<<t)-1,s="",o=0,c=0;for(let a=0;a<r.length;++a)for(c=c<<8|r[a],o+=8;o>t;)o-=t,s+=e[i&c>>o];if(o!==0&&(s+=e[i&c<<t-o]),n)for(;(s.length*t&7)!==0;)s+="=";return s}function $t(r,e){let t={};for(let n=0;n<r.length;++n)if(t[r[n]]=n,e){let i=r[n].toLowerCase(),s=r[n].toUpperCase();i!==r[n]&&(t[i]=n),s!==r[n]&&(t[s]=n)}return t}function d({name:r,prefix:e,bitsPerChar:t,alphabet:n,caseInsensitive:i=!1}){let s=$t(n,i);return _({prefix:e,name:r,encode(o){return zt(o,n,t)},decode(o){return Pt(o,s,t,r)}})}var Ot=P({prefix:"9",name:"base10",alphabet:"0123456789"});var me={};v(me,{base16:()=>_t,base16upper:()=>kt});var _t=d({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4,caseInsensitive:!0}),kt=d({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4,caseInsensitive:!0});var ge={};v(ge,{base2:()=>qt});var qt=d({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var be={};v(be,{base256emoji:()=>Vt});var Ye=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}"),Mt=Ye.reduce((r,e,t)=>(r[t]=e,r),[]),Rt=Ye.reduce((r,e,t)=>{let n=e.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${e}`);return r[n]=t,r},[]);function Bt(r){return r.reduce((e,t)=>(e+=Mt[t],e),"")}function Ft(r){let e=[];for(let t of r){let n=t.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${t}`);let i=Rt[n];if(i==null)throw new Error(`Non-base256emoji character: ${t}`);e.push(i)}return new Uint8Array(e)}var Vt=_({prefix:"\u{1F680}",name:"base256emoji",encode:Bt,decode:Ft});var ve={};v(ve,{base32:()=>k,base32hex:()=>Xt,base32hexpad:()=>Gt,base32hexpadupper:()=>Zt,base32hexupper:()=>Yt,base32pad:()=>Ht,base32padupper:()=>Jt,base32upper:()=>Qt,base32z:()=>Wt});var k=d({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5,caseInsensitive:!0}),Qt=d({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5,caseInsensitive:!0}),Ht=d({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5,caseInsensitive:!0}),Jt=d({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5,caseInsensitive:!0}),Xt=d({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5,caseInsensitive:!0}),Yt=d({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5,caseInsensitive:!0}),Gt=d({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5,caseInsensitive:!0}),Zt=d({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5,caseInsensitive:!0}),Wt=d({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ye={};v(ye,{base36:()=>H,base36upper:()=>Kt});var H=P({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz",caseInsensitive:!0}),Kt=P({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",caseInsensitive:!0});var xe={};v(xe,{base58btc:()=>S,base58flickr:()=>jt});var S=P({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),jt=P({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var we={};v(we,{base64:()=>er,base64pad:()=>tr,base64url:()=>rr,base64urlpad:()=>nr});var er=d({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),tr=d({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),rr=d({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),nr=d({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Ee={};v(Ee,{base8:()=>ir});var ir=d({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Ae={};v(Ae,{identity:()=>sr});var sr=_({prefix:"\0",name:"identity",encode:r=>Qe(r),decode:r=>Ve(r)});var wn=new TextEncoder,En=new TextDecoder;var Te={};v(Te,{identity:()=>Lr});var cr=We,Ge=128,hr=127,ur=~hr,fr=Math.pow(2,31);function We(r,e,t){e=e||[],t=t||0;for(var n=t;r>=fr;)e[t++]=r&255|Ge,r/=128;for(;r&ur;)e[t++]=r&255|Ge,r>>>=7;return e[t]=r|0,We.bytes=t-n+1,e}var lr=Ce,dr=128,Ze=127;function Ce(r,n){var t=0,n=n||0,i=0,s=n,o,c=r.length;do{if(s>=c)throw Ce.bytes=0,new RangeError("Could not decode varint");o=r[s++],t+=i<28?(o&Ze)<<i:(o&Ze)*Math.pow(2,i),i+=7}while(o>=dr);return Ce.bytes=s-n,t}var pr=Math.pow(2,7),mr=Math.pow(2,14),gr=Math.pow(2,21),br=Math.pow(2,28),vr=Math.pow(2,35),yr=Math.pow(2,42),xr=Math.pow(2,49),wr=Math.pow(2,56),Er=Math.pow(2,63),Ar=function(r){return r<pr?1:r<mr?2:r<gr?3:r<br?4:r<vr?5:r<yr?6:r<xr?7:r<wr?8:r<Er?9:10},Cr={encode:cr,decode:lr,encodingLength:Ar},Tr=Cr,J=Tr;function X(r,e=0){return[J.decode(r,e),J.decode.bytes]}function q(r,e,t=0){return J.encode(r,e,t),e}function M(r){return J.encodingLength(r)}function B(r,e){let t=e.byteLength,n=M(r),i=n+M(t),s=new Uint8Array(i+t);return q(r,s,0),q(t,s,n),s.set(e,i),new R(r,t,e,s)}function Ke(r){let e=D(r),[t,n]=X(e),[i,s]=X(e.subarray(n)),o=e.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new R(t,i,o,e)}function je(r,e){if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&Fe(r.bytes,t.bytes)}}var R=class{code;size;digest;bytes;constructor(e,t,n,i){this.code=e,this.size=t,this.digest=$(n),this.bytes=$(i)}};var et=0,Ir="identity",tt=D;function Sr(r,e){if(e?.truncate!=null&&e.truncate!==r.byteLength){if(e.truncate<0||e.truncate>r.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${r.byteLength}`);r=r.subarray(0,e.truncate)}return B(et,tt(r))}var Lr={code:et,name:Ir,encode:tt,digest:Sr};var Le={};v(Le,{sha256:()=>Nr,sha512:()=>Ur});var Dr=20;function Se({name:r,code:e,encode:t,minDigestLength:n,maxDigestLength:i}){return new Ie(r,e,t,n,i)}var Ie=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,n,i,s){this.name=e,this.code=t,this.encode=n,this.minDigestLength=i??Dr,this.maxDigestLength=s}digest(e,t){if(t?.truncate!=null){if(t.truncate<this.minDigestLength)throw new Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&t.truncate>this.maxDigestLength)throw new Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(e instanceof Uint8Array){let n=this.encode(e);return n instanceof Uint8Array?rt(n,this.code,t?.truncate):n.then(i=>rt(i,this.code,t?.truncate))}else throw Error("Unknown type, must be binary type")}};function rt(r,e,t){if(t!=null&&t!==r.byteLength){if(t>r.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${r.byteLength}`);r=r.subarray(0,t)}return B(e,r)}function it(r){return async e=>new Uint8Array(await crypto.subtle.digest(r,e))}var Nr=Se({name:"sha2-256",code:18,encode:it("SHA-256")}),Ur=Se({name:"sha2-512",code:19,encode:it("SHA-512")});function st(r,e){let{bytes:t,version:n}=r;return n===0?zr(t,De(r),e??S.encoder):$r(t,De(r),e??k.encoder)}var ot=new WeakMap;function De(r){let e=ot.get(r);if(e==null){let t=new Map;return ot.set(r,t),t}return e}var re=class r{code;version;multihash;bytes;"/";constructor(e,t,n,i){this.code=t,this.version=e,this.multihash=n,this.bytes=$(i),this["/"]=this.bytes}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:e,multihash:t}=this;if(e!==G)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==Or)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}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:e,digest:t}=this.multihash,n=B(e,t);return r.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(e){return r.equals(this,e)}static equals(e,t){let n=t;return n!=null&&e.code===n.code&&e.version===n.version&&je(e.multihash,n.multihash)}toString(e){return st(this,e)}toJSON(){return{"/":st(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof r)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:i,multihash:s,bytes:o}=t;return new r(n,i,s,o??at(n,i,s.bytes))}else if(t[_r]===!0){let{version:n,multihash:i,code:s}=t,o=Ke(i);return r.create(n,s,o)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==G)throw new Error(`Version 0 CID must use dag-pb (code: ${G}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let i=at(e,t,n.bytes);return new r(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,G,e)}static createV1(e,t){return r.create(1,e,t)}static decode(e){let[t,n]=r.decodeFirst(e);if(n.length!==0)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=r.inspectBytes(e),n=t.size-t.multihashSize,i=D(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=i.subarray(t.multihashSize-t.digestSize),o=new R(t.multihashCode,t.digestSize,s,i);return[t.version===0?r.createV0(o):r.createV1(t.codec,o),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[f,p]=X(e.subarray(t));return t+=p,f},i=n(),s=G;if(i===18?(i=0,t=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=t,c=n(),a=n(),h=t+a,u=h-o;return{version:i,codec:s,multihashCode:c,digestSize:a,multihashSize:u,size:h}}static parse(e,t){let[n,i]=Pr(e,t),s=r.decode(i);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return De(s).set(n,e),s}};function Pr(r,e){switch(r[0]){case"Q":{let t=e??S;return[S.prefix,t.decode(`${S.prefix}${r}`)]}case S.prefix:{let t=e??S;return[S.prefix,t.decode(r)]}case k.prefix:{let t=e??k;return[k.prefix,t.decode(r)]}case H.prefix:{let t=e??H;return[H.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}}function zr(r,e,t){let{prefix:n}=t;if(n!==S.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let s=t.encode(r).slice(1);return e.set(n,s),s}else return i}function $r(r,e,t){let{prefix:n}=t,i=e.get(n);if(i==null){let s=t.encode(r);return e.set(n,s),s}else return i}var G=112,Or=18;function at(r,e,t){let n=M(r),i=n+M(e),s=new Uint8Array(i+t.byteLength);return q(r,s,0),q(e,s,n),s.set(t,i),s}var _r=Symbol.for("@ipld/js-cid/CID");var Ne={...Ae,...ge,...Ee,...pe,...me,...ve,...ye,...xe,...we,...be},Qn={...Le,...Te};function ct(r=0){return new Uint8Array(r)}function ut(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var ht=ut("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Ue=ut("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=ct(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),kr={utf8:ht,"utf-8":ht,hex:Ne.base16,latin1:Ue,ascii:Ue,binary:Ue,...Ne},ft=kr;function lt(r,e="utf8"){let t=ft[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(r).substring(1)}var Pe=60;function ne(r){return{Status:r.Status??0,TC:r.TC??r.flag_tc??!1,RD:r.RD??r.flag_rd??!1,RA:r.RA??r.flag_ra??!1,AD:r.AD??r.flag_ad??!1,CD:r.CD??r.flag_cd??!1,Question:(r.Question??r.questions??[]).map(e=>({name:e.name,type:x[e.type]})),Answer:(r.Answer??r.answers??[]).map(e=>({name:e.name,type:x[e.type],TTL:e.TTL??e.ttl??Pe,data:e.data instanceof Uint8Array?lt(e.data):e.data}))}}var qr=4;function ze(r,e={}){let t=new Q({concurrency:e.queryConcurrency??qr});return async(n,i={})=>{let s=i?.logger?.forComponent("dns:dns-json-over-https"),o=new URLSearchParams;o.set("name",n),ee(i.types).forEach(a=>{o.append("type",x[a])}),i.onProgress?.(new U("dns:query",n)),s?.("GET %s",`${r}?${o}`);let c=await t.add(async()=>{let a=await fetch(`${r}?${o}`,{headers:{accept:"application/dns-json"},signal:i?.signal});if(s?.("GET %s %d",a.url,a.status),a.status!==200)throw new Error(`Unexpected HTTP status: ${a.status} - ${a.statusText}`);let h=ne(await a.json());return i.onProgress?.(new U("dns:response",h)),h},{signal:i.signal});if(c==null)throw new Error("No DNS response received");return c}}function dt(){return[ze("https://cloudflare-dns.com/dns-query"),ze("https://dns.google/resolve")]}var gt=qe(mt(),1);var $e=class{lru;constructor(e){this.lru=(0,gt.default)(e)}get(e,t){let n=!0,i=[];for(let s of t){let o=this.getAnswers(e,s);if(o.length===0){n=!1;break}i.push(...o)}if(n)return ne({answers:i})}getAnswers(e,t){let n=`${e.toLowerCase()}-${t}`,i=this.lru.get(n);if(i!=null){let s=i.filter(o=>o.expires>Date.now()).map(({expires:o,value:c})=>({...c,TTL:Math.round((o-Date.now())/1e3),type:x[c.type]}));return s.length===0&&this.lru.remove(n),s}return[]}add(e,t){let n=`${e.toLowerCase()}-${t.type}`,i=this.lru.get(n)??[];i.push({expires:Date.now()+(t.TTL??Pe)*1e3,value:t}),this.lru.set(n,i)}remove(e,t){let n=`${e.toLowerCase()}-${t}`;this.lru.remove(n)}clear(){this.lru.clear()}};function bt(r){return new $e(r)}var Mr=1e3,ie=class{resolvers;cache;logger;constructor(e){this.resolvers={},this.cache=bt(e.cacheSize??Mr),this.logger=e.logger,Object.entries(e.resolvers??{}).forEach(([t,n])=>{Array.isArray(n)||(n=[n]),t.endsWith(".")||(t=`${t}.`),this.resolvers[t]=n}),this.resolvers["."]==null&&(this.resolvers["."]=dt())}async query(e,t={}){let n=ee(t.types),i=t.cached!==!1?this.cache.get(e,n):void 0;if(i!=null)return t.onProgress?.(new U("dns:cache",i)),i;let s=`${e.split(".").pop()}.`,o=(this.resolvers[s]??this.resolvers["."]).sort(()=>Math.random()>.5?-1:1),c=[];for(let a of o){if(t.signal?.aborted===!0)break;try{let h=await a(e,{...t,logger:this.logger,types:n});for(let u of h.Answer)this.cache.add(e,u);return h}catch(h){c.push(h),t.onProgress?.(new U("dns:error",h))}}throw new K(c,`DNS lookup of ${e} ${n} failed`)}};var x;(function(r){r[r.A=1]="A",r[r.CNAME=5]="CNAME",r[r.TXT=16]="TXT",r[r.AAAA=28]="AAAA"})(x||(x={}));var Rr=32;function Br(r={}){return new ie(r)}return Ct(Fr);})();
return MultiformatsDns}));
//# sourceMappingURL=index.min.js.map

@@ -1,2 +0,2 @@

import type { DNS as DNSInterface, DNSInit, DNSResponse, QueryOptions } from './index.js';
import type { DNS as DNSInterface, DNSInit, DNSResponse, QueryOptions } from './index.ts';
export declare class DNS implements DNSInterface {

@@ -3,0 +3,0 @@ private readonly resolvers;

import { CustomProgressEvent } from 'progress-events';
import { DNSQueryFailedError } from "./errors.js";
import { defaultResolver } from './resolvers/default.js';
import { cache } from './utils/cache.js';
import { getTypes } from './utils/get-types.js';
import { defaultResolver } from "./resolvers/default.js";
import { cache } from "./utils/cache.js";
import { getTypes } from "./utils/get-types.js";
const DEFAULT_ANSWER_CACHE_SIZE = 1000;

@@ -7,0 +7,0 @@ export class DNS {

@@ -82,3 +82,3 @@ /**

*/
import type { DNSResolver } from './resolvers/index.js';
import type { DNSResolver } from './resolvers/index.ts';
import type { ComponentLogger } from '@libp2p/interface';

@@ -85,0 +85,0 @@ import type { ProgressEvent, ProgressOptions } from 'progress-events';

@@ -82,3 +82,3 @@ /**

*/
import { DNS as DNSClass } from './dns.js';
import { DNS as DNSClass } from "./dns.js";
/**

@@ -85,0 +85,0 @@ * A subset of DNS Record Types

@@ -1,3 +0,3 @@

import type { DNSResolver } from './index.js';
import type { DNSResolver } from './index.ts';
export declare function defaultResolver(): DNSResolver[];
//# sourceMappingURL=default.browser.d.ts.map

@@ -1,2 +0,2 @@

import { dnsJsonOverHttps } from './dns-json-over-https.js';
import { dnsJsonOverHttps } from "./dns-json-over-https.js";
export function defaultResolver() {

@@ -3,0 +3,0 @@ return [

@@ -1,3 +0,3 @@

import type { DNSResolver } from './index.js';
import type { DNSResolver } from './index.ts';
export declare function defaultResolver(): DNSResolver[];
//# sourceMappingURL=default.d.ts.map
import { Resolver } from 'dns/promises';
import { RecordType } from '../index.js';
import { getTypes } from '../utils/get-types.js';
import { toDNSResponse } from '../utils/to-dns-response.js';
import { RecordType } from "../index.js";
import { getTypes } from "../utils/get-types.js";
import { toDNSResponse } from "../utils/to-dns-response.js";
const nodeResolver = async (fqdn, options = {}) => {

@@ -6,0 +6,0 @@ const resolver = new Resolver();

@@ -1,2 +0,2 @@

import type { DNSResolver } from './index.js';
import type { DNSResolver } from './index.ts';
/**

@@ -3,0 +3,0 @@ * Browsers limit concurrent connections per host (~6), we don't want to exhaust

import PQueue from 'p-queue';
import { CustomProgressEvent } from 'progress-events';
import { RecordType } from '../index.js';
import { getTypes } from '../utils/get-types.js';
import { toDNSResponse } from '../utils/to-dns-response.js';
import { RecordType } from "../index.js";
import { getTypes } from "../utils/get-types.js";
import { toDNSResponse } from "../utils/to-dns-response.js";
/**

@@ -7,0 +7,0 @@ * Browsers limit concurrent connections per host (~6), we don't want to exhaust

@@ -1,2 +0,2 @@

import type { DNSResolver } from './index.js';
import type { DNSResolver } from './index.ts';
import type { ComponentLogger } from '@libp2p/interface';

@@ -3,0 +3,0 @@ /**

@@ -5,5 +5,5 @@ import { decode, encode, RECURSION_DESIRED } from '@dnsquery/dns-packet';

import { toString as uint8ArrayToString } from 'uint8arrays/to-string';
import { RecordType } from '../index.js';
import { getTypes } from '../utils/get-types.js';
import { toDNSResponse } from '../utils/to-dns-response.js';
import { RecordType } from "../index.js";
import { getTypes } from "../utils/get-types.js";
import { toDNSResponse } from "../utils/to-dns-response.js";
/**

@@ -10,0 +10,0 @@ * Browsers limit concurrent connections per host (~6), we don't want to exhaust

@@ -1,7 +0,9 @@

import type { DNSResponse, QueryOptions } from '../index.js';
import type { DNSResponse, QueryOptions } from '../index.ts';
export interface DNSResolver {
(domain: string, options?: QueryOptions): Promise<DNSResponse>;
}
export { dnsOverHttps } from './dns-over-https.js';
export { dnsJsonOverHttps } from './dns-json-over-https.js';
export type { DNSJSONOverHTTPSOptions } from './dns-json-over-https.ts';
export type { DNSOverHTTPSOptions } from './dns-over-https.ts';
export { dnsOverHttps } from './dns-over-https.ts';
export { dnsJsonOverHttps } from './dns-json-over-https.ts';
//# sourceMappingURL=index.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resolvers/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE5D,MAAM,WAAW,WAAW;IAC1B,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;CAC/D;AAED,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resolvers/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE5D,MAAM,WAAW,WAAW;IAC1B,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;CAC/D;AAED,YAAY,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AACvE,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA"}

@@ -1,3 +0,3 @@

export { dnsOverHttps } from './dns-over-https.js';
export { dnsJsonOverHttps } from './dns-json-over-https.js';
export { dnsOverHttps } from "./dns-over-https.js";
export { dnsJsonOverHttps } from "./dns-json-over-https.js";
//# sourceMappingURL=index.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resolvers/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA"}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resolvers/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA"}

@@ -1,3 +0,3 @@

import { RecordType } from '../index.js';
import type { Answer, DNSResponse } from '../index.js';
import { RecordType } from '../index.ts';
import type { Answer, DNSResponse } from '../index.ts';
export interface AnswerCache {

@@ -4,0 +4,0 @@ get(fqdn: string, types: RecordType[]): DNSResponse | undefined;

import hashlru from 'hashlru';
import { RecordType } from '../index.js';
import { DEFAULT_TTL, toDNSResponse } from './to-dns-response.js';
import { RecordType } from "../index.js";
import { DEFAULT_TTL, toDNSResponse } from "./to-dns-response.js";
/**

@@ -5,0 +5,0 @@ * Time Aware Least Recent Used Cache

@@ -1,3 +0,3 @@

import { RecordType } from '../index.js';
import { RecordType } from '../index.ts';
export declare function getTypes(types?: RecordType | RecordType[]): RecordType[];
//# sourceMappingURL=get-types.d.ts.map

@@ -1,2 +0,2 @@

import { RecordType } from '../index.js';
import { RecordType } from "../index.js";
export function getTypes(types) {

@@ -3,0 +3,0 @@ const DEFAULT_TYPES = [

@@ -1,2 +0,2 @@

import type { DNSResponse } from '../index.js';
import type { DNSResponse } from '../index.ts';
/**

@@ -3,0 +3,0 @@ * This TTL will be used if the remote service does not return one

import { toString as uint8ArrayToString } from 'uint8arrays/to-string';
import { RecordType } from '../index.js';
import { RecordType } from "../index.js";
/**

@@ -4,0 +4,0 @@ * This TTL will be used if the remote service does not return one

@@ -24,2 +24,4 @@ {

".:dns": "https://multiformats.github.io/js-dns/functions/index.dns.html",
"DNSJSONOverHTTPSOptions": "https://multiformats.github.io/js-dns/interfaces/resolvers.DNSJSONOverHTTPSOptions.html",
"DNSOverHTTPSOptions": "https://multiformats.github.io/js-dns/interfaces/resolvers.DNSOverHTTPSOptions.html",
"DNSResolver": "https://multiformats.github.io/js-dns/interfaces/resolvers.DNSResolver.html",

@@ -26,0 +28,0 @@ "./resolvers:DNSResolver": "https://multiformats.github.io/js-dns/interfaces/resolvers.DNSResolver.html",

{
"name": "@multiformats/dns",
"version": "1.0.13",
"version": "1.0.14",
"description": "Resolve DNS queries with browser fallback",

@@ -45,7 +45,9 @@ "license": "Apache-2.0 OR MIT",

"types": "./dist/src/index.d.ts",
"import": "./dist/src/index.js"
"import": "./dist/src/index.js",
"module-sync": "./dist/src/index.js"
},
"./resolvers": {
"types": "./dist/src/resolvers/index.d.ts",
"import": "./dist/src/resolvers/index.js"
"import": "./dist/src/resolvers/index.js",
"module-sync": "./dist/src/resolvers/index.js"
}

@@ -167,3 +169,3 @@ },

"progress-events": "^1.0.0",
"uint8arrays": "^5.0.2"
"uint8arrays": "^6.1.1"
},

@@ -173,3 +175,3 @@ "devDependencies": {

"@types/sinon": "^21.0.0",
"aegir": "^47.0.21",
"aegir": "^48.0.13",
"sinon": "^21.0.0"

@@ -176,0 +178,0 @@ },

import { CustomProgressEvent } from 'progress-events'
import { DNSQueryFailedError } from './errors.ts'
import { defaultResolver } from './resolvers/default.js'
import { cache } from './utils/cache.js'
import { getTypes } from './utils/get-types.js'
import type { DNS as DNSInterface, DNSInit, DNSResponse, QueryOptions } from './index.js'
import type { DNSResolver } from './resolvers/index.js'
import type { AnswerCache } from './utils/cache.js'
import { defaultResolver } from './resolvers/default.ts'
import { cache } from './utils/cache.ts'
import { getTypes } from './utils/get-types.ts'
import type { DNS as DNSInterface, DNSInit, DNSResponse, QueryOptions } from './index.ts'
import type { DNSResolver } from './resolvers/index.ts'
import type { AnswerCache } from './utils/cache.ts'
import type { ComponentLogger } from '@libp2p/interface'

@@ -10,0 +10,0 @@

@@ -83,4 +83,4 @@ /**

import { DNS as DNSClass } from './dns.js'
import type { DNSResolver } from './resolvers/index.js'
import { DNS as DNSClass } from './dns.ts'
import type { DNSResolver } from './resolvers/index.ts'
import type { ComponentLogger } from '@libp2p/interface'

@@ -87,0 +87,0 @@ import type { ProgressEvent, ProgressOptions } from 'progress-events'

@@ -1,3 +0,3 @@

import { dnsJsonOverHttps } from './dns-json-over-https.js'
import type { DNSResolver } from './index.js'
import { dnsJsonOverHttps } from './dns-json-over-https.ts'
import type { DNSResolver } from './index.ts'

@@ -4,0 +4,0 @@ export function defaultResolver (): DNSResolver[] {

import { Resolver } from 'dns/promises'
import { RecordType } from '../index.js'
import { getTypes } from '../utils/get-types.js'
import { toDNSResponse } from '../utils/to-dns-response.js'
import type { DNSResolver } from './index.js'
import type { Answer } from '../index.js'
import { RecordType } from '../index.ts'
import { getTypes } from '../utils/get-types.ts'
import { toDNSResponse } from '../utils/to-dns-response.ts'
import type { DNSResolver } from './index.ts'
import type { Answer } from '../index.ts'

@@ -8,0 +8,0 @@ const nodeResolver: DNSResolver = async (fqdn, options = {}) => {

import PQueue from 'p-queue'
import { CustomProgressEvent } from 'progress-events'
import { RecordType } from '../index.js'
import { getTypes } from '../utils/get-types.js'
import { toDNSResponse } from '../utils/to-dns-response.js'
import type { DNSResponse } from '../index.js'
import type { DNSResolver } from './index.js'
import { RecordType } from '../index.ts'
import { getTypes } from '../utils/get-types.ts'
import { toDNSResponse } from '../utils/to-dns-response.ts'
import type { DNSResponse } from '../index.ts'
import type { DNSResolver } from './index.ts'

@@ -9,0 +9,0 @@ /**

@@ -5,7 +5,7 @@ import { decode, encode, RECURSION_DESIRED } from '@dnsquery/dns-packet'

import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
import { RecordType } from '../index.js'
import { getTypes } from '../utils/get-types.js'
import { toDNSResponse } from '../utils/to-dns-response.js'
import type { DNSResolver } from './index.js'
import type { DNSResponse } from '../index.js'
import { RecordType } from '../index.ts'
import { getTypes } from '../utils/get-types.ts'
import { toDNSResponse } from '../utils/to-dns-response.ts'
import type { DNSResolver } from './index.ts'
import type { DNSResponse } from '../index.ts'
import type { ComponentLogger } from '@libp2p/interface'

@@ -12,0 +12,0 @@

@@ -1,2 +0,2 @@

import type { DNSResponse, QueryOptions } from '../index.js'
import type { DNSResponse, QueryOptions } from '../index.ts'

@@ -7,3 +7,6 @@ export interface DNSResolver {

export { dnsOverHttps } from './dns-over-https.js'
export { dnsJsonOverHttps } from './dns-json-over-https.js'
export type { DNSJSONOverHTTPSOptions } from './dns-json-over-https.ts'
export type { DNSOverHTTPSOptions } from './dns-over-https.ts'
export { dnsOverHttps } from './dns-over-https.ts'
export { dnsJsonOverHttps } from './dns-json-over-https.ts'
import hashlru from 'hashlru'
import { RecordType } from '../index.js'
import { DEFAULT_TTL, toDNSResponse } from './to-dns-response.js'
import type { Answer, DNSResponse } from '../index.js'
import { RecordType } from '../index.ts'
import { DEFAULT_TTL, toDNSResponse } from './to-dns-response.ts'
import type { Answer, DNSResponse } from '../index.ts'

@@ -6,0 +6,0 @@ interface CachedAnswer {

@@ -1,2 +0,2 @@

import { RecordType } from '../index.js'
import { RecordType } from '../index.ts'

@@ -3,0 +3,0 @@ export function getTypes (types?: RecordType | RecordType[]): RecordType[] {

import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
import { RecordType } from '../index.js'
import type { DNSResponse } from '../index.js'
import { RecordType } from '../index.ts'
import type { DNSResponse } from '../index.ts'

@@ -5,0 +5,0 @@ /**

Sorry, the diff of this file is too big to display