@dodoex/wallet-web3 0.0.3-1 → 0.0.3-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_commonjsHelpers-70de2c37.js +1 -0
- package/dist/bn-16003306.js +1 -0
- package/dist/cjs/_commonjsHelpers-66ecbaf8.cjs +1 -0
- package/dist/cjs/bn-1bd77809.cjs +1 -0
- package/dist/cjs/core/index.d.ts +1 -0
- package/dist/cjs/elliptic-174586a6.cjs +1 -0
- package/dist/cjs/hash-121fdd2c.cjs +1 -0
- package/dist/cjs/index-0494ffbc.cjs +1 -0
- package/dist/cjs/index-1613ac94.cjs +22 -0
- package/dist/cjs/index-33e57d81.cjs +1 -0
- package/dist/cjs/index-5976e357.cjs +1 -0
- package/dist/cjs/index-613571b4.cjs +3 -0
- package/dist/cjs/index-6d7369f7.cjs +1 -0
- package/dist/cjs/index-b63f2913.cjs +19 -0
- package/dist/cjs/index-f7522058.cjs +1 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/inherits-6d52d55b.cjs +1 -0
- package/dist/cjs/interface-6a2093d7.cjs +1 -0
- package/dist/cjs/node-ponyfill-c08c51bf.cjs +1 -0
- package/dist/cjs/portis-09fea9b2.cjs +1 -0
- package/dist/cjs/provider-653a6c4b.cjs +1 -0
- package/dist/cjs/providers/connector/safeGnosis/adapter.d.ts +1 -6
- package/dist/cjs/sha256-21fccd26.cjs +1 -0
- package/dist/cjs/sha3-499f6bea.cjs +10 -0
- package/dist/cjs/uAuth-e46c0332.cjs +1 -0
- package/dist/cjs/walletConnect-a74c7523.cjs +1 -0
- package/dist/cjs/walletLink-5a993e87.cjs +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/elliptic-1100204f.js +1 -0
- package/dist/hash-4b8ad136.js +1 -0
- package/dist/index-201c01d8.js +22 -0
- package/dist/index-5c16deff.js +1 -0
- package/dist/index-632fbf92.js +1 -0
- package/dist/index-9547c0cf.js +1 -0
- package/dist/index-b6a46a6d.js +1 -0
- package/dist/index-b869aac9.js +19 -0
- package/dist/index-cecc22f4.js +2 -0
- package/dist/index-e3ab6de5.js +1 -0
- package/dist/index.js +1 -1
- package/dist/inherits-e2363129.js +1 -0
- package/dist/interface-36a3c8cf.js +1 -0
- package/dist/node-ponyfill-bda9b4f4.js +1 -0
- package/dist/portis-3b5726bc.js +1 -0
- package/dist/provider-847fb9d1.js +1 -0
- package/dist/providers/connector/safeGnosis/adapter.d.ts +1 -6
- package/dist/sha256-8f7b3565.js +1 -0
- package/dist/sha3-a5661517.js +9 -0
- package/dist/uAuth-458fbce7.js +1 -0
- package/dist/walletConnect-643e147f.js +1 -0
- package/dist/walletLink-fd84e70b.js +1 -0
- package/package.json +8 -8
- package/dist/cjs/index-1d035f96.cjs +0 -1
- package/dist/cjs/index-20589cad.cjs +0 -1
- package/dist/cjs/index-3c0f322c.cjs +0 -1
- package/dist/cjs/index-57e7ce01.cjs +0 -1
- package/dist/cjs/index-5f524b54.cjs +0 -1
- package/dist/cjs/index-809d42db.cjs +0 -1
- package/dist/cjs/index-9726ade3.cjs +0 -1
- package/dist/cjs/index-a53895dd.cjs +0 -1
- package/dist/cjs/index-b3bae54d.cjs +0 -1
- package/dist/cjs/index-b787ad60.cjs +0 -1
- package/dist/cjs/index-bd507185.cjs +0 -1
- package/dist/cjs/index-e43297ee.cjs +0 -1
- package/dist/cjs/portis-0d0ed336.cjs +0 -1
- package/dist/cjs/portis-139a9e4d.cjs +0 -1
- package/dist/cjs/portis-19c00eba.cjs +0 -1
- package/dist/cjs/portis-2053ea4b.cjs +0 -1
- package/dist/cjs/provider-216c4ecc.cjs +0 -1
- package/dist/cjs/provider-664da1b0.cjs +0 -1
- package/dist/cjs/provider-9bce34ab.cjs +0 -1
- package/dist/cjs/provider-a9b8a548.cjs +0 -1
- package/dist/cjs/uAuth-218d5a4e.cjs +0 -1
- package/dist/cjs/uAuth-384147c3.cjs +0 -1
- package/dist/cjs/uAuth-5d059de5.cjs +0 -1
- package/dist/cjs/uAuth-b52b01e0.cjs +0 -1
- package/dist/cjs/walletConnect-02bcbc5c.cjs +0 -1
- package/dist/cjs/walletConnect-712b3724.cjs +0 -1
- package/dist/cjs/walletConnect-9a4bbbc8.cjs +0 -1
- package/dist/cjs/walletConnect-b6ac4960.cjs +0 -1
- package/dist/cjs/walletLink-2cd8be6e.cjs +0 -1
- package/dist/cjs/walletLink-349e1bf5.cjs +0 -1
- package/dist/cjs/walletLink-92f211ff.cjs +0 -1
- package/dist/cjs/walletLink-f4cbd510.cjs +0 -1
- package/dist/index-4025ab08.js +0 -1
- package/dist/index-5ced3e7a.js +0 -1
- package/dist/index-677159b8.js +0 -1
- package/dist/index-6b9ad9a8.js +0 -1
- package/dist/index-6f08dc42.js +0 -1
- package/dist/index-829e82f9.js +0 -1
- package/dist/index-853b673b.js +0 -1
- package/dist/index-8dfaf647.js +0 -1
- package/dist/index-be16dd4e.js +0 -1
- package/dist/index-be47cca9.js +0 -1
- package/dist/index-c7eb0cf4.js +0 -1
- package/dist/index-fa3d2d50.js +0 -1
- package/dist/portis-32658178.js +0 -1
- package/dist/portis-5cb50e65.js +0 -1
- package/dist/portis-db858db8.js +0 -1
- package/dist/portis-fbb3c228.js +0 -1
- package/dist/provider-3fe99d2c.js +0 -1
- package/dist/provider-9ab2eb6e.js +0 -1
- package/dist/provider-e2314677.js +0 -1
- package/dist/provider-f7f5cb2b.js +0 -1
- package/dist/uAuth-64c3dda3.js +0 -1
- package/dist/uAuth-9f7c98e7.js +0 -1
- package/dist/uAuth-ddaae2b5.js +0 -1
- package/dist/uAuth-e4b5c839.js +0 -1
- package/dist/walletConnect-1a1a1062.js +0 -1
- package/dist/walletConnect-2b8f3354.js +0 -1
- package/dist/walletConnect-4c410280.js +0 -1
- package/dist/walletConnect-fb4a3e3c.js +0 -1
- package/dist/walletLink-5b9fdf98.js +0 -1
- package/dist/walletLink-98193680.js +0 -1
- package/dist/walletLink-986484a1.js +0 -1
- package/dist/walletLink-cf8da449.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r=function(r){if("string"!=typeof r)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof r+", while checking isHexPrefixed.");return"0x"===r.slice(0,2)},t=r,e=function(r){return"string"!=typeof r?r:t(r)?r.slice(2):r};function n(r){var t=r;if("string"!=typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof t+", while padToEven.");return t.length%2&&(t="0"+t),t}function i(r){return"0x"+r.toString(16)}var o,f,u,a,c,s={arrayContainsArray:function(r,t,e){if(!0!==Array.isArray(r))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof r+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof t+"'");return t[Boolean(e)?"some":"every"]((function(t){return r.indexOf(t)>=0}))},intToBuffer:function(r){var t=i(r);return new Buffer(n(t.slice(2)),"hex")},getBinarySize:function(r){if("string"!=typeof r)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof r+"'.");return Buffer.byteLength(r,"utf8")},isHexPrefixed:r,stripHexPrefix:e,padToEven:n,intToHex:i,fromAscii:function(r){for(var t="",e=0;e<r.length;e++){var n=r.charCodeAt(e).toString(16);t+=n.length<2?"0"+n:n}return"0x"+t},fromUtf8:function(r){return"0x"+n(new Buffer(r,"utf8").toString("hex")).replace(/^0+|0+$/g,"")},toAscii:function(r){var t="",e=0,n=r.length;for("0x"===r.substring(0,2)&&(e=2);e<n;e+=2){var i=parseInt(r.substr(e,2),16);t+=String.fromCharCode(i)}return t},toUtf8:function(r){return new Buffer(n(e(r).replace(/^0+|0+$/g,"")),"hex").toString("utf8")},getKeys:function(r,t,e){if(!Array.isArray(r))throw new Error("[ethjs-util] method getKeys expecting type Array as 'params' input, got '"+typeof r+"'");if("string"!=typeof t)throw new Error("[ethjs-util] method getKeys expecting type String for input 'key' got '"+typeof t+"'.");for(var n=[],i=0;i<r.length;i++){var o=r[i][t];if(e&&!o)o="";else if("string"!=typeof o)throw new Error("invalid abi");n.push(o)}return n},isHexString:function(r,t){return!("string"!=typeof r||!r.match(/^0x[0-9A-Fa-f]*$/))&&(!t||r.length===2+2*t)}},y={};function p(){if(f)return o;var r,t;f=1;var e,n={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function i(t){throw{name:"SyntaxError",message:t,at:r,text:e}}function u(n){return n&&n!==t&&i("Expected '"+n+"' instead of '"+t+"'"),t=e.charAt(r),r+=1,t}function a(){var r,e="";for("-"===t&&(e="-",u("-"));t>="0"&&t<="9";)e+=t,u();if("."===t)for(e+=".";u()&&t>="0"&&t<="9";)e+=t;if("e"===t||"E"===t)for(e+=t,u(),"-"!==t&&"+"!==t||(e+=t,u());t>="0"&&t<="9";)e+=t,u();return r=Number(e),isFinite(r)||i("Bad number"),r}function c(){var r,e,o,f="";if('"'===t)for(;u();){if('"'===t)return u(),f;if("\\"===t)if(u(),"u"===t){for(o=0,e=0;e<4&&(r=parseInt(u(),16),isFinite(r));e+=1)o=16*o+r;f+=String.fromCharCode(o)}else{if("string"!=typeof n[t])break;f+=n[t]}else f+=t}i("Bad string")}function s(){for(;t&&t<=" ";)u()}function y(){switch(s(),t){case"{":return function(){var r,e={};if("{"===t){if(u("{"),s(),"}"===t)return u("}"),e;for(;t;){if(r=c(),s(),u(":"),Object.prototype.hasOwnProperty.call(e,r)&&i('Duplicate key "'+r+'"'),e[r]=y(),s(),"}"===t)return u("}"),e;u(","),s()}}i("Bad object")}();case"[":return function(){var r=[];if("["===t){if(u("["),s(),"]"===t)return u("]"),r;for(;t;){if(r.push(y()),s(),"]"===t)return u("]"),r;u(","),s()}}i("Bad array")}();case'"':return c();case"-":return a();default:return t>="0"&&t<="9"?a():function(){switch(t){case"t":return u("t"),u("r"),u("u"),u("e"),!0;case"f":return u("f"),u("a"),u("l"),u("s"),u("e"),!1;case"n":return u("n"),u("u"),u("l"),u("l"),null;default:i("Unexpected '"+t+"'")}}()}}return o=function(n,o){var f;return e=n,r=0,t=" ",f=y(),s(),t&&i("Syntax error"),"function"==typeof o?function r(t,e){var n,i,f=t[e];if(f&&"object"==typeof f)for(n in y)Object.prototype.hasOwnProperty.call(f,n)&&(void 0===(i=r(f,n))?delete f[n]:f[n]=i);return o.call(t,e,f)}({"":f},""):f}}function l(){if(a)return u;a=1;var r,t,e,n=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,i={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function o(r){return n.lastIndex=0,n.test(r)?'"'+r.replace(n,(function(r){var t=i[r];return"string"==typeof t?t:"\\u"+("0000"+r.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+r+'"'}function f(n,i){var u,a,c,s,y,p=r,l=i[n];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(n)),"function"==typeof e&&(l=e.call(i,n,l)),typeof l){case"string":return o(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(r+=t,y=[],"[object Array]"===Object.prototype.toString.apply(l)){for(s=l.length,u=0;u<s;u+=1)y[u]=f(u,l)||"null";return c=0===y.length?"[]":r?"[\n"+r+y.join(",\n"+r)+"\n"+p+"]":"["+y.join(",")+"]",r=p,c}if(e&&"object"==typeof e)for(s=e.length,u=0;u<s;u+=1)"string"==typeof(a=e[u])&&(c=f(a,l))&&y.push(o(a)+(r?": ":":")+c);else for(a in l)Object.prototype.hasOwnProperty.call(l,a)&&(c=f(a,l))&&y.push(o(a)+(r?": ":":")+c);return c=0===y.length?"{}":r?"{\n"+r+y.join(",\n"+r)+"\n"+p+"}":"{"+y.join(",")+"}",r=p,c}}return u=function(n,i,o){var u;if(r="",t="","number"==typeof o)for(u=0;u<o;u+=1)t+=" ";else"string"==typeof o&&(t=o);if(e=i,i&&"function"!=typeof i&&("object"!=typeof i||"number"!=typeof i.length))throw new Error("JSON.stringify");return f("",{"":n})}}var g="undefined"!=typeof JSON?JSON:(c||(c=1,y.parse=p(),y.stringify=l()),y),h=Array.isArray||function(r){return"[object Array]"==={}.toString.call(r)},v=Object.keys||function(r){var t=Object.prototype.hasOwnProperty||function(){return!0},e=[];for(var n in r)t.call(r,n)&&e.push(n);return e},b=function(r,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var e=t.space||"";"number"==typeof e&&(e=Array(e+1).join(" "));var n,i="boolean"==typeof t.cycles&&t.cycles,o=t.replacer||function(r,t){return t},f=t.cmp&&(n=t.cmp,function(r){return function(t,e){var i={key:t,value:r[t]},o={key:e,value:r[e]};return n(i,o)}}),u=[];return function r(t,n,a,c){var s=e?"\n"+new Array(c+1).join(e):"",y=e?": ":":";if(a&&a.toJSON&&"function"==typeof a.toJSON&&(a=a.toJSON()),void 0!==(a=o.call(t,n,a))){if("object"!=typeof a||null===a)return g.stringify(a);if(h(a)){for(var p=[],l=0;l<a.length;l++){var b=r(a,l,a[l],c+1)||g.stringify(null);p.push(s+e+b)}return"["+p.join(",")+s+"]"}if(-1!==u.indexOf(a)){if(i)return g.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}u.push(a);var d=v(a).sort(f&&f(a));for(p=[],l=0;l<d.length;l++){var w=r(a,n=d[l],a[n],c+1);if(w){var x=g.stringify(n)+y+w;p.push(s+e+x)}}return u.splice(u.indexOf(a),1),"{"+p.join(",")+s+"}"}}({"":r},"",r,0)};export{b as j,s as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e,c as t}from"./_commonjsHelpers-70de2c37.js";import r from"tty";import n from"util";import s from"os";var o={},i={};class a extends TypeError{constructor(e,t){let r;const{message:n,explanation:s,...o}=e,{path:i}=e,a=0===i.length?n:`At path: ${i.join(".")} -- ${n}`;super(s??a),null!=s&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function c(e){return"object"==typeof e&&null!=e}function u(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function p(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:s,branch:o}=t,{type:i}=r,{refinement:a,message:c=`Expected a value of type \`${i}\`${a?` with refinement \`${a}\``:""}, but received: \`${l(n)}\``}=e;return{value:n,type:i,refinement:a,key:s[s.length-1],path:s,branch:o,...e,message:c}}function*h(e,t,r,n){var s;c(s=e)&&"function"==typeof s[Symbol.iterator]||(e=[e]);for(const s of e){const e=p(s,t,r,n);e&&(yield e)}}function*f(e,t,r={}){const{path:n=[],branch:s=[e],coerce:o=!1,mask:i=!1}=r,a={path:n,branch:s};if(o&&(e=t.coercer(e,a),i&&"type"!==t.type&&c(t.schema)&&c(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let u="valid";for(const n of t.validator(e,a))n.explanation=r.message,u="not_valid",yield[n,void 0];for(let[l,p,h]of t.entries(e,a)){const t=f(p,h,{path:void 0===l?n:[...n,l],branch:void 0===l?s:[...s,p],coerce:o,mask:i,message:r.message});for(const r of t)r[0]?(u=null!=r[0].refinement?"not_refined":"not_valid",yield[r[0],void 0]):o&&(p=r[1],void 0===l?e=p:e instanceof Map?e.set(l,p):e instanceof Set?e.add(p):c(e)&&(void 0!==p||l in e)&&(e[l]=p))}if("not_valid"!==u)for(const n of t.refiner(e,a))n.explanation=r.message,u="not_refined",yield[n,void 0];"valid"===u&&(yield[void 0,e])}class d{constructor(e){const{type:t,schema:r,validator:n,refiner:s,coercer:o=(e=>e),entries:i=function*(){}}=e;this.type=t,this.schema=r,this.entries=i,this.coercer=o,this.validator=n?(e,t)=>h(n(e,t),t,this,e):()=>[],this.refiner=s?(e,t)=>h(s(e,t),t,this,e):()=>[]}assert(e,t){return m(e,this,t)}create(e,t){return g(e,this,t)}is(e){return E(e,this)}mask(e,t){return v(e,this,t)}validate(e,t={}){return y(e,this,t)}}function m(e,t,r){const n=y(e,t,{message:r});if(n[0])throw n[0]}function g(e,t,r){const n=y(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function v(e,t,r){const n=y(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function E(e,t){return!y(e,t)[0]}function y(e,t,r={}){const n=f(e,t,r),s=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);if(s[0]){const e=new a(s[0],(function*(){for(const e of n)e[0]&&(yield e[0])}));return[e,void 0]}return[void 0,s[1]]}function S(e,t){return new d({type:e,schema:null,validator:t})}function R(){return S("never",(()=>!1))}function b(e){const t=e?Object.keys(e):[],r=R();return new d({type:"object",schema:e||null,*entries(n){if(e&&c(n)){const s=new Set(Object.keys(n));for(const r of t)s.delete(r),yield[r,n[r],e[r]];for(const e of s)yield[e,n[e],r]}},validator:e=>c(e)||`Expected an object, but received: ${l(e)}`,coercer:e=>c(e)?{...e}:e})}function I(e){return new d({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function $(){return S("string",(e=>"string"==typeof e||`Expected a string, but received: ${l(e)}`))}function w(e){const t=Object.keys(e);return new d({type:"type",schema:e,*entries(r){if(c(r))for(const n of t)yield[n,r[n],e[n]]},validator:e=>c(e)||`Expected an object, but received: ${l(e)}`,coercer:e=>c(e)?{...e}:e})}function O(){return S("unknown",(()=>!0))}function C(e,t,r){return new d({...e,coercer:(n,s)=>E(n,t)?e.coercer(r(n,s),s):e.coercer(n,s)})}function N(e){return e instanceof Map||e instanceof Set?e.size:e.length}function A(e,t,r){return new d({...e,*refiner(n,s){yield*e.refiner(n,s);const o=h(r(n,s),s,e,n);for(const e of o)yield{...e,refinement:t}}})}var x=Object.freeze({__proto__:null,Struct:d,StructError:a,any:function(){return S("any",(()=>!0))},array:function(e){return new d({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${l(e)}`})},assert:m,assign:function(...e){const t="type"===e[0].type,r=e.map((e=>e.schema)),n=Object.assign({},...r);return t?w(n):b(n)},bigint:function(){return S("bigint",(e=>"bigint"==typeof e))},boolean:function(){return S("boolean",(e=>"boolean"==typeof e))},coerce:C,create:g,date:function(){return S("date",(e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${l(e)}`))},defaulted:function(e,t,r={}){return C(e,O(),(e=>{const n="function"==typeof t?t():t;if(void 0===e)return n;if(!r.strict&&u(e)&&u(n)){const t={...e};let r=!1;for(const e in n)void 0===t[e]&&(t[e]=n[e],r=!0);if(r)return t}return e}))},define:S,deprecated:function(e,t){return new d({...e,refiner:(t,r)=>void 0===t||e.refiner(t,r),validator:(r,n)=>void 0===r||(t(r,n),e.validator(r,n))})},dynamic:function(e){return new d({type:"dynamic",schema:null,*entries(t,r){const n=e(t,r);yield*n.entries(t,r)},validator:(t,r)=>e(t,r).validator(t,r),coercer:(t,r)=>e(t,r).coercer(t,r),refiner:(t,r)=>e(t,r).refiner(t,r)})},empty:function(e){return A(e,"empty",(t=>{const r=N(t);return 0===r||`Expected an empty ${e.type} but received one with a size of \`${r}\``}))},enums:function(e){const t={},r=e.map((e=>l(e))).join();for(const r of e)t[r]=r;return new d({type:"enums",schema:t,validator:t=>e.includes(t)||`Expected one of \`${r}\`, but received: ${l(t)}`})},func:function(){return S("func",(e=>"function"==typeof e||`Expected a function, but received: ${l(e)}`))},instance:function(e){return S("instance",(t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${l(t)}`))},integer:function(){return S("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${l(e)}`))},intersection:function(e){return new d({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})},is:E,lazy:function(e){let t;return new d({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator:(r,n)=>(t??(t=e()),t.validator(r,n)),coercer:(r,n)=>(t??(t=e()),t.coercer(r,n)),refiner:(r,n)=>(t??(t=e()),t.refiner(r,n))})},literal:function(e){const t=l(e),r=typeof e;return new d({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||`Expected the literal \`${t}\`, but received: ${l(r)}`})},map:function(e,t){return new d({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,s]of r.entries())yield[n,n,e],yield[n,s,t]},coercer:e=>e instanceof Map?new Map(e):e,validator:e=>e instanceof Map||`Expected a \`Map\` object, but received: ${l(e)}`})},mask:v,max:function(e,t,r={}){const{exclusive:n}=r;return A(e,"max",(r=>n?r<t:r<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${r}\``))},min:function(e,t,r={}){const{exclusive:n}=r;return A(e,"min",(r=>n?r>t:r>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${r}\``))},never:R,nonempty:function(e){return A(e,"nonempty",(t=>N(t)>0||`Expected a nonempty ${e.type} but received an empty one`))},nullable:function(e){return new d({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})},number:function(){return S("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${l(e)}`))},object:b,omit:function(e,t){const{schema:r}=e,n={...r};for(const e of t)delete n[e];return"type"===e.type?w(n):b(n)},optional:I,partial:function(e){const t=e instanceof d?{...e.schema}:{...e};for(const e in t)t[e]=I(t[e]);return b(t)},pattern:function(e,t){return A(e,"pattern",(r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`))},pick:function(e,t){const{schema:r}=e,n={};for(const e of t)n[e]=r[e];return b(n)},record:function(e,t){return new d({type:"record",schema:null,*entries(r){if(c(r))for(const n in r){const s=r[n];yield[n,n,e],yield[n,s,t]}},validator:e=>c(e)||`Expected an object, but received: ${l(e)}`})},refine:A,regexp:function(){return S("regexp",(e=>e instanceof RegExp))},set:function(e){return new d({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer:e=>e instanceof Set?new Set(e):e,validator:e=>e instanceof Set||`Expected a \`Set\` object, but received: ${l(e)}`})},size:function(e,t,r=t){const n=`Expected a ${e.type}`,s=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return A(e,"size",(e=>{if("number"==typeof e||e instanceof Date)return t<=e&&e<=r||`${n} ${s} but received \`${e}\``;if(e instanceof Map||e instanceof Set){const{size:o}=e;return t<=o&&o<=r||`${n} with a size ${s} but received one with a size of \`${o}\``}{const{length:o}=e;return t<=o&&o<=r||`${n} with a length ${s} but received one with a length of \`${o}\``}}))},string:$,struct:function(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),S(e,t)},trimmed:function(e){return C(e,$(),(e=>e.trim()))},tuple:function(e){const t=R();return new d({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let s=0;s<n;s++)yield[s,r[s],e[s]||t]}},validator:e=>Array.isArray(e)||`Expected an array, but received: ${l(e)}`})},type:w,union:function(e){const t=e.map((e=>e.type)).join(" | ");return new d({type:"union",schema:null,coercer(t){for(const r of e){const[e,n]=r.validate(t,{coerce:!0});if(!e)return n}return t},validator(r,n){const s=[];for(const t of e){const[...e]=f(r,t,n),[o]=e;if(!o[0])return[];for(const[t]of e)t&&s.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${l(r)}`,...s]}})},unknown:O,validate:y}),T=e(x);Object.defineProperty(i,"__esModule",{value:!0}),i.assertExhaustive=i.assertStruct=i.assert=i.AssertionError=void 0;const L=T;function F(e,t){return r=e,Boolean("string"==typeof(null===(s=null===(n=null==r?void 0:r.prototype)||void 0===n?void 0:n.constructor)||void 0===s?void 0:s.name))?new e({message:t}):e({message:t});var r,n,s}class P extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}i.AssertionError=P,i.assert=function(e,t="Assertion failed.",r=P){if(!e){if(t instanceof Error)throw t;throw F(r,t)}},i.assertStruct=function(e,t,r="Assertion failed",n=P){try{(0,L.assert)(e,t)}catch(e){throw F(n,`${r}: ${function(e){const t=function(e){return"object"==typeof e&&null!==e&&"message"in e}(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}(e)}.`)}},i.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")};var j={};Object.defineProperty(j,"__esModule",{value:!0}),j.base64=void 0;const J=T,_=i;j.base64=(e,t={})=>{var r,n;const s=null!==(r=t.paddingRequired)&&void 0!==r&&r,o=null!==(n=t.characterSet)&&void 0!==n?n:"base64";let i,a;return"base64"===o?i=String.raw`[A-Za-z0-9+\/]`:((0,_.assert)("base64url"===o),i=String.raw`[-_A-Za-z0-9]`),a=s?new RegExp(`^(?:${i}{4})*(?:${i}{3}=|${i}{2}==)?$`,"u"):new RegExp(`^(?:${i}{4})*(?:${i}{2,3}|${i}{3}=|${i}{2}==)?$`,"u"),(0,J.pattern)(e,a)};var M={},D={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=T,r=i;function n(r){return(0,t.is)(r,e.HexStruct)}function s(r){return(0,t.is)(r,e.StrictHexStruct)}e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu),e.isHexString=n,e.isStrictHexString=s,e.assertIsHexString=function(e){(0,r.assert)(n(e),"Value must be a hexadecimal string.")},e.assertIsStrictHexString=function(e){(0,r.assert)(s(e),'Value must be a hexadecimal string, starting with "0x".')},e.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},e.remove0x=function(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}}(D),Object.defineProperty(M,"__esModule",{value:!0}),M.createDataView=M.concatBytes=M.valueToBytes=M.stringToBytes=M.numberToBytes=M.signedBigIntToBytes=M.bigIntToBytes=M.hexToBytes=M.bytesToString=M.bytesToNumber=M.bytesToSignedBigInt=M.bytesToBigInt=M.bytesToHex=M.assertIsBytes=M.isBytes=void 0;const V=i,B=D,k=48,G=58,z=87;const U=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function H(e){return e instanceof Uint8Array}function X(e){(0,V.assert)(H(e),"Value must be a Uint8Array.")}function W(e){if(X(e),0===e.length)return"0x";const t=U(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,B.add0x)(r.join(""))}function q(e){X(e);const t=W(e);return BigInt(t)}function Y(e){var t;if("0x"===(null===(t=null==e?void 0:e.toLowerCase)||void 0===t?void 0:t.call(e)))return new Uint8Array;(0,B.assertIsHexString)(e);const r=(0,B.remove0x)(e).toLowerCase(),n=r.length%2==0?r:`0${r}`,s=new Uint8Array(n.length/2);for(let e=0;e<s.length;e++){const t=n.charCodeAt(2*e),r=n.charCodeAt(2*e+1),o=t-(t<G?k:z),i=r-(r<G?k:z);s[e]=16*o+i}return s}function Z(e){(0,V.assert)("bigint"==typeof e,"Value must be a bigint."),(0,V.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");return Y(e.toString(16))}function Q(e){(0,V.assert)("number"==typeof e,"Value must be a number."),(0,V.assert)(e>=0,"Value must be a non-negative number."),(0,V.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");return Y(e.toString(16))}function K(e){return(0,V.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function ee(e){if("bigint"==typeof e)return Z(e);if("number"==typeof e)return Q(e);if("string"==typeof e)return e.startsWith("0x")?Y(e):K(e);if(H(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}M.isBytes=H,M.assertIsBytes=X,M.bytesToHex=W,M.bytesToBigInt=q,M.bytesToSignedBigInt=function(e){X(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*e.length,t)},M.bytesToNumber=function(e){X(e);const t=q(e);return(0,V.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)},M.bytesToString=function(e){return X(e),(new TextDecoder).decode(e)},M.hexToBytes=Y,M.bigIntToBytes=Z,M.signedBigIntToBytes=function(e,t){(0,V.assert)("bigint"==typeof e,"Value must be a bigint."),(0,V.assert)("number"==typeof t,"Byte length must be a number."),(0,V.assert)(t>0,"Byte length must be greater than 0."),(0,V.assert)(function(e,t){(0,V.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(8*t-1))}(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let e=0;e<n.length;e++)n[e]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()},M.numberToBytes=Q,M.stringToBytes=K,M.valueToBytes=ee,M.concatBytes=function(e){const t=new Array(e.length);let r=0;for(let n=0;n<e.length;n++){const s=ee(e[n]);t[n]=s,r+=s.length}const n=new Uint8Array(r);for(let e=0,r=0;e<t.length;e++)n.set(t[e],r),r+=t[e].length;return n},M.createDataView=function(e){if("undefined"!=typeof Buffer&&e instanceof Buffer){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)};var te={};Object.defineProperty(te,"__esModule",{value:!0}),te.ChecksumStruct=void 0;const re=T,ne=j;te.ChecksumStruct=(0,re.size)((0,ne.base64)((0,re.string)(),{paddingRequired:!0}),44,44);var se={};Object.defineProperty(se,"__esModule",{value:!0}),se.createHex=se.createBytes=se.createBigInt=se.createNumber=void 0;const oe=T,ie=i,ae=M,ce=D,ue=(0,oe.union)([(0,oe.number)(),(0,oe.bigint)(),(0,oe.string)(),ce.StrictHexStruct]),le=(0,oe.coerce)((0,oe.number)(),ue,Number),pe=(0,oe.coerce)((0,oe.bigint)(),ue,BigInt);(0,oe.union)([ce.StrictHexStruct,(0,oe.instance)(Uint8Array)]);const he=(0,oe.coerce)((0,oe.instance)(Uint8Array),(0,oe.union)([ce.StrictHexStruct]),ae.hexToBytes),fe=(0,oe.coerce)(ce.StrictHexStruct,(0,oe.instance)(Uint8Array),ae.bytesToHex);se.createNumber=function(e){try{const t=(0,oe.create)(e,le);return(0,ie.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof oe.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw t}},se.createBigInt=function(e){try{return(0,oe.create)(e,pe)}catch(e){if(e instanceof oe.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},se.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,oe.create)(e,he)}catch(e){if(e instanceof oe.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},se.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,oe.create)(e,fe)}catch(e){if(e instanceof oe.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}};var de,me,ge={},ve=t&&t.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},Ee=t&&t.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(ge,"__esModule",{value:!0}),ge.FrozenSet=ge.FrozenMap=void 0;class ye{constructor(e){de.set(this,void 0),ve(this,de,new Map(e),"f"),Object.freeze(this)}get size(){return Ee(this,de,"f").size}[(de=new WeakMap,Symbol.iterator)](){return Ee(this,de,"f")[Symbol.iterator]()}entries(){return Ee(this,de,"f").entries()}forEach(e,t){return Ee(this,de,"f").forEach(((r,n,s)=>e.call(t,r,n,this)))}get(e){return Ee(this,de,"f").get(e)}has(e){return Ee(this,de,"f").has(e)}keys(){return Ee(this,de,"f").keys()}values(){return Ee(this,de,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,t])=>`${String(e)} => ${String(t)}`)).join(", ")} `:""}}`}}ge.FrozenMap=ye;class Se{constructor(e){me.set(this,void 0),ve(this,me,new Set(e),"f"),Object.freeze(this)}get size(){return Ee(this,me,"f").size}[(me=new WeakMap,Symbol.iterator)](){return Ee(this,me,"f")[Symbol.iterator]()}entries(){return Ee(this,me,"f").entries()}forEach(e,t){return Ee(this,me,"f").forEach(((r,n,s)=>e.call(t,r,n,this)))}has(e){return Ee(this,me,"f").has(e)}keys(){return Ee(this,me,"f").keys()}values(){return Ee(this,me,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}}ge.FrozenSet=Se,Object.freeze(ye),Object.freeze(ye.prototype),Object.freeze(Se),Object.freeze(Se.prototype);var Re={},be={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0,e.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},e.isNullOrUndefined=function(e){return null==e},e.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)};var t;function r(e){return e.charCodeAt(0)<=127}e.hasProperty=(e,t)=>Object.hasOwnProperty.call(e,t),(t=e.JsonSize||(e.JsonSize={}))[t.Null=4]="Null",t[t.Comma=1]="Comma",t[t.Wrapper=1]="Wrapper",t[t.True=4]="True",t[t.False=5]="False",t[t.Quote=1]="Quote",t[t.Colon=1]="Colon",t[t.Date=24]="Date",e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,e.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}},e.isASCII=r,e.calculateStringSize=function(t){var n;return t.split("").reduce(((e,t)=>r(t)?e+1:e+2),0)+(null!==(n=t.match(e.ESCAPE_CHARACTERS_REGEXP))&&void 0!==n?n:[]).length},e.calculateNumberSize=function(e){return e.toString().length}}(be),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateJsonAndGetSize=e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.isValidJson=e.JsonStruct=void 0;const t=T,r=i,n=be;function s(e,t=!1){const r=new Set;return function e(t,s){if(void 0===t)return[!1,0];if(null===t)return[!0,s?0:n.JsonSize.Null];const o=typeof t;try{if("function"===o)return[!1,0];if("string"===o||t instanceof String)return[!0,s?0:(0,n.calculateStringSize)(t)+2*n.JsonSize.Quote];if("boolean"===o||t instanceof Boolean)return s?[!0,0]:[!0,1==t?n.JsonSize.True:n.JsonSize.False];if("number"===o||t instanceof Number)return s?[!0,0]:[!0,(0,n.calculateNumberSize)(t)];if(t instanceof Date)return s?[!0,0]:[!0,isNaN(t.getDate())?n.JsonSize.Null:n.JsonSize.Date+2*n.JsonSize.Quote]}catch(e){return[!1,0]}if(!(0,n.isPlainObject)(t)&&!Array.isArray(t))return[!1,0];if(r.has(t))return[!1,0];r.add(t);try{return[!0,Object.entries(t).reduce(((o,[i,a],c,u)=>{let[l,p]=e(a,s);if(!l)throw new Error("JSON validation did not pass. Validation process stopped.");if(r.delete(t),s)return 0;return o+(Array.isArray(t)?0:i.length+n.JsonSize.Comma+2*n.JsonSize.Colon)+p+(c<u.length-1?n.JsonSize.Comma:0)}),s?0:2*n.JsonSize.Wrapper)]}catch(e){return[!1,0]}}(e,t)}e.JsonStruct=(0,t.define)("Json",(e=>{const[t]=s(e,!0);return!!t||"Expected a valid JSON-serializable value"})),e.isValidJson=function(r){return(0,t.is)(r,e.JsonStruct)},e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]),e.isJsonRpcNotification=function(r){return(0,t.is)(r,e.JsonRpcNotificationStruct)},e.assertIsJsonRpcNotification=function(t,n){(0,r.assertStruct)(t,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",n)},e.isJsonRpcRequest=function(r){return(0,t.is)(r,e.JsonRpcRequestStruct)},e.assertIsJsonRpcRequest=function(t,n){(0,r.assertStruct)(t,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",n)},e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]),e.isPendingJsonRpcResponse=function(r){return(0,t.is)(r,e.PendingJsonRpcResponseStruct)},e.assertIsPendingJsonRpcResponse=function(t,n){(0,r.assertStruct)(t,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",n)},e.isJsonRpcResponse=function(r){return(0,t.is)(r,e.JsonRpcResponseStruct)},e.assertIsJsonRpcResponse=function(t,n){(0,r.assertStruct)(t,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",n)},e.isJsonRpcSuccess=function(r){return(0,t.is)(r,e.JsonRpcSuccessStruct)},e.assertIsJsonRpcSuccess=function(t,n){(0,r.assertStruct)(t,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",n)},e.isJsonRpcFailure=function(r){return(0,t.is)(r,e.JsonRpcFailureStruct)},e.assertIsJsonRpcFailure=function(t,n){(0,r.assertStruct)(t,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",n)},e.isJsonRpcError=function(r){return(0,t.is)(r,e.JsonRpcErrorStruct)},e.assertIsJsonRpcError=function(t,n){(0,r.assertStruct)(t,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",n)},e.getJsonRpcIdValidator=function(e){const{permitEmptyString:t,permitFractions:r,permitNull:n}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},e);return e=>Boolean("number"==typeof e&&(r||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||n&&null===e)},e.validateJsonAndGetSize=s}(Re);var Ie,$e,we,Oe,Ce,Ne={},Ae={exports:{}},xe={exports:{}};function Te(){if($e)return Ie;$e=1;var e=1e3,t=60*e,r=60*t,n=24*r,s=7*n,o=365.25*n;function i(e,t,r,n){var s=t>=1.5*r;return Math.round(e/r)+" "+n+(s?"s":"")}return Ie=function(a,c){c=c||{};var u=typeof a;if("string"===u&&a.length>0)return function(i){if((i=String(i)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*s;case"days":case"day":case"d":return c*n;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(a);if("number"===u&&isFinite(a))return c.long?function(s){var o=Math.abs(s);if(o>=n)return i(s,o,n,"day");if(o>=r)return i(s,o,r,"hour");if(o>=t)return i(s,o,t,"minute");if(o>=e)return i(s,o,e,"second");return s+" ms"}(a):function(s){var o=Math.abs(s);if(o>=n)return Math.round(s/n)+"d";if(o>=r)return Math.round(s/r)+"h";if(o>=t)return Math.round(s/t)+"m";if(o>=e)return Math.round(s/e)+"s";return s+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))},Ie}function Le(){if(Oe)return we;return Oe=1,we=function(e){function t(e){let n,s,o,i=null;function a(...e){if(!a.enabled)return;const r=a,s=Number(new Date),o=s-(n||s);r.diff=o,r.prev=n,r.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,s)=>{if("%%"===n)return"%";i++;const o=t.formatters[s];if("function"==typeof o){const t=e[i];n=o.call(r,t),e.splice(i,1),i--}return n})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(s!==t.namespaces&&(s=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(n),...t.skips.map(n).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),s=n.length;for(r=0;r<s;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=Te(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t},we}var Fe,Pe,je,Je,_e,Me,De={exports:{}};function Ve(){return Pe?Fe:(Pe=1,Fe=(e,t=process.argv)=>{const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return-1!==n&&(-1===s||n<s)})}function Be(){return _e||(_e=1,function(e,t){const o=r,i=n;t.init=function(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let n=0;n<r.length;n++)e.inspectOpts[r[n]]=t.inspectOpts[r[n]]},t.log=function(...e){return process.stderr.write(i.format(...e)+"\n")},t.formatArgs=function(r){const{namespace:n,useColors:s}=this;if(s){const t=this.color,s="[3"+(t<8?t:"8;5;"+t),o=` ${s};1m${n} [0m`;r[0]=o+r[0].split("\n").join("\n"+o),r.push(s+"m+"+e.exports.humanize(this.diff)+"[0m")}else r[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+n+" "+r[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):o.isatty(process.stderr.fd)},t.destroy=i.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=function(){if(Je)return je;Je=1;const e=s,t=r,n=Ve(),{env:o}=process;let i;function a(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function c(t,r){if(0===i)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!r&&void 0===i)return 0;const s=i||0;if("dumb"===o.TERM)return s;if("win32"===process.platform){const t=e.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in o)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in o))||"codeship"===o.CI_NAME?1:s;if("TEAMCITY_VERSION"in o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0;if("truecolor"===o.COLORTERM)return 3;if("TERM_PROGRAM"in o){const e=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||"COLORTERM"in o?1:s}return n("no-color")||n("no-colors")||n("color=false")||n("color=never")?i=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(i=1),"FORCE_COLOR"in o&&(i="true"===o.FORCE_COLOR?1:"false"===o.FORCE_COLOR?0:0===o.FORCE_COLOR.length?1:Math.min(parseInt(o.FORCE_COLOR,10),3)),je={supportsColor:function(e){return a(c(e,e&&e.isTTY))},stdout:a(c(!0,t.isatty(1))),stderr:a(c(!0,t.isatty(2)))}}();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let n=process.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e}),{}),e.exports=Le()(t);const{formatters:a}=e.exports;a.o=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},a.O=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts)}}(De,De.exports)),De.exports}Me=Ae,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Me.exports=(Ce||(Ce=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,s=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(s=n))})),t.splice(s,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Le()(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(xe,xe.exports)),xe.exports):Me.exports=Be();var ke=t&&t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.createModuleLogger=Ne.createProjectLogger=void 0;const Ge=(0,ke(Ae.exports).default)("metamask");Ne.createProjectLogger=function(e){return Ge.extend(e)},Ne.createModuleLogger=function(e,t){return e.extend(t)};var ze={};Object.defineProperty(ze,"__esModule",{value:!0}),ze.hexToBigInt=ze.hexToNumber=ze.bigIntToHex=ze.numberToHex=void 0;const Ue=i,He=D;ze.numberToHex=e=>((0,Ue.assert)("number"==typeof e,"Value must be a number."),(0,Ue.assert)(e>=0,"Value must be a non-negative number."),(0,Ue.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,He.add0x)(e.toString(16)));ze.bigIntToHex=e=>((0,Ue.assert)("bigint"==typeof e,"Value must be a bigint."),(0,Ue.assert)(e>=0,"Value must be a non-negative bigint."),(0,He.add0x)(e.toString(16)));ze.hexToNumber=e=>{(0,He.assertIsHexString)(e);const t=parseInt(e,16);return(0,Ue.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};ze.hexToBigInt=e=>((0,He.assertIsHexString)(e),BigInt((0,He.add0x)(e)));var Xe={};Object.defineProperty(Xe,"__esModule",{value:!0});var We={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,(t=e.Duration||(e.Duration={}))[t.Millisecond=1]="Millisecond",t[t.Second=1e3]="Second",t[t.Minute=6e4]="Minute",t[t.Hour=36e5]="Hour",t[t.Day=864e5]="Day",t[t.Week=6048e5]="Week",t[t.Year=31536e6]="Year";const r=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};e.inMilliseconds=function(e,t){return r(e,"count"),e*t},e.timeSince=function(e){return r(e,"timestamp"),Date.now()-e}}(We);var qe={},Ye={exports:{}};var Ze={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};var Qe="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r}=Ze,n=Qe,s=(t=e.exports={}).re=[],o=t.src=[],i=t.t={};let a=0;const c=(e,t,r)=>{const c=a++;n(e,c,t),i[e]=c,o[c]=t,s[c]=new RegExp(t,r?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","[0-9]+"),c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),c("MAINVERSION",`(${o[i.NUMERICIDENTIFIER]})\\.(${o[i.NUMERICIDENTIFIER]})\\.(${o[i.NUMERICIDENTIFIER]})`),c("MAINVERSIONLOOSE",`(${o[i.NUMERICIDENTIFIERLOOSE]})\\.(${o[i.NUMERICIDENTIFIERLOOSE]})\\.(${o[i.NUMERICIDENTIFIERLOOSE]})`),c("PRERELEASEIDENTIFIER",`(?:${o[i.NUMERICIDENTIFIER]}|${o[i.NONNUMERICIDENTIFIER]})`),c("PRERELEASEIDENTIFIERLOOSE",`(?:${o[i.NUMERICIDENTIFIERLOOSE]}|${o[i.NONNUMERICIDENTIFIER]})`),c("PRERELEASE",`(?:-(${o[i.PRERELEASEIDENTIFIER]}(?:\\.${o[i.PRERELEASEIDENTIFIER]})*))`),c("PRERELEASELOOSE",`(?:-?(${o[i.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${o[i.PRERELEASEIDENTIFIERLOOSE]})*))`),c("BUILDIDENTIFIER","[0-9A-Za-z-]+"),c("BUILD",`(?:\\+(${o[i.BUILDIDENTIFIER]}(?:\\.${o[i.BUILDIDENTIFIER]})*))`),c("FULLPLAIN",`v?${o[i.MAINVERSION]}${o[i.PRERELEASE]}?${o[i.BUILD]}?`),c("FULL",`^${o[i.FULLPLAIN]}$`),c("LOOSEPLAIN",`[v=\\s]*${o[i.MAINVERSIONLOOSE]}${o[i.PRERELEASELOOSE]}?${o[i.BUILD]}?`),c("LOOSE",`^${o[i.LOOSEPLAIN]}$`),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE",`${o[i.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),c("XRANGEIDENTIFIER",`${o[i.NUMERICIDENTIFIER]}|x|X|\\*`),c("XRANGEPLAIN",`[v=\\s]*(${o[i.XRANGEIDENTIFIER]})(?:\\.(${o[i.XRANGEIDENTIFIER]})(?:\\.(${o[i.XRANGEIDENTIFIER]})(?:${o[i.PRERELEASE]})?${o[i.BUILD]}?)?)?`),c("XRANGEPLAINLOOSE",`[v=\\s]*(${o[i.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[i.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[i.XRANGEIDENTIFIERLOOSE]})(?:${o[i.PRERELEASELOOSE]})?${o[i.BUILD]}?)?)?`),c("XRANGE",`^${o[i.GTLT]}\\s*${o[i.XRANGEPLAIN]}$`),c("XRANGELOOSE",`^${o[i.GTLT]}\\s*${o[i.XRANGEPLAINLOOSE]}$`),c("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),c("COERCERTL",o[i.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM",`(\\s*)${o[i.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",c("TILDE",`^${o[i.LONETILDE]}${o[i.XRANGEPLAIN]}$`),c("TILDELOOSE",`^${o[i.LONETILDE]}${o[i.XRANGEPLAINLOOSE]}$`),c("LONECARET","(?:\\^)"),c("CARETTRIM",`(\\s*)${o[i.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",c("CARET",`^${o[i.LONECARET]}${o[i.XRANGEPLAIN]}$`),c("CARETLOOSE",`^${o[i.LONECARET]}${o[i.XRANGEPLAINLOOSE]}$`),c("COMPARATORLOOSE",`^${o[i.GTLT]}\\s*(${o[i.LOOSEPLAIN]})$|^$`),c("COMPARATOR",`^${o[i.GTLT]}\\s*(${o[i.FULLPLAIN]})$|^$`),c("COMPARATORTRIM",`(\\s*)${o[i.GTLT]}\\s*(${o[i.LOOSEPLAIN]}|${o[i.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE",`^\\s*(${o[i.XRANGEPLAIN]})\\s+-\\s+(${o[i.XRANGEPLAIN]})\\s*$`),c("HYPHENRANGELOOSE",`^\\s*(${o[i.XRANGEPLAINLOOSE]})\\s+-\\s+(${o[i.XRANGEPLAINLOOSE]})\\s*$`),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Ye,Ye.exports);const Ke=Object.freeze({loose:!0}),et=Object.freeze({});var tt=e=>e?"object"!=typeof e?Ke:e:et;const rt=/^[0-9]+$/,nt=(e,t)=>{const r=rt.test(e),n=rt.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1};var st={compareIdentifiers:nt,rcompareIdentifiers:(e,t)=>nt(t,e)};const ot=Qe,{MAX_LENGTH:it,MAX_SAFE_INTEGER:at}=Ze,{re:ct,t:ut}=Ye.exports,lt=tt,{compareIdentifiers:pt}=st;class ht{constructor(e,t){if(t=lt(t),e instanceof ht){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid Version: ${n.inspect(e)}`);if(e.length>it)throw new TypeError(`version is longer than ${it} characters`);ot("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?ct[ut.LOOSE]:ct[ut.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>at||this.major<0)throw new TypeError("Invalid major version");if(this.minor>at||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>at||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<at)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(ot("SemVer.compare",this.version,this.options,e),!(e instanceof ht)){if("string"==typeof e&&e===this.version)return 0;e=new ht(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof ht||(e=new ht(e,this.options)),pt(this.major,e.major)||pt(this.minor,e.minor)||pt(this.patch,e.patch)}comparePre(e){if(e instanceof ht||(e=new ht(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],n=e.prerelease[t];if(ot("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return pt(r,n)}while(++t)}compareBuild(e){e instanceof ht||(e=new ht(e,this.options));let t=0;do{const r=this.build[t],n=e.build[t];if(ot("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return pt(r,n)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===pt(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}}var ft=ht;const dt=ft;var mt=(e,t,r=!1)=>{if(e instanceof dt)return e;try{return new dt(e,t)}catch(e){if(!r)return null;throw e}};const gt=mt;var vt=(e,t)=>{const r=gt(e,t);return r?r.version:null};const Et=mt;var yt=(e,t)=>{const r=Et(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};const St=ft;var Rt=(e,t,r,n,s)=>{"string"==typeof r&&(s=n,n=r,r=void 0);try{return new St(e instanceof St?e.version:e,r).inc(t,n,s).version}catch(e){return null}};const bt=mt;var It=(e,t)=>{const r=bt(e,null,!0),n=bt(t,null,!0),s=r.compare(n);if(0===s)return null;const o=s>0,i=o?n:r,a=!!(o?r:n).prerelease.length,c=a?"pre":"";return r.major!==n.major?c+"major":r.minor!==n.minor?c+"minor":r.patch!==n.patch?c+"patch":a?"prerelease":i.patch?"patch":i.minor?"minor":"major"};const $t=ft;var wt=(e,t)=>new $t(e,t).major;const Ot=ft;var Ct=(e,t)=>new Ot(e,t).minor;const Nt=ft;var At=(e,t)=>new Nt(e,t).patch;const xt=mt;var Tt=(e,t)=>{const r=xt(e,t);return r&&r.prerelease.length?r.prerelease:null};const Lt=ft;var Ft=(e,t,r)=>new Lt(e,r).compare(new Lt(t,r));const Pt=Ft;var jt=(e,t,r)=>Pt(t,e,r);const Jt=Ft;var _t=(e,t)=>Jt(e,t,!0);const Mt=ft;var Dt=(e,t,r)=>{const n=new Mt(e,r),s=new Mt(t,r);return n.compare(s)||n.compareBuild(s)};const Vt=Dt;var Bt=(e,t)=>e.sort(((e,r)=>Vt(e,r,t)));const kt=Dt;var Gt=(e,t)=>e.sort(((e,r)=>kt(r,e,t)));const zt=Ft;var Ut=(e,t,r)=>zt(e,t,r)>0;const Ht=Ft;var Xt=(e,t,r)=>Ht(e,t,r)<0;const Wt=Ft;var qt=(e,t,r)=>0===Wt(e,t,r);const Yt=Ft;var Zt=(e,t,r)=>0!==Yt(e,t,r);const Qt=Ft;var Kt=(e,t,r)=>Qt(e,t,r)>=0;const er=Ft;var tr=(e,t,r)=>er(e,t,r)<=0;const rr=qt,nr=Zt,sr=Ut,or=Kt,ir=Xt,ar=tr;var cr=(e,t,r,n)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return rr(e,r,n);case"!=":return nr(e,r,n);case">":return sr(e,r,n);case">=":return or(e,r,n);case"<":return ir(e,r,n);case"<=":return ar(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};const ur=ft,lr=mt,{re:pr,t:hr}=Ye.exports;var fr,dr,mr,gr,vr,Er,yr,Sr,Rr,br,Ir=(e,t)=>{if(e instanceof ur)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=pr[hr.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),pr[hr.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;pr[hr.COERCERTL].lastIndex=-1}else r=e.match(pr[hr.COERCE]);return null===r?null:lr(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};function $r(){if(gr)return mr;function e(t){var r=this;if(r instanceof e||(r=new e),r.tail=null,r.head=null,r.length=0,t&&"function"==typeof t.forEach)t.forEach((function(e){r.push(e)}));else if(arguments.length>0)for(var n=0,s=arguments.length;n<s;n++)r.push(arguments[n]);return r}function t(e,t,r){var n=t===e.head?new s(r,null,t,e):new s(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function r(e,t){e.tail=new s(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function n(e,t){e.head=new s(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function s(e,t,r,n){if(!(this instanceof s))return new s(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}gr=1,mr=e,e.Node=s,e.create=e,e.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},e.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},e.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},e.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)r(this,arguments[e]);return this.length},e.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)n(this,arguments[e]);return this.length},e.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},e.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},e.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},e.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},e.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},e.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},e.prototype.map=function(t,r){r=r||this;for(var n=new e,s=this.head;null!==s;)n.push(t.call(r,s.value,this)),s=s.next;return n},e.prototype.mapReverse=function(t,r){r=r||this;for(var n=new e,s=this.tail;null!==s;)n.push(t.call(r,s.value,this)),s=s.prev;return n},e.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var s=0;null!==n;s++)r=e(r,n.value,s),n=n.next;return r},e.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var s=this.length-1;null!==n;s--)r=e(r,n.value,s),n=n.prev;return r},e.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},e.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},e.prototype.slice=function(t,r){(r=r||this.length)<0&&(r+=this.length),(t=t||0)<0&&(t+=this.length);var n=new e;if(r<t||r<0)return n;t<0&&(t=0),r>this.length&&(r=this.length);for(var s=0,o=this.head;null!==o&&s<t;s++)o=o.next;for(;null!==o&&s<r;s++,o=o.next)n.push(o.value);return n},e.prototype.sliceReverse=function(t,r){(r=r||this.length)<0&&(r+=this.length),(t=t||0)<0&&(t+=this.length);var n=new e;if(r<t||r<0)return n;t<0&&(t=0),r>this.length&&(r=this.length);for(var s=this.length,o=this.tail;null!==o&&s>r;s--)o=o.prev;for(;null!==o&&s>t;s--,o=o.prev)n.push(o.value);return n},e.prototype.splice=function(e,r,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var s=0,o=this.head;null!==o&&s<e;s++)o=o.next;var i=[];for(s=0;o&&s<r;s++)i.push(o.value),o=this.removeNode(o);null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(s=0;s<n.length;s++)o=t(this,o,n[s]);return i},e.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{(dr?fr:(dr=1,fr=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}))(e)}catch(e){}return mr}function wr(){if(Sr)return yr;Sr=1;class e{constructor(t,r){if(r=n(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof s)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t,this.set=t.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${t}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!d(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const t=((this.options.includePrerelease&&h)|(this.options.loose&&f))+":"+e,n=r.get(t);if(n)return n;const i=this.options.loose,m=i?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];e=e.replace(m,C(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(a[c.COMPARATORTRIM],u),o("comparator trim",e);let g=(e=(e=(e=e.replace(a[c.TILDETRIM],l)).replace(a[c.CARETTRIM],p)).split(/\s+/).join(" ")).split(" ").map((e=>v(e,this.options))).join(" ").split(/\s+/).map((e=>O(e,this.options)));i&&(g=g.filter((e=>(o("loose invalid filter",e,this.options),!!e.match(a[c.COMPARATORLOOSE]))))),o("range list",g);const E=new Map,y=g.map((e=>new s(e,this.options)));for(const e of y){if(d(e))return[e];E.set(e.value,e)}E.size>1&&E.has("")&&E.delete("");const S=[...E.values()];return r.set(t,S),S}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>g(e,r)&&t.set.some((t=>g(t,r)&&e.every((e=>t.every((t=>e.intersects(t,r)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new i(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(N(this.set[t],e,this.options))return!0;return!1}}yr=e;const t=function(){if(Er)return vr;Er=1;const e=$r(),t=Symbol("max"),r=Symbol("length"),n=Symbol("lengthCalculator"),s=Symbol("allowStale"),o=Symbol("maxAge"),i=Symbol("dispose"),a=Symbol("noDisposeOnSet"),c=Symbol("lruList"),u=Symbol("cache"),l=Symbol("updateAgeOnGet"),p=()=>1,h=(e,t,r)=>{const n=e[u].get(t);if(n){const t=n.value;if(f(e,t)){if(m(e,n),!e[s])return}else r&&(e[l]&&(n.value.now=Date.now()),e[c].unshiftNode(n));return t.value}},f=(e,t)=>{if(!t||!t.maxAge&&!e[o])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[o]&&r>e[o]},d=e=>{if(e[r]>e[t])for(let n=e[c].tail;e[r]>e[t]&&null!==n;){const t=n.prev;m(e,n),n=t}},m=(e,t)=>{if(t){const n=t.value;e[i]&&e[i](n.key,n.value),e[r]-=n.length,e[u].delete(n.key),e[c].removeNode(t)}};class g{constructor(e,t,r,n,s){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=s||0}}const v=(e,t,r,n)=>{let o=r.value;f(e,o)&&(m(e,r),e[s]||(o=void 0)),o&&t.call(n,o.value,o.key,e)};return vr=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[t]=e.max||1/0;const r=e.length||p;if(this[n]="function"!=typeof r?p:r,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[o]=e.maxAge||0,this[i]=e.dispose,this[a]=e.noDisposeOnSet||!1,this[l]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[t]=e||1/0,d(this)}get max(){return this[t]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[o]=e,d(this)}get maxAge(){return this[o]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[n]&&(this[n]=e,this[r]=0,this[c].forEach((e=>{e.length=this[n](e.value,e.key),this[r]+=e.length}))),d(this)}get lengthCalculator(){return this[n]}get length(){return this[r]}get itemCount(){return this[c].length}rforEach(e,t){t=t||this;for(let r=this[c].tail;null!==r;){const n=r.prev;v(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[c].head;null!==r;){const n=r.next;v(this,e,r,t),r=n}}keys(){return this[c].toArray().map((e=>e.key))}values(){return this[c].toArray().map((e=>e.value))}reset(){this[i]&&this[c]&&this[c].length&&this[c].forEach((e=>this[i](e.key,e.value))),this[u]=new Map,this[c]=new e,this[r]=0}dump(){return this[c].map((e=>!f(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[c]}set(e,s,l){if((l=l||this[o])&&"number"!=typeof l)throw new TypeError("maxAge must be a number");const p=l?Date.now():0,h=this[n](s,e);if(this[u].has(e)){if(h>this[t])return m(this,this[u].get(e)),!1;const n=this[u].get(e).value;return this[i]&&(this[a]||this[i](e,n.value)),n.now=p,n.maxAge=l,n.value=s,this[r]+=h-n.length,n.length=h,this.get(e),d(this),!0}const f=new g(e,s,h,p,l);return f.length>this[t]?(this[i]&&this[i](e,s),!1):(this[r]+=f.length,this[c].unshift(f),this[u].set(e,this[c].head),d(this),!0)}has(e){if(!this[u].has(e))return!1;const t=this[u].get(e).value;return!f(this,t)}get(e){return h(this,e,!0)}peek(e){return h(this,e,!1)}pop(){const e=this[c].tail;return e?(m(this,e),e.value):null}del(e){m(this,this[u].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],s=n.e||0;if(0===s)this.set(n.k,n.v);else{const e=s-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[u].forEach(((e,t)=>h(this,t,!1)))}},vr}(),r=new t({max:1e3}),n=tt,s=Or(),o=Qe,i=ft,{re:a,t:c,comparatorTrimReplace:u,tildeTrimReplace:l,caretTrimReplace:p}=Ye.exports,{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:f}=Ze,d=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,g=(e,t)=>{let r=!0;const n=e.slice();let s=n.pop();for(;r&&n.length;)r=n.every((e=>s.intersects(e,t))),s=n.pop();return r},v=(e,t)=>(o("comp",e,t),e=R(e,t),o("caret",e),e=y(e,t),o("tildes",e),e=I(e,t),o("xrange",e),e=w(e,t),o("stars",e),e),E=e=>!e||"x"===e.toLowerCase()||"*"===e,y=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{const r=t.loose?a[c.TILDELOOSE]:a[c.TILDE];return e.replace(r,((t,r,n,s,i)=>{let a;return o("tilde",e,t,r,n,s,i),E(r)?a="":E(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:E(s)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:i?(o("replaceTilde pr",i),a=`>=${r}.${n}.${s}-${i} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${s} <${r}.${+n+1}.0-0`,o("tilde return",a),a}))},R=(e,t)=>e.trim().split(/\s+/).map((e=>b(e,t))).join(" "),b=(e,t)=>{o("caret",e,t);const r=t.loose?a[c.CARETLOOSE]:a[c.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,s,i,a)=>{let c;return o("caret",e,t,r,s,i,a),E(r)?c="":E(s)?c=`>=${r}.0.0${n} <${+r+1}.0.0-0`:E(i)?c="0"===r?`>=${r}.${s}.0${n} <${r}.${+s+1}.0-0`:`>=${r}.${s}.0${n} <${+r+1}.0.0-0`:a?(o("replaceCaret pr",a),c="0"===r?"0"===s?`>=${r}.${s}.${i}-${a} <${r}.${s}.${+i+1}-0`:`>=${r}.${s}.${i}-${a} <${r}.${+s+1}.0-0`:`>=${r}.${s}.${i}-${a} <${+r+1}.0.0-0`):(o("no pr"),c="0"===r?"0"===s?`>=${r}.${s}.${i}${n} <${r}.${s}.${+i+1}-0`:`>=${r}.${s}.${i}${n} <${r}.${+s+1}.0-0`:`>=${r}.${s}.${i} <${+r+1}.0.0-0`),o("caret return",c),c}))},I=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>$(e,t))).join(" ")),$=(e,t)=>{e=e.trim();const r=t.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return e.replace(r,((r,n,s,i,a,c)=>{o("xRange",e,r,n,s,i,a,c);const u=E(s),l=u||E(i),p=l||E(a),h=p;return"="===n&&h&&(n=""),c=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&h?(l&&(i=0),a=0,">"===n?(n=">=",l?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):"<="===n&&(n="<",l?s=+s+1:i=+i+1),"<"===n&&(c="-0"),r=`${n+s}.${i}.${a}${c}`):l?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:p&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),o("xRange return",r),r}))},w=(e,t)=>(o("replaceStars",e,t),e.trim().replace(a[c.STAR],"")),O=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?c.GTE0PRE:c.GTE0],"")),C=e=>(t,r,n,s,o,i,a,c,u,l,p,h,f)=>`${r=E(n)?"":E(s)?`>=${n}.0.0${e?"-0":""}`:E(o)?`>=${n}.${s}.0${e?"-0":""}`:i?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=E(u)?"":E(l)?`<${+u+1}.0.0-0`:E(p)?`<${u}.${+l+1}.0-0`:h?`<=${u}.${l}.${p}-${h}`:e?`<${u}.${l}.${+p+1}-0`:`<=${c}`}`.trim(),N=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(o(e[r].semver),e[r].semver!==s.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0};return yr}function Or(){if(br)return Rr;br=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(n,s){if(s=r(s),n instanceof t){if(n.loose===!!s.loose)return n;n=n.value}i("comparator",n,s),this.options=s,this.loose=!!s.loose,this.parse(n),this.semver===e?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}parse(t){const r=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],o=t.match(r);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new a(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(i("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new a(t,this.options)}catch(e){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,n).test(this.value):""===e.operator?""===e.value||new c(this.value,n).test(e.semver):(!(n=r(n)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(o(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}Rr=t;const r=tt,{re:n,t:s}=Ye.exports,o=cr,i=Qe,a=ft,c=wr();return Rr}const Cr=wr();var Nr=(e,t,r)=>{try{t=new Cr(t,r)}catch(e){return!1}return t.test(e)};const Ar=wr();var xr=(e,t)=>new Ar(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));const Tr=ft,Lr=wr();var Fr=(e,t,r)=>{let n=null,s=null,o=null;try{o=new Lr(t,r)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(n&&-1!==s.compare(e)||(n=e,s=new Tr(n,r)))})),n};const Pr=ft,jr=wr();var Jr=(e,t,r)=>{let n=null,s=null,o=null;try{o=new jr(t,r)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(n&&1!==s.compare(e)||(n=e,s=new Pr(n,r)))})),n};const _r=ft,Mr=wr(),Dr=Ut;var Vr=(e,t)=>{e=new Mr(e,t);let r=new _r("0.0.0");if(e.test(r))return r;if(r=new _r("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const n=e.set[t];let s=null;n.forEach((e=>{const t=new _r(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":s&&!Dr(t,s)||(s=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!s||r&&!Dr(r,s)||(r=s)}return r&&e.test(r)?r:null};const Br=wr();var kr=(e,t)=>{try{return new Br(e,t).range||"*"}catch(e){return null}};const Gr=ft,zr=Or(),{ANY:Ur}=zr,Hr=wr(),Xr=Nr,Wr=Ut,qr=Xt,Yr=tr,Zr=Kt;var Qr=(e,t,r,n)=>{let s,o,i,a,c;switch(e=new Gr(e,n),t=new Hr(t,n),r){case">":s=Wr,o=Yr,i=qr,a=">",c=">=";break;case"<":s=qr,o=Zr,i=Wr,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Xr(e,t,n))return!1;for(let r=0;r<t.set.length;++r){const u=t.set[r];let l=null,p=null;if(u.forEach((e=>{e.semver===Ur&&(e=new zr(">=0.0.0")),l=l||e,p=p||e,s(e.semver,l.semver,n)?l=e:i(e.semver,p.semver,n)&&(p=e)})),l.operator===a||l.operator===c)return!1;if((!p.operator||p.operator===a)&&o(e,p.semver))return!1;if(p.operator===c&&i(e,p.semver))return!1}return!0};const Kr=Qr;var en=(e,t,r)=>Kr(e,t,">",r);const tn=Qr;var rn=(e,t,r)=>tn(e,t,"<",r);const nn=wr();var sn=(e,t,r)=>(e=new nn(e,r),t=new nn(t,r),e.intersects(t,r));const on=Nr,an=Ft;const cn=wr(),un=Or(),{ANY:ln}=un,pn=Nr,hn=Ft,fn=[new un(">=0.0.0-0")],dn=[new un(">=0.0.0")],mn=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===ln){if(1===t.length&&t[0].semver===ln)return!0;e=r.includePrerelease?fn:dn}if(1===t.length&&t[0].semver===ln){if(r.includePrerelease)return!0;t=dn}const n=new Set;let s,o,i,a,c,u,l;for(const t of e)">"===t.operator||">="===t.operator?s=gn(s,t,r):"<"===t.operator||"<="===t.operator?o=vn(o,t,r):n.add(t.semver);if(n.size>1)return null;if(s&&o){if(i=hn(s.semver,o.semver,r),i>0)return null;if(0===i&&(">="!==s.operator||"<="!==o.operator))return null}for(const e of n){if(s&&!pn(e,String(s),r))return null;if(o&&!pn(e,String(o),r))return null;for(const n of t)if(!pn(e,String(n),r))return!1;return!0}let p=!(!o||r.includePrerelease||!o.semver.prerelease.length)&&o.semver,h=!(!s||r.includePrerelease||!s.semver.prerelease.length)&&s.semver;p&&1===p.prerelease.length&&"<"===o.operator&&0===p.prerelease[0]&&(p=!1);for(const e of t){if(l=l||">"===e.operator||">="===e.operator,u=u||"<"===e.operator||"<="===e.operator,s)if(h&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===h.major&&e.semver.minor===h.minor&&e.semver.patch===h.patch&&(h=!1),">"===e.operator||">="===e.operator){if(a=gn(s,e,r),a===e&&a!==s)return!1}else if(">="===s.operator&&!pn(s.semver,String(e),r))return!1;if(o)if(p&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===p.major&&e.semver.minor===p.minor&&e.semver.patch===p.patch&&(p=!1),"<"===e.operator||"<="===e.operator){if(c=vn(o,e,r),c===e&&c!==o)return!1}else if("<="===o.operator&&!pn(o.semver,String(e),r))return!1;if(!e.operator&&(o||s)&&0!==i)return!1}return!(s&&u&&!o&&0!==i)&&(!(o&&l&&!s&&0!==i)&&(!h&&!p))},gn=(e,t,r)=>{if(!e)return t;const n=hn(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},vn=(e,t,r)=>{if(!e)return t;const n=hn(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};var En=(e,t,r={})=>{if(e===t)return!0;e=new cn(e,r),t=new cn(t,r);let n=!1;e:for(const s of e.set){for(const e of t.set){const t=mn(s,e,r);if(n=n||null!==t,t)continue e}if(n)return!1}return!0};const yn=Ye.exports,Sn=Ze,Rn=ft,bn=st,In=(e,t,r)=>{const n=[];let s=null,o=null;const i=e.sort(((e,t)=>an(e,t,r)));for(const e of i){on(e,t,r)?(o=e,s||(s=e)):(o&&n.push([s,o]),o=null,s=null)}s&&n.push([s,null]);const a=[];for(const[e,t]of n)e===t?a.push(e):t||e!==i[0]?t?e===i[0]?a.push(`<=${t}`):a.push(`${e} - ${t}`):a.push(`>=${e}`):a.push("*");const c=a.join(" || "),u="string"==typeof t.raw?t.raw:String(t);return c.length<u.length?c:t};var $n,wn,On,Cn={parse:mt,valid:vt,clean:yt,inc:Rt,diff:It,major:wt,minor:Ct,patch:At,prerelease:Tt,compare:Ft,rcompare:jt,compareLoose:_t,compareBuild:Dt,sort:Bt,rsort:Gt,gt:Ut,lt:Xt,eq:qt,neq:Zt,gte:Kt,lte:tr,cmp:cr,coerce:Ir,Comparator:Or(),Range:wr(),satisfies:Nr,toComparators:xr,maxSatisfying:Fr,minSatisfying:Jr,minVersion:Vr,validRange:kr,outside:Qr,gtr:en,ltr:rn,intersects:sn,simplifyRange:In,subset:En,SemVer:Rn,re:yn.re,src:yn.src,tokens:yn.t,SEMVER_SPEC_VERSION:Sn.SEMVER_SPEC_VERSION,RELEASE_TYPES:Sn.RELEASE_TYPES,compareIdentifiers:bn.compareIdentifiers,rcompareIdentifiers:bn.rcompareIdentifiers};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=Cn,r=T,n=i;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",(e=>null!==(0,t.valid)(e)||`Expected SemVer version, got "${e}"`)),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",(e=>null!==(0,t.validRange)(e)||`Expected SemVer range, got "${e}"`)),e.isValidSemVerVersion=function(t){return(0,r.is)(t,e.VersionStruct)},e.isValidSemVerRange=function(t){return(0,r.is)(t,e.VersionRangeStruct)},e.assertIsSemVerVersion=function(t){(0,n.assertStruct)(t,e.VersionStruct)},e.assertIsSemVerRange=function(t){(0,n.assertStruct)(t,e.VersionRangeStruct)},e.gtVersion=function(e,r){return(0,t.gt)(e,r)},e.gtRange=function(e,r){return(0,t.gtr)(e,r)},e.satisfiesVersionRange=function(e,r){return(0,t.satisfies)(e,r,{includePrerelease:!0})}}(qe),$n=o,wn=t&&t.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),On=t&&t.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||wn(t,e,r)},Object.defineProperty($n,"__esModule",{value:!0}),On(i,$n),On(j,$n),On(M,$n),On(te,$n),On(se,$n),On(ge,$n),On(D,$n),On(Re,$n),On(Ne,$n),On(be,$n),On(ze,$n),On(Xe,$n),On(We,$n),On(qe,$n);export{Cn as a,o as d,Ae as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"stream";import t from"http";import r from"url";import{p as o,L as n}from"./interface-36a3c8cf.js";import s from"https";import i from"zlib";import{g as a}from"./_commonjsHelpers-70de2c37.js";import{hexlify as u,arrayify as c,isBytesLike as l}from"@ethersproject/bytes";const f=e.Readable,h=Symbol("buffer"),d=Symbol("type");class p{constructor(){this[d]="";const e=arguments[0],t=arguments[1],r=[];let o=0;if(e){const t=e,n=Number(t.length);for(let e=0;e<n;e++){const n=t[e];let s;s=n instanceof Buffer?n:ArrayBuffer.isView(n)?Buffer.from(n.buffer,n.byteOffset,n.byteLength):n instanceof ArrayBuffer?Buffer.from(n):n instanceof p?n[h]:Buffer.from("string"==typeof n?n:String(n)),o+=s.length,r.push(s)}}this[h]=Buffer.concat(r);let n=t&&void 0!==t.type&&String(t.type).toLowerCase();n&&!/[^\u0020-\u007E]/.test(n)&&(this[d]=n)}get size(){return this[h].length}get type(){return this[d]}text(){return Promise.resolve(this[h].toString())}arrayBuffer(){const e=this[h],t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return Promise.resolve(t)}stream(){const e=new f;return e._read=function(){},e.push(this[h]),e.push(null),e}toString(){return"[object Blob]"}slice(){const e=this.size,t=arguments[0],r=arguments[1];let o,n;o=void 0===t?0:t<0?Math.max(e+t,0):Math.min(t,e),n=void 0===r?e:r<0?Math.max(e+r,0):Math.min(r,e);const s=Math.max(n-o,0),i=this[h].slice(o,o+s),a=new p([],{type:arguments[2]});return a[h]=i,a}}function m(e,t,r){Error.call(this,e),this.message=e,this.type=t,r&&(this.code=this.errno=r.code),Error.captureStackTrace(this,this.constructor)}let y;Object.defineProperties(p.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Object.defineProperty(p.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0}),m.prototype=Object.create(Error.prototype),m.prototype.constructor=m,m.prototype.name="FetchError";try{y=require("encoding").convert}catch(e){}const b=Symbol("Body internals"),g=e.PassThrough;function w(t){var r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=o.size;let s=void 0===n?0:n;var i=o.timeout;let a=void 0===i?0:i;null==t?t=null:E(t)?t=Buffer.from(t.toString()):S(t)||Buffer.isBuffer(t)||("[object ArrayBuffer]"===Object.prototype.toString.call(t)?t=Buffer.from(t):ArrayBuffer.isView(t)?t=Buffer.from(t.buffer,t.byteOffset,t.byteLength):t instanceof e||(t=Buffer.from(String(t)))),this[b]={body:t,disturbed:!1,error:null},this.size=s,this.timeout=a,t instanceof e&&t.on("error",(function(e){const t="AbortError"===e.name?e:new m(`Invalid response body while trying to fetch ${r.url}: ${e.message}`,"system",e);r[b].error=t}))}function v(){var t=this;if(this[b].disturbed)return w.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[b].disturbed=!0,this[b].error)return w.Promise.reject(this[b].error);let r=this.body;if(null===r)return w.Promise.resolve(Buffer.alloc(0));if(S(r)&&(r=r.stream()),Buffer.isBuffer(r))return w.Promise.resolve(r);if(!(r instanceof e))return w.Promise.resolve(Buffer.alloc(0));let o=[],n=0,s=!1;return new w.Promise((function(e,i){let a;t.timeout&&(a=setTimeout((function(){s=!0,i(new m(`Response timeout while trying to fetch ${t.url} (over ${t.timeout}ms)`,"body-timeout"))}),t.timeout)),r.on("error",(function(e){"AbortError"===e.name?(s=!0,i(e)):i(new m(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e))})),r.on("data",(function(e){if(!s&&null!==e){if(t.size&&n+e.length>t.size)return s=!0,void i(new m(`content size at ${t.url} over limit: ${t.size}`,"max-size"));n+=e.length,o.push(e)}})),r.on("end",(function(){if(!s){clearTimeout(a);try{e(Buffer.concat(o,n))}catch(e){i(new m(`Could not create Buffer from response body for ${t.url}: ${e.message}`,"system",e))}}}))}))}function E(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function S(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function T(t){let r,o,n=t.body;if(t.bodyUsed)throw new Error("cannot clone body after it is used");return n instanceof e&&"function"!=typeof n.getBoundary&&(r=new g,o=new g,n.pipe(r),n.pipe(o),t[b].body=r,n=o),n}function O(t){return null===t?null:"string"==typeof t?"text/plain;charset=UTF-8":E(t)?"application/x-www-form-urlencoded;charset=UTF-8":S(t)?t.type||null:Buffer.isBuffer(t)||"[object ArrayBuffer]"===Object.prototype.toString.call(t)||ArrayBuffer.isView(t)?null:"function"==typeof t.getBoundary?`multipart/form-data;boundary=${t.getBoundary()}`:t instanceof e?null:"text/plain;charset=UTF-8"}function R(e){const t=e.body;return null===t?0:S(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}w.prototype={get body(){return this[b].body},get bodyUsed(){return this[b].disturbed},arrayBuffer(){return v.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return v.call(this).then((function(t){return Object.assign(new p([],{type:e.toLowerCase()}),{[h]:t})}))},json(){var e=this;return v.call(this).then((function(t){try{return JSON.parse(t.toString())}catch(t){return w.Promise.reject(new m(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}}))},text(){return v.call(this).then((function(e){return e.toString()}))},buffer(){return v.call(this)},textConverted(){var e=this;return v.call(this).then((function(t){return function(e,t){if("function"!=typeof y)throw new Error("The package `encoding` must be installed to use the textConverted() function");const r=t.get("content-type");let o,n,s="utf-8";r&&(o=/charset=([^;]*)/i.exec(r));n=e.slice(0,1024).toString(),!o&&n&&(o=/<meta.+?charset=(['"])(.+?)\1/i.exec(n));!o&&n&&(o=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(n),o||(o=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(n),o&&o.pop()),o&&(o=/charset=(.*)/i.exec(o.pop())));!o&&n&&(o=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(n));o&&(s=o.pop(),"gb2312"!==s&&"gbk"!==s||(s="gb18030"));return y(e,"UTF-8",s).toString()}(t,e.headers)}))}},Object.defineProperties(w.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),w.mixIn=function(e){for(const t of Object.getOwnPropertyNames(w.prototype))if(!(t in e)){const r=Object.getOwnPropertyDescriptor(w.prototype,t);Object.defineProperty(e,t,r)}},w.Promise=global.Promise;const j=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,B=/[^\t\x20-\x7e\x80-\xff]/;function P(e){if(e=`${e}`,j.test(e)||""===e)throw new TypeError(`${e} is not a legal HTTP header name`)}function x(e){if(e=`${e}`,B.test(e))throw new TypeError(`${e} is not a legal HTTP header value`)}function U(e,t){t=t.toLowerCase();for(const r in e)if(r.toLowerCase()===t)return r}const L=Symbol("map");class A{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[L]=Object.create(null),e instanceof A){const t=e.raw(),r=Object.keys(t);for(const e of r)for(const r of t[e])this.append(e,r)}else if(null==e);else{if("object"!=typeof e)throw new TypeError("Provided initializer must be an object");{const t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw new TypeError("Header pairs must be iterable");const r=[];for(const t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Each header pair must be iterable");r.push(Array.from(t))}for(const e of r){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const t of Object.keys(e)){const r=e[t];this.append(t,r)}}}}get(e){P(e=`${e}`);const t=U(this[L],e);return void 0===t?null:this[L][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=$(this),o=0;for(;o<r.length;){var n=r[o];const s=n[0],i=n[1];e.call(t,i,s,this),r=$(this),o++}}set(e,t){t=`${t}`,P(e=`${e}`),x(t);const r=U(this[L],e);this[L][void 0!==r?r:e]=[t]}append(e,t){t=`${t}`,P(e=`${e}`),x(t);const r=U(this[L],e);void 0!==r?this[L][r].push(t):this[L][e]=[t]}has(e){return P(e=`${e}`),void 0!==U(this[L],e)}delete(e){P(e=`${e}`);const t=U(this[L],e);void 0!==t&&delete this[L][t]}raw(){return this[L]}keys(){return C(this,"key")}values(){return C(this,"value")}[Symbol.iterator](){return C(this,"key+value")}}function $(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key+value";return Object.keys(e[L]).sort().map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[L][t].join(", ")}:function(t){return[t.toLowerCase(),e[L][t].join(", ")]})}A.prototype.entries=A.prototype[Symbol.iterator],Object.defineProperty(A.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(A.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const _=Symbol("internal");function C(e,t){const r=Object.create(k);return r[_]={target:e,kind:t,index:0},r}const k=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==k)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[_];const t=e.target,r=e.kind,o=e.index,n=$(t,r);return o>=n.length?{value:void 0,done:!0}:(this[_].index=o+1,{value:n[o],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function z(e){const t=Object.assign({__proto__:null},e[L]),r=U(e[L],"Host");return void 0!==r&&(t[r]=t[r][0]),t}Object.defineProperty(k,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const F=Symbol("Response internals"),H=t.STATUS_CODES;class q{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};w.call(this,e,t);const r=t.status||200,o=new A(t.headers);if(null!=e&&!o.has("Content-Type")){const t=O(e);t&&o.append("Content-Type",t)}this[F]={url:t.url,status:r,statusText:t.statusText||H[r],headers:o,counter:t.counter}}get url(){return this[F].url||""}get status(){return this[F].status}get ok(){return this[F].status>=200&&this[F].status<300}get redirected(){return this[F].counter>0}get statusText(){return this[F].statusText}get headers(){return this[F].headers}clone(){return new q(T(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}w.mixIn(q.prototype),Object.defineProperties(q.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(q.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const N=Symbol("Request internals"),V=r.URL||o.URL,I=r.parse,M=r.format;function D(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(e)&&(e=new V(e).toString()),I(e)}const G="destroy"in e.Readable.prototype;function Z(e){return"object"==typeof e&&"object"==typeof e[N]}class K{constructor(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Z(e)?t=D(e.url):(t=e&&e.href?D(e.href):D(`${e}`),e={});let o=r.method||e.method||"GET";if(o=o.toUpperCase(),(null!=r.body||Z(e)&&null!==e.body)&&("GET"===o||"HEAD"===o))throw new TypeError("Request with GET/HEAD method cannot have body");let n=null!=r.body?r.body:Z(e)&&null!==e.body?T(e):null;w.call(this,n,{timeout:r.timeout||e.timeout||0,size:r.size||e.size||0});const s=new A(r.headers||e.headers||{});if(null!=n&&!s.has("Content-Type")){const e=O(n);e&&s.append("Content-Type",e)}let i=Z(e)?e.signal:null;if("signal"in r&&(i=r.signal),null!=i&&!function(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}(i))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[N]={method:o,redirect:r.redirect||e.redirect||"follow",headers:s,parsedURL:t,signal:i},this.follow=void 0!==r.follow?r.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==r.compress?r.compress:void 0===e.compress||e.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent}get method(){return this[N].method}get url(){return M(this[N].parsedURL)}get headers(){return this[N].headers}get redirect(){return this[N].redirect}get signal(){return this[N].signal}clone(){return new K(this)}}function Y(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}w.mixIn(K.prototype),Object.defineProperty(K.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(K.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),Y.prototype=Object.create(Error.prototype),Y.prototype.constructor=Y,Y.prototype.name="AbortError";const J=r.URL||o.URL,W=e.PassThrough;function Q(r,o){if(!Q.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return w.Promise=Q.Promise,new Q.Promise((function(n,a){const u=new K(r,o),c=function(t){const r=t[N].parsedURL,o=new A(t[N].headers);if(o.has("Accept")||o.set("Accept","*/*"),!r.protocol||!r.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(r.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(t.signal&&t.body instanceof e.Readable&&!G)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let n=null;if(null==t.body&&/^(POST|PUT)$/i.test(t.method)&&(n="0"),null!=t.body){const e=R(t);"number"==typeof e&&(n=String(e))}n&&o.set("Content-Length",n),o.has("User-Agent")||o.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),t.compress&&!o.has("Accept-Encoding")&&o.set("Accept-Encoding","gzip,deflate");let s=t.agent;return"function"==typeof s&&(s=s(r)),o.has("Connection")||s||o.set("Connection","close"),Object.assign({},r,{method:t.method,headers:z(o),agent:s})}(u),l=("https:"===c.protocol?s:t).request,f=u.signal;let h=null;const d=function(){let t=new Y("The user aborted a request.");a(t),u.body&&u.body instanceof e.Readable&&X(u.body,t),h&&h.body&&h.body.emit("error",t)};if(f&&f.aborted)return void d();const p=function(){d(),g()},y=l(c);let b;function g(){y.abort(),f&&f.removeEventListener("abort",p),clearTimeout(b)}f&&f.addEventListener("abort",p),u.timeout&&y.once("socket",(function(e){b=setTimeout((function(){a(new m(`network timeout at: ${u.url}`,"request-timeout")),g()}),u.timeout)})),y.on("error",(function(e){a(new m(`request to ${u.url} failed, reason: ${e.message}`,"system",e)),h&&h.body&&X(h.body,e),g()})),function(e,t){let r;e.on("socket",(function(e){r=e})),e.on("response",(function(e){const o=e.headers;"chunked"!==o["transfer-encoding"]||o["content-length"]||e.once("close",(function(e){if(r.listenerCount("data")>0&&!e){const e=new Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",t(e)}}))}))}(y,(function(e){f&&f.aborted||h&&h.body&&X(h.body,e)})),parseInt(process.version.substring(1))<14&&y.on("socket",(function(e){e.addListener("close",(function(t){const r=e.listenerCount("data")>0;if(h&&r&&!t&&(!f||!f.aborted)){const e=new Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",h.body.emit("error",e)}}))})),y.on("response",(function(e){clearTimeout(b);const t=function(e){const t=new A;for(const r of Object.keys(e))if(!j.test(r))if(Array.isArray(e[r]))for(const o of e[r])B.test(o)||(void 0===t[L][r]?t[L][r]=[o]:t[L][r].push(o));else B.test(e[r])||(t[L][r]=[e[r]]);return t}(e.headers);if(Q.isRedirect(e.statusCode)){const o=t.get("Location");let s=null;try{s=null===o?null:new J(o,u.url).toString()}catch(e){if("manual"!==u.redirect)return a(new m(`uri requested responds with an invalid redirect URL: ${o}`,"invalid-redirect")),void g()}switch(u.redirect){case"error":return a(new m(`uri requested responds with a redirect, redirect mode is set to error: ${u.url}`,"no-redirect")),void g();case"manual":if(null!==s)try{t.set("Location",s)}catch(e){a(e)}break;case"follow":if(null===s)break;if(u.counter>=u.follow)return a(new m(`maximum redirect reached at: ${u.url}`,"max-redirect")),void g();const o={headers:new A(u.headers),follow:u.follow,counter:u.counter+1,agent:u.agent,compress:u.compress,method:u.method,body:u.body,signal:u.signal,timeout:u.timeout,size:u.size};if(!function(e,t){const r=new J(t).hostname,o=new J(e).hostname;return r===o||"."===r[r.length-o.length-1]&&r.endsWith(o)}(u.url,s)||(r=u.url,new J(s).protocol!==new J(r).protocol))for(const e of["authorization","www-authenticate","cookie","cookie2"])o.headers.delete(e);return 303!==e.statusCode&&u.body&&null===R(u)?(a(new m("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void g()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==u.method)||(o.method="GET",o.body=void 0,o.headers.delete("content-length")),n(Q(new K(s,o))),void g())}}var r;e.once("end",(function(){f&&f.removeEventListener("abort",p)}));let o=e.pipe(new W);const s={url:u.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:u.size,timeout:u.timeout,counter:u.counter},c=t.get("Content-Encoding");if(!u.compress||"HEAD"===u.method||null===c||204===e.statusCode||304===e.statusCode)return h=new q(o,s),void n(h);const l={flush:i.Z_SYNC_FLUSH,finishFlush:i.Z_SYNC_FLUSH};if("gzip"==c||"x-gzip"==c)return o=o.pipe(i.createGunzip(l)),h=new q(o,s),void n(h);if("deflate"==c||"x-deflate"==c){const t=e.pipe(new W);return t.once("data",(function(e){o=8==(15&e[0])?o.pipe(i.createInflate()):o.pipe(i.createInflateRaw()),h=new q(o,s),n(h)})),void t.on("end",(function(){h||(h=new q(o,s),n(h))}))}if("br"==c&&"function"==typeof i.createBrotliDecompress)return o=o.pipe(i.createBrotliDecompress()),h=new q(o,s),void n(h);h=new q(o,s),n(h)})),function(e,t){const r=t.body;null===r?e.end():S(r)?r.stream().pipe(e):Buffer.isBuffer(r)?(e.write(r),e.end()):r.pipe(e)}(y,u)}))}function X(e,t){e.destroy?e.destroy(t):(e.emit("error",t),e.end())}Q.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},Q.Promise=global.Promise;var ee=a(Object.freeze({__proto__:null,default:Q,Headers:A,Request:K,Response:q,FetchError:m}));const te=new n("rlp/5.7.0");function re(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function oe(e,t,r){let o=0;for(let n=0;n<r;n++)o=256*o+e[t+n];return o}function ne(e){if(Array.isArray(e)){let t=[];if(e.forEach((function(e){t=t.concat(ne(e))})),t.length<=55)return t.unshift(192+t.length),t;const r=re(t.length);return r.unshift(247+r.length),r.concat(t)}l(e)||te.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call(c(e));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=re(t.length);return r.unshift(183+r.length),r.concat(t)}function se(e){return u(ne(e))}function ie(e,t,r,o){const s=[];for(;r<t+1+o;){const i=ae(e,r);s.push(i.result),(r+=i.consumed)>t+1+o&&te.throwError("child data too short",n.errors.BUFFER_OVERRUN,{})}return{consumed:1+o,result:s}}function ae(e,t){if(0===e.length&&te.throwError("data too short",n.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&te.throwError("data short segment too short",n.errors.BUFFER_OVERRUN,{});const o=oe(e,t+1,r);return t+1+r+o>e.length&&te.throwError("data long segment too short",n.errors.BUFFER_OVERRUN,{}),ie(e,t,t+1+r,r+o)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&te.throwError("data array too short",n.errors.BUFFER_OVERRUN,{}),ie(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&te.throwError("data array too short",n.errors.BUFFER_OVERRUN,{});const o=oe(e,t+1,r);t+1+r+o>e.length&&te.throwError("data array too short",n.errors.BUFFER_OVERRUN,{});return{consumed:1+r+o,result:u(e.slice(t+1+r,t+1+r+o))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&te.throwError("data too short",n.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:u(e.slice(t+1,t+1+r))}}return{consumed:1,result:u(e[t])}}function ue(e){const t=c(e),r=ae(t,0);return r.consumed!==t.length&&te.throwArgumentError("invalid rlp data","data",e),r.result}var ce=Object.freeze({__proto__:null,encode:se,decode:ue});export{ue as d,se as e,ce as i,ee as r};
|