@tbd54566975/common
Advanced tools
Comparing version 0.1.0 to 0.1.1-alpha-20230713-d1dda95
@@ -1,2 +0,15 @@ | ||
"use strict";var Web5=(()=>{var Tr=Object.create;var q=Object.defineProperty;var Ir=Object.getOwnPropertyDescriptor;var dr=Object.getOwnPropertyNames;var Cr=Object.getPrototypeOf,Sr=Object.prototype.hasOwnProperty;var Lr=(e,r)=>()=>(e&&(r=e(e=0)),r);var N=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var rr=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of dr(r))!Sr.call(e,n)&&n!==t&&q(e,n,{get:()=>r[n],enumerable:!(i=Ir(r,n))||i.enumerable});return e};var tr=(e,r,t)=>(t=e!=null?Tr(Cr(e)):{},rr(r||!e||!e.__esModule?q(t,"default",{value:e,enumerable:!0}):t,e)),Rr=e=>rr(q({},"__esModule",{value:!0}),e);var nr=N(W=>{"use strict";m();W.byteLength=Mr;W.toByteArray=Dr;W.fromByteArray=Wr;var g=[],E=[],_r=typeof Uint8Array<"u"?Uint8Array:Array,H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(d=0,er=H.length;d<er;++d)g[d]=H[d],E[H.charCodeAt(d)]=d;var d,er;E["-".charCodeAt(0)]=62;E["_".charCodeAt(0)]=63;function ir(e){var r=e.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=r);var i=t===r?0:4-t%4;return[t,i]}function Mr(e){var r=ir(e),t=r[0],i=r[1];return(t+i)*3/4-i}function kr(e,r,t){return(r+t)*3/4-t}function Dr(e){var r,t=ir(e),i=t[0],n=t[1],o=new _r(kr(e,i,n)),u=0,h=n>0?i-4:i,f;for(f=0;f<h;f+=4)r=E[e.charCodeAt(f)]<<18|E[e.charCodeAt(f+1)]<<12|E[e.charCodeAt(f+2)]<<6|E[e.charCodeAt(f+3)],o[u++]=r>>16&255,o[u++]=r>>8&255,o[u++]=r&255;return n===2&&(r=E[e.charCodeAt(f)]<<2|E[e.charCodeAt(f+1)]>>4,o[u++]=r&255),n===1&&(r=E[e.charCodeAt(f)]<<10|E[e.charCodeAt(f+1)]<<4|E[e.charCodeAt(f+2)]>>2,o[u++]=r>>8&255,o[u++]=r&255),o}function br(e){return g[e>>18&63]+g[e>>12&63]+g[e>>6&63]+g[e&63]}function Nr(e,r,t){for(var i,n=[],o=r;o<t;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),n.push(br(i));return n.join("")}function Wr(e){for(var r,t=e.length,i=t%3,n=[],o=16383,u=0,h=t-i;u<h;u+=o)n.push(Nr(e,u,u+o>h?h:u+o));return i===1?(r=e[t-1],n.push(g[r>>2]+g[r<<4&63]+"==")):i===2&&(r=(e[t-2]<<8)+e[t-1],n.push(g[r>>10]+g[r>>4&63]+g[r<<2&63]+"=")),n.join("")}});var or=N(X=>{m();X.read=function(e,r,t,i,n){var o,u,h=n*8-i-1,f=(1<<h)-1,c=f>>1,l=-7,p=t?n-1:0,F=t?-1:1,x=e[r+p];for(p+=F,o=x&(1<<-l)-1,x>>=-l,l+=h;l>0;o=o*256+e[r+p],p+=F,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=i;l>0;u=u*256+e[r+p],p+=F,l-=8);if(o===0)o=1-c;else{if(o===f)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,i),o=o-c}return(x?-1:1)*u*Math.pow(2,o-i)};X.write=function(e,r,t,i,n,o){var u,h,f,c=o*8-n-1,l=(1<<c)-1,p=l>>1,F=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=i?0:o-1,L=i?1:-1,Ur=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,u=l):(u=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-u))<1&&(u--,f*=2),u+p>=1?r+=F/f:r+=F*Math.pow(2,1-p),r*f>=2&&(u++,f/=2),u+p>=l?(h=0,u=l):u+p>=1?(h=(r*f-1)*Math.pow(2,n),u=u+p):(h=r*Math.pow(2,p-1)*Math.pow(2,n),u=0));n>=8;e[t+x]=h&255,x+=L,h/=256,n-=8);for(u=u<<n|h,c+=n;c>0;e[t+x]=u&255,x+=L,u/=256,c-=8);e[t+x-L]|=Ur*128}});var Er=N(k=>{"use strict";m();var G=nr(),M=or(),ur=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;k.Buffer=a;k.SlowBuffer=Xr;k.INSPECT_MAX_BYTES=50;var K=2147483647;k.kMaxLength=K;a.TYPED_ARRAY_SUPPORT=Kr();!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Kr(){try{var e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}});Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function U(e){if(e>K)throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=new Uint8Array(e);return Object.setPrototypeOf(r,a.prototype),r}function a(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return O(e)}return fr(e,r,t)}a.poolSize=8192;function fr(e,r,t){if(typeof e=="string")return Yr(e,r);if(ArrayBuffer.isView(e))return qr(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(B(e,SharedArrayBuffer)||e&&B(e.buffer,SharedArrayBuffer)))return J(e,r,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(i!=null&&i!==e)return a.from(i,r,t);var n=Hr(e);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return a.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}a.from=function(e,r,t){return fr(e,r,t)};Object.setPrototypeOf(a.prototype,Uint8Array.prototype);Object.setPrototypeOf(a,Uint8Array);function pr(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Vr(e,r,t){return pr(e),e<=0?U(e):r!==void 0?typeof t=="string"?U(e).fill(r,t):U(e).fill(r):U(e)}a.alloc=function(e,r,t){return Vr(e,r,t)};function O(e){return pr(e),U(e<0?0:P(e)|0)}a.allocUnsafe=function(e){return O(e)};a.allocUnsafeSlow=function(e){return O(e)};function Yr(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var t=cr(e,r)|0,i=U(t),n=i.write(e,r);return n!==t&&(i=i.slice(0,n)),i}function z(e){for(var r=e.length<0?0:P(e.length)|0,t=U(r),i=0;i<r;i+=1)t[i]=e[i]&255;return t}function qr(e){if(B(e,Uint8Array)){var r=new Uint8Array(e);return J(r.buffer,r.byteOffset,r.byteLength)}return z(e)}function J(e,r,t){if(r<0||e.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<r+(t||0))throw new RangeError('"length" is outside of buffer bounds');var i;return r===void 0&&t===void 0?i=new Uint8Array(e):t===void 0?i=new Uint8Array(e,r):i=new Uint8Array(e,r,t),Object.setPrototypeOf(i,a.prototype),i}function Hr(e){if(a.isBuffer(e)){var r=P(e.length)|0,t=U(r);return t.length===0||e.copy(t,0,0,r),t}if(e.length!==void 0)return typeof e.length!="number"||Z(e.length)?U(0):z(e);if(e.type==="Buffer"&&Array.isArray(e.data))return z(e.data)}function P(e){if(e>=K)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K.toString(16)+" bytes");return e|0}function Xr(e){return+e!=e&&(e=0),a.alloc(+e)}a.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==a.prototype};a.compare=function(r,t){if(B(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),B(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(r)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;for(var i=r.length,n=t.length,o=0,u=Math.min(i,n);o<u;++o)if(r[o]!==t[o]){i=r[o],n=t[o];break}return i<n?-1:n<i?1:0};a.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var i;if(t===void 0)for(t=0,i=0;i<r.length;++i)t+=r[i].length;var n=a.allocUnsafe(t),o=0;for(i=0;i<r.length;++i){var u=r[i];if(B(u,Uint8Array))o+u.length>n.length?a.from(u).copy(n,o):Uint8Array.prototype.set.call(n,u,o);else if(a.isBuffer(u))u.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=u.length}return n};function cr(e,r){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var t=e.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return mr(e).length;default:if(n)return i?-1:Q(e).length;r=(""+r).toLowerCase(),n=!0}}a.byteLength=cr;function Gr(e,r,t){var i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return tt(this,r,t);case"utf8":case"utf-8":return sr(this,r,t);case"ascii":return jr(this,r,t);case"latin1":case"binary":return rt(this,r,t);case"base64":return Zr(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return et(this,r,t);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}a.prototype._isBuffer=!0;function C(e,r,t){var i=e[r];e[r]=e[t],e[t]=i}a.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)C(this,t,t+1);return this};a.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)C(this,t,t+3),C(this,t+1,t+2);return this};a.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)C(this,t,t+7),C(this,t+1,t+6),C(this,t+2,t+5),C(this,t+3,t+4);return this};a.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?sr(this,0,r):Gr.apply(this,arguments)};a.prototype.toLocaleString=a.prototype.toString;a.prototype.equals=function(r){if(!a.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.inspect=function(){var r="",t=k.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"};ur&&(a.prototype[ur]=a.prototype.inspect);a.prototype.compare=function(r,t,i,n,o){if(B(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),!a.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;for(var u=o-n,h=i-t,f=Math.min(u,h),c=this.slice(n,o),l=r.slice(t,i),p=0;p<f;++p)if(c[p]!==l[p]){u=c[p],h=l[p];break}return u<h?-1:h<u?1:0};function lr(e,r,t,i,n){if(e.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Z(t)&&(t=n?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(n)return-1;t=e.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof r=="string"&&(r=a.from(r,i)),a.isBuffer(r))return r.length===0?-1:ar(e,r,t,i,n);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):ar(e,[r],t,i,n);throw new TypeError("val must be string, number or Buffer")}function ar(e,r,t,i,n){var o=1,u=e.length,h=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,u/=2,h/=2,t/=2}function f(x,L){return o===1?x[L]:x.readUInt16BE(L*o)}var c;if(n){var l=-1;for(c=t;c<u;c++)if(f(e,c)===f(r,l===-1?0:c-l)){if(l===-1&&(l=c),c-l+1===h)return l*o}else l!==-1&&(c-=c-l),l=-1}else for(t+h>u&&(t=u-h),c=t;c>=0;c--){for(var p=!0,F=0;F<h;F++)if(f(e,c+F)!==f(r,F)){p=!1;break}if(p)return c}return-1}a.prototype.includes=function(r,t,i){return this.indexOf(r,t,i)!==-1};a.prototype.indexOf=function(r,t,i){return lr(this,r,t,i,!0)};a.prototype.lastIndexOf=function(r,t,i){return lr(this,r,t,i,!1)};function zr(e,r,t,i){t=Number(t)||0;var n=e.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;var o=r.length;i>o/2&&(i=o/2);for(var u=0;u<i;++u){var h=parseInt(r.substr(u*2,2),16);if(Z(h))return u;e[t+u]=h}return u}function Jr(e,r,t,i){return V(Q(r,e.length-t),e,t,i)}function Qr(e,r,t,i){return V(ot(r),e,t,i)}function Or(e,r,t,i){return V(mr(r),e,t,i)}function Pr(e,r,t,i){return V(ut(r,e.length-t),e,t,i)}a.prototype.write=function(r,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-t;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var u=!1;;)switch(n){case"hex":return zr(this,r,t,i);case"utf8":case"utf-8":return Jr(this,r,t,i);case"ascii":case"latin1":case"binary":return Qr(this,r,t,i);case"base64":return Or(this,r,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pr(this,r,t,i);default:if(u)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),u=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Zr(e,r,t){return r===0&&t===e.length?G.fromByteArray(e):G.fromByteArray(e.slice(r,t))}function sr(e,r,t){t=Math.min(e.length,t);for(var i=[],n=r;n<t;){var o=e[n],u=null,h=o>239?4:o>223?3:o>191?2:1;if(n+h<=t){var f,c,l,p;switch(h){case 1:o<128&&(u=o);break;case 2:f=e[n+1],(f&192)===128&&(p=(o&31)<<6|f&63,p>127&&(u=p));break;case 3:f=e[n+1],c=e[n+2],(f&192)===128&&(c&192)===128&&(p=(o&15)<<12|(f&63)<<6|c&63,p>2047&&(p<55296||p>57343)&&(u=p));break;case 4:f=e[n+1],c=e[n+2],l=e[n+3],(f&192)===128&&(c&192)===128&&(l&192)===128&&(p=(o&15)<<18|(f&63)<<12|(c&63)<<6|l&63,p>65535&&p<1114112&&(u=p))}}u===null?(u=65533,h=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|u&1023),i.push(u),n+=h}return $r(i)}var hr=4096;function $r(e){var r=e.length;if(r<=hr)return String.fromCharCode.apply(String,e);for(var t="",i=0;i<r;)t+=String.fromCharCode.apply(String,e.slice(i,i+=hr));return t}function jr(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]&127);return i}function rt(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]);return i}function tt(e,r,t){var i=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>i)&&(t=i);for(var n="",o=r;o<t;++o)n+=at[e[o]];return n}function et(e,r,t){for(var i=e.slice(r,t),n="",o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}a.prototype.slice=function(r,t){var i=this.length;r=~~r,t=t===void 0?i:~~t,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<r&&(t=r);var n=this.subarray(r,t);return Object.setPrototypeOf(n,a.prototype),n};function w(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=this[r],o=1,u=0;++u<t&&(o*=256);)n+=this[r+u]*o;return n};a.prototype.readUintBE=a.prototype.readUIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=this[r+--t],o=1;t>0&&(o*=256);)n+=this[r+--t]*o;return n};a.prototype.readUint8=a.prototype.readUInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]};a.prototype.readUint16LE=a.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUint16BE=a.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUint32LE=a.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};a.prototype.readUint32BE=a.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};a.prototype.readIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=this[r],o=1,u=0;++u<t&&(o*=256);)n+=this[r+u]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n};a.prototype.readIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=t,o=1,u=this[r+--n];n>0&&(o*=256);)u+=this[r+--n]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*t)),u};a.prototype.readInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,t){r=r>>>0,t||w(r,2,this.length);var i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};a.prototype.readInt16BE=function(r,t){r=r>>>0,t||w(r,2,this.length);var i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};a.prototype.readInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};a.prototype.readInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};a.prototype.readFloatLE=function(r,t){return r=r>>>0,t||w(r,4,this.length),M.read(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,t){return r=r>>>0,t||w(r,4,this.length),M.read(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||w(r,8,this.length),M.read(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||w(r,8,this.length),M.read(this,r,!1,52,8)};function y(e,r,t,i,n,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<o)throw new RangeError('"value" argument is out of bounds');if(t+i>e.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(r,t,i,n){if(r=+r,t=t>>>0,i=i>>>0,!n){var o=Math.pow(2,8*i)-1;y(this,r,t,i,o,0)}var u=1,h=0;for(this[t]=r&255;++h<i&&(u*=256);)this[t+h]=r/u&255;return t+i};a.prototype.writeUintBE=a.prototype.writeUIntBE=function(r,t,i,n){if(r=+r,t=t>>>0,i=i>>>0,!n){var o=Math.pow(2,8*i)-1;y(this,r,t,i,o,0)}var u=i-1,h=1;for(this[t+u]=r&255;--u>=0&&(h*=256);)this[t+u]=r/h&255;return t+i};a.prototype.writeUint8=a.prototype.writeUInt8=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,1,255,0),this[t]=r&255,t+1};a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};a.prototype.writeIntLE=function(r,t,i,n){if(r=+r,t=t>>>0,!n){var o=Math.pow(2,8*i-1);y(this,r,t,i,o-1,-o)}var u=0,h=1,f=0;for(this[t]=r&255;++u<i&&(h*=256);)r<0&&f===0&&this[t+u-1]!==0&&(f=1),this[t+u]=(r/h>>0)-f&255;return t+i};a.prototype.writeIntBE=function(r,t,i,n){if(r=+r,t=t>>>0,!n){var o=Math.pow(2,8*i-1);y(this,r,t,i,o-1,-o)}var u=i-1,h=1,f=0;for(this[t+u]=r&255;--u>=0&&(h*=256);)r<0&&f===0&&this[t+u+1]!==0&&(f=1),this[t+u]=(r/h>>0)-f&255;return t+i};a.prototype.writeInt8=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};a.prototype.writeInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};a.prototype.writeInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};a.prototype.writeInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};a.prototype.writeInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function wr(e,r,t,i,n,o){if(t+i>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function yr(e,r,t,i,n){return r=+r,t=t>>>0,n||wr(e,r,t,4,34028234663852886e22,-34028234663852886e22),M.write(e,r,t,i,23,4),t+4}a.prototype.writeFloatLE=function(r,t,i){return yr(this,r,t,!0,i)};a.prototype.writeFloatBE=function(r,t,i){return yr(this,r,t,!1,i)};function xr(e,r,t,i,n){return r=+r,t=t>>>0,n||wr(e,r,t,8,17976931348623157e292,-17976931348623157e292),M.write(e,r,t,i,52,8),t+8}a.prototype.writeDoubleLE=function(r,t,i){return xr(this,r,t,!0,i)};a.prototype.writeDoubleBE=function(r,t,i){return xr(this,r,t,!1,i)};a.prototype.copy=function(r,t,i,n){if(!a.isBuffer(r))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n<i&&(n=i),n===i||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-t<n-i&&(n=r.length-t+i);var o=n-i;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,i,n):Uint8Array.prototype.set.call(r,this.subarray(i,n),t),o};a.prototype.fill=function(r,t,i,n){if(typeof r=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(r.length===1){var o=r.charCodeAt(0);(n==="utf8"&&o<128||n==="latin1")&&(r=o)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);var u;if(typeof r=="number")for(u=t;u<i;++u)this[u]=r;else{var h=a.isBuffer(r)?r:a.from(r,n),f=h.length;if(f===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(u=0;u<i-t;++u)this[u+t]=h[u%f]}return this};var it=/[^+/0-9A-Za-z-_]/g;function nt(e){if(e=e.split("=")[0],e=e.trim().replace(it,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Q(e,r){r=r||1/0;for(var t,i=e.length,n=null,o=[],u=0;u<i;++u){if(t=e.charCodeAt(u),t>55295&&t<57344){if(!n){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function ot(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function ut(e,r){for(var t,i,n,o=[],u=0;u<e.length&&!((r-=2)<0);++u)t=e.charCodeAt(u),i=t>>8,n=t%256,o.push(n),o.push(i);return o}function mr(e){return G.toByteArray(nt(e))}function V(e,r,t,i){for(var n=0;n<i&&!(n+t>=r.length||n>=e.length);++n)r[n+t]=e[n];return n}function B(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function Z(e){return e!==e}var at=function(){for(var e="0123456789abcdef",r=new Array(256),t=0;t<16;++t)for(var i=t*16,n=0;n<16;++n)r[i+n]=e[t]+e[n];return r}()});var vr=N((Et,Ar)=>{m();var s=Ar.exports={},A,v;function $(){throw new Error("setTimeout has not been defined")}function j(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?A=setTimeout:A=$}catch{A=$}try{typeof clearTimeout=="function"?v=clearTimeout:v=j}catch{v=j}})();function Fr(e){if(A===setTimeout)return setTimeout(e,0);if((A===$||!A)&&setTimeout)return A=setTimeout,setTimeout(e,0);try{return A(e,0)}catch{try{return A.call(null,e,0)}catch{return A.call(this,e,0)}}}function ht(e){if(v===clearTimeout)return clearTimeout(e);if((v===j||!v)&&clearTimeout)return v=clearTimeout,clearTimeout(e);try{return v(e)}catch{try{return v.call(null,e)}catch{return v.call(this,e)}}}var T=[],D=!1,S,Y=-1;function ft(){!D||!S||(D=!1,S.length?T=S.concat(T):Y=-1,T.length&&gr())}function gr(){if(!D){var e=Fr(ft);D=!0;for(var r=T.length;r;){for(S=T,T=[];++Y<r;)S&&S[Y].run();Y=-1,r=T.length}S=null,D=!1,ht(e)}}s.nextTick=function(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];T.push(new Br(e,r)),T.length===1&&!D&&Fr(gr)};function Br(e,r){this.fun=e,this.array=r}Br.prototype.run=function(){this.fun.apply(null,this.array)};s.title="browser";s.browser=!0;s.env={};s.argv=[];s.version="";s.versions={};function I(){}s.on=I;s.addListener=I;s.once=I;s.off=I;s.removeListener=I;s.removeAllListeners=I;s.emit=I;s.prependListener=I;s.prependOnceListener=I;s.listeners=function(e){return[]};s.binding=function(e){throw new Error("process.binding is not supported")};s.cwd=function(){return"/"};s.chdir=function(e){throw new Error("process.chdir is not supported")};s.umask=function(){return 0}});var R,_,gt,m=Lr(()=>{R=tr(Er()),_=tr(vr()),gt=function(e){function r(){var i=this||self;return delete e.prototype.__magic__,i}if(typeof globalThis=="object")return globalThis;if(this)return r();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:r});var t=__magic__;return t}(Object)});var pt={};m();m();return Rr(pt);})(); | ||
"use strict";var Web5=(()=>{var Be=Object.create;var fr=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var Fe=Object.getOwnPropertyNames;var Te=Object.getPrototypeOf,Se=Object.prototype.hasOwnProperty;var Ce=(t,r)=>()=>(t&&(r=t(t=0)),r);var pr=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),Pr=(t,r)=>{for(var e in r)fr(t,e,{get:r[e],enumerable:!0})},qr=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Fe(r))!Se.call(t,i)&&i!==e&&fr(t,i,{get:()=>r[i],enumerable:!(n=Ue(r,i))||n.enumerable});return t};var Jr=(t,r,e)=>(e=t!=null?Be(Te(t)):{},qr(r||!t||!t.__esModule?fr(e,"default",{value:t,enumerable:!0}):e,t)),Ie=t=>qr(fr({},"__esModule",{value:!0}),t);var Kr=pr(lr=>{"use strict";h();lr.byteLength=Le;lr.toByteArray=Ne;lr.fromByteArray=Oe;var k=[],C=[],Me=typeof Uint8Array<"u"?Uint8Array:Array,gr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(W=0,_r=gr.length;W<_r;++W)k[W]=gr[W],C[gr.charCodeAt(W)]=W;var W,_r;C["-".charCodeAt(0)]=62;C["_".charCodeAt(0)]=63;function jr(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");e===-1&&(e=r);var n=e===r?0:4-e%4;return[e,n]}function Le(t){var r=jr(t),e=r[0],n=r[1];return(e+n)*3/4-n}function De(t,r,e){return(r+e)*3/4-e}function Ne(t){var r,e=jr(t),n=e[0],i=e[1],o=new Me(De(t,n,i)),a=0,u=i>0?n-4:n,c;for(c=0;c<u;c+=4)r=C[t.charCodeAt(c)]<<18|C[t.charCodeAt(c+1)]<<12|C[t.charCodeAt(c+2)]<<6|C[t.charCodeAt(c+3)],o[a++]=r>>16&255,o[a++]=r>>8&255,o[a++]=r&255;return i===2&&(r=C[t.charCodeAt(c)]<<2|C[t.charCodeAt(c+1)]>>4,o[a++]=r&255),i===1&&(r=C[t.charCodeAt(c)]<<10|C[t.charCodeAt(c+1)]<<4|C[t.charCodeAt(c+2)]>>2,o[a++]=r>>8&255,o[a++]=r&255),o}function Re(t){return k[t>>18&63]+k[t>>12&63]+k[t>>6&63]+k[t&63]}function ke(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(Re(n));return i.join("")}function Oe(t){for(var r,e=t.length,n=e%3,i=[],o=16383,a=0,u=e-n;a<u;a+=o)i.push(ke(t,a,a+o>u?u:a+o));return n===1?(r=t[e-1],i.push(k[r>>2]+k[r<<4&63]+"==")):n===2&&(r=(t[e-2]<<8)+t[e-1],i.push(k[r>>10]+k[r>>4&63]+k[r<<2&63]+"=")),i.join("")}});var Hr=pr(br=>{h();br.read=function(t,r,e,n,i){var o,a,u=i*8-n-1,c=(1<<u)-1,l=c>>1,f=-7,p=e?i-1:0,E=e?-1:1,B=t[r+p];for(p+=E,o=B&(1<<-f)-1,B>>=-f,f+=u;f>0;o=o*256+t[r+p],p+=E,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=a*256+t[r+p],p+=E,f-=8);if(o===0)o=1-l;else{if(o===c)return a?NaN:(B?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-l}return(B?-1:1)*a*Math.pow(2,o-n)};br.write=function(t,r,e,n,i,o){var a,u,c,l=o*8-i-1,f=(1<<l)-1,p=f>>1,E=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=n?0:o-1,d=n?1:-1,v=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+p>=1?r+=E/c:r+=E*Math.pow(2,1-p),r*c>=2&&(a++,c/=2),a+p>=f?(u=0,a=f):a+p>=1?(u=(r*c-1)*Math.pow(2,i),a=a+p):(u=r*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;t[e+B]=u&255,B+=d,u/=256,i-=8);for(a=a<<i|u,l+=i;l>0;t[e+B]=a&255,B+=d,a/=256,l-=8);t[e+B-d]|=v*128}});var ae=pr(rr=>{"use strict";h();var Er=Kr(),Z=Hr(),Wr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;rr.Buffer=s;rr.SlowBuffer=Je;rr.INSPECT_MAX_BYTES=50;var dr=2147483647;rr.kMaxLength=dr;s.TYPED_ARRAY_SUPPORT=ze();!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ze(){try{var t=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(t,r),t.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}});Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function P(t){if(t>dr)throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return Object.setPrototypeOf(r,s.prototype),r}function s(t,r,e){if(typeof t=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Ur(t)}return Qr(t,r,e)}s.poolSize=8192;function Qr(t,r,e){if(typeof t=="string")return $e(t,r);if(ArrayBuffer.isView(t))return Pe(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(O(t,ArrayBuffer)||t&&O(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(O(t,SharedArrayBuffer)||t&&O(t.buffer,SharedArrayBuffer)))return Ar(t,r,e);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return s.from(n,r,e);var i=qe(t);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return s.from(t[Symbol.toPrimitive]("string"),r,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s.from=function(t,r,e){return Qr(t,r,e)};Object.setPrototypeOf(s.prototype,Uint8Array.prototype);Object.setPrototypeOf(s,Uint8Array);function Yr(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function Ve(t,r,e){return Yr(t),t<=0?P(t):r!==void 0?typeof e=="string"?P(t).fill(r,e):P(t).fill(r):P(t)}s.alloc=function(t,r,e){return Ve(t,r,e)};function Ur(t){return Yr(t),P(t<0?0:Fr(t)|0)}s.allocUnsafe=function(t){return Ur(t)};s.allocUnsafeSlow=function(t){return Ur(t)};function $e(t,r){if((typeof r!="string"||r==="")&&(r="utf8"),!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var e=Zr(t,r)|0,n=P(e),i=n.write(t,r);return i!==e&&(n=n.slice(0,i)),n}function vr(t){for(var r=t.length<0?0:Fr(t.length)|0,e=P(r),n=0;n<r;n+=1)e[n]=t[n]&255;return e}function Pe(t){if(O(t,Uint8Array)){var r=new Uint8Array(t);return Ar(r.buffer,r.byteOffset,r.byteLength)}return vr(t)}function Ar(t,r,e){if(r<0||t.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(e||0))throw new RangeError('"length" is outside of buffer bounds');var n;return r===void 0&&e===void 0?n=new Uint8Array(t):e===void 0?n=new Uint8Array(t,r):n=new Uint8Array(t,r,e),Object.setPrototypeOf(n,s.prototype),n}function qe(t){if(s.isBuffer(t)){var r=Fr(t.length)|0,e=P(r);return e.length===0||t.copy(e,0,0,r),e}if(t.length!==void 0)return typeof t.length!="number"||Tr(t.length)?P(0):vr(t);if(t.type==="Buffer"&&Array.isArray(t.data))return vr(t.data)}function Fr(t){if(t>=dr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+dr.toString(16)+" bytes");return t|0}function Je(t){return+t!=t&&(t=0),s.alloc(+t)}s.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==s.prototype};s.compare=function(r,e){if(O(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),O(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(r)||!s.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<n?1:0};s.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return s.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=s.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(O(a,Uint8Array))o+a.length>i.length?s.from(a).copy(i,o):Uint8Array.prototype.set.call(i,a,o);else if(s.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return i};function Zr(t,r){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||O(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var e=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&e===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return Br(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return oe(t).length;default:if(i)return n?-1:Br(t).length;r=(""+r).toLowerCase(),i=!0}}s.byteLength=Zr;function _e(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return rt(this,r,e);case"utf8":case"utf-8":return ee(this,r,e);case"ascii":return Ye(this,r,e);case"latin1":case"binary":return Ze(this,r,e);case"base64":return Ge(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return et(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function X(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}s.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)X(this,e,e+1);return this};s.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)X(this,e,e+3),X(this,e+1,e+2);return this};s.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)X(this,e,e+7),X(this,e+1,e+6),X(this,e+2,e+5),X(this,e+3,e+4);return this};s.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?ee(this,0,r):_e.apply(this,arguments)};s.prototype.toLocaleString=s.prototype.toString;s.prototype.equals=function(r){if(!s.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.inspect=function(){var r="",e=rr.INSPECT_MAX_BYTES;return r=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(r+=" ... "),"<Buffer "+r+">"};Wr&&(s.prototype[Wr]=s.prototype.inspect);s.prototype.compare=function(r,e,n,i,o){if(O(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),!s.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var a=o-i,u=n-e,c=Math.min(a,u),l=this.slice(i,o),f=r.slice(e,n),p=0;p<c;++p)if(l[p]!==f[p]){a=l[p],u=f[p];break}return a<u?-1:u<a?1:0};function re(t,r,e,n,i){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,Tr(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),s.isBuffer(r))return r.length===0?-1:Xr(t,r,e,n,i);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Xr(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Xr(t,r,e,n,i){var o=1,a=t.length,u=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;o=2,a/=2,u/=2,e/=2}function c(B,d){return o===1?B[d]:B.readUInt16BE(d*o)}var l;if(i){var f=-1;for(l=e;l<a;l++)if(c(t,l)===c(r,f===-1?0:l-f)){if(f===-1&&(f=l),l-f+1===u)return f*o}else f!==-1&&(l-=l-f),f=-1}else for(e+u>a&&(e=a-u),l=e;l>=0;l--){for(var p=!0,E=0;E<u;E++)if(c(t,l+E)!==c(r,E)){p=!1;break}if(p)return l}return-1}s.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};s.prototype.indexOf=function(r,e,n){return re(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return re(this,r,e,n,!1)};function je(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var u=parseInt(r.substr(a*2,2),16);if(Tr(u))return a;t[e+a]=u}return a}function Ke(t,r,e,n){return yr(Br(r,t.length-e),t,e,n)}function He(t,r,e,n){return yr(it(r),t,e,n)}function We(t,r,e,n){return yr(oe(r),t,e,n)}function Xe(t,r,e,n){return yr(ot(r,t.length-e),t,e,n)}s.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return je(this,r,e,n);case"utf8":case"utf-8":return Ke(this,r,e,n);case"ascii":case"latin1":case"binary":return He(this,r,e,n);case"base64":return We(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xe(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ge(t,r,e){return r===0&&e===t.length?Er.fromByteArray(t):Er.fromByteArray(t.slice(r,e))}function ee(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,u=o>239?4:o>223?3:o>191?2:1;if(i+u<=e){var c,l,f,p;switch(u){case 1:o<128&&(a=o);break;case 2:c=t[i+1],(c&192)===128&&(p=(o&31)<<6|c&63,p>127&&(a=p));break;case 3:c=t[i+1],l=t[i+2],(c&192)===128&&(l&192)===128&&(p=(o&15)<<12|(c&63)<<6|l&63,p>2047&&(p<55296||p>57343)&&(a=p));break;case 4:c=t[i+1],l=t[i+2],f=t[i+3],(c&192)===128&&(l&192)===128&&(f&192)===128&&(p=(o&15)<<18|(c&63)<<12|(l&63)<<6|f&63,p>65535&&p<1114112&&(a=p))}}a===null?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=u}return Qe(n)}var Gr=4096;function Qe(t){var r=t.length;if(r<=Gr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Gr));return e}function Ye(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function Ze(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function rt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=at[t[o]];return i}function et(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}s.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var i=this.subarray(r,e);return Object.setPrototypeOf(i,s.prototype),i};function b(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(r,e,n){r=r>>>0,e=e>>>0,n||b(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};s.prototype.readUintBE=s.prototype.readUIntBE=function(r,e,n){r=r>>>0,e=e>>>0,n||b(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};s.prototype.readUint8=s.prototype.readUInt8=function(r,e){return r=r>>>0,e||b(r,1,this.length),this[r]};s.prototype.readUint16LE=s.prototype.readUInt16LE=function(r,e){return r=r>>>0,e||b(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUint16BE=s.prototype.readUInt16BE=function(r,e){return r=r>>>0,e||b(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUint32LE=s.prototype.readUInt32LE=function(r,e){return r=r>>>0,e||b(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUint32BE=s.prototype.readUInt32BE=function(r,e){return r=r>>>0,e||b(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,e,n){r=r>>>0,e=e>>>0,n||b(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};s.prototype.readIntBE=function(r,e,n){r=r>>>0,e=e>>>0,n||b(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};s.prototype.readInt8=function(r,e){return r=r>>>0,e||b(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,e){r=r>>>0,e||b(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,e){r=r>>>0,e||b(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,e){return r=r>>>0,e||b(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,e){return r=r>>>0,e||b(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,e){return r=r>>>0,e||b(r,4,this.length),Z.read(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,e){return r=r>>>0,e||b(r,4,this.length),Z.read(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,e){return r=r>>>0,e||b(r,8,this.length),Z.read(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,e){return r=r>>>0,e||b(r,8,this.length),Z.read(this,r,!1,52,8)};function F(t,r,e,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(r,e,n,i){if(r=+r,e=e>>>0,n=n>>>0,!i){var o=Math.pow(2,8*n)-1;F(this,r,e,n,o,0)}var a=1,u=0;for(this[e]=r&255;++u<n&&(a*=256);)this[e+u]=r/a&255;return e+n};s.prototype.writeUintBE=s.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e>>>0,n=n>>>0,!i){var o=Math.pow(2,8*n)-1;F(this,r,e,n,o,0)}var a=n-1,u=1;for(this[e+a]=r&255;--a>=0&&(u*=256);)this[e+a]=r/u&255;return e+n};s.prototype.writeUint8=s.prototype.writeUInt8=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,1,255,0),this[e]=r&255,e+1};s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,2,65535,0),this[e]=r&255,this[e+1]=r>>>8,e+2};s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,2,65535,0),this[e]=r>>>8,this[e+1]=r&255,e+2};s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,4,4294967295,0),this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255,e+4};s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,4,4294967295,0),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255,e+4};s.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e>>>0,!i){var o=Math.pow(2,8*n-1);F(this,r,e,n,o-1,-o)}var a=0,u=1,c=0;for(this[e]=r&255;++a<n&&(u*=256);)r<0&&c===0&&this[e+a-1]!==0&&(c=1),this[e+a]=(r/u>>0)-c&255;return e+n};s.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e>>>0,!i){var o=Math.pow(2,8*n-1);F(this,r,e,n,o-1,-o)}var a=n-1,u=1,c=0;for(this[e+a]=r&255;--a>=0&&(u*=256);)r<0&&c===0&&this[e+a+1]!==0&&(c=1),this[e+a]=(r/u>>0)-c&255;return e+n};s.prototype.writeInt8=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,1,127,-128),r<0&&(r=255+r+1),this[e]=r&255,e+1};s.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,2,32767,-32768),this[e]=r&255,this[e+1]=r>>>8,e+2};s.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,2,32767,-32768),this[e]=r>>>8,this[e+1]=r&255,e+2};s.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,4,2147483647,-2147483648),this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24,e+4};s.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e>>>0,n||F(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255,e+4};function te(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ne(t,r,e,n,i){return r=+r,e=e>>>0,i||te(t,r,e,4,34028234663852886e22,-34028234663852886e22),Z.write(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return ne(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return ne(this,r,e,!1,n)};function ie(t,r,e,n,i){return r=+r,e=e>>>0,i||te(t,r,e,8,17976931348623157e292,-17976931348623157e292),Z.write(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return ie(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return ie(this,r,e,!1,n)};s.prototype.copy=function(r,e,n,i){if(!s.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,n,i):Uint8Array.prototype.set.call(r,this.subarray(n,i),e),o};s.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(r.length===1){var o=r.charCodeAt(0);(i==="utf8"&&o<128||i==="latin1")&&(r=o)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var u=s.isBuffer(r)?r:s.from(r,i),c=u.length;if(c===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(a=0;a<n-e;++a)this[a+e]=u[a%c]}return this};var tt=/[^+/0-9A-Za-z-_]/g;function nt(t){if(t=t.split("=")[0],t=t.trim().replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Br(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function it(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function ot(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function oe(t){return Er.toByteArray(nt(t))}function yr(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function O(t,r){return t instanceof r||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===r.name}function Tr(t){return t!==t}var at=function(){for(var t="0123456789abcdef",r=new Array(256),e=0;e<16;++e)for(var n=e*16,i=0;i<16;++i)r[n+i]=t[e]+t[i];return r}()});var fe=pr((Wt,he)=>{h();var m=he.exports={},z,V;function Sr(){throw new Error("setTimeout has not been defined")}function Cr(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?z=setTimeout:z=Sr}catch{z=Sr}try{typeof clearTimeout=="function"?V=clearTimeout:V=Cr}catch{V=Cr}})();function se(t){if(z===setTimeout)return setTimeout(t,0);if((z===Sr||!z)&&setTimeout)return z=setTimeout,setTimeout(t,0);try{return z(t,0)}catch{try{return z.call(null,t,0)}catch{return z.call(this,t,0)}}}function st(t){if(V===clearTimeout)return clearTimeout(t);if((V===Cr||!V)&&clearTimeout)return V=clearTimeout,clearTimeout(t);try{return V(t)}catch{try{return V.call(null,t)}catch{return V.call(this,t)}}}var q=[],er=!1,G,wr=-1;function ut(){!er||!G||(er=!1,G.length?q=G.concat(q):wr=-1,q.length&&ue())}function ue(){if(!er){var t=se(ut);er=!0;for(var r=q.length;r;){for(G=q,q=[];++wr<r;)G&&G[wr].run();wr=-1,r=q.length}G=null,er=!1,st(t)}}m.nextTick=function(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];q.push(new ce(t,r)),q.length===1&&!er&&se(ue)};function ce(t,r){this.fun=t,this.array=r}ce.prototype.run=function(){this.fun.apply(null,this.array)};m.title="browser";m.browser=!0;m.env={};m.argv=[];m.version="";m.versions={};function J(){}m.on=J;m.addListener=J;m.once=J;m.off=J;m.removeListener=J;m.removeAllListeners=J;m.emit=J;m.prependListener=J;m.prependOnceListener=J;m.listeners=function(t){return[]};m.binding=function(t){throw new Error("process.binding is not supported")};m.cwd=function(){return"/"};m.chdir=function(t){throw new Error("process.chdir is not supported")};m.umask=function(){return 0}});var y,w,Gt,h=Ce(()=>{y=Jr(ae()),w=Jr(fe()),Gt=function(t){function r(){var n=this||self;return delete t.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return r();t.defineProperty(t.prototype,"__magic__",{configurable:!0,get:r});var e=__magic__;return e}(Object)});var $t={};Pr($t,{Convert:()=>A,MemoryStore:()=>$r,Multicodec:()=>L,isArrayBufferSlice:()=>Rr,isDefined:()=>yt,universalTypeOf:()=>xr});h();h();h();h();h();function ct(t,r){if(t.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<t.length;i++){var o=t.charAt(i),a=o.charCodeAt(0);if(e[a]!==255)throw new TypeError(o+" is ambiguous");e[a]=i}var u=t.length,c=t.charAt(0),l=Math.log(u)/Math.log(256),f=Math.log(256)/Math.log(u);function p(d){if(d instanceof Uint8Array||(ArrayBuffer.isView(d)?d=new Uint8Array(d.buffer,d.byteOffset,d.byteLength):Array.isArray(d)&&(d=Uint8Array.from(d))),!(d instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(d.length===0)return"";for(var v=0,H=0,I=0,D=d.length;I!==D&&d[I]===0;)I++,v++;for(var N=(D-I)*f+1>>>0,S=new Uint8Array(N);I!==D;){for(var R=d[I],K=0,M=N-1;(R!==0||K<H)&&M!==-1;M--,K++)R+=256*S[M]>>>0,S[M]=R%u>>>0,R=R/u>>>0;if(R!==0)throw new Error("Non-zero carry");H=K,I++}for(var $=N-H;$!==N&&S[$]===0;)$++;for(var hr=c.repeat(v);$<N;++$)hr+=t.charAt(S[$]);return hr}function E(d){if(typeof d!="string")throw new TypeError("Expected String");if(d.length===0)return new Uint8Array;var v=0;if(d[v]!==" "){for(var H=0,I=0;d[v]===c;)H++,v++;for(var D=(d.length-v)*l+1>>>0,N=new Uint8Array(D);d[v];){var S=e[d.charCodeAt(v)];if(S===255)return;for(var R=0,K=D-1;(S!==0||R<I)&&K!==-1;K--,R++)S+=u*N[K]>>>0,N[K]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");I=R,v++}if(d[v]!==" "){for(var M=D-I;M!==D&&N[M]===0;)M++;for(var $=new Uint8Array(H+(D-M)),hr=H;M!==D;)$[hr++]=N[M++];return $}}}function B(d){var v=E(d);if(v)return v;throw new Error(`Non-${r} character`)}return{encode:p,decodeUnsafe:E,decode:B}}var ht=ct,ft=ht,pe=ft;h();var rn=new Uint8Array(0);var le=(t,r)=>{if(t===r)return!0;if(t.byteLength!==r.byteLength)return!1;for(let e=0;e<t.byteLength;e++)if(t[e]!==r[e])return!1;return!0},tr=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};h();var Ir=class{constructor(r,e,n){this.name=r,this.prefix=e,this.baseEncode=n}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}},Mr=class{constructor(r,e,n){if(this.name=r,this.prefix=e,e.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=n}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return de(this,r)}},Lr=class{constructor(r){this.decoders=r}or(r){return de(this,r)}decode(r){let e=r[0],n=this.decoders[e];if(n)return n.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},de=(t,r)=>new Lr({...t.decoders||{[t.prefix]:t},...r.decoders||{[r.prefix]:r}}),Dr=class{constructor(r,e,n,i){this.name=r,this.prefix=e,this.baseEncode=n,this.baseDecode=i,this.encoder=new Ir(r,e,n),this.decoder=new Mr(r,e,i)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}},ye=({name:t,prefix:r,encode:e,decode:n})=>new Dr(t,r,e,n),Nr=({prefix:t,name:r,alphabet:e})=>{let{encode:n,decode:i}=pe(e,r);return ye({prefix:t,name:r,encode:n,decode:o=>tr(i(o))})},lt=(t,r,e,n)=>{let i={};for(let f=0;f<r.length;++f)i[r[f]]=f;let o=t.length;for(;t[o-1]==="=";)--o;let a=new Uint8Array(o*e/8|0),u=0,c=0,l=0;for(let f=0;f<o;++f){let p=i[t[f]];if(p===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<e|p,u+=e,u>=8&&(u-=8,a[l++]=255&c>>u)}if(u>=e||255&c<<8-u)throw new SyntaxError("Unexpected end of data");return a},dt=(t,r,e)=>{let n=r[r.length-1]==="=",i=(1<<e)-1,o="",a=0,u=0;for(let c=0;c<t.length;++c)for(u=u<<8|t[c],a+=8;a>e;)a-=e,o+=r[i&u>>a];if(a&&(o+=r[i&u<<e-a]),n)for(;o.length*e&7;)o+="=";return o},U=({name:t,prefix:r,bitsPerChar:e,alphabet:n})=>ye({prefix:r,name:t,encode(i){return dt(i,n,e)},decode(i){return lt(i,n,e,t)}});var T=Nr({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),hn=Nr({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});h();var dn=U({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),yn=U({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),_=U({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),wn=U({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});h();function Rr(t){return t.byteOffset!==0||t.byteLength!==t.buffer.byteLength}function yt(t){return t!==null&&typeof t<"u"}function xr(t){let e=Object.prototype.toString.call(t).match(/\s([a-zA-Z0-9]+)/),[n,i]=e;return i}var mr=new TextEncoder,ar=new TextDecoder,A=class{constructor(r,e){this.data=r,this.format=e}static arrayBuffer(r){return new A(r,"ArrayBuffer")}static base58Btc(r){return new A(r,"Base58Btc")}static base64Url(r){return new A(r,"Base64Url")}static bufferSource(r){return new A(r,"BufferSource")}static hex(r){if(typeof r!="string")throw new TypeError("Hex input must be a string.");if(r.length%2!==0)throw new TypeError("Hex input must have an even number of characters.");return new A(r,"Hex")}static multibase(r){return new A(r,"Multibase")}static object(r){return new A(r,"Object")}static string(r){return new A(r,"String")}static uint8Array(r){return new A(r,"Uint8Array")}toArrayBuffer(){switch(this.format){case"Base58Btc":return T.baseDecode(this.data).buffer;case"Base64Url":return _.baseDecode(this.data).buffer;case"BufferSource":{if(xr(this.data)==="ArrayBuffer")return this.data;if(ArrayBuffer.isView(this.data))return Rr(this.data)?this.data.buffer.slice(this.data.byteOffset,this.data.byteOffset+this.data.byteLength):this.data.buffer;throw new TypeError(`${this.format} value is not of type: ArrayBuffer, DataView, or TypedArray.`)}case"Hex":return A.hex(this.data).toUint8Array().buffer;case"String":return A.string(this.data).toUint8Array().buffer;case"Uint8Array":return this.data.buffer;default:throw new TypeError(`Conversion from ${this.format} to ArrayBuffer is not supported.`)}}toBase58Btc(){switch(this.format){case"ArrayBuffer":{let r=new Uint8Array(this.data);return T.baseEncode(r)}case"Multibase":return this.data.substring(1);case"Uint8Array":return T.baseEncode(this.data);default:throw new TypeError(`Conversion from ${this.format} to Base58Btc is not supported.`)}}toBase64Url(){switch(this.format){case"ArrayBuffer":{let r=new Uint8Array(this.data);return _.baseEncode(r)}case"Object":{let r=JSON.stringify(this.data),e=mr.encode(r);return _.baseEncode(e)}case"String":{let r=mr.encode(this.data);return _.baseEncode(r)}case"Uint8Array":return _.baseEncode(this.data);default:throw new TypeError(`Conversion from ${this.format} to Base64Url is not supported.`)}}toHex(){let r=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));switch(this.format){case"ArrayBuffer":{let e=new Uint8Array(this.data);return A.uint8Array(e).toHex()}case"Uint8Array":{let e="";for(let n=0;n<this.data.length;n++)e+=r[this.data[n]];return e}default:throw new TypeError(`Conversion from ${this.format} to Object is not supported.`)}}toMultibase(){switch(this.format){case"Base58Btc":return`z${this.data}`;default:throw new TypeError(`Conversion from ${this.format} to Multibase is not supported.`)}}toObject(){switch(this.format){case"Base64Url":{let r=_.baseDecode(this.data),e=ar.decode(r);return JSON.parse(e)}case"String":return JSON.parse(this.data);case"Uint8Array":{let r=ar.decode(this.data);return JSON.parse(r)}default:throw new TypeError(`Conversion from ${this.format} to Object is not supported.`)}}toString(){switch(this.format){case"ArrayBuffer":return ar.decode(this.data);case"Base64Url":{let r=_.baseDecode(this.data);return ar.decode(r)}case"Object":return JSON.stringify(this.data);case"Uint8Array":return ar.decode(this.data);default:throw new TypeError(`Conversion from ${this.format} to String is not supported.`)}}toUint8Array(){switch(this.format){case"ArrayBuffer":return new Uint8Array(this.data);case"Base58Btc":return T.baseDecode(this.data);case"Base64Url":return _.baseDecode(this.data);case"BufferSource":{let r=xr(this.data);if(r==="Uint8Array")return this.data;if(r==="ArrayBuffer")return new Uint8Array(this.data);if(ArrayBuffer.isView(this.data))return new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength);throw new TypeError(`${this.format} value is not of type: ArrayBuffer, DataView, or TypedArray.`)}case"Hex":{let r=new Uint8Array(this.data.length/2);for(let e=0;e<this.data.length;e+=2){let n=parseInt(this.data.substring(e,e+2),16);if(isNaN(n))throw new TypeError("Input is not a valid hexadecimal string.");r[e/2]=n}return r}case"Object":{let r=JSON.stringify(this.data);return mr.encode(r)}case"String":return mr.encode(this.data);default:throw new TypeError(`Conversion from ${this.format} to Uint8Array is not supported.`)}}};h();h();h();var j={};Pr(j,{decode:()=>nr,encodeTo:()=>Q,encodingLength:()=>Y});h();h();var wt=me,we=128,xt=127,mt=~xt,gt=Math.pow(2,31);function me(t,r,e){r=r||[],e=e||0;for(var n=e;t>=gt;)r[e++]=t&255|we,t/=128;for(;t&mt;)r[e++]=t&255|we,t>>>=7;return r[e]=t|0,me.bytes=e-n+1,r}var bt=kr,Et=128,xe=127;function kr(t,n){var e=0,n=n||0,i=0,o=n,a,u=t.length;do{if(o>=u)throw kr.bytes=0,new RangeError("Could not decode varint");a=t[o++],e+=i<28?(a&xe)<<i:(a&xe)*Math.pow(2,i),i+=7}while(a>=Et);return kr.bytes=o-n,e}var vt=Math.pow(2,7),At=Math.pow(2,14),Bt=Math.pow(2,21),Ut=Math.pow(2,28),Ft=Math.pow(2,35),Tt=Math.pow(2,42),St=Math.pow(2,49),Ct=Math.pow(2,56),It=Math.pow(2,63),Mt=function(t){return t<vt?1:t<At?2:t<Bt?3:t<Ut?4:t<Ft?5:t<Tt?6:t<St?7:t<Ct?8:t<It?9:10},Lt={encode:wt,decode:bt,encodingLength:Mt},Dt=Lt,sr=Dt;var nr=(t,r=0)=>[sr.decode(t,r),sr.decode.bytes],Q=(t,r,e=0)=>(sr.encode(t,r,e),r),Y=t=>sr.encodingLength(t);h();var Or=(t,r)=>{let e=r.byteLength,n=Y(t),i=n+Y(e),o=new Uint8Array(i+e);return Q(t,o,0),Q(e,o,n),o.set(r,i),new ir(t,e,r,o)},ge=t=>{let r=tr(t),[e,n]=nr(r),[i,o]=nr(r.subarray(n)),a=r.subarray(n+o);if(a.byteLength!==i)throw new Error("Incorrect length");return new ir(e,i,a,r)},be=(t,r)=>{if(t===r)return!0;{let e=r;return t.code===e.code&&t.size===e.size&&e.bytes instanceof Uint8Array&&le(t.bytes,e.bytes)}},ir=class{constructor(r,e,n,i){this.code=r,this.size=e,this.digest=n,this.bytes=i}};h();var ur=U({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Dn=U({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Nn=U({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Rn=U({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),kn=U({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),On=U({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),zn=U({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Vn=U({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),$n=U({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});h();var Ee=(t,r)=>{let{bytes:e,version:n}=t;switch(n){case 0:return Rt(e,Vr(t),r||T.encoder);default:return kt(e,Vr(t),r||ur.encoder)}};var ve=new WeakMap,Vr=t=>{let r=ve.get(t);if(r==null){let e=new Map;return ve.set(t,e),e}return r},g=class{constructor(r,e,n,i){this.code=e,this.version=r,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:r,multihash:e}=this;if(r!==cr)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==Ot)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return g.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:r,digest:e}=this.multihash,n=Or(r,e);return g.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(r){return g.equals(this,r)}static equals(r,e){let n=e;return n&&r.code===n.code&&r.version===n.version&&be(r.multihash,n.multihash)}toString(r){return Ee(this,r)}toJSON(){return{"/":Ee(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(r){if(r==null)return null;let e=r;if(e instanceof g)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){let{version:n,code:i,multihash:o,bytes:a}=e;return new g(n,i,o,a||Ae(n,i,o.bytes))}else if(e[zt]===!0){let{version:n,multihash:i,code:o}=e,a=ge(i);return g.create(n,o,a)}else return null}static create(r,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(r){case 0:{if(e!==cr)throw new Error(`Version 0 CID must use dag-pb (code: ${cr}) block encoding`);return new g(r,e,n,n.bytes)}case 1:{let i=Ae(r,e,n.bytes);return new g(r,e,n,i)}default:throw new Error("Invalid version")}}static createV0(r){return g.create(0,cr,r)}static createV1(r,e){return g.create(1,r,e)}static decode(r){let[e,n]=g.decodeFirst(r);if(n.length)throw new Error("Incorrect length");return e}static decodeFirst(r){let e=g.inspectBytes(r),n=e.size-e.multihashSize,i=tr(r.subarray(n,n+e.multihashSize));if(i.byteLength!==e.multihashSize)throw new Error("Incorrect length");let o=i.subarray(e.multihashSize-e.digestSize),a=new ir(e.multihashCode,e.digestSize,o,i);return[e.version===0?g.createV0(a):g.createV1(e.codec,a),r.subarray(e.size)]}static inspectBytes(r){let e=0,n=()=>{let[p,E]=nr(r.subarray(e));return e+=E,p},i=n(),o=cr;if(i===18?(i=0,e=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let a=e,u=n(),c=n(),l=e+c,f=l-a;return{version:i,codec:o,multihashCode:u,digestSize:c,multihashSize:f,size:l}}static parse(r,e){let[n,i]=Nt(r,e),o=g.decode(i);if(o.version===0&&r[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Vr(o).set(n,r),o}},Nt=(t,r)=>{switch(t[0]){case"Q":{let e=r||T;return[T.prefix,e.decode(`${T.prefix}${t}`)]}case T.prefix:{let e=r||T;return[T.prefix,e.decode(t)]}case ur.prefix:{let e=r||ur;return[ur.prefix,e.decode(t)]}default:{if(r==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],r.decode(t)]}}},Rt=(t,r,e)=>{let{prefix:n}=e;if(n!==T.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let i=r.get(n);if(i==null){let o=e.encode(t).slice(1);return r.set(n,o),o}else return i},kt=(t,r,e)=>{let{prefix:n}=e,i=r.get(n);if(i==null){let o=e.encode(t);return r.set(n,o),o}else return i},cr=112,Ot=18,Ae=(t,r,e)=>{let n=Y(t),i=n+Y(r),o=new Uint8Array(i+e.byteLength);return Q(t,o,0),Q(r,o,n),o.set(e,i),o},zt=Symbol.for("@ipld/js-cid/CID");h();h();var or=class{static addPrefix(r){let{code:e,data:n,name:i}=r;if(!(i?!e:e))throw new Error("Exactly one of 'name' or 'code' must be defined.");if(e=or.codeToName.has(e)?e:or.nameToCode.get(i),e===void 0)throw new Error(`Multicodec not found: ${i??e}`);let o=j.encodingLength(e),a=new Uint8Array(o+n.byteLength);return a.set(n,o),j.encodeTo(e,a),a}static getCodeFromData(r){let{prefixedData:e}=r,[n,i]=j.decode(e);return n}static registerCodec(r){or.codeToName.set(r.code,r.name),or.nameToCode.set(r.name,r.code)}static removePrefix(r){let{prefixedData:e}=r,[n,i]=j.decode(e);return e.slice(i)}},L=or;L.codeToName=new Map,L.nameToCode=new Map;L.registerCodec({code:237,name:"ed25519-pub"});L.registerCodec({code:4864,name:"ed25519-priv"});L.registerCodec({code:236,name:"x25519-pub"});L.registerCodec({code:4866,name:"x25519-priv"});L.registerCodec({code:231,name:"secp256k1-pub"});L.registerCodec({code:4865,name:"secp256k1-priv"});h();var $r=class{#r=new Map;async clear(){this.#r.clear()}async close(){throw new Error("MemoryStore does not support the close() method.")}async delete(r){return this.#r.delete(r)}async get(r){return this.#r.get(r)}async has(r){return this.#r.has(r)}async list(){return Array.from(this.#r.values())}async set(r,e){this.#r.set(r,e)}};return Ie($t);})(); | ||
/*! Bundled license information: | ||
ieee754/index.js: | ||
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *) | ||
buffer/index.js: | ||
(*! | ||
* The buffer module from node.js, for the browser. | ||
* | ||
* @author Feross Aboukhadijeh <https://feross.org> | ||
* @license MIT | ||
*) | ||
*/ | ||
//# sourceMappingURL=browser.js.map |
@@ -1,2 +0,6 @@ | ||
export * from './types.js'; | ||
export type * from './types.js'; | ||
export * from './convert.js'; | ||
export * from './multicodec.js'; | ||
export * from './stores.js'; | ||
export * from './type-utils.js'; | ||
//# sourceMappingURL=main.d.ts.map |
/** | ||
* simple interface for a Key/Value store. Can be implemented to override default implementations wherever | ||
* they're used | ||
* TODO: add references to concrete implementations in other packages | ||
* Interface for a generic key-value store. | ||
*/ | ||
export interface KeyValueStore<K, V> { | ||
get(key: K): Promise<V>; | ||
set(key: K, value: V): Promise<void>; | ||
delete(key: K): Promise<void>; | ||
/** | ||
* Clears the store, removing all key-value pairs. | ||
* | ||
* @returns A promise that resolves when the store has been cleared. | ||
*/ | ||
clear(): Promise<void>; | ||
/** | ||
* Closes the store, freeing up any resources used. After calling this method, no other operations can be performed on the store. | ||
* | ||
* @returns A promise that resolves when the store has been closed. | ||
*/ | ||
close(): Promise<void>; | ||
/** | ||
* Deletes a key-value pair from the store. | ||
* | ||
* @param key - The key of the value to delete. | ||
* @returns A promise that resolves to true if the element existed and has been removed, or false if the element does not exist. | ||
*/ | ||
delete(key: K): Promise<boolean | void>; | ||
/** | ||
* Fetches a value from the store given its key. | ||
* | ||
* @param key - The key of the value to retrieve. | ||
* @returns A promise that resolves with the value associated with the key, or `undefined` if no value exists for that key. | ||
*/ | ||
get(key: K): Promise<V | undefined>; | ||
/** | ||
* Sets the value for a key in the store. | ||
* | ||
* @param key - The key under which to store the value. | ||
* @param value - The value to be stored. | ||
* @returns A promise that resolves when the value has been set. | ||
*/ | ||
set(key: K, value: V): Promise<void>; | ||
} | ||
/** | ||
* Represents an object type where a subset of keys are required and everything else is optional. | ||
*/ | ||
export type RequireOnly<T, K extends keyof T, O extends keyof T = never> = Required<Pick<T, K>> & Omit<Partial<T>, O>; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "@tbd54566975/common", | ||
"version": "0.1.0", | ||
"version": "0.1.1-alpha-20230713-d1dda95", | ||
"type": "module", | ||
@@ -63,2 +63,7 @@ "main": "./dist/cjs/main.cjs", | ||
}, | ||
"react-native": { | ||
"./dist/esm/main.mjs": "./dist/esm/main.mjs", | ||
"./dist/cjs/main.cjs": "./dist/esm/main.mjs", | ||
"types": "./dist/types/main.d.ts" | ||
}, | ||
"keywords": [ | ||
@@ -79,3 +84,5 @@ "decentralized", | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"multiformats": "11.0.2" | ||
}, | ||
"devDependencies": { | ||
@@ -87,5 +94,5 @@ "@types/chai": "4.3.0", | ||
"@typescript-eslint/parser": "5.59.0", | ||
"c8": "7.14.0", | ||
"c8": "8.0.0", | ||
"chai": "4.3.7", | ||
"esbuild": "0.16.7", | ||
"esbuild": "0.16.17", | ||
"eslint": "8.39.0", | ||
@@ -106,6 +113,3 @@ "eslint-plugin-mocha": "10.1.0", | ||
"typescript": "5.0.4" | ||
}, | ||
"overrides": { | ||
"socket.io-parser@>4.0.4 <4.2.3": "4.2.3" | ||
} | ||
} | ||
} |
@@ -1,1 +0,6 @@ | ||
export * from './types.js'; | ||
export type * from './types.js'; | ||
export * from './convert.js'; | ||
export * from './multicodec.js'; | ||
export * from './stores.js'; | ||
export * from './type-utils.js'; |
/** | ||
* simple interface for a Key/Value store. Can be implemented to override default implementations wherever | ||
* they're used | ||
* TODO: add references to concrete implementations in other packages | ||
* Interface for a generic key-value store. | ||
*/ | ||
export interface KeyValueStore<K, V> { | ||
get(key: K): Promise<V>; | ||
set(key: K, value: V): Promise<void>; | ||
delete(key: K): Promise<void>; | ||
/** | ||
* Clears the store, removing all key-value pairs. | ||
* | ||
* @returns A promise that resolves when the store has been cleared. | ||
*/ | ||
clear(): Promise<void>; | ||
/** | ||
* Closes the store, freeing up any resources used. After calling this method, no other operations can be performed on the store. | ||
* | ||
* @returns A promise that resolves when the store has been closed. | ||
*/ | ||
close(): Promise<void>; | ||
} | ||
/** | ||
* Deletes a key-value pair from the store. | ||
* | ||
* @param key - The key of the value to delete. | ||
* @returns A promise that resolves to true if the element existed and has been removed, or false if the element does not exist. | ||
*/ | ||
delete(key: K): Promise<boolean | void>; | ||
/** | ||
* Fetches a value from the store given its key. | ||
* | ||
* @param key - The key of the value to retrieve. | ||
* @returns A promise that resolves with the value associated with the key, or `undefined` if no value exists for that key. | ||
*/ | ||
get(key: K): Promise<V | undefined>; | ||
/** | ||
* Sets the value for a key in the store. | ||
* | ||
* @param key - The key under which to store the value. | ||
* @param value - The value to be stored. | ||
* @returns A promise that resolves when the value has been set. | ||
*/ | ||
set(key: K, value: V): Promise<void>; | ||
} | ||
/** | ||
* Represents an object type where a subset of keys are required and everything else is optional. | ||
*/ | ||
export type RequireOnly<T, K extends keyof T, O extends keyof T = never> = Required<Pick<T, K>> & Omit<Partial<T>, O>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
725443
30
3684
1
1
+ Addedmultiformats@11.0.2
+ Addedmultiformats@11.0.2(transitive)